@crystaldesign/diva-seller 24.15.0-beta.9 → 24.16.0-beta.1

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 (34) hide show
  1. package/build/esm/index.js +629 -336
  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/ProductsOrArticles/index.d.ts +2 -1
  12. package/build/types/seller/src/components/InfoWithProducts/ProductsOrArticles/index.d.ts.map +1 -1
  13. package/build/types/seller/src/components/InfoWithProducts/index.d.ts.map +1 -1
  14. package/build/types/seller/src/components/InfoWithProducts/useModelInfoPage.d.ts.map +1 -1
  15. package/build/types/seller/src/components/ProductCreator/components/Priceedit.d.ts.map +1 -1
  16. package/build/types/seller/src/components/ProductCreator/tabs/BaseDataForm.d.ts.map +1 -1
  17. package/build/types/seller/src/components/ProductCreator/tabs/VariantTable/index.d.ts.map +1 -1
  18. package/build/types/seller/src/provider/hooks/useProduct.d.ts +8 -0
  19. package/build/types/seller/src/provider/hooks/useProduct.d.ts.map +1 -0
  20. package/build/types/seller/src/types.d.ts +5 -4
  21. package/build/types/seller/src/types.d.ts.map +1 -1
  22. package/build/types/seller/src/ui/Basket/CheckOut/components/Step3Product.d.ts +11 -0
  23. package/build/types/seller/src/ui/Basket/CheckOut/components/Step3Product.d.ts.map +1 -0
  24. package/build/types/seller/src/ui/Basket/CheckOut/index.d.ts +5 -2
  25. package/build/types/seller/src/ui/Basket/CheckOut/index.d.ts.map +1 -1
  26. package/build/types/seller/src/ui/Basket/CheckOut/statusMenu.d.ts +1 -2
  27. package/build/types/seller/src/ui/Basket/CheckOut/statusMenu.d.ts.map +1 -1
  28. package/build/types/seller/src/ui/Basket/Header.d.ts +3 -2
  29. package/build/types/seller/src/ui/Basket/Header.d.ts.map +1 -1
  30. package/build/types/seller/src/ui/Basket/PriceOverView/Footer.d.ts +1 -1
  31. package/build/types/seller/src/ui/Basket/PriceOverView/Footer.d.ts.map +1 -1
  32. package/package.json +5 -5
  33. package/build/types/seller/src/ui/Basket/CheckOut/useProduct.d.ts +0 -32
  34. 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() {
@@ -3085,7 +3089,7 @@ var Wrapper = styled('div')({
3085
3089
  display: 'flex',
3086
3090
  justifyContent: 'space-between',
3087
3091
  alignItems: 'center',
3088
- margin: '10px 10px 0 10px',
3092
+ margin: '5px 5px 5px 5px',
3089
3093
  flexWrap: 'wrap',
3090
3094
  gap: '10px'
3091
3095
  });
@@ -3872,11 +3876,7 @@ function Articles(_ref) {
3872
3876
  component: "div",
3873
3877
  variant: "body1",
3874
3878
  color: "textSecondary",
3875
- children: DivaUtils$1.sizeFormatter({
3876
- width: row.values['width'],
3877
- depth: row.values['depth'],
3878
- height: row.values['height']
3879
- }, i18n)
3879
+ children: DivaUtils$1.sizeFormatter(row.values, i18n)
3880
3880
  })]
3881
3881
  }), /*#__PURE__*/jsx("div", {
3882
3882
  style: {
@@ -3949,6 +3949,30 @@ function Articles(_ref) {
3949
3949
  }, {
3950
3950
  label: t('articles.header.depth'),
3951
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
3952
3976
  }],
3953
3977
  groupBy: ['groupName'],
3954
3978
  expanded: true,
@@ -3992,8 +4016,10 @@ function Header$1(_ref) {
3992
4016
  enableVKPExportButton = _ref.enableVKPExportButton;
3993
4017
  var _useTranslation = useTranslation(),
3994
4018
  t = _useTranslation.t;
4019
+ var _useDivaCore = useDivaCore(),
4020
+ organization = _useDivaCore.state.organization;
3995
4021
  var handleClick = function handleClick(event) {
3996
- 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') {
3997
4023
  setActBasketPage(event.currentTarget.name);
3998
4024
  }
3999
4025
  };
@@ -4004,7 +4030,7 @@ function Header$1(_ref) {
4004
4030
  zIndex: 1
4005
4031
  },
4006
4032
  children: /*#__PURE__*/jsxs(Title, {
4007
- text: t('data.' + status) + ' - Nr. ' + divaNr + '-' + documentVersion,
4033
+ text: (actBasketPage === 'Step4' ? 'Marketing' : t('data.' + status)) + ' - Nr. ' + divaNr + '-' + documentVersion,
4008
4034
  children: [showVKPExportButton && /*#__PURE__*/jsx(Button, {
4009
4035
  color: 'primary',
4010
4036
  variant: 'contained',
@@ -4039,6 +4065,13 @@ function Header$1(_ref) {
4039
4065
  children: t('basket.navigation.checkoutNew', {
4040
4066
  step: (config === null || config === void 0 ? void 0 : config.clientData) != false ? 3 : 2
4041
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
+ })
4042
4075
  })]
4043
4076
  })]
4044
4077
  })
@@ -5317,8 +5350,7 @@ function Step2ClientData(_ref) {
5317
5350
  function StatusMenu(_ref) {
5318
5351
  var visibleStatus = _ref.visibleStatus,
5319
5352
  status = _ref.status,
5320
- setStatus = _ref.setStatus,
5321
- productSaved = _ref.productSaved;
5353
+ setStatus = _ref.setStatus;
5322
5354
  var handleClick = function handleClick(item) {
5323
5355
  setStatus(item);
5324
5356
  };
@@ -5343,7 +5375,6 @@ function StatusMenu(_ref) {
5343
5375
  onClick: function onClick() {
5344
5376
  return handleClick(item);
5345
5377
  },
5346
- disabled: productSaved && item !== 'BASE_CONFIGURATION',
5347
5378
  children: t('data.' + item, item)
5348
5379
  }, item);
5349
5380
  })
@@ -5742,88 +5773,6 @@ var HQ_RenderingTypeSource = [{
5742
5773
  RenderPipeline: 'vRayNext'
5743
5774
  }];
5744
5775
 
