@crystaldesign/diva-seller 24.15.0-beta.9 → 24.15.0-rc.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 +631 -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,243 @@ 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 _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; }
5863
6040
  function CheckOut(_ref) {
5864
6041
  var _basket$Client;
5865
6042
  var schema = _ref.schema,
@@ -5873,6 +6050,9 @@ function CheckOut(_ref) {
5873
6050
  updateBasket = _ref.updateBasket,
5874
6051
  statusArray = _ref.statusArray,
5875
6052
  configSaveButtons = _ref.configSaveButtons,
6053
+ currentProduct = _ref.currentProduct,
6054
+ saveProduct = _ref.saveProduct,
6055
+ updateProductData = _ref.updateProductData,
5876
6056
  gdpr = _ref.gdpr;
5877
6057
  var _useState = useState(false),
5878
6058
  _useState2 = _slicedToArray(_useState, 2),
@@ -5880,16 +6060,8 @@ function CheckOut(_ref) {
5880
6060
  setIsSaving = _useState2[1];
5881
6061
  var _useState3 = useState(false),
5882
6062
  _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];
6063
+ basket3DExportChecked = _useState4[0],
6064
+ setBasket3DExportChecked = _useState4[1];
5893
6065
  var _useTranslation = useTranslation(),
5894
6066
  t = _useTranslation.t;
5895
6067
  var _useSellerState = useSellerState(),
@@ -5899,117 +6071,41 @@ function CheckOut(_ref) {
5899
6071
  userHasPermission = _useDivaCore$actions.userHasPermission,
5900
6072
  toggleLoading = _useDivaCore$actions.toggleLoading,
5901
6073
  openModal = _useDivaCore$actions.openModal,
5902
- productHandler = _useDivaCore.handler.productHandler,
5903
6074
  _useDivaCore$state = _useDivaCore.state,
5904
6075
  apiConfig = _useDivaCore$state.apiConfig,
5905
6076
  jwt = _useDivaCore$state.jwt,
5906
6077
  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;
6078
+ var handleSave = useCallback(/*#__PURE__*/function () {
6079
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(openPDF, sendMail, isFav) {
5939
6080
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
5940
6081
  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
6082
  case 0:
5975
6083
  if (!(status === 'BASE_CONFIGURATION')) {
5976
- _context4.next = 13;
5977
- break;
5978
- }
5979
- if (!hqMedia) {
5980
- _context4.next = 6;
6084
+ _context2.next = 7;
5981
6085
  break;
5982
6086
  }
5983
- _context4.next = 4;
5984
- return saveProductAndShowHqMedia();
5985
- case 4:
5986
- _context4.next = 11;
5987
- break;
5988
- case 6:
5989
6087
  toggleLoading('saveProduct');
5990
- _context4.next = 9;
5991
- return saveProduct(favourite);
5992
- case 9:
6088
+ _context2.next = 4;
6089
+ return saveProduct(isFav);
6090
+ case 4:
5993
6091
  toggleLoading('saveProduct');
5994
6092
  openModal({
5995
6093
  title: t('basket.checkout.productsavedtitle'),
5996
6094
  accept: true,
5997
6095
  text: t('basket.checkout.productsavedtext')
5998
6096
  });
5999
- case 11:
6000
- setIsSaved(true);
6001
- return _context4.abrupt("return");
6002
- case 13:
6097
+ return _context2.abrupt("return");
6098
+ case 7:
6003
6099
  if (!isSaving) {
6004
6100
  setIsSaving(true);
6005
6101
  onClickSave(openPDF, sendMail).then(/*#__PURE__*/function () {
6006
- var _ref5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(p) {
6102
+ var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(p) {
6007
6103
  var newRenderJob;
6008
- return _regeneratorRuntime.wrap(function _callee3$(_context3) {
6009
- while (1) switch (_context3.prev = _context3.next) {
6104
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
6105
+ while (1) switch (_context.prev = _context.next) {
6010
6106
  case 0:
6011
6107
  if (!basket3DExportChecked) {
6012
- _context3.next = 4;
6108
+ _context.next = 4;
6013
6109
  break;
6014
6110
  }
6015
6111
  newRenderJob = {
@@ -6019,7 +6115,7 @@ function CheckOut(_ref) {
6019
6115
  diva3DProject: basket.Diva3DProject ? atob(basket.Diva3DProject) : undefined,
6020
6116
  hQRenderScript: basket.OrderSets[0].HQRenderScript
6021
6117
  };
6022
- _context3.next = 4;
6118
+ _context.next = 4;
6023
6119
  return apiSaveRenderJobs({
6024
6120
  serviceUrl: apiConfig.mediaService,
6025
6121
  jobs: [newRenderJob],
@@ -6029,43 +6125,36 @@ function CheckOut(_ref) {
6029
6125
  setIsSaving(false);
6030
6126
  case 5:
6031
6127
  case "end":
6032
- return _context3.stop();
6128
+ return _context.stop();
6033
6129
  }
6034
- }, _callee3);
6130
+ }, _callee);
6035
6131
  }));
6036
- return function (_x5) {
6037
- return _ref5.apply(this, arguments);
6132
+ return function (_x4) {
6133
+ return _ref3.apply(this, arguments);
6038
6134
  };
6039
6135
  }())["catch"](function () {
6040
6136
  return setIsSaving(false);
6041
6137
  });
6042
6138
  }
6043
- case 14:
6139
+ case 8:
6044
6140
  case "end":
6045
- return _context4.stop();
6141
+ return _context2.stop();
6046
6142
  }
6047
- }, _callee4);
6143
+ }, _callee2);
6048
6144
  }));
6049
- return function (_x, _x2, _x3, _x4) {
6050
- return _ref4.apply(this, arguments);
6145
+ return function (_x, _x2, _x3) {
6146
+ return _ref2.apply(this, arguments);
6051
6147
  };
6052
6148
  }(), [isSaving, onClickSave, basket3DExportChecked]);
