"use strict";

function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
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; }
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
// GHS CRM — Stap 2 · Dakplan-module met legplan
// Eén gedeelde setup (bovenbalk → klikbare legplan-kaarten → dakvlak-editor → systeem/afwerking),
// in 4 teken-stijlen voor het legplan: Perspectief (3D), Bovenaanzicht, Blueprint, Realistisch.
// Legplan zit in de state (rows/cols/orient) zodat het mee in de offerte gaat.
// Hergebruikt FSysteem/FDc/FAansluiting/FKeuring/FExtras/FMarge (v1), PillGroup (v2), Lbl.

/* ───────────── legplan helpers ───────────── */
var PANEL_M = {
  portrait: {
    w: 1.13,
    h: 1.76
  },
  landscape: {
    w: 1.76,
    h: 1.13
  }
};
var dvGrid = function dvGrid(dv) {
  var orient = dv.orient || 'portrait';
  var cols = dv.cols,
    rows = dv.rows;
  if (!cols || !rows) {
    var n = Math.max(1, dv.panelen || 1);
    cols = Math.max(1, Math.min(n, orient === 'landscape' ? 5 : 7));
    rows = Math.max(1, Math.ceil(n / cols));
  }
  return {
    rows: rows,
    cols: cols,
    orient: orient
  };
};
var roofDims = function roofDims(g) {
  var p = PANEL_M[g.orient];
  return {
    w: g.cols * p.w,
    h: g.rows * p.h
  };
};