5745
- 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; }
5746
- 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; }
5747
- function useProduct(basket) {
5748
- var _useState = useState(undefined),
5749
- _useState2 = _slicedToArray(_useState, 2),
5750
- currentProduct = _useState2[0],
5751
- setCurrentProduct = _useState2[1];
5752
- var _useDivaCore = useDivaCore(),
5753
- productHandler = _useDivaCore.handler.productHandler;
5754
- var loadProduct = /*#__PURE__*/function () {
5755
- var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
5756
- var _myProduct$baseData$p;
5757
- var myProduct;
5758
- return _regeneratorRuntime.wrap(function _callee$(_context) {
5759
- while (1) switch (_context.prev = _context.next) {
5760
- case 0:
5761
- _context.next = 2;
5762
- return productHandler.loadProducts({
5763
- basket: new BasketData(basket),
5764
- divaNr: basket.DivaNr
5765
- });
5766
- case 2:
5767
- myProduct = _context.sent;
5768
- setCurrentProduct(_objectSpread$s(_objectSpread$s({}, myProduct.baseData), {}, {
5769
- parent: (_myProduct$baseData$p = myProduct.baseData.parent) !== null && _myProduct$baseData$p !== void 0 ? _myProduct$baseData$p : myProduct.baseData._id
5770
- }));
5771
- return _context.abrupt("return", myProduct);
5772
- case 5:
5773
- case "end":
5774
- return _context.stop();
5775
- }
5776
- }, _callee);
5777
- }));
5778
- return function loadProduct() {
5779
- return _ref.apply(this, arguments);
5780
- };
5781
- }();
5782
- useEffect(function () {
5783
- loadProduct();
5784
- }, [basket]);
5785
- var saveProduct = /*#__PURE__*/function () {
5786
- var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(favourite) {
5787
- var _myproduct$0$parent;
5788
- var myproduct;
5789
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
5790
- while (1) switch (_context2.prev = _context2.next) {
5791
- case 0:
5792
- _context2.next = 2;
5793
- return productHandler.saveProducts({
5794
- products: [currentProduct]
5795
- });
5796
- case 2:
5797
- myproduct = _context2.sent;
5798
- setCurrentProduct(_objectSpread$s(_objectSpread$s({}, myproduct[0]), {}, {
5799
- parent: (_myproduct$0$parent = myproduct[0].parent) !== null && _myproduct$0$parent !== void 0 ? _myproduct$0$parent : myproduct[0]._id
5800
- }));
5801
- if (!favourite) {
5802
- _context2.next = 7;
5803
- break;
5804
- }
5805
- _context2.next = 7;
5806
- return productHandler.apiMarkAsFavorite(currentProduct._id, basket.OrganizationId);
5807
- case 7:
5808
- setCurrentProduct(currentProduct);
5809
- basket.DocumentVersion = basket.DocumentVersion + 1;
5810
- case 9:
5811
- case "end":
5812
- return _context2.stop();
5813
- }
5814
- }, _callee2);
5815
- }));
5816
- return function saveProduct(_x) {
5817
- return _ref2.apply(this, arguments);
5818
- };
5819
- }();
5820
- return {
5821
- currentProduct: currentProduct,
5822
- loadProduct: loadProduct,
5823
- saveProduct: saveProduct
5824
- };
5825
- }
5826
-
5827
5776
  function styleInject(css, ref) {
5828
5777
  if ( ref === void 0 ) ref = {};
5829
5778
  var insertAt = ref.insertAt;
@@ -5851,15 +5800,241 @@ function styleInject(css, ref) {
5851
5800
  }
5852
5801
  }
5853
5802
 
5854
- var paperContainer = "paperContainer-9grpT";
5855
- var hqMediaHeaderContainer = "hqMediaHeaderContainer-PlXdo";
5856
- var hqmediaContainer = "hqmediaContainer-sBjym";
5857
- var hqMediaTitle = "hqMediaTitle-ugda8";
5858
- 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";
5859
- 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);
5860
5823
 
