@crystaldesign/diva-seller 24.15.0-beta.8 → 24.15.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/build/esm/index.js +694 -393
  2. package/build/types/seller/src/components/Articles/index.d.ts.map +1 -1
  3. package/build/types/seller/src/components/Basket/Step3Checkout.d.ts +5 -2
  4. package/build/types/seller/src/components/Basket/Step3Checkout.d.ts.map +1 -1
  5. package/build/types/seller/src/components/Basket/Step4Checkout.d.ts +10 -0
  6. package/build/types/seller/src/components/Basket/Step4Checkout.d.ts.map +1 -0
  7. package/build/types/seller/src/components/Basket/index.d.ts +1 -1
  8. package/build/types/seller/src/components/Basket/index.d.ts.map +1 -1
  9. package/build/types/seller/src/components/Basket/types.d.ts +1 -1
  10. package/build/types/seller/src/components/Basket/types.d.ts.map +1 -1
  11. package/build/types/seller/src/components/InfoWithProducts/NavBar/index.d.ts.map +1 -1
  12. package/build/types/seller/src/components/InfoWithProducts/ProductsOrArticles/index.d.ts +2 -1
  13. package/build/types/seller/src/components/InfoWithProducts/ProductsOrArticles/index.d.ts.map +1 -1
  14. package/build/types/seller/src/components/InfoWithProducts/index.d.ts.map +1 -1
  15. package/build/types/seller/src/components/InfoWithProducts/useModelInfoPage.d.ts.map +1 -1
  16. package/build/types/seller/src/components/ProductCreator/components/Priceedit.d.ts.map +1 -1
  17. package/build/types/seller/src/components/ProductCreator/tabs/BaseDataForm.d.ts.map +1 -1
  18. package/build/types/seller/src/components/ProductCreator/tabs/VariantTable/index.d.ts.map +1 -1
  19. package/build/types/seller/src/provider/hooks/useProduct.d.ts +8 -0
  20. package/build/types/seller/src/provider/hooks/useProduct.d.ts.map +1 -0
  21. package/build/types/seller/src/services/ApiHandler.d.ts.map +1 -1
  22. package/build/types/seller/src/types.d.ts +5 -5
  23. package/build/types/seller/src/types.d.ts.map +1 -1
  24. package/build/types/seller/src/ui/Basket/CheckOut/components/Step3Product.d.ts +11 -0
  25. package/build/types/seller/src/ui/Basket/CheckOut/components/Step3Product.d.ts.map +1 -0
  26. package/build/types/seller/src/ui/Basket/CheckOut/index.d.ts +5 -2
  27. package/build/types/seller/src/ui/Basket/CheckOut/index.d.ts.map +1 -1
  28. package/build/types/seller/src/ui/Basket/CheckOut/statusMenu.d.ts +1 -2
  29. package/build/types/seller/src/ui/Basket/CheckOut/statusMenu.d.ts.map +1 -1
  30. package/build/types/seller/src/ui/Basket/Header.d.ts +3 -2
  31. package/build/types/seller/src/ui/Basket/Header.d.ts.map +1 -1
  32. package/build/types/seller/src/ui/Basket/PriceOverView/Footer.d.ts +1 -1
  33. package/build/types/seller/src/ui/Basket/PriceOverView/Footer.d.ts.map +1 -1
  34. package/package.json +7 -5
  35. package/build/types/seller/src/ui/Basket/CheckOut/useProduct.d.ts +0 -32
  36. package/build/types/seller/src/ui/Basket/CheckOut/useProduct.d.ts.map +0 -1
@@ -17,7 +17,7 @@ import CardMedia from '@mui/material/CardMedia';
17
17
  import Typography$1 from '@mui/material/Typography';
18
18
  import createStyles from '@mui/styles/createStyles';
19
19
  import makeStyles from '@mui/styles/makeStyles';
20
- import { styled, Typography, Card as Card$1, CardActionArea as CardActionArea$1, CardMedia as CardMedia$1, Button as Button$1, TextField, ButtonGroup as ButtonGroup$1, Tooltip, Paper as Paper$1, FormControlLabel as FormControlLabel$1, Checkbox as Checkbox$1, IconButton as IconButton$1, Link, InputBase, Accordion, AccordionSummary, Tabs, Tab, AccordionDetails, Table as Table$1, TableBody as TableBody$1, TableRow as TableRow$1, TableCell as TableCell$1, CardHeader, CardContent, FormControl as FormControl$1, FormHelperText, TextareaAutosize, Box, Select as Select$1, MenuItem as MenuItem$1, ListItemButton, ListItemIcon } from '@mui/material';
20
+ import { styled, Typography, Card as Card$1, CardActionArea as CardActionArea$1, CardMedia as CardMedia$1, Button as Button$1, TextField, ButtonGroup as ButtonGroup$1, Tooltip, Stack, Paper as Paper$1, Skeleton, IconButton as IconButton$1, FormControlLabel as FormControlLabel$1, Checkbox as Checkbox$1, Divider as Divider$1, Alert, AlertTitle, Link, InputBase, Accordion, AccordionSummary, Tabs, Tab, AccordionDetails, Table as Table$1, TableBody as TableBody$1, TableRow as TableRow$1, TableCell as TableCell$1, CardHeader, CardContent, FormControl as FormControl$1, FormHelperText, TextareaAutosize, Box as Box$1, Select as Select$1, MenuItem as MenuItem$1, ListItemButton, ListItemIcon } from '@mui/material';
21
21
  import { Histogram, useFilterState, FilterComponent, AnalyticsComponent } from '@crystaldesign/analytics';
22
22
  import Button from '@mui/material/Button';
23
23
  import ButtonGroup from '@mui/material/ButtonGroup';
@@ -55,7 +55,12 @@ import TextField$1 from '@mui/material/TextField';
55
55
  import Select from '@mui/material/Select';
56
56
  import Input from '@mui/material/Input';
57
57
  import OrderEntry, { apiSaveRenderJobs, VariantSelector } from '@crystaldesign/order-entry';
58
- import CloseIcon from '@mui/icons-material/Close';
58
+ import _toArray from '@babel/runtime/helpers/toArray';
59
+ import Box from '@mui/material/Box';
60
+ import StarBorderIcon from '@mui/icons-material/StarBorder';
61
+ import EditIcon from '@mui/icons-material/Edit';
62
+ import Alert$1 from '@mui/material/Alert';
63
+ import AlertTitle$1 from '@mui/material/AlertTitle';
59
64
  import classnames from 'classnames';
60
65
  import { InfoRounded, Remove, Add, Delete } from '@mui/icons-material';
61
66
  import { Swiper, SwiperSlide } from 'swiper/react';
@@ -68,7 +73,7 @@ import 'swiper/css/free-mode';
68
73
  import 'swiper/css/mousewheel';
69
74
  import ExpandMore from '@mui/icons-material/ExpandMore';
70
75
  import ProductsComponent, { useProductState as useProductState$1 } from '@crystaldesign/products-component';
71
- import Alert from '@mui/lab/Alert';
76
+ import Alert$2 from '@mui/lab/Alert';
72
77
  import Tab$1 from '@mui/material/Tab';
73
78
  import Tabs$1 from '@mui/material/Tabs';
74
79
  import Autocomplete$1 from '@mui/material/Autocomplete';
@@ -91,7 +96,6 @@ import AssetEditor, { DivaFile } from '@crystaldesign/media-upload';
91
96
  import AddIcon$1 from '@mui/icons-material/NoteAdd';
92
97
  import DeleteIcon from '@mui/icons-material/Delete';
93
98
  import debounce from 'lodash/debounce';
94
- import Alert$1 from '@mui/material/Alert';
95
99
  import Settings from '@mui/icons-material/Settings';
96
100
 
97
101
  (function() {
@@ -654,8 +658,6 @@ function _apiLoadCatalogs() {
654
658
  // "Johann Jakob - CLASSICS"
655
659
  subCategory: data.RetailSubCategory ? data.RetailSubCategory : data.SubCategory ? data.SubCategory : undefined,
656
660
  retailArticleNr: data.RetailArticleNr ? data.RetailArticleNr : undefined,
657
- fileBaseUrl: data.BaseURL ? data.BaseURL : undefined,
658
- // "https://myCC3Retail.crystal-design.local/files"
659
661
  nArticles: data.Articles ? Number(data.Articles) : 0,
660
662
  // "236"
661
663
  nConfigurators: data.Configurators ? Number(data.Configurators) : 0,
@@ -3087,7 +3089,7 @@ var Wrapper = styled('div')({
3087
3089
  display: 'flex',
3088
3090
  justifyContent: 'space-between',
3089
3091
  alignItems: 'center',
3090
- margin: '10px 10px 0 10px',
3092
+ margin: '5px 5px 5px 5px',
3091
3093
  flexWrap: 'wrap',
3092
3094
  gap: '10px'
3093
3095
  });
@@ -3874,11 +3876,7 @@ function Articles(_ref) {
3874
3876
  component: "div",
3875
3877
  variant: "body1",
3876
3878
  color: "textSecondary",
3877
- children: DivaUtils$1.sizeFormatter({
3878
- width: row.values['width'],
3879
- depth: row.values['depth'],
3880
- height: row.values['height']
3881
- }, i18n)
3879
+ children: DivaUtils$1.sizeFormatter(row.values, i18n)
3882
3880
  })]
3883
3881
  }), /*#__PURE__*/jsx("div", {
3884
3882
  style: {
@@ -3951,6 +3949,30 @@ function Articles(_ref) {
3951
3949
  }, {
3952
3950
  label: t('articles.header.depth'),
3953
3951
  accessor: 'depth'
3952
+ }, {
3953
+ label: t('articles.header.width'),
3954
+ accessor: 'widthFrom',
3955
+ hidden: true
3956
+ }, {
3957
+ label: t('articles.header.height'),
3958
+ accessor: 'heightFrom',
3959
+ hidden: true
3960
+ }, {
3961
+ label: t('articles.header.depth'),
3962
+ accessor: 'depthFrom',
3963
+ hidden: true
3964
+ }, {
3965
+ label: t('articles.header.width'),
3966
+ accessor: 'widthTo',
3967
+ hidden: true
3968
+ }, {
3969
+ label: t('articles.header.height'),
3970
+ accessor: 'heightTo',
3971
+ hidden: true
3972
+ }, {
3973
+ label: t('articles.header.depth'),
3974
+ accessor: 'depthTo',
3975
+ hidden: true
3954
3976
  }],
3955
3977
  groupBy: ['groupName'],
3956
3978
  expanded: true,
@@ -3994,8 +4016,10 @@ function Header$1(_ref) {
3994
4016
  enableVKPExportButton = _ref.enableVKPExportButton;
3995
4017
  var _useTranslation = useTranslation(),
3996
4018
  t = _useTranslation.t;
4019
+ var _useDivaCore = useDivaCore(),
4020
+ organization = _useDivaCore.state.organization;
3997
4021
  var handleClick = function handleClick(event) {
3998
- if (event.currentTarget.name == 'Step1' || event.currentTarget.name == 'Step2' || event.currentTarget.name == 'Step3') {
4022
+ if (event.currentTarget.name == 'Step1' || event.currentTarget.name == 'Step2' || event.currentTarget.name == 'Step3' || event.currentTarget.name == 'Step4') {
3999
4023
  setActBasketPage(event.currentTarget.name);
4000
4024
  }
4001
4025
  };
@@ -4006,7 +4030,7 @@ function Header$1(_ref) {
4006
4030
  zIndex: 1
4007
4031
  },
4008
4032
  children: /*#__PURE__*/jsxs(Title, {
4009
- text: t('data.' + status) + ' - Nr. ' + divaNr + '-' + documentVersion,
4033
+ text: (actBasketPage === 'Step4' ? 'Marketing' : t('data.' + status)) + ' - Nr. ' + divaNr + '-' + documentVersion,
4010
4034
  children: [showVKPExportButton && /*#__PURE__*/jsx(Button, {
4011
4035
  color: 'primary',
4012
4036
  variant: 'contained',
@@ -4041,6 +4065,13 @@ function Header$1(_ref) {
4041
4065
  children: t('basket.navigation.checkoutNew', {
4042
4066
  step: (config === null || config === void 0 ? void 0 : config.clientData) != false ? 3 : 2
4043
4067
  })
4068
+ }), organization.settings.enableVKMarketing && /*#__PURE__*/jsx(Button, {
4069
+ name: "Step4",
4070
+ onClick: handleClick,
4071
+ variant: actBasketPage == 'Step4' ? 'contained' : 'outlined',
4072
+ children: t('basket.navigation.checkoutMarketing', {
4073
+ step: (config === null || config === void 0 ? void 0 : config.clientData) != false ? 4 : 3
4074
+ })
4044
4075
  })]
4045
4076
  })]
4046
4077
  })
@@ -4101,12 +4132,12 @@ function MenuListComposition(_ref) {
4101
4132
  }
4102
4133
  prevOpen.current = open;
4103
4134
  }, [open]);
