door_models 0.1.1 → 2.0.0

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.
@@ -0,0 +1,4288 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var require$$0 = require('react');
6
+ var csg = require('@react-three/csg');
7
+ var three = require('@react-spring/three');
8
+ var THREE = require('three');
9
+ var material = require('@mui/material');
10
+ var iconsMaterial = require('@mui/icons-material');
11
+
12
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
13
+
14
+ function _interopNamespace(e) {
15
+ if (e && e.__esModule) return e;
16
+ var n = Object.create(null);
17
+ if (e) {
18
+ Object.keys(e).forEach(function (k) {
19
+ if (k !== 'default') {
20
+ var d = Object.getOwnPropertyDescriptor(e, k);
21
+ Object.defineProperty(n, k, d.get ? d : {
22
+ enumerable: true,
23
+ get: function () { return e[k]; }
24
+ });
25
+ }
26
+ });
27
+ }
28
+ n["default"] = e;
29
+ return Object.freeze(n);
30
+ }
31
+
32
+ var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0);
33
+ var THREE__namespace = /*#__PURE__*/_interopNamespace(THREE);
34
+
35
+ function _defineProperty(e, r, t) {
36
+ return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
37
+ value: t,
38
+ enumerable: !0,
39
+ configurable: !0,
40
+ writable: !0
41
+ }) : e[r] = t, e;
42
+ }
43
+ function ownKeys(e, r) {
44
+ var t = Object.keys(e);
45
+ if (Object.getOwnPropertySymbols) {
46
+ var o = Object.getOwnPropertySymbols(e);
47
+ r && (o = o.filter(function (r) {
48
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
49
+ })), t.push.apply(t, o);
50
+ }
51
+ return t;
52
+ }
53
+ function _objectSpread2(e) {
54
+ for (var r = 1; r < arguments.length; r++) {
55
+ var t = null != arguments[r] ? arguments[r] : {};
56
+ r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
57
+ _defineProperty(e, r, t[r]);
58
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
59
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
60
+ });
61
+ }
62
+ return e;
63
+ }
64
+ function _objectWithoutProperties(e, t) {
65
+ if (null == e) return {};
66
+ var o,
67
+ r,
68
+ i = _objectWithoutPropertiesLoose(e, t);
69
+ if (Object.getOwnPropertySymbols) {
70
+ var n = Object.getOwnPropertySymbols(e);
71
+ for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
72
+ }
73
+ return i;
74
+ }
75
+ function _objectWithoutPropertiesLoose(r, e) {
76
+ if (null == r) return {};
77
+ var t = {};
78
+ for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
79
+ if (-1 !== e.indexOf(n)) continue;
80
+ t[n] = r[n];
81
+ }
82
+ return t;
83
+ }
84
+ function _toPrimitive(t, r) {
85
+ if ("object" != typeof t || !t) return t;
86
+ var e = t[Symbol.toPrimitive];
87
+ if (void 0 !== e) {
88
+ var i = e.call(t, r || "default");
89
+ if ("object" != typeof i) return i;
90
+ throw new TypeError("@@toPrimitive must return a primitive value.");
91
+ }
92
+ return ("string" === r ? String : Number)(t);
93
+ }
94
+ function _toPropertyKey(t) {
95
+ var i = _toPrimitive(t, "string");
96
+ return "symbol" == typeof i ? i : i + "";
97
+ }
98
+
99
+ var jsxRuntime = {exports: {}};
100
+
101
+ var reactJsxRuntime_production_min = {};
102
+
103
+ /**
104
+ * @license React
105
+ * react-jsx-runtime.production.min.js
106
+ *
107
+ * Copyright (c) Facebook, Inc. and its affiliates.
108
+ *
109
+ * This source code is licensed under the MIT license found in the
110
+ * LICENSE file in the root directory of this source tree.
111
+ */
112
+
113
+ var hasRequiredReactJsxRuntime_production_min;
114
+
115
+ function requireReactJsxRuntime_production_min () {
116
+ if (hasRequiredReactJsxRuntime_production_min) return reactJsxRuntime_production_min;
117
+ hasRequiredReactJsxRuntime_production_min = 1;
118
+ var f=require$$0__default["default"],k=Symbol.for("react.element"),l=Symbol.for("react.fragment"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};
119
+ function q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=""+g);void 0!==a.key&&(e=""+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return {$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}reactJsxRuntime_production_min.Fragment=l;reactJsxRuntime_production_min.jsx=q;reactJsxRuntime_production_min.jsxs=q;
120
+ return reactJsxRuntime_production_min;
121
+ }
122
+
123
+ var reactJsxRuntime_development = {};
124
+
125
+ /**
126
+ * @license React
127
+ * react-jsx-runtime.development.js
128
+ *
129
+ * Copyright (c) Facebook, Inc. and its affiliates.
130
+ *
131
+ * This source code is licensed under the MIT license found in the
132
+ * LICENSE file in the root directory of this source tree.
133
+ */
134
+
135
+ var hasRequiredReactJsxRuntime_development;
136
+
137
+ function requireReactJsxRuntime_development () {
138
+ if (hasRequiredReactJsxRuntime_development) return reactJsxRuntime_development;
139
+ hasRequiredReactJsxRuntime_development = 1;
140
+
141
+ if (process.env.NODE_ENV !== "production") {
142
+ (function() {
143
+
144
+ var React = require$$0__default["default"];
145
+
146
+ // ATTENTION
147
+ // When adding new symbols to this file,
148
+ // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
149
+ // The Symbol used to tag the ReactElement-like types.
150
+ var REACT_ELEMENT_TYPE = Symbol.for('react.element');
151
+ var REACT_PORTAL_TYPE = Symbol.for('react.portal');
152
+ var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
153
+ var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');
154
+ var REACT_PROFILER_TYPE = Symbol.for('react.profiler');
155
+ var REACT_PROVIDER_TYPE = Symbol.for('react.provider');
156
+ var REACT_CONTEXT_TYPE = Symbol.for('react.context');
157
+ var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
158
+ var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
159
+ var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');
160
+ var REACT_MEMO_TYPE = Symbol.for('react.memo');
161
+ var REACT_LAZY_TYPE = Symbol.for('react.lazy');
162
+ var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
163
+ var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
164
+ var FAUX_ITERATOR_SYMBOL = '@@iterator';
165
+ function getIteratorFn(maybeIterable) {
166
+ if (maybeIterable === null || typeof maybeIterable !== 'object') {
167
+ return null;
168
+ }
169
+
170
+ var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
171
+
172
+ if (typeof maybeIterator === 'function') {
173
+ return maybeIterator;
174
+ }
175
+
176
+ return null;
177
+ }
178
+
179
+ var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
180
+
181
+ function error(format) {
182
+ {
183
+ {
184
+ for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
185
+ args[_key2 - 1] = arguments[_key2];
186
+ }
187
+
188
+ printWarning('error', format, args);
189
+ }
190
+ }
191
+ }
192
+
193
+ function printWarning(level, format, args) {
194
+ // When changing this logic, you might want to also
195
+ // update consoleWithStackDev.www.js as well.
196
+ {
197
+ var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
198
+ var stack = ReactDebugCurrentFrame.getStackAddendum();
199
+
200
+ if (stack !== '') {
201
+ format += '%s';
202
+ args = args.concat([stack]);
203
+ } // eslint-disable-next-line react-internal/safe-string-coercion
204
+
205
+
206
+ var argsWithFormat = args.map(function (item) {
207
+ return String(item);
208
+ }); // Careful: RN currently depends on this prefix
209
+
210
+ argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
211
+ // breaks IE9: https://github.com/facebook/react/issues/13610
212
+ // eslint-disable-next-line react-internal/no-production-logging
213
+
214
+ Function.prototype.apply.call(console[level], console, argsWithFormat);
215
+ }
216
+ }
217
+
218
+ // -----------------------------------------------------------------------------
219
+
220
+ var enableScopeAPI = false; // Experimental Create Event Handle API.
221
+ var enableCacheElement = false;
222
+ var enableTransitionTracing = false; // No known bugs, but needs performance testing
223
+
224
+ var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber
225
+ // stuff. Intended to enable React core members to more easily debug scheduling
226
+ // issues in DEV builds.
227
+
228
+ var enableDebugTracing = false; // Track which Fiber(s) schedule render work.
229
+
230
+ var REACT_MODULE_REFERENCE;
231
+
232
+ {
233
+ REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');
234
+ }
235
+
236
+ function isValidElementType(type) {
237
+ if (typeof type === 'string' || typeof type === 'function') {
238
+ return true;
239
+ } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
240
+
241
+
242
+ if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {
243
+ return true;
244
+ }
245
+
246
+ if (typeof type === 'object' && type !== null) {
247
+ if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object
248
+ // types supported by any Flight configuration anywhere since
249
+ // we don't know which Flight build this will end up being used
250
+ // with.
251
+ type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {
252
+ return true;
253
+ }
254
+ }
255
+
256
+ return false;
257
+ }
258
+
259
+ function getWrappedName(outerType, innerType, wrapperName) {
260
+ var displayName = outerType.displayName;
261
+
262
+ if (displayName) {
263
+ return displayName;
264
+ }
265
+
266
+ var functionName = innerType.displayName || innerType.name || '';
267
+ return functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName;
268
+ } // Keep in sync with react-reconciler/getComponentNameFromFiber
269
+
270
+
271
+ function getContextName(type) {
272
+ return type.displayName || 'Context';
273
+ } // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.
274
+
275
+
276
+ function getComponentNameFromType(type) {
277
+ if (type == null) {
278
+ // Host root, text node or just invalid type.
279
+ return null;
280
+ }
281
+
282
+ {
283
+ if (typeof type.tag === 'number') {
284
+ error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');
285
+ }
286
+ }
287
+
288
+ if (typeof type === 'function') {
289
+ return type.displayName || type.name || null;
290
+ }
291
+
292
+ if (typeof type === 'string') {
293
+ return type;
294
+ }
295
+
296
+ switch (type) {
297
+ case REACT_FRAGMENT_TYPE:
298
+ return 'Fragment';
299
+
300
+ case REACT_PORTAL_TYPE:
301
+ return 'Portal';
302
+
303
+ case REACT_PROFILER_TYPE:
304
+ return 'Profiler';
305
+
306
+ case REACT_STRICT_MODE_TYPE:
307
+ return 'StrictMode';
308
+
309
+ case REACT_SUSPENSE_TYPE:
310
+ return 'Suspense';
311
+
312
+ case REACT_SUSPENSE_LIST_TYPE:
313
+ return 'SuspenseList';
314
+
315
+ }
316
+
317
+ if (typeof type === 'object') {
318
+ switch (type.$$typeof) {
319
+ case REACT_CONTEXT_TYPE:
320
+ var context = type;
321
+ return getContextName(context) + '.Consumer';
322
+
323
+ case REACT_PROVIDER_TYPE:
324
+ var provider = type;
325
+ return getContextName(provider._context) + '.Provider';
326
+
327
+ case REACT_FORWARD_REF_TYPE:
328
+ return getWrappedName(type, type.render, 'ForwardRef');
329
+
330
+ case REACT_MEMO_TYPE:
331
+ var outerName = type.displayName || null;
332
+
333
+ if (outerName !== null) {
334
+ return outerName;
335
+ }
336
+
337
+ return getComponentNameFromType(type.type) || 'Memo';
338
+
339
+ case REACT_LAZY_TYPE:
340
+ {
341
+ var lazyComponent = type;
342
+ var payload = lazyComponent._payload;
343
+ var init = lazyComponent._init;
344
+
345
+ try {
346
+ return getComponentNameFromType(init(payload));
347
+ } catch (x) {
348
+ return null;
349
+ }
350
+ }
351
+
352
+ // eslint-disable-next-line no-fallthrough
353
+ }
354
+ }
355
+
356
+ return null;
357
+ }
358
+
359
+ var assign = Object.assign;
360
+
361
+ // Helpers to patch console.logs to avoid logging during side-effect free
362
+ // replaying on render function. This currently only patches the object
363
+ // lazily which won't cover if the log function was extracted eagerly.
364
+ // We could also eagerly patch the method.
365
+ var disabledDepth = 0;
366
+ var prevLog;
367
+ var prevInfo;
368
+ var prevWarn;
369
+ var prevError;
370
+ var prevGroup;
371
+ var prevGroupCollapsed;
372
+ var prevGroupEnd;
373
+
374
+ function disabledLog() {}
375
+
376
+ disabledLog.__reactDisabledLog = true;
377
+ function disableLogs() {
378
+ {
379
+ if (disabledDepth === 0) {
380
+ /* eslint-disable react-internal/no-production-logging */
381
+ prevLog = console.log;
382
+ prevInfo = console.info;
383
+ prevWarn = console.warn;
384
+ prevError = console.error;
385
+ prevGroup = console.group;
386
+ prevGroupCollapsed = console.groupCollapsed;
387
+ prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099
388
+
389
+ var props = {
390
+ configurable: true,
391
+ enumerable: true,
392
+ value: disabledLog,
393
+ writable: true
394
+ }; // $FlowFixMe Flow thinks console is immutable.
395
+
396
+ Object.defineProperties(console, {
397
+ info: props,
398
+ log: props,
399
+ warn: props,
400
+ error: props,
401
+ group: props,
402
+ groupCollapsed: props,
403
+ groupEnd: props
404
+ });
405
+ /* eslint-enable react-internal/no-production-logging */
406
+ }
407
+
408
+ disabledDepth++;
409
+ }
410
+ }
411
+ function reenableLogs() {
412
+ {
413
+ disabledDepth--;
414
+
415
+ if (disabledDepth === 0) {
416
+ /* eslint-disable react-internal/no-production-logging */
417
+ var props = {
418
+ configurable: true,
419
+ enumerable: true,
420
+ writable: true
421
+ }; // $FlowFixMe Flow thinks console is immutable.
422
+
423
+ Object.defineProperties(console, {
424
+ log: assign({}, props, {
425
+ value: prevLog
426
+ }),
427
+ info: assign({}, props, {
428
+ value: prevInfo
429
+ }),
430
+ warn: assign({}, props, {
431
+ value: prevWarn
432
+ }),
433
+ error: assign({}, props, {
434
+ value: prevError
435
+ }),
436
+ group: assign({}, props, {
437
+ value: prevGroup
438
+ }),
439
+ groupCollapsed: assign({}, props, {
440
+ value: prevGroupCollapsed
441
+ }),
442
+ groupEnd: assign({}, props, {
443
+ value: prevGroupEnd
444
+ })
445
+ });
446
+ /* eslint-enable react-internal/no-production-logging */
447
+ }
448
+
449
+ if (disabledDepth < 0) {
450
+ error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
451
+ }
452
+ }
453
+ }
454
+
455
+ var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
456
+ var prefix;
457
+ function describeBuiltInComponentFrame(name, source, ownerFn) {
458
+ {
459
+ if (prefix === undefined) {
460
+ // Extract the VM specific prefix used by each line.
461
+ try {
462
+ throw Error();
463
+ } catch (x) {
464
+ var match = x.stack.trim().match(/\n( *(at )?)/);
465
+ prefix = match && match[1] || '';
466
+ }
467
+ } // We use the prefix to ensure our stacks line up with native stack frames.
468
+
469
+
470
+ return '\n' + prefix + name;
471
+ }
472
+ }
473
+ var reentry = false;
474
+ var componentFrameCache;
475
+
476
+ {
477
+ var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
478
+ componentFrameCache = new PossiblyWeakMap();
479
+ }
480
+
481
+ function describeNativeComponentFrame(fn, construct) {
482
+ // If something asked for a stack inside a fake render, it should get ignored.
483
+ if ( !fn || reentry) {
484
+ return '';
485
+ }
486
+
487
+ {
488
+ var frame = componentFrameCache.get(fn);
489
+
490
+ if (frame !== undefined) {
491
+ return frame;
492
+ }
493
+ }
494
+
495
+ var control;
496
+ reentry = true;
497
+ var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.
498
+
499
+ Error.prepareStackTrace = undefined;
500
+ var previousDispatcher;
501
+
502
+ {
503
+ previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function
504
+ // for warnings.
505
+
506
+ ReactCurrentDispatcher.current = null;
507
+ disableLogs();
508
+ }
509
+
510
+ try {
511
+ // This should throw.
512
+ if (construct) {
513
+ // Something should be setting the props in the constructor.
514
+ var Fake = function () {
515
+ throw Error();
516
+ }; // $FlowFixMe
517
+
518
+
519
+ Object.defineProperty(Fake.prototype, 'props', {
520
+ set: function () {
521
+ // We use a throwing setter instead of frozen or non-writable props
522
+ // because that won't throw in a non-strict mode function.
523
+ throw Error();
524
+ }
525
+ });
526
+
527
+ if (typeof Reflect === 'object' && Reflect.construct) {
528
+ // We construct a different control for this case to include any extra
529
+ // frames added by the construct call.
530
+ try {
531
+ Reflect.construct(Fake, []);
532
+ } catch (x) {
533
+ control = x;
534
+ }
535
+
536
+ Reflect.construct(fn, [], Fake);
537
+ } else {
538
+ try {
539
+ Fake.call();
540
+ } catch (x) {
541
+ control = x;
542
+ }
543
+
544
+ fn.call(Fake.prototype);
545
+ }
546
+ } else {
547
+ try {
548
+ throw Error();
549
+ } catch (x) {
550
+ control = x;
551
+ }
552
+
553
+ fn();
554
+ }
555
+ } catch (sample) {
556
+ // This is inlined manually because closure doesn't do it for us.
557
+ if (sample && control && typeof sample.stack === 'string') {
558
+ // This extracts the first frame from the sample that isn't also in the control.
559
+ // Skipping one frame that we assume is the frame that calls the two.
560
+ var sampleLines = sample.stack.split('\n');
561
+ var controlLines = control.stack.split('\n');
562
+ var s = sampleLines.length - 1;
563
+ var c = controlLines.length - 1;
564
+
565
+ while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
566
+ // We expect at least one stack frame to be shared.
567
+ // Typically this will be the root most one. However, stack frames may be
568
+ // cut off due to maximum stack limits. In this case, one maybe cut off
569
+ // earlier than the other. We assume that the sample is longer or the same
570
+ // and there for cut off earlier. So we should find the root most frame in
571
+ // the sample somewhere in the control.
572
+ c--;
573
+ }
574
+
575
+ for (; s >= 1 && c >= 0; s--, c--) {
576
+ // Next we find the first one that isn't the same which should be the
577
+ // frame that called our sample function and the control.
578
+ if (sampleLines[s] !== controlLines[c]) {
579
+ // In V8, the first line is describing the message but other VMs don't.
580
+ // If we're about to return the first line, and the control is also on the same
581
+ // line, that's a pretty good indicator that our sample threw at same line as
582
+ // the control. I.e. before we entered the sample frame. So we ignore this result.
583
+ // This can happen if you passed a class to function component, or non-function.
584
+ if (s !== 1 || c !== 1) {
585
+ do {
586
+ s--;
587
+ c--; // We may still have similar intermediate frames from the construct call.
588
+ // The next one that isn't the same should be our match though.
589
+
590
+ if (c < 0 || sampleLines[s] !== controlLines[c]) {
591
+ // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
592
+ var _frame = '\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled "<anonymous>"
593
+ // but we have a user-provided "displayName"
594
+ // splice it in to make the stack more readable.
595
+
596
+
597
+ if (fn.displayName && _frame.includes('<anonymous>')) {
598
+ _frame = _frame.replace('<anonymous>', fn.displayName);
599
+ }
600
+
601
+ {
602
+ if (typeof fn === 'function') {
603
+ componentFrameCache.set(fn, _frame);
604
+ }
605
+ } // Return the line we found.
606
+
607
+
608
+ return _frame;
609
+ }
610
+ } while (s >= 1 && c >= 0);
611
+ }
612
+
613
+ break;
614
+ }
615
+ }
616
+ }
617
+ } finally {
618
+ reentry = false;
619
+
620
+ {
621
+ ReactCurrentDispatcher.current = previousDispatcher;
622
+ reenableLogs();
623
+ }
624
+
625
+ Error.prepareStackTrace = previousPrepareStackTrace;
626
+ } // Fallback to just using the name if we couldn't make it throw.
627
+
628
+
629
+ var name = fn ? fn.displayName || fn.name : '';
630
+ var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';
631
+
632
+ {
633
+ if (typeof fn === 'function') {
634
+ componentFrameCache.set(fn, syntheticFrame);
635
+ }
636
+ }
637
+
638
+ return syntheticFrame;
639
+ }
640
+ function describeFunctionComponentFrame(fn, source, ownerFn) {
641
+ {
642
+ return describeNativeComponentFrame(fn, false);
643
+ }
644
+ }
645
+
646
+ function shouldConstruct(Component) {
647
+ var prototype = Component.prototype;
648
+ return !!(prototype && prototype.isReactComponent);
649
+ }
650
+
651
+ function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
652
+
653
+ if (type == null) {
654
+ return '';
655
+ }
656
+
657
+ if (typeof type === 'function') {
658
+ {
659
+ return describeNativeComponentFrame(type, shouldConstruct(type));
660
+ }
661
+ }
662
+
663
+ if (typeof type === 'string') {
664
+ return describeBuiltInComponentFrame(type);
665
+ }
666
+
667
+ switch (type) {
668
+ case REACT_SUSPENSE_TYPE:
669
+ return describeBuiltInComponentFrame('Suspense');
670
+
671
+ case REACT_SUSPENSE_LIST_TYPE:
672
+ return describeBuiltInComponentFrame('SuspenseList');
673
+ }
674
+
675
+ if (typeof type === 'object') {
676
+ switch (type.$$typeof) {
677
+ case REACT_FORWARD_REF_TYPE:
678
+ return describeFunctionComponentFrame(type.render);
679
+
680
+ case REACT_MEMO_TYPE:
681
+ // Memo may contain any component type so we recursively resolve it.
682
+ return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
683
+
684
+ case REACT_LAZY_TYPE:
685
+ {
686
+ var lazyComponent = type;
687
+ var payload = lazyComponent._payload;
688
+ var init = lazyComponent._init;
689
+
690
+ try {
691
+ // Lazy may contain any component type so we recursively resolve it.
692
+ return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
693
+ } catch (x) {}
694
+ }
695
+ }
696
+ }
697
+
698
+ return '';
699
+ }
700
+
701
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
702
+
703
+ var loggedTypeFailures = {};
704
+ var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
705
+
706
+ function setCurrentlyValidatingElement(element) {
707
+ {
708
+ if (element) {
709
+ var owner = element._owner;
710
+ var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
711
+ ReactDebugCurrentFrame.setExtraStackFrame(stack);
712
+ } else {
713
+ ReactDebugCurrentFrame.setExtraStackFrame(null);
714
+ }
715
+ }
716
+ }
717
+
718
+ function checkPropTypes(typeSpecs, values, location, componentName, element) {
719
+ {
720
+ // $FlowFixMe This is okay but Flow doesn't know it.
721
+ var has = Function.call.bind(hasOwnProperty);
722
+
723
+ for (var typeSpecName in typeSpecs) {
724
+ if (has(typeSpecs, typeSpecName)) {
725
+ var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to
726
+ // fail the render phase where it didn't fail before. So we log it.
727
+ // After these have been cleaned up, we'll let them throw.
728
+
729
+ try {
730
+ // This is intentionally an invariant that gets caught. It's the same
731
+ // behavior as without this statement except with a better message.
732
+ if (typeof typeSpecs[typeSpecName] !== 'function') {
733
+ // eslint-disable-next-line react-internal/prod-error-codes
734
+ var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');
735
+ err.name = 'Invariant Violation';
736
+ throw err;
737
+ }
738
+
739
+ error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
740
+ } catch (ex) {
741
+ error$1 = ex;
742
+ }
743
+
744
+ if (error$1 && !(error$1 instanceof Error)) {
745
+ setCurrentlyValidatingElement(element);
746
+
747
+ error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);
748
+
749
+ setCurrentlyValidatingElement(null);
750
+ }
751
+
752
+ if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
753
+ // Only monitor this failure once because there tends to be a lot of the
754
+ // same error.
755
+ loggedTypeFailures[error$1.message] = true;
756
+ setCurrentlyValidatingElement(element);
757
+
758
+ error('Failed %s type: %s', location, error$1.message);
759
+
760
+ setCurrentlyValidatingElement(null);
761
+ }
762
+ }
763
+ }
764
+ }
765
+ }
766
+
767
+ var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare
768
+
769
+ function isArray(a) {
770
+ return isArrayImpl(a);
771
+ }
772
+
773
+ /*
774
+ * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol
775
+ * and Temporal.* types. See https://github.com/facebook/react/pull/22064.
776
+ *
777
+ * The functions in this module will throw an easier-to-understand,
778
+ * easier-to-debug exception with a clear errors message message explaining the
779
+ * problem. (Instead of a confusing exception thrown inside the implementation
780
+ * of the `value` object).
781
+ */
782
+ // $FlowFixMe only called in DEV, so void return is not possible.
783
+ function typeName(value) {
784
+ {
785
+ // toStringTag is needed for namespaced types like Temporal.Instant
786
+ var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;
787
+ var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';
788
+ return type;
789
+ }
790
+ } // $FlowFixMe only called in DEV, so void return is not possible.
791
+
792
+
793
+ function willCoercionThrow(value) {
794
+ {
795
+ try {
796
+ testStringCoercion(value);
797
+ return false;
798
+ } catch (e) {
799
+ return true;
800
+ }
801
+ }
802
+ }
803
+
804
+ function testStringCoercion(value) {
805
+ // If you ended up here by following an exception call stack, here's what's
806
+ // happened: you supplied an object or symbol value to React (as a prop, key,
807
+ // DOM attribute, CSS property, string ref, etc.) and when React tried to
808
+ // coerce it to a string using `'' + value`, an exception was thrown.
809
+ //
810
+ // The most common types that will cause this exception are `Symbol` instances
811
+ // and Temporal objects like `Temporal.Instant`. But any object that has a
812
+ // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this
813
+ // exception. (Library authors do this to prevent users from using built-in
814
+ // numeric operators like `+` or comparison operators like `>=` because custom
815
+ // methods are needed to perform accurate arithmetic or comparison.)
816
+ //
817
+ // To fix the problem, coerce this object or symbol value to a string before
818
+ // passing it to React. The most reliable way is usually `String(value)`.
819
+ //
820
+ // To find which value is throwing, check the browser or debugger console.
821
+ // Before this exception was thrown, there should be `console.error` output
822
+ // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the
823
+ // problem and how that type was used: key, atrribute, input value prop, etc.
824
+ // In most cases, this console output also shows the component and its
825
+ // ancestor components where the exception happened.
826
+ //
827
+ // eslint-disable-next-line react-internal/safe-string-coercion
828
+ return '' + value;
829
+ }
830
+ function checkKeyStringCoercion(value) {
831
+ {
832
+ if (willCoercionThrow(value)) {
833
+ error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));
834
+
835
+ return testStringCoercion(value); // throw (to help callers find troubleshooting comments)
836
+ }
837
+ }
838
+ }
839
+
840
+ var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
841
+ var RESERVED_PROPS = {
842
+ key: true,
843
+ ref: true,
844
+ __self: true,
845
+ __source: true
846
+ };
847
+ var specialPropKeyWarningShown;
848
+ var specialPropRefWarningShown;
849
+ var didWarnAboutStringRefs;
850
+
851
+ {
852
+ didWarnAboutStringRefs = {};
853
+ }
854
+
855
+ function hasValidRef(config) {
856
+ {
857
+ if (hasOwnProperty.call(config, 'ref')) {
858
+ var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
859
+
860
+ if (getter && getter.isReactWarning) {
861
+ return false;
862
+ }
863
+ }
864
+ }
865
+
866
+ return config.ref !== undefined;
867
+ }
868
+
869
+ function hasValidKey(config) {
870
+ {
871
+ if (hasOwnProperty.call(config, 'key')) {
872
+ var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
873
+
874
+ if (getter && getter.isReactWarning) {
875
+ return false;
876
+ }
877
+ }
878
+ }
879
+
880
+ return config.key !== undefined;
881
+ }
882
+
883
+ function warnIfStringRefCannotBeAutoConverted(config, self) {
884
+ {
885
+ if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {
886
+ var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);
887
+
888
+ if (!didWarnAboutStringRefs[componentName]) {
889
+ error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref);
890
+
891
+ didWarnAboutStringRefs[componentName] = true;
892
+ }
893
+ }
894
+ }
895
+ }
896
+
897
+ function defineKeyPropWarningGetter(props, displayName) {
898
+ {
899
+ var warnAboutAccessingKey = function () {
900
+ if (!specialPropKeyWarningShown) {
901
+ specialPropKeyWarningShown = true;
902
+
903
+ error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);
904
+ }
905
+ };
906
+
907
+ warnAboutAccessingKey.isReactWarning = true;
908
+ Object.defineProperty(props, 'key', {
909
+ get: warnAboutAccessingKey,
910
+ configurable: true
911
+ });
912
+ }
913
+ }
914
+
915
+ function defineRefPropWarningGetter(props, displayName) {
916
+ {
917
+ var warnAboutAccessingRef = function () {
918
+ if (!specialPropRefWarningShown) {
919
+ specialPropRefWarningShown = true;
920
+
921
+ error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);
922
+ }
923
+ };
924
+
925
+ warnAboutAccessingRef.isReactWarning = true;
926
+ Object.defineProperty(props, 'ref', {
927
+ get: warnAboutAccessingRef,
928
+ configurable: true
929
+ });
930
+ }
931
+ }
932
+ /**
933
+ * Factory method to create a new React element. This no longer adheres to
934
+ * the class pattern, so do not use new to call it. Also, instanceof check
935
+ * will not work. Instead test $$typeof field against Symbol.for('react.element') to check
936
+ * if something is a React Element.
937
+ *
938
+ * @param {*} type
939
+ * @param {*} props
940
+ * @param {*} key
941
+ * @param {string|object} ref
942
+ * @param {*} owner
943
+ * @param {*} self A *temporary* helper to detect places where `this` is
944
+ * different from the `owner` when React.createElement is called, so that we
945
+ * can warn. We want to get rid of owner and replace string `ref`s with arrow
946
+ * functions, and as long as `this` and owner are the same, there will be no
947
+ * change in behavior.
948
+ * @param {*} source An annotation object (added by a transpiler or otherwise)
949
+ * indicating filename, line number, and/or other information.
950
+ * @internal
951
+ */
952
+
953
+
954
+ var ReactElement = function (type, key, ref, self, source, owner, props) {
955
+ var element = {
956
+ // This tag allows us to uniquely identify this as a React Element
957
+ $$typeof: REACT_ELEMENT_TYPE,
958
+ // Built-in properties that belong on the element
959
+ type: type,
960
+ key: key,
961
+ ref: ref,
962
+ props: props,
963
+ // Record the component responsible for creating this element.
964
+ _owner: owner
965
+ };
966
+
967
+ {
968
+ // The validation flag is currently mutative. We put it on
969
+ // an external backing store so that we can freeze the whole object.
970
+ // This can be replaced with a WeakMap once they are implemented in
971
+ // commonly used development environments.
972
+ element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
973
+ // the validation flag non-enumerable (where possible, which should
974
+ // include every environment we run tests in), so the test framework
975
+ // ignores it.
976
+
977
+ Object.defineProperty(element._store, 'validated', {
978
+ configurable: false,
979
+ enumerable: false,
980
+ writable: true,
981
+ value: false
982
+ }); // self and source are DEV only properties.
983
+
984
+ Object.defineProperty(element, '_self', {
985
+ configurable: false,
986
+ enumerable: false,
987
+ writable: false,
988
+ value: self
989
+ }); // Two elements created in two different places should be considered
990
+ // equal for testing purposes and therefore we hide it from enumeration.
991
+
992
+ Object.defineProperty(element, '_source', {
993
+ configurable: false,
994
+ enumerable: false,
995
+ writable: false,
996
+ value: source
997
+ });
998
+
999
+ if (Object.freeze) {
1000
+ Object.freeze(element.props);
1001
+ Object.freeze(element);
1002
+ }
1003
+ }
1004
+
1005
+ return element;
1006
+ };
1007
+ /**
1008
+ * https://github.com/reactjs/rfcs/pull/107
1009
+ * @param {*} type
1010
+ * @param {object} props
1011
+ * @param {string} key
1012
+ */
1013
+
1014
+ function jsxDEV(type, config, maybeKey, source, self) {
1015
+ {
1016
+ var propName; // Reserved names are extracted
1017
+
1018
+ var props = {};
1019
+ var key = null;
1020
+ var ref = null; // Currently, key can be spread in as a prop. This causes a potential
1021
+ // issue if key is also explicitly declared (ie. <div {...props} key="Hi" />
1022
+ // or <div key="Hi" {...props} /> ). We want to deprecate key spread,
1023
+ // but as an intermediary step, we will use jsxDEV for everything except
1024
+ // <div {...props} key="Hi" />, because we aren't currently able to tell if
1025
+ // key is explicitly declared to be undefined or not.
1026
+
1027
+ if (maybeKey !== undefined) {
1028
+ {
1029
+ checkKeyStringCoercion(maybeKey);
1030
+ }
1031
+
1032
+ key = '' + maybeKey;
1033
+ }
1034
+
1035
+ if (hasValidKey(config)) {
1036
+ {
1037
+ checkKeyStringCoercion(config.key);
1038
+ }
1039
+
1040
+ key = '' + config.key;
1041
+ }
1042
+
1043
+ if (hasValidRef(config)) {
1044
+ ref = config.ref;
1045
+ warnIfStringRefCannotBeAutoConverted(config, self);
1046
+ } // Remaining properties are added to a new props object
1047
+
1048
+
1049
+ for (propName in config) {
1050
+ if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
1051
+ props[propName] = config[propName];
1052
+ }
1053
+ } // Resolve default props
1054
+
1055
+
1056
+ if (type && type.defaultProps) {
1057
+ var defaultProps = type.defaultProps;
1058
+
1059
+ for (propName in defaultProps) {
1060
+ if (props[propName] === undefined) {
1061
+ props[propName] = defaultProps[propName];
1062
+ }
1063
+ }
1064
+ }
1065
+
1066
+ if (key || ref) {
1067
+ var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
1068
+
1069
+ if (key) {
1070
+ defineKeyPropWarningGetter(props, displayName);
1071
+ }
1072
+
1073
+ if (ref) {
1074
+ defineRefPropWarningGetter(props, displayName);
1075
+ }
1076
+ }
1077
+
1078
+ return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
1079
+ }
1080
+ }
1081
+
1082
+ var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
1083
+ var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
1084
+
1085
+ function setCurrentlyValidatingElement$1(element) {
1086
+ {
1087
+ if (element) {
1088
+ var owner = element._owner;
1089
+ var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
1090
+ ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
1091
+ } else {
1092
+ ReactDebugCurrentFrame$1.setExtraStackFrame(null);
1093
+ }
1094
+ }
1095
+ }
1096
+
1097
+ var propTypesMisspellWarningShown;
1098
+
1099
+ {
1100
+ propTypesMisspellWarningShown = false;
1101
+ }
1102
+ /**
1103
+ * Verifies the object is a ReactElement.
1104
+ * See https://reactjs.org/docs/react-api.html#isvalidelement
1105
+ * @param {?object} object
1106
+ * @return {boolean} True if `object` is a ReactElement.
1107
+ * @final
1108
+ */
1109
+
1110
+
1111
+ function isValidElement(object) {
1112
+ {
1113
+ return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
1114
+ }
1115
+ }
1116
+
1117
+ function getDeclarationErrorAddendum() {
1118
+ {
1119
+ if (ReactCurrentOwner$1.current) {
1120
+ var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);
1121
+
1122
+ if (name) {
1123
+ return '\n\nCheck the render method of `' + name + '`.';
1124
+ }
1125
+ }
1126
+
1127
+ return '';
1128
+ }
1129
+ }
1130
+
1131
+ function getSourceInfoErrorAddendum(source) {
1132
+ {
1133
+ if (source !== undefined) {
1134
+ var fileName = source.fileName.replace(/^.*[\\\/]/, '');
1135
+ var lineNumber = source.lineNumber;
1136
+ return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
1137
+ }
1138
+
1139
+ return '';
1140
+ }
1141
+ }
1142
+ /**
1143
+ * Warn if there's no key explicitly set on dynamic arrays of children or
1144
+ * object keys are not valid. This allows us to keep track of children between
1145
+ * updates.
1146
+ */
1147
+
1148
+
1149
+ var ownerHasKeyUseWarning = {};
1150
+
1151
+ function getCurrentComponentErrorInfo(parentType) {
1152
+ {
1153
+ var info = getDeclarationErrorAddendum();
1154
+
1155
+ if (!info) {
1156
+ var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
1157
+
1158
+ if (parentName) {
1159
+ info = "\n\nCheck the top-level render call using <" + parentName + ">.";
1160
+ }
1161
+ }
1162
+
1163
+ return info;
1164
+ }
1165
+ }
1166
+ /**
1167
+ * Warn if the element doesn't have an explicit key assigned to it.
1168
+ * This element is in an array. The array could grow and shrink or be
1169
+ * reordered. All children that haven't already been validated are required to
1170
+ * have a "key" property assigned to it. Error statuses are cached so a warning
1171
+ * will only be shown once.
1172
+ *
1173
+ * @internal
1174
+ * @param {ReactElement} element Element that requires a key.
1175
+ * @param {*} parentType element's parent's type.
1176
+ */
1177
+
1178
+
1179
+ function validateExplicitKey(element, parentType) {
1180
+ {
1181
+ if (!element._store || element._store.validated || element.key != null) {
1182
+ return;
1183
+ }
1184
+
1185
+ element._store.validated = true;
1186
+ var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
1187
+
1188
+ if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
1189
+ return;
1190
+ }
1191
+
1192
+ ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a
1193
+ // property, it may be the creator of the child that's responsible for
1194
+ // assigning it a key.
1195
+
1196
+ var childOwner = '';
1197
+
1198
+ if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {
1199
+ // Give the component that originally created this child.
1200
+ childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
1201
+ }
1202
+
1203
+ setCurrentlyValidatingElement$1(element);
1204
+
1205
+ error('Each child in a list should have a unique "key" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);
1206
+
1207
+ setCurrentlyValidatingElement$1(null);
1208
+ }
1209
+ }
1210
+ /**
1211
+ * Ensure that every element either is passed in a static location, in an
1212
+ * array with an explicit keys property defined, or in an object literal
1213
+ * with valid key property.
1214
+ *
1215
+ * @internal
1216
+ * @param {ReactNode} node Statically passed child of any type.
1217
+ * @param {*} parentType node's parent's type.
1218
+ */
1219
+
1220
+
1221
+ function validateChildKeys(node, parentType) {
1222
+ {
1223
+ if (typeof node !== 'object') {
1224
+ return;
1225
+ }
1226
+
1227
+ if (isArray(node)) {
1228
+ for (var i = 0; i < node.length; i++) {
1229
+ var child = node[i];
1230
+
1231
+ if (isValidElement(child)) {
1232
+ validateExplicitKey(child, parentType);
1233
+ }
1234
+ }
1235
+ } else if (isValidElement(node)) {
1236
+ // This element was passed in a valid location.
1237
+ if (node._store) {
1238
+ node._store.validated = true;
1239
+ }
1240
+ } else if (node) {
1241
+ var iteratorFn = getIteratorFn(node);
1242
+
1243
+ if (typeof iteratorFn === 'function') {
1244
+ // Entry iterators used to provide implicit keys,
1245
+ // but now we print a separate warning for them later.
1246
+ if (iteratorFn !== node.entries) {
1247
+ var iterator = iteratorFn.call(node);
1248
+ var step;
1249
+
1250
+ while (!(step = iterator.next()).done) {
1251
+ if (isValidElement(step.value)) {
1252
+ validateExplicitKey(step.value, parentType);
1253
+ }
1254
+ }
1255
+ }
1256
+ }
1257
+ }
1258
+ }
1259
+ }
1260
+ /**
1261
+ * Given an element, validate that its props follow the propTypes definition,
1262
+ * provided by the type.
1263
+ *
1264
+ * @param {ReactElement} element
1265
+ */
1266
+
1267
+
1268
+ function validatePropTypes(element) {
1269
+ {
1270
+ var type = element.type;
1271
+
1272
+ if (type === null || type === undefined || typeof type === 'string') {
1273
+ return;
1274
+ }
1275
+
1276
+ var propTypes;
1277
+
1278
+ if (typeof type === 'function') {
1279
+ propTypes = type.propTypes;
1280
+ } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
1281
+ // Inner props are checked in the reconciler.
1282
+ type.$$typeof === REACT_MEMO_TYPE)) {
1283
+ propTypes = type.propTypes;
1284
+ } else {
1285
+ return;
1286
+ }
1287
+
1288
+ if (propTypes) {
1289
+ // Intentionally inside to avoid triggering lazy initializers:
1290
+ var name = getComponentNameFromType(type);
1291
+ checkPropTypes(propTypes, element.props, 'prop', name, element);
1292
+ } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
1293
+ propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:
1294
+
1295
+ var _name = getComponentNameFromType(type);
1296
+
1297
+ error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');
1298
+ }
1299
+
1300
+ if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {
1301
+ error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
1302
+ }
1303
+ }
1304
+ }
1305
+ /**
1306
+ * Given a fragment, validate that it can only be provided with fragment props
1307
+ * @param {ReactElement} fragment
1308
+ */
1309
+
1310
+
1311
+ function validateFragmentProps(fragment) {
1312
+ {
1313
+ var keys = Object.keys(fragment.props);
1314
+
1315
+ for (var i = 0; i < keys.length; i++) {
1316
+ var key = keys[i];
1317
+
1318
+ if (key !== 'children' && key !== 'key') {
1319
+ setCurrentlyValidatingElement$1(fragment);
1320
+
1321
+ error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
1322
+
1323
+ setCurrentlyValidatingElement$1(null);
1324
+ break;
1325
+ }
1326
+ }
1327
+
1328
+ if (fragment.ref !== null) {
1329
+ setCurrentlyValidatingElement$1(fragment);
1330
+
1331
+ error('Invalid attribute `ref` supplied to `React.Fragment`.');
1332
+
1333
+ setCurrentlyValidatingElement$1(null);
1334
+ }
1335
+ }
1336
+ }
1337
+
1338
+ var didWarnAboutKeySpread = {};
1339
+ function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
1340
+ {
1341
+ var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
1342
+ // succeed and there will likely be errors in render.
1343
+
1344
+ if (!validType) {
1345
+ var info = '';
1346
+
1347
+ if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
1348
+ info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports.";
1349
+ }
1350
+
1351
+ var sourceInfo = getSourceInfoErrorAddendum(source);
1352
+
1353
+ if (sourceInfo) {
1354
+ info += sourceInfo;
1355
+ } else {
1356
+ info += getDeclarationErrorAddendum();
1357
+ }
1358
+
1359
+ var typeString;
1360
+
1361
+ if (type === null) {
1362
+ typeString = 'null';
1363
+ } else if (isArray(type)) {
1364
+ typeString = 'array';
1365
+ } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
1366
+ typeString = "<" + (getComponentNameFromType(type.type) || 'Unknown') + " />";
1367
+ info = ' Did you accidentally export a JSX literal instead of a component?';
1368
+ } else {
1369
+ typeString = typeof type;
1370
+ }
1371
+
1372
+ error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);
1373
+ }
1374
+
1375
+ var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.
1376
+ // TODO: Drop this when these are no longer allowed as the type argument.
1377
+
1378
+ if (element == null) {
1379
+ return element;
1380
+ } // Skip key warning if the type isn't valid since our key validation logic
1381
+ // doesn't expect a non-string/function type and can throw confusing errors.
1382
+ // We don't want exception behavior to differ between dev and prod.
1383
+ // (Rendering will throw with a helpful message and as soon as the type is
1384
+ // fixed, the key warnings will appear.)
1385
+
1386
+
1387
+ if (validType) {
1388
+ var children = props.children;
1389
+
1390
+ if (children !== undefined) {
1391
+ if (isStaticChildren) {
1392
+ if (isArray(children)) {
1393
+ for (var i = 0; i < children.length; i++) {
1394
+ validateChildKeys(children[i], type);
1395
+ }
1396
+
1397
+ if (Object.freeze) {
1398
+ Object.freeze(children);
1399
+ }
1400
+ } else {
1401
+ error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');
1402
+ }
1403
+ } else {
1404
+ validateChildKeys(children, type);
1405
+ }
1406
+ }
1407
+ }
1408
+
1409
+ {
1410
+ if (hasOwnProperty.call(props, 'key')) {
1411
+ var componentName = getComponentNameFromType(type);
1412
+ var keys = Object.keys(props).filter(function (k) {
1413
+ return k !== 'key';
1414
+ });
1415
+ var beforeExample = keys.length > 0 ? '{key: someKey, ' + keys.join(': ..., ') + ': ...}' : '{key: someKey}';
1416
+
1417
+ if (!didWarnAboutKeySpread[componentName + beforeExample]) {
1418
+ var afterExample = keys.length > 0 ? '{' + keys.join(': ..., ') + ': ...}' : '{}';
1419
+
1420
+ error('A props object containing a "key" prop is being spread into JSX:\n' + ' let props = %s;\n' + ' <%s {...props} />\n' + 'React keys must be passed directly to JSX without using spread:\n' + ' let props = %s;\n' + ' <%s key={someKey} {...props} />', beforeExample, componentName, afterExample, componentName);
1421
+
1422
+ didWarnAboutKeySpread[componentName + beforeExample] = true;
1423
+ }
1424
+ }
1425
+ }
1426
+
1427
+ if (type === REACT_FRAGMENT_TYPE) {
1428
+ validateFragmentProps(element);
1429
+ } else {
1430
+ validatePropTypes(element);
1431
+ }
1432
+
1433
+ return element;
1434
+ }
1435
+ } // These two functions exist to still get child warnings in dev
1436
+ // even with the prod transform. This means that jsxDEV is purely
1437
+ // opt-in behavior for better messages but that we won't stop
1438
+ // giving you warnings if you use production apis.
1439
+
1440
+ function jsxWithValidationStatic(type, props, key) {
1441
+ {
1442
+ return jsxWithValidation(type, props, key, true);
1443
+ }
1444
+ }
1445
+ function jsxWithValidationDynamic(type, props, key) {
1446
+ {
1447
+ return jsxWithValidation(type, props, key, false);
1448
+ }
1449
+ }
1450
+
1451
+ var jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.
1452
+ // for now we can ship identical prod functions
1453
+
1454
+ var jsxs = jsxWithValidationStatic ;
1455
+
1456
+ reactJsxRuntime_development.Fragment = REACT_FRAGMENT_TYPE;
1457
+ reactJsxRuntime_development.jsx = jsx;
1458
+ reactJsxRuntime_development.jsxs = jsxs;
1459
+ })();
1460
+ }
1461
+ return reactJsxRuntime_development;
1462
+ }
1463
+
1464
+ var hasRequiredJsxRuntime;
1465
+
1466
+ function requireJsxRuntime () {
1467
+ if (hasRequiredJsxRuntime) return jsxRuntime.exports;
1468
+ hasRequiredJsxRuntime = 1;
1469
+
1470
+ if (process.env.NODE_ENV === 'production') {
1471
+ jsxRuntime.exports = requireReactJsxRuntime_production_min();
1472
+ } else {
1473
+ jsxRuntime.exports = requireReactJsxRuntime_development();
1474
+ }
1475
+ return jsxRuntime.exports;
1476
+ }
1477
+
1478
+ var jsxRuntimeExports = requireJsxRuntime();
1479
+
1480
+ const _excluded$1 = ["doorDepth"];
1481
+ const ConfiguratorContext = /*#__PURE__*/require$$0.createContext(undefined);
1482
+ const ConfiguratorProvider = _ref => {
1483
+ let {
1484
+ children
1485
+ } = _ref;
1486
+ const [isPlaneVisible, setIsPlaneVisible] = require$$0.useState(false);
1487
+ const [isFrameVisible, setIsFrameVisible] = require$$0.useState(true);
1488
+ const [cpid, setCpid] = require$$0.useState("");
1489
+ const [totalHeight, setTotalHeight] = require$$0.useState(2700);
1490
+ const [totalWidth, setTotalWidth] = require$$0.useState(974);
1491
+ const [glassVisible, setGlassVisible] = require$$0.useState(false);
1492
+ const [glassDepth, setGlassDepth] = require$$0.useState(8);
1493
+ const [door, setDoor] = require$$0.useState({
1494
+ doorMaterial: "door_material",
1495
+ doorWidth: 0,
1496
+ doorHeight: 0,
1497
+ theDoorDepth: 40,
1498
+ doorPivot: "left",
1499
+ doorOpening: "out"
1500
+ });
1501
+ const [doorFrame, setDoorFrame] = require$$0.useState({
1502
+ frameMaterial: "doorFrame_material",
1503
+ doorStopMaterial: "doorStop_material",
1504
+ gasketMaterial: "gasket_material",
1505
+ hingeMaterial: "hinge_material",
1506
+ glassMaterial: "glass_material",
1507
+ frameDepth: 103,
1508
+ topThk: "20mm",
1509
+ sidesThk: "20mm",
1510
+ doorStopOffset: "30mm",
1511
+ doorStopWidth: 20,
1512
+ doorStopDepth: 13,
1513
+ notchWidth: "20mm",
1514
+ notchDepth: "40mm",
1515
+ notchposition: 0.01,
1516
+ gasketDepth: 5,
1517
+ gasketWidth: 5,
1518
+ secondDoorStopWidth: 20,
1519
+ secondDoorStopDepth: 30,
1520
+ secondDoorStopOffset: 13
1521
+ });
1522
+ const [interiorFanlight, setInteriorFanlight] = require$$0.useState({
1523
+ visible: false,
1524
+ height: 300,
1525
+ material: "interiorFanlight_material"
1526
+ });
1527
+ const [exteriorFanlight, setExteriorFanlight] = require$$0.useState({
1528
+ visible: false,
1529
+ height: 300,
1530
+ depth: 60,
1531
+ material: "exteriorFanlight_material"
1532
+ });
1533
+ const [occulus, setOcculus] = require$$0.useState({
1534
+ visible: false,
1535
+ infillVisible: true,
1536
+ x1: 120,
1537
+ x2: 120,
1538
+ y1: 600,
1539
+ y2: 220,
1540
+ material: "infill_material",
1541
+ depth: 20
1542
+ });
1543
+ const [frontCoverPanel, setFrontCoverPanel] = require$$0.useState({
1544
+ visible: false,
1545
+ width: 73,
1546
+ height: 2200,
1547
+ depth: 12,
1548
+ material: "front_cover_material"
1549
+ });
1550
+ const [backCoverPanel, setBackCoverPanel] = require$$0.useState({
1551
+ visible: false,
1552
+ width: 73,
1553
+ height: 2200,
1554
+ depth: 12,
1555
+ material: "back_cover_material"
1556
+ });
1557
+ const [glass, setGlass] = require$$0.useState({
1558
+ visible: false,
1559
+ material: "infill_material",
1560
+ depth: 20
1561
+ });
1562
+ const [frameType, setFrameType] = require$$0.useState("AF20_40");
1563
+ const [bodyType, setBodyType] = require$$0.useState("40");
1564
+ const [exteriorFanlightType, setExteriorFanlightType] = require$$0.useState("WPFL");
1565
+ const [testDoorMaterial, setTestDoorMaterial] = require$$0.useState("brown");
1566
+ const [testFrameMaterial, setTestFrameMaterial] = require$$0.useState("black");
1567
+ const [testGasketMaterial, setTestGasketMaterial] = require$$0.useState("darkgrey");
1568
+ const [testInteriorFanlightMaterial, setTestInteriorFanlightMaterial] = require$$0.useState("grey");
1569
+ const [testExteriorFanlightMaterial, setTestExteriorFanlightMaterial] = require$$0.useState("metal");
1570
+ const [testOcculusInfillMaterial, setTestOcculusInfillMaterial] = require$$0.useState("glass");
1571
+ const [testGlassInfillMaterial, setTestGlassInfillMaterial] = require$$0.useState("glass");
1572
+ const [testDoorStopMaterial, setTestDoorStopMaterial] = require$$0.useState("black");
1573
+ const [testHingeMaterial, setTestHingeMaterial] = require$$0.useState("metal");
1574
+ const [testFrontCoverPanelMaterial, setTestFrontCoverPanelMaterial] = require$$0.useState("aluminum");
1575
+ const [testBackCoverPanelMaterial, setTestBackCoverPanelMaterial] = require$$0.useState("aluminum");
1576
+
1577
+ //
1578
+ const [parseMessage, setParseMessage] = require$$0.useState({
1579
+ type: "",
1580
+ text: ""
1581
+ });
1582
+ const handleParseCpid = require$$0.useCallback(cpidToParse => {
1583
+ const showMessage = function (text) {
1584
+ let type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "error";
1585
+ setParseMessage({
1586
+ text,
1587
+ type
1588
+ });
1589
+ setTimeout(() => setParseMessage({
1590
+ text: "",
1591
+ type: ""
1592
+ }), 4000);
1593
+ };
1594
+ if (!cpidToParse || !cpidToParse.trim().startsWith("P_")) {
1595
+ showMessage("Invalid format: CPID must start with 'P_'.");
1596
+ return;
1597
+ }
1598
+ const parts = cpidToParse.trim().split("_");
1599
+ if (parts.length < 4) {
1600
+ showMessage("Invalid format: Not enough parts in CPID.");
1601
+ return;
1602
+ }
1603
+ const newConfig = {
1604
+ fanlightVisible: false,
1605
+ fanlightType: "WPFL",
1606
+ interiorFanlightVisible: false,
1607
+ occulusVisible: false,
1608
+ frameType: "",
1609
+ bodyType: ""
1610
+ };
1611
+ let currentIndex = 1;
1612
+
1613
+ // Door Type
1614
+ if (parts[currentIndex] === "SD") {
1615
+ currentIndex++;
1616
+ } else {
1617
+ showMessage("Unsupported Door Type: Only 'SD' is supported.");
1618
+ return;
1619
+ }
1620
+
1621
+ //Fanlight Type
1622
+ const fanlightPart = parts[currentIndex];
1623
+ const validFanlights = ["WPFL", "ALDGFL", "ALSGFL"];
1624
+ if (fanlightPart === "FH") {
1625
+ newConfig.fanlightVisible = false;
1626
+ currentIndex++;
1627
+ } else if (validFanlights.includes(fanlightPart)) {
1628
+ newConfig.fanlightVisible = true;
1629
+ newConfig.fanlightType = fanlightPart;
1630
+ currentIndex++;
1631
+ } else {
1632
+ showMessage("Invalid Fanlight Type: '".concat(fanlightPart, "'."));
1633
+ return;
1634
+ }
1635
+
1636
+ // Frame and Body Type
1637
+ const validSimpleFrameTypes = ["AF20", "AF40", "WF", "MXF", "MXCAF", "NOF"];
1638
+ const validBodyTypes = ["40", "50", "FLI", "100", "WDG100", "SG8", "SG10", "SG12"];
1639
+ let framePart = parts[currentIndex];
1640
+ let bodyPartRaw = parts[currentIndex + 1] || "";
1641
+ let frameFound = false;
1642
+ if ("".concat(framePart, "_").concat(bodyPartRaw) === "WDGF_WDG100") {
1643
+ newConfig.frameType = "WDGF_WDG100";
1644
+ newConfig.bodyType = "WDG100";
1645
+ currentIndex += 2;
1646
+ frameFound = true;
1647
+ } else if (validSimpleFrameTypes.includes(framePart)) {
1648
+ let tempBody = bodyPartRaw.replace("OCC", "");
1649
+ if (validBodyTypes.includes(tempBody)) {
1650
+ newConfig.frameType = framePart === "NOF" ? "NOF" : "".concat(framePart, "_").concat(tempBody);
1651
+ newConfig.bodyType = tempBody;
1652
+ if (bodyPartRaw.endsWith("OCC")) {
1653
+ newConfig.occulusVisible = true;
1654
+ }
1655
+ currentIndex += 2;
1656
+ frameFound = true;
1657
+ }
1658
+ }
1659
+ if (!frameFound) {
1660
+ showMessage("Invalid Frame/Body combination starting with '".concat(framePart, "'."));
1661
+ return;
1662
+ }
1663
+ for (let i = currentIndex; i < parts.length; i++) {
1664
+ if (parts[i] === "IFL") {
1665
+ newConfig.interiorFanlightVisible = true;
1666
+ } else if (parts[i] === "OCC") {
1667
+ newConfig.occulusVisible = true;
1668
+ }
1669
+ }
1670
+
1671
+ // Apply final configuration
1672
+ setFrameType(newConfig.frameType);
1673
+ setBodyType(newConfig.bodyType);
1674
+ setExteriorFanlight(prev => _objectSpread2(_objectSpread2({}, prev), {}, {
1675
+ visible: newConfig.fanlightVisible
1676
+ }));
1677
+ if (newConfig.fanlightVisible) {
1678
+ setExteriorFanlightType(newConfig.fanlightType);
1679
+ }
1680
+ setInteriorFanlight(prev => _objectSpread2(_objectSpread2({}, prev), {}, {
1681
+ visible: newConfig.interiorFanlightVisible
1682
+ }));
1683
+ setOcculus(prev => _objectSpread2(_objectSpread2({}, prev), {}, {
1684
+ visible: newConfig.occulusVisible
1685
+ }));
1686
+ showMessage("Configuration Applied!", "success");
1687
+ }, [setBodyType, setExteriorFanlight, setExteriorFanlightType, setFrameType, setInteriorFanlight, setOcculus]);
1688
+
1689
+ // --- BodyType Effect ---
1690
+ require$$0.useEffect(() => {
1691
+ let newDoorDepth = 40;
1692
+ let newMaterial = "brown";
1693
+ switch (bodyType) {
1694
+ case "50":
1695
+ newDoorDepth = 50;
1696
+ break;
1697
+ case "SG8":
1698
+ newDoorDepth = 8;
1699
+ newMaterial = "glass";
1700
+ break;
1701
+ case "SG10":
1702
+ newDoorDepth = 10;
1703
+ newMaterial = "glass";
1704
+ break;
1705
+ case "SG12":
1706
+ newDoorDepth = 12;
1707
+ newMaterial = "glass";
1708
+ break;
1709
+ }
1710
+ setDoor(prev => _objectSpread2(_objectSpread2({}, prev), {}, {
1711
+ theDoorDepth: newDoorDepth
1712
+ }));
1713
+ setTestDoorMaterial(newMaterial);
1714
+ }, [bodyType]);
1715
+
1716
+ // --- FrameType Effect ---
1717
+ require$$0.useEffect(() => {
1718
+ setIsFrameVisible(frameType !== "NOF");
1719
+ setGlassVisible(false);
1720
+ let newSettings = {};
1721
+ let lookupKey = frameType;
1722
+ if (frameType.startsWith("AF20_SG")) {
1723
+ lookupKey = "AF20_40";
1724
+ } else if (frameType.startsWith("AF40_SG")) {
1725
+ lookupKey = "AF40_40";
1726
+ }
1727
+ switch (lookupKey) {
1728
+ case "NOF":
1729
+ newSettings = {
1730
+ topThk: "0mm",
1731
+ sidesThk: "0mm",
1732
+ frameDepth: 0
1733
+ };
1734
+ break;
1735
+ case "AF20_40":
1736
+ newSettings = {
1737
+ frameDepth: 103,
1738
+ topThk: "20mm",
1739
+ sidesThk: "20mm",
1740
+ doorStopOffset: "42mm",
1741
+ doorStopWidth: 20,
1742
+ doorStopDepth: 13,
1743
+ notchWidth: "20mm",
1744
+ notchDepth: "40mm",
1745
+ notchposition: 0.01,
1746
+ gasketDepth: 5,
1747
+ gasketWidth: 5
1748
+ };
1749
+ if (frameType === "AF20_40") {
1750
+ newSettings.doorDepth = 40;
1751
+ }
1752
+ break;
1753
+ case "AF20_50":
1754
+ newSettings = {
1755
+ doorDepth: 50,
1756
+ frameDepth: 103,
1757
+ topThk: "20mm",
1758
+ sidesThk: "20mm",
1759
+ doorStopOffset: "30mm",
1760
+ doorStopWidth: 20,
1761
+ doorStopDepth: 13,
1762
+ notchWidth: "20mm",
1763
+ notchDepth: "40mm",
1764
+ notchposition: 0.01,
1765
+ gasketDepth: 5,
1766
+ gasketWidth: 5
1767
+ };
1768
+ break;
1769
+ case "AF40_40":
1770
+ newSettings = {
1771
+ frameDepth: 103,
1772
+ topThk: "40mm",
1773
+ sidesThk: "40mm",
1774
+ doorStopOffset: "42mm",
1775
+ doorStopWidth: 20,
1776
+ doorStopDepth: 13,
1777
+ notchWidth: "20mm",
1778
+ notchDepth: "40mm",
1779
+ notchposition: 0.01,
1780
+ gasketDepth: 5,
1781
+ gasketWidth: 5
1782
+ };
1783
+ if (frameType === "AF40_40") {
1784
+ newSettings.doorDepth = 40;
1785
+ }
1786
+ break;
1787
+ case "AF40_50":
1788
+ newSettings = {
1789
+ doorDepth: 50,
1790
+ frameDepth: 103,
1791
+ topThk: "40mm",
1792
+ sidesThk: "40mm",
1793
+ doorStopOffset: "30mm",
1794
+ doorStopWidth: 20,
1795
+ doorStopDepth: 13,
1796
+ notchWidth: "20mm",
1797
+ notchDepth: "40mm",
1798
+ notchposition: 0.01,
1799
+ gasketDepth: 5,
1800
+ gasketWidth: 5
1801
+ };
1802
+ break;
1803
+ case "WF_40":
1804
+ newSettings = {
1805
+ doorDepth: 39.6,
1806
+ frameDepth: 103,
1807
+ topThk: "31.6mm",
1808
+ sidesThk: "31.6mm",
1809
+ doorStopOffset: "0mm",
1810
+ doorStopWidth: 16.4,
1811
+ doorStopDepth: 58.4,
1812
+ notchWidth: "20mm",
1813
+ notchDepth: "40mm",
1814
+ notchposition: 0.01,
1815
+ gasketDepth: 5,
1816
+ gasketWidth: 5
1817
+ };
1818
+ break;
1819
+ case "WF_50":
1820
+ newSettings = {
1821
+ doorDepth: 51.6,
1822
+ frameDepth: 103,
1823
+ topThk: "31.6mm",
1824
+ sidesThk: "31.6mm",
1825
+ doorStopOffset: "0mm",
1826
+ doorStopWidth: 16,
1827
+ doorStopDepth: 46.4,
1828
+ notchWidth: "20mm",
1829
+ notchDepth: "40mm",
1830
+ notchposition: 0.01,
1831
+ gasketDepth: 5,
1832
+ gasketWidth: 5
1833
+ };
1834
+ break;
1835
+ case "WF_100":
1836
+ newSettings = {
1837
+ doorDepth: 102,
1838
+ frameDepth: 102,
1839
+ topThk: "52mm",
1840
+ sidesThk: "52mm",
1841
+ doorStopOffset: "17.6mm",
1842
+ doorStopWidth: 16.4,
1843
+ doorStopDepth: 44.8,
1844
+ notchWidth: "16mm",
1845
+ notchDepth: "66.5mm",
1846
+ notchposition: 0.02,
1847
+ gasketDepth: 5,
1848
+ gasketWidth: 5,
1849
+ secondDoorStopWidth: 29,
1850
+ secondDoorStopDepth: 17.6,
1851
+ secondDoorStopOffset: 0
1852
+ };
1853
+ break;
1854
+ case "WF_FLI":
1855
+ newSettings = {
1856
+ doorDepth: 51,
1857
+ frameDepth: 102,
1858
+ topThk: "52mm",
1859
+ sidesThk: "52mm",
1860
+ doorStopOffset: "17.4mm",
1861
+ doorStopWidth: 16.4,
1862
+ doorStopDepth: 34,
1863
+ notchWidth: "14mm",
1864
+ notchDepth: "66mm",
1865
+ notchposition: 0.02,
1866
+ gasketDepth: 5,
1867
+ gasketWidth: 5,
1868
+ secondDoorStopWidth: 29,
1869
+ secondDoorStopDepth: 17.6,
1870
+ secondDoorStopOffset: 0
1871
+ };
1872
+ break;
1873
+ case "WDGF_WDG100":
1874
+ newSettings = {
1875
+ doorDepth: 86,
1876
+ frameDepth: 86,
1877
+ topThk: "50mm",
1878
+ sidesThk: "50mm",
1879
+ doorStopOffset: "34mm",
1880
+ doorStopWidth: 13,
1881
+ doorStopDepth: 30,
1882
+ notchWidth: "14mm",
1883
+ notchDepth: "66mm",
1884
+ notchposition: 0.02,
1885
+ gasketDepth: 4.5,
1886
+ gasketWidth: 5,
1887
+ secondDoorStopWidth: 23,
1888
+ secondDoorStopDepth: 30,
1889
+ secondDoorStopOffset: 13
1890
+ };
1891
+ setGlassVisible(true);
1892
+ break;
1893
+ case "MXF_40":
1894
+ newSettings = {
1895
+ doorDepth: 38,
1896
+ frameDepth: 103,
1897
+ topThk: "18mm",
1898
+ sidesThk: "18mm",
1899
+ doorStopOffset: "45mm",
1900
+ doorStopWidth: 15,
1901
+ doorStopDepth: 15,
1902
+ notchWidth: "20mm",
1903
+ notchDepth: "40mm",
1904
+ notchposition: 0.01,
1905
+ gasketDepth: 5,
1906
+ gasketWidth: 5
1907
+ };
1908
+ break;
1909
+ case "MXF_50":
1910
+ newSettings = {
1911
+ doorDepth: 50,
1912
+ frameDepth: 103,
1913
+ topThk: "18.2mm",
1914
+ sidesThk: "18.2mm",
1915
+ doorStopOffset: "33mm",
1916
+ doorStopWidth: 15,
1917
+ doorStopDepth: 15,
1918
+ notchWidth: "20mm",
1919
+ notchDepth: "40mm",
1920
+ notchposition: 0.01,
1921
+ gasketDepth: 5,
1922
+ gasketWidth: 5
1923
+ };
1924
+ break;
1925
+ case "MXCAF_40":
1926
+ newSettings = {
1927
+ doorDepth: 38,
1928
+ frameDepth: 103,
1929
+ topThk: "18mm",
1930
+ sidesThk: "18mm",
1931
+ doorStopOffset: "45mm",
1932
+ doorStopWidth: 15,
1933
+ doorStopDepth: 15,
1934
+ notchWidth: "20mm",
1935
+ notchDepth: "40mm",
1936
+ notchposition: 0.01,
1937
+ gasketDepth: 5,
1938
+ gasketWidth: 5
1939
+ };
1940
+ break;
1941
+ case "MXCAF_50":
1942
+ newSettings = {
1943
+ doorDepth: 50,
1944
+ frameDepth: 103,
1945
+ topThk: "18.2mm",
1946
+ sidesThk: "18.2mm",
1947
+ doorStopOffset: "33mm",
1948
+ doorStopWidth: 15,
1949
+ doorStopDepth: 15,
1950
+ notchWidth: "20mm",
1951
+ notchDepth: "40mm",
1952
+ notchposition: 0.01,
1953
+ gasketDepth: 5,
1954
+ gasketWidth: 5
1955
+ };
1956
+ break;
1957
+ }
1958
+ const isMxCaf = frameType.startsWith("MXCAF");
1959
+ setFrontCoverPanel(prev => _objectSpread2(_objectSpread2({}, prev), {}, {
1960
+ visible: isMxCaf
1961
+ }));
1962
+ setBackCoverPanel(prev => _objectSpread2(_objectSpread2({}, prev), {}, {
1963
+ visible: isMxCaf
1964
+ }));
1965
+ const {
1966
+ doorDepth
1967
+ } = newSettings,
1968
+ newFrameSettings = _objectWithoutProperties(newSettings, _excluded$1);
1969
+ setDoorFrame(prev => _objectSpread2(_objectSpread2({}, prev), newFrameSettings));
1970
+ if (doorDepth !== undefined) {
1971
+ setDoor(prev => _objectSpread2(_objectSpread2({}, prev), {}, {
1972
+ theDoorDepth: doorDepth
1973
+ }));
1974
+ }
1975
+ }, [frameType]);
1976
+
1977
+ // --- Exterior Fanlight Logic ---
1978
+ require$$0.useEffect(() => {
1979
+ if (!exteriorFanlight.visible) return;
1980
+ switch (exteriorFanlightType) {
1981
+ case "WPFL":
1982
+ setExteriorFanlight(prev => _objectSpread2(_objectSpread2({}, prev), {}, {
1983
+ depth: doorFrame.frameDepth
1984
+ }));
1985
+ setTestExteriorFanlightMaterial("metal");
1986
+ break;
1987
+ case "ALDGL":
1988
+ setExteriorFanlight(prev => _objectSpread2(_objectSpread2({}, prev), {}, {
1989
+ depth: doorFrame.frameDepth
1990
+ }));
1991
+ setTestExteriorFanlightMaterial("glass");
1992
+ break;
1993
+ case "ALSGL":
1994
+ setExteriorFanlight(prev => _objectSpread2(_objectSpread2({}, prev), {}, {
1995
+ depth: 40
1996
+ }));
1997
+ setTestExteriorFanlightMaterial("glass");
1998
+ break;
1999
+ }
2000
+ }, [exteriorFanlight.visible, exteriorFanlightType, doorFrame.frameDepth, setTestExteriorFanlightMaterial, setExteriorFanlight]);
2001
+ require$$0.useEffect(() => {
2002
+ const topThkValue = parseInt(doorFrame.topThk) || 0;
2003
+ const exteriorFanlightHeight = exteriorFanlight.visible ? exteriorFanlight.height : 0;
2004
+ const newDoorHeight = totalHeight - topThkValue - exteriorFanlightHeight;
2005
+ setDoor(prevDoor => _objectSpread2(_objectSpread2({}, prevDoor), {}, {
2006
+ doorHeight: newDoorHeight > 0 ? newDoorHeight : 0
2007
+ }));
2008
+ }, [totalHeight, doorFrame.topThk, exteriorFanlight.visible, exteriorFanlight.height]);
2009
+ require$$0.useEffect(() => {
2010
+ const sidesThkValue = parseInt(doorFrame.sidesThk) || 0;
2011
+ const newDoorWidth = totalWidth - sidesThkValue * 2;
2012
+ setDoor(prevDoor => _objectSpread2(_objectSpread2({}, prevDoor), {}, {
2013
+ doorWidth: newDoorWidth > 0 ? newDoorWidth : 0
2014
+ }));
2015
+ }, [totalWidth, doorFrame.sidesThk]);
2016
+ return /*#__PURE__*/jsxRuntimeExports.jsx(ConfiguratorContext.Provider, {
2017
+ value: {
2018
+ isPlaneVisible,
2019
+ setIsPlaneVisible,
2020
+ isFrameVisible,
2021
+ setIsFrameVisible,
2022
+ cpid,
2023
+ setCpid,
2024
+ door,
2025
+ setDoor,
2026
+ doorFrame,
2027
+ setDoorFrame,
2028
+ interiorFanlight,
2029
+ setInteriorFanlight,
2030
+ exteriorFanlight,
2031
+ setExteriorFanlight,
2032
+ occulus,
2033
+ setOcculus,
2034
+ frontCoverPanel,
2035
+ setFrontCoverPanel,
2036
+ backCoverPanel,
2037
+ setBackCoverPanel,
2038
+ glass,
2039
+ setGlass,
2040
+ frameType,
2041
+ setFrameType,
2042
+ bodyType,
2043
+ setBodyType,
2044
+ totalHeight,
2045
+ setTotalHeight,
2046
+ totalWidth,
2047
+ setTotalWidth,
2048
+ exteriorFanlightType,
2049
+ setExteriorFanlightType,
2050
+ testDoorMaterial,
2051
+ setTestDoorMaterial,
2052
+ testFrameMaterial,
2053
+ setTestFrameMaterial,
2054
+ testGasketMaterial,
2055
+ setTestGasketMaterial,
2056
+ testInteriorFanlightMaterial,
2057
+ setTestInteriorFanlightMaterial,
2058
+ testExteriorFanlightMaterial,
2059
+ setTestExteriorFanlightMaterial,
2060
+ testOcculusInfillMaterial,
2061
+ setTestOcculusInfillMaterial,
2062
+ testGlassInfillMaterial,
2063
+ setTestGlassInfillMaterial,
2064
+ testDoorStopMaterial,
2065
+ setTestDoorStopMaterial,
2066
+ testHingeMaterial,
2067
+ setTestHingeMaterial,
2068
+ testFrontCoverPanelMaterial,
2069
+ setTestFrontCoverPanelMaterial,
2070
+ testBackCoverPanelMaterial,
2071
+ setTestBackCoverPanelMaterial,
2072
+ glassVisible,
2073
+ setGlassVisible,
2074
+ glassDepth,
2075
+ setGlassDepth,
2076
+ handleParseCpid
2077
+ },
2078
+ children: children
2079
+ });
2080
+ };
2081
+ const useConfigurator = () => {
2082
+ const context = require$$0.useContext(ConfiguratorContext);
2083
+ if (!context) {
2084
+ throw new Error("useConfigurator must be used within a ConfiguratorProvider");
2085
+ }
2086
+ return context;
2087
+ };
2088
+
2089
+ const placeholderMaterial = new THREE__namespace.MeshStandardMaterial({
2090
+ color: "#cccccc",
2091
+ roughness: 0.8
2092
+ });
2093
+ const placeholderMaterialforFrames = new THREE__namespace.MeshStandardMaterial({
2094
+ color: "#000",
2095
+ roughness: 0.8
2096
+ });
2097
+ const availableMaterials = {
2098
+ black: new THREE__namespace.MeshStandardMaterial({
2099
+ color: "#000000"
2100
+ }),
2101
+ metal: new THREE__namespace.MeshStandardMaterial({
2102
+ color: "#0xaaaaaa",
2103
+ metalness: 1.0,
2104
+ roughness: 0.4
2105
+ }),
2106
+ darkgrey: new THREE__namespace.MeshStandardMaterial({
2107
+ color: "#5e5e5e"
2108
+ }),
2109
+ grey: new THREE__namespace.MeshStandardMaterial({
2110
+ color: "#cccccc"
2111
+ }),
2112
+ yellow: new THREE__namespace.MeshStandardMaterial({
2113
+ color: "#ffff00"
2114
+ }),
2115
+ darkBrown: new THREE__namespace.MeshStandardMaterial({
2116
+ color: "#a0522d"
2117
+ }),
2118
+ brown: new THREE__namespace.MeshStandardMaterial({
2119
+ color: "#d2b48c"
2120
+ }),
2121
+ glass: new THREE__namespace.MeshStandardMaterial({
2122
+ color: "#ffffff",
2123
+ roughness: 0.1,
2124
+ transparent: true,
2125
+ opacity: 0.7
2126
+ }),
2127
+ aluminum: new THREE__namespace.MeshStandardMaterial({
2128
+ color: "#dcdcdc",
2129
+ metalness: 1.0,
2130
+ roughness: 0.3
2131
+ }),
2132
+ silver: new THREE__namespace.MeshStandardMaterial({
2133
+ color: "#c0c0c0",
2134
+ metalness: 1.0,
2135
+ roughness: 0.2
2136
+ }),
2137
+ gold: new THREE__namespace.MeshStandardMaterial({
2138
+ color: "#ffd700",
2139
+ metalness: 1.0,
2140
+ roughness: 0.3
2141
+ }),
2142
+ diamond: new THREE__namespace.MeshStandardMaterial({
2143
+ color: "#e0f7fa",
2144
+ metalness: 0.9,
2145
+ roughness: 0.05,
2146
+ transparent: true,
2147
+ opacity: 0.9,
2148
+ envMapIntensity: 1.5
2149
+ })
2150
+ };
2151
+ function GlassHinge(_ref) {
2152
+ let {
2153
+ position,
2154
+ pivot,
2155
+ frameSideWidth,
2156
+ doorDepthM,
2157
+ material,
2158
+ gasketMaterial
2159
+ } = _ref;
2160
+ const plateWidth = 130 / 1000;
2161
+ const plateHeight = 55 / 1000;
2162
+ const plateThickness = 8 / 1000;
2163
+ const gasketThickness = 1 / 1000;
2164
+ const pivotRadius = 10 / 1000;
2165
+ const pivotHeight = plateHeight;
2166
+ const sideMultiplier = pivot === "left" ? 1 : -1;
2167
+ const plateOffsetX = sideMultiplier * (plateWidth / 2 + frameSideWidth);
2168
+ const holeRadius = 10 / 1000;
2169
+ const holeSpacingX = 45 / 1000;
2170
+ return /*#__PURE__*/jsxRuntimeExports.jsxs("group", {
2171
+ position: position,
2172
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx("mesh", {
2173
+ material: material,
2174
+ castShadow: true,
2175
+ receiveShadow: true,
2176
+ "position-x": 0.01,
2177
+ children: /*#__PURE__*/jsxRuntimeExports.jsx("cylinderGeometry", {
2178
+ args: [pivotRadius, pivotRadius, pivotHeight, 32]
2179
+ })
2180
+ }), /*#__PURE__*/jsxRuntimeExports.jsxs("group", {
2181
+ "position-x": plateOffsetX,
2182
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx("mesh", {
2183
+ "position-z": -(doorDepthM / 2) - plateThickness / 2 - gasketThickness,
2184
+ material: material,
2185
+ castShadow: true,
2186
+ receiveShadow: true,
2187
+ children: /*#__PURE__*/jsxRuntimeExports.jsx("boxGeometry", {
2188
+ args: [plateWidth, plateHeight, plateThickness]
2189
+ })
2190
+ }), /*#__PURE__*/jsxRuntimeExports.jsx("mesh", {
2191
+ "position-z": -(doorDepthM / 2) - gasketThickness / 2,
2192
+ material: gasketMaterial,
2193
+ castShadow: true,
2194
+ receiveShadow: true,
2195
+ children: /*#__PURE__*/jsxRuntimeExports.jsx("boxGeometry", {
2196
+ args: [plateWidth, plateHeight, gasketThickness]
2197
+ })
2198
+ }), /*#__PURE__*/jsxRuntimeExports.jsx("mesh", {
2199
+ "position-z": doorDepthM / 2 + plateThickness / 2 + gasketThickness,
2200
+ castShadow: true,
2201
+ receiveShadow: true,
2202
+ children: /*#__PURE__*/jsxRuntimeExports.jsxs(csg.Geometry, {
2203
+ useGroups: true,
2204
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx(csg.Base, {
2205
+ material: material,
2206
+ children: /*#__PURE__*/jsxRuntimeExports.jsx("boxGeometry", {
2207
+ args: [plateWidth, plateHeight, plateThickness]
2208
+ })
2209
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(csg.Subtraction, {
2210
+ position: [-sideMultiplier * (holeSpacingX / 2), 0, 0],
2211
+ rotation: [Math.PI / 2, 0, 0],
2212
+ children: /*#__PURE__*/jsxRuntimeExports.jsx("cylinderGeometry", {
2213
+ args: [holeRadius, holeRadius, plateThickness + 0.01, 32]
2214
+ })
2215
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(csg.Subtraction, {
2216
+ position: [sideMultiplier * (holeSpacingX / 2), 0, 0],
2217
+ rotation: [Math.PI / 2, 0, 0],
2218
+ children: /*#__PURE__*/jsxRuntimeExports.jsx("cylinderGeometry", {
2219
+ args: [holeRadius, holeRadius, plateThickness + 0.01, 32]
2220
+ })
2221
+ })]
2222
+ })
2223
+ }), /*#__PURE__*/jsxRuntimeExports.jsx("mesh", {
2224
+ "position-z": doorDepthM / 2 + gasketThickness / 2,
2225
+ material: gasketMaterial,
2226
+ castShadow: true,
2227
+ receiveShadow: true,
2228
+ children: /*#__PURE__*/jsxRuntimeExports.jsx("boxGeometry", {
2229
+ args: [plateWidth, plateHeight, gasketThickness]
2230
+ })
2231
+ })]
2232
+ })]
2233
+ });
2234
+ }
2235
+ function DoorStopCuts(_ref2) {
2236
+ let {
2237
+ visible,
2238
+ width,
2239
+ height,
2240
+ stopWidth,
2241
+ stopDepth,
2242
+ stopPositionZ,
2243
+ centerZ,
2244
+ glassDepthOffset = 0,
2245
+ material,
2246
+ setName
2247
+ } = _ref2;
2248
+ if (!visible) return null;
2249
+ return /*#__PURE__*/jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
2250
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx(csg.Subtraction, {
2251
+ name: "cut-top-".concat(setName),
2252
+ material: material,
2253
+ position: [0, height / 2 - stopWidth / 2 + 0.0001, stopPositionZ - centerZ],
2254
+ children: /*#__PURE__*/jsxRuntimeExports.jsx("boxGeometry", {
2255
+ args: [width + 0.01, stopWidth, stopDepth + 0.01]
2256
+ })
2257
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(csg.Subtraction, {
2258
+ name: "cut-left-".concat(setName),
2259
+ material: material,
2260
+ position: [-width / 2 + stopWidth / 2 - 0.0001, 0, stopPositionZ - centerZ],
2261
+ children: /*#__PURE__*/jsxRuntimeExports.jsx("boxGeometry", {
2262
+ args: [stopWidth, height + 0.01, stopDepth + 0.01]
2263
+ })
2264
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(csg.Subtraction, {
2265
+ name: "cut-right-".concat(setName),
2266
+ material: material,
2267
+ position: [width / 2 - stopWidth / 2 + 0.0001, 0, stopPositionZ - centerZ],
2268
+ children: /*#__PURE__*/jsxRuntimeExports.jsx("boxGeometry", {
2269
+ args: [stopWidth, height + 0.01, stopDepth + 0.01]
2270
+ })
2271
+ })]
2272
+ });
2273
+ }
2274
+ function DoorModels(_ref3) {
2275
+ let {
2276
+ doorName
2277
+ } = _ref3;
2278
+ const {
2279
+ isPlaneVisible,
2280
+ isFrameVisible,
2281
+ door,
2282
+ doorFrame,
2283
+ interiorFanlight,
2284
+ exteriorFanlight,
2285
+ occulus,
2286
+ glass,
2287
+ frontCoverPanel,
2288
+ backCoverPanel,
2289
+ frameType,
2290
+ bodyType,
2291
+ exteriorFanlightType,
2292
+ testDoorMaterial,
2293
+ testFrameMaterial,
2294
+ testGasketMaterial,
2295
+ testInteriorFanlightMaterial,
2296
+ testExteriorFanlightMaterial,
2297
+ testOcculusInfillMaterial,
2298
+ testGlassInfillMaterial,
2299
+ testDoorStopMaterial,
2300
+ testHingeMaterial,
2301
+ glassVisible,
2302
+ testFrontCoverPanelMaterial,
2303
+ testBackCoverPanelMaterial,
2304
+ glassDepth,
2305
+ handleParseCpid
2306
+ } = useConfigurator();
2307
+ require$$0.useEffect(() => {
2308
+ if (doorName) {
2309
+ handleParseCpid(doorName);
2310
+ }
2311
+ }, [doorName, handleParseCpid]);
2312
+
2313
+ // here i get material names from context
2314
+ const {
2315
+ doorMaterial: doorMaterialName
2316
+ } = door;
2317
+ const {
2318
+ frameMaterial: frameMaterialName,
2319
+ gasketMaterial: gasketMaterialName,
2320
+ doorStopMaterial: doorStopMaterialName,
2321
+ hingeMaterial: hingeMaterialName
2322
+ } = doorFrame;
2323
+ const {
2324
+ material: interiorFanlightMaterialName
2325
+ } = interiorFanlight;
2326
+ const {
2327
+ material: exteriorFanlightMaterialName
2328
+ } = exteriorFanlight;
2329
+ const {
2330
+ material: occulusInfillMaterialName
2331
+ } = occulus;
2332
+ const {
2333
+ material: glassInfillMaterialName
2334
+ } = glass;
2335
+ const {
2336
+ material: frontCoverPanelMaterialName
2337
+ } = frontCoverPanel;
2338
+ const {
2339
+ material: backCoverPanelMaterialName
2340
+ } = backCoverPanel;
2341
+
2342
+ // --- Material Logic ---
2343
+ const doorMaterial = require$$0.useMemo(() => availableMaterials[testDoorMaterial] || availableMaterials[doorMaterialName] || placeholderMaterial, [testDoorMaterial, doorMaterialName]);
2344
+ const frameMaterial = require$$0.useMemo(() => availableMaterials[testFrameMaterial] || availableMaterials[frameMaterialName] || placeholderMaterialforFrames, [testFrameMaterial, frameMaterialName]);
2345
+ const gasketMaterial = require$$0.useMemo(() => availableMaterials[testGasketMaterial] || availableMaterials[gasketMaterialName] || new THREE__namespace.MeshStandardMaterial({
2346
+ color: "#111111"
2347
+ }), [testGasketMaterial, gasketMaterialName]);
2348
+ const doorStopMaterial = require$$0.useMemo(() => {
2349
+ return availableMaterials[testDoorStopMaterial] || availableMaterials[doorStopMaterialName || ""] || frameMaterial;
2350
+ }, [testDoorStopMaterial, doorStopMaterialName, frameType, frameMaterial]);
2351
+ const interiorFanlightMaterial = require$$0.useMemo(() => availableMaterials[testInteriorFanlightMaterial] || availableMaterials[interiorFanlightMaterialName] || placeholderMaterial, [testInteriorFanlightMaterial, interiorFanlightMaterialName]);
2352
+ const exteriorFanlightMaterial = require$$0.useMemo(() => availableMaterials[testExteriorFanlightMaterial] || availableMaterials[exteriorFanlightMaterialName] || placeholderMaterial, [testExteriorFanlightMaterial, exteriorFanlightMaterialName]);
2353
+ const occulusInfillMaterial = require$$0.useMemo(() => availableMaterials[testOcculusInfillMaterial] || availableMaterials[occulusInfillMaterialName] || placeholderMaterial, [testOcculusInfillMaterial, occulusInfillMaterialName]);
2354
+ const glassInfillMaterial = require$$0.useMemo(() => availableMaterials[testGlassInfillMaterial] || availableMaterials[glassInfillMaterialName] || placeholderMaterial, [testGlassInfillMaterial, glassInfillMaterialName]);
2355
+ const hingeBodyMaterial = require$$0.useMemo(() => availableMaterials[testHingeMaterial] || availableMaterials[hingeMaterialName] || new THREE__namespace.MeshStandardMaterial({
2356
+ color: "#d4d4d4",
2357
+ metalness: 1.0,
2358
+ roughness: 0.4
2359
+ }), [testHingeMaterial, hingeMaterialName]);
2360
+ const frontCoverPanelMaterial = require$$0.useMemo(() => availableMaterials[testFrontCoverPanelMaterial] || availableMaterials[frontCoverPanelMaterialName] || placeholderMaterial, [testFrontCoverPanelMaterial, frontCoverPanelMaterialName]);
2361
+ const backCoverPanelMaterial = require$$0.useMemo(() => availableMaterials[testBackCoverPanelMaterial] || availableMaterials[backCoverPanelMaterialName] || placeholderMaterial, [testBackCoverPanelMaterial, backCoverPanelMaterialName]);
2362
+ const hingeAccentMaterial = require$$0.useMemo(() => new THREE__namespace.MeshStandardMaterial({
2363
+ color: "#1a1a1a",
2364
+ roughness: 0.1
2365
+ }), []);
2366
+
2367
+ // --- Dimension calculations ---
2368
+ const {
2369
+ doorWidth,
2370
+ doorHeight,
2371
+ theDoorDepth,
2372
+ doorPivot,
2373
+ doorOpening
2374
+ } = door;
2375
+ const {
2376
+ frameDepth,
2377
+ topThk,
2378
+ sidesThk,
2379
+ doorStopWidth,
2380
+ doorStopDepth,
2381
+ doorStopOffset,
2382
+ notchWidth,
2383
+ notchDepth,
2384
+ notchposition,
2385
+ gasketWidth,
2386
+ gasketDepth,
2387
+ secondDoorStopWidth,
2388
+ secondDoorStopDepth,
2389
+ secondDoorStopOffset
2390
+ } = doorFrame;
2391
+ const {
2392
+ height: interiorFanlightHeightValue
2393
+ } = interiorFanlight;
2394
+ const {
2395
+ height: exteriorFanlightHeightValue,
2396
+ depth: exteriorFanlightDepthValue
2397
+ } = exteriorFanlight;
2398
+ const {
2399
+ x1: occulusX1,
2400
+ x2: occulusX2,
2401
+ y1: occulusY1,
2402
+ y2: occulusY2,
2403
+ depth: occulusInfillDepth
2404
+ } = occulus;
2405
+ const {
2406
+ width: architraveWidth,
2407
+ depth: architraveDepth
2408
+ } = frontCoverPanel;
2409
+ const interiorFanlightHeight = interiorFanlight.visible ? interiorFanlightHeightValue : 0;
2410
+ const mainDoorHeight = doorHeight - interiorFanlightHeight;
2411
+ const topThkValue = parseInt(topThk) || 20;
2412
+ const sidesThkValue = parseInt(sidesThk) || 20;
2413
+
2414
+ // Convert dimensions from mm to meters
2415
+ const doorWidthM = doorWidth / 1000;
2416
+ const mainDoorHeightM = mainDoorHeight / 1000;
2417
+ const interiorFanlightHeightM = interiorFanlightHeight / 1000;
2418
+ const totalOpeningHeightM = doorHeight / 1000;
2419
+ const doorDepthM = theDoorDepth / 1000;
2420
+ const frameDepthM = frameDepth / 1000;
2421
+ const topFrameWidthM = topThkValue / 1000;
2422
+ const sidesFrameWidthM = sidesThkValue / 1000;
2423
+ const exteriorFanlightHeightM = exteriorFanlightHeightValue / 1000;
2424
+ const exteriorFanlightDepthM = exteriorFanlightDepthValue / 1000;
2425
+ const occulusX1M = occulusX1 / 1000;
2426
+ const occulusX2M = occulusX2 / 1000;
2427
+ const occulusY1M = occulusY1 / 1000;
2428
+ const occulusY2M = occulusY2 / 1000;
2429
+ const occulusInfillDepthM = occulusInfillDepth / 1000;
2430
+ const doorStopWidthM = doorStopWidth / 1000;
2431
+ const doorStopDepthM = doorStopDepth / 1000;
2432
+
2433
+ // Architrave Dimensions
2434
+ const architraveProfileM = architraveWidth / 1000;
2435
+ const architraveDepthM = architraveDepth / 1000;
2436
+
2437
+ // Gasket Dimensions
2438
+ const gasketWidthM = gasketWidth / 1000;
2439
+ const gasketDepthM = gasketDepth / 1000;
2440
+ const doorStopOffsetValue = parseInt(doorStopOffset);
2441
+ const doorStopOffsetFromEdgeM = doorStopOffsetValue / 1000;
2442
+ const notchDepthValue = parseInt(notchDepth) || 40;
2443
+ const notchWidthValue = parseInt(notchWidth) || 20;
2444
+ const notchWidthM = notchWidthValue / 1000;
2445
+ const notchDepthM = notchDepthValue / 1000;
2446
+ const isOpeningIn = doorOpening === "in";
2447
+ const doorStopPositionZ = require$$0.useMemo(() => isOpeningIn ? frameDepthM / 2 - doorStopOffsetFromEdgeM - doorStopDepthM / 2 : -frameDepthM / 2 + doorStopOffsetFromEdgeM + doorStopDepthM / 2, [isOpeningIn, frameDepthM, doorStopOffsetFromEdgeM, doorStopDepthM]);
2448
+ const gasketZPosition = require$$0.useMemo(() => isOpeningIn ? doorStopPositionZ - doorStopDepthM / 2 - gasketDepthM / 2 : doorStopPositionZ + doorStopDepthM / 2 + gasketDepthM / 2, [isOpeningIn, doorStopPositionZ, doorStopDepthM, gasketDepthM]);
2449
+ const secondDoorStopWidthM = secondDoorStopWidth / 1000;
2450
+ const secondDoorStopDepthM = secondDoorStopDepth / 1000;
2451
+ const secondDoorStopPositionZ = isOpeningIn ? frameDepthM / 2 - secondDoorStopDepthM / 2 : -frameDepthM / 2 + secondDoorStopDepthM / 2;
2452
+
2453
+ // Position the first glass panel against the primary doorstop
2454
+
2455
+ const secondGasketZPosition = isOpeningIn ? secondDoorStopPositionZ - secondDoorStopDepthM / 2 - gasketDepthM / 2 : secondDoorStopPositionZ + secondDoorStopDepthM / 2 + gasketDepthM / 2;
2456
+ const doorCenterZ = require$$0.useMemo(() => {
2457
+ if (frameType === "WF_FLI") {
2458
+ if (isOpeningIn) {
2459
+ return frameDepthM / 2 - doorDepthM / 2;
2460
+ } else {
2461
+ return -frameDepthM / 2 + doorDepthM / 2;
2462
+ }
2463
+ }
2464
+ if (frameType === "WDGF_WDG100" || frameType === "WF_100") {
2465
+ return 0;
2466
+ } else {
2467
+ if (isOpeningIn) {
2468
+ const gasketBackFaceZ = gasketZPosition - gasketDepthM / 2;
2469
+ return gasketBackFaceZ - doorDepthM / 2;
2470
+ } else {
2471
+ const gasketFrontFaceZ = gasketZPosition + gasketDepthM / 2;
2472
+ return gasketFrontFaceZ + doorDepthM / 2;
2473
+ }
2474
+ }
2475
+ }, [isOpeningIn, gasketZPosition, gasketDepthM, doorDepthM, frameType, frameDepthM]);
2476
+ const GlassPanelDepthM = glassDepth / 1000;
2477
+ const frontGlassOffsetZ = doorDepthM / 2 + GlassPanelDepthM / 2;
2478
+ const backGlassOffsetZ = -doorDepthM / 2 - GlassPanelDepthM / 2;
2479
+ const exteriorFanlightZPosition = exteriorFanlightType === "ALSGFL" ? 0 // Center it
2480
+ : isOpeningIn ? -frameDepthM / 2 + exteriorFanlightDepthM / 2 : frameDepthM / 2 - exteriorFanlightDepthM / 2;
2481
+ const occulusWidthM = doorWidthM - occulusX1M - occulusX2M;
2482
+ const occulusHeightM = mainDoorHeightM - occulusY1M - occulusY2M;
2483
+ const occulusPositionXM = (occulusX1M - occulusX2M) / 2;
2484
+ const occulusPositionYM = (occulusY2M - occulusY1M) / 2;
2485
+ const [isOpen, setIsOpen] = require$$0.useState(false);
2486
+ const hingeSideX = doorPivot === "left" ? -doorWidthM / 2 : doorWidthM / 2;
2487
+ const leftGlass_Z = -frameDepthM / 2 + GlassPanelDepthM / 2 - GlassPanelDepthM;
2488
+ const rightGlass_Z = frameDepthM / 2 - GlassPanelDepthM / 2 + GlassPanelDepthM;
2489
+ // --- PIVOT ---
2490
+ const hingeZ = require$$0.useMemo(() => {
2491
+ if (frameType === "WF_FLI") {
2492
+ if (isOpeningIn) {
2493
+ return doorCenterZ - doorDepthM / 2;
2494
+ } else {
2495
+ return doorCenterZ + doorDepthM / 2;
2496
+ }
2497
+ }
2498
+ return isOpeningIn ? -frameDepthM / 2 : frameDepthM / 2;
2499
+ }, [frameType, isOpeningIn, doorCenterZ, doorDepthM, frameDepthM]);
2500
+ const doorOffsetZ = require$$0.useMemo(() => doorCenterZ - hingeZ, [doorCenterZ, hingeZ]);
2501
+ const directionMultiplier = doorOpening === "in" ? 1 : -1;
2502
+ const {
2503
+ rotation
2504
+ } = three.useSpring({
2505
+ rotation: isOpen ? [0, (doorPivot === "left" ? Math.PI / 2 : -Math.PI / 2) * directionMultiplier, 0] : [0, 0, 0],
2506
+ config: {
2507
+ mass: 1,
2508
+ tension: 100,
2509
+ friction: 20
2510
+ }
2511
+ });
2512
+ const handleClick = () => setIsOpen(!isOpen);
2513
+ const totalFrameWidth = doorWidthM + sidesFrameWidthM * 2;
2514
+ const totalFrameHeightM = totalOpeningHeightM + topFrameWidthM;
2515
+ const sideFrameCenterY = topFrameWidthM / 2;
2516
+ const interiorFanlightYPosition = totalOpeningHeightM / 2 - interiorFanlightHeightM / 2;
2517
+ const doorYPosition = -totalOpeningHeightM / 2 + mainDoorHeightM / 2;
2518
+ const topFrameCenterY = totalOpeningHeightM / 2 + topFrameWidthM / 2;
2519
+ const topOfFrameY = topFrameCenterY + topFrameWidthM / 2;
2520
+ const exteriorFanlightYPosition = topOfFrameY + exteriorFanlightHeightM / 2;
2521
+ const frontArchitraveZ = frameDepthM / 2 + architraveDepthM / 2;
2522
+ const backArchitraveZ = -frameDepthM / 2 - architraveDepthM / 2;
2523
+ const sideArchitraveHeight = totalOpeningHeightM;
2524
+ const sideArchitraveCenterY = 0;
2525
+ const leftArchitraveX = -doorWidthM / 2 - architraveProfileM / 2;
2526
+ const rightArchitraveX = doorWidthM / 2 + architraveProfileM / 2;
2527
+ const topArchitraveY = totalOpeningHeightM / 2 + architraveProfileM / 2;
2528
+ const topArchitraveWidth = doorWidthM + 2 * architraveProfileM;
2529
+
2530
+ // --- Primary Gasket Edge Position Calculations ---
2531
+ const topGasketYPosition = totalOpeningHeightM / 2 - doorStopWidthM + gasketWidthM / 2;
2532
+ const leftGasketXPosition = -doorWidthM / 2 + doorStopWidthM - gasketWidthM / 2;
2533
+ const rightGasketXPosition = doorWidthM / 2 - doorStopWidthM + gasketWidthM / 2;
2534
+
2535
+ // --- Second Gasket ---
2536
+
2537
+ const secondTopGasketYPosition = totalOpeningHeightM / 2 - secondDoorStopWidthM + gasketWidthM / 2;
2538
+ const secondLeftGasketXPosition = -doorWidthM / 2 + secondDoorStopWidthM - gasketWidthM / 2;
2539
+ const secondRightGasketXPosition = doorWidthM / 2 - secondDoorStopWidthM + gasketWidthM / 2;
2540
+ // --- HINGE CALCULATIONS ---
2541
+ const hingeTotalHeightM = 120 / 1000;
2542
+ const hingeRadiusM = 8 / 1000;
2543
+ const capHeightM = 4 / 1000;
2544
+ const separatorHeightM = 4 / 1000;
2545
+ const barrelPartHeight = (hingeTotalHeightM - capHeightM * 2 - separatorHeightM) / 2;
2546
+
2547
+ // --- HINGE VISIBILITY LOGIC ---
2548
+ const isGlassDoor = require$$0.useMemo(() => ["SG8", "SG10", "SG12"].includes(bodyType), [bodyType]);
2549
+
2550
+ // Calculate evenly spaced hinge positions
2551
+ const standardHingeYPositions = require$$0.useMemo(() => {
2552
+ const numHinges = 4;
2553
+ const topMargin = 180 / 1000;
2554
+ const bottomMargin = 180 / 1000;
2555
+ const availableHeight = mainDoorHeightM - topMargin - bottomMargin;
2556
+ const spacing = availableHeight / (numHinges - 1);
2557
+ const positions = [];
2558
+ for (let i = 0; i < numHinges; i++) {
2559
+ positions.push(mainDoorHeightM / 2 - topMargin - i * spacing);
2560
+ }
2561
+ return positions;
2562
+ }, [mainDoorHeightM]);
2563
+
2564
+ // Y positions for the new glass hinges
2565
+ const glassHingeYPositions = require$$0.useMemo(() => {
2566
+ const topMargin = 250 / 1000;
2567
+ const secondTopMargin = 450 / 1000;
2568
+ const bottomMargin = 250 / 1000;
2569
+ const top = mainDoorHeightM / 2 - topMargin;
2570
+ const secondTop = mainDoorHeightM / 2 - secondTopMargin;
2571
+ const bottom = -mainDoorHeightM / 2 + bottomMargin;
2572
+ return [top, secondTop, bottom];
2573
+ }, [mainDoorHeightM]);
2574
+ const isStandardHingeVisible = require$$0.useMemo(() => {
2575
+ if (isGlassDoor) return false;
2576
+ if (!isFrameVisible) return false;
2577
+ const invisibleFrameTypes = ["WDGF_WDG100", "WF_100", "WF_FLI"];
2578
+ if (invisibleFrameTypes.includes(frameType)) {
2579
+ return false;
2580
+ }
2581
+ return true;
2582
+ }, [isFrameVisible, frameType, isGlassDoor]);
2583
+ return /*#__PURE__*/jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
2584
+ children: [frontCoverPanel.visible && /*#__PURE__*/jsxRuntimeExports.jsxs("group", {
2585
+ "position-z": frontArchitraveZ,
2586
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx("mesh", {
2587
+ position: [0, topArchitraveY, 0],
2588
+ castShadow: true,
2589
+ material: frontCoverPanelMaterial,
2590
+ children: /*#__PURE__*/jsxRuntimeExports.jsx("boxGeometry", {
2591
+ args: [topArchitraveWidth, architraveProfileM, architraveDepthM]
2592
+ })
2593
+ }), /*#__PURE__*/jsxRuntimeExports.jsx("mesh", {
2594
+ position: [leftArchitraveX, sideArchitraveCenterY, 0],
2595
+ castShadow: true,
2596
+ material: frontCoverPanelMaterial,
2597
+ children: /*#__PURE__*/jsxRuntimeExports.jsx("boxGeometry", {
2598
+ args: [architraveProfileM, sideArchitraveHeight, architraveDepthM]
2599
+ })
2600
+ }), /*#__PURE__*/jsxRuntimeExports.jsx("mesh", {
2601
+ position: [rightArchitraveX, sideArchitraveCenterY, 0],
2602
+ castShadow: true,
2603
+ material: frontCoverPanelMaterial,
2604
+ children: /*#__PURE__*/jsxRuntimeExports.jsx("boxGeometry", {
2605
+ args: [architraveProfileM, sideArchitraveHeight, architraveDepthM]
2606
+ })
2607
+ })]
2608
+ }), backCoverPanel.visible && /*#__PURE__*/jsxRuntimeExports.jsxs("group", {
2609
+ "position-z": backArchitraveZ,
2610
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx("mesh", {
2611
+ position: [0, topArchitraveY, 0],
2612
+ castShadow: true,
2613
+ material: backCoverPanelMaterial,
2614
+ children: /*#__PURE__*/jsxRuntimeExports.jsx("boxGeometry", {
2615
+ args: [topArchitraveWidth, architraveProfileM, architraveDepthM]
2616
+ })
2617
+ }), /*#__PURE__*/jsxRuntimeExports.jsx("mesh", {
2618
+ position: [leftArchitraveX, sideArchitraveCenterY, 0],
2619
+ castShadow: true,
2620
+ material: backCoverPanelMaterial,
2621
+ children: /*#__PURE__*/jsxRuntimeExports.jsx("boxGeometry", {
2622
+ args: [architraveProfileM, sideArchitraveHeight, architraveDepthM]
2623
+ })
2624
+ }), /*#__PURE__*/jsxRuntimeExports.jsx("mesh", {
2625
+ position: [rightArchitraveX, sideArchitraveCenterY, 0],
2626
+ castShadow: true,
2627
+ material: backCoverPanelMaterial,
2628
+ children: /*#__PURE__*/jsxRuntimeExports.jsx("boxGeometry", {
2629
+ args: [architraveProfileM, sideArchitraveHeight, architraveDepthM]
2630
+ })
2631
+ })]
2632
+ }), exteriorFanlight.visible && /*#__PURE__*/jsxRuntimeExports.jsx("mesh", {
2633
+ position: [0, exteriorFanlightYPosition, exteriorFanlightZPosition],
2634
+ castShadow: true,
2635
+ material: exteriorFanlightMaterial,
2636
+ children: /*#__PURE__*/jsxRuntimeExports.jsx("boxGeometry", {
2637
+ args: [totalFrameWidth, exteriorFanlightHeightM, exteriorFanlightDepthM]
2638
+ })
2639
+ }), isFrameVisible && /*#__PURE__*/jsxRuntimeExports.jsxs("group", {
2640
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx("mesh", {
2641
+ castShadow: true,
2642
+ position: [0, topFrameCenterY, 0],
2643
+ children: /*#__PURE__*/jsxRuntimeExports.jsxs(csg.Geometry, {
2644
+ useGroups: true,
2645
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx(csg.Base, {
2646
+ name: "frame-base",
2647
+ material: frameMaterial,
2648
+ children: /*#__PURE__*/jsxRuntimeExports.jsx("boxGeometry", {
2649
+ args: [doorWidthM, topFrameWidthM, frameDepthM]
2650
+ })
2651
+ }), !["MXF_40", "MXF_50", "MXCAF_40", "MXCAF_50"].includes(frameType) && /*#__PURE__*/jsxRuntimeExports.jsx(csg.Subtraction, {
2652
+ name: "cut-exterior",
2653
+ material: frameMaterial,
2654
+ position: [0, notchposition, 0],
2655
+ children: /*#__PURE__*/jsxRuntimeExports.jsx("boxGeometry", {
2656
+ args: [doorWidthM + 0.01, notchWidthM, notchDepthM]
2657
+ })
2658
+ })]
2659
+ })
2660
+ }), /*#__PURE__*/jsxRuntimeExports.jsx("mesh", {
2661
+ castShadow: true,
2662
+ position: [-doorWidthM / 2 - sidesFrameWidthM / 2, sideFrameCenterY, 0],
2663
+ children: /*#__PURE__*/jsxRuntimeExports.jsxs(csg.Geometry, {
2664
+ useGroups: true,
2665
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx(csg.Base, {
2666
+ name: "frame-base",
2667
+ material: frameMaterial,
2668
+ children: /*#__PURE__*/jsxRuntimeExports.jsx("boxGeometry", {
2669
+ args: [sidesFrameWidthM, totalFrameHeightM, frameDepthM]
2670
+ })
2671
+ }), !["MXF_40", "MXF_50", "MXCAF_40", "MXCAF_50"].includes(frameType) && /*#__PURE__*/jsxRuntimeExports.jsx(csg.Subtraction, {
2672
+ name: "cut-exterior",
2673
+ material: frameMaterial,
2674
+ position: [-notchposition, 0, 0],
2675
+ children: /*#__PURE__*/jsxRuntimeExports.jsx("boxGeometry", {
2676
+ args: [notchWidthM, totalFrameHeightM + 0.01, notchDepthM]
2677
+ })
2678
+ })]
2679
+ })
2680
+ }), /*#__PURE__*/jsxRuntimeExports.jsx("mesh", {
2681
+ castShadow: true,
2682
+ position: [doorWidthM / 2 + sidesFrameWidthM / 2, sideFrameCenterY, 0],
2683
+ children: /*#__PURE__*/jsxRuntimeExports.jsxs(csg.Geometry, {
2684
+ useGroups: true,
2685
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx(csg.Base, {
2686
+ name: "frame-base",
2687
+ material: frameMaterial,
2688
+ children: /*#__PURE__*/jsxRuntimeExports.jsx("boxGeometry", {
2689
+ args: [sidesFrameWidthM, totalFrameHeightM, frameDepthM]
2690
+ })
2691
+ }), !["MXF_40", "MXF_50", "MXCAF_40", "MXCAF_50"].includes(frameType) && /*#__PURE__*/jsxRuntimeExports.jsx(csg.Subtraction, {
2692
+ name: "cut-exterior",
2693
+ material: frameMaterial,
2694
+ position: [notchposition, 0, 0],
2695
+ children: /*#__PURE__*/jsxRuntimeExports.jsx("boxGeometry", {
2696
+ args: [notchWidthM, totalFrameHeightM + 0.01, notchDepthM]
2697
+ })
2698
+ })]
2699
+ })
2700
+ }), /*#__PURE__*/jsxRuntimeExports.jsx("mesh", {
2701
+ castShadow: true,
2702
+ position: [0, totalOpeningHeightM / 2 - doorStopWidthM / 2, doorStopPositionZ],
2703
+ material: doorStopMaterial,
2704
+ children: /*#__PURE__*/jsxRuntimeExports.jsx("boxGeometry", {
2705
+ args: [doorWidthM, doorStopWidthM, doorStopDepthM]
2706
+ })
2707
+ }), /*#__PURE__*/jsxRuntimeExports.jsx("mesh", {
2708
+ castShadow: true,
2709
+ position: [-doorWidthM / 2 + doorStopWidthM / 2, 0, doorStopPositionZ],
2710
+ material: doorStopMaterial,
2711
+ children: /*#__PURE__*/jsxRuntimeExports.jsx("boxGeometry", {
2712
+ args: [doorStopWidthM, totalOpeningHeightM, doorStopDepthM]
2713
+ })
2714
+ }), /*#__PURE__*/jsxRuntimeExports.jsx("mesh", {
2715
+ castShadow: true,
2716
+ position: [doorWidthM / 2 - doorStopWidthM / 2, 0, doorStopPositionZ],
2717
+ material: doorStopMaterial,
2718
+ children: /*#__PURE__*/jsxRuntimeExports.jsx("boxGeometry", {
2719
+ args: [doorStopWidthM, totalOpeningHeightM, doorStopDepthM]
2720
+ })
2721
+ }), frameType !== "WF_FLI" && /*#__PURE__*/jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
2722
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx("mesh", {
2723
+ castShadow: true,
2724
+ position: [0, topGasketYPosition, gasketZPosition],
2725
+ material: gasketMaterial,
2726
+ children: /*#__PURE__*/jsxRuntimeExports.jsx("boxGeometry", {
2727
+ args: [doorWidthM - 0.03, gasketWidthM + 0.005, gasketDepthM]
2728
+ })
2729
+ }), /*#__PURE__*/jsxRuntimeExports.jsx("mesh", {
2730
+ castShadow: true,
2731
+ position: [leftGasketXPosition - 0.005, -0.005, gasketZPosition],
2732
+ material: gasketMaterial,
2733
+ children: /*#__PURE__*/jsxRuntimeExports.jsx("boxGeometry", {
2734
+ args: [gasketWidthM + 0.005, totalOpeningHeightM - 0.02, gasketDepthM]
2735
+ })
2736
+ }), /*#__PURE__*/jsxRuntimeExports.jsx("mesh", {
2737
+ castShadow: true,
2738
+ position: [rightGasketXPosition + 0.005, -0.005, gasketZPosition],
2739
+ material: gasketMaterial,
2740
+ children: /*#__PURE__*/jsxRuntimeExports.jsx("boxGeometry", {
2741
+ args: [gasketWidthM + 0.005, totalOpeningHeightM - 0.02, gasketDepthM]
2742
+ })
2743
+ })]
2744
+ }), (frameType === "WDGF_WDG100" || frameType === "WF_100" || frameType === "WF_FLI") && /*#__PURE__*/jsxRuntimeExports.jsxs("group", {
2745
+ children: [/*#__PURE__*/jsxRuntimeExports.jsxs("group", {
2746
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx("mesh", {
2747
+ castShadow: true,
2748
+ position: [0, totalOpeningHeightM / 2 - secondDoorStopWidthM / 2, secondDoorStopPositionZ],
2749
+ material: doorStopMaterial,
2750
+ children: /*#__PURE__*/jsxRuntimeExports.jsx("boxGeometry", {
2751
+ args: [doorWidthM, secondDoorStopWidthM, secondDoorStopDepthM]
2752
+ })
2753
+ }), /*#__PURE__*/jsxRuntimeExports.jsx("mesh", {
2754
+ castShadow: true,
2755
+ position: [-doorWidthM / 2 + secondDoorStopWidthM / 2, 0, secondDoorStopPositionZ],
2756
+ material: doorStopMaterial,
2757
+ children: /*#__PURE__*/jsxRuntimeExports.jsx("boxGeometry", {
2758
+ args: [secondDoorStopWidthM, totalOpeningHeightM, secondDoorStopDepthM]
2759
+ })
2760
+ }), /*#__PURE__*/jsxRuntimeExports.jsx("mesh", {
2761
+ castShadow: true,
2762
+ position: [doorWidthM / 2 - secondDoorStopWidthM / 2, 0, secondDoorStopPositionZ],
2763
+ material: doorStopMaterial,
2764
+ children: /*#__PURE__*/jsxRuntimeExports.jsx("boxGeometry", {
2765
+ args: [secondDoorStopWidthM, totalOpeningHeightM, secondDoorStopDepthM]
2766
+ })
2767
+ })]
2768
+ }), /*#__PURE__*/jsxRuntimeExports.jsxs("group", {
2769
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx("mesh", {
2770
+ castShadow: true,
2771
+ position: [0, secondTopGasketYPosition - 0.005, secondGasketZPosition],
2772
+ material: gasketMaterial,
2773
+ children: /*#__PURE__*/jsxRuntimeExports.jsx("boxGeometry", {
2774
+ args: [doorWidthM - 0.03, gasketWidthM + 0.005, gasketDepthM]
2775
+ })
2776
+ }), /*#__PURE__*/jsxRuntimeExports.jsx("mesh", {
2777
+ castShadow: true,
2778
+ position: [secondLeftGasketXPosition - 0.005, -0.01, secondGasketZPosition],
2779
+ material: gasketMaterial,
2780
+ children: /*#__PURE__*/jsxRuntimeExports.jsx("boxGeometry", {
2781
+ args: [gasketWidthM + 0.005, totalOpeningHeightM - 0.04, gasketDepthM]
2782
+ })
2783
+ }), /*#__PURE__*/jsxRuntimeExports.jsx("mesh", {
2784
+ castShadow: true,
2785
+ position: [secondRightGasketXPosition + 0.005, -0.01, secondGasketZPosition],
2786
+ material: gasketMaterial,
2787
+ children: /*#__PURE__*/jsxRuntimeExports.jsx("boxGeometry", {
2788
+ args: [gasketWidthM + 0.004, totalOpeningHeightM - 0.04, gasketDepthM]
2789
+ })
2790
+ })]
2791
+ }), glassVisible && /*#__PURE__*/jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
2792
+ children: [/*#__PURE__*/jsxRuntimeExports.jsxs("group", {
2793
+ children: [(frameType === "WDGF_WDG100" || frameType === "WF_100") && /*#__PURE__*/jsxRuntimeExports.jsx("mesh", {
2794
+ castShadow: true,
2795
+ position: [0, topFrameCenterY - secondDoorStopWidthM / 2, leftGlass_Z],
2796
+ material: glassInfillMaterial,
2797
+ children: /*#__PURE__*/jsxRuntimeExports.jsx("boxGeometry", {
2798
+ args: [doorWidthM - 2 * secondDoorStopWidthM, topFrameWidthM + secondDoorStopWidthM, GlassPanelDepthM]
2799
+ })
2800
+ }), frameType !== "WDGF_WDG100" && frameType !== "WF_100" && /*#__PURE__*/jsxRuntimeExports.jsx("mesh", {
2801
+ castShadow: true,
2802
+ position: [0, topFrameCenterY, leftGlass_Z],
2803
+ material: glassInfillMaterial,
2804
+ children: /*#__PURE__*/jsxRuntimeExports.jsx("boxGeometry", {
2805
+ args: [doorWidthM - 2 * secondDoorStopWidthM, topFrameWidthM, GlassPanelDepthM]
2806
+ })
2807
+ }), /*#__PURE__*/jsxRuntimeExports.jsx("mesh", {
2808
+ castShadow: true,
2809
+ position: [-doorWidthM / 2 - sidesFrameWidthM / 2 + secondDoorStopWidthM / 2, sideFrameCenterY, leftGlass_Z],
2810
+ material: glassInfillMaterial,
2811
+ children: /*#__PURE__*/jsxRuntimeExports.jsx("boxGeometry", {
2812
+ args: [sidesFrameWidthM + secondDoorStopWidthM, totalFrameHeightM, GlassPanelDepthM]
2813
+ })
2814
+ }), /*#__PURE__*/jsxRuntimeExports.jsx("mesh", {
2815
+ castShadow: true,
2816
+ position: [doorWidthM / 2 + sidesFrameWidthM / 2 - secondDoorStopWidthM / 2, sideFrameCenterY, leftGlass_Z],
2817
+ material: glassInfillMaterial,
2818
+ children: /*#__PURE__*/jsxRuntimeExports.jsx("boxGeometry", {
2819
+ args: [sidesFrameWidthM + secondDoorStopWidthM, totalFrameHeightM, GlassPanelDepthM]
2820
+ })
2821
+ })]
2822
+ }), /*#__PURE__*/jsxRuntimeExports.jsxs("group", {
2823
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx("mesh", {
2824
+ castShadow: true,
2825
+ position: [0, topFrameCenterY, rightGlass_Z],
2826
+ material: glassInfillMaterial,
2827
+ children: /*#__PURE__*/jsxRuntimeExports.jsx("boxGeometry", {
2828
+ args: [doorWidthM, topFrameWidthM, GlassPanelDepthM]
2829
+ })
2830
+ }), /*#__PURE__*/jsxRuntimeExports.jsx("mesh", {
2831
+ castShadow: true,
2832
+ position: [-doorWidthM / 2 - sidesFrameWidthM / 2, sideFrameCenterY, rightGlass_Z],
2833
+ material: glassInfillMaterial,
2834
+ children: /*#__PURE__*/jsxRuntimeExports.jsx("boxGeometry", {
2835
+ args: [sidesFrameWidthM, totalFrameHeightM, GlassPanelDepthM]
2836
+ })
2837
+ }), /*#__PURE__*/jsxRuntimeExports.jsx("mesh", {
2838
+ castShadow: true,
2839
+ position: [doorWidthM / 2 + sidesFrameWidthM / 2, sideFrameCenterY, rightGlass_Z],
2840
+ material: glassInfillMaterial,
2841
+ children: /*#__PURE__*/jsxRuntimeExports.jsx("boxGeometry", {
2842
+ args: [sidesFrameWidthM, totalFrameHeightM, GlassPanelDepthM]
2843
+ })
2844
+ })]
2845
+ })]
2846
+ })]
2847
+ })]
2848
+ }), interiorFanlight.visible && /*#__PURE__*/jsxRuntimeExports.jsx("mesh", {
2849
+ position: [0, interiorFanlightYPosition, doorCenterZ],
2850
+ castShadow: true,
2851
+ material: interiorFanlightMaterial,
2852
+ children: /*#__PURE__*/jsxRuntimeExports.jsx("boxGeometry", {
2853
+ args: [doorWidthM, interiorFanlightHeightM, doorDepthM]
2854
+ })
2855
+ }), isStandardHingeVisible && standardHingeYPositions.map((y, index) => /*#__PURE__*/jsxRuntimeExports.jsxs("group", {
2856
+ position: [hingeSideX, doorYPosition + y, hingeZ],
2857
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx("mesh", {
2858
+ material: hingeBodyMaterial,
2859
+ position: [0, separatorHeightM / 2 + barrelPartHeight / 2, 0],
2860
+ castShadow: true,
2861
+ children: /*#__PURE__*/jsxRuntimeExports.jsx("cylinderGeometry", {
2862
+ args: [hingeRadiusM, hingeRadiusM, barrelPartHeight, 32]
2863
+ })
2864
+ }), /*#__PURE__*/jsxRuntimeExports.jsx("mesh", {
2865
+ material: hingeAccentMaterial,
2866
+ position: [0, separatorHeightM / 2 + barrelPartHeight + capHeightM / 2, 0],
2867
+ castShadow: true,
2868
+ children: /*#__PURE__*/jsxRuntimeExports.jsx("cylinderGeometry", {
2869
+ args: [hingeRadiusM, hingeRadiusM, capHeightM, 32]
2870
+ })
2871
+ })]
2872
+ }, "frame-hinge-".concat(index))), /*#__PURE__*/jsxRuntimeExports.jsxs(three.a.group, {
2873
+ position: [hingeSideX, doorYPosition, hingeZ],
2874
+ rotation: rotation.to((x, y, z) => [x, y, z]),
2875
+ onClick: handleClick,
2876
+ onPointerOver: () => document.body.style.cursor = "pointer",
2877
+ onPointerOut: () => document.body.style.cursor = "auto",
2878
+ children: [isStandardHingeVisible && standardHingeYPositions.map((y, index) => /*#__PURE__*/jsxRuntimeExports.jsxs("group", {
2879
+ position: [0, y, 0],
2880
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx("mesh", {
2881
+ material: hingeBodyMaterial,
2882
+ position: [0, -separatorHeightM / 2 - barrelPartHeight / 2, 0],
2883
+ castShadow: true,
2884
+ children: /*#__PURE__*/jsxRuntimeExports.jsx("cylinderGeometry", {
2885
+ args: [hingeRadiusM, hingeRadiusM, barrelPartHeight, 32]
2886
+ })
2887
+ }), /*#__PURE__*/jsxRuntimeExports.jsx("mesh", {
2888
+ material: hingeAccentMaterial,
2889
+ position: [0, -separatorHeightM / 2 - barrelPartHeight - capHeightM / 2, 0],
2890
+ castShadow: true,
2891
+ children: /*#__PURE__*/jsxRuntimeExports.jsx("cylinderGeometry", {
2892
+ args: [hingeRadiusM, hingeRadiusM, capHeightM, 32]
2893
+ })
2894
+ }), /*#__PURE__*/jsxRuntimeExports.jsx("mesh", {
2895
+ material: hingeAccentMaterial,
2896
+ position: [0, 0, 0],
2897
+ castShadow: true,
2898
+ children: /*#__PURE__*/jsxRuntimeExports.jsx("cylinderGeometry", {
2899
+ args: [hingeRadiusM, hingeRadiusM, separatorHeightM, 32]
2900
+ })
2901
+ })]
2902
+ }, "door-hinge-".concat(index))), isGlassDoor && isFrameVisible && glassHingeYPositions.map((y, index) => /*#__PURE__*/jsxRuntimeExports.jsx(GlassHinge, {
2903
+ position: [0, y, doorOffsetZ],
2904
+ pivot: doorPivot,
2905
+ frameSideWidth: sidesFrameWidthM,
2906
+ doorDepthM: doorDepthM,
2907
+ material: hingeBodyMaterial,
2908
+ gasketMaterial: gasketMaterial
2909
+ }, "glass-hinge-".concat(index))), /*#__PURE__*/jsxRuntimeExports.jsxs("group", {
2910
+ position: [-hingeSideX, 0, doorOffsetZ],
2911
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx("mesh", {
2912
+ castShadow: true,
2913
+ children: /*#__PURE__*/jsxRuntimeExports.jsxs(csg.Geometry, {
2914
+ useGroups: true,
2915
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx(csg.Base, {
2916
+ name: "door-base",
2917
+ material: doorMaterial,
2918
+ children: /*#__PURE__*/jsxRuntimeExports.jsx("boxGeometry", {
2919
+ args: [doorWidthM, mainDoorHeightM, doorDepthM]
2920
+ })
2921
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(DoorStopCuts, {
2922
+ visible: frameType === "WDGF_WDG100" || frameType === "WF_100" || frameType === "WF_FLI",
2923
+ width: doorWidthM,
2924
+ height: totalOpeningHeightM,
2925
+ stopWidth: doorStopWidthM,
2926
+ stopDepth: doorStopDepthM,
2927
+ stopPositionZ: doorStopPositionZ,
2928
+ centerZ: doorCenterZ,
2929
+ glassDepthOffset: GlassPanelDepthM / 2,
2930
+ material: doorMaterial,
2931
+ setName: "1"
2932
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(DoorStopCuts, {
2933
+ visible: frameType === "WDGF_WDG100" || frameType === "WF_100" || frameType === "WF_FLI",
2934
+ width: doorWidthM,
2935
+ height: totalOpeningHeightM,
2936
+ stopWidth: secondDoorStopWidthM,
2937
+ stopDepth: secondDoorStopDepthM,
2938
+ stopPositionZ: secondDoorStopPositionZ,
2939
+ centerZ: doorCenterZ,
2940
+ glassDepthOffset: GlassPanelDepthM / 2,
2941
+ material: doorMaterial,
2942
+ setName: "2"
2943
+ }), glassVisible && /*#__PURE__*/jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
2944
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx("mesh", {
2945
+ position: [0, 0, frontGlassOffsetZ],
2946
+ castShadow: true,
2947
+ material: glassInfillMaterial,
2948
+ children: /*#__PURE__*/jsxRuntimeExports.jsx("boxGeometry", {
2949
+ args: [doorWidthM, mainDoorHeightM, GlassPanelDepthM]
2950
+ })
2951
+ }), frameType !== "WDGF_WDG100" && frameType !== "WF_100" && /*#__PURE__*/jsxRuntimeExports.jsx("mesh", {
2952
+ position: [0, 0, backGlassOffsetZ],
2953
+ castShadow: true,
2954
+ material: glassInfillMaterial,
2955
+ children: /*#__PURE__*/jsxRuntimeExports.jsx("boxGeometry", {
2956
+ args: [doorWidthM, mainDoorHeightM, GlassPanelDepthM]
2957
+ })
2958
+ }), (frameType === "WDGF_WDG100" || frameType === "WF_100") && /*#__PURE__*/jsxRuntimeExports.jsx("mesh", {
2959
+ position: [0, -secondDoorStopWidthM / 2, backGlassOffsetZ],
2960
+ castShadow: true,
2961
+ material: glassInfillMaterial,
2962
+ children: /*#__PURE__*/jsxRuntimeExports.jsx("boxGeometry", {
2963
+ args: [doorWidthM - 2 * secondDoorStopWidthM, mainDoorHeightM - secondDoorStopWidthM, GlassPanelDepthM]
2964
+ })
2965
+ })]
2966
+ }), occulus.visible && occulusWidthM > 0 && occulusHeightM > 0 && /*#__PURE__*/jsxRuntimeExports.jsx(csg.Subtraction, {
2967
+ material: placeholderMaterial,
2968
+ position: [occulusPositionXM, occulusPositionYM, 0],
2969
+ children: /*#__PURE__*/jsxRuntimeExports.jsx("boxGeometry", {
2970
+ args: [occulusWidthM, occulusHeightM, doorDepthM + 0.01]
2971
+ })
2972
+ })]
2973
+ })
2974
+ }), occulus.visible && occulus.infillVisible && occulusWidthM > 0 && occulusHeightM > 0 && /*#__PURE__*/jsxRuntimeExports.jsx("mesh", {
2975
+ position: [occulusPositionXM, occulusPositionYM, 0],
2976
+ castShadow: true,
2977
+ material: occulusInfillMaterial,
2978
+ children: /*#__PURE__*/jsxRuntimeExports.jsx("boxGeometry", {
2979
+ args: [occulusWidthM, occulusHeightM, occulusInfillDepthM]
2980
+ })
2981
+ })]
2982
+ })]
2983
+ }), isPlaneVisible && /*#__PURE__*/jsxRuntimeExports.jsxs("mesh", {
2984
+ receiveShadow: true,
2985
+ rotation: [-Math.PI / 2, 0, 0],
2986
+ position: [0, -totalOpeningHeightM / 2 - 0.01, 0],
2987
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx("planeGeometry", {
2988
+ args: [10, 10]
2989
+ }), /*#__PURE__*/jsxRuntimeExports.jsx("meshStandardMaterial", {
2990
+ color: "#f9f9f9",
2991
+ side: THREE__namespace.DoubleSide
2992
+ })]
2993
+ })]
2994
+ });
2995
+ }
2996
+
2997
+ const _excluded = ["frameType"];
2998
+ const cpidOptions = ["P_SD_FH_AF20_40", "P_SD_FH_AF20_40OCC", "P_SD_FH_AF40_40", "P_SD_FH_AF40_40OCC", "P_SD_FH_WF_40", "P_SD_FH_WF_40OCC", "P_SD_FH_MXF_40", "P_SD_FH_MXF_40OCC", "P_SD_FH_MXCAF_40", "P_SD_FH_MXCAF_40OCC", "P_SD_FH_AF20_50", "P_SD_FH_AF20_50OCC", "P_SD_FH_AF40_50", "P_SD_FH_AF40_50OCC", "P_SD_FH_WF_50", "P_SD_FH_WF_50OCC", "P_SD_FH_WF_FLI", "P_SD_FH_AF20_SG8", "P_SD_FH_AF20_SG10", "P_SD_FH_AF20_SG12", "P_SD_FH_AF40_SG8", "P_SD_FH_AF40_SG10", "P_SD_FH_AF40_SG12", "P_SD_FH_NOF_SG8", "P_SD_FH_NOF_SG10", "P_SD_FH_NOF_SG12", "P_SD_FH_WF_100", "P_SD_FH_WDGF_WDG100", "P_SD_FH_AF20_40_IFL", "P_SD_FH_AF20_40OCC_IFL", "P_SD_FH_AF40_40_IFL", "P_SD_FH_AF40_40OCC_IFL", "P_SD_FH_WF_40_IFL", "P_SD_FH_WF_40OCC_IFL", "P_SD_FH_AF20_50_IFL", "P_SD_FH_AF20_50OCC_IFL", "P_SD_FH_AF40_50_IFL", "P_SD_FH_AF40_50OCC_IFL", "P_SD_FH_WF_50_IFL", "P_SD_FH_WF_50OCC_IFL", "P_SD_WPFL_AF20_40", "P_SD_WPFL_AF20_40OCC", "P_SD_WPFL_AF40_40", "P_SD_WPFL_AF40_40OCC", "P_SD_WPFL_WF_40", "P_SD_WPFL_WF_40OCC", "P_SD_WPFL_AF20_50", "P_SD_WPFL_AF20_50OCC", "P_SD_WPFL_AF40_50", "P_SD_WPFL_AF40_50OCC", "P_SD_WPFL_WF_50", "P_SD_WPFL_WF_50OCC", "P_SD_WPFL_AF20_SG8", "P_SD_WPFL_AF20_SG10", "P_SD_WPFL_AF20_SG12", "P_SD_WPFL_AF40_SG8", "P_SD_WPFL_AF40_SG10", "P_SD_WPFL_AF40_SG12", "P_SD_ALSGFL_AF20_40", "P_SD_ALSGFL_AF20_40OCC", "P_SD_ALSGFL_AF40_40", "P_SD_ALSGFL_AF40_40OCC", "P_SD_ALSGFL_WF_40", "P_SD_ALSGFL_WF_40OCC", "P_SD_ALSGFL_AF20_SG8", "P_SD_ALSGFL_AF20_SG10", "P_SD_ALSGFL_AF20_SG12", "P_SD_ALSGFL_AF40_SG8", "P_SD_ALSGFL_AF40_SG10", "P_SD_ALSGFL_AF40_SG12", "P_SD_ALDGFL_AF20_40", "P_SD_ALDGFL_AF20_40OCC", "P_SD_ALDGFL_AF40_40", "P_SD_ALDGFL_AF40_40OCC", "P_SD_ALDGFL_WF_40", "P_SD_ALDGFL_WF_40OCC", "P_SD_ALDGFL_AF20_50", "P_SD_ALDGFL_AF20_50OCC", "P_SD_ALDGFL_AF40_50", "P_SD_ALDGFL_AF40_50OCC", "P_SD_ALDGFL_WF_50", "P_SD_ALDGFL_WF_50OCC", "P_SD_ALDGFL_AF20_SG8", "P_SD_ALDGFL_AF20_SG10", "P_SD_ALDGFL_AF20_SG12", "P_SD_ALDGFL_AF40_SG8", "P_SD_ALDGFL_AF40_SG10", "P_SD_ALDGFL_AF40_SG12"];
2999
+ const EditableSlider = _ref => {
3000
+ let {
3001
+ label,
3002
+ value,
3003
+ min,
3004
+ max,
3005
+ step = 1,
3006
+ onChange
3007
+ } = _ref;
3008
+ const [inputValue, setInputValue] = require$$0.useState(value);
3009
+ require$$0__default["default"].useEffect(() => {
3010
+ setInputValue(value);
3011
+ }, [value]);
3012
+ const handleSliderChange = (_, newValue) => {
3013
+ onChange(Array.isArray(newValue) ? newValue[0] : newValue);
3014
+ };
3015
+ const handleInputChange = event => {
3016
+ setInputValue(event.target.value);
3017
+ };
3018
+ const handleInputBlur = () => {
3019
+ let numericValue = inputValue === "" || isNaN(Number(inputValue)) ? min : Number(inputValue);
3020
+ if (numericValue < min) numericValue = min;
3021
+ if (numericValue > max) numericValue = max;
3022
+ onChange(numericValue);
3023
+ };
3024
+ const handleInputKeyDown = event => {
3025
+ if (event.key === "Enter") {
3026
+ handleInputBlur();
3027
+ event.target.blur();
3028
+ }
3029
+ };
3030
+ return /*#__PURE__*/jsxRuntimeExports.jsxs(material.FormControl, {
3031
+ fullWidth: true,
3032
+ children: [/*#__PURE__*/jsxRuntimeExports.jsxs(material.FormLabel, {
3033
+ sx: {
3034
+ mb: 1,
3035
+ display: "flex",
3036
+ justifyContent: "space-between",
3037
+ alignItems: "center"
3038
+ },
3039
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx("span", {
3040
+ children: label
3041
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(material.TextField, {
3042
+ value: inputValue,
3043
+ size: "small",
3044
+ onChange: handleInputChange,
3045
+ onBlur: handleInputBlur,
3046
+ onKeyDown: handleInputKeyDown,
3047
+ type: "number",
3048
+ variant: "outlined",
3049
+ inputProps: {
3050
+ step: step,
3051
+ min: min,
3052
+ max: max,
3053
+ "aria-labelledby": "input-slider"
3054
+ },
3055
+ InputProps: {
3056
+ endAdornment: /*#__PURE__*/jsxRuntimeExports.jsx(material.InputAdornment, {
3057
+ position: "end",
3058
+ children: "mm"
3059
+ })
3060
+ },
3061
+ sx: {
3062
+ width: "140px"
3063
+ }
3064
+ })]
3065
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(material.Slider, {
3066
+ value: typeof value === "number" ? value : min,
3067
+ min: min,
3068
+ max: max,
3069
+ step: step,
3070
+ onChange: handleSliderChange,
3071
+ "aria-labelledby": "input-slider"
3072
+ })]
3073
+ });
3074
+ };
3075
+ const MaterialInput = _ref2 => {
3076
+ let {
3077
+ label,
3078
+ value,
3079
+ onChange,
3080
+ onApply
3081
+ } = _ref2;
3082
+ const [inputValue, setInputValue] = require$$0.useState(value);
3083
+ require$$0__default["default"].useEffect(() => {
3084
+ setInputValue(value);
3085
+ }, [value]);
3086
+ const handleApply = () => {
3087
+ if (onApply) {
3088
+ onApply(inputValue);
3089
+ }
3090
+ onChange(inputValue);
3091
+ };
3092
+ return /*#__PURE__*/jsxRuntimeExports.jsxs(material.FormControl, {
3093
+ fullWidth: true,
3094
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx(material.FormLabel, {
3095
+ children: label
3096
+ }), /*#__PURE__*/jsxRuntimeExports.jsxs(material.Stack, {
3097
+ direction: "row",
3098
+ spacing: 1,
3099
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx(material.TextField, {
3100
+ size: "small",
3101
+ value: inputValue,
3102
+ onChange: e => setInputValue(e.target.value)
3103
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(material.Button, {
3104
+ variant: "contained",
3105
+ onClick: handleApply,
3106
+ children: "Apply"
3107
+ })]
3108
+ })]
3109
+ });
3110
+ };
3111
+ const MaterialSelector = _ref3 => {
3112
+ let {
3113
+ label,
3114
+ value,
3115
+ onChange
3116
+ } = _ref3;
3117
+ const materialOptions = Object.keys(availableMaterials);
3118
+ return /*#__PURE__*/jsxRuntimeExports.jsxs(material.FormControl, {
3119
+ fullWidth: true,
3120
+ size: "small",
3121
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx(material.FormLabel, {
3122
+ children: label
3123
+ }), /*#__PURE__*/jsxRuntimeExports.jsxs(material.Select, {
3124
+ value: value,
3125
+ onChange: e => onChange(e.target.value),
3126
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx(material.MenuItem, {
3127
+ value: "none",
3128
+ children: /*#__PURE__*/jsxRuntimeExports.jsx("em", {
3129
+ children: "None"
3130
+ })
3131
+ }), materialOptions.map(name => /*#__PURE__*/jsxRuntimeExports.jsx(material.MenuItem, {
3132
+ value: name,
3133
+ children: name
3134
+ }, name))]
3135
+ })]
3136
+ });
3137
+ };
3138
+ const Interface = () => {
3139
+ const {
3140
+ isPlaneVisible,
3141
+ setIsPlaneVisible,
3142
+ cpid,
3143
+ setCpid,
3144
+ door,
3145
+ setDoor,
3146
+ doorFrame,
3147
+ setDoorFrame,
3148
+ interiorFanlight,
3149
+ setInteriorFanlight,
3150
+ exteriorFanlight,
3151
+ setExteriorFanlight,
3152
+ occulus,
3153
+ setOcculus,
3154
+ frontCoverPanel,
3155
+ setFrontCoverPanel,
3156
+ backCoverPanel,
3157
+ setBackCoverPanel,
3158
+ frameType,
3159
+ setFrameType,
3160
+ bodyType,
3161
+ setBodyType,
3162
+ totalHeight,
3163
+ setTotalHeight,
3164
+ totalWidth,
3165
+ setTotalWidth,
3166
+ exteriorFanlightType,
3167
+ setExteriorFanlightType,
3168
+ testDoorMaterial,
3169
+ setTestDoorMaterial,
3170
+ testFrameMaterial,
3171
+ setTestFrameMaterial,
3172
+ testInteriorFanlightMaterial,
3173
+ setTestInteriorFanlightMaterial,
3174
+ testExteriorFanlightMaterial,
3175
+ setTestExteriorFanlightMaterial,
3176
+ testOcculusInfillMaterial,
3177
+ setTestOcculusInfillMaterial,
3178
+ testGlassInfillMaterial,
3179
+ setTestGlassInfillMaterial,
3180
+ testGasketMaterial,
3181
+ setTestGasketMaterial,
3182
+ testDoorStopMaterial,
3183
+ setTestDoorStopMaterial,
3184
+ testHingeMaterial,
3185
+ setTestHingeMaterial,
3186
+ glassVisible,
3187
+ setGlassVisible,
3188
+ glassDepth,
3189
+ setGlassDepth,
3190
+ testFrontCoverPanelMaterial,
3191
+ setTestFrontCoverPanelMaterial,
3192
+ setTestBackCoverPanelMaterial
3193
+ } = useConfigurator();
3194
+ const [parseMessage, setParseMessage] = require$$0.useState({
3195
+ type: "",
3196
+ text: ""
3197
+ });
3198
+ const handleMaterialApply = materialName => {
3199
+ console.log("[DATABASE SIMULATION] Started fetching data for material: \"".concat(materialName, "\""));
3200
+ };
3201
+ const fileInputRef = require$$0.useRef(null);
3202
+ const handleExport = () => {
3203
+ if (!cpid || cpid.trim() === "") {
3204
+ alert("Please enter a Door Title (CPID) before exporting.");
3205
+ return;
3206
+ }
3207
+ const doorFrameWithFrameType = _objectSpread2(_objectSpread2({}, doorFrame), {}, {
3208
+ frameType: frameType
3209
+ });
3210
+ const exportData = {
3211
+ cpid,
3212
+ door,
3213
+ doorFrame: doorFrameWithFrameType,
3214
+ interiorFanlight,
3215
+ exteriorFanlight,
3216
+ occulus,
3217
+ frontCoverPanel,
3218
+ backCoverPanel
3219
+ };
3220
+ const jsonString = "data:text/json;charset=utf-8,".concat(encodeURIComponent(JSON.stringify(exportData, null, 2)));
3221
+ const link = document.createElement("a");
3222
+ link.href = jsonString;
3223
+ link.download = "".concat(cpid.trim(), ".json");
3224
+ link.click();
3225
+ };
3226
+ const handleImportClick = () => {
3227
+ if (fileInputRef.current) {
3228
+ fileInputRef.current.click();
3229
+ }
3230
+ };
3231
+ const handleFileChange = event => {
3232
+ var _event$target$files;
3233
+ const file = (_event$target$files = event.target.files) === null || _event$target$files === void 0 ? void 0 : _event$target$files[0];
3234
+ if (!file) return;
3235
+ const reader = new FileReader();
3236
+ reader.onload = e => {
3237
+ if (e.target && typeof e.target.result === "string") {
3238
+ try {
3239
+ const importedData = JSON.parse(e.target.result);
3240
+ if (importedData.cpid) setCpid(importedData.cpid);
3241
+ if (importedData.door) setDoor(importedData.door);
3242
+ if (importedData.doorFrame) {
3243
+ const _importedData$doorFra = importedData.doorFrame,
3244
+ {
3245
+ frameType: importedFrameType
3246
+ } = _importedData$doorFra,
3247
+ doorFrameData = _objectWithoutProperties(_importedData$doorFra, _excluded);
3248
+ setDoorFrame(doorFrameData);
3249
+ if (importedFrameType) setFrameType(importedFrameType);
3250
+ }
3251
+ if (importedData.interiorFanlight) setInteriorFanlight(importedData.interiorFanlight);
3252
+ if (importedData.exteriorFanlight) setExteriorFanlight(importedData.exteriorFanlight);
3253
+ if (importedData.occulus) setOcculus(importedData.occulus);
3254
+ if (importedData.frontCoverPanel) setFrontCoverPanel(importedData.frontCoverPanel);
3255
+ if (importedData.backCoverPanel) setBackCoverPanel(importedData.backCoverPanel);
3256
+ } catch (error) {
3257
+ console.error("Error parsing JSON file:", error);
3258
+ alert("Error: Could not parse the JSON file.");
3259
+ }
3260
+ } else {
3261
+ console.error("FileReader error: result is not a string or target is null");
3262
+ alert("Error: Could not read the file.");
3263
+ }
3264
+ };
3265
+ reader.readAsText(file);
3266
+ event.target.value = "";
3267
+ };
3268
+ const handleParseCpid = require$$0.useCallback(cpidToParse => {
3269
+ const showMessage = function (text) {
3270
+ let type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "error";
3271
+ setParseMessage({
3272
+ text,
3273
+ type
3274
+ });
3275
+ setTimeout(() => setParseMessage({
3276
+ text: "",
3277
+ type: ""
3278
+ }), 4000);
3279
+ };
3280
+ if (!cpidToParse || !cpidToParse.trim().startsWith("P_")) {
3281
+ showMessage("Invalid format: CPID must start with 'P_'.");
3282
+ return;
3283
+ }
3284
+ const parts = cpidToParse.trim().split("_");
3285
+ if (parts.length < 4) {
3286
+ showMessage("Invalid format: Not enough parts in CPID.");
3287
+ return;
3288
+ }
3289
+ const newConfig = {
3290
+ fanlightVisible: false,
3291
+ fanlightType: "WPFL",
3292
+ interiorFanlightVisible: false,
3293
+ occulusVisible: false,
3294
+ frameType: "",
3295
+ bodyType: ""
3296
+ };
3297
+ let currentIndex = 1;
3298
+
3299
+ // Door Type
3300
+ if (parts[currentIndex] === "SD") {
3301
+ currentIndex++;
3302
+ } else {
3303
+ showMessage("Unsupported Door Type: Only 'SD' is supported.");
3304
+ return;
3305
+ }
3306
+
3307
+ //Fanlight Type
3308
+ const fanlightPart = parts[currentIndex];
3309
+ const validFanlights = ["WPFL", "ALDGFL", "ALSGFL"];
3310
+ if (fanlightPart === "FH") {
3311
+ newConfig.fanlightVisible = false;
3312
+ currentIndex++;
3313
+ } else if (validFanlights.includes(fanlightPart)) {
3314
+ newConfig.fanlightVisible = true;
3315
+ newConfig.fanlightType = fanlightPart;
3316
+ currentIndex++;
3317
+ } else {
3318
+ showMessage("Invalid Fanlight Type: '".concat(fanlightPart, "'."));
3319
+ return;
3320
+ }
3321
+
3322
+ // Frame and Body Type
3323
+ const validSimpleFrameTypes = ["AF20", "AF40", "WF", "MXF", "MXCAF", "NOF"];
3324
+ const validBodyTypes = ["40", "50", "FLI", "100", "WDG100", "SG8", "SG10", "SG12"];
3325
+ let framePart = parts[currentIndex];
3326
+ let bodyPartRaw = parts[currentIndex + 1] || "";
3327
+ let frameFound = false;
3328
+ if ("".concat(framePart, "_").concat(bodyPartRaw) === "WDGF_WDG100") {
3329
+ newConfig.frameType = "WDGF_WDG100";
3330
+ newConfig.bodyType = "WDG100";
3331
+ currentIndex += 2;
3332
+ frameFound = true;
3333
+ } else if (validSimpleFrameTypes.includes(framePart)) {
3334
+ let tempBody = bodyPartRaw.replace("OCC", "");
3335
+ if (validBodyTypes.includes(tempBody)) {
3336
+ newConfig.frameType = framePart === "NOF" ? "NOF" : "".concat(framePart, "_").concat(tempBody);
3337
+ newConfig.bodyType = tempBody;
3338
+ if (bodyPartRaw.endsWith("OCC")) {
3339
+ newConfig.occulusVisible = true;
3340
+ }
3341
+ currentIndex += 2;
3342
+ frameFound = true;
3343
+ }
3344
+ }
3345
+ if (!frameFound) {
3346
+ showMessage("Invalid Frame/Body combination starting with '".concat(framePart, "'."));
3347
+ return;
3348
+ }
3349
+ for (let i = currentIndex; i < parts.length; i++) {
3350
+ if (parts[i] === "IFL") {
3351
+ newConfig.interiorFanlightVisible = true;
3352
+ } else if (parts[i] === "OCC") {
3353
+ newConfig.occulusVisible = true;
3354
+ }
3355
+ }
3356
+
3357
+ // Apply final configuration
3358
+ setFrameType(newConfig.frameType);
3359
+ setBodyType(newConfig.bodyType);
3360
+ setExteriorFanlight(prev => _objectSpread2(_objectSpread2({}, prev), {}, {
3361
+ visible: newConfig.fanlightVisible
3362
+ }));
3363
+ if (newConfig.fanlightVisible) {
3364
+ setExteriorFanlightType(newConfig.fanlightType);
3365
+ }
3366
+ setInteriorFanlight(prev => _objectSpread2(_objectSpread2({}, prev), {}, {
3367
+ visible: newConfig.interiorFanlightVisible
3368
+ }));
3369
+ setOcculus(prev => _objectSpread2(_objectSpread2({}, prev), {}, {
3370
+ visible: newConfig.occulusVisible
3371
+ }));
3372
+ showMessage("Configuration Applied!", "success");
3373
+ }, [setBodyType, setExteriorFanlight, setExteriorFanlightType, setFrameType, setInteriorFanlight, setOcculus]);
3374
+ const mainDoorHeight = door.doorHeight - (interiorFanlight.visible ? interiorFanlight.height : 0);
3375
+ const handleExteriorFanlightHeightChange = newHeight => {
3376
+ const oldHeight = exteriorFanlight.height;
3377
+ const heightDifference = newHeight - oldHeight;
3378
+ setExteriorFanlight(_objectSpread2(_objectSpread2({}, exteriorFanlight), {}, {
3379
+ height: newHeight
3380
+ }));
3381
+ setTotalHeight(totalHeight + heightDifference);
3382
+ };
3383
+ return /*#__PURE__*/jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
3384
+ children: [parseMessage.text && /*#__PURE__*/jsxRuntimeExports.jsx(material.Box, {
3385
+ sx: {
3386
+ position: "absolute",
3387
+ top: 20,
3388
+ left: "50%",
3389
+ transform: "translateX(-50%)",
3390
+ padding: "10px 20px",
3391
+ backgroundColor: parseMessage.type === "error" ? "rgba(211, 47, 47, 0.8)" : "rgba(46, 125, 50, 0.8)",
3392
+ backdropFilter: "blur(5px)",
3393
+ borderRadius: "10px",
3394
+ color: "white",
3395
+ zIndex: 20,
3396
+ textAlign: "center"
3397
+ },
3398
+ children: /*#__PURE__*/jsxRuntimeExports.jsx(material.Typography, {
3399
+ variant: "body1",
3400
+ children: parseMessage.text
3401
+ })
3402
+ }), /*#__PURE__*/jsxRuntimeExports.jsxs(material.Box, {
3403
+ sx: {
3404
+ position: "absolute",
3405
+ top: 20,
3406
+ left: 20,
3407
+ padding: "10px 15px",
3408
+ backgroundColor: "rgba(0, 0, 0, 0.6)",
3409
+ backdropFilter: "blur(10px)",
3410
+ borderRadius: "10px",
3411
+ color: "white",
3412
+ zIndex: 10
3413
+ },
3414
+ children: [/*#__PURE__*/jsxRuntimeExports.jsxs(material.Typography, {
3415
+ variant: "body1",
3416
+ children: ["Total Width: ", Math.round(totalWidth), " mm"]
3417
+ }), frontCoverPanel.visible && /*#__PURE__*/jsxRuntimeExports.jsxs(material.Typography, {
3418
+ variant: "body1",
3419
+ sx: {
3420
+ color: "#81d4fa"
3421
+ },
3422
+ children: ["Total Width with CAS:", " ", Math.round(totalWidth + frontCoverPanel.width * 2), " mm"]
3423
+ }), /*#__PURE__*/jsxRuntimeExports.jsxs(material.Typography, {
3424
+ variant: "body1",
3425
+ children: ["Total Height: ", Math.round(totalHeight), " mm"]
3426
+ }), /*#__PURE__*/jsxRuntimeExports.jsxs(material.Typography, {
3427
+ variant: "body1",
3428
+ children: ["Frame Depth: ", Math.round(doorFrame.frameDepth), " mm"]
3429
+ }), /*#__PURE__*/jsxRuntimeExports.jsxs(material.Typography, {
3430
+ variant: "body1",
3431
+ children: ["Door Depth: ", Math.round(door.theDoorDepth), " mm"]
3432
+ })]
3433
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(material.Box, {
3434
+ sx: {
3435
+ position: "absolute",
3436
+ top: 0,
3437
+ right: 0,
3438
+ height: "100vh",
3439
+ width: "25%",
3440
+ overflowY: "auto",
3441
+ boxSizing: "border-box",
3442
+ backgroundColor: "rgba(255, 255, 255, 0.95)",
3443
+ backdropFilter: "blur(10px)"
3444
+ },
3445
+ p: 2,
3446
+ children: /*#__PURE__*/jsxRuntimeExports.jsxs(material.Stack, {
3447
+ spacing: 2,
3448
+ children: [/*#__PURE__*/jsxRuntimeExports.jsxs(material.Paper, {
3449
+ elevation: 3,
3450
+ sx: {
3451
+ p: 2
3452
+ },
3453
+ children: [/*#__PURE__*/jsxRuntimeExports.jsxs(material.FormControl, {
3454
+ fullWidth: true,
3455
+ sx: {
3456
+ mb: 2
3457
+ },
3458
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx(material.FormLabel, {
3459
+ children: "Door Title (CPID)"
3460
+ }), /*#__PURE__*/jsxRuntimeExports.jsxs(material.Stack, {
3461
+ direction: "row",
3462
+ spacing: 1,
3463
+ alignItems: "center",
3464
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx(material.TextField, {
3465
+ value: cpid,
3466
+ onChange: e => {
3467
+ setCpid(e.target.value);
3468
+ },
3469
+ variant: "outlined",
3470
+ size: "small",
3471
+ fullWidth: true,
3472
+ placeholder: "e.g. P_SD_WPFL_AF20_50_IFL"
3473
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(material.Button, {
3474
+ variant: "contained",
3475
+ onClick: () => handleParseCpid(cpid),
3476
+ children: "Apply"
3477
+ })]
3478
+ })]
3479
+ }), /*#__PURE__*/jsxRuntimeExports.jsxs(material.FormControl, {
3480
+ fullWidth: true,
3481
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx(material.FormLabel, {
3482
+ children: "Or Select a Preset (Searchable)"
3483
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(material.Autocomplete, {
3484
+ value: cpid,
3485
+ onChange: (event, newValue) => {
3486
+ if (newValue) {
3487
+ setCpid(newValue);
3488
+ handleParseCpid(newValue);
3489
+ }
3490
+ },
3491
+ onInputChange: (event, newInputValue) => {
3492
+ setCpid(newInputValue);
3493
+ },
3494
+ options: cpidOptions,
3495
+ renderInput: params => /*#__PURE__*/jsxRuntimeExports.jsx(material.TextField, _objectSpread2(_objectSpread2({}, params), {}, {
3496
+ size: "small"
3497
+ })),
3498
+ ListboxProps: {
3499
+ style: {
3500
+ maxHeight: 300
3501
+ }
3502
+ },
3503
+ freeSolo: true,
3504
+ disableClearable: true
3505
+ })]
3506
+ })]
3507
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(material.Paper, {
3508
+ elevation: 3,
3509
+ sx: {
3510
+ p: 2
3511
+ },
3512
+ children: /*#__PURE__*/jsxRuntimeExports.jsxs(material.Stack, {
3513
+ direction: "row",
3514
+ spacing: 2,
3515
+ justifyContent: "center",
3516
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx(material.Button, {
3517
+ variant: "contained",
3518
+ color: "primary",
3519
+ onClick: handleExport,
3520
+ children: "Export JSON"
3521
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(material.Button, {
3522
+ variant: "contained",
3523
+ color: "secondary",
3524
+ onClick: handleImportClick,
3525
+ children: "Import JSON"
3526
+ }), /*#__PURE__*/jsxRuntimeExports.jsx("input", {
3527
+ type: "file",
3528
+ ref: fileInputRef,
3529
+ style: {
3530
+ display: "none"
3531
+ },
3532
+ accept: ".json",
3533
+ onChange: handleFileChange
3534
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(material.Tooltip, {
3535
+ title: isPlaneVisible ? "Hide Ground Plane" : "Show Ground Plane",
3536
+ children: /*#__PURE__*/jsxRuntimeExports.jsx(material.IconButton, {
3537
+ onClick: () => setIsPlaneVisible(!isPlaneVisible),
3538
+ children: isPlaneVisible ? /*#__PURE__*/jsxRuntimeExports.jsx(iconsMaterial.Visibility, {}) : /*#__PURE__*/jsxRuntimeExports.jsx(iconsMaterial.VisibilityOff, {})
3539
+ })
3540
+ })]
3541
+ })
3542
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(material.Paper, {
3543
+ elevation: 3,
3544
+ sx: {
3545
+ p: 2
3546
+ },
3547
+ children: /*#__PURE__*/jsxRuntimeExports.jsxs(material.Stack, {
3548
+ spacing: 2,
3549
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx(material.Typography, {
3550
+ variant: "h6",
3551
+ color: "primary",
3552
+ children: "Door Properties"
3553
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(material.Stack, {
3554
+ direction: "row",
3555
+ spacing: 2,
3556
+ alignItems: "flex-end",
3557
+ children: /*#__PURE__*/jsxRuntimeExports.jsx(MaterialInput, {
3558
+ label: "Door Material",
3559
+ value: door.doorMaterial,
3560
+ onChange: value => setDoor(_objectSpread2(_objectSpread2({}, door), {}, {
3561
+ doorMaterial: value
3562
+ })),
3563
+ onApply: handleMaterialApply
3564
+ })
3565
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(material.Stack, {
3566
+ direction: "row",
3567
+ spacing: 2,
3568
+ alignItems: "flex-end",
3569
+ children: /*#__PURE__*/jsxRuntimeExports.jsx(MaterialSelector, {
3570
+ label: "Test Material",
3571
+ value: testDoorMaterial,
3572
+ onChange: setTestDoorMaterial
3573
+ })
3574
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(material.Divider, {}), /*#__PURE__*/jsxRuntimeExports.jsxs(material.FormControl, {
3575
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx(material.FormLabel, {
3576
+ children: "Body Type"
3577
+ }), /*#__PURE__*/jsxRuntimeExports.jsxs(material.RadioGroup, {
3578
+ row: true,
3579
+ value: bodyType,
3580
+ onChange: (_, value) => setBodyType(value),
3581
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx(material.FormControlLabel, {
3582
+ value: "40",
3583
+ control: /*#__PURE__*/jsxRuntimeExports.jsx(material.Radio, {
3584
+ size: "small"
3585
+ }),
3586
+ label: "40mm"
3587
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(material.FormControlLabel, {
3588
+ value: "50",
3589
+ control: /*#__PURE__*/jsxRuntimeExports.jsx(material.Radio, {
3590
+ size: "small"
3591
+ }),
3592
+ label: "50mm"
3593
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(material.FormControlLabel, {
3594
+ value: "SG8",
3595
+ control: /*#__PURE__*/jsxRuntimeExports.jsx(material.Radio, {
3596
+ size: "small"
3597
+ }),
3598
+ label: "8mm Glass"
3599
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(material.FormControlLabel, {
3600
+ value: "SG10",
3601
+ control: /*#__PURE__*/jsxRuntimeExports.jsx(material.Radio, {
3602
+ size: "small"
3603
+ }),
3604
+ label: "10mm Glass"
3605
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(material.FormControlLabel, {
3606
+ value: "SG12",
3607
+ control: /*#__PURE__*/jsxRuntimeExports.jsx(material.Radio, {
3608
+ size: "small"
3609
+ }),
3610
+ label: "12mm Glass"
3611
+ })]
3612
+ })]
3613
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(material.Divider, {}), /*#__PURE__*/jsxRuntimeExports.jsx(EditableSlider, {
3614
+ label: "Total Width",
3615
+ value: totalWidth,
3616
+ min: 600,
3617
+ max: 2200,
3618
+ onChange: setTotalWidth
3619
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(material.FormControl, {
3620
+ fullWidth: true,
3621
+ children: /*#__PURE__*/jsxRuntimeExports.jsxs(material.FormLabel, {
3622
+ sx: {
3623
+ display: "flex",
3624
+ justifyContent: "space-between",
3625
+ alignItems: "center"
3626
+ },
3627
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx("span", {
3628
+ children: "Calculated Door Width"
3629
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(material.TextField, {
3630
+ value: Math.round(door.doorWidth),
3631
+ size: "small",
3632
+ disabled: true,
3633
+ variant: "outlined",
3634
+ InputProps: {
3635
+ endAdornment: /*#__PURE__*/jsxRuntimeExports.jsx(material.InputAdornment, {
3636
+ position: "end",
3637
+ children: "mm"
3638
+ })
3639
+ },
3640
+ sx: {
3641
+ width: "140px"
3642
+ }
3643
+ })]
3644
+ })
3645
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(EditableSlider, {
3646
+ label: "Total Height",
3647
+ value: totalHeight,
3648
+ min: 1500,
3649
+ max: 4000,
3650
+ onChange: setTotalHeight
3651
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(material.FormControl, {
3652
+ fullWidth: true,
3653
+ children: /*#__PURE__*/jsxRuntimeExports.jsxs(material.FormLabel, {
3654
+ sx: {
3655
+ display: "flex",
3656
+ justifyContent: "space-between",
3657
+ alignItems: "center"
3658
+ },
3659
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx("span", {
3660
+ children: "Calculated Door Height"
3661
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(material.TextField, {
3662
+ value: Math.round(door.doorHeight),
3663
+ size: "small",
3664
+ disabled: true,
3665
+ variant: "outlined",
3666
+ InputProps: {
3667
+ endAdornment: /*#__PURE__*/jsxRuntimeExports.jsx(material.InputAdornment, {
3668
+ position: "end",
3669
+ children: "mm"
3670
+ })
3671
+ },
3672
+ sx: {
3673
+ width: "140px"
3674
+ }
3675
+ })]
3676
+ })
3677
+ }), /*#__PURE__*/jsxRuntimeExports.jsxs(material.Stack, {
3678
+ direction: "row",
3679
+ justifyContent: "space-around",
3680
+ children: [/*#__PURE__*/jsxRuntimeExports.jsxs(material.FormControl, {
3681
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx(material.FormLabel, {
3682
+ children: "Pivot"
3683
+ }), /*#__PURE__*/jsxRuntimeExports.jsxs(material.RadioGroup, {
3684
+ row: true,
3685
+ value: door.doorPivot,
3686
+ onChange: (_, value) => setDoor(_objectSpread2(_objectSpread2({}, door), {}, {
3687
+ doorPivot: value
3688
+ })),
3689
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx(material.FormControlLabel, {
3690
+ value: "left",
3691
+ control: /*#__PURE__*/jsxRuntimeExports.jsx(material.Radio, {
3692
+ size: "small"
3693
+ }),
3694
+ label: "Left"
3695
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(material.FormControlLabel, {
3696
+ value: "right",
3697
+ control: /*#__PURE__*/jsxRuntimeExports.jsx(material.Radio, {
3698
+ size: "small"
3699
+ }),
3700
+ label: "Right"
3701
+ })]
3702
+ })]
3703
+ }), /*#__PURE__*/jsxRuntimeExports.jsxs(material.FormControl, {
3704
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx(material.FormLabel, {
3705
+ children: "Opening"
3706
+ }), /*#__PURE__*/jsxRuntimeExports.jsxs(material.RadioGroup, {
3707
+ row: true,
3708
+ value: door.doorOpening,
3709
+ onChange: (_, value) => setDoor(_objectSpread2(_objectSpread2({}, door), {}, {
3710
+ doorOpening: value
3711
+ })),
3712
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx(material.FormControlLabel, {
3713
+ value: "in",
3714
+ control: /*#__PURE__*/jsxRuntimeExports.jsx(material.Radio, {
3715
+ size: "small"
3716
+ }),
3717
+ label: "In"
3718
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(material.FormControlLabel, {
3719
+ value: "out",
3720
+ control: /*#__PURE__*/jsxRuntimeExports.jsx(material.Radio, {
3721
+ size: "small"
3722
+ }),
3723
+ label: "Out"
3724
+ })]
3725
+ })]
3726
+ })]
3727
+ })]
3728
+ })
3729
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(material.Paper, {
3730
+ elevation: 3,
3731
+ sx: {
3732
+ p: 2
3733
+ },
3734
+ children: /*#__PURE__*/jsxRuntimeExports.jsxs(material.Stack, {
3735
+ spacing: 2,
3736
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx(material.Typography, {
3737
+ variant: "h6",
3738
+ color: "primary",
3739
+ children: "Frame Properties"
3740
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(material.Stack, {
3741
+ direction: "row",
3742
+ spacing: 2,
3743
+ alignItems: "flex-end",
3744
+ children: /*#__PURE__*/jsxRuntimeExports.jsx(MaterialInput, {
3745
+ label: "Frame Material",
3746
+ value: doorFrame.frameMaterial,
3747
+ onChange: value => setDoorFrame(_objectSpread2(_objectSpread2({}, doorFrame), {}, {
3748
+ frameMaterial: value
3749
+ })),
3750
+ onApply: handleMaterialApply
3751
+ })
3752
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(MaterialSelector, {
3753
+ label: "Test Material",
3754
+ value: testFrameMaterial,
3755
+ onChange: setTestFrameMaterial
3756
+ }), /*#__PURE__*/jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
3757
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx(material.Divider, {}), /*#__PURE__*/jsxRuntimeExports.jsx(material.Typography, {
3758
+ variant: "subtitle1",
3759
+ color: "secondary",
3760
+ children: "Doorstop Properties"
3761
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(material.Stack, {
3762
+ direction: "row",
3763
+ spacing: 2,
3764
+ alignItems: "flex-end",
3765
+ children: /*#__PURE__*/jsxRuntimeExports.jsx(MaterialInput, {
3766
+ label: "Doorstop Material",
3767
+ value: doorFrame.doorStopMaterial || "",
3768
+ onChange: value => setDoorFrame(_objectSpread2(_objectSpread2({}, doorFrame), {}, {
3769
+ doorStopMaterial: value
3770
+ })),
3771
+ onApply: handleMaterialApply
3772
+ })
3773
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(MaterialSelector, {
3774
+ label: "Test Doorstop Material",
3775
+ value: testDoorStopMaterial,
3776
+ onChange: setTestDoorStopMaterial
3777
+ })]
3778
+ }), /*#__PURE__*/jsxRuntimeExports.jsxs(material.FormControl, {
3779
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx(material.FormLabel, {
3780
+ children: "Frame Type"
3781
+ }), /*#__PURE__*/jsxRuntimeExports.jsxs(material.RadioGroup, {
3782
+ value: frameType,
3783
+ onChange: (_, value) => setFrameType(value),
3784
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx(material.FormControlLabel, {
3785
+ value: "NOF",
3786
+ control: /*#__PURE__*/jsxRuntimeExports.jsx(material.Radio, {
3787
+ size: "small"
3788
+ }),
3789
+ label: "NOF"
3790
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(material.FormControlLabel, {
3791
+ value: "AF20_40",
3792
+ control: /*#__PURE__*/jsxRuntimeExports.jsx(material.Radio, {
3793
+ size: "small"
3794
+ }),
3795
+ label: "AF20_40"
3796
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(material.FormControlLabel, {
3797
+ value: "AF20_50",
3798
+ control: /*#__PURE__*/jsxRuntimeExports.jsx(material.Radio, {
3799
+ size: "small"
3800
+ }),
3801
+ label: "AF20_50"
3802
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(material.FormControlLabel, {
3803
+ value: "AF40_40",
3804
+ control: /*#__PURE__*/jsxRuntimeExports.jsx(material.Radio, {
3805
+ size: "small"
3806
+ }),
3807
+ label: "AF40_40"
3808
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(material.FormControlLabel, {
3809
+ value: "AF40_50",
3810
+ control: /*#__PURE__*/jsxRuntimeExports.jsx(material.Radio, {
3811
+ size: "small"
3812
+ }),
3813
+ label: "AF40_50"
3814
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(material.FormControlLabel, {
3815
+ value: "WF_40",
3816
+ control: /*#__PURE__*/jsxRuntimeExports.jsx(material.Radio, {
3817
+ size: "small"
3818
+ }),
3819
+ label: "WF_40"
3820
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(material.FormControlLabel, {
3821
+ value: "WF_50",
3822
+ control: /*#__PURE__*/jsxRuntimeExports.jsx(material.Radio, {
3823
+ size: "small"
3824
+ }),
3825
+ label: "WF_50"
3826
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(material.FormControlLabel, {
3827
+ value: "WF_100",
3828
+ control: /*#__PURE__*/jsxRuntimeExports.jsx(material.Radio, {
3829
+ size: "small"
3830
+ }),
3831
+ label: "WF_100"
3832
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(material.FormControlLabel, {
3833
+ value: "WF_FLI",
3834
+ control: /*#__PURE__*/jsxRuntimeExports.jsx(material.Radio, {
3835
+ size: "small"
3836
+ }),
3837
+ label: "WF_FLI"
3838
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(material.FormControlLabel, {
3839
+ value: "WDGF_WDG100",
3840
+ control: /*#__PURE__*/jsxRuntimeExports.jsx(material.Radio, {
3841
+ size: "small"
3842
+ }),
3843
+ label: "WDGF_WDG100"
3844
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(material.FormControlLabel, {
3845
+ value: "MXF_40",
3846
+ control: /*#__PURE__*/jsxRuntimeExports.jsx(material.Radio, {
3847
+ size: "small"
3848
+ }),
3849
+ label: "MXF_40"
3850
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(material.FormControlLabel, {
3851
+ value: "MXF_50",
3852
+ control: /*#__PURE__*/jsxRuntimeExports.jsx(material.Radio, {
3853
+ size: "small"
3854
+ }),
3855
+ label: "MXF_50"
3856
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(material.FormControlLabel, {
3857
+ value: "MXCAF_40",
3858
+ control: /*#__PURE__*/jsxRuntimeExports.jsx(material.Radio, {
3859
+ size: "small"
3860
+ }),
3861
+ label: "MXCAF_40"
3862
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(material.FormControlLabel, {
3863
+ value: "MXCAF_50",
3864
+ control: /*#__PURE__*/jsxRuntimeExports.jsx(material.Radio, {
3865
+ size: "small"
3866
+ }),
3867
+ label: "MXCAF_50"
3868
+ })]
3869
+ })]
3870
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(material.Divider, {}), /*#__PURE__*/jsxRuntimeExports.jsx(material.Typography, {
3871
+ variant: "subtitle1",
3872
+ color: "secondary",
3873
+ children: "Gasket Properties"
3874
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(material.Stack, {
3875
+ direction: "row",
3876
+ spacing: 2,
3877
+ alignItems: "flex-end",
3878
+ children: /*#__PURE__*/jsxRuntimeExports.jsx(MaterialInput, {
3879
+ label: "Gasket Material",
3880
+ value: doorFrame.gasketMaterial,
3881
+ onChange: value => setDoorFrame(_objectSpread2(_objectSpread2({}, doorFrame), {}, {
3882
+ gasketMaterial: value
3883
+ })),
3884
+ onApply: handleMaterialApply
3885
+ })
3886
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(MaterialSelector, {
3887
+ label: "Test Gasket Material",
3888
+ value: testGasketMaterial,
3889
+ onChange: setTestGasketMaterial
3890
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(material.Divider, {}), /*#__PURE__*/jsxRuntimeExports.jsx(material.Typography, {
3891
+ variant: "subtitle1",
3892
+ color: "secondary",
3893
+ children: "Hinge Properties"
3894
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(material.Stack, {
3895
+ direction: "row",
3896
+ spacing: 2,
3897
+ alignItems: "flex-end",
3898
+ children: /*#__PURE__*/jsxRuntimeExports.jsx(MaterialInput, {
3899
+ label: "Hinge Material",
3900
+ value: doorFrame.hingeMaterial,
3901
+ onChange: value => setDoorFrame(_objectSpread2(_objectSpread2({}, doorFrame), {}, {
3902
+ hingeMaterial: value
3903
+ })),
3904
+ onApply: handleMaterialApply
3905
+ })
3906
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(MaterialSelector, {
3907
+ label: "Test Hinge Material",
3908
+ value: testHingeMaterial,
3909
+ onChange: setTestHingeMaterial
3910
+ })]
3911
+ })
3912
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(material.Paper, {
3913
+ elevation: 3,
3914
+ sx: {
3915
+ p: 2
3916
+ },
3917
+ children: /*#__PURE__*/jsxRuntimeExports.jsxs(material.Stack, {
3918
+ spacing: 2,
3919
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx(material.FormControlLabel, {
3920
+ control: /*#__PURE__*/jsxRuntimeExports.jsx(material.Switch, {
3921
+ checked: frontCoverPanel.visible,
3922
+ onChange: e => {
3923
+ const isVisible = e.target.checked;
3924
+ setFrontCoverPanel(prev => _objectSpread2(_objectSpread2({}, prev), {}, {
3925
+ visible: isVisible
3926
+ }));
3927
+ setBackCoverPanel(prev => _objectSpread2(_objectSpread2({}, prev), {}, {
3928
+ visible: isVisible
3929
+ }));
3930
+ }
3931
+ }),
3932
+ label: /*#__PURE__*/jsxRuntimeExports.jsx(material.Typography, {
3933
+ variant: "h6",
3934
+ color: "primary",
3935
+ children: "CAS Properties"
3936
+ })
3937
+ }), frontCoverPanel.visible && /*#__PURE__*/jsxRuntimeExports.jsx(material.Paper, {
3938
+ variant: "outlined",
3939
+ sx: {
3940
+ p: 2,
3941
+ mt: 1
3942
+ },
3943
+ children: /*#__PURE__*/jsxRuntimeExports.jsxs(material.Stack, {
3944
+ spacing: 2,
3945
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx(MaterialInput, {
3946
+ label: "Material",
3947
+ value: frontCoverPanel.material,
3948
+ onChange: value => {
3949
+ setFrontCoverPanel(prev => _objectSpread2(_objectSpread2({}, prev), {}, {
3950
+ material: value
3951
+ }));
3952
+ setBackCoverPanel(prev => _objectSpread2(_objectSpread2({}, prev), {}, {
3953
+ material: value
3954
+ }));
3955
+ },
3956
+ onApply: handleMaterialApply
3957
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(MaterialSelector, {
3958
+ label: "Test Material",
3959
+ value: testFrontCoverPanelMaterial,
3960
+ onChange: value => {
3961
+ setTestFrontCoverPanelMaterial(value);
3962
+ setTestBackCoverPanelMaterial(value);
3963
+ }
3964
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(EditableSlider, {
3965
+ label: "Profile Width",
3966
+ value: frontCoverPanel.width,
3967
+ min: 20,
3968
+ max: 500,
3969
+ onChange: value => {
3970
+ setFrontCoverPanel(prev => _objectSpread2(_objectSpread2({}, prev), {}, {
3971
+ width: value
3972
+ }));
3973
+ setBackCoverPanel(prev => _objectSpread2(_objectSpread2({}, prev), {}, {
3974
+ width: value
3975
+ }));
3976
+ }
3977
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(EditableSlider, {
3978
+ label: "Depth (from frame)",
3979
+ value: frontCoverPanel.depth,
3980
+ min: 5,
3981
+ max: 100,
3982
+ onChange: value => {
3983
+ setFrontCoverPanel(prev => _objectSpread2(_objectSpread2({}, prev), {}, {
3984
+ depth: value
3985
+ }));
3986
+ setBackCoverPanel(prev => _objectSpread2(_objectSpread2({}, prev), {}, {
3987
+ depth: value
3988
+ }));
3989
+ }
3990
+ })]
3991
+ })
3992
+ })]
3993
+ })
3994
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(material.Paper, {
3995
+ elevation: 3,
3996
+ sx: {
3997
+ p: 2
3998
+ },
3999
+ children: /*#__PURE__*/jsxRuntimeExports.jsxs(material.Stack, {
4000
+ spacing: 2,
4001
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx(material.FormControlLabel, {
4002
+ control: /*#__PURE__*/jsxRuntimeExports.jsx(material.Switch, {
4003
+ checked: interiorFanlight.visible,
4004
+ onChange: e => {
4005
+ setInteriorFanlight(_objectSpread2(_objectSpread2({}, interiorFanlight), {}, {
4006
+ visible: e.target.checked
4007
+ }));
4008
+ }
4009
+ }),
4010
+ label: /*#__PURE__*/jsxRuntimeExports.jsx(material.Typography, {
4011
+ variant: "h6",
4012
+ color: "primary",
4013
+ children: "Interior Fanlight"
4014
+ })
4015
+ }), interiorFanlight.visible && /*#__PURE__*/jsxRuntimeExports.jsx(material.Paper, {
4016
+ variant: "outlined",
4017
+ sx: {
4018
+ p: 2,
4019
+ mt: 1
4020
+ },
4021
+ children: /*#__PURE__*/jsxRuntimeExports.jsxs(material.Stack, {
4022
+ spacing: 2,
4023
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx(material.Stack, {
4024
+ direction: "row",
4025
+ spacing: 2,
4026
+ alignItems: "flex-end",
4027
+ children: /*#__PURE__*/jsxRuntimeExports.jsx(MaterialInput, {
4028
+ label: "Material",
4029
+ value: interiorFanlight.material,
4030
+ onChange: value => setInteriorFanlight(_objectSpread2(_objectSpread2({}, interiorFanlight), {}, {
4031
+ material: value
4032
+ })),
4033
+ onApply: handleMaterialApply
4034
+ })
4035
+ }), " ", /*#__PURE__*/jsxRuntimeExports.jsx(MaterialSelector, {
4036
+ label: "Test Material",
4037
+ value: testInteriorFanlightMaterial,
4038
+ onChange: setTestInteriorFanlightMaterial
4039
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(EditableSlider, {
4040
+ label: "Height",
4041
+ value: interiorFanlight.height,
4042
+ min: 100,
4043
+ max: door.doorHeight - 1500 > 100 ? door.doorHeight - 1500 : 100,
4044
+ onChange: value => setInteriorFanlight(_objectSpread2(_objectSpread2({}, interiorFanlight), {}, {
4045
+ height: value
4046
+ }))
4047
+ })]
4048
+ })
4049
+ })]
4050
+ })
4051
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(material.Paper, {
4052
+ elevation: 3,
4053
+ sx: {
4054
+ p: 2
4055
+ },
4056
+ children: /*#__PURE__*/jsxRuntimeExports.jsxs(material.Stack, {
4057
+ spacing: 2,
4058
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx(material.FormControlLabel, {
4059
+ control: /*#__PURE__*/jsxRuntimeExports.jsx(material.Switch, {
4060
+ checked: exteriorFanlight.visible,
4061
+ onChange: e => setExteriorFanlight(_objectSpread2(_objectSpread2({}, exteriorFanlight), {}, {
4062
+ visible: e.target.checked
4063
+ }))
4064
+ }),
4065
+ label: /*#__PURE__*/jsxRuntimeExports.jsx(material.Typography, {
4066
+ variant: "h6",
4067
+ color: "primary",
4068
+ children: "Exterior Fanlight"
4069
+ })
4070
+ }), exteriorFanlight.visible && /*#__PURE__*/jsxRuntimeExports.jsx(material.Paper, {
4071
+ variant: "outlined",
4072
+ sx: {
4073
+ p: 2,
4074
+ mt: 1
4075
+ },
4076
+ children: /*#__PURE__*/jsxRuntimeExports.jsxs(material.Stack, {
4077
+ spacing: 2,
4078
+ children: [/*#__PURE__*/jsxRuntimeExports.jsxs(material.FormControl, {
4079
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx(material.FormLabel, {
4080
+ children: "Type"
4081
+ }), /*#__PURE__*/jsxRuntimeExports.jsxs(material.RadioGroup, {
4082
+ row: true,
4083
+ value: exteriorFanlightType,
4084
+ onChange: e => setExteriorFanlightType(e.target.value),
4085
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx(material.FormControlLabel, {
4086
+ value: "WPFL",
4087
+ control: /*#__PURE__*/jsxRuntimeExports.jsx(material.Radio, {
4088
+ size: "small"
4089
+ }),
4090
+ label: "WPFL"
4091
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(material.FormControlLabel, {
4092
+ value: "ALDGFL",
4093
+ control: /*#__PURE__*/jsxRuntimeExports.jsx(material.Radio, {
4094
+ size: "small"
4095
+ }),
4096
+ label: "ALDGFL"
4097
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(material.FormControlLabel, {
4098
+ value: "ALSGFL",
4099
+ control: /*#__PURE__*/jsxRuntimeExports.jsx(material.Radio, {
4100
+ size: "small"
4101
+ }),
4102
+ label: "ALSGFL"
4103
+ })]
4104
+ })]
4105
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(MaterialInput, {
4106
+ label: "Material",
4107
+ value: exteriorFanlight.material,
4108
+ onChange: value => setExteriorFanlight(_objectSpread2(_objectSpread2({}, exteriorFanlight), {}, {
4109
+ material: value
4110
+ })),
4111
+ onApply: handleMaterialApply
4112
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(MaterialSelector, {
4113
+ label: "Test Material",
4114
+ value: testExteriorFanlightMaterial,
4115
+ onChange: setTestExteriorFanlightMaterial
4116
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(EditableSlider, {
4117
+ label: "Height",
4118
+ value: exteriorFanlight.height,
4119
+ min: 100,
4120
+ max: 1000,
4121
+ onChange: handleExteriorFanlightHeightChange
4122
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(EditableSlider, {
4123
+ label: "Depth",
4124
+ value: exteriorFanlight.depth,
4125
+ min: 40,
4126
+ max: doorFrame.frameDepth,
4127
+ onChange: value => setExteriorFanlight(_objectSpread2(_objectSpread2({}, exteriorFanlight), {}, {
4128
+ depth: value
4129
+ }))
4130
+ })]
4131
+ })
4132
+ })]
4133
+ })
4134
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(material.Paper, {
4135
+ elevation: 3,
4136
+ sx: {
4137
+ p: 2
4138
+ },
4139
+ children: /*#__PURE__*/jsxRuntimeExports.jsxs(material.Stack, {
4140
+ spacing: 2,
4141
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx(material.FormControlLabel, {
4142
+ control: /*#__PURE__*/jsxRuntimeExports.jsx(material.Switch, {
4143
+ checked: occulus.visible,
4144
+ onChange: e => setOcculus(_objectSpread2(_objectSpread2({}, occulus), {}, {
4145
+ visible: e.target.checked
4146
+ }))
4147
+ }),
4148
+ label: /*#__PURE__*/jsxRuntimeExports.jsx(material.Typography, {
4149
+ variant: "h6",
4150
+ color: "primary",
4151
+ children: "Occulus"
4152
+ })
4153
+ }), occulus.visible && /*#__PURE__*/jsxRuntimeExports.jsx(material.Paper, {
4154
+ variant: "outlined",
4155
+ sx: {
4156
+ p: 2,
4157
+ mt: 1
4158
+ },
4159
+ children: /*#__PURE__*/jsxRuntimeExports.jsxs(material.Stack, {
4160
+ spacing: 2,
4161
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx(EditableSlider, {
4162
+ label: "Offset from Left (x1)",
4163
+ value: occulus.x1,
4164
+ min: 50,
4165
+ max: door.doorWidth - occulus.x2 - 50,
4166
+ onChange: value => setOcculus(_objectSpread2(_objectSpread2({}, occulus), {}, {
4167
+ x1: value
4168
+ }))
4169
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(EditableSlider, {
4170
+ label: "Offset from Right (x2)",
4171
+ value: occulus.x2,
4172
+ min: 50,
4173
+ max: door.doorWidth - occulus.x1 - 50,
4174
+ onChange: value => setOcculus(_objectSpread2(_objectSpread2({}, occulus), {}, {
4175
+ x2: value
4176
+ }))
4177
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(EditableSlider, {
4178
+ label: "Offset from Top (y1)",
4179
+ value: occulus.y1,
4180
+ min: 50,
4181
+ max: mainDoorHeight - occulus.y2 - 50,
4182
+ onChange: value => setOcculus(_objectSpread2(_objectSpread2({}, occulus), {}, {
4183
+ y1: value
4184
+ }))
4185
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(EditableSlider, {
4186
+ label: "Offset from Bottom (y2)",
4187
+ value: occulus.y2,
4188
+ min: 50,
4189
+ max: mainDoorHeight - occulus.y1 - 50,
4190
+ onChange: value => setOcculus(_objectSpread2(_objectSpread2({}, occulus), {}, {
4191
+ y2: value
4192
+ }))
4193
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(material.Divider, {}), /*#__PURE__*/jsxRuntimeExports.jsx(material.Paper, {
4194
+ variant: "outlined",
4195
+ sx: {
4196
+ p: 2,
4197
+ mt: 1
4198
+ },
4199
+ children: /*#__PURE__*/jsxRuntimeExports.jsxs(material.Stack, {
4200
+ spacing: 2,
4201
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx(material.FormControlLabel, {
4202
+ control: /*#__PURE__*/jsxRuntimeExports.jsx(material.Switch, {
4203
+ checked: occulus.infillVisible,
4204
+ onChange: e => setOcculus(_objectSpread2(_objectSpread2({}, occulus), {}, {
4205
+ infillVisible: e.target.checked
4206
+ }))
4207
+ }),
4208
+ label: "Show Infill"
4209
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(material.Stack, {
4210
+ direction: "row",
4211
+ spacing: 2,
4212
+ alignItems: "flex-end",
4213
+ children: /*#__PURE__*/jsxRuntimeExports.jsx(MaterialInput, {
4214
+ label: "Infill Material",
4215
+ value: occulus.material,
4216
+ onChange: value => setOcculus(_objectSpread2(_objectSpread2({}, occulus), {}, {
4217
+ material: value
4218
+ })),
4219
+ onApply: handleMaterialApply
4220
+ })
4221
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(MaterialSelector, {
4222
+ label: "Test Material",
4223
+ value: testOcculusInfillMaterial,
4224
+ onChange: setTestOcculusInfillMaterial
4225
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(EditableSlider, {
4226
+ label: "Infill Depth",
4227
+ value: occulus.depth,
4228
+ min: 10,
4229
+ max: door.theDoorDepth,
4230
+ onChange: value => setOcculus(_objectSpread2(_objectSpread2({}, occulus), {}, {
4231
+ depth: value
4232
+ }))
4233
+ })]
4234
+ })
4235
+ })]
4236
+ })
4237
+ })]
4238
+ })
4239
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(material.Paper, {
4240
+ elevation: 3,
4241
+ sx: {
4242
+ p: 2
4243
+ },
4244
+ children: /*#__PURE__*/jsxRuntimeExports.jsxs(material.Stack, {
4245
+ spacing: 2,
4246
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx(material.FormControlLabel, {
4247
+ control: /*#__PURE__*/jsxRuntimeExports.jsx(material.Switch, {
4248
+ checked: glassVisible,
4249
+ onChange: e => setGlassVisible(e.target.checked)
4250
+ }),
4251
+ label: /*#__PURE__*/jsxRuntimeExports.jsx(material.Typography, {
4252
+ variant: "h6",
4253
+ color: "primary",
4254
+ children: "Glass"
4255
+ })
4256
+ }), glassVisible && /*#__PURE__*/jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
4257
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx(MaterialInput, {
4258
+ label: "Glass Material",
4259
+ value: doorFrame.glassMaterial || "",
4260
+ onChange: value => setDoorFrame(_objectSpread2(_objectSpread2({}, doorFrame), {}, {
4261
+ glassMaterial: value
4262
+ })),
4263
+ onApply: handleMaterialApply
4264
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(MaterialSelector, {
4265
+ label: "Test Glass Material",
4266
+ value: testGlassInfillMaterial,
4267
+ onChange: setTestGlassInfillMaterial
4268
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(EditableSlider, {
4269
+ label: "Glass Depth",
4270
+ value: glassDepth,
4271
+ min: 4,
4272
+ max: 20,
4273
+ step: 0.5,
4274
+ onChange: setGlassDepth
4275
+ })]
4276
+ })]
4277
+ })
4278
+ })]
4279
+ })
4280
+ })]
4281
+ });
4282
+ };
4283
+
4284
+ exports.ConfiguratorProvider = ConfiguratorProvider;
4285
+ exports.DoorModels = DoorModels;
4286
+ exports.Interface = Interface;
4287
+ exports.useConfigurator = useConfigurator;
4288
+ //# sourceMappingURL=index.cjs.js.map