/* Visuele paneel-raster — mode: persp | flat | blueprint | realistic | mini */
var LegplanGrid = function LegplanGrid(_ref) {
  var rows = _ref.rows,
    cols = _ref.cols,
    orient = _ref.orient,
    _ref$active = _ref.active,
    active = _ref$active === void 0 ? true : _ref$active,
    _ref$mode = _ref.mode,
    mode = _ref$mode === void 0 ? 'flat' : _ref$mode,
    _ref$scale = _ref.scale,
    scale = _ref$scale === void 0 ? 1 : _ref$scale;
  var base = orient === 'landscape' ? {
    w: 22,
    h: 13
  } : {
    w: 13,
    h: 22
  };
  var isMini = mode === 'mini';
  var cap = isMini ? 0.58 : 1;
  var cell = {
    w: base.w * scale * cap,
    h: base.h * scale * cap
  };
  var gap = Math.max(1, 2 * scale * cap);
  var cellStyle = function () {
    if (mode === 'blueprint') return {
      background: 'rgba(0,217,0,0.05)',
      border: "1px solid ".concat(active ? 'rgba(0,217,0,0.85)' : 'rgba(0,217,0,0.4)'),
      borderRadius: 1
    };
    if (mode === 'realistic') return {
      background: 'linear-gradient(135deg, rgba(10,60,80,0.95) 0%, rgba(6,70,62,0.85) 55%, rgba(3,40,36,0.95) 100%)',
      border: '1px solid rgba(170,225,255,0.32)',
      borderRadius: 2,
      boxShadow: 'inset 0 1px 2px rgba(255,255,255,0.18), inset 0 -1px 2px rgba(0,0,0,0.3)'
    };
    return {
      background: active ? 'rgba(0,217,0,0.42)' : 'rgba(0,217,0,0.18)',
      border: "1px solid ".concat(active ? '#00D900' : 'rgba(0,217,0,0.38)'),
      borderRadius: 1.5,
      boxShadow: active && !isMini ? '0 0 4px rgba(0,217,0,0.3)' : 'none'
    };
  }();
  var grid = /*#__PURE__*/React.createElement("div", {
    style: {
      display: 'grid',
      gridTemplateColumns: "repeat(".concat(cols, ", ").concat(cell.w, "px)"),
      gap: gap,
      justifyContent: 'center'
    }
  }, Array.from({
    length: rows * cols
  }).map(function (_, i) {
    return /*#__PURE__*/React.createElement("div", {
      key: i,
      style: _objectSpread({
        width: cell.w,
        height: cell.h
      }, cellStyle)
    });
  }));
  if (mode === 'persp') return /*#__PURE__*/React.createElement("div", {
    style: {
      perspective: 640,
      padding: '8px 4px'
    }
  }, /*#__PURE__*/React.createElement("div", {
    style: {
      transform: 'rotateX(46deg)',
      transformOrigin: 'center bottom'
    }
  }, grid));
  if (mode === 'blueprint') return /*#__PURE__*/React.createElement("div", {
    style: {
      padding: 14,
      background: 'repeating-linear-gradient(0deg, rgba(0,217,0,0.06) 0 1px, transparent 1px 15px), repeating-linear-gradient(90deg, rgba(0,217,0,0.06) 0 1px, transparent 1px 15px), #02120e',
      border: "1px solid ".concat(active ? 'rgba(0,217,0,0.5)' : T.stroke1),
      clipPath: cutPath(10),
      display: 'inline-block'
    }
  }, grid);
  if (mode === 'realistic') return /*#__PURE__*/React.createElement("div", {
    style: {
      padding: 12,
      background: 'linear-gradient(180deg,#0b1512,#05100c)',
      border: "1px solid ".concat(active ? T.strokeAccent : T.stroke1),
      clipPath: cutPath(10),
      display: 'inline-block',
      boxShadow: 'inset 0 0 24px rgba(0,0,0,0.4)'
    }
  }, grid);
  if (mode === 'flat') return /*#__PURE__*/React.createElement("div", {
    style: {
      padding: 12,
      background: 'rgba(0,0,0,0.25)',
      border: "1px solid ".concat(active ? T.strokeAccent : T.stroke1),
      clipPath: cutPath(10),
      display: 'inline-block'
    }
  }, grid);
  return grid;
};
var GridControls = function GridControls(_ref2) {
  var ctx = _ref2.ctx,
    dv = _ref2.dv;
  var g = dvGrid(dv);
  var setG = function setG(patch) {
    var n = _objectSpread(_objectSpread({}, g), patch);
    ctx.updateDakvlak(dv.id, {
      rows: n.rows,
      cols: n.cols,
      orient: n.orient,
      panelen: n.rows * n.cols
    });
  };
  return /*#__PURE__*/React.createElement("div", {
    style: {
      display: 'flex',
      gap: 12,
      flexWrap: 'wrap',
      alignItems: 'end'
    }
  }, /*#__PURE__*/React.createElement(NumInput, {
    label: "Rijen",
    value: g.rows,
    onChange: function onChange(r) {
      return setG({
        rows: Math.max(1, r)
      });
    },
    min: 1,
    max: 30
  }), /*#__PURE__*/React.createElement(NumInput, {
    label: "Kolommen",
    value: g.cols,
    onChange: function onChange(c) {
      return setG({
        cols: Math.max(1, c)
      });
    },
    min: 1,
    max: 30
  }), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Lbl, null, "Ori\xEBntatie"), /*#__PURE__*/React.createElement(PillGroup, {
    value: g.orient,
    onChange: function onChange(o) {
      return setG({
        orient: o
      });
    },
    options: [{
      value: 'portrait',
      label: 'Staand'
    }, {
      value: 'landscape',
      label: 'Liggend'
    }]
  })));
};
var DakHead = function DakHead(_ref3) {
  var ctx = _ref3.ctx;
  return ctx.toonPV === false ? null : /*#__PURE__*/React.createElement("div", {
    style: {
      background: T.bg1,
      clipPath: cutPath(14),
      padding: '15px 18px',
      position: 'relative',
      marginBottom: 10
    }
  }, /*#__PURE__*/React.createElement("div", {
    style: accentEdge(14)
  }), /*#__PURE__*/React.createElement("div", {
    style: {
      display: 'flex',
      gap: 16,
      alignItems: 'flex-end',
      flexWrap: 'wrap'
    }
  }, /*#__PURE__*/React.createElement("div", {
    style: {
      flex: '1 1 240px',
      minWidth: 0
    }
  }, /*#__PURE__*/React.createElement(GhsSelect, {
    label: "Type paneel",
    value: ctx.panel.id,
    onChange: ctx.setPanelId,
    options: PANELS.map(function (p) {
      return {
        value: p.id,
        label: "".concat(p.name, " (").concat(p.watt, " Wp)")
      };
    })
  })), /*#__PURE__*/React.createElement(NumInput, {
    label: "Dakvlakken",
    value: ctx.dakvlakken.length,
    onChange: ctx.setNDakvlakken,
    min: 1,
    max: 8
  }), /*#__PURE__*/React.createElement("div", {
    style: {
      display: 'flex',
      gap: 6,
      flexWrap: 'wrap',
      paddingBottom: 8
    }
  }, /*#__PURE__*/React.createElement(Badge, {
    type: "accent"
  }, ctx.kWp.toFixed(2).replace('.', ','), " kWp"), /*#__PURE__*/React.createElement(Badge, {
    type: "neutral"
  }, ctx.nPanels, " panelen"), ctx.adminMode && /*#__PURE__*/React.createElement(Badge, {
    type: "neutral"
  }, fmtEur(ctx.buyPanels)))));
};
/* Samenstelling (calculatorprofiel): de productvelden van het Excel-tabblad in plaats van de vrije keuzes. */
/* Het btw-tarief staat bij het totaal in de samenvatting. */
var DakRestProfiel = function DakRestProfiel(_ref4) {
  var ctx = _ref4.ctx;
  return /*#__PURE__*/React.createElement("div", null, window.GhsProfielVelden && /*#__PURE__*/React.createElement(window.GhsProfielVelden, {
    ctx: ctx
  }));
};
/* Montage en plaatsing per dakvlak in een samenstelling: de keuzes van de Excel. */
var montageKeuzeVan = function montageKeuzeVan(ctx, dv) {
  var l = window.calcMontageKeuzes ? window.calcMontageKeuzes() : [];
  return l.find(function (k) {
    return k.id === dv.montageId;
  }) || l[0] || {
    id: '',
    naam: '—'
  };
};
var montageLabel = function montageLabel(ctx, dv) {
  var k = montageKeuzeVan(ctx, dv);
  return k.inleg ? "PAN INLEG \xB7 ".concat(Math.min(3, dv.rows || 1), " rij ").concat(dv.orient === 'landscape' ? 'liggend' : 'staand') : k.naam;
};
var DakRest = function DakRest(_ref5) {
  var ctx = _ref5.ctx;
  return ctx.profiel ? /*#__PURE__*/React.createElement(DakRestProfiel, {
    ctx: ctx
  }) : /*#__PURE__*/React.createElement("div", {
    style: {
      display: 'flex',
      gap: 10,
      alignItems: 'flex-start',
      flexWrap: 'wrap',
      marginTop: 10
    }
  }, /*#__PURE__*/React.createElement("div", {
    style: {
      flex: '1 1 300px',
      minWidth: 280,
      display: 'flex',
      flexDirection: 'column',
      gap: 10
    }
  }, /*#__PURE__*/React.createElement(CalcSection, {
    compact: true,
    title: "OMVORMER, BATTERIJ & OPTIMIZERS",
    icon: "zap"
  }, /*#__PURE__*/React.createElement(FSysteem, {
    ctx: ctx
  })), /*#__PURE__*/React.createElement(CalcSection, {
    compact: true,
    title: "DC-BEKABELING",
    icon: "bolt"
  }, /*#__PURE__*/React.createElement(FDc, {
    ctx: ctx
  }))), /*#__PURE__*/React.createElement("div", {
    style: {
      flex: '1 1 300px',
      minWidth: 280,
      display: 'flex',
      flexDirection: 'column',
      gap: 10
    }
  }, /*#__PURE__*/React.createElement(CalcSection, {
    compact: true,
    title: "AANSLUITING",
    icon: "zap"
  }, /*#__PURE__*/React.createElement(FAansluiting, {
    ctx: ctx
  })), /*#__PURE__*/React.createElement(CalcSection, {
    compact: true,
    title: "KEURING & OPMETING",
    icon: "check"
  }, /*#__PURE__*/React.createElement(FKeuring, {
    ctx: ctx
  })), /*#__PURE__*/React.createElement(CalcSection, {
    compact: true,
    title: "EXTRA'S",
    icon: "plus"
  }, /*#__PURE__*/React.createElement(FExtras, {
    ctx: ctx
  })), ctx.adminMode && /*#__PURE__*/React.createElement(CalcSection, {
    compact: true,
    title: "DOELMARGE",
    icon: "percent"
  }, /*#__PURE__*/React.createElement(FMarge, {
    ctx: ctx,
    metBtw: false
  }))));
};