4104
- return /*#__PURE__*/jsx("div", {
4135
+ return /*#__PURE__*/jsxs("div", {
4105
4136
  style: {
4106
4137
  "float": 'right',
4107
4138
  height: 'fit-content'
4108
4139
  },
4109
- children: /*#__PURE__*/jsxs(ButtonGroup, {
4140
+ children: [/*#__PURE__*/jsxs(ButtonGroup, {
4110
4141
  color: "primary",
4111
4142
  "aria-label": "outlined primary button group",
4112
4143
  children: [/*#__PURE__*/jsx(Button, {
@@ -4128,61 +4159,61 @@ function MenuListComposition(_ref) {
4128
4159
  "aria-haspopup": "true",
4129
4160
  onClick: handleToggle,
4130
4161
  children: t('basket.priceOverview.actions.addtionalActions')
4131
- }), /*#__PURE__*/jsx(Popper, {
4132
- style: {
4133
- zIndex: 1
4134
- },
4135
- open: open,
4136
- anchorEl: anchorRef.current,
4137
- role: undefined,
4138
- transition: true,
4139
- disablePortal: true,
4140
- children: function children(_ref2) {
4141
- var TransitionProps = _ref2.TransitionProps,
4142
- placement = _ref2.placement;
4143
- return /*#__PURE__*/jsx(Grow, _objectSpread$w(_objectSpread$w({}, TransitionProps), {}, {
4144
- style: {
4145
- transformOrigin: placement === 'bottom' ? 'right top' : 'right bottom'
4146
- },
4147
- children: /*#__PURE__*/jsx(Paper, {
4148
- children: /*#__PURE__*/jsx(ClickAwayListener, {
4149
- onClickAway: handleClose,
4150
- children: /*#__PURE__*/jsxs(MenuList, {
4151
- autoFocusItem: open,
4152
- id: "menu-list-grow",
4153
- onKeyDown: handleListKeyDown,
4154
- children: [/*#__PURE__*/jsx(MenuItem, {
4155
- style: {
4156
- display: !visibile ? 'block' : 'none'
4157
- },
4158
- onClick: function onClick(e) {
4159
- handleClose(e);
4160
- setVisibile(true);
4161
- },
4162
- children: t('basket.priceOverview.actions.showOrder')
4163
- }), /*#__PURE__*/jsx(MenuItem, {
4164
- style: {
4165
- display: visibile ? 'block' : 'none'
4166
- },
4167
- onClick: function onClick(e) {
4168
- handleClose(e);
4169
- setVisibile(false);
4170
- },
4171
- children: t('basket.priceOverview.actions.hideOrder')
4172
- }), /*#__PURE__*/jsx(MenuItem, {
4173
- onClick: function onClick(e) {
4174
- handleClose(e);
4175
- openInfo();
4176
- },
4177
- children: t('basket.priceOverview.actions.openInfo')
4178
- })]
4179
- })
4162
+ })]
4163
+ }), /*#__PURE__*/jsx(Popper, {
4164
+ sx: {
4165
+ zIndex: 1
4166
+ },
4167
+ open: open,
4168
+ anchorEl: anchorRef.current,
4169
+ role: undefined,
4170
+ transition: true,
4171
+ disablePortal: true,
4172
+ children: function children(_ref2) {
4173
+ var TransitionProps = _ref2.TransitionProps,
4174
+ placement = _ref2.placement;
4175
+ return /*#__PURE__*/jsx(Grow, _objectSpread$w(_objectSpread$w({}, TransitionProps), {}, {
4176
+ style: {
4177
+ transformOrigin: placement === 'bottom' ? 'right top' : 'right bottom'
4178
+ },
4179
+ children: /*#__PURE__*/jsx(Paper, {
4180
+ children: /*#__PURE__*/jsx(ClickAwayListener, {
4181
+ onClickAway: handleClose,
4182
+ children: /*#__PURE__*/jsxs(MenuList, {
4183
+ autoFocusItem: open,
4184
+ id: "menu-list-grow",
4185
+ onKeyDown: handleListKeyDown,
4186
+ children: [/*#__PURE__*/jsx(MenuItem, {
4187
+ style: {
4188
+ display: !visibile ? 'block' : 'none'
4189
+ },
4190
+ onClick: function onClick(e) {
4191
+ handleClose(e);
4192
+ setVisibile(true);
4193
+ },
4194
+ children: t('basket.priceOverview.actions.showOrder')
4195
+ }), /*#__PURE__*/jsx(MenuItem, {
4196
+ style: {
4197
+ display: visibile ? 'block' : 'none'
4198
+ },
4199
+ onClick: function onClick(e) {
4200
+ handleClose(e);
4201
+ setVisibile(false);
4202
+ },
4203
+ children: t('basket.priceOverview.actions.hideOrder')
4204
+ }), /*#__PURE__*/jsx(MenuItem, {
4205
+ onClick: function onClick(e) {
4206
+ handleClose(e);
4207
+ openInfo();
4208
+ },
4209
+ children: t('basket.priceOverview.actions.openInfo')
4210
+ })]
4180
4211
  })
4181
4212
  })
4182
- }));
4183
- }
4184
- })]
4185
- })
4213
+ })
4214
+ }));
4215
+ }
4216
+ })]
4186
4217
  });
4187
4218
  }
4188
4219
 
@@ -5319,8 +5350,7 @@ function Step2ClientData(_ref) {
5319
5350
  function StatusMenu(_ref) {
5320
5351
  var visibleStatus = _ref.visibleStatus,
5321
5352
  status = _ref.status,
5322
- setStatus = _ref.setStatus,
5323
- productSaved = _ref.productSaved;
5353
+ setStatus = _ref.setStatus;
5324
5354
  var handleClick = function handleClick(item) {
5325
5355
  setStatus(item);
5326
5356
  };
@@ -5345,7 +5375,6 @@ function StatusMenu(_ref) {
5345
5375
  onClick: function onClick() {
5346
5376
  return handleClick(item);
5347
5377
  },
5348
- disabled: productSaved && item !== 'BASE_CONFIGURATION',
5349
5378
  children: t('data.' + item, item)
5350
5379
  }, item);
5351
5380
  })
@@ -5744,88 +5773,6 @@ var HQ_RenderingTypeSource = [{
5744
5773
  RenderPipeline: 'vRayNext'
5745
5774
  }];
5746
5775
 
5747
- function ownKeys$s(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; }
5748
- function _objectSpread$s(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$s(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$s(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
5749
- function useProduct(basket) {
5750
- var _useState = useState(undefined),
5751
- _useState2 = _slicedToArray(_useState, 2),
5752
- currentProduct = _useState2[0],
5753
- setCurrentProduct = _useState2[1];
5754
- var _useDivaCore = useDivaCore(),
5755
- productHandler = _useDivaCore.handler.productHandler;
5756
- var loadProduct = /*#__PURE__*/function () {
5757
- var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
5758
- var _myProduct$baseData$p;
5759
- var myProduct;
5760
- return _regeneratorRuntime.wrap(function _callee$(_context) {
5761
- while (1) switch (_context.prev = _context.next) {
5762
- case 0:
5763
- _context.next = 2;
5764
- return productHandler.loadProducts({
5765
- basket: new BasketData(basket),
5766
- divaNr: basket.DivaNr
5767
- });
5768
- case 2:
5769
- myProduct = _context.sent;
5770
- setCurrentProduct(_objectSpread$s(_objectSpread$s({}, myProduct.baseData), {}, {
5771
- parent: (_myProduct$baseData$p = myProduct.baseData.parent) !== null && _myProduct$baseData$p !== void 0 ? _myProduct$baseData$p : myProduct.baseData._id
5772
- }));
5773
- return _context.abrupt("return", myProduct);
5774
- case 5:
5775
- case "end":
5776
- return _context.stop();
5777
- }
5778
- }, _callee);
5779
- }));
5780
- return function loadProduct() {
5781
- return _ref.apply(this, arguments);
5782
- };
5783
- }();
5784
- useEffect(function () {
5785
- loadProduct();
5786
- }, [basket]);
5787
- var saveProduct = /*#__PURE__*/function () {
5788
- var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(favourite) {
5789
- var _myproduct$0$parent;
5790
- var myproduct;
5791
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
5792
- while (1) switch (_context2.prev = _context2.next) {
5793
- case 0:
5794
- _context2.next = 2;
5795
- return productHandler.saveProducts({
5796
- products: [currentProduct]
5797
- });
5798
- case 2:
5799
- myproduct = _context2.sent;
5800
- setCurrentProduct(_objectSpread$s(_objectSpread$s({}, myproduct[0]), {}, {
5801
- parent: (_myproduct$0$parent = myproduct[0].parent) !== null && _myproduct$0$parent !== void 0 ? _myproduct$0$parent : myproduct[0]._id
5802
- }));
5803
- if (!favourite) {
5804
- _context2.next = 7;
5805
- break;
5806
- }
5807
- _context2.next = 7;
5808
- return productHandler.apiMarkAsFavorite(currentProduct._id, basket.OrganizationId);
5809
- case 7:
5810
- setCurrentProduct(currentProduct);
5811
- basket.DocumentVersion = basket.DocumentVersion + 1;
5812
- case 9:
5813
- case "end":
5814
- return _context2.stop();
5815
- }
5816
- }, _callee2);
5817
- }));
5818
- return function saveProduct(_x) {
5819
- return _ref2.apply(this, arguments);
5820
- };
5821
- }();
5822
- return {
5823
- currentProduct: currentProduct,
5824
- loadProduct: loadProduct,
5825
- saveProduct: saveProduct
5826
- };
5827
- }
5828
-
5829
5776
  function styleInject(css, ref) {
5830
5777
  if ( ref === void 0 ) ref = {};
5831
5778
  var insertAt = ref.insertAt;
@@ -5853,15 +5800,243 @@ function styleInject(css, ref) {
5853
5800
  }
5854
5801
  }
5855
5802
 