6053
- var onChangeForm = function onChangeForm(_ref6) {
6054
- var data = _ref6.data;
6149
+ var onChangeForm = function onChangeForm(_ref4) {
6150
+ var data = _ref4.data;
6055
6151
  for (var key in data) {
6056
6152
  basket[key] = data[key];
6057
6153
  }
6058
6154
  };
6059
- var onErrorHqMedia = function onErrorHqMedia(error) {
6060
- openModal({
6061
- title: t('Error'),
6062
- accept: true,
6063
- text: t('basket.checkout.errorhqmediatext')
6064
- });
6065
- };
6066
6155
 
6067
6156
  // for LEAFLET don't show printOptions, if there are any configured.
6068
- var finalSchema = _objectSpread$r(_objectSpread$r({}, uiSchema), {}, {
6157
+ var finalSchema = _objectSpread$s(_objectSpread$s({}, uiSchema), {}, {
6069
6158
  elements: _toConsumableArray(uiSchema.elements)
6070
6159
  });
6071
6160
  if (status == 'LEAFLET') {
@@ -6097,63 +6186,15 @@ function CheckOut(_ref) {
6097
6186
  }), /*#__PURE__*/jsx(StatusMenu, {
6098
6187
  visibleStatus: statusArray,
6099
6188
  status: status,
6100
- setStatus: setStatus,
6101
- productSaved: isSaved
6189
+ setStatus: setStatus
6102
6190
  })]
6103
6191
  }), /*#__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, {
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, {
6157
6198
  children: [/*#__PURE__*/jsx("div", {
6158
6199
  style: {
6159
6200
  margin: '1rem',
@@ -6170,7 +6211,7 @@ function CheckOut(_ref) {
6170
6211
  }), !!renderService && permissionAnyHqRenderBox && (catalogData === null || catalogData === void 0 ? void 0 : catalogData[0].has3D) && /*#__PURE__*/jsx(HqRenderBox, {
6171
6212
  basket: basket,
6172
6213
  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", {
6214
+ }), (catalogData === null || catalogData === void 0 ? void 0 : catalogData[0].has3D) && organization.settings.enable3DExport && /*#__PURE__*/jsxs("div", {
6174
6215
  style: {
6175
6216
  marginLeft: '50px',
6176
6217
  width: '700px'
@@ -6198,7 +6239,7 @@ function CheckOut(_ref) {
6198
6239
  })
6199
6240
  })]
6200
6241
  })]
6201
- }), !showRenderJobs && /*#__PURE__*/jsx(SaveButtonsGroup, {
6242
+ }), status !== 'BASE_CONFIGURATION' && /*#__PURE__*/jsx(SaveButtonsGroup, {
6202
6243
  orderEmpty: !basket.OrderSets || basket.OrderSets.length == 0 || gdpr && !isEmpty(basket === null || basket === void 0 ? void 0 : basket.Client) && !basket.Gdpr,
6203
6244
  onClickSave: handleSave,
6204
6245
  startWithEmptyBasket: startWithEmptyBasket,
@@ -6222,12 +6263,12 @@ function isEmpty(data) {
6222
6263
  });
6223
6264
  }