/* ───────────── gedeelde shell (de behouden setup) ───────────── */
/* Tussenkop binnen een kaart: lijn erboven, label links, uitleg of maat rechts. */
var DakTussen = function DakTussen(_ref6) {
  var titel = _ref6.titel,
    rechts = _ref6.rechts;
  return /*#__PURE__*/React.createElement("div", {
    style: {
      display: 'flex',
      alignItems: 'baseline',
      justifyContent: 'space-between',
      gap: 12,
      flexWrap: 'wrap',
      margin: '18px 0 12px',
      paddingTop: 16,
      borderTop: "1px solid ".concat(T.stroke1)
    }
  }, /*#__PURE__*/React.createElement("span", {
    style: {
      fontFamily: T.fontBody,
      fontSize: 10,
      fontWeight: 700,
      letterSpacing: '0.2em',
      textTransform: 'uppercase',
      color: T.fg3
    }
  }, titel), rechts && /*#__PURE__*/React.createElement("span", {
    style: {
      fontFamily: T.fontBody,
      fontSize: 12,
      color: T.fg3
    }
  }, rechts));
};
var DakKaartNood = function DakKaartNood(_ref7) {
  var titel = _ref7.titel,
    children = _ref7.children,
    style = _ref7.style;
  return /*#__PURE__*/React.createElement("div", {
    style: _objectSpread({
      background: T.bg1,
      clipPath: cutPath(14),
      padding: '16px 18px'
    }, style)
  }, /*#__PURE__*/React.createElement("div", {
    style: {
      fontFamily: T.fontDisplay,
      fontSize: 17,
      fontWeight: 600,
      color: T.fg1,
      marginBottom: 12
    }
  }, titel), children);
};
var DakGroepNood = function DakGroepNood(_ref8) {
  var titel = _ref8.titel,
    children = _ref8.children;
  return /*#__PURE__*/React.createElement("div", {
    style: {
      display: 'flex',
      flexDirection: 'column',
      gap: 12,
      padding: 14,
      background: T.bg0,
      border: "1px solid ".concat(T.stroke1)
    }
  }, /*#__PURE__*/React.createElement("b", {
    style: {
      fontFamily: T.fontBody,
      fontSize: 13.5,
      color: T.fg1
    }
  }, titel), children);
};