5856
- var paperContainer = "paperContainer-9grpT";
5857
- var hqMediaHeaderContainer = "hqMediaHeaderContainer-PlXdo";
5858
- var hqmediaContainer = "hqmediaContainer-sBjym";
5859
- var hqMediaTitle = "hqMediaTitle-ugda8";
5860
- var css_248z$a = ".paperContainer-9grpT {\n height: 68vh;\n margin-left: 50px;\n margin-right: 50px;\n margin-top: 10px;\n}\n\n.hqMediaHeaderContainer-PlXdo {\n display: flex;\n justify-content: space-between;\n padding-left: 15px;\n}\n\n.hqmediaContainer-sBjym {\n height: 90%;\n border: 1px solid rgb(224, 224, 224);\n}\n.hqMediaTitle-ugda8 {\n font-size: 20px;\n font-weight: normal;\n color: #333;\n padding: 10px 0;\n}\n";
5861
- styleInject(css_248z$a);
5803
+ var container$1 = "container-3kPdM";
5804
+ var mainStack = "mainStack-1xE4c";
5805
+ var productContainer = "productContainer-JcVn0";
5806
+ var productNameContainer = "productNameContainer-35ZZc";
5807
+ var productNameField = "productNameField-hPNbW";
5808
+ var productImage = "productImage-Vn0l-";
5809
+ var hidden$1 = "hidden-zZ8fS";
5810
+ var productDetailsContainer = "productDetailsContainer-5c-V9";
5811
+ var productDetailRow = "productDetailRow-9KtDG";
5812
+ var productDetailLabel = "productDetailLabel-t7Mn7";
5813
+ var favoriteContainer = "favoriteContainer-ka7lC";
5814
+ var favoriteCheckbox = "favoriteCheckbox-JYnH-";
5815
+ var actionButtonContainer = "actionButtonContainer-WfYfD";
5816
+ var productDetailsPaper = "productDetailsPaper-VsWfW";
5817
+ var productDetailText = "productDetailText-wkk6U";
5818
+ var productDetailSkeleton = "productDetailSkeleton-3-RLq";
5819
+ var productDetailDivider = "productDetailDivider-C1Cdh";
5820
+ var alertTitle = "alertTitle-Bm1NO";
5821
+ var css_248z$b = ".container-3kPdM {\n padding-bottom: 10px;\n margin-top: 2px;\n}\n\n.mainStack-1xE4c {\n width: 100%;\n margin-top: 16px;\n}\n\n.productContainer-JcVn0 {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n padding-bottom: 16px;\n width: 100%;\n}\n\n.productNameContainer-35ZZc {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n width: 100%;\n}\n\n.productNameField-hPNbW {\n margin: 8px;\n width: 70%;\n}\n\n.productImage-Vn0l- {\n width: 70%;\n display: block;\n}\n\n.productImage-Vn0l-.hidden-zZ8fS {\n display: none;\n}\n\n.productDetailsContainer-5c-V9 {\n margin: 20px;\n max-height: 100%;\n}\n\n.productDetailRow-9KtDG {\n display: flex;\n}\n\n.productDetailLabel-t7Mn7 {\n font-weight: 600;\n width: 40%;\n}\n\n.favoriteContainer-ka7lC {\n display: flex;\n align-items: center;\n margin-top: 16px;\n}\n.favoriteCheckbox-JYnH- {\n margin-left: 10px;\n}\n\n.actionButtonContainer-WfYfD {\n display: flex;\n gap: 16px;\n margin-top: 16px;\n justify-content: right;\n}\n@media (max-width: 768px) {\n .actionButtonContainer-WfYfD {\n display: flex;\n justify-content: space-between;\n }\n}\n\n.productDetailsPaper-VsWfW {\n width: 100%;\n max-height: 100%;\n overflow: auto;\n}\n\n.productDetailText-wkk6U {\n white-space: pre-wrap;\n}\n\n.productDetailSkeleton-3-RLq {\n margin-left: 30px;\n height: 28px;\n}\n\n.productDetailDivider-C1Cdh {\n margin-bottom: 16px;\n}\n\n.alertTitle-Bm1NO {\n font-weight: 600;\n}\n\n/* Responsive styles */\n@media (min-width: 900px) {\n .productDetailsPaper-VsWfW {\n width: 60%;\n }\n}\n";
5822
+ styleInject(css_248z$b);
5862
5823
 
