import _defineProperty from '@babel/runtime/helpers/defineProperty';
import _objectDestructuringEmpty from '@babel/runtime/helpers/objectDestructuringEmpty';
import { s as styleInject, u as useViewHandler, a as useAnalyzerComponents, M as MissingAnalyzerComponent } from './index-bbdfb97a.js';
import { observer } from 'mobx-react-lite';
import { useEffect, createElement } from 'react';
import Product from './index-fb306b96.js';
import Sidebar from './index-1d8ae9f0.js';
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
import 'react-dynamic-multi-render';
import '@crystaldesign/diva-core';
import '@babel/runtime/helpers/asyncToGenerator';
import '@babel/runtime/helpers/slicedToArray';
import '@babel/runtime/helpers/objectWithoutProperties';
import '@babel/runtime/regenerator';
import '@babel/runtime/helpers/classCallCheck';
import '@babel/runtime/helpers/createClass';
import '@babel/runtime/helpers/toConsumableArray';
import '@crystaldesign/diva-utils';
import 'mobx';
import '@crystaldesign/web-planner-logic';
import 'classnames';
import 'qrcode.react';
import '@babel/runtime/helpers/typeof';
import 'flat';
import 'react-switch';
import 'react-countup';
import './index-8e04211b.js';
import './index-b28b0372.js';
import '@crystaldesign/content-item';
import './index-6941ff10.js';
import './index-e8768440.js';
import './index-105eab2c.js';
import 'sift';
import './index-0d3bfd91.js';
import './index-2b5bdfe1.js';
import './index-caff71dc.js';
import './index-5cb692e9.js';
import './index.module-d6f043d2.js';
import './index-04a7a9b4.js';
import './index-755074ae.js';
import '@mui/icons-material/Block';
import '@mui/icons-material/Warning';
import './index-db439036.js';
import 'react-dropdown';
import './index-7f2e9c31.js';
import './index-4b3e6bbf.js';
import './index-69271b96.js';
import './index-9a965a68.js';
import '@crystaldesign/content-box';
import './index-e9a81262.js';
import './index-2f37b9f2.js';
import './index-bea5c228.js';
import './index-014a5003.js';
import 'swiper/react';
import 'swiper/modules';
import './UnlockCard-575022e0.js';
import './index-ce21cd4d.js';
import './index-6a697eea.js';
import './index-ea5e3e90.js';
import './index-69fd5e9e.js';
import './index-079ef135.js';
import './index-4b48794b.js';
import 'react-laag';
import './index.module-25687dd9.js';
import './index-3f40a92d.js';
import './index-66fd1759.js';
import './index-8a330776.js';
import './index-4fda4c71.js';
import './index-d896efe9.js';
import './index.module-fe49e10f.js';
import './index-6051ac01.js';
import './index-ec31a7cb.js';
import './index-79fbb400.js';
import './index-2e39dac3.js';
import './index-1641324b.js';
import './index-7635bafb.js';
import './index-0e0e6ac6.js';
import './index-a1cef81d.js';
import './index-4c03ac5c.js';
import './index-10d8be2f.js';
import './index-b7364bb1.js';
import './index-a253bbbf.js';
import './index-4ca1affe.js';
import 'rc-slider';
import './index-c44088dc.js';
import './index-e4d1ba18.js';
import './index-d5bb9bda.js';
import './index-dd2aabd2.js';
import './index-eb98a8c6.js';
import 'react-confetti-explosion';
import './index-d0331808.js';
import './index-7167c5bc.js';
import './index-5a146745.js';
import 'react-qr-code';
import './index-c648d661.js';
import './useCustomDimensions-8be02680.js';
import './index-c0a41b5b.js';
import './ussIsSticky-2f6bc37b.js';
import './index-290c519e.js';
import './index-be7a52a8.js';
import './index-9c4f9dc2.js';
import './index.module-613d19d3.js';
import './index-23081351.js';
import './index-b14a4a7c.js';
import './index-fdf81349.js';
import './index-688fe1aa.js';
import './index-49b01da7.js';
import './index-f4a37353.js';
import './index-59c6de33.js';
import './index-b788a35a.js';
import './index-51c25e6a.js';
import './index-10375806.js';
import './index.module-19cb4aaa.js';
import './index-0c88d91e.js';
import './index-0980b4b8.js';
import './index-2d9c2031.js';
import './index-9c4fe1ee.js';
import './index-dc78191b.js';
import './index-aa356ee3.js';
import './index-428e2823.js';
import './index-2da144c0.js';
import './index-7a15caf2.js';
import './index-db051102.js';
import './index-f879f2c4.js';