/* ───────────── gedeelde shell: één kaart voor panelen en dakvlakken, daarna het systeem ───────────── */
var DakPlanShell = function DakPlanShell(_ref9) {
  var ctx = _ref9.ctx,
    mode = _ref9.mode;
  var _React$useState = React.useState(0),
    _React$useState2 = _slicedToArray(_React$useState, 2),
    sel = _React$useState2[0],
    setSel = _React$useState2[1];
  var idx = Math.min(sel, ctx.dakvlakken.length - 1);
  var dv = ctx.dakvlakken[idx];
  var m = MONTAGE_TYPES.find(function (x) {
    return x.id === dv.montageId;
  }) || MONTAGE_TYPES[0];
  var cardScale = mode === 'persp' ? 1 : mode === 'mini' ? 1 : 0.82;
  var dim = roofDims(dvGrid(dv));
  if (ctx.toonPV === false) return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(DakRest, {
    ctx: ctx
  }));
  var Kaart = window.GhsCalcKaart || DakKaartNood,
    Groep = window.GhsCalcGroep || DakGroepNood;
  var n = ctx.dakvlakken.length,
    kwp = ctx.kWp.toFixed(2).replace('.', ',');
  var eur = function eur(v) {
    return fmtEur(Math.round(v * 100) / 100);
  };
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Kaart, {
    icon: "sun",
    titel: "Zonnepanelen en dakvlakken",
    sub: "".concat(ctx.nPanels, " panelen \xB7 ").concat(kwp, " kWp, verdeeld over ").concat(n, " dakvlak").concat(n > 1 ? 'ken' : ''),
    rechts: ctx.adminMode ? /*#__PURE__*/React.createElement(Badge, {
      type: "neutral"
    }, "Panelen ".concat(fmtEur(ctx.buyPanels))) : null
  }, /*#__PURE__*/React.createElement("div", {
    style: {
      display: 'flex',
      gap: 16,
      alignItems: 'flex-end',
      flexWrap: 'wrap'
    }
  }, /*#__PURE__*/React.createElement("div", {
    style: {
      flex: '1 1 300px',
      minWidth: 0
    }
  }, /*#__PURE__*/React.createElement(GhsSelect, {
    label: "Type paneel",
    value: ctx.panel.id,
    onChange: ctx.setPanelId,
    options: PANELS.map(function (p) {
      return {
        value: p.id,
        label: "".concat(p.name, " (").concat(p.watt, " Wp)")
      };
    })
  })), /*#__PURE__*/React.createElement("div", {
    style: {
      width: 150
    }
  }, /*#__PURE__*/React.createElement(NumInput, {
    label: "Dakvlakken",
    value: n,
    onChange: ctx.setNDakvlakken,
    min: 1,
    max: 8
  }))), /*#__PURE__*/React.createElement(DakTussen, {
    titel: "Legplan",
    rechts: n > 1 ? 'Klik een dakvlak om het hieronder te bewerken' : 'Rijen en kolommen bepalen het aantal panelen'
  }), /*#__PURE__*/React.createElement("div", {
    style: {
      display: 'flex',
      gap: 14,
      flexWrap: 'wrap',
      alignItems: 'flex-end',
      justifyContent: n > 1 ? 'flex-start' : 'center',
      padding: '16px 14px',
      background: 'linear-gradient(180deg,#022a24,#011d18)',
      clipPath: cutPath(10)
    }
  }, ctx.dakvlakken.map(function (d, i) {
    var g = dvGrid(d),
      mm = MONTAGE_TYPES.find(function (x) {
        return x.id === d.montageId;
      }) || MONTAGE_TYPES[0],
      on = i === idx;
    return /*#__PURE__*/React.createElement("button", {
      key: d.id,
      type: "button",
      "aria-pressed": on,
      onClick: function onClick() {
        return setSel(i);
      },
      style: {
        background: on ? 'rgba(0,217,0,0.08)' : T.bg1,
        border: "1px solid ".concat(on ? T.strokeAccent : T.stroke1),
        clipPath: cutPath(12),
        padding: '12px 14px 14px',
        cursor: 'pointer',
        minWidth: 160,
        boxShadow: on ? '0 0 22px rgba(0,217,0,0.18)' : 'none',
        transition: 'border-color 180ms, box-shadow 180ms'
      }
    }, /*#__PURE__*/React.createElement("div", {
      style: {
        display: 'flex',
        justifyContent: 'center',
        minHeight: mode === 'persp' ? 70 : 56
      }
    }, /*#__PURE__*/React.createElement(LegplanGrid, _extends({}, g, {
      active: on,
      mode: mode,
      scale: cardScale
    }))), /*#__PURE__*/React.createElement("div", {
      style: {
        borderTop: "1px solid ".concat(T.stroke1),
        marginTop: 10,
        paddingTop: 9,
        textAlign: 'center'
      }
    }, /*#__PURE__*/React.createElement("div", {
      style: {
        fontFamily: T.fontBody,
        fontSize: 10,
        fontWeight: 700,
        letterSpacing: '0.1em',
        textTransform: 'uppercase',
        color: on ? T.accent : T.fg3
      }
    }, "Dakvlak ", i + 1), /*#__PURE__*/React.createElement("div", {
      style: {
        fontFamily: T.fontDisplay,
        fontSize: 16,
        fontWeight: 600,
        color: T.fg1,
        marginTop: 3
      }
    }, g.rows, "\xD7", g.cols, " ", /*#__PURE__*/React.createElement("span", {
      style: {
        fontSize: 11.5,
        color: T.fg3
      }
    }, "= ", g.rows * g.cols)), /*#__PURE__*/React.createElement("div", {
      style: {
        fontFamily: T.fontBody,
        fontSize: 11,
        color: T.fg3,
        marginTop: 2
      }
    }, ctx.profiel ? montageLabel(ctx, d) : DAK_FAMILY_LABEL[mm.family])));
  })), /*#__PURE__*/React.createElement(DakTussen, {
    titel: "Dakvlak ".concat(idx + 1, " \xB7 ").concat(ctx.profiel ? montageLabel(ctx, dv) : DAK_FAMILY_LABEL[m.family]),
    rechts: "\u2248 ".concat(dim.w.toFixed(1).replace('.', ','), " \xD7 ").concat(dim.h.toFixed(1).replace('.', ','), " m")
  }), /*#__PURE__*/React.createElement("div", {
    style: {
      display: 'grid',
      gridTemplateColumns: 'repeat(auto-fit,minmax(min(100%,300px),1fr))',
      gap: 14,
      alignItems: 'start'
    }
  }, /*#__PURE__*/React.createElement(Groep, {
    icon: "grid",
    titel: "Opstelling"
  }, /*#__PURE__*/React.createElement(GridControls, {
    ctx: ctx,
    dv: dv
  }), /*#__PURE__*/React.createElement("span", {
    style: {
      fontFamily: T.fontBody,
      fontSize: 11.5,
      color: T.fg3,
      lineHeight: 1.45
    }
  }, "".concat(dvGrid(dv).rows * dvGrid(dv).cols, " panelen op dit dakvlak. ").concat(ctx.profiel ? 'PAN INLEG volgt deze rijen en oriëntatie.' : ''))), ctx.profiel ? function () {
    /* Enkel de montagekeuzes die het calculatorprofiel toelaat. */
    var keuzes = window.calcMontageKeuzesVoorProfiel ? window.calcMontageKeuzesVoorProfiel(ctx.profiel.id) : window.calcMontageKeuzes ? window.calcMontageKeuzes() : [],
      k = montageKeuzeVan(ctx, dv);
    var inst = window.calcMontageInst ? window.calcMontageInst() : {
      technieken: []
    };
    var tech = dv.plaatsingTech || (window.calcTechVoorMontage ? window.calcTechVoorMontage(dv.montageId) : 'pan');
    var mLijn = window.calcMontageLijn ? window.calcMontageLijn(dv, {
      nTotaal: ctx.nPanelen
    }) : null;
    return /*#__PURE__*/React.createElement(Groep, {
      icon: "package",
      titel: "Montage en plaatsing"
    }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(GhsSelect, {
      label: "Montage",
      value: k.id,
      onChange: function onChange(id) {
        return ctx.updateDakvlak(dv.id, {
          montageId: id,
          plaatsingTech: window.calcTechVoorMontage ? window.calcTechVoorMontage(id) : 'pan'
        });
      },
      options: keuzes.map(function (x) {
        return {
          value: x.id,
          label: x.inleg ? 'PAN INLEG (ALIUS) — volgt het legplan' : ctx.adminMode && !x.geen ? "".concat(x.naam, " (\u20AC ").concat(String(x.prijs).replace('.', ','), "/paneel)") : x.naam
        };
      })
    }), /*#__PURE__*/React.createElement("div", {
      style: {
        fontFamily: T.fontBody,
        fontSize: 11.5,
        color: T.fg3,
        marginTop: 5,
        lineHeight: 1.45
      }
    }, k.inleg ? "".concat(mLijn && mLijn.naam ? mLijn.naam : '').concat(ctx.adminMode && mLijn ? " \xB7 ".concat(eur(mLijn.buy), "/paneel").concat(mLijn.bron === 'stuklijst' ? ' (stuklijst)' : '') : '') : k.geen ? 'Geen montageregel op de offerte.' : 'Prijs per paneel.')), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(GhsSelect, {
      label: "Plaatsing",
      value: tech,
      onChange: function onChange(t) {
        return ctx.updateDakvlak(dv.id, {
          plaatsingTech: t
        });
      },
      options: inst.technieken.map(function (t) {
        return {
          value: t.id,
          label: ctx.adminMode && window.calcPlaatsingPrijs ? "".concat(t.label, " (").concat(eur(window.calcPlaatsingPrijs(t.id, ctx.nPanelen)), "/paneel)") : t.label
        };
      })
    }), /*#__PURE__*/React.createElement("div", {
      style: {
        fontFamily: T.fontBody,
        fontSize: 11.5,
        color: T.fg3,
        marginTop: 5
      }
    }, "Volgt de montage; per dakvlak aan te passen.")));
  }() : /*#__PURE__*/React.createElement(Groep, {
    icon: "package",
    titel: "Montage en plaatsing"
  }, /*#__PURE__*/React.createElement(GhsSelect, {
    label: "Montagemateriaal",
    value: dv.montageId,
    onChange: function onChange(id) {
      return ctx.updateDakvlak(dv.id, {
        montageId: id
      });
    },
    options: MONTAGE_TYPES.map(function (mt) {
      return {
        value: mt.id,
        label: ctx.adminMode ? "".concat(mt.name, " (\u20AC").concat(mt.pricePerPanel, ")") : mt.name
      };
    })
  }), /*#__PURE__*/React.createElement(GhsSelect, {
    label: "Plaatsing",
    value: dv.plaatsingId,
    onChange: function onChange(id) {
      return ctx.updateDakvlak(dv.id, {
        plaatsingId: id
      });
    },
    options: plaatsingForFamily(m.family).map(function (p) {
      return {
        value: p.id,
        label: ctx.adminMode ? "".concat(p.name, " (\u20AC").concat(p.pricePerPanel, ")") : p.name
      };
    })
  })))), /*#__PURE__*/React.createElement(DakRest, {
    ctx: ctx
  }));
};