5861
- 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; }
5862
- 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 _useTranslation = useTranslation(),
5831
+ t = _useTranslation.t;
5832
+ var _useState = useState(false),
5833
+ _useState2 = _slicedToArray(_useState, 2),
5834
+ imgIsLoaded = _useState2[0],
5835
+ setImgIsLoaded = _useState2[1];
5836
+ var _useState3 = useState(false),
5837
+ _useState4 = _slicedToArray(_useState3, 2),
5838
+ isFavorite = _useState4[0],
5839
+ setIsFavorite = _useState4[1];
5840
+ var dataIsReady = !!currentProduct;
5841
+ var _useState5 = useState(false),
5842
+ _useState6 = _slicedToArray(_useState5, 2),
5843
+ editProductName = _useState6[0],
5844
+ setEditProductName = _useState6[1];
5845
+ var handleEditProductName = function handleEditProductName() {
5846
+ setEditProductName(true);
5847
+ };
5848
+ var handleBlur = function handleBlur() {
5849
+ setEditProductName(false);
5850
+ };
5851
+ var handleChangeProductName = function handleChangeProductName(event) {
5852
+ currentProduct.shortDescription = event.target.value;
5853
+ updateProductData(currentProduct);
5854
+ };
5855
+ var handleFavoriteToggle = function handleFavoriteToggle() {
5856
+ setIsFavorite(!isFavorite);
5857
+ };
5858
+ return /*#__PURE__*/jsxs(Box, {
5859
+ className: container$1,
5860
+ children: [/*#__PURE__*/jsx(InfoAlert$1, {
5861
+ type: "info",
5862
+ content: /*#__PURE__*/jsx(Fragment, {
5863
+ children: t('basket.checkout.step4.info')
5864
+ })
5865
+ }), /*#__PURE__*/jsxs(Stack, {
5866
+ direction: {
5867
+ xs: 'column',
5868
+ md: 'row'
5869
+ },
5870
+ spacing: 2,
5871
+ className: mainStack,
5872
+ children: [/*#__PURE__*/jsxs(Box, {
5873
+ sx: {
5874
+ width: {
5875
+ xs: '100%',
5876
+ md: '40%'
5877
+ }
5878
+ },
5879
+ children: [/*#__PURE__*/jsx(Paper$1, {
5880
+ variant: "outlined",
5881
+ children: /*#__PURE__*/jsxs("div", {
5882
+ className: productContainer,
5883
+ children: [/*#__PURE__*/jsxs("div", {
5884
+ className: productNameContainer,
5885
+ children: [editProductName ? /*#__PURE__*/jsx(TextField, {
5886
+ variant: "standard",
5887
+ value: currentProduct === null || currentProduct === void 0 ? void 0 : currentProduct.shortDescription,
5888
+ onChange: handleChangeProductName,
5889
+ onBlur: handleBlur,
5890
+ autoFocus: true,
5891
+ className: productNameField
5892
+ }) : dataIsReady ? /*#__PURE__*/jsx("h2", {
5893
+ children: currentProduct === null || currentProduct === void 0 ? void 0 : currentProduct.shortDescription
5894
+ }) : /*#__PURE__*/jsx(Skeleton, {
5895
+ animation: "wave",
5896
+ variant: "text",
5897
+ width: "50%",
5898
+ height: 50
5899
+ }), !editProductName && /*#__PURE__*/jsx(IconButton$1, {
5900
+ size: "small",
5901
+ onClick: handleEditProductName,
5902
+ children: /*#__PURE__*/jsx(EditIcon, {
5903
+ fontSize: "small"
5904
+ })
5905
+ })]
5906
+ }), /*#__PURE__*/jsx("img", {
5907
+ src: (currentProduct === null || currentProduct === void 0 ? void 0 : currentProduct.image) || (currentProduct === null || currentProduct === void 0 ? void 0 : currentProduct.image2D),
5908
+ className: "".concat(productImage, " ").concat(!imgIsLoaded ? hidden$1 : ''),
5909
+ alt: "Product",
5910
+ onLoad: function onLoad() {
5911
+ return setImgIsLoaded(true);
5912
+ }
5913
+ }), !imgIsLoaded && /*#__PURE__*/jsx(Skeleton, {
5914
+ animation: "wave",
5915
+ variant: "text",
5916
+ width: "75%",
5917
+ height: 300
5918
+ })]
5919
+ })
5920
+ }), /*#__PURE__*/jsx(Box, {
5921
+ className: favoriteContainer,
5922
+ children: /*#__PURE__*/jsx(InfoAlert$1, {
5923
+ type: "warning",
5924
+ icon: /*#__PURE__*/jsx(StarBorderIcon, {}),
5925
+ title: t('basket.checkout.step4.favorite'),
5926
+ content: /*#__PURE__*/jsxs(Fragment, {
5927
+ children: [/*#__PURE__*/jsx(Typography, {
5928
+ mb: 1,
5929
+ children: t('basket.checkout.step4.favoriteinfo')
5930
+ }), /*#__PURE__*/jsx(FormControlLabel$1, {
5931
+ disabled: !dataIsReady,
5932
+ control: /*#__PURE__*/jsx(Checkbox$1, {
5933
+ className: favoriteCheckbox,
5934
+ checked: isFavorite,
5935
+ onChange: handleFavoriteToggle
5936
+ }),
5937
+ label: t('basket.checkout.step4.savemsg')
5938
+ })]
5939
+ })
5940
+ })
5941
+ }), /*#__PURE__*/jsxs(Box, {
5942
+ className: actionButtonContainer,
5943
+ children: [/*#__PURE__*/jsx(Button$1, {
5944
+ variant: "contained",
5945
+ onClick: function onClick() {
5946
+ return handleSave(undefined, false, isFavorite);
5947
+ },
5948
+ disabled: !dataIsReady,
5949
+ children: t('basket.checkout.step4.saveproduct')
5950
+ }), /*#__PURE__*/jsx(Button$1, {
5951
+ onClick: startWithEmptyBasket,
5952
+ variant: "outlined",
5953
+ disabled: !dataIsReady,
5954
+ children: t('basket.checkout.step4.cancel')
5955
+ })]
5956
+ })]
5957
+ }), /*#__PURE__*/jsx(Paper$1, {
5958
+ variant: "outlined",
5959
+ className: productDetailsPaper,
5960
+ children: /*#__PURE__*/jsxs("div", {
5961
+ className: productDetailsContainer,
5962
+ children: [/*#__PURE__*/jsx("h2", {
5963
+ children: t('basket.checkout.step3.productdetails')
5964
+ }), !dataIsReady && /*#__PURE__*/jsx(Fragment, {
5965
+ children: _toConsumableArray(Array(13)).map(function (_, index) {
5966
+ return /*#__PURE__*/jsxs(Box, {
5967
+ className: productDetailRow,
5968
+ children: [/*#__PURE__*/jsx(Skeleton, {
5969
+ animation: "wave",
5970
+ variant: "text",
5971
+ width: "40%",
5972
+ className: productDetailSkeleton
5973
+ }), /*#__PURE__*/jsx(Skeleton, {
5974
+ animation: "wave",
5975
+ variant: "text",
5976
+ width: "60%",
5977
+ className: productDetailSkeleton
5978
+ }), index < 12 && /*#__PURE__*/jsx(Divider$1, {
5979
+ className: productDetailDivider
5980
+ })]
5981
+ }, index);
5982
+ })
5983
+ }), 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) {
5984
+ var _currentProduct$techn2;
5985
+ var formattedLine = line.trim().endsWith(',') ? line.slice(0, -1) : line;
5986
+ var _formattedLine$split = formattedLine.split(':'),
5987
+ _formattedLine$split2 = _toArray(_formattedLine$split),
5988
+ firstPart = _formattedLine$split2[0],
5989
+ rest = _formattedLine$split2.slice(1);
5990
+ var formattedFirstPart = firstPart.trim();
5991
+ var formattedRest = rest.join(':').trim();
5992
+ return /*#__PURE__*/jsxs("div", {
5993
+ children: [/*#__PURE__*/jsx(Typography, {
5994
+ sx: {
5995
+ fontSize: {
5996
+ xs: '12px',
5997
+ md: '1rem'
5998
+ }
5999
+ },
6000
+ className: productDetailText,
6001
+ children: /*#__PURE__*/jsxs(Box, {
6002
+ className: productDetailRow,
6003
+ children: [/*#__PURE__*/jsxs("span", {
6004
+ className: productDetailLabel,
6005
+ children: [formattedFirstPart, ":"]
6006
+ }), /*#__PURE__*/jsx("span", {
6007
+ children: formattedRest
6008
+ })]
6009
+ })
6010
+ }), 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, {
6011
+ className: productDetailDivider
6012
+ })]
6013
+ }, index);
6014
+ }))]
6015
+ })
6016
+ })]
6017
+ })]
6018
+ });
6019
+ }
6020
+ function InfoAlert$1(_ref2) {
6021
+ var type = _ref2.type,
6022
+ content = _ref2.content,
6023
+ title = _ref2.title,
6024
+ icon = _ref2.icon;
6025
+ return /*#__PURE__*/jsxs(Alert, {
6026
+ variant: "outlined",
6027
+ severity: type,
6028
+ icon: icon,
6029
+ children: [title && /*#__PURE__*/jsx(AlertTitle, {
6030
+ className: alertTitle,
6031
+ children: title
6032
+ }), content]
6033
+ });
6034
+ }
6035
+
6036
+ 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; }
6037
+ 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; }
5863
6038
  function CheckOut(_ref) {
5864
6039
  var _basket$Client;
5865
6040
  var schema = _ref.schema,
@@ -5873,6 +6048,9 @@ function CheckOut(_ref) {
5873
6048
  updateBasket = _ref.updateBasket,
5874
6049
  statusArray = _ref.statusArray,
5875
6050
  configSaveButtons = _ref.configSaveButtons,
6051
+ currentProduct = _ref.currentProduct,
6052
+ saveProduct = _ref.saveProduct,
6053
+ updateProductData = _ref.updateProductData,
5876
6054
  gdpr = _ref.gdpr;
5877
6055
  var _useState = useState(false),
5878
6056
  _useState2 = _slicedToArray(_useState, 2),
@@ -5880,16 +6058,8 @@ function CheckOut(_ref) {
5880
6058
  setIsSaving = _useState2[1];
5881
6059
  var _useState3 = useState(false),
5882
6060
  _useState4 = _slicedToArray(_useState3, 2),
5883
- isSaved = _useState4[0],
5884
- setIsSaved = _useState4[1];
5885
- var _useState5 = useState(false),
5886
- _useState6 = _slicedToArray(_useState5, 2),
5887
- showRenderJobs = _useState6[0],
5888
- setShowRenderJobs = _useState6[1];
5889
- var _useState7 = useState(false),
5890
- _useState8 = _slicedToArray(_useState7, 2),
5891
- basket3DExportChecked = _useState8[0],
5892
- setBasket3DExportChecked = _useState8[1];
6061
+ basket3DExportChecked = _useState4[0],
6062
+ setBasket3DExportChecked = _useState4[1];
5893
6063
  var _useTranslation = useTranslation(),
5894
6064
  t = _useTranslation.t;
5895
6065
  var _useSellerState = useSellerState(),
@@ -5899,117 +6069,41 @@ function CheckOut(_ref) {
5899
6069
  userHasPermission = _useDivaCore$actions.userHasPermission,
5900
6070
  toggleLoading = _useDivaCore$actions.toggleLoading,
5901
6071
  openModal = _useDivaCore$actions.openModal,
5902
- productHandler = _useDivaCore.handler.productHandler,
5903
6072
  _useDivaCore$state = _useDivaCore.state,
5904
6073
  apiConfig = _useDivaCore$state.apiConfig,
5905
6074
  jwt = _useDivaCore$state.jwt,
5906
6075
  organization = _useDivaCore$state.organization;
5907
- var _useProduct = useProduct(basket),
5908
- currentProduct = _useProduct.currentProduct,
5909
- loadProduct = _useProduct.loadProduct,
5910
- saveProduct = _useProduct.saveProduct;
5911
- useEffect(function () {
5912
- var fetchProduct = /*#__PURE__*/function () {
5913
- var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
5914
- return _regeneratorRuntime.wrap(function _callee$(_context) {
5915
- while (1) switch (_context.prev = _context.next) {
5916
- case 0:
5917
- if (!(status === 'BASE_CONFIGURATION' && !currentProduct)) {
5918
- _context.next = 3;
5919
- break;
5920
- }
5921
- _context.next = 3;
5922
- return loadProduct();
5923
- case 3:
5924
- case "end":
5925
- return _context.stop();
5926
- }
5927
- }, _callee);
5928
- }));
5929
- return function fetchProduct() {
5930
- return _ref2.apply(this, arguments);
5931
- };
5932
- }();
5933
- fetchProduct();
5934
- setShowRenderJobs(false);
5935
- }, [status]);
5936
- var saveProductAndShowHqMedia = /*#__PURE__*/function () {
5937
- var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
5938
- var myProduct;
6076
+ var handleSave = useCallback(/*#__PURE__*/function () {
6077
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(openPDF, sendMail, isFav) {
5939
6078
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
5940
6079
  while (1) switch (_context2.prev = _context2.next) {
5941
- case 0:
5942
- _context2.next = 2;
5943
- return loadProduct();
5944
- case 2:
5945
- myProduct = _context2.sent;
5946
- if (!(!myProduct || myProduct.isNew)) {
5947
- _context2.next = 11;
5948
- break;
5949
- }
5950
- toggleLoading('saveProduct');
5951
- _context2.next = 7;
5952
- return saveProduct();
5953
- case 7:
5954
- toggleLoading('saveProduct');
5955
- setShowRenderJobs(true);
5956
- _context2.next = 12;
5957
- break;
5958
- case 11:
5959
- setShowRenderJobs(true);
5960
- case 12:
5961
- case "end":
5962
- return _context2.stop();
5963
- }
5964
- }, _callee2);
5965
- }));
5966
- return function saveProductAndShowHqMedia() {
5967
- return _ref3.apply(this, arguments);
5968
- };
5969
- }();
5970
- var handleSave = useCallback(/*#__PURE__*/function () {
5971
- var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(openPDF, sendMail, favourite, hqMedia) {
5972
- return _regeneratorRuntime.wrap(function _callee4$(_context4) {
5973
- while (1) switch (_context4.prev = _context4.next) {
5974
6080
  case 0:
5975
6081
  if (!(status === 'BASE_CONFIGURATION')) {
5976
- _context4.next = 13;
5977
- break;
5978
- }
5979
- if (!hqMedia) {
5980
- _context4.next = 6;
6082
+ _context2.next = 7;
5981
6083
  break;
5982
6084
  }
5983
- _context4.next = 4;
5984
- return saveProductAndShowHqMedia();
5985
- case 4:
5986
- _context4.next = 11;
5987
- break;
5988
- case 6:
5989
6085
  toggleLoading('saveProduct');
5990
- _context4.next = 9;
5991
- return saveProduct(favourite);
5992
- case 9:
6086
+ _context2.next = 4;
6087
+ return saveProduct(isFav);
6088
+ case 4:
5993
6089
  toggleLoading('saveProduct');
5994
6090
  openModal({
5995
6091
  title: t('basket.checkout.productsavedtitle'),
5996
6092
  accept: true,
5997
6093
  text: t('basket.checkout.productsavedtext')
5998
6094
  });
5999
- case 11:
6000
- setIsSaved(true);
6001
- return _context4.abrupt("return");
6002
- case 13:
6095
+ return _context2.abrupt("return");
6096
+ case 7:
6003
6097
  if (!isSaving) {
6004
6098
  setIsSaving(true);
6005
6099
  onClickSave(openPDF, sendMail).then(/*#__PURE__*/function () {
6006
- var _ref5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(p) {
6100
+ var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(p) {
6007
6101
  var newRenderJob;
6008
- return _regeneratorRuntime.wrap(function _callee3$(_context3) {
6009
- while (1) switch (_context3.prev = _context3.next) {
6102
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
6103
+ while (1) switch (_context.prev = _context.next) {
6010
6104
  case 0:
6011
6105
  if (!basket3DExportChecked) {
6012
- _context3.next = 4;
6106
+ _context.next = 4;
6013
6107
  break;
6014
6108
  }
6015
6109
  newRenderJob = {
@@ -6019,7 +6113,7 @@ function CheckOut(_ref) {
6019
6113
  diva3DProject: basket.Diva3DProject ? atob(basket.Diva3DProject) : undefined,
6020
6114
  hQRenderScript: basket.OrderSets[0].HQRenderScript
6021
6115
  };
6022
- _context3.next = 4;
6116
+ _context.next = 4;
6023
6117
  return apiSaveRenderJobs({
6024
6118
  serviceUrl: apiConfig.mediaService,
6025
6119
  jobs: [newRenderJob],
@@ -6029,43 +6123,36 @@ function CheckOut(_ref) {
6029
6123
  setIsSaving(false);
6030
6124
  case 5:
6031
6125
  case "end":
6032
- return _context3.stop();
6126
+ return _context.stop();
6033
6127
  }
6034
- }, _callee3);
6128
+ }, _callee);
6035
6129
  }));
6036
- return function (_x5) {
6037
- return _ref5.apply(this, arguments);
6130
+ return function (_x4) {
6131
+ return _ref3.apply(this, arguments);
6038
6132
  };
6039
6133
  }())["catch"](function () {
6040
6134
  return setIsSaving(false);
6041
6135
  });
6042
6136
  }
6043
- case 14:
6137
+ case 8:
6044
6138
  case "end":
6045
- return _context4.stop();
6139
+ return _context2.stop();
6046
6140
  }
6047
- }, _callee4);
6141
+ }, _callee2);
6048
6142
  }));
6049
- return function (_x, _x2, _x3, _x4) {
6050
- return _ref4.apply(this, arguments);
6143
+ return function (_x, _x2, _x3) {
6144
+ return _ref2.apply(this, arguments);
6051
6145
  };
6052
6146
  }(), [isSaving, onClickSave, basket3DExportChecked]);