var list = "list-N44Jp";
var css_248z = ".whole-wrapper-5OM64 {\n  position: absolute;\n  margin-left: 50px;\n  height: 92%;\n  background-color: var(--settingsBackgroundColor);\n  padding-left: 5px;\n  overflow: auto;\n  display: flex;\n  flex-direction: column;\n  box-shadow: inset 0px 4px 40px 1px rgba(0, 0, 0, 0.1);\n  border-right: 2px solid;\n  -webkit-user-select: text;\n     -moz-user-select: text;\n          user-select: text;\n}\n.not-expanded-A0UYP {\n  width: calc(25.5%) !important;\n}\n.not-expanded-A0UYP {\n  background-color: white;\n}\n.list-N44Jp {\n  width: calc(63% - 50px) !important;\n}\n.list-N44Jp {\n  z-index: 590;\n  background-color: rgba(250, 250, 250, 0.5);\n  margin-left: 50px;\n  /*width: calc(69% - 50px); pfister*/\n}\n";
styleInject(css_248z);

function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
var WINDOW_TO_COMPONENT = {
  Options: 'OptionTree',
  PartList: 'PartListTable',
  DecisionAnalyzer: 'DecisionAnalyzer',
  PriceAnalyzer: 'PriceAnalyzer',
  'Artikelübersicht': 'ArticleOverview',
  'SVGübersicht': 'SVGAnalyzer',
  ekText: 'EkTextViewer',
  CatalogMakeup: 'CatalogMakeup',
  RTVAnalyzer: 'RTVAnalyzer',
  J3DEditor: 'J3DEditor',
  PropertiesEditor: 'PropertiesEditor',
  GridOverview: 'GridOverview'
};
var CatalogProduct = function CatalogProduct(_ref) {
  var props = Object.assign({}, (_objectDestructuringEmpty(_ref), _ref));
  var viewHandler = useViewHandler();
  var analyzerComponents = useAnalyzerComponents();
  var changeVal = function changeVal(newValue) {
    localStorage.setItem('lastWindow', newValue);
    viewHandler.uiState.setActiveCatalogSection(newValue);
  };
  useEffect(function () {
    switch (viewHandler.uiState.activeCatalogSection) {
      case 'Options':
        viewHandler.uiState.setConfigSettingsIsExpanded(true);
        break;
      case 'ekText':
      case '3D/2D':
      case 'PartList':
      case 'Artikelübersicht':
      case 'SVGübersicht':
      case 'DecisionAnalyzer':
      case 'CatalogMakeup':
      case 'RTVAnalyzer':
      case 'J3DEditor':
      case 'PropertiesEditor':
      case 'GridOverview':
        viewHandler.uiState.setConfigSettingsIsExpanded(false);
        break;
    }
  }, [viewHandler.uiState.activeCatalogSection]);
  useEffect(function () {
    if (viewHandler.getIsInMobileView()) viewHandler.uiState.setActiveCatalogSection('3D/2D');
  }, []);
  var section = viewHandler.uiState.activeCatalogSection;
  var classname = props.className + ' ' + list;
  var activeWindow = undefined;
  if (section !== '3D/2D') {
    var componentKey = WINDOW_TO_COMPONENT[section];
    if (componentKey) {
      var Component = analyzerComponents[componentKey];
      if (Component) {
        var extraProps = section === 'Options' ? {
          style: {
            zIndex: 700
          }
        } : {
          className: classname
        };
        activeWindow = /*#__PURE__*/jsx(Component, _objectSpread(_objectSpread({}, props), extraProps));
      } else {
        activeWindow = /*#__PURE__*/jsx(MissingAnalyzerComponent, {
          name: componentKey
        });
      }
    }
  }
  return /*#__PURE__*/jsxs(Fragment, {
    children: [!viewHandler.uiState.isInMobileView && /*#__PURE__*/jsx(Sidebar, _objectSpread(_objectSpread({}, props), {}, {
      currentWindowActive: viewHandler.uiState.activeCatalogSection,
      setCurrentWindowActive: changeVal
    })), /*#__PURE__*/createElement(Product, _objectSpread(_objectSpread({}, props), {}, {
      style: {
        boxSizing: 'border-box',
        borderLeft: !viewHandler.uiState.isInMobileView ? '50px solid transparent' : undefined
      },
      key: 'product'
    })), activeWindow]
  });
};
var index = observer(CatalogProduct);

export { index as default };