/* 4 weergaven — zelfde setup, ander legplan-teken-stijl */
var LayoutDakPersp = function LayoutDakPersp(_ref0) {
  var ctx = _ref0.ctx;
  return /*#__PURE__*/React.createElement(DakPlanShell, {
    ctx: ctx,
    mode: "persp"
  });
};
var LayoutDakFlat = function LayoutDakFlat(_ref1) {
  var ctx = _ref1.ctx;
  return /*#__PURE__*/React.createElement(DakPlanShell, {
    ctx: ctx,
    mode: "flat"
  });
};
var LayoutDakBlueprint = function LayoutDakBlueprint(_ref10) {
  var ctx = _ref10.ctx;
  return /*#__PURE__*/React.createElement(DakPlanShell, {
    ctx: ctx,
    mode: "blueprint"
  });
};
var LayoutDakReal = function LayoutDakReal(_ref11) {
  var ctx = _ref11.ctx;
  return /*#__PURE__*/React.createElement(DakPlanShell, {
    ctx: ctx,
    mode: "realistic"
  });
};

/* ───────────── helper: legplan-veld zetten ───────────── */
var setGridField = function setGridField(ctx, dv, patch) {
  var g = dvGrid(dv),
    n = _objectSpread(_objectSpread({}, g), patch);
  ctx.updateDakvlak(dv.id, {
    rows: Math.max(1, n.rows),
    cols: Math.max(1, n.cols),
    orient: n.orient,
    panelen: Math.max(1, n.rows) * Math.max(1, n.cols)
  });
};
/* kop met type paneel + dakvlakken, IN het blok (geen aparte balk) */
var OneBlockHead = function OneBlockHead(_ref12) {
  var ctx = _ref12.ctx;
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
    style: {
      display: 'flex',
      gap: 14,
      alignItems: 'flex-end',
      flexWrap: 'wrap'
    }
  }, /*#__PURE__*/React.createElement("div", {
    style: {
      flex: '1 1 240px',
      minWidth: 0
    }
  }, /*#__PURE__*/React.createElement(GhsSelect, {
    label: "Type paneel",
    value: ctx.panel.id,
    onChange: ctx.setPanelId,
    options: PANELS.map(function (p) {
      return {
        value: p.id,
        label: "".concat(p.name, " (").concat(p.watt, " Wp)")
      };
    })
  })), /*#__PURE__*/React.createElement(NumInput, {
    label: "Aantal dakvlakken",
    value: ctx.dakvlakken.length,
    onChange: ctx.setNDakvlakken,
    min: 1,
    max: 8
  }), /*#__PURE__*/React.createElement("div", {
    style: {
      display: 'flex',
      gap: 6,
      flexWrap: 'wrap',
      paddingBottom: 8
    }
  }, /*#__PURE__*/React.createElement(Badge, {
    type: "accent"
  }, ctx.kWp.toFixed(2).replace('.', ','), " kWp"), /*#__PURE__*/React.createElement(Badge, {
    type: "neutral"
  }, ctx.nPanels, " panelen"), ctx.adminMode && /*#__PURE__*/React.createElement(Badge, {
    type: "neutral"
  }, fmtEur(ctx.buyPanels)))), /*#__PURE__*/React.createElement("div", {
    style: {
      height: 1,
      background: 'linear-gradient(90deg, transparent, rgba(0,217,0,0.55), transparent)',
      margin: '14px 0'
    }
  }));
};