6053
- var onChangeForm = function onChangeForm(_ref6) {
6054
- var data = _ref6.data;
6147
+ var onChangeForm = function onChangeForm(_ref4) {
6148
+ var data = _ref4.data;
6055
6149
  for (var key in data) {
6056
6150
  basket[key] = data[key];
6057
6151
  }
6058
6152
  };
6059
- var onErrorHqMedia = function onErrorHqMedia(error) {
6060
- openModal({
6061
- title: t('Error'),
6062
- accept: true,
6063
- text: t('basket.checkout.errorhqmediatext')
6064
- });
6065
- };
6066
6153
 
6067
6154
  // for LEAFLET don't show printOptions, if there are any configured.
6068
- var finalSchema = _objectSpread$r(_objectSpread$r({}, uiSchema), {}, {
6155
+ var finalSchema = _objectSpread$s(_objectSpread$s({}, uiSchema), {}, {
6069
6156
  elements: _toConsumableArray(uiSchema.elements)
6070
6157
  });
6071
6158
  if (status == 'LEAFLET') {
@@ -6097,63 +6184,15 @@ function CheckOut(_ref) {
6097
6184
  }), /*#__PURE__*/jsx(StatusMenu, {
6098
6185
  visibleStatus: statusArray,
6099
6186
  status: status,
6100
- setStatus: setStatus,
6101
- productSaved: isSaved
6187
+ setStatus: setStatus
6102
6188
  })]
6103
6189
  }), /*#__PURE__*/jsxs("div", {
6104
- children: [showRenderJobs && /*#__PURE__*/jsxs(Paper$1, {
6105
- elevation: 4,
6106
- className: paperContainer,
6107
- children: [/*#__PURE__*/jsxs("div", {
6108
- className: hqMediaHeaderContainer,
6109
- children: [/*#__PURE__*/jsx("div", {
6110
- className: hqMediaTitle,
6111
- children: "HQ Medien"
6112
- }), /*#__PURE__*/jsx(Button$1, {
6113
- onClick: function onClick() {
6114
- return setShowRenderJobs(false);
6115
- },
6116
- children: /*#__PURE__*/jsx(CloseIcon, {})
6117
- })]
6118
- }), /*#__PURE__*/jsx("div", {
6119
- className: hqmediaContainer,
6120
- children: /*#__PURE__*/jsx(OrderEntry, {
6121
- variantData: [],
6122
- baseData: currentProduct,
6123
- basketData: basket,
6124
- onSave: function onSave() {
6125
- return productHandler.saveProducts({
6126
- products: [currentProduct]
6127
- }).then(function (r) {
6128
- return !!r.length;
6129
- });
6130
- },
6131
- saved: true,
6132
- onError: function onError() {
6133
- return onErrorHqMedia;
6134
- }
6135
- })
6136
- })]
6137
- }), status === 'BASE_CONFIGURATION' && !showRenderJobs && /*#__PURE__*/jsx(Fragment, {
6138
- children: /*#__PURE__*/jsxs("div", {
6139
- style: {
6140
- margin: '1rem',
6141
- marginLeft: '150px',
6142
- display: 'flex',
6143
- alignItems: 'center',
6144
- gap: 25
6145
- },
6146
- children: [/*#__PURE__*/jsx("img", {
6147
- src: currentProduct === null || currentProduct === void 0 ? void 0 : currentProduct.image,
6148
- height: 250
6149
- }), /*#__PURE__*/jsx("div", {
6150
- style: {
6151
- whiteSpace: 'pre-wrap'
6152
- },
6153
- children: currentProduct === null || currentProduct === void 0 ? void 0 : currentProduct.technicalDescription
6154
- })]
6155
- })
6156
- }), status !== 'BASE_CONFIGURATION' && !showRenderJobs && /*#__PURE__*/jsxs(Fragment, {
6190
+ children: [status === 'BASE_CONFIGURATION' && /*#__PURE__*/jsx(Step3Product, {
6191
+ startWithEmptyBasket: startWithEmptyBasket,
6192
+ currentProduct: currentProduct,
6193
+ handleSave: handleSave,
6194
+ updateProductData: updateProductData
6195
+ }), status !== 'BASE_CONFIGURATION' && /*#__PURE__*/jsxs(Fragment, {
6157
6196
  children: [/*#__PURE__*/jsx("div", {
6158
6197
  style: {
6159
6198
  margin: '1rem',
@@ -6170,7 +6209,7 @@ function CheckOut(_ref) {
6170
6209
  }), !!renderService && permissionAnyHqRenderBox && (catalogData === null || catalogData === void 0 ? void 0 : catalogData[0].has3D) && /*#__PURE__*/jsx(HqRenderBox, {
6171
6210
  basket: basket,
6172
6211
  config: renderService
6173
- }), (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", {
6212
+ }), (catalogData === null || catalogData === void 0 ? void 0 : catalogData[0].has3D) && organization.settings.enable3DExport && /*#__PURE__*/jsxs("div", {
6174
6213
  style: {
6175
6214
  marginLeft: '50px',
6176
6215
  width: '700px'
@@ -6198,7 +6237,7 @@ function CheckOut(_ref) {
6198
6237
  })
6199
6238
  })]
6200
6239
  })]
6201
- }), !showRenderJobs && /*#__PURE__*/jsx(SaveButtonsGroup, {
6240
+ }), status !== 'BASE_CONFIGURATION' && /*#__PURE__*/jsx(SaveButtonsGroup, {
6202
6241
  orderEmpty: !basket.OrderSets || basket.OrderSets.length == 0 || gdpr && !isEmpty(basket === null || basket === void 0 ? void 0 : basket.Client) && !basket.Gdpr,
6203
6242
  onClickSave: handleSave,
6204
6243
  startWithEmptyBasket: startWithEmptyBasket,
@@ -6222,12 +6261,12 @@ function isEmpty(data) {
6222
6261
  });
6223
6262
  }
6224
6263
 
6225
- 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; }
6226
- 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; }
6264
+ 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; }
6265
+ 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; }
6227
6266
  var schema = function schema(hideWWSButton) {
6228
6267
  return {
6229
6268
  type: 'object',
6230
- properties: _objectSpread$q(_objectSpread$q({
6269
+ properties: _objectSpread$r(_objectSpread$r({
6231
6270
  Salesperson: {
6232
6271
  type: 'string',
6233
6272
  title: 'basket.checkout.form.seller'
@@ -6462,7 +6501,10 @@ function Step3Checkout(_ref) {
6462
6501
  status = _ref.status,
6463
6502
  setStatus = _ref.setStatus,
6464
6503
  statusArray = _ref.statusArray,
6465
- config = _ref.config;
6504
+ config = _ref.config,
6505
+ currentProduct = _ref.currentProduct,
6506
+ saveProduct = _ref.saveProduct,
6507
+ updateProductData = _ref.updateProductData;
6466
6508
  var _useDivaCore = useDivaCore(),
6467
6509
  organization = _useDivaCore.state.organization;
6468
6510
  return /*#__PURE__*/jsx(CheckOut, {
@@ -6477,19 +6519,225 @@ function Step3Checkout(_ref) {
6477
6519
  updateBasket: updateBasket,
6478
6520
  renderService: config === null || config === void 0 || (_config$checkout3 = config.checkout) === null || _config$checkout3 === void 0 ? void 0 : _config$checkout3.renderService,
6479
6521
  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'],
6480
- gdpr: config === null || config === void 0 || (_config$checkout5 = config.checkout) === null || _config$checkout5 === void 0 ? void 0 : _config$checkout5.checkGdpr
6522
+ gdpr: config === null || config === void 0 || (_config$checkout5 = config.checkout) === null || _config$checkout5 === void 0 ? void 0 : _config$checkout5.checkGdpr,
6523
+ currentProduct: currentProduct,
6524
+ saveProduct: saveProduct,
6525
+ updateProductData: updateProductData
6481
6526
  });
6482
6527
  }
6483
6528
 
6529
+ var infocontainer = "infocontainer-ir9gv";
6530
+ var css_248z$a = ".infocontainer-ir9gv {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n";
6531
+ styleInject(css_248z$a);
6532
+
6533
+ function Step4Checkout(_ref) {
6534
+ var currentProduct = _ref.currentProduct,
6535
+ basket = _ref.basket,
6536
+ productSaved = _ref.productSaved,
6537
+ is3dReady = _ref.is3dReady;
6538
+ var _useTranslation = useTranslation(),
6539
+ t = _useTranslation.t;
6540
+ var _useDivaCore = useDivaCore(),
6541
+ openModal = _useDivaCore.actions.openModal,
6542
+ productHandler = _useDivaCore.handler.productHandler;
6543
+ var onErrorHqMedia = function onErrorHqMedia(error) {
6544
+ openModal({
6545
+ title: t('Error'),
6546
+ accept: true,
6547
+ text: t('basket.checkout.errorhqmediatext')
6548
+ });
6549
+ };
6550
+ if (!is3dReady) {
6551
+ return /*#__PURE__*/jsx("div", {
6552
+ className: infocontainer,
6553
+ children: /*#__PURE__*/jsx(InfoAlert, {
6554
+ title: t('basket.checkout.step4.errortitle'),
6555
+ content: /*#__PURE__*/jsx(Fragment, {
6556
+ children: t('basket.checkout.step4.error3d')
6557
+ })
6558
+ })
6559
+ });
6560
+ }
6561
+ if (!productSaved) {
6562
+ return /*#__PURE__*/jsx("div", {
6563
+ className: infocontainer,
6564
+ children: /*#__PURE__*/jsx(InfoAlert, {
6565
+ title: t('basket.checkout.step4.errortitle'),
6566
+ content: /*#__PURE__*/jsx(Fragment, {
6567
+ children: t('basket.checkout.step4.productNotSaved')
6568
+ })
6569
+ })
6570
+ });
6571
+ }
6572
+ return /*#__PURE__*/jsxs(Box, {
6573
+ sx: {
6574
+ display: 'flex',
6575
+ flexDirection: 'column',
6576
+ gap: 2,
6577
+ height: '100%'
6578
+ },
6579
+ children: [/*#__PURE__*/jsx(InfoAlert, {
6580
+ content: /*#__PURE__*/jsxs(Fragment, {
6581
+ children: [t('basket.checkout.step4.hqmediainfo'), ":", ' ', /*#__PURE__*/jsx("a", {
6582
+ href: "https://www.diva-portal.de/digitalisierungs-service",
6583
+ target: "_blank",
6584
+ children: "www.diva-portal.de/digitalisierungs-service"
6585
+ })]
6586
+ })
6587
+ }), /*#__PURE__*/jsx(OrderEntry, {
6588
+ variantData: [],
6589
+ baseData: currentProduct,
6590
+ basketData: basket,
6591
+ onSave: function onSave() {
6592
+ return productHandler.saveProducts({
6593
+ products: [currentProduct]
6594
+ }).then(function (r) {
6595
+ return !!r.length;
6596
+ });
6597
+ },
6598
+ saved: true,
6599
+ onError: function onError() {
6600
+ return onErrorHqMedia;
6601
+ }
6602
+ })]
6603
+ });
6604
+ }
6605
+ function InfoAlert(_ref2) {
6606
+ var title = _ref2.title,
6607
+ content = _ref2.content;
6608
+ return /*#__PURE__*/jsxs(Alert$1, {
6609
+ variant: "outlined",
6610
+ severity: "info",
6611
+ children: [title && /*#__PURE__*/jsx(AlertTitle$1, {
6612
+ children: title
6613
+ }), content]
6614
+ });
6615
+ }
6616
+
6617
+ 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; }
6618
+ 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; }
6619
+ function useProduct(basket) {
6620
+ var _useState = useState(false),
6621
+ _useState2 = _slicedToArray(_useState, 2),
6622
+ productSaved = _useState2[0],
6623
+ setProductSaved = _useState2[1];
6624
+ var _useState3 = useState(),
6625
+ _useState4 = _slicedToArray(_useState3, 2),
6626
+ currentProduct = _useState4[0],
6627
+ setCurrentProduct = _useState4[1];
6628
+ var _useDivaCore = useDivaCore(),
6629
+ productHandler = _useDivaCore.handler.productHandler;
6630
+ useEffect(function () {
6631
+ var fetchProduct = /*#__PURE__*/function () {
6632
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
6633
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
6634
+ while (1) switch (_context.prev = _context.next) {
6635
+ case 0:
6636
+ if (!((basket === null || basket === void 0 ? void 0 : basket.Status) === 'BASE_CONFIGURATION' && !currentProduct)) {
6637
+ _context.next = 3;
6638
+ break;
6639
+ }
6640
+ _context.next = 3;
6641
+ return loadProduct(basket);
6642
+ case 3:
6643
+ case "end":
6644
+ return _context.stop();
6645
+ }
6646
+ }, _callee);
6647
+ }));
6648
+ return function fetchProduct() {
6649
+ return _ref.apply(this, arguments);
6650
+ };
6651
+ }();
6652
+ fetchProduct();
6653
+ }, [basket === null || basket === void 0 ? void 0 : basket.Status]);
6654
+ var loadProduct = /*#__PURE__*/function () {
6655
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(basket) {
6656
+ var _myProduct$baseData$p;
6657
+ var myProduct;
6658
+ return _regeneratorRuntime.wrap(function _callee2$(_context2) {
6659
+ while (1) switch (_context2.prev = _context2.next) {
6660
+ case 0:
6661
+ _context2.next = 2;
6662
+ return productHandler.loadProducts({
6663
+ basket: new BasketData(basket),
6664
+ productData: currentProduct ? [currentProduct] : undefined,
6665
+ getUniqueNewDivaNr: true
6666
+ });
6667
+ case 2:
6668
+ myProduct = _context2.sent;
6669
+ setCurrentProduct(_objectSpread$q(_objectSpread$q({}, myProduct.baseData), {}, {
6670
+ parent: (_myProduct$baseData$p = myProduct.baseData.parent) !== null && _myProduct$baseData$p !== void 0 ? _myProduct$baseData$p : myProduct.baseData._id
6671
+ }));
6672
+ case 4:
6673
+ case "end":
6674
+ return _context2.stop();
6675
+ }
6676
+ }, _callee2);
6677
+ }));
6678
+ return function loadProduct(_x) {
6679
+ return _ref2.apply(this, arguments);
6680
+ };
6681
+ }();
6682
+ var saveProduct = /*#__PURE__*/function () {
6683
+ var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(favourite) {
6684
+ var _myproduct$0$parent;
6685
+ var myproduct;
6686
+ return _regeneratorRuntime.wrap(function _callee3$(_context3) {
6687
+ while (1) switch (_context3.prev = _context3.next) {
6688
+ case 0:
6689
+ if (currentProduct) {
6690
+ _context3.next = 2;
6691
+ break;
6692
+ }
6693
+ return _context3.abrupt("return");
6694
+ case 2:
6695
+ _context3.next = 4;
6696
+ return productHandler.saveProducts({
6697
+ products: [currentProduct]
6698
+ });
6699
+ case 4:
6700
+ myproduct = _context3.sent;
6701
+ setCurrentProduct(_objectSpread$q(_objectSpread$q({}, myproduct[0]), {}, {
6702
+ parent: (_myproduct$0$parent = myproduct[0].parent) !== null && _myproduct$0$parent !== void 0 ? _myproduct$0$parent : myproduct[0]._id
6703
+ }));
6704
+ if (!favourite) {
6705
+ _context3.next = 9;
6706
+ break;
6707
+ }
6708
+ _context3.next = 9;
6709
+ return productHandler.apiMarkAsFavorite(currentProduct._id, currentProduct.organizationId);
6710
+ case 9:
6711
+ setProductSaved(true);
6712
+ case 10:
6713
+ case "end":
6714
+ return _context3.stop();
6715
+ }
6716
+ }, _callee3);
6717
+ }));
6718
+ return function saveProduct(_x2) {
6719
+ return _ref3.apply(this, arguments);
6720
+ };
6721
+ }();
6722
+ var updateProductData = function updateProductData(product) {
6723
+ setCurrentProduct(_objectSpread$q({}, product));
6724
+ };
6725
+ return {
6726
+ currentProduct: currentProduct,
6727
+ saveProduct: saveProduct,
6728
+ productSaved: productSaved,
6729
+ updateProductData: updateProductData
6730
+ };
6731
+ }
6732
+
6484
6733
  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; }