5863
- function ownKeys$r(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; }
5864
- function _objectSpread$r(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$r(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$r(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
5824
+ function Step3Product(_ref) {
5825
+ var _currentProduct$techn;
5826
+ var currentProduct = _ref.currentProduct,
5827
+ startWithEmptyBasket = _ref.startWithEmptyBasket,
5828
+ handleSave = _ref.handleSave,
5829
+ updateProductData = _ref.updateProductData;
5830
+ var _useDivaCore = useDivaCore(),
5831
+ organization = _useDivaCore.state.organization;
5832
+ var _useTranslation = useTranslation(),
5833
+ t = _useTranslation.t;
5834
+ var _useState = useState(false),
5835
+ _useState2 = _slicedToArray(_useState, 2),
5836
+ imgIsLoaded = _useState2[0],
5837
+ setImgIsLoaded = _useState2[1];
5838
+ var _useState3 = useState(false),
5839
+ _useState4 = _slicedToArray(_useState3, 2),
5840
+ isFavorite = _useState4[0],
5841
+ setIsFavorite = _useState4[1];
5842
+ var dataIsReady = !!currentProduct;
5843
+ var _useState5 = useState(false),
5844
+ _useState6 = _slicedToArray(_useState5, 2),
5845
+ editProductName = _useState6[0],
5846
+ setEditProductName = _useState6[1];
5847
+ var handleEditProductName = function handleEditProductName() {
5848
+ setEditProductName(true);
5849
+ };
5850
+ var handleBlur = function handleBlur() {
5851
+ setEditProductName(false);
5852
+ };
5853
+ var handleChangeProductName = function handleChangeProductName(event) {
5854
+ currentProduct.shortDescription = event.target.value;
5855
+ updateProductData(currentProduct);
5856
+ };
5857
+ var handleFavoriteToggle = function handleFavoriteToggle() {
5858
+ setIsFavorite(!isFavorite);
5859
+ };
5860
+ return /*#__PURE__*/jsxs(Box, {
5861
+ className: container$1,
5862
+ children: [organization.settings.enableVKMarketing && /*#__PURE__*/jsx(InfoAlert$1, {
5863
+ type: "info",
5864
+ content: /*#__PURE__*/jsx(Fragment, {
5865
+ children: t('basket.checkout.step4.info')
5866
+ })
5867
+ }), /*#__PURE__*/jsxs(Stack, {
5868
+ direction: {
5869
+ xs: 'column',
5870
+ md: 'row'
5871
+ },
5872
+ spacing: 2,
5873
+ className: mainStack,
5874
+ children: [/*#__PURE__*/jsxs(Box, {
5875
+ sx: {
5876
+ width: {
5877
+ xs: '100%',
5878
+ md: '40%'
5879
+ }
5880
+ },
5881
+ children: [/*#__PURE__*/jsx(Paper$1, {
5882
+ variant: "outlined",
5883
+ children: /*#__PURE__*/jsxs("div", {
5884
+ className: productContainer,
5885
+ children: [/*#__PURE__*/jsxs("div", {
5886
+ className: productNameContainer,
5887
+ children: [editProductName ? /*#__PURE__*/jsx(TextField, {
5888
+ variant: "standard",
5889
+ value: currentProduct === null || currentProduct === void 0 ? void 0 : currentProduct.shortDescription,
5890
+ onChange: handleChangeProductName,
5891
+ onBlur: handleBlur,
5892
+ autoFocus: true,
5893
+ className: productNameField
5894
+ }) : dataIsReady ? /*#__PURE__*/jsx("h2", {
5895
+ children: currentProduct === null || currentProduct === void 0 ? void 0 : currentProduct.shortDescription
5896
+ }) : /*#__PURE__*/jsx(Skeleton, {
5897
+ animation: "wave",
5898
+ variant: "text",
5899
+ width: "50%",
5900
+ height: 50
5901
+ }), !editProductName && /*#__PURE__*/jsx(IconButton$1, {
5902
+ size: "small",
5903
+ onClick: handleEditProductName,
5904
+ children: /*#__PURE__*/jsx(EditIcon, {
5905
+ fontSize: "small"
5906
+ })
5907
+ })]
5908
+ }), /*#__PURE__*/jsx("img", {
5909
+ src: (currentProduct === null || currentProduct === void 0 ? void 0 : currentProduct.image) || (currentProduct === null || currentProduct === void 0 ? void 0 : currentProduct.image2D),
5910
+ className: "".concat(productImage, " ").concat(!imgIsLoaded ? hidden$1 : ''),
5911
+ alt: "Product",
5912
+ onLoad: function onLoad() {
5913
+ return setImgIsLoaded(true);
5914
+ }
5915
+ }), !imgIsLoaded && /*#__PURE__*/jsx(Skeleton, {
5916
+ animation: "wave",
5917
+ variant: "text",
5918
+ width: "75%",
5919
+ height: 300
5920
+ })]
5921
+ })
5922
+ }), /*#__PURE__*/jsx(Box, {
5923
+ className: favoriteContainer,
5924
+ children: /*#__PURE__*/jsx(InfoAlert$1, {
5925
+ type: "warning",
5926
+ icon: /*#__PURE__*/jsx(StarBorderIcon, {}),
5927
+ title: t('basket.checkout.step4.favorite'),
5928
+ content: /*#__PURE__*/jsxs(Fragment, {
5929
+ children: [/*#__PURE__*/jsx(Typography, {
5930
+ mb: 1,
5931
+ children: t('basket.checkout.step4.favoriteinfo')
5932
+ }), /*#__PURE__*/jsx(FormControlLabel$1, {
5933
+ disabled: !dataIsReady,
5934
+ control: /*#__PURE__*/jsx(Checkbox$1, {
5935
+ className: favoriteCheckbox,
5936
+ checked: isFavorite,
5937
+ onChange: handleFavoriteToggle
5938
+ }),
5939
+ label: t('basket.checkout.step4.savemsg')
5940
+ })]
5941
+ })
5942
+ })
5943
+ }), /*#__PURE__*/jsxs(Box, {
5944
+ className: actionButtonContainer,
5945
+ children: [/*#__PURE__*/jsx(Button$1, {
5946
+ variant: "contained",
5947
+ onClick: function onClick() {
5948
+ return handleSave(undefined, false, isFavorite);
5949
+ },
5950
+ disabled: !dataIsReady,
5951
+ children: t('basket.checkout.step4.saveproduct')
5952
+ }), /*#__PURE__*/jsx(Button$1, {
5953
+ onClick: startWithEmptyBasket,
5954
+ variant: "outlined",
5955
+ disabled: !dataIsReady,
5956
+ children: t('basket.checkout.step4.cancel')
5957
+ })]
5958
+ })]
5959
+ }), /*#__PURE__*/jsx(Paper$1, {
5960
+ variant: "outlined",
5961
+ className: productDetailsPaper,
5962
+ children: /*#__PURE__*/jsxs("div", {
5963
+ className: productDetailsContainer,
5964
+ children: [/*#__PURE__*/jsx("h2", {
5965
+ children: t('basket.checkout.step3.productdetails')
5966
+ }), !dataIsReady && /*#__PURE__*/jsx(Fragment, {
5967
+ children: _toConsumableArray(Array(13)).map(function (_, index) {
5968
+ return /*#__PURE__*/jsxs(Box, {
5969
+ className: productDetailRow,
5970
+ children: [/*#__PURE__*/jsx(Skeleton, {
5971
+ animation: "wave",
5972
+ variant: "text",
5973
+ width: "40%",
5974
+ className: productDetailSkeleton
5975
+ }), /*#__PURE__*/jsx(Skeleton, {
5976
+ animation: "wave",
5977
+ variant: "text",
5978
+ width: "60%",
5979
+ className: productDetailSkeleton
5980
+ }), index < 12 && /*#__PURE__*/jsx(Divider$1, {
5981
+ className: productDetailDivider
5982
+ })]
5983
+ }, index);
5984
+ })
5985
+ }), dataIsReady && (currentProduct === null || currentProduct === void 0 || (_currentProduct$techn = currentProduct.technicalDescription) === null || _currentProduct$techn === void 0 ? void 0 : _currentProduct$techn.split('\n').map(function (line, index) {
5986
+ var _currentProduct$techn2;
5987
+ var formattedLine = line.trim().endsWith(',') ? line.slice(0, -1) : line;
5988
+ var _formattedLine$split = formattedLine.split(':'),
5989
+ _formattedLine$split2 = _toArray(_formattedLine$split),
5990
+ firstPart = _formattedLine$split2[0],
5991
+ rest = _formattedLine$split2.slice(1);
5992
+ var formattedFirstPart = firstPart.trim();
5993
+ var formattedRest = rest.join(':').trim();
5994
+ return /*#__PURE__*/jsxs("div", {
5995
+ children: [/*#__PURE__*/jsx(Typography, {
5996
+ sx: {
5997
+ fontSize: {
5998
+ xs: '12px',
5999
+ md: '1rem'
6000
+ }
6001
+ },
6002
+ className: productDetailText,
6003
+ children: /*#__PURE__*/jsxs(Box, {
6004
+ className: productDetailRow,
6005
+ children: [/*#__PURE__*/jsxs("span", {
6006
+ className: productDetailLabel,
6007
+ children: [formattedFirstPart, ":"]
6008
+ }), /*#__PURE__*/jsx("span", {
6009
+ children: formattedRest
6010
+ })]
6011
+ })
6012
+ }), index < (currentProduct === null || currentProduct === void 0 || (_currentProduct$techn2 = currentProduct.technicalDescription) === null || _currentProduct$techn2 === void 0 ? void 0 : _currentProduct$techn2.split('\n').length) - 1 && /*#__PURE__*/jsx(Divider$1, {
6013
+ className: productDetailDivider
6014
+ })]
6015
+ }, index);
6016
+ }))]
6017
+ })
6018
+ })]
6019
+ })]
6020
+ });
6021
+ }
6022
+ function InfoAlert$1(_ref2) {
6023
+ var type = _ref2.type,
6024
+ content = _ref2.content,
6025
+ title = _ref2.title,
6026
+ icon = _ref2.icon;
6027
+ return /*#__PURE__*/jsxs(Alert, {
6028
+ variant: "outlined",
6029
+ severity: type,
6030
+ icon: icon,
6031
+ children: [title && /*#__PURE__*/jsx(AlertTitle, {
6032
+ className: alertTitle,
6033
+ children: title
6034
+ }), content]
6035
+ });
6036
+ }
6037
+
6038
+ function ownKeys$s(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; }
6039
+ function _objectSpread$s(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$s(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$s(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
5865
6040
  function CheckOut(_ref) {
5866
6041
  var _basket$Client;
5867
6042
  var schema = _ref.schema,
@@ -5875,6 +6050,9 @@ function CheckOut(_ref) {
5875
6050
  updateBasket = _ref.updateBasket,
5876
6051
  statusArray = _ref.statusArray,
5877
6052
  configSaveButtons = _ref.configSaveButtons,
6053
+ currentProduct = _ref.currentProduct,
6054
+ saveProduct = _ref.saveProduct,
6055
+ updateProductData = _ref.updateProductData,
5878
6056
  gdpr = _ref.gdpr;
5879
6057
  var _useState = useState(false),
5880
6058
  _useState2 = _slicedToArray(_useState, 2),
@@ -5882,16 +6060,8 @@ function CheckOut(_ref) {
5882
6060
  setIsSaving = _useState2[1];
5883
6061
  var _useState3 = useState(false),
5884
6062
  _useState4 = _slicedToArray(_useState3, 2),
5885
- isSaved = _useState4[0],
5886
- setIsSaved = _useState4[1];
5887
- var _useState5 = useState(false),
5888
- _useState6 = _slicedToArray(_useState5, 2),
5889
- showRenderJobs = _useState6[0],
5890
- setShowRenderJobs = _useState6[1];
5891
- var _useState7 = useState(false),
5892
- _useState8 = _slicedToArray(_useState7, 2),
5893
- basket3DExportChecked = _useState8[0],
5894
- setBasket3DExportChecked = _useState8[1];
6063
+ basket3DExportChecked = _useState4[0],
6064
+ setBasket3DExportChecked = _useState4[1];
5895
6065
  var _useTranslation = useTranslation(),
5896
6066
  t = _useTranslation.t;
5897
6067
  var _useSellerState = useSellerState(),
@@ -5901,117 +6071,41 @@ function CheckOut(_ref) {
5901
6071
  userHasPermission = _useDivaCore$actions.userHasPermission,
5902
6072
  toggleLoading = _useDivaCore$actions.toggleLoading,
5903
6073
  openModal = _useDivaCore$actions.openModal,
5904
- productHandler = _useDivaCore.handler.productHandler,
5905
6074
  _useDivaCore$state = _useDivaCore.state,
5906
6075
  apiConfig = _useDivaCore$state.apiConfig,
5907
6076
  jwt = _useDivaCore$state.jwt,
5908
6077
  organization = _useDivaCore$state.organization;
5909
- var _useProduct = useProduct(basket),
5910
- currentProduct = _useProduct.currentProduct,
5911
- loadProduct = _useProduct.loadProduct,
5912
- saveProduct = _useProduct.saveProduct;
5913
- useEffect(function () {
5914
- var fetchProduct = /*#__PURE__*/function () {
5915
- var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
5916
- return _regeneratorRuntime.wrap(function _callee$(_context) {
5917
- while (1) switch (_context.prev = _context.next) {
5918
- case 0:
5919
- if (!(status === 'BASE_CONFIGURATION' && !currentProduct)) {
5920
- _context.next = 3;
5921
- break;
5922
- }
5923
- _context.next = 3;
5924
- return loadProduct();
5925
- case 3:
5926
- case "end":
5927
- return _context.stop();
5928
- }
5929
- }, _callee);
5930
- }));
5931
- return function fetchProduct() {
5932
- return _ref2.apply(this, arguments);
5933
- };
5934
- }();
5935
- fetchProduct();
5936
- setShowRenderJobs(false);
5937
- }, [status]);
5938
- var saveProductAndShowHqMedia = /*#__PURE__*/function () {
5939
- var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
5940
- var myProduct;
6078
+ var handleSave = useCallback(/*#__PURE__*/function () {
6079
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(openPDF, sendMail, isFav) {
5941
6080
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
5942
6081
  while (1) switch (_context2.prev = _context2.next) {
5943
- case 0:
5944
- _context2.next = 2;
5945
- return loadProduct();
5946
- case 2:
5947
- myProduct = _context2.sent;
5948
- if (!(!myProduct || myProduct.isNew)) {
5949
- _context2.next = 11;
5950
- break;
5951
- }
5952
- toggleLoading('saveProduct');
5953
- _context2.next = 7;
5954
- return saveProduct();
5955
- case 7:
5956
- toggleLoading('saveProduct');
5957
- setShowRenderJobs(true);
5958
- _context2.next = 12;
5959
- break;
5960
- case 11:
5961
- setShowRenderJobs(true);
5962
- case 12:
5963
- case "end":
5964
- return _context2.stop();
5965
- }
5966
- }, _callee2);
5967
- }));
5968
- return function saveProductAndShowHqMedia() {
5969
- return _ref3.apply(this, arguments);
5970
- };
5971
- }();
5972
- var handleSave = useCallback(/*#__PURE__*/function () {
5973
- var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(openPDF, sendMail, favourite, hqMedia) {
5974
- return _regeneratorRuntime.wrap(function _callee4$(_context4) {
5975
- while (1) switch (_context4.prev = _context4.next) {
5976
6082
  case 0:
5977
6083
  if (!(status === 'BASE_CONFIGURATION')) {
5978
- _context4.next = 13;
5979
- break;
5980
- }
5981
- if (!hqMedia) {
5982
- _context4.next = 6;
6084
+ _context2.next = 7;
5983
6085
  break;
5984
6086
  }
5985
- _context4.next = 4;
5986
- return saveProductAndShowHqMedia();
5987
- case 4:
5988
- _context4.next = 11;
5989
- break;
5990
- case 6:
5991
6087
  toggleLoading('saveProduct');
5992
- _context4.next = 9;
5993
- return saveProduct(favourite);
5994
- case 9:
6088
+ _context2.next = 4;
6089
+ return saveProduct(isFav);
6090
+ case 4:
5995
6091
  toggleLoading('saveProduct');
5996
6092
  openModal({
5997
6093
  title: t('basket.checkout.productsavedtitle'),
5998
6094
  accept: true,
5999
6095
  text: t('basket.checkout.productsavedtext')
6000
6096
  });
6001
- case 11:
6002
- setIsSaved(true);
6003
- return _context4.abrupt("return");
6004
- case 13:
6097
+ return _context2.abrupt("return");
6098
+ case 7:
6005
6099
  if (!isSaving) {
6006
6100
  setIsSaving(true);
6007
6101
  onClickSave(openPDF, sendMail).then(/*#__PURE__*/function () {
6008
- var _ref5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(p) {
6102
+ var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(p) {
6009
6103
  var newRenderJob;
6010
- return _regeneratorRuntime.wrap(function _callee3$(_context3) {
6011
- while (1) switch (_context3.prev = _context3.next) {
6104
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
6105
+ while (1) switch (_context.prev = _context.next) {
6012
6106
  case 0:
6013
6107
  if (!basket3DExportChecked) {
6014
- _context3.next = 4;
6108
+ _context.next = 4;
6015
6109
  break;
6016
6110
  }
6017
6111
  newRenderJob = {
@@ -6021,7 +6115,7 @@ function CheckOut(_ref) {
6021
6115
  diva3DProject: basket.Diva3DProject ? atob(basket.Diva3DProject) : undefined,
6022
6116
  hQRenderScript: basket.OrderSets[0].HQRenderScript
6023
6117
  };
6024
- _context3.next = 4;
6118
+ _context.next = 4;
6025
6119
  return apiSaveRenderJobs({
6026
6120
  serviceUrl: apiConfig.mediaService,
6027
6121
  jobs: [newRenderJob],
@@ -6031,43 +6125,36 @@ function CheckOut(_ref) {
6031
6125
  setIsSaving(false);
6032
6126
  case 5:
6033
6127
  case "end":
6034
- return _context3.stop();
6128
+ return _context.stop();
6035
6129
  }
6036
- }, _callee3);
6130
+ }, _callee);
6037
6131
  }));
6038
- return function (_x5) {
6039
- return _ref5.apply(this, arguments);
6132
+ return function (_x4) {
6133
+ return _ref3.apply(this, arguments);
6040
6134
  };
6041
6135
  }())["catch"](function () {
6042
6136
  return setIsSaving(false);
6043
6137
  });
6044
6138
  }
6045
- case 14:
6139
+ case 8:
6046
6140
  case "end":
6047
- return _context4.stop();
6141
+ return _context2.stop();
6048
6142
  }
6049
- }, _callee4);
6143
+ }, _callee2);
6050
6144
  }));
6051
- return function (_x, _x2, _x3, _x4) {
6052
- return _ref4.apply(this, arguments);
6145
+ return function (_x, _x2, _x3) {
6146
+ return _ref2.apply(this, arguments);
6053
6147
  };
6054
6148
  }(), [isSaving, onClickSave, basket3DExportChecked]);
6055
- var onChangeForm = function onChangeForm(_ref6) {
6056
- var data = _ref6.data;
6149
+ var onChangeForm = function onChangeForm(_ref4) {
6150
+ var data = _ref4.data;
6057
6151
  for (var key in data) {
6058
6152
  basket[key] = data[key];
6059
6153
  }
6060
6154
  };
6061
- var onErrorHqMedia = function onErrorHqMedia(error) {
6062
- openModal({
6063
- title: t('Error'),
6064
- accept: true,
6065
- text: t('basket.checkout.errorhqmediatext')
6066
- });
6067
- };
6068
6155
 
6069
6156
  // for LEAFLET don't show printOptions, if there are any configured.
6070
- var finalSchema = _objectSpread$r(_objectSpread$r({}, uiSchema), {}, {
6157
+ var finalSchema = _objectSpread$s(_objectSpread$s({}, uiSchema), {}, {
6071
6158
  elements: _toConsumableArray(uiSchema.elements)
6072
6159
  });
6073
6160
  if (status == 'LEAFLET') {
@@ -6099,63 +6186,15 @@ function CheckOut(_ref) {
6099
6186
  }), /*#__PURE__*/jsx(StatusMenu, {
6100
6187
  visibleStatus: statusArray,
6101
6188
  status: status,
6102
- setStatus: setStatus,
6103
- productSaved: isSaved
6189
+ setStatus: setStatus
6104
6190
  })]
6105
6191
  }), /*#__PURE__*/jsxs("div", {
6106
- children: [showRenderJobs && /*#__PURE__*/jsxs(Paper$1, {
6107
- elevation: 4,
6108
- className: paperContainer,
6109
- children: [/*#__PURE__*/jsxs("div", {
6110
- className: hqMediaHeaderContainer,
6111
- children: [/*#__PURE__*/jsx("div", {
6112
- className: hqMediaTitle,
6113
- children: "HQ Medien"
6114
- }), /*#__PURE__*/jsx(Button$1, {
6115
- onClick: function onClick() {
6116
- return setShowRenderJobs(false);
6117
- },
6118
- children: /*#__PURE__*/jsx(CloseIcon, {})
6119
- })]
6120
- }), /*#__PURE__*/jsx("div", {
6121
- className: hqmediaContainer,
6122
- children: /*#__PURE__*/jsx(OrderEntry, {
6123
- variantData: [],
6124
- baseData: currentProduct,
6125
- basketData: basket,
6126
- onSave: function onSave() {
6127
- return productHandler.saveProducts({
6128
- products: [currentProduct]
6129
- }).then(function (r) {
6130
- return !!r.length;
6131
- });
6132
- },
6133
- saved: true,
6134
- onError: function onError() {
6135
- return onErrorHqMedia;
6136
- }
6137
- })
6138
- })]
6139
- }), status === 'BASE_CONFIGURATION' && !showRenderJobs && /*#__PURE__*/jsx(Fragment, {
6140
- children: /*#__PURE__*/jsxs("div", {
6141
- style: {
6142
- margin: '1rem',
6143
- marginLeft: '150px',
6144
- display: 'flex',
6145
- alignItems: 'center',
6146
- gap: 25
6147
- },
6148
- children: [/*#__PURE__*/jsx("img", {
6149
- src: currentProduct === null || currentProduct === void 0 ? void 0 : currentProduct.image,
6150
- height: 250
6151
- }), /*#__PURE__*/jsx("div", {
6152
- style: {
6153
- whiteSpace: 'pre-wrap'
6154
- },
6155
- children: currentProduct === null || currentProduct === void 0 ? void 0 : currentProduct.technicalDescription
6156
- })]
6157
- })
6158
- }), status !== 'BASE_CONFIGURATION' && !showRenderJobs && /*#__PURE__*/jsxs(Fragment, {
6192
+ children: [status === 'BASE_CONFIGURATION' && /*#__PURE__*/jsx(Step3Product, {
6193
+ startWithEmptyBasket: startWithEmptyBasket,
6194
+ currentProduct: currentProduct,
6195
+ handleSave: handleSave,
6196
+ updateProductData: updateProductData
6197
+ }), status !== 'BASE_CONFIGURATION' && /*#__PURE__*/jsxs(Fragment, {
6159
6198
  children: [/*#__PURE__*/jsx("div", {
6160
6199
  style: {
6161
6200
  margin: '1rem',
@@ -6172,7 +6211,7 @@ function CheckOut(_ref) {
6172
6211
  }), !!renderService && permissionAnyHqRenderBox && (catalogData === null || catalogData === void 0 ? void 0 : catalogData[0].has3D) && /*#__PURE__*/jsx(HqRenderBox, {
6173
6212
  basket: basket,
6174
6213
  config: renderService
6175
- }), (catalogData === null || catalogData === void 0 ? void 0 : catalogData[0].has3D) && (catalogData === null || catalogData === void 0 ? void 0 : catalogData[0].arReady) && organization.settings.enable3DExport && /*#__PURE__*/jsxs("div", {
6214
+ }), (catalogData === null || catalogData === void 0 ? void 0 : catalogData[0].has3D) && organization.settings.enable3DExport && /*#__PURE__*/jsxs("div", {
6176
6215
  style: {
6177
6216
  marginLeft: '50px',
6178
6217
  width: '700px'
@@ -6200,7 +6239,7 @@ function CheckOut(_ref) {
6200
6239
  })
6201
6240
  })]
6202
6241
  })]
6203
- }), !showRenderJobs && /*#__PURE__*/jsx(SaveButtonsGroup, {
6242
+ }), status !== 'BASE_CONFIGURATION' && /*#__PURE__*/jsx(SaveButtonsGroup, {
6204
6243
  orderEmpty: !basket.OrderSets || basket.OrderSets.length == 0 || gdpr && !isEmpty(basket === null || basket === void 0 ? void 0 : basket.Client) && !basket.Gdpr,
6205
6244
  onClickSave: handleSave,
6206
6245
  startWithEmptyBasket: startWithEmptyBasket,
@@ -6224,12 +6263,12 @@ function isEmpty(data) {
6224
6263
  });
6225
6264
  }
6226
6265
 
6227
- function ownKeys$q(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; }
6228
- function _objectSpread$q(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$q(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$q(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
6266
+ function ownKeys$r(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; }
6267
+ function _objectSpread$r(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$r(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$r(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
6229
6268
  var schema = function schema(hideWWSButton) {
6230
6269
  return {
6231
6270
  type: 'object',
6232
- properties: _objectSpread$q(_objectSpread$q({
6271
+ properties: _objectSpread$r(_objectSpread$r({
6233
6272
  Salesperson: {
6234
6273
  type: 'string',
6235
6274
  title: 'basket.checkout.form.seller'
@@ -6464,7 +6503,10 @@ function Step3Checkout(_ref) {
6464
6503
  status = _ref.status,
6465
6504
  setStatus = _ref.setStatus,
6466
6505
  statusArray = _ref.statusArray,
6467
- config = _ref.config;
6506
+ config = _ref.config,
6507
+ currentProduct = _ref.currentProduct,
6508
+ saveProduct = _ref.saveProduct,
6509
+ updateProductData = _ref.updateProductData;
6468
6510
  var _useDivaCore = useDivaCore(),
6469
6511
  organization = _useDivaCore.state.organization;
6470
6512
  return /*#__PURE__*/jsx(CheckOut, {
@@ -6479,19 +6521,225 @@ function Step3Checkout(_ref) {
6479
6521
  updateBasket: updateBasket,
6480
6522
  renderService: config === null || config === void 0 || (_config$checkout3 = config.checkout) === null || _config$checkout3 === void 0 ? void 0 : _config$checkout3.renderService,
6481
6523
  configSaveButtons: (config === null || config === void 0 || (_config$checkout4 = config.checkout) === null || _config$checkout4 === void 0 ? void 0 : _config$checkout4.saveButtons) || ['SAVE', 'SAVE_AND_OPEN', 'SAVE_AND_SEND', 'NEW'],
6482
- gdpr: config === null || config === void 0 || (_config$checkout5 = config.checkout) === null || _config$checkout5 === void 0 ? void 0 : _config$checkout5.checkGdpr
6524
+ gdpr: config === null || config === void 0 || (_config$checkout5 = config.checkout) === null || _config$checkout5 === void 0 ? void 0 : _config$checkout5.checkGdpr,
6525
+ currentProduct: currentProduct,
6526
+ saveProduct: saveProduct,
6527
+ updateProductData: updateProductData
6483
6528
  });
6484
6529
  }
6485
6530
 
6531
+ var infocontainer = "infocontainer-ir9gv";
6532
+ var css_248z$a = ".infocontainer-ir9gv {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n";
6533
+ styleInject(css_248z$a);
6534
+
6535
+ function Step4Checkout(_ref) {
6536
+ var currentProduct = _ref.currentProduct,
6537
+ basket = _ref.basket,
6538
+ productSaved = _ref.productSaved,
6539
+ is3dReady = _ref.is3dReady;
6540
+ var _useTranslation = useTranslation(),
6541
+ t = _useTranslation.t;
6542
+ var _useDivaCore = useDivaCore(),
6543
+ openModal = _useDivaCore.actions.openModal,
6544
+ productHandler = _useDivaCore.handler.productHandler;
6545
+ var onErrorHqMedia = function onErrorHqMedia(error) {
6546
+ openModal({
6547
+ title: t('Error'),
6548
+ accept: true,
6549
+ text: t('basket.checkout.errorhqmediatext')
6550
+ });
6551
+ };
6552
+ if (!is3dReady) {
6553
+ return /*#__PURE__*/jsx("div", {
6554
+ className: infocontainer,
6555
+ children: /*#__PURE__*/jsx(InfoAlert, {
6556
+ title: t('basket.checkout.step4.errortitle'),
6557
+ content: /*#__PURE__*/jsx(Fragment, {
6558
+ children: t('basket.checkout.step4.error3d')
6559
+ })
6560
+ })
6561
+ });
6562
+ }
6563
+ if (!productSaved) {
6564
+ return /*#__PURE__*/jsx("div", {
6565
+ className: infocontainer,
6566
+ children: /*#__PURE__*/jsx(InfoAlert, {
6567
+ title: t('basket.checkout.step4.errortitle'),
6568
+ content: /*#__PURE__*/jsx(Fragment, {
6569
+ children: t('basket.checkout.step4.productNotSaved')
6570
+ })
6571
+ })
6572
+ });
6573
+ }
6574
+ return /*#__PURE__*/jsxs(Box, {
6575
+ sx: {
6576
+ display: 'flex',
6577
+ flexDirection: 'column',
6578
+ gap: 2,
6579
+ height: '100%'
6580
+ },
6581
+ children: [/*#__PURE__*/jsx(InfoAlert, {
6582
+ content: /*#__PURE__*/jsxs(Fragment, {
6583
+ children: [t('basket.checkout.step4.hqmediainfo'), ":", ' ', /*#__PURE__*/jsx("a", {
6584
+ href: "https://www.diva-portal.de/digitalisierungs-service",
6585
+ target: "_blank",
6586
+ children: "www.diva-portal.de/digitalisierungs-service"
6587
+ })]
6588
+ })
6589
+ }), /*#__PURE__*/jsx(OrderEntry, {
6590
+ variantData: [],
6591
+ baseData: currentProduct,
6592
+ basketData: basket,
6593
+ onSave: function onSave() {
6594
+ return productHandler.saveProducts({
6595
+ products: [currentProduct]
6596
+ }).then(function (r) {
6597
+ return !!r.length;
6598
+ });
6599
+ },
6600
+ saved: true,
6601
+ onError: function onError() {
6602
+ return onErrorHqMedia;
6603
+ }
6604
+ })]
6605
+ });
6606
+ }
6607
+ function InfoAlert(_ref2) {
6608
+ var title = _ref2.title,
6609
+ content = _ref2.content;
6610
+ return /*#__PURE__*/jsxs(Alert$1, {
6611
+ variant: "outlined",
6612
+ severity: "info",
6613
+ children: [title && /*#__PURE__*/jsx(AlertTitle$1, {
6614
+ children: title
6615
+ }), content]
6616
+ });
6617
+ }
6618
+
6619
+ function ownKeys$q(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; }
6620
+ function _objectSpread$q(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$q(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$q(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
6621
+ function useProduct(basket) {
6622
+ var _useState = useState(false),
6623
+ _useState2 = _slicedToArray(_useState, 2),
6624
+ productSaved = _useState2[0],
6625
+ setProductSaved = _useState2[1];
6626
+ var _useState3 = useState(),
6627
+ _useState4 = _slicedToArray(_useState3, 2),
6628
+ currentProduct = _useState4[0],
6629
+ setCurrentProduct = _useState4[1];
6630
+ var _useDivaCore = useDivaCore(),
6631
+ productHandler = _useDivaCore.handler.productHandler;
6632
+ useEffect(function () {
6633
+ var fetchProduct = /*#__PURE__*/function () {
6634
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
6635
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
6636
+ while (1) switch (_context.prev = _context.next) {
6637
+ case 0:
6638
+ if (!((basket === null || basket === void 0 ? void 0 : basket.Status) === 'BASE_CONFIGURATION' && !currentProduct)) {
6639
+ _context.next = 3;
6640
+ break;
6641
+ }
6642
+ _context.next = 3;
6643
+ return loadProduct(basket);
6644
+ case 3:
6645
+ case "end":
6646
+ return _context.stop();
6647
+ }
6648
+ }, _callee);
6649
+ }));
6650
+ return function fetchProduct() {
6651
+ return _ref.apply(this, arguments);
6652
+ };
6653
+ }();
6654
+ fetchProduct();
6655
+ }, [basket === null || basket === void 0 ? void 0 : basket.Status]);
6656
+ var loadProduct = /*#__PURE__*/function () {
6657
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(basket) {
6658
+ var _myProduct$baseData$p;
6659
+ var myProduct;
6660
+ return _regeneratorRuntime.wrap(function _callee2$(_context2) {
6661
+ while (1) switch (_context2.prev = _context2.next) {
6662
+ case 0:
6663
+ _context2.next = 2;
6664
+ return productHandler.loadProducts({
6665
+ basket: new BasketData(basket),
6666
+ productData: currentProduct ? [currentProduct] : undefined,
6667
+ getUniqueNewDivaNr: true
6668
+ });
6669
+ case 2:
6670
+ myProduct = _context2.sent;
6671
+ setCurrentProduct(_objectSpread$q(_objectSpread$q({}, myProduct.baseData), {}, {
6672
+ parent: (_myProduct$baseData$p = myProduct.baseData.parent) !== null && _myProduct$baseData$p !== void 0 ? _myProduct$baseData$p : myProduct.baseData._id
6673
+ }));
6674
+ case 4:
6675
+ case "end":
6676
+ return _context2.stop();
6677
+ }
6678
+ }, _callee2);
6679
+ }));
6680
+ return function loadProduct(_x) {
6681
+ return _ref2.apply(this, arguments);
6682
+ };
6683
+ }();
6684
+ var saveProduct = /*#__PURE__*/function () {
6685
+ var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(favourite) {
6686
+ var _myproduct$0$parent;
6687
+ var myproduct;
6688
+ return _regeneratorRuntime.wrap(function _callee3$(_context3) {
6689
+ while (1) switch (_context3.prev = _context3.next) {
6690
+ case 0:
6691
+ if (currentProduct) {
6692
+ _context3.next = 2;
6693
+ break;
6694
+ }
6695
+ return _context3.abrupt("return");
6696
+ case 2:
6697
+ _context3.next = 4;
6698
+ return productHandler.saveProducts({
6699
+ products: [currentProduct]
6700
+ });
6701
+ case 4:
6702
+ myproduct = _context3.sent;
6703
+ setCurrentProduct(_objectSpread$q(_objectSpread$q({}, myproduct[0]), {}, {
6704
+ parent: (_myproduct$0$parent = myproduct[0].parent) !== null && _myproduct$0$parent !== void 0 ? _myproduct$0$parent : myproduct[0]._id
6705
+ }));
6706
+ if (!favourite) {
6707
+ _context3.next = 9;
6708
+ break;
6709
+ }
6710
+ _context3.next = 9;
6711
+ return productHandler.apiMarkAsFavorite(currentProduct._id, currentProduct.organizationId);
6712
+ case 9:
6713
+ setProductSaved(true);
6714
+ case 10:
6715
+ case "end":
6716
+ return _context3.stop();
6717
+ }
6718
+ }, _callee3);
6719
+ }));
6720
+ return function saveProduct(_x2) {
6721
+ return _ref3.apply(this, arguments);
6722
+ };
6723
+ }();
6724
+ var updateProductData = function updateProductData(product) {
6725
+ setCurrentProduct(_objectSpread$q({}, product));
6726
+ };
6727
+ return {
6728
+ currentProduct: currentProduct,
6729
+ saveProduct: saveProduct,
6730
+ productSaved: productSaved,
6731
+ updateProductData: updateProductData
6732
+ };
6733
+ }
6734
+
6486
6735
  function ownKeys$p(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; }
6487
6736
  function _objectSpread$p(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$p(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$p(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
6488
6737
  var LOG$4 = getLogger('SellerBasket', 'Basket');
6489
6738
  function Basket(_ref) {
6490
- var _configurationData$Ch5;
6739
+ var _currentProduct$divaN, _configurationData$Ch5, _currentBasket$OrderS5;
6491
6740
  var divaNr = _ref.divaNr,
6492
6741
  basket = _ref.basket,
6493
6742
  checkBasket = _ref.checkBasket;
6494
- //Hooks
6495
6743
  var _useState = useState('Step1'),
6496
6744
  _useState2 = _slicedToArray(_useState, 2),
6497
6745
  actBasketPage = _useState2[0],
@@ -6525,6 +6773,11 @@ function Basket(_ref) {
6525
6773
  openModal = _useSellerState$actio.openModal,
6526
6774
  sendEmail = _useSellerState$actio.sendEmail,
6527
6775
  resetBasketState = _useSellerState$actio.resetBasketState;
6776
+ var _useProduct = useProduct(currentBasketState === null || currentBasketState === void 0 ? void 0 : currentBasketState.basket),
6777
+ currentProduct = _useProduct.currentProduct,
6778
+ saveProduct = _useProduct.saveProduct,
6779
+ productSaved = _useProduct.productSaved,
6780
+ updateProductData = _useProduct.updateProductData;
6528
6781
  var statusRef = useRef(basket !== null && basket !== void 0 && basket.StatusKey ? basket === null || basket === void 0 ? void 0 : basket.StatusKey : basket !== null && basket !== void 0 && basket.Status ? basket === null || basket === void 0 ? void 0 : basket.Status : '');
6529
6782
  useEffect(function () {
6530
6783
  if (!basket) DivaUtils$1.businessMetrics.setConfiguratorSessionId();
@@ -6701,6 +6954,7 @@ function Basket(_ref) {
6701
6954
  message: t('basket.checkout.pdfqr'),
6702
6955
  type: 'big',
6703
6956
  clickable: true,
6957
+ qrCodeSize: 312,
6704
6958
  autoHideDuration: (_configurationData$Ch3 = configurationData === null || configurationData === void 0 || (_configurationData$Ch4 = configurationData.Checkout) === null || _configurationData$Ch4 === void 0 ? void 0 : _configurationData$Ch4.pdfQRAutoHideDuration) !== null && _configurationData$Ch3 !== void 0 ? _configurationData$Ch3 : 1000 * 60 * 2
6705
6959
  });
6706
6960
  }
@@ -6866,9 +7120,9 @@ function Basket(_ref) {
6866
7120
  },
6867
7121
  children: [/*#__PURE__*/jsx(Header$1, {
6868
7122
  config: configurationData === null || configurationData === void 0 ? void 0 : configurationData.Checkout,
6869
- status: statusRef.current,
7123
+ status: currentBasket.Status,
6870
7124
  documentVersion: currentBasket.getDocumentVersion(),
6871
- divaNr: currentBasket.DivaNr,
7125
+ divaNr: currentBasket.Status == 'BASE_CONFIGURATION' && currentProduct ? (_currentProduct$divaN = currentProduct.divaNr) !== null && _currentProduct$divaN !== void 0 ? _currentProduct$divaN : '' : currentBasket.DivaNr,
6872
7126
  actBasketPage: actBasketPage,
6873
7127
  setActBasketPage: setActBasketPage,
6874
7128
  showVKPExportButton: !!(vkpExportData !== null && vkpExportData !== void 0 && vkpExportData.callbackurl) || !!(configurationData !== null && configurationData !== void 0 && configurationData.VKPExportUrl),
@@ -6907,7 +7161,18 @@ function Basket(_ref) {
6907
7161
  onClickSave: onClickSave,
6908
7162
  statusArray: getBasketStatusArr(),
6909
7163
  updateBasket: update,
6910
- currentUser: currentUser
7164
+ currentUser: currentUser,
7165
+ currentProduct: currentProduct,
7166
+ saveProduct: saveProduct,
7167
+ updateProductData: updateProductData
7168
+ }), actBasketPage == 'Step4' && organization.settings.enableVKMarketing && /*#__PURE__*/jsx(Step4Checkout, {
7169
+ config: configurationData === null || configurationData === void 0 ? void 0 : configurationData.Checkout,
7170
+ basket: currentBasket,
7171
+ setActBasketPage: setActBasketPage,
7172
+ startWithEmptyBasket: startWithEmptyBasket,
7173
+ currentProduct: currentProduct,
7174
+ productSaved: productSaved,
7175
+ is3dReady: currentBasket !== null && currentBasket !== void 0 && (_currentBasket$OrderS5 = currentBasket.OrderSets[0]) !== null && _currentBasket$OrderS5 !== void 0 && _currentBasket$OrderS5.HQRenderScript ? true : false
6911
7176
  })]
6912
7177
  })]
6913
7178
  });
@@ -6920,7 +7185,7 @@ var modelTitle = "model-title-Sgm-0";
6920
7185
  var description = "description-GyPZq";
6921
7186
  var pdf = "pdf-oNnao";
6922
7187
  var hidden = "hidden-xYPOr";
6923
- var css_248z$9 = ".wrapper-fSL18 {\n display: flex;\n flex-direction: column;\n padding: 0 12px;\n height: 100%;\n}\n\n.title-iTDPA {\n padding: 16px 8px;\n font-size: 36px;\n}\n\n.title-iTDPA .MuiButtonBase-root {\n display: none;\n}\n\n.subTitle-4-0PW {\n padding: 12px 18px;\n font-size: 28px;\n}\n\n.description-container-k1vLT {\n display: flex;\n flex-direction: column;\n background-color: #f2f2f2;\n padding: 18px;\n gap: 12px;\n height: 100%;\n}\n\n.model-title-Sgm-0 {\n font-size: 24px;\n font-weight: 600;\n}\n.description-GyPZq {\n font-size: 16px;\n overflow: auto;\n flex-grow: 3;\n}\n\n.pdf-oNnao {\n display: 'flex';\n flex: 1 1 10px;\n}\n\n.pdf-oNnao svg {\n margin-right: 10px;\n}\n\n@media (max-width: 820px) {\n .wrapper-fSL18 {\n height: 75px;\n }\n .description-container-k1vLT {\n position: fixed;\n top: 22px;\n width: 80%;\n z-index: 101;\n box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);\n box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);\n margin-top: 135px;\n margin-left: -10px;\n transition: width 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;\n }\n .title-iTDPA .MuiButtonBase-root {\n display: inline-flex;\n }\n .hidden-xYPOr .description-container-k1vLT {\n padding: 0;\n width: 0;\n }\n\n .hidden-xYPOr .model-title-Sgm-0 {\n display: none;\n }\n\n .hidden-xYPOr .description-GyPZq {\n display: none;\n }\n}\n";
7188
+ var css_248z$9 = ".wrapper-fSL18 {\n display: flex;\n flex-direction: column;\n padding: 0 12px;\n height: 100%;\n}\n\n.title-iTDPA {\n padding: 16px 8px;\n font-size: 36px;\n}\n\n.title-iTDPA .MuiButtonBase-root {\n display: none;\n}\n\n.subTitle-4-0PW {\n padding: 12px 18px;\n font-size: 28px;\n}\n\n.description-container-k1vLT {\n display: flex;\n flex-direction: column;\n background-color: #f2f2f2;\n padding: 18px;\n gap: 12px;\n height: 100%;\n overflow: auto;\n}\n\n.model-title-Sgm-0 {\n font-size: 24px;\n font-weight: 600;\n}\n.description-GyPZq {\n font-size: 16px;\n overflow: auto;\n flex-grow: 3;\n scrollbar-width: thin;\n}\n\n.pdf-oNnao {\n display: 'flex';\n flex: 1 1 10px;\n}\n\n.pdf-oNnao svg {\n margin-right: 10px;\n}\n\n@media (max-width: 820px) {\n .wrapper-fSL18 {\n height: 75px;\n }\n .description-container-k1vLT {\n position: fixed;\n top: 22px;\n width: 80%;\n z-index: 101;\n box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);\n box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);\n margin-top: 135px;\n margin-left: -10px;\n transition: width 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;\n height: calc(100% - 195px);\n }\n .title-iTDPA .MuiButtonBase-root {\n display: inline-flex;\n }\n .hidden-xYPOr .description-container-k1vLT {\n padding: 0;\n width: 0;\n }\n\n .hidden-xYPOr .pdf-oNnao {\n display: none;\n }\n\n .hidden-xYPOr .model-title-Sgm-0 {\n display: none;\n }\n\n .hidden-xYPOr .description-GyPZq {\n display: none;\n }\n}\n";
6924
7189
  styleInject(css_248z$9);
6925
7190
 
6926
7191
  var _excluded$6 = ["data", "text"];
@@ -6975,8 +7240,9 @@ function Description$1 (_ref) {
6975
7240
  }
6976
7241
 
6977
7242
  var container = "container-Sr3pC";
7243
+ var iconOnly = "icon-only-2SJ6e";
6978
7244
  var icon$1 = "icon-0h-39";
6979
- var css_248z$8 = ".container-Sr3pC {\n display: flex;\n gap: 12px;\n justify-content: flex-end;\n padding: 8px;\n flex-wrap: wrap;\n}\n.container-Sr3pC .MuiButton-root {\n height: 45px;\n}\n\n.icon-0h-39 {\n width: 24px;\n height: 24px;\n}\n";
7245
+ var css_248z$8 = ".container-Sr3pC {\n display: flex;\n gap: 12px;\n justify-content: flex-end;\n padding: 8px;\n flex-wrap: wrap;\n}\n.container-Sr3pC .MuiButton-root {\n height: 45px;\n}\n\n.icon-only-2SJ6e span {\n margin-right: 2px;\n}\n\n.icon-0h-39 {\n width: 24px;\n height: 24px;\n}\n";
6980
7246
  styleInject(css_248z$8);
6981
7247
 
6982
7248
  function ownKeys$n(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; }
@@ -7049,6 +7315,7 @@ function NavBar (buttons) {
7049
7315
  return /*#__PURE__*/jsxs("div", {
7050
7316
  className: container,
7051
7317
  children: [/*#__PURE__*/jsx(Button, {
7318
+ className: iconOnly,
7052
7319
  variant: "outlined",
7053
7320
  color: "primary",
7054
7321
  startIcon: /*#__PURE__*/jsx(NavBackSvg, {
@@ -7100,7 +7367,7 @@ var leftSide = "left-side-10jmj";
7100
7367
  var rightSide$1 = "right-side-64-Yz";
7101
7368
  var catalogImages = "catalog-images-jJGqW";
7102
7369
  var footer = "footer-1ONIt";
7103
- var css_248z$7 = ".layout-NhUpB {\n display: flex;\n height: 100%;\n flex-direction: column;\n}\n\n.content-t8Rtl {\n display: flex;\n flex: 1;\n overflow: auto;\n}\n\n.left-side-10jmj {\n width: 25%;\n min-width: 300px;\n}\n\n.right-side-64-Yz {\n display: flex;\n flex-direction: column;\n position: relative;\n flex: 1;\n overflow: auto;\n}\n\n.catalog-images-jJGqW {\n flex: 1;\n padding: 12px;\n}\n\n.footer-1ONIt {\n display: flex;\n justify-content: flex-end;\n}\n\n@media (max-width: 820px) {\n .content-t8Rtl {\n flex-direction: column;\n }\n}\n";
7370
+ var css_248z$7 = ".layout-NhUpB {\n display: flex;\n height: 100%;\n flex-direction: column;\n}\n\n.content-t8Rtl {\n display: flex;\n flex: 1;\n overflow: auto;\n}\n\n.left-side-10jmj {\n width: 25%;\n min-width: 300px;\n}\n\n.right-side-64-Yz {\n display: flex;\n flex-direction: column;\n position: relative;\n flex: 1;\n overflow: auto;\n justify-content: flex-end;\n}\n\n.catalog-images-jJGqW {\n flex: 1;\n padding: 12px;\n}\n\n.footer-1ONIt {\n display: flex;\n justify-content: flex-end;\n}\n\n@media (max-width: 820px) {\n .content-t8Rtl {\n flex-direction: column;\n }\n}\n";
7104
7371
  styleInject(css_248z$7);
7105
7372
 
7106
7373
  var wrapper$5 = "wrapper-D5Cmc";
@@ -7192,9 +7459,10 @@ var CatalogImages = function CatalogImages(_ref) {
7192
7459
  };
7193
7460
 
7194
7461
  var wrapper$4 = "wrapper-3d2zl";
7462
+ var fullHeight = "full-height-CQ8Cy";
7195
7463
  var tabBar = "tab-bar-lQQ28";
7196
7464
  var nothingFound = "nothing-found-0eqZ5";
7197
- var css_248z$5 = ".wrapper-3d2zl {\n max-height: 50%;\n overflow: hidden;\n}\n\n.wrapper-3d2zl.MuiAccordion-root.Mui-expanded {\n height: 50%;\n}\n\n.wrapper-3d2zl .MuiAccordionSummary-root.Mui-expanded {\n min-height: 0;\n}\n\n.wrapper-3d2zl .MuiAccordionSummary-root.Mui-focused {\n background-color: #fff8f8;\n}\n\n.wrapper-3d2zl .MuiAccordionSummary-content {\n justify-content: space-between;\n height: 100%;\n}\n\n.wrapper-3d2zl .MuiTabs-root {\n height: 100%;\n}\n\n.wrapper-3d2zl .MuiCollapse-root {\n height: calc(100% - 46px) !important;\n}\n\n.wrapper-3d2zl .MuiCollapse-root {\n scrollbar-width: thin;\n overflow-y: scroll;\n}\n\n.wrapper-3d2zl .MuiCollapse-root .MuiCollapse-wrapper {\n display: none;\n height: 100%;\n}\n\n.wrapper-3d2zl .MuiCollapse-root.MuiCollapse-entered .MuiCollapse-wrapper {\n display: flex;\n}\n\n.wrapper-3d2zl .MuiCollapse-root .MuiCollapse-wrapperInner {\n height: 100%;\n}\n\n.wrapper-3d2zl .MuiCollapse-root .MuiCollapse-wrapperInner > div {\n height: 100%;\n}\n\n.wrapper-3d2zl .MuiAccordionDetails-root {\n height: calc(100% - 24px);\n width: calc(100% - 32px);\n}\n\n.tab-bar-lQQ28 {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n background-color: #f8f8f8;\n height: 46px;\n}\n\n.nothing-found-0eqZ5 {\n display: flex;\n justify-content: center;\n align-items: center;\n height: 100%;\n flex-direction: column;\n gap: 15px;\n margin: auto;\n}\n";
7465
+ var css_248z$5 = ".wrapper-3d2zl {\n max-height: 50%;\n overflow: hidden;\n}\n\n.wrapper-3d2zl.MuiAccordion-root.Mui-expanded {\n height: 50%;\n}\n\n.wrapper-3d2zl.full-height-CQ8Cy {\n max-height: 100%;\n}\n\n.wrapper-3d2zl.full-height-CQ8Cy.MuiAccordion-root.Mui-expanded {\n height: 100%;\n}\n\n.wrapper-3d2zl .MuiAccordionSummary-root.Mui-expanded {\n min-height: 0;\n}\n\n.wrapper-3d2zl .MuiAccordionSummary-root.Mui-focused {\n background-color: #fff8f8;\n}\n\n.wrapper-3d2zl .MuiAccordionSummary-content {\n justify-content: space-between;\n height: 100%;\n}\n\n.wrapper-3d2zl .MuiTabs-root {\n height: 100%;\n}\n\n.wrapper-3d2zl .MuiCollapse-root {\n height: calc(100% - 46px) !important;\n}\n\n.wrapper-3d2zl .MuiCollapse-root {\n scrollbar-width: thin;\n overflow-y: scroll;\n}\n\n.wrapper-3d2zl .MuiCollapse-root .MuiCollapse-wrapper {\n display: none;\n height: 100%;\n}\n\n.wrapper-3d2zl .MuiCollapse-root.MuiCollapse-entered .MuiCollapse-wrapper {\n display: flex;\n}\n\n.wrapper-3d2zl .MuiCollapse-root .MuiCollapse-wrapperInner {\n height: 100%;\n}\n\n.wrapper-3d2zl .MuiCollapse-root .MuiCollapse-wrapperInner > div {\n height: 100%;\n}\n\n.wrapper-3d2zl .MuiAccordionDetails-root {\n height: calc(100% - 24px);\n width: calc(100% - 32px);\n}\n\n.tab-bar-lQQ28 {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n background-color: #f8f8f8;\n height: 46px;\n}\n\n.nothing-found-0eqZ5 {\n display: flex;\n justify-content: center;\n align-items: center;\n height: 100%;\n flex-direction: column;\n gap: 15px;\n margin: auto;\n}\n";
7198
7466
  styleInject(css_248z$5);
7199
7467
 
7200
7468
  var wrapper$3 = "wrapper-i9mNn";
@@ -7238,7 +7506,7 @@ function NothingFound (_ref) {
7238
7506
  children: [/*#__PURE__*/jsx(Typography$1, {
7239
7507
  variant: "body2",
7240
7508
  children: text
7241
- }), info && /*#__PURE__*/jsx(Alert, {
7509
+ }), info && /*#__PURE__*/jsx(Alert$2, {
7242
7510
  variant: "outlined",
7243
7511
  severity: "info",
7244
7512
  children: info
@@ -7250,7 +7518,8 @@ var ProductsOrArticles = function ProductsOrArticles(_ref) {
7250
7518
  var _scroller$current, _scroller$current2;
7251
7519
  var catalogCodex = _ref.catalogCodex,
7252
7520
  onProductClick = _ref.onProductClick,
7253
- hideProducts = _ref.hideProducts;
7521
+ hideProducts = _ref.hideProducts,
7522
+ hideImages = _ref.hideImages;
7254
7523
  var _useSellerState = useSellerState(),
7255
7524
  configurationData = _useSellerState.state.configurationData;
7256
7525
  var _useState = useState(0),
@@ -7329,18 +7598,10 @@ var ProductsOrArticles = function ProductsOrArticles(_ref) {
7329
7598
  favoriteProductsState.search[1](search);
7330
7599
  }
7331
7600
  };
7332
- if (hideAll || vzProductsState.loading || favoriteProductsState.loading) return /*#__PURE__*/jsx(Fragment, {});
7333
- /*#__PURE__*/jsx(ProductsComponent, {
7334
- productState: vzProductsState,
7335
- onClickFunction: onProductClick,
7336
- groupVariantsByField: configurationData === null || configurationData === void 0 ? void 0 : configurationData.groupVariantsByField,
7337
- galleryConfig: {
7338
- hidePrices: true
7339
- }
7340
- });
7341
- var isEmpty = tab == 0 ? vzProductsState.groups.length == 0 : favoriteProductsState.groups.length == 0;
7601
+ if (hideAll) return /*#__PURE__*/jsx(Fragment, {});
7602
+ var isEmpty = selectedTab == 0 ? vzProductsState.groups.length == 0 : favoriteProductsState.groups.length == 0;
7342
7603
  return /*#__PURE__*/jsxs(Accordion, {
7343
- className: wrapper$4,
7604
+ className: classnames(wrapper$4, _defineProperty({}, fullHeight, hideImages)),
7344
7605
  expanded: shouldExpand,
7345
7606
  onChange: function onChange(_, exp) {
7346
7607
  return setExpanded(exp);
@@ -7354,7 +7615,7 @@ var ProductsOrArticles = function ProductsOrArticles(_ref) {
7354
7615
  children: [showVZProducts && /*#__PURE__*/jsx(Tab, {
7355
7616
  label: t('info.products.shared'),
7356
7617
  value: 0
7357
- }), /*#__PURE__*/jsx(Tab, {
7618
+ }), showFavoriteProducts && /*#__PURE__*/jsx(Tab, {
7358
7619
  label: t('info.products.favorite'),
7359
7620
  value: 1
7360
7621
  })]
@@ -7370,7 +7631,10 @@ var ProductsOrArticles = function ProductsOrArticles(_ref) {
7370
7631
  onClickFunction: onProductClick,
7371
7632
  groupVariantsByField: configurationData === null || configurationData === void 0 ? void 0 : configurationData.groupVariantsByField,
7372
7633
  galleryConfig: {
7373
- hidePrices: true
7634
+ hidePrices: true,
7635
+ imageWrapperStyle: {
7636
+ maxHeight: '200px'
7637
+ }
7374
7638
  }
7375
7639
  }), isEmpty && /*#__PURE__*/jsx(NothingFound, {
7376
7640
  text: selectedTab == 0 ? t('info.products.novzproducts') : t('info.products.nofavorites'),
@@ -7433,11 +7697,11 @@ function useModelInfoPage (_ref) {
7433
7697
  toggleLoading('seller-model-info', false, true);
7434
7698
  accountSessionId = undefined;
7435
7699
  if (!(organization.type === 'RETAILER')) {
7436
- _context.next = 13;
7700
+ _context.next = 14;
7437
7701
  break;
7438
7702
  }
7439
7703
  if (accountId) {
7440
- _context.next = 10;
7704
+ _context.next = 11;
7441
7705
  break;
7442
7706
  }
7443
7707
  LOG$3.errorTransaction('ON_OPEN_MODULE_INFO', 'SELLER_0001', 'Missing account ID', {
@@ -7446,33 +7710,46 @@ function useModelInfoPage (_ref) {
7446
7710
  });
7447
7711
  setLoading(false);
7448
7712
  toggleLoading('seller-model-info', false, false);
7713
+ openComponent({
7714
+ type: 'SELLER'
7715
+ });
7449
7716
  return _context.abrupt("return");
7450
- case 10:
7451
- _context.next = 12;
7717
+ case 11:
7718
+ _context.next = 13;
7452
7719
  return checkAccountLogin({
7453
7720
  accountId: accountId
7454
7721
  });
7455
- case 12:
7456
- accountSessionId = _context.sent;
7457
7722
  case 13:
7723
+ accountSessionId = _context.sent;
7724
+ case 14:
7458
7725
  if (!catalogCodex) {
7459
- _context.next = 21;
7726
+ _context.next = 26;
7460
7727
  break;
7461
7728
  }
7462
- _context.next = 16;
7729
+ _context.next = 17;
7463
7730
  return loadCatalogInfo({
7464
7731
  catalogCodex: catalogCodex,
7465
7732
  accountSessionId: accountSessionId,
7466
7733
  accountId: accountId,
7467
7734
  language: i18n.language || 'en'
7468
7735
  });
7469
- case 16:
7736
+ case 17:
7470
7737
  catalogInfoData = _context.sent;
7738
+ if (catalogInfoData) {
7739
+ _context.next = 22;
7740
+ break;
7741
+ }
7742
+ toggleLoading('seller-model-info', false, false);
7743
+ openComponent({
7744
+ type: 'SELLER'
7745
+ });
7746
+ return _context.abrupt("return");
7747
+ case 22:
7471
7748
  {
7472
- _context.next = 19;
7749
+ _context.next = 24;
7473
7750
  break;
7474
7751
  }
7475
- case 19:
7752
+ case 24:
7476
7753
  setData(catalogInfoData === null || catalogInfoData === void 0 ? void 0 : catalogInfoData[0]);
7477
7754
 
7478
7755
  //if there is no relevant catalog information, as a normal seller continue directly to the planner
@@ -7482,14 +7759,14 @@ function useModelInfoPage (_ref) {
7482
7759
  onOpenPlanner(accountSessionId);
7483
7760
  }
7484
7761
  }
7485
- case 21:
7762
+ case 26:
7486
7763
  LOG$3.successTransaction('ON_OPEN_MODULE_INFO', {
7487
7764
  cat: catalogCodex,
7488
7765
  accountId: accountId
7489
7766
  });
7490
7767
  setLoading(false);
7491
7768
  toggleLoading('seller-model-info', false, false);
7492
- case 24:
7769
+ case 29:
7493
7770
  case "end":
7494
7771
  return _context.stop();
7495
7772
  }
@@ -7624,7 +7901,8 @@ function Info(props) {
7624
7901
  }), /*#__PURE__*/jsx(ProductsOrArticles, {
7625
7902
  catalogCodex: catalogData.codex,
7626
7903
  onProductClick: onOpenPlannerWithProduct,
7627
- hideProducts: hideProducts
7904
+ hideProducts: hideProducts,
7905
+ hideImages: hideImage
7628
7906
  })]
7629
7907
  })]
7630
7908
  }), /*#__PURE__*/jsx("div", {
@@ -7685,10 +7963,16 @@ function Priceedit (_ref) {
7685
7963
  discount.percentageDiscount = isPercentage ? value : undefined;
7686
7964
  var price = (_productData$addedPri = productData.addedPrice) !== null && _productData$addedPri !== void 0 ? _productData$addedPri : 0;
7687
7965
  if (isPercentage) {
7688
- var discountPrice = (discount.percentageDiscount || 0) / 100 * price;
7689
- discount = _objectSpread$i(_objectSpread$i({}, discount), {}, {
7690
- calcDiscountPrice: formatTwoDecimals(price - discountPrice)
7691
- });
7966
+ if (discount.percentageDiscount == 0 || discount.percentageDiscount == undefined) {
7967
+ discount = _objectSpread$i(_objectSpread$i({}, discount), {}, {
7968
+ calcDiscountPrice: ''
7969
+ });
7970
+ } else {
7971
+ var discountPrice = (discount.percentageDiscount || 0) / 100 * price;
7972
+ discount = _objectSpread$i(_objectSpread$i({}, discount), {}, {
7973
+ calcDiscountPrice: formatTwoDecimals(price - discountPrice)
7974
+ });
7975
+ }
7692
7976
  } else {
7693
7977
  discount = _objectSpread$i(_objectSpread$i({}, discount), {}, {
7694
7978
  percentageDiscount: formatOneDecimals((price - value || 0) / price * 100)
@@ -7696,8 +7980,8 @@ function Priceedit (_ref) {
7696
7980
  }
7697
7981
  setDiscount(discount);
7698
7982
  update(_objectSpread$i(_objectSpread$i({}, productData), {}, {
7699
- discountedPrice: isPercentage ? formatTwoDecimals(discount.calcDiscountPrice) : value,
7700
- percentageDiscount: discount.percentageDiscount
7983
+ discountedPrice: isPercentage ? discount.calcDiscountPrice ? formatTwoDecimals(discount.calcDiscountPrice) : undefined : value,
7984
+ percentageDiscount: discount.percentageDiscount > 0 ? discount.percentageDiscount : undefined
7701
7985
  }));
7702
7986
  }, [productData, update]);
7703
7987
  function formatTwoDecimals(value) {
@@ -8772,9 +9056,9 @@ var CustomDataFields = function CustomDataFields(_ref) {
8772
9056
  children: [/*#__PURE__*/jsx(CardHeader, {
8773
9057
  title: t('seller.productcreator.customfields') + (productData.variantId !== undefined ? ' (' + t('productvariant') + ':' + productData.variantId + ')' : '')
8774
9058
  }), /*#__PURE__*/jsx(CardContent, {
8775
- children: /*#__PURE__*/jsxs(Box, {
9059
+ children: /*#__PURE__*/jsxs(Box$1, {
8776
9060
  children: [pairs.map(function (pair, index) {
8777
- return /*#__PURE__*/jsxs(Box, {
9061
+ return /*#__PURE__*/jsxs(Box$1, {
8778
9062
  className: wrapper$2,
8779
9063
  children: [/*#__PURE__*/jsx(TextField, {
8780
9064
  style: {
@@ -9231,9 +9515,15 @@ function BaseDataForm (_ref) {
9231
9515
  children: [/*#__PURE__*/jsx(CardHeader, {
9232
9516
  title: t('productcreator.basedata.prices')
9233
9517
  }), /*#__PURE__*/jsx(CardContent, {
9234
- children: /*#__PURE__*/jsx(Priceedit, {
9518
+ children: !hasVariants ? /*#__PURE__*/jsx(Priceedit, {
9235
9519
  productData: productData,
9236
9520
  update: update
9521
+ }) : /*#__PURE__*/jsxs(Alert, {
9522
+ variant: "outlined",
9523
+ severity: "info",
9524
+ children: [/*#__PURE__*/jsxs(AlertTitle, {
9525
+ children: [" ", t('productcreator.basedata.nopriceedittitle')]
9526
+ }), t('productcreator.basedata.nopriceeditdesc')]
9237
9527
  })
9238
9528
  })]
9239
9529
  })]
@@ -9797,7 +10087,6 @@ function VariantTable (_ref) {
9797
10087
  sortBy: [{
9798
10088
  id: getSortByIdField()
9799
10089
  }],
9800
- expanded: true,
9801
10090
  views: ['Table'],
9802
10091
  defaultView: 'Table',
9803
10092
  selectable: false,
@@ -9910,8 +10199,14 @@ function _preUpdateData(field, value, row) {
9910
10199
  var calcedValue = (price - myValue || 0) / price * 100;
9911
10200
  if (fieldName === 'percentageDiscount') {
9912
10201
  calcedField = 'discountedPrice';
9913
- var discountedPrice = Math.round((myValue || 0) / 100 * price);
9914
- calcedValue = price - discountedPrice;
10202
+ myValue = isNaN(myValue) ? 0 : myValue;
10203
+ if (myValue > 0) {
10204
+ var discountedPrice = Math.round(myValue / 100 * price);
10205
+ calcedValue = price - discountedPrice;
10206
+ } else {
10207
+ myValue = 0;
10208
+ calcedValue = undefined;
10209
+ }
9915
10210
  }
9916
10211
  return _objectSpread$7(_objectSpread$7({}, row.original), {}, _defineProperty(_defineProperty({}, fieldName, myValue), calcedField, calcedValue));
9917
10212
  }
@@ -9929,7 +10224,7 @@ function _preUpdateData(field, value, row) {
9929
10224
 
9930
10225
  var wrapper$1 = "wrapper-I8eY4";
9931
10226
  var dataTable = "data-table-ImAxQ";
9932
- var css_248z$2 = ".wrapper-I8eY4 {\n display: flex;\n height: 100%;\n border-bottom: 1px solid rgb(224, 224, 224);\n}\n\n.data-table-ImAxQ {\n position: relative;\n height: 100%;\n flex-grow: 1;\n overflow: hidden;\n}\n";
10227
+ var css_248z$2 = ".wrapper-I8eY4 {\n display: flex;\n height: calc(100% - 67px);\n border-bottom: 1px solid rgb(224, 224, 224);\n}\n\n.data-table-ImAxQ {\n position: relative;\n height: 100%;\n flex-grow: 1;\n overflow: hidden;\n}\n";
9933
10228
  styleInject(css_248z$2);
9934
10229
 
9935
10230
  function ownKeys$6(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; }
@@ -11354,6 +11649,12 @@ function updateVariants(prevState, currentState, configurationData, baseDataFiel
11354
11649
  if (field == 'shortDescription' || field == ' customData') {
11355
11650
  //updated shortDescription as last value
11356
11651
  continue;
11652
+ } else if (field == 'discountedPrice' && (newVariant === null || newVariant === void 0 ? void 0 : newVariant['percentageDiscount']) === 0 && (newVariant === null || newVariant === void 0 ? void 0 : newVariant[field]) === undefined) {
11653
+ finalVariant[field] = undefined;
11654
+ newModified[field] = variant[field] !== undefined;
11655
+ } else if (field == 'percentageDiscount' && (newVariant === null || newVariant === void 0 ? void 0 : newVariant[field]) === 0) {
11656
+ finalVariant[field] = 0;
11657
+ newModified[field] = variant[field] !== 0;
11357
11658
  } else if (field == 'addedPrice' || field == 'calculatedPrice') {
11358
11659
  var _currentState$modifie;
11359
11660
  var _ProductHandler$calcu = ProductHandler.calculateComputedValue(variant[field], newVariant === null || newVariant === void 0 ? void 0 : newVariant[field], currentState.baseData[field], (_currentState$modifie = currentState.modified.variantData[_i]) === null || _currentState$modifie === void 0 ? void 0 : _currentState$modifie[field]),