/* ═══════════ VARIANT · ÉÉN PANEEL ═══════════
   Alles in één blok: type paneel + dakvlakken + per-dakvlak legplan-instellingen. */
var LayoutDakOneBlock = function LayoutDakOneBlock(_ref13) {
  var ctx = _ref13.ctx;
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
    style: {
      background: T.bg1,
      clipPath: cutPath(16),
      padding: '17px 19px',
      position: 'relative'
    }
  }, /*#__PURE__*/React.createElement("div", {
    style: accentEdge(16)
  }), /*#__PURE__*/React.createElement(OneBlockHead, {
    ctx: ctx
  }), /*#__PURE__*/React.createElement("div", {
    style: {
      display: 'flex',
      flexDirection: 'column',
      gap: 10
    }
  }, ctx.dakvlakken.map(function (dv, i) {
    var g = dvGrid(dv),
      m = MONTAGE_TYPES.find(function (x) {
        return x.id === dv.montageId;
      }) || MONTAGE_TYPES[0],
      dim = roofDims(g);
    return /*#__PURE__*/React.createElement("div", {
      key: dv.id,
      style: {
        background: T.bg0,
        border: "1px solid ".concat(T.stroke1),
        clipPath: cutPath(12),
        padding: '12px 14px',
        display: 'flex',
        gap: 16,
        alignItems: 'center',
        flexWrap: 'wrap'
      }
    }, /*#__PURE__*/React.createElement("div", {
      style: {
        width: 92,
        flexShrink: 0,
        display: 'flex',
        flexDirection: 'column',
        alignItems: 'center',
        gap: 5
      }
    }, /*#__PURE__*/React.createElement(LegplanGrid, _extends({}, g, {
      active: true,
      mode: "mini"
    })), /*#__PURE__*/React.createElement("span", {
      style: {
        fontFamily: T.fontBody,
        fontSize: 9,
        fontWeight: 700,
        letterSpacing: '0.1em',
        textTransform: 'uppercase',
        color: T.accent
      }
    }, "Dak ", i + 1)), /*#__PURE__*/React.createElement("div", {
      style: {
        flex: 1,
        minWidth: 240,
        display: 'flex',
        flexDirection: 'column',
        gap: 9
      }
    }, /*#__PURE__*/React.createElement("div", {
      style: {
        display: 'flex',
        gap: 10,
        alignItems: 'end',
        flexWrap: 'wrap'
      }
    }, /*#__PURE__*/React.createElement(NumInput, {
      label: "Rijen",
      value: g.rows,
      onChange: function onChange(r) {
        return setGridField(ctx, dv, {
          rows: r
        });
      },
      min: 1,
      max: 30
    }), /*#__PURE__*/React.createElement(NumInput, {
      label: "Kolommen",
      value: g.cols,
      onChange: function onChange(c) {
        return setGridField(ctx, dv, {
          cols: c
        });
      },
      min: 1,
      max: 30
    }), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Lbl, null, "Ori\xEBntatie"), /*#__PURE__*/React.createElement(PillGroup, {
      value: g.orient,
      onChange: function onChange(o) {
        return setGridField(ctx, dv, {
          orient: o
        });
      },
      options: [{
        value: 'portrait',
        label: 'Staand'
      }, {
        value: 'landscape',
        label: 'Liggend'
      }]
    })), /*#__PURE__*/React.createElement("div", {
      style: {
        paddingBottom: 7
      }
    }, /*#__PURE__*/React.createElement(Badge, {
      type: "accent"
    }, g.rows * g.cols, " pan."), " ", /*#__PURE__*/React.createElement("span", {
      style: {
        fontFamily: T.fontBody,
        fontSize: 10.5,
        color: T.fg3
      }
    }, "\u2248 ", dim.w.toFixed(1), "\xD7", dim.h.toFixed(1), " m"))), /*#__PURE__*/React.createElement("div", {
      style: {
        display: 'grid',
        gridTemplateColumns: '1fr 1fr',
        gap: 10
      }
    }, /*#__PURE__*/React.createElement(GhsSelect, {
      value: dv.montageId,
      onChange: function onChange(id) {
        return ctx.updateDakvlak(dv.id, {
          montageId: id
        });
      },
      options: MONTAGE_TYPES.map(function (mt) {
        return {
          value: mt.id,
          label: ctx.adminMode ? "".concat(mt.name, " (\u20AC").concat(mt.pricePerPanel, ")") : mt.name
        };
      })
    }), /*#__PURE__*/React.createElement(GhsSelect, {
      value: dv.plaatsingId,
      onChange: function onChange(id) {
        return ctx.updateDakvlak(dv.id, {
          plaatsingId: id
        });
      },
      options: plaatsingForFamily(m.family).map(function (p) {
        return {
          value: p.id,
          label: ctx.adminMode ? "".concat(p.name, " (\u20AC").concat(p.pricePerPanel, ")") : p.name
        };
      })
    }))));
  }))), /*#__PURE__*/React.createElement(DakRest, {
    ctx: ctx
  }));
};

/* ═══════════ VARIANT · TABEL ═══════════
   Eén blok met een compacte tabel: één rij per dakvlak. */