6485
6734
  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; }
6486
6735
  var LOG$4 = getLogger('SellerBasket', 'Basket');
6487
6736
  function Basket(_ref) {
6488
- var _configurationData$Ch5;
6737
+ var _currentProduct$divaN, _configurationData$Ch5, _currentBasket$OrderS5;
6489
6738
  var divaNr = _ref.divaNr,
6490
6739
  basket = _ref.basket,
6491
6740
  checkBasket = _ref.checkBasket;
6492
- //Hooks
6493
6741
  var _useState = useState('Step1'),
6494
6742
  _useState2 = _slicedToArray(_useState, 2),
6495
6743
  actBasketPage = _useState2[0],
@@ -6523,6 +6771,11 @@ function Basket(_ref) {
6523
6771
  openModal = _useSellerState$actio.openModal,
6524
6772
  sendEmail = _useSellerState$actio.sendEmail,
6525
6773
  resetBasketState = _useSellerState$actio.resetBasketState;
6774
+ var _useProduct = useProduct(currentBasketState === null || currentBasketState === void 0 ? void 0 : currentBasketState.basket),
6775
+ currentProduct = _useProduct.currentProduct,
6776
+ saveProduct = _useProduct.saveProduct,
6777
+ productSaved = _useProduct.productSaved,
6778
+ updateProductData = _useProduct.updateProductData;
6526
6779
  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 : '');
6527
6780
  useEffect(function () {
6528
6781
  if (!basket) DivaUtils$1.businessMetrics.setConfiguratorSessionId();
@@ -6699,6 +6952,7 @@ function Basket(_ref) {
6699
6952
  message: t('basket.checkout.pdfqr'),
6700
6953
  type: 'big',
6701
6954
  clickable: true,
6955
+ qrCodeSize: 312,
6702
6956
  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
6703
6957
  });
6704
6958
  }
@@ -6864,9 +7118,9 @@ function Basket(_ref) {
6864
7118
  },
6865
7119
  children: [/*#__PURE__*/jsx(Header$1, {
6866
7120
  config: configurationData === null || configurationData === void 0 ? void 0 : configurationData.Checkout,
6867
- status: statusRef.current,
7121
+ status: currentBasket.Status,
6868
7122
  documentVersion: currentBasket.getDocumentVersion(),
6869
- divaNr: currentBasket.DivaNr,
7123
+ divaNr: currentBasket.Status == 'BASE_CONFIGURATION' && currentProduct ? (_currentProduct$divaN = currentProduct.divaNr) !== null && _currentProduct$divaN !== void 0 ? _currentProduct$divaN : '' : currentBasket.DivaNr,
6870
7124
  actBasketPage: actBasketPage,
6871
7125
  setActBasketPage: setActBasketPage,
6872
7126
  showVKPExportButton: !!(vkpExportData !== null && vkpExportData !== void 0 && vkpExportData.callbackurl) || !!(configurationData !== null && configurationData !== void 0 && configurationData.VKPExportUrl),
@@ -6905,7 +7159,18 @@ function Basket(_ref) {
6905
7159
  onClickSave: onClickSave,
6906
7160
  statusArray: getBasketStatusArr(),
6907
7161
  updateBasket: update,
6908
- currentUser: currentUser
7162
+ currentUser: currentUser,
7163
+ currentProduct: currentProduct,
7164
+ saveProduct: saveProduct,
7165
+ updateProductData: updateProductData
7166
+ }), actBasketPage == 'Step4' && organization.settings.enableVKMarketing && /*#__PURE__*/jsx(Step4Checkout, {
7167
+ config: configurationData === null || configurationData === void 0 ? void 0 : configurationData.Checkout,
7168
+ basket: currentBasket,
7169
+ setActBasketPage: setActBasketPage,
7170
+ startWithEmptyBasket: startWithEmptyBasket,
7171
+ currentProduct: currentProduct,
7172
+ productSaved: productSaved,
7173
+ is3dReady: currentBasket !== null && currentBasket !== void 0 && (_currentBasket$OrderS5 = currentBasket.OrderSets[0]) !== null && _currentBasket$OrderS5 !== void 0 && _currentBasket$OrderS5.HQRenderScript ? true : false
6909
7174
  })]
6910
7175
  })]