6224
6265
 
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; }
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; }
6227
6268
  var schema = function schema(hideWWSButton) {
6228
6269
  return {
6229
6270
  type: 'object',
6230
- properties: _objectSpread$q(_objectSpread$q({
6271
+ properties: _objectSpread$r(_objectSpread$r({
6231
6272
  Salesperson: {
6232
6273
  type: 'string',
6233
6274
  title: 'basket.checkout.form.seller'
@@ -6462,7 +6503,10 @@ function Step3Checkout(_ref) {
6462
6503
  status = _ref.status,
6463
6504
  setStatus = _ref.setStatus,
6464
6505
  statusArray = _ref.statusArray,
6465
- config = _ref.config;
6506
+ config = _ref.config,
6507
+ currentProduct = _ref.currentProduct,
6508
+ saveProduct = _ref.saveProduct,
6509
+ updateProductData = _ref.updateProductData;
6466
6510
  var _useDivaCore = useDivaCore(),
6467
6511
  organization = _useDivaCore.state.organization;
6468
6512
  return /*#__PURE__*/jsx(CheckOut, {
@@ -6477,19 +6521,225 @@ function Step3Checkout(_ref) {
6477
6521
  updateBasket: updateBasket,
6478
6522
  renderService: config === null || config === void 0 || (_config$checkout3 = config.checkout) === null || _config$checkout3 === void 0 ? void 0 : _config$checkout3.renderService,
6479
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'],
6480
- 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
6528
+ });
6529
+ }
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]
6481
6616
  });
6482
6617
  }
6483
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
+
6484
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; }
6485
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; }
6486
6737
  var LOG$4 = getLogger('SellerBasket', 'Basket');
6487
6738
  function Basket(_ref) {
6488
- var _configurationData$Ch5;
6739
+ var _currentProduct$divaN, _configurationData$Ch5, _currentBasket$OrderS5;
6489
6740
  var divaNr = _ref.divaNr,
6490
6741
  basket = _ref.basket,
6491
6742
  checkBasket = _ref.checkBasket;
6492
- //Hooks
6493
6743
  var _useState = useState('Step1'),
6494
6744
  _useState2 = _slicedToArray(_useState, 2),
6495
6745
  actBasketPage = _useState2[0],
@@ -6523,6 +6773,11 @@ function Basket(_ref) {
6523
6773
  openModal = _useSellerState$actio.openModal,
6524
6774
  sendEmail = _useSellerState$actio.sendEmail,
6525
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;
6526
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 : '');
6527
6782
  useEffect(function () {
6528
6783
  if (!basket) DivaUtils$1.businessMetrics.setConfiguratorSessionId();
@@ -6699,6 +6954,7 @@ function Basket(_ref) {
6699
6954
  message: t('basket.checkout.pdfqr'),
6700
6955
  type: 'big',
6701
6956
  clickable: true,
6957
+ qrCodeSize: 312,
6702
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
6703
6959
  });
6704
6960
  }
@@ -6864,9 +7120,9 @@ function Basket(_ref) {
6864
7120
  },
6865
7121
  children: [/*#__PURE__*/jsx(Header$1, {
6866
7122
  config: configurationData === null || configurationData === void 0 ? void 0 : configurationData.Checkout,
6867
- status: statusRef.current,
7123
+ status: currentBasket.Status,
6868
7124
  documentVersion: currentBasket.getDocumentVersion(),
6869
- divaNr: currentBasket.DivaNr,
7125
+ divaNr: currentBasket.Status == 'BASE_CONFIGURATION' && currentProduct ? (_currentProduct$divaN = currentProduct.divaNr) !== null && _currentProduct$divaN !== void 0 ? _currentProduct$divaN : '' : currentBasket.DivaNr,
6870
7126
  actBasketPage: actBasketPage,
6871
7127
  setActBasketPage: setActBasketPage,
6872
7128
  showVKPExportButton: !!(vkpExportData !== null && vkpExportData !== void 0 && vkpExportData.callbackurl) || !!(configurationData !== null && configurationData !== void 0 && configurationData.VKPExportUrl),
@@ -6905,7 +7161,18 @@ function Basket(_ref) {
6905
7161
  onClickSave: onClickSave,
6906
7162
  statusArray: getBasketStatusArr(),
6907
7163
  updateBasket: update,
6908
- 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
6909
7176
  })]
6910
7177
  })]
6911
7178
  });
@@ -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,21 +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
- imageWrapperStyle: {
7340
- maxHeight: '200px'
7341
- }
7342
- }
7343
- });
7344
- 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;
7345
7603
  return /*#__PURE__*/jsxs(Accordion, {
7346
- className: wrapper$4,
7604
+ className: classnames(wrapper$4, _defineProperty({}, fullHeight, hideImages)),
7347
7605
  expanded: shouldExpand,
7348
7606
  onChange: function onChange(_, exp) {
7349
7607
  return setExpanded(exp);
@@ -7357,7 +7615,7 @@ var ProductsOrArticles = function ProductsOrArticles(_ref) {
7357
7615
  children: [showVZProducts && /*#__PURE__*/jsx(Tab, {
7358
7616
  label: t('info.products.shared'),
7359
7617
  value: 0
7360
- }), /*#__PURE__*/jsx(Tab, {
7618
+ }), showFavoriteProducts && /*#__PURE__*/jsx(Tab, {
7361
7619
  label: t('info.products.favorite'),
7362
7620
  value: 1
7363
7621
  })]
@@ -7439,11 +7697,11 @@ function useModelInfoPage (_ref) {
7439
7697
  toggleLoading('seller-model-info', false, true);
7440
7698
  accountSessionId = undefined;
7441
7699
  if (!(organization.type === 'RETAILER')) {
7442
- _context.next = 13;
7700
+ _context.next = 14;
7443
7701
  break;
7444
7702
  }
7445
7703
  if (accountId) {
7446
- _context.next = 10;
7704
+ _context.next = 11;
7447
7705
  break;
7448
7706
  }
7449
7707
  LOG$3.errorTransaction('ON_OPEN_MODULE_INFO', 'SELLER_0001', 'Missing account ID', {
@@ -7452,33 +7710,46 @@ function useModelInfoPage (_ref) {
7452
7710
  });
7453
7711
  setLoading(false);
7454
7712
  toggleLoading('seller-model-info', false, false);
7713
+ openComponent({
7714
+ type: 'SELLER'
7715
+ });
7455
7716
  return _context.abrupt("return");
7456
- case 10:
7457
- _context.next = 12;
7717
+ case 11:
7718
+ _context.next = 13;
7458
7719
  return checkAccountLogin({
7459
7720
  accountId: accountId
7460
7721
  });
7461
- case 12:
7462
- accountSessionId = _context.sent;
7463
7722
  case 13:
7723
+ accountSessionId = _context.sent;
7724
+ case 14:
7464
7725
  if (!catalogCodex) {
7465
- _context.next = 21;
7726
+ _context.next = 26;
7466
7727
  break;
7467
7728
  }
7468
- _context.next = 16;
7729
+ _context.next = 17;
7469
7730
  return loadCatalogInfo({
7470
7731
  catalogCodex: catalogCodex,
7471
7732
  accountSessionId: accountSessionId,
7472
7733
  accountId: accountId,
7473
7734
  language: i18n.language || 'en'
7474
7735
  });
7475
- case 16:
7736
+ case 17:
7476
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:
7477
7748
  {
7478
- _context.next = 19;
7749
+ _context.next = 24;
7479
7750
  break;
7480
7751
  }
7481
- case 19:
7752
+ case 24:
7482
7753
  setData(catalogInfoData === null || catalogInfoData === void 0 ? void 0 : catalogInfoData[0]);
7483
7754
 
7484
7755
  //if there is no relevant catalog information, as a normal seller continue directly to the planner
@@ -7488,14 +7759,14 @@ function useModelInfoPage (_ref) {
7488
7759
  onOpenPlanner(accountSessionId);
7489
7760
  }
7490
7761
  }
7491
- case 21:
7762
+ case 26:
7492
7763
  LOG$3.successTransaction('ON_OPEN_MODULE_INFO', {
7493
7764
  cat: catalogCodex,
7494
7765
  accountId: accountId
7495
7766
  });
7496
7767
  setLoading(false);
7497
7768
  toggleLoading('seller-model-info', false, false);
7498
- case 24:
7769
+ case 29:
7499
7770
  case "end":
7500
7771
  return _context.stop();
7501
7772
  }
@@ -7630,7 +7901,8 @@ function Info(props) {
7630
7901
  }), /*#__PURE__*/jsx(ProductsOrArticles, {
7631
7902
  catalogCodex: catalogData.codex,
7632
7903
  onProductClick: onOpenPlannerWithProduct,
7633
- hideProducts: hideProducts
7904
+ hideProducts: hideProducts,
7905
+ hideImages: hideImage
7634
7906
  })]
7635
7907
  })]