var LayoutDakTable = function LayoutDakTable(_ref14) {
  var ctx = _ref14.ctx;
  var COLS = '74px 96px 96px 150px 1fr 1fr';
  var HeadCell = function HeadCell(_ref15) {
    var children = _ref15.children;
    return /*#__PURE__*/React.createElement("div", {
      style: {
        fontFamily: T.fontBody,
        fontSize: 9,
        fontWeight: 700,
        letterSpacing: '0.12em',
        textTransform: 'uppercase',
        color: T.fg4
      }
    }, children);
  };
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
    style: {
      background: T.bg1,
      clipPath: cutPath(16),
      padding: '17px 19px',
      position: 'relative'
    }
  }, /*#__PURE__*/React.createElement("div", {
    style: accentEdge(16)
  }), /*#__PURE__*/React.createElement(OneBlockHead, {
    ctx: ctx
  }), /*#__PURE__*/React.createElement("div", {
    style: {
      overflowX: 'auto'
    }
  }, /*#__PURE__*/React.createElement("div", {
    style: {
      minWidth: 660
    }
  }, /*#__PURE__*/React.createElement("div", {
    style: {
      display: 'grid',
      gridTemplateColumns: COLS,
      gap: 10,
      padding: '0 0 8px',
      borderBottom: "1px solid ".concat(T.stroke1)
    }
  }, /*#__PURE__*/React.createElement(HeadCell, null, "Dakvlak"), /*#__PURE__*/React.createElement(HeadCell, null, "Rijen"), /*#__PURE__*/React.createElement(HeadCell, null, "Kolommen"), /*#__PURE__*/React.createElement(HeadCell, null, "Ori\xEBntatie"), /*#__PURE__*/React.createElement(HeadCell, null, "Montage"), /*#__PURE__*/React.createElement(HeadCell, null, "Plaatsing")), ctx.dakvlakken.map(function (dv, i) {
    var g = dvGrid(dv),
      m = MONTAGE_TYPES.find(function (x) {
        return x.id === dv.montageId;
      }) || MONTAGE_TYPES[0];
    return /*#__PURE__*/React.createElement("div", {
      key: dv.id,
      style: {
        display: 'grid',
        gridTemplateColumns: COLS,
        gap: 10,
        alignItems: 'center',
        padding: '10px 0',
        borderBottom: "1px solid ".concat(T.stroke1)
      }
    }, /*#__PURE__*/React.createElement("div", {
      style: {
        display: 'flex',
        flexDirection: 'column',
        gap: 3
      }
    }, /*#__PURE__*/React.createElement(LegplanGrid, _extends({}, g, {
      active: true,
      mode: "mini",
      scale: 0.8
    })), /*#__PURE__*/React.createElement("span", {
      style: {
        fontFamily: T.fontBody,
        fontSize: 9,
        fontWeight: 700,
        letterSpacing: '0.08em',
        textTransform: 'uppercase',
        color: T.accent
      }
    }, "Dak ", i + 1)), /*#__PURE__*/React.createElement(NumInput, {
      value: g.rows,
      onChange: function onChange(r) {
        return setGridField(ctx, dv, {
          rows: r
        });
      },
      min: 1,
      max: 30
    }), /*#__PURE__*/React.createElement(NumInput, {
      value: g.cols,
      onChange: function onChange(c) {
        return setGridField(ctx, dv, {
          cols: c
        });
      },
      min: 1,
      max: 30
    }), /*#__PURE__*/React.createElement(PillGroup, {
      value: g.orient,
      onChange: function onChange(o) {
        return setGridField(ctx, dv, {
          orient: o
        });
      },
      options: [{
        value: 'portrait',
        label: 'Staand'
      }, {
        value: 'landscape',
        label: 'Liggend'
      }]
    }), /*#__PURE__*/React.createElement(GhsSelect, {
      value: dv.montageId,
      onChange: function onChange(id) {
        return ctx.updateDakvlak(dv.id, {
          montageId: id
        });
      },
      options: MONTAGE_TYPES.map(function (mt) {
        return {
          value: mt.id,
          label: ctx.adminMode ? "".concat(mt.name, " (\u20AC").concat(mt.pricePerPanel, ")") : mt.name
        };
      })
    }), /*#__PURE__*/React.createElement(GhsSelect, {
      value: dv.plaatsingId,
      onChange: function onChange(id) {
        return ctx.updateDakvlak(dv.id, {
          plaatsingId: id
        });
      },
      options: plaatsingForFamily(m.family).map(function (p) {
        return {
          value: p.id,
          label: ctx.adminMode ? "".concat(p.name, " (\u20AC").concat(p.pricePerPanel, ")") : p.name
        };
      })
    }));
  })))), /*#__PURE__*/React.createElement(DakRest, {
    ctx: ctx
  }));
};

/* ═══════════ VARIANT · MASTER-DETAIL ═══════════
   Eén blok, gesplitst: links keuze + dakvlak-lijst, rechts de instellingen. */