6911
7176
  });
@@ -7100,7 +7365,7 @@ var leftSide = "left-side-10jmj";
7100
7365
  var rightSide$1 = "right-side-64-Yz";
7101
7366
  var catalogImages = "catalog-images-jJGqW";
7102
7367
  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";
7368
+ 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
7369
  styleInject(css_248z$7);
7105
7370
 
7106
7371
  var wrapper$5 = "wrapper-D5Cmc";
@@ -7192,9 +7457,10 @@ var CatalogImages = function CatalogImages(_ref) {
7192
7457
  };
7193
7458
 
7194
7459
  var wrapper$4 = "wrapper-3d2zl";
7460
+ var fullHeight = "full-height-CQ8Cy";
7195
7461
  var tabBar = "tab-bar-lQQ28";
7196
7462
  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";
7463
+ 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
7464
  styleInject(css_248z$5);
7199
7465
 
7200
7466
  var wrapper$3 = "wrapper-i9mNn";
@@ -7238,7 +7504,7 @@ function NothingFound (_ref) {
7238
7504
  children: [/*#__PURE__*/jsx(Typography$1, {
7239
7505
  variant: "body2",
7240
7506
  children: text
7241
- }), info && /*#__PURE__*/jsx(Alert, {
7507
+ }), info && /*#__PURE__*/jsx(Alert$2, {
7242
7508
  variant: "outlined",
7243
7509
  severity: "info",
7244
7510
  children: info
@@ -7250,7 +7516,8 @@ var ProductsOrArticles = function ProductsOrArticles(_ref) {
7250
7516
  var _scroller$current, _scroller$current2;
7251
7517
  var catalogCodex = _ref.catalogCodex,
7252
7518
  onProductClick = _ref.onProductClick,
7253
- hideProducts = _ref.hideProducts;
7519
+ hideProducts = _ref.hideProducts,
7520
+ hideImages = _ref.hideImages;
7254
7521
  var _useSellerState = useSellerState(),
7255
7522
  configurationData = _useSellerState.state.configurationData;
7256
7523
  var _useState = useState(0),
@@ -7329,21 +7596,10 @@ var ProductsOrArticles = function ProductsOrArticles(_ref) {
7329
7596
  favoriteProductsState.search[1](search);
7330
7597
  }
7331
7598
  };
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
- imageWrapperStyle: {
7340
- maxHeight: '200px'
7341
- }
7342
- }
7343
- });
7344
- var isEmpty = tab == 0 ? vzProductsState.groups.length == 0 : favoriteProductsState.groups.length == 0;
7599
+ if (hideAll) return /*#__PURE__*/jsx(Fragment, {});
7600
+ var isEmpty = selectedTab == 0 ? vzProductsState.groups.length == 0 : favoriteProductsState.groups.length == 0;
7345
7601
  return /*#__PURE__*/jsxs(Accordion, {
7346
- className: wrapper$4,
7602
+ className: classnames(wrapper$4, _defineProperty({}, fullHeight, hideImages)),
7347
7603
  expanded: shouldExpand,
7348
7604
  onChange: function onChange(_, exp) {
7349
7605
  return setExpanded(exp);
@@ -7357,7 +7613,7 @@ var ProductsOrArticles = function ProductsOrArticles(_ref) {
7357
7613
  children: [showVZProducts && /*#__PURE__*/jsx(Tab, {
7358
7614
  label: t('info.products.shared'),
7359
7615
  value: 0
7360
- }), /*#__PURE__*/jsx(Tab, {
7616
+ }), showFavoriteProducts && /*#__PURE__*/jsx(Tab, {
7361
7617
  label: t('info.products.favorite'),
7362
7618
  value: 1
7363
7619
  })]
@@ -7439,11 +7695,11 @@ function useModelInfoPage (_ref) {
7439
7695
  toggleLoading('seller-model-info', false, true);
7440
7696
  accountSessionId = undefined;
7441
7697
  if (!(organization.type === 'RETAILER')) {
7442
- _context.next = 13;
7698
+ _context.next = 14;
7443
7699
  break;
7444
7700
  }
7445
7701
  if (accountId) {
7446
- _context.next = 10;
7702
+ _context.next = 11;
7447
7703
  break;
7448
7704
  }
7449
7705
  LOG$3.errorTransaction('ON_OPEN_MODULE_INFO', 'SELLER_0001', 'Missing account ID', {
@@ -7452,33 +7708,46 @@ function useModelInfoPage (_ref) {
7452
7708
  });
7453
7709
  setLoading(false);
7454
7710
  toggleLoading('seller-model-info', false, false);
7711
+ openComponent({
7712
+ type: 'SELLER'
7713
+ });
7455
7714
  return _context.abrupt("return");
7456
- case 10:
7457
- _context.next = 12;
7715
+ case 11:
7716
+ _context.next = 13;
7458
7717
  return checkAccountLogin({
7459
7718
  accountId: accountId
7460
7719
  });
7461
- case 12:
7462
- accountSessionId = _context.sent;
7463
7720
  case 13:
7721
+ accountSessionId = _context.sent;
7722
+ case 14:
7464
7723
  if (!catalogCodex) {
7465
- _context.next = 21;
7724
+ _context.next = 26;
7466
7725
  break;
7467
7726
  }
7468
- _context.next = 16;
7727
+ _context.next = 17;
7469
7728
  return loadCatalogInfo({
7470
7729
  catalogCodex: catalogCodex,
7471
7730
  accountSessionId: accountSessionId,
7472
7731
  accountId: accountId,
7473
7732
  language: i18n.language || 'en'
7474
7733
  });
7475
- case 16:
7734
+ case 17:
7476
7735
  catalogInfoData = _context.sent;
7736
+ if (catalogInfoData) {
7737
+ _context.next = 22;
7738
+ break;
7739
+ }
7740
+ toggleLoading('seller-model-info', false, false);
7741
+ openComponent({
7742
+ type: 'SELLER'
7743
+ });
7744
+ return _context.abrupt("return");
7745
+ case 22:
7477
7746
  {
7478
- _context.next = 19;
7747
+ _context.next = 24;
7479
7748
  break;
7480
7749
  }
7481
- case 19:
7750
+ case 24:
7482
7751
  setData(catalogInfoData === null || catalogInfoData === void 0 ? void 0 : catalogInfoData[0]);
7483
7752
 
7484
7753
  //if there is no relevant catalog information, as a normal seller continue directly to the planner
@@ -7488,14 +7757,14 @@ function useModelInfoPage (_ref) {
7488
7757
  onOpenPlanner(accountSessionId);
7489
7758
  }
7490
7759
  }
7491
- case 21:
7760
+ case 26:
7492
7761
  LOG$3.successTransaction('ON_OPEN_MODULE_INFO', {
7493
7762
  cat: catalogCodex,
7494
7763
  accountId: accountId
7495
7764
  });
7496
7765
  setLoading(false);
7497
7766
  toggleLoading('seller-model-info', false, false);
7498
- case 24:
7767
+ case 29:
7499
7768
  case "end":
7500
7769
  return _context.stop();
7501
7770
  }
@@ -7630,7 +7899,8 @@ function Info(props) {
7630
7899
  }), /*#__PURE__*/jsx(ProductsOrArticles, {
7631
7900
  catalogCodex: catalogData.codex,
7632
7901
  onProductClick: onOpenPlannerWithProduct,
7633
- hideProducts: hideProducts
7902
+ hideProducts: hideProducts,
7903
+ hideImages: hideImage
7634
7904
  })]
7635
7905
  })]