7636
7908
  }), /*#__PURE__*/jsx("div", {
@@ -7691,10 +7963,16 @@ function Priceedit (_ref) {
7691
7963
  discount.percentageDiscount = isPercentage ? value : undefined;
7692
7964
  var price = (_productData$addedPri = productData.addedPrice) !== null && _productData$addedPri !== void 0 ? _productData$addedPri : 0;
7693
7965
  if (isPercentage) {
7694
- var discountPrice = (discount.percentageDiscount || 0) / 100 * price;
7695
- discount = _objectSpread$i(_objectSpread$i({}, discount), {}, {
7696
- calcDiscountPrice: formatTwoDecimals(price - discountPrice)
7697
- });
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
+ }
7698
7976
  } else {
7699
7977
  discount = _objectSpread$i(_objectSpread$i({}, discount), {}, {
7700
7978
  percentageDiscount: formatOneDecimals((price - value || 0) / price * 100)
@@ -7702,8 +7980,8 @@ function Priceedit (_ref) {
7702
7980
  }
7703
7981
  setDiscount(discount);
7704
7982
  update(_objectSpread$i(_objectSpread$i({}, productData), {}, {
7705
- discountedPrice: isPercentage ? formatTwoDecimals(discount.calcDiscountPrice) : value,
7706
- percentageDiscount: discount.percentageDiscount
7983
+ discountedPrice: isPercentage ? discount.calcDiscountPrice ? formatTwoDecimals(discount.calcDiscountPrice) : undefined : value,
7984
+ percentageDiscount: discount.percentageDiscount > 0 ? discount.percentageDiscount : undefined
7707
7985
  }));
7708
7986
  }, [productData, update]);
7709
7987
  function formatTwoDecimals(value) {
@@ -8778,9 +9056,9 @@ var CustomDataFields = function CustomDataFields(_ref) {
8778
9056
  children: [/*#__PURE__*/jsx(CardHeader, {
8779
9057
  title: t('seller.productcreator.customfields') + (productData.variantId !== undefined ? ' (' + t('productvariant') + ':' + productData.variantId + ')' : '')
8780
9058
  }), /*#__PURE__*/jsx(CardContent, {
8781
- children: /*#__PURE__*/jsxs(Box, {
9059
+ children: /*#__PURE__*/jsxs(Box$1, {
8782
9060
  children: [pairs.map(function (pair, index) {
8783
- return /*#__PURE__*/jsxs(Box, {
9061
+ return /*#__PURE__*/jsxs(Box$1, {
8784
9062
  className: wrapper$2,
8785
9063
  children: [/*#__PURE__*/jsx(TextField, {
8786
9064
  style: {
@@ -9237,9 +9515,15 @@ function BaseDataForm (_ref) {
9237
9515
  children: [/*#__PURE__*/jsx(CardHeader, {
9238
9516
  title: t('productcreator.basedata.prices')
9239
9517
  }), /*#__PURE__*/jsx(CardContent, {
9240
- children: /*#__PURE__*/jsx(Priceedit, {
9518
+ children: !hasVariants ? /*#__PURE__*/jsx(Priceedit, {
9241
9519
  productData: productData,
9242
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')]
9243
9527
  })
9244
9528
  })]
9245
9529
  })]
@@ -9803,7 +10087,6 @@ function VariantTable (_ref) {
9803
10087
  sortBy: [{
9804
10088
  id: getSortByIdField()
9805
10089
  }],
9806
- expanded: true,
9807
10090
  views: ['Table'],
9808
10091
  defaultView: 'Table',
9809
10092
  selectable: false,
@@ -9916,8 +10199,14 @@ function _preUpdateData(field, value, row) {
9916
10199
  var calcedValue = (price - myValue || 0) / price * 100;
9917
10200
  if (fieldName === 'percentageDiscount') {
9918
10201
  calcedField = 'discountedPrice';
9919
- var discountedPrice = Math.round((myValue || 0) / 100 * price);
9920
- 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
+ }
9921
10210
  }
9922
10211
  return _objectSpread$7(_objectSpread$7({}, row.original), {}, _defineProperty(_defineProperty({}, fieldName, myValue), calcedField, calcedValue));
9923
10212
  }
@@ -9935,7 +10224,7 @@ function _preUpdateData(field, value, row) {
9935
10224
 
9936
10225
  var wrapper$1 = "wrapper-I8eY4";
9937
10226
  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";
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";
9939
10228
  styleInject(css_248z$2);
9940
10229
 
9941
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; }
@@ -11360,6 +11649,12 @@ function updateVariants(prevState, currentState, configurationData, baseDataFiel
11360
11649
  if (field == 'shortDescription' || field == ' customData') {
11361
11650
  //updated shortDescription as last value
11362
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;
11363
11658
  } else if (field == 'addedPrice' || field == 'calculatedPrice') {
11364
11659
  var _currentState$modifie;
11365
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]),