import { c as usePlannerUIHandler } from './index-bbdfb97a.js';
import classnames from 'classnames';
import { observer } from 'mobx-react-lite';
import 'react';
import { jsx } from 'react/jsx-runtime';
import '@babel/runtime/helpers/defineProperty';
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 'qrcode.react';
import '@babel/runtime/helpers/typeof';
import 'flat';
import 'react-switch';
import 'react-countup';

var DPACC = function DPACC(_ref) {
  var rect = _ref.rect,
    item = _ref.item,
    onElement = _ref.onElement,
    plannerUIProps = _ref.plannerUIProps;
  var plannerUIHandler = usePlannerUIHandler();
  var iconIsSelected = plannerUIHandler.getDPUIISSelected(item);
  return /*#__PURE__*/jsx("div", {
    ref: function ref(elem) {
      return onElement(elem);
    },
    onClick: function onClick() {
      var _item$clickFunction;
      plannerUIHandler.setDPUISelectionChanged(item, !iconIsSelected);
      (_item$clickFunction = item.clickFunction) === null || _item$clickFunction === void 0 || _item$clickFunction.call(item, item.setId, Number(item.elementId), item.dpId, !iconIsSelected, item.dockToElementId);
    },
    style: {
      left: item.position.interpretation == 'percentage' ? rect.left + '%' : rect.left + 'px',
      top: item.position.interpretation == 'percentage' ? rect.top + '%' : rect.top + 'px'
    },
    className: classnames(plannerUIProps.classes.buttonGeneral, item.plannerMode == '2D' ? item.dockingInfo == 'DOCKING' ? plannerUIProps.classes.dockingPoint.DPACC.dp2DAccDocking : plannerUIProps.classes.dockingPoint.DPACC.dp2DAccNotDocking : undefined, item.plannerMode == '2D' ? iconIsSelected && item.dockingInfo == 'NOT_DOCKING' ? plannerUIProps.classes.dockingPoint.DPACC.dp2DAccNotDockingSel : undefined : undefined, item.plannerMode == '3D' ? item.dockingInfo == 'DOCKING' ? plannerUIProps.classes.dockingPoint.DPACC.dp3DAccDocking : plannerUIProps.classes.dockingPoint.DPACC.dp3DAccNotDocking : undefined, item.plannerMode == '3D' ? iconIsSelected && item.dockingInfo == 'NOT_DOCKING' ? plannerUIProps.classes.dockingPoint.DPACC.dp3DAccNotDockingSel : undefined : undefined),
    children: item.posNr
  });
};
var DPACC$1 = observer(DPACC);

export { DPACC$1 as default };