7636
7906
  }), /*#__PURE__*/jsx("div", {
@@ -7691,10 +7961,16 @@ function Priceedit (_ref) {
7691
7961
  discount.percentageDiscount = isPercentage ? value : undefined;
7692
7962
  var price = (_productData$addedPri = productData.addedPrice) !== null && _productData$addedPri !== void 0 ? _productData$addedPri : 0;
7693
7963
  if (isPercentage) {
7694
- var discountPrice = (discount.percentageDiscount || 0) / 100 * price;
7695
- discount = _objectSpread$i(_objectSpread$i({}, discount), {}, {
7696
- calcDiscountPrice: formatTwoDecimals(price - discountPrice)
7697
- });
7964
+ if (discount.percentageDiscount == 0 || discount.percentageDiscount == undefined) {
7965
+ discount = _objectSpread$i(_objectSpread$i({}, discount), {}, {
7966
+ calcDiscountPrice: ''
7967
+ });
7968
+ } else {
7969
+ var discountPrice = (discount.percentageDiscount || 0) / 100 * price;
7970
+ discount = _objectSpread$i(_objectSpread$i({}, discount), {}, {
7971
+ calcDiscountPrice: formatTwoDecimals(price - discountPrice)
7972
+ });
7973
+ }
7698
7974
  } else {
7699
7975
  discount = _objectSpread$i(_objectSpread$i({}, discount), {}, {
7700
7976
  percentageDiscount: formatOneDecimals((price - value || 0) / price * 100)
@@ -7702,8 +7978,8 @@ function Priceedit (_ref) {
7702
7978
  }
7703
7979
  setDiscount(discount);
7704
7980
  update(_objectSpread$i(_objectSpread$i({}, productData), {}, {
7705
- discountedPrice: isPercentage ? formatTwoDecimals(discount.calcDiscountPrice) : value,
7706
- percentageDiscount: discount.percentageDiscount
7981
+ discountedPrice: isPercentage ? discount.calcDiscountPrice ? formatTwoDecimals(discount.calcDiscountPrice) : undefined : value,
7982
+ percentageDiscount: discount.percentageDiscount > 0 ? discount.percentageDiscount : undefined
7707
7983
  }));
7708
7984
  }, [productData, update]);
7709
7985
  function formatTwoDecimals(value) {
@@ -8778,9 +9054,9 @@ var CustomDataFields = function CustomDataFields(_ref) {
8778
9054
  children: [/*#__PURE__*/jsx(CardHeader, {
8779
9055
  title: t('seller.productcreator.customfields') + (productData.variantId !== undefined ? ' (' + t('productvariant') + ':' + productData.variantId + ')' : '')
8780
9056
  }), /*#__PURE__*/jsx(CardContent, {
8781
- children: /*#__PURE__*/jsxs(Box, {
9057
+ children: /*#__PURE__*/jsxs(Box$1, {
8782
9058
  children: [pairs.map(function (pair, index) {
8783
- return /*#__PURE__*/jsxs(Box, {
9059
+ return /*#__PURE__*/jsxs(Box$1, {
8784
9060
  className: wrapper$2,
8785
9061
  children: [/*#__PURE__*/jsx(TextField, {
8786
9062
  style: {
@@ -9237,9 +9513,15 @@ function BaseDataForm (_ref) {
9237
9513
  children: [/*#__PURE__*/jsx(CardHeader, {
9238
9514
  title: t('productcreator.basedata.prices')
9239
9515
  }), /*#__PURE__*/jsx(CardContent, {
9240
- children: /*#__PURE__*/jsx(Priceedit, {
9516
+ children: !hasVariants ? /*#__PURE__*/jsx(Priceedit, {
9241
9517
  productData: productData,
9242
9518
  update: update
9519
+ }) : /*#__PURE__*/jsxs(Alert, {
9520
+ variant: "outlined",
9521
+ severity: "info",
9522
+ children: [/*#__PURE__*/jsxs(AlertTitle, {
9523
+ children: [" ", t('productcreator.basedata.nopriceedittitle')]
9524
+ }), t('productcreator.basedata.nopriceeditdesc')]
9243
9525
  })
9244
9526
  })]
9245
9527
  })]
@@ -9803,7 +10085,6 @@ function VariantTable (_ref) {
9803
10085
  sortBy: [{
9804
10086
  id: getSortByIdField()
9805
10087
  }],
9806
- expanded: true,
9807
10088
  views: ['Table'],
9808
10089
  defaultView: 'Table',
9809
10090
  selectable: false,
@@ -9916,8 +10197,14 @@ function _preUpdateData(field, value, row) {
9916
10197
  var calcedValue = (price - myValue || 0) / price * 100;
9917
10198
  if (fieldName === 'percentageDiscount') {
9918
10199
  calcedField = 'discountedPrice';
9919
- var discountedPrice = Math.round((myValue || 0) / 100 * price);
9920
- calcedValue = price - discountedPrice;
10200
+ myValue = isNaN(myValue) ? 0 : myValue;
10201
+ if (myValue > 0) {
10202
+ var discountedPrice = Math.round(myValue / 100 * price);
10203
+ calcedValue = price - discountedPrice;
10204
+ } else {
10205
+ myValue = 0;
10206
+ calcedValue = undefined;
10207
+ }
9921
10208
  }
9922
10209
  return _objectSpread$7(_objectSpread$7({}, row.original), {}, _defineProperty(_defineProperty({}, fieldName, myValue), calcedField, calcedValue));
9923
10210
  }
@@ -9935,7 +10222,7 @@ function _preUpdateData(field, value, row) {
9935
10222
 
9936
10223
  var wrapper$1 = "wrapper-I8eY4";
9937
10224
  var dataTable = "data-table-ImAxQ";
9938
- 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";
10225
+ 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";
9939
10226
  styleInject(css_248z$2);
9940
10227
 
9941
10228
  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; }
@@ -11360,6 +11647,12 @@ function updateVariants(prevState, currentState, configurationData, baseDataFiel
11360
11647
  if (field == 'shortDescription' || field == ' customData') {
11361
11648
  //updated shortDescription as last value
11362
11649
  continue;
11650
+ } else if (field == 'discountedPrice' && (newVariant === null || newVariant === void 0 ? void 0 : newVariant['percentageDiscount']) === 0 && (newVariant === null || newVariant === void 0 ? void 0 : newVariant[field]) === undefined) {
11651
+ finalVariant[field] = undefined;
11652
+ newModified[field] = variant[field] !== undefined;
11653
+ } else if (field == 'percentageDiscount' && (newVariant === null || newVariant === void 0 ? void 0 : newVariant[field]) === 0) {
11654
+ finalVariant[field] = 0;
11655
+ newModified[field] = variant[field] !== 0;
11363
11656
  } else if (field == 'addedPrice' || field == 'calculatedPrice') {
11364
11657
  var _currentState$modifie;
11365
11658
  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]),