var LayoutDakMaster = function LayoutDakMaster(_ref16) {
  var ctx = _ref16.ctx;
  var _React$useState3 = React.useState(0),
    _React$useState4 = _slicedToArray(_React$useState3, 2),
    sel = _React$useState4[0],
    setSel = _React$useState4[1];
  var idx = Math.min(sel, ctx.dakvlakken.length - 1);
  var dv = ctx.dakvlakken[idx];
  var g = dvGrid(dv),
    m = MONTAGE_TYPES.find(function (x) {
      return x.id === dv.montageId;
    }) || MONTAGE_TYPES[0],
    dim = roofDims(g);
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
    style: {
      background: T.bg1,
      clipPath: cutPath(16),
      padding: '17px 19px',
      position: 'relative',
      display: 'flex',
      gap: 18,
      flexWrap: 'wrap'
    }
  }, /*#__PURE__*/React.createElement("div", {
    style: accentEdge(16)
  }), /*#__PURE__*/React.createElement("div", {
    style: {
      flex: '1 1 260px',
      minWidth: 240,
      display: 'flex',
      flexDirection: 'column',
      gap: 12
    }
  }, /*#__PURE__*/React.createElement(GhsSelect, {
    label: "Type paneel",
    value: ctx.panel.id,
    onChange: ctx.setPanelId,
    options: PANELS.map(function (p) {
      return {
        value: p.id,
        label: "".concat(p.name, " (").concat(p.watt, " Wp)")
      };
    })
  }), /*#__PURE__*/React.createElement(NumInput, {
    label: "Aantal dakvlakken",
    value: ctx.dakvlakken.length,
    onChange: ctx.setNDakvlakken,
    min: 1,
    max: 8
  }), /*#__PURE__*/React.createElement("div", {
    style: {
      display: 'flex',
      gap: 6,
      flexWrap: 'wrap'
    }
  }, /*#__PURE__*/React.createElement(Badge, {
    type: "accent"
  }, ctx.kWp.toFixed(2).replace('.', ','), " kWp"), /*#__PURE__*/React.createElement(Badge, {
    type: "neutral"
  }, ctx.nPanels, " pan.")), /*#__PURE__*/React.createElement("div", {
    style: {
      display: 'flex',
      flexDirection: 'column',
      gap: 6,
      marginTop: 2
    }
  }, ctx.dakvlakken.map(function (d, i) {
    var gg = dvGrid(d),
      mm = MONTAGE_TYPES.find(function (x) {
        return x.id === d.montageId;
      }) || MONTAGE_TYPES[0],
      on = i === idx;
    return /*#__PURE__*/React.createElement("button", {
      key: d.id,
      onClick: function onClick() {
        return setSel(i);
      },
      style: {
        display: 'flex',
        alignItems: 'center',
        gap: 10,
        background: on ? 'rgba(0,217,0,0.10)' : T.bg0,
        border: "1px solid ".concat(on ? T.strokeAccent : T.stroke1),
        clipPath: cutPath(10),
        padding: '8px 10px',
        cursor: 'pointer',
        textAlign: 'left'
      }
    }, /*#__PURE__*/React.createElement(LegplanGrid, _extends({}, gg, {
      active: on,
      mode: "mini",
      scale: 0.7
    })), /*#__PURE__*/React.createElement("div", {
      style: {
        flex: 1
      }
    }, /*#__PURE__*/React.createElement("div", {
      style: {
        fontFamily: T.fontBody,
        fontSize: 9,
        fontWeight: 700,
        letterSpacing: '0.1em',
        textTransform: 'uppercase',
        color: on ? T.accent : T.fg3
      }
    }, "Dakvlak ", i + 1), /*#__PURE__*/React.createElement("div", {
      style: {
        fontFamily: T.fontDisplay,
        fontSize: 13,
        fontWeight: 600,
        color: T.fg1
      }
    }, gg.rows, "\xD7", gg.cols, " ", /*#__PURE__*/React.createElement("span", {
      style: {
        fontSize: 10,
        color: T.fg3
      }
    }, "\xB7 ", DAK_FAMILY_LABEL[mm.family]))));
  }))), /*#__PURE__*/React.createElement("div", {
    style: {
      flex: '2 1 320px',
      minWidth: 280,
      borderLeft: "1px solid ".concat(T.stroke1),
      paddingLeft: 18
    }
  }, /*#__PURE__*/React.createElement("div", {
    style: {
      display: 'flex',
      alignItems: 'center',
      gap: 9,
      marginBottom: 13
    }
  }, /*#__PURE__*/React.createElement(Icon, {
    name: "grid",
    size: 14,
    color: T.accent
  }), /*#__PURE__*/React.createElement("span", {
    style: {
      fontFamily: T.fontDisplay,
      fontSize: 16,
      fontWeight: 600,
      color: T.fg1
    }
  }, "Dakvlak ", idx + 1, " \u2014 ", DAK_FAMILY_LABEL[m.family]), /*#__PURE__*/React.createElement("span", {
    style: {
      marginLeft: 'auto',
      fontFamily: T.fontBody,
      fontSize: 11,
      color: T.fg3
    }
  }, "\u2248 ", dim.w.toFixed(1), " \xD7 ", dim.h.toFixed(1), " m")), /*#__PURE__*/React.createElement("div", {
    style: {
      display: 'flex',
      justifyContent: 'center',
      marginBottom: 14
    }
  }, /*#__PURE__*/React.createElement(LegplanGrid, _extends({}, g, {
    active: true,
    mode: "flat"
  }))), /*#__PURE__*/React.createElement(GridControls, {
    ctx: ctx,
    dv: dv
  }), /*#__PURE__*/React.createElement("div", {
    style: {
      display: 'grid',
      gridTemplateColumns: '1fr 1fr',
      gap: 12,
      marginTop: 13
    }
  }, /*#__PURE__*/React.createElement(GhsSelect, {
    label: "Montagemateriaal",
    value: dv.montageId,
    onChange: function onChange(id) {
      return ctx.updateDakvlak(dv.id, {
        montageId: id
      });
    },
    options: MONTAGE_TYPES.map(function (mt) {
      return {
        value: mt.id,
        label: ctx.adminMode ? "".concat(mt.name, " (\u20AC").concat(mt.pricePerPanel, ")") : mt.name
      };
    })
  }), /*#__PURE__*/React.createElement(GhsSelect, {
    label: "Plaatsing",
    value: dv.plaatsingId,
    onChange: function onChange(id) {
      return ctx.updateDakvlak(dv.id, {
        plaatsingId: id
      });
    },
    options: plaatsingForFamily(m.family).map(function (p) {
      return {
        value: p.id,
        label: ctx.adminMode ? "".concat(p.name, " (\u20AC").concat(p.pricePerPanel, ")") : p.name
      };
    })
  })))), /*#__PURE__*/React.createElement(DakRest, {
    ctx: ctx
  }));
};
Object.assign(window, {
  LayoutDakPersp: LayoutDakPersp,
  LayoutDakFlat: LayoutDakFlat,
  LayoutDakBlueprint: LayoutDakBlueprint,
  LayoutDakReal: LayoutDakReal,
  LayoutDakOneBlock: LayoutDakOneBlock,
  LayoutDakTable: LayoutDakTable,
  LayoutDakMaster: LayoutDakMaster
});