door_models 3.0.6 → 3.0.7
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.
- package/dist/index.cjs.js +209 -1592
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +148 -1528
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var react = require('react');
|
|
6
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
7
|
var csg = require('@react-three/csg');
|
|
7
8
|
var three = require('@react-spring/three');
|
|
8
9
|
var THREE = require('three');
|
|
9
10
|
|
|
10
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
11
|
-
|
|
12
11
|
function _interopNamespace(e) {
|
|
13
12
|
if (e && e.__esModule) return e;
|
|
14
13
|
var n = Object.create(null);
|
|
@@ -27,7 +26,6 @@ function _interopNamespace(e) {
|
|
|
27
26
|
return Object.freeze(n);
|
|
28
27
|
}
|
|
29
28
|
|
|
30
|
-
var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0);
|
|
31
29
|
var THREE__namespace = /*#__PURE__*/_interopNamespace(THREE);
|
|
32
30
|
|
|
33
31
|
function _defineProperty(e, r, t) {
|
|
@@ -94,1401 +92,20 @@ function _toPropertyKey(t) {
|
|
|
94
92
|
return "symbol" == typeof i ? i : i + "";
|
|
95
93
|
}
|
|
96
94
|
|
|
97
|
-
var jsxRuntime = {exports: {}};
|
|
98
|
-
|
|
99
|
-
var reactJsxRuntime_production_min = {};
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* @license React
|
|
103
|
-
* react-jsx-runtime.production.min.js
|
|
104
|
-
*
|
|
105
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
106
|
-
*
|
|
107
|
-
* This source code is licensed under the MIT license found in the
|
|
108
|
-
* LICENSE file in the root directory of this source tree.
|
|
109
|
-
*/
|
|
110
|
-
|
|
111
|
-
var hasRequiredReactJsxRuntime_production_min;
|
|
112
|
-
|
|
113
|
-
function requireReactJsxRuntime_production_min () {
|
|
114
|
-
if (hasRequiredReactJsxRuntime_production_min) return reactJsxRuntime_production_min;
|
|
115
|
-
hasRequiredReactJsxRuntime_production_min = 1;
|
|
116
|
-
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};
|
|
117
|
-
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;
|
|
118
|
-
return reactJsxRuntime_production_min;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
var reactJsxRuntime_development = {};
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* @license React
|
|
125
|
-
* react-jsx-runtime.development.js
|
|
126
|
-
*
|
|
127
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
128
|
-
*
|
|
129
|
-
* This source code is licensed under the MIT license found in the
|
|
130
|
-
* LICENSE file in the root directory of this source tree.
|
|
131
|
-
*/
|
|
132
|
-
|
|
133
|
-
var hasRequiredReactJsxRuntime_development;
|
|
134
|
-
|
|
135
|
-
function requireReactJsxRuntime_development () {
|
|
136
|
-
if (hasRequiredReactJsxRuntime_development) return reactJsxRuntime_development;
|
|
137
|
-
hasRequiredReactJsxRuntime_development = 1;
|
|
138
|
-
|
|
139
|
-
if (process.env.NODE_ENV !== "production") {
|
|
140
|
-
(function() {
|
|
141
|
-
|
|
142
|
-
var React = require$$0__default["default"];
|
|
143
|
-
|
|
144
|
-
// ATTENTION
|
|
145
|
-
// When adding new symbols to this file,
|
|
146
|
-
// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
|
|
147
|
-
// The Symbol used to tag the ReactElement-like types.
|
|
148
|
-
var REACT_ELEMENT_TYPE = Symbol.for('react.element');
|
|
149
|
-
var REACT_PORTAL_TYPE = Symbol.for('react.portal');
|
|
150
|
-
var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
|
|
151
|
-
var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');
|
|
152
|
-
var REACT_PROFILER_TYPE = Symbol.for('react.profiler');
|
|
153
|
-
var REACT_PROVIDER_TYPE = Symbol.for('react.provider');
|
|
154
|
-
var REACT_CONTEXT_TYPE = Symbol.for('react.context');
|
|
155
|
-
var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
|
|
156
|
-
var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
|
|
157
|
-
var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');
|
|
158
|
-
var REACT_MEMO_TYPE = Symbol.for('react.memo');
|
|
159
|
-
var REACT_LAZY_TYPE = Symbol.for('react.lazy');
|
|
160
|
-
var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
|
|
161
|
-
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
|
162
|
-
var FAUX_ITERATOR_SYMBOL = '@@iterator';
|
|
163
|
-
function getIteratorFn(maybeIterable) {
|
|
164
|
-
if (maybeIterable === null || typeof maybeIterable !== 'object') {
|
|
165
|
-
return null;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
|
|
169
|
-
|
|
170
|
-
if (typeof maybeIterator === 'function') {
|
|
171
|
-
return maybeIterator;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
return null;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
178
|
-
|
|
179
|
-
function error(format) {
|
|
180
|
-
{
|
|
181
|
-
{
|
|
182
|
-
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
183
|
-
args[_key2 - 1] = arguments[_key2];
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
printWarning('error', format, args);
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
function printWarning(level, format, args) {
|
|
192
|
-
// When changing this logic, you might want to also
|
|
193
|
-
// update consoleWithStackDev.www.js as well.
|
|
194
|
-
{
|
|
195
|
-
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
196
|
-
var stack = ReactDebugCurrentFrame.getStackAddendum();
|
|
197
|
-
|
|
198
|
-
if (stack !== '') {
|
|
199
|
-
format += '%s';
|
|
200
|
-
args = args.concat([stack]);
|
|
201
|
-
} // eslint-disable-next-line react-internal/safe-string-coercion
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
var argsWithFormat = args.map(function (item) {
|
|
205
|
-
return String(item);
|
|
206
|
-
}); // Careful: RN currently depends on this prefix
|
|
207
|
-
|
|
208
|
-
argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
|
|
209
|
-
// breaks IE9: https://github.com/facebook/react/issues/13610
|
|
210
|
-
// eslint-disable-next-line react-internal/no-production-logging
|
|
211
|
-
|
|
212
|
-
Function.prototype.apply.call(console[level], console, argsWithFormat);
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
// -----------------------------------------------------------------------------
|
|
217
|
-
|
|
218
|
-
var enableScopeAPI = false; // Experimental Create Event Handle API.
|
|
219
|
-
var enableCacheElement = false;
|
|
220
|
-
var enableTransitionTracing = false; // No known bugs, but needs performance testing
|
|
221
|
-
|
|
222
|
-
var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber
|
|
223
|
-
// stuff. Intended to enable React core members to more easily debug scheduling
|
|
224
|
-
// issues in DEV builds.
|
|
225
|
-
|
|
226
|
-
var enableDebugTracing = false; // Track which Fiber(s) schedule render work.
|
|
227
|
-
|
|
228
|
-
var REACT_MODULE_REFERENCE;
|
|
229
|
-
|
|
230
|
-
{
|
|
231
|
-
REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
function isValidElementType(type) {
|
|
235
|
-
if (typeof type === 'string' || typeof type === 'function') {
|
|
236
|
-
return true;
|
|
237
|
-
} // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
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 ) {
|
|
241
|
-
return true;
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
if (typeof type === 'object' && type !== null) {
|
|
245
|
-
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
|
|
246
|
-
// types supported by any Flight configuration anywhere since
|
|
247
|
-
// we don't know which Flight build this will end up being used
|
|
248
|
-
// with.
|
|
249
|
-
type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {
|
|
250
|
-
return true;
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
return false;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
function getWrappedName(outerType, innerType, wrapperName) {
|
|
258
|
-
var displayName = outerType.displayName;
|
|
259
|
-
|
|
260
|
-
if (displayName) {
|
|
261
|
-
return displayName;
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
var functionName = innerType.displayName || innerType.name || '';
|
|
265
|
-
return functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName;
|
|
266
|
-
} // Keep in sync with react-reconciler/getComponentNameFromFiber
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
function getContextName(type) {
|
|
270
|
-
return type.displayName || 'Context';
|
|
271
|
-
} // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
function getComponentNameFromType(type) {
|
|
275
|
-
if (type == null) {
|
|
276
|
-
// Host root, text node or just invalid type.
|
|
277
|
-
return null;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
{
|
|
281
|
-
if (typeof type.tag === 'number') {
|
|
282
|
-
error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
if (typeof type === 'function') {
|
|
287
|
-
return type.displayName || type.name || null;
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
if (typeof type === 'string') {
|
|
291
|
-
return type;
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
switch (type) {
|
|
295
|
-
case REACT_FRAGMENT_TYPE:
|
|
296
|
-
return 'Fragment';
|
|
297
|
-
|
|
298
|
-
case REACT_PORTAL_TYPE:
|
|
299
|
-
return 'Portal';
|
|
300
|
-
|
|
301
|
-
case REACT_PROFILER_TYPE:
|
|
302
|
-
return 'Profiler';
|
|
303
|
-
|
|
304
|
-
case REACT_STRICT_MODE_TYPE:
|
|
305
|
-
return 'StrictMode';
|
|
306
|
-
|
|
307
|
-
case REACT_SUSPENSE_TYPE:
|
|
308
|
-
return 'Suspense';
|
|
309
|
-
|
|
310
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
|
311
|
-
return 'SuspenseList';
|
|
312
|
-
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
if (typeof type === 'object') {
|
|
316
|
-
switch (type.$$typeof) {
|
|
317
|
-
case REACT_CONTEXT_TYPE:
|
|
318
|
-
var context = type;
|
|
319
|
-
return getContextName(context) + '.Consumer';
|
|
320
|
-
|
|
321
|
-
case REACT_PROVIDER_TYPE:
|
|
322
|
-
var provider = type;
|
|
323
|
-
return getContextName(provider._context) + '.Provider';
|
|
324
|
-
|
|
325
|
-
case REACT_FORWARD_REF_TYPE:
|
|
326
|
-
return getWrappedName(type, type.render, 'ForwardRef');
|
|
327
|
-
|
|
328
|
-
case REACT_MEMO_TYPE:
|
|
329
|
-
var outerName = type.displayName || null;
|
|
330
|
-
|
|
331
|
-
if (outerName !== null) {
|
|
332
|
-
return outerName;
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
return getComponentNameFromType(type.type) || 'Memo';
|
|
336
|
-
|
|
337
|
-
case REACT_LAZY_TYPE:
|
|
338
|
-
{
|
|
339
|
-
var lazyComponent = type;
|
|
340
|
-
var payload = lazyComponent._payload;
|
|
341
|
-
var init = lazyComponent._init;
|
|
342
|
-
|
|
343
|
-
try {
|
|
344
|
-
return getComponentNameFromType(init(payload));
|
|
345
|
-
} catch (x) {
|
|
346
|
-
return null;
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
// eslint-disable-next-line no-fallthrough
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
return null;
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
var assign = Object.assign;
|
|
358
|
-
|
|
359
|
-
// Helpers to patch console.logs to avoid logging during side-effect free
|
|
360
|
-
// replaying on render function. This currently only patches the object
|
|
361
|
-
// lazily which won't cover if the log function was extracted eagerly.
|
|
362
|
-
// We could also eagerly patch the method.
|
|
363
|
-
var disabledDepth = 0;
|
|
364
|
-
var prevLog;
|
|
365
|
-
var prevInfo;
|
|
366
|
-
var prevWarn;
|
|
367
|
-
var prevError;
|
|
368
|
-
var prevGroup;
|
|
369
|
-
var prevGroupCollapsed;
|
|
370
|
-
var prevGroupEnd;
|
|
371
|
-
|
|
372
|
-
function disabledLog() {}
|
|
373
|
-
|
|
374
|
-
disabledLog.__reactDisabledLog = true;
|
|
375
|
-
function disableLogs() {
|
|
376
|
-
{
|
|
377
|
-
if (disabledDepth === 0) {
|
|
378
|
-
/* eslint-disable react-internal/no-production-logging */
|
|
379
|
-
prevLog = console.log;
|
|
380
|
-
prevInfo = console.info;
|
|
381
|
-
prevWarn = console.warn;
|
|
382
|
-
prevError = console.error;
|
|
383
|
-
prevGroup = console.group;
|
|
384
|
-
prevGroupCollapsed = console.groupCollapsed;
|
|
385
|
-
prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099
|
|
386
|
-
|
|
387
|
-
var props = {
|
|
388
|
-
configurable: true,
|
|
389
|
-
enumerable: true,
|
|
390
|
-
value: disabledLog,
|
|
391
|
-
writable: true
|
|
392
|
-
}; // $FlowFixMe Flow thinks console is immutable.
|
|
393
|
-
|
|
394
|
-
Object.defineProperties(console, {
|
|
395
|
-
info: props,
|
|
396
|
-
log: props,
|
|
397
|
-
warn: props,
|
|
398
|
-
error: props,
|
|
399
|
-
group: props,
|
|
400
|
-
groupCollapsed: props,
|
|
401
|
-
groupEnd: props
|
|
402
|
-
});
|
|
403
|
-
/* eslint-enable react-internal/no-production-logging */
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
disabledDepth++;
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
function reenableLogs() {
|
|
410
|
-
{
|
|
411
|
-
disabledDepth--;
|
|
412
|
-
|
|
413
|
-
if (disabledDepth === 0) {
|
|
414
|
-
/* eslint-disable react-internal/no-production-logging */
|
|
415
|
-
var props = {
|
|
416
|
-
configurable: true,
|
|
417
|
-
enumerable: true,
|
|
418
|
-
writable: true
|
|
419
|
-
}; // $FlowFixMe Flow thinks console is immutable.
|
|
420
|
-
|
|
421
|
-
Object.defineProperties(console, {
|
|
422
|
-
log: assign({}, props, {
|
|
423
|
-
value: prevLog
|
|
424
|
-
}),
|
|
425
|
-
info: assign({}, props, {
|
|
426
|
-
value: prevInfo
|
|
427
|
-
}),
|
|
428
|
-
warn: assign({}, props, {
|
|
429
|
-
value: prevWarn
|
|
430
|
-
}),
|
|
431
|
-
error: assign({}, props, {
|
|
432
|
-
value: prevError
|
|
433
|
-
}),
|
|
434
|
-
group: assign({}, props, {
|
|
435
|
-
value: prevGroup
|
|
436
|
-
}),
|
|
437
|
-
groupCollapsed: assign({}, props, {
|
|
438
|
-
value: prevGroupCollapsed
|
|
439
|
-
}),
|
|
440
|
-
groupEnd: assign({}, props, {
|
|
441
|
-
value: prevGroupEnd
|
|
442
|
-
})
|
|
443
|
-
});
|
|
444
|
-
/* eslint-enable react-internal/no-production-logging */
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
if (disabledDepth < 0) {
|
|
448
|
-
error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
|
|
449
|
-
}
|
|
450
|
-
}
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
|
|
454
|
-
var prefix;
|
|
455
|
-
function describeBuiltInComponentFrame(name, source, ownerFn) {
|
|
456
|
-
{
|
|
457
|
-
if (prefix === undefined) {
|
|
458
|
-
// Extract the VM specific prefix used by each line.
|
|
459
|
-
try {
|
|
460
|
-
throw Error();
|
|
461
|
-
} catch (x) {
|
|
462
|
-
var match = x.stack.trim().match(/\n( *(at )?)/);
|
|
463
|
-
prefix = match && match[1] || '';
|
|
464
|
-
}
|
|
465
|
-
} // We use the prefix to ensure our stacks line up with native stack frames.
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
return '\n' + prefix + name;
|
|
469
|
-
}
|
|
470
|
-
}
|
|
471
|
-
var reentry = false;
|
|
472
|
-
var componentFrameCache;
|
|
473
|
-
|
|
474
|
-
{
|
|
475
|
-
var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
|
|
476
|
-
componentFrameCache = new PossiblyWeakMap();
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
function describeNativeComponentFrame(fn, construct) {
|
|
480
|
-
// If something asked for a stack inside a fake render, it should get ignored.
|
|
481
|
-
if ( !fn || reentry) {
|
|
482
|
-
return '';
|
|
483
|
-
}
|
|
484
|
-
|
|
485
|
-
{
|
|
486
|
-
var frame = componentFrameCache.get(fn);
|
|
487
|
-
|
|
488
|
-
if (frame !== undefined) {
|
|
489
|
-
return frame;
|
|
490
|
-
}
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
var control;
|
|
494
|
-
reentry = true;
|
|
495
|
-
var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.
|
|
496
|
-
|
|
497
|
-
Error.prepareStackTrace = undefined;
|
|
498
|
-
var previousDispatcher;
|
|
499
|
-
|
|
500
|
-
{
|
|
501
|
-
previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function
|
|
502
|
-
// for warnings.
|
|
503
|
-
|
|
504
|
-
ReactCurrentDispatcher.current = null;
|
|
505
|
-
disableLogs();
|
|
506
|
-
}
|
|
507
|
-
|
|
508
|
-
try {
|
|
509
|
-
// This should throw.
|
|
510
|
-
if (construct) {
|
|
511
|
-
// Something should be setting the props in the constructor.
|
|
512
|
-
var Fake = function () {
|
|
513
|
-
throw Error();
|
|
514
|
-
}; // $FlowFixMe
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
Object.defineProperty(Fake.prototype, 'props', {
|
|
518
|
-
set: function () {
|
|
519
|
-
// We use a throwing setter instead of frozen or non-writable props
|
|
520
|
-
// because that won't throw in a non-strict mode function.
|
|
521
|
-
throw Error();
|
|
522
|
-
}
|
|
523
|
-
});
|
|
524
|
-
|
|
525
|
-
if (typeof Reflect === 'object' && Reflect.construct) {
|
|
526
|
-
// We construct a different control for this case to include any extra
|
|
527
|
-
// frames added by the construct call.
|
|
528
|
-
try {
|
|
529
|
-
Reflect.construct(Fake, []);
|
|
530
|
-
} catch (x) {
|
|
531
|
-
control = x;
|
|
532
|
-
}
|
|
533
|
-
|
|
534
|
-
Reflect.construct(fn, [], Fake);
|
|
535
|
-
} else {
|
|
536
|
-
try {
|
|
537
|
-
Fake.call();
|
|
538
|
-
} catch (x) {
|
|
539
|
-
control = x;
|
|
540
|
-
}
|
|
541
|
-
|
|
542
|
-
fn.call(Fake.prototype);
|
|
543
|
-
}
|
|
544
|
-
} else {
|
|
545
|
-
try {
|
|
546
|
-
throw Error();
|
|
547
|
-
} catch (x) {
|
|
548
|
-
control = x;
|
|
549
|
-
}
|
|
550
|
-
|
|
551
|
-
fn();
|
|
552
|
-
}
|
|
553
|
-
} catch (sample) {
|
|
554
|
-
// This is inlined manually because closure doesn't do it for us.
|
|
555
|
-
if (sample && control && typeof sample.stack === 'string') {
|
|
556
|
-
// This extracts the first frame from the sample that isn't also in the control.
|
|
557
|
-
// Skipping one frame that we assume is the frame that calls the two.
|
|
558
|
-
var sampleLines = sample.stack.split('\n');
|
|
559
|
-
var controlLines = control.stack.split('\n');
|
|
560
|
-
var s = sampleLines.length - 1;
|
|
561
|
-
var c = controlLines.length - 1;
|
|
562
|
-
|
|
563
|
-
while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
|
|
564
|
-
// We expect at least one stack frame to be shared.
|
|
565
|
-
// Typically this will be the root most one. However, stack frames may be
|
|
566
|
-
// cut off due to maximum stack limits. In this case, one maybe cut off
|
|
567
|
-
// earlier than the other. We assume that the sample is longer or the same
|
|
568
|
-
// and there for cut off earlier. So we should find the root most frame in
|
|
569
|
-
// the sample somewhere in the control.
|
|
570
|
-
c--;
|
|
571
|
-
}
|
|
572
|
-
|
|
573
|
-
for (; s >= 1 && c >= 0; s--, c--) {
|
|
574
|
-
// Next we find the first one that isn't the same which should be the
|
|
575
|
-
// frame that called our sample function and the control.
|
|
576
|
-
if (sampleLines[s] !== controlLines[c]) {
|
|
577
|
-
// In V8, the first line is describing the message but other VMs don't.
|
|
578
|
-
// If we're about to return the first line, and the control is also on the same
|
|
579
|
-
// line, that's a pretty good indicator that our sample threw at same line as
|
|
580
|
-
// the control. I.e. before we entered the sample frame. So we ignore this result.
|
|
581
|
-
// This can happen if you passed a class to function component, or non-function.
|
|
582
|
-
if (s !== 1 || c !== 1) {
|
|
583
|
-
do {
|
|
584
|
-
s--;
|
|
585
|
-
c--; // We may still have similar intermediate frames from the construct call.
|
|
586
|
-
// The next one that isn't the same should be our match though.
|
|
587
|
-
|
|
588
|
-
if (c < 0 || sampleLines[s] !== controlLines[c]) {
|
|
589
|
-
// V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
|
|
590
|
-
var _frame = '\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled "<anonymous>"
|
|
591
|
-
// but we have a user-provided "displayName"
|
|
592
|
-
// splice it in to make the stack more readable.
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
if (fn.displayName && _frame.includes('<anonymous>')) {
|
|
596
|
-
_frame = _frame.replace('<anonymous>', fn.displayName);
|
|
597
|
-
}
|
|
598
|
-
|
|
599
|
-
{
|
|
600
|
-
if (typeof fn === 'function') {
|
|
601
|
-
componentFrameCache.set(fn, _frame);
|
|
602
|
-
}
|
|
603
|
-
} // Return the line we found.
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
return _frame;
|
|
607
|
-
}
|
|
608
|
-
} while (s >= 1 && c >= 0);
|
|
609
|
-
}
|
|
610
|
-
|
|
611
|
-
break;
|
|
612
|
-
}
|
|
613
|
-
}
|
|
614
|
-
}
|
|
615
|
-
} finally {
|
|
616
|
-
reentry = false;
|
|
617
|
-
|
|
618
|
-
{
|
|
619
|
-
ReactCurrentDispatcher.current = previousDispatcher;
|
|
620
|
-
reenableLogs();
|
|
621
|
-
}
|
|
622
|
-
|
|
623
|
-
Error.prepareStackTrace = previousPrepareStackTrace;
|
|
624
|
-
} // Fallback to just using the name if we couldn't make it throw.
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
var name = fn ? fn.displayName || fn.name : '';
|
|
628
|
-
var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';
|
|
629
|
-
|
|
630
|
-
{
|
|
631
|
-
if (typeof fn === 'function') {
|
|
632
|
-
componentFrameCache.set(fn, syntheticFrame);
|
|
633
|
-
}
|
|
634
|
-
}
|
|
635
|
-
|
|
636
|
-
return syntheticFrame;
|
|
637
|
-
}
|
|
638
|
-
function describeFunctionComponentFrame(fn, source, ownerFn) {
|
|
639
|
-
{
|
|
640
|
-
return describeNativeComponentFrame(fn, false);
|
|
641
|
-
}
|
|
642
|
-
}
|
|
643
|
-
|
|
644
|
-
function shouldConstruct(Component) {
|
|
645
|
-
var prototype = Component.prototype;
|
|
646
|
-
return !!(prototype && prototype.isReactComponent);
|
|
647
|
-
}
|
|
648
|
-
|
|
649
|
-
function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
|
|
650
|
-
|
|
651
|
-
if (type == null) {
|
|
652
|
-
return '';
|
|
653
|
-
}
|
|
654
|
-
|
|
655
|
-
if (typeof type === 'function') {
|
|
656
|
-
{
|
|
657
|
-
return describeNativeComponentFrame(type, shouldConstruct(type));
|
|
658
|
-
}
|
|
659
|
-
}
|
|
660
|
-
|
|
661
|
-
if (typeof type === 'string') {
|
|
662
|
-
return describeBuiltInComponentFrame(type);
|
|
663
|
-
}
|
|
664
|
-
|
|
665
|
-
switch (type) {
|
|
666
|
-
case REACT_SUSPENSE_TYPE:
|
|
667
|
-
return describeBuiltInComponentFrame('Suspense');
|
|
668
|
-
|
|
669
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
|
670
|
-
return describeBuiltInComponentFrame('SuspenseList');
|
|
671
|
-
}
|
|
672
|
-
|
|
673
|
-
if (typeof type === 'object') {
|
|
674
|
-
switch (type.$$typeof) {
|
|
675
|
-
case REACT_FORWARD_REF_TYPE:
|
|
676
|
-
return describeFunctionComponentFrame(type.render);
|
|
677
|
-
|
|
678
|
-
case REACT_MEMO_TYPE:
|
|
679
|
-
// Memo may contain any component type so we recursively resolve it.
|
|
680
|
-
return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
|
|
681
|
-
|
|
682
|
-
case REACT_LAZY_TYPE:
|
|
683
|
-
{
|
|
684
|
-
var lazyComponent = type;
|
|
685
|
-
var payload = lazyComponent._payload;
|
|
686
|
-
var init = lazyComponent._init;
|
|
687
|
-
|
|
688
|
-
try {
|
|
689
|
-
// Lazy may contain any component type so we recursively resolve it.
|
|
690
|
-
return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
|
|
691
|
-
} catch (x) {}
|
|
692
|
-
}
|
|
693
|
-
}
|
|
694
|
-
}
|
|
695
|
-
|
|
696
|
-
return '';
|
|
697
|
-
}
|
|
698
|
-
|
|
699
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
700
|
-
|
|
701
|
-
var loggedTypeFailures = {};
|
|
702
|
-
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
703
|
-
|
|
704
|
-
function setCurrentlyValidatingElement(element) {
|
|
705
|
-
{
|
|
706
|
-
if (element) {
|
|
707
|
-
var owner = element._owner;
|
|
708
|
-
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
709
|
-
ReactDebugCurrentFrame.setExtraStackFrame(stack);
|
|
710
|
-
} else {
|
|
711
|
-
ReactDebugCurrentFrame.setExtraStackFrame(null);
|
|
712
|
-
}
|
|
713
|
-
}
|
|
714
|
-
}
|
|
715
|
-
|
|
716
|
-
function checkPropTypes(typeSpecs, values, location, componentName, element) {
|
|
717
|
-
{
|
|
718
|
-
// $FlowFixMe This is okay but Flow doesn't know it.
|
|
719
|
-
var has = Function.call.bind(hasOwnProperty);
|
|
720
|
-
|
|
721
|
-
for (var typeSpecName in typeSpecs) {
|
|
722
|
-
if (has(typeSpecs, typeSpecName)) {
|
|
723
|
-
var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to
|
|
724
|
-
// fail the render phase where it didn't fail before. So we log it.
|
|
725
|
-
// After these have been cleaned up, we'll let them throw.
|
|
726
|
-
|
|
727
|
-
try {
|
|
728
|
-
// This is intentionally an invariant that gets caught. It's the same
|
|
729
|
-
// behavior as without this statement except with a better message.
|
|
730
|
-
if (typeof typeSpecs[typeSpecName] !== 'function') {
|
|
731
|
-
// eslint-disable-next-line react-internal/prod-error-codes
|
|
732
|
-
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`.');
|
|
733
|
-
err.name = 'Invariant Violation';
|
|
734
|
-
throw err;
|
|
735
|
-
}
|
|
736
|
-
|
|
737
|
-
error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
|
|
738
|
-
} catch (ex) {
|
|
739
|
-
error$1 = ex;
|
|
740
|
-
}
|
|
741
|
-
|
|
742
|
-
if (error$1 && !(error$1 instanceof Error)) {
|
|
743
|
-
setCurrentlyValidatingElement(element);
|
|
744
|
-
|
|
745
|
-
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);
|
|
746
|
-
|
|
747
|
-
setCurrentlyValidatingElement(null);
|
|
748
|
-
}
|
|
749
|
-
|
|
750
|
-
if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
|
|
751
|
-
// Only monitor this failure once because there tends to be a lot of the
|
|
752
|
-
// same error.
|
|
753
|
-
loggedTypeFailures[error$1.message] = true;
|
|
754
|
-
setCurrentlyValidatingElement(element);
|
|
755
|
-
|
|
756
|
-
error('Failed %s type: %s', location, error$1.message);
|
|
757
|
-
|
|
758
|
-
setCurrentlyValidatingElement(null);
|
|
759
|
-
}
|
|
760
|
-
}
|
|
761
|
-
}
|
|
762
|
-
}
|
|
763
|
-
}
|
|
764
|
-
|
|
765
|
-
var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare
|
|
766
|
-
|
|
767
|
-
function isArray(a) {
|
|
768
|
-
return isArrayImpl(a);
|
|
769
|
-
}
|
|
770
|
-
|
|
771
|
-
/*
|
|
772
|
-
* The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol
|
|
773
|
-
* and Temporal.* types. See https://github.com/facebook/react/pull/22064.
|
|
774
|
-
*
|
|
775
|
-
* The functions in this module will throw an easier-to-understand,
|
|
776
|
-
* easier-to-debug exception with a clear errors message message explaining the
|
|
777
|
-
* problem. (Instead of a confusing exception thrown inside the implementation
|
|
778
|
-
* of the `value` object).
|
|
779
|
-
*/
|
|
780
|
-
// $FlowFixMe only called in DEV, so void return is not possible.
|
|
781
|
-
function typeName(value) {
|
|
782
|
-
{
|
|
783
|
-
// toStringTag is needed for namespaced types like Temporal.Instant
|
|
784
|
-
var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;
|
|
785
|
-
var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';
|
|
786
|
-
return type;
|
|
787
|
-
}
|
|
788
|
-
} // $FlowFixMe only called in DEV, so void return is not possible.
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
function willCoercionThrow(value) {
|
|
792
|
-
{
|
|
793
|
-
try {
|
|
794
|
-
testStringCoercion(value);
|
|
795
|
-
return false;
|
|
796
|
-
} catch (e) {
|
|
797
|
-
return true;
|
|
798
|
-
}
|
|
799
|
-
}
|
|
800
|
-
}
|
|
801
|
-
|
|
802
|
-
function testStringCoercion(value) {
|
|
803
|
-
// If you ended up here by following an exception call stack, here's what's
|
|
804
|
-
// happened: you supplied an object or symbol value to React (as a prop, key,
|
|
805
|
-
// DOM attribute, CSS property, string ref, etc.) and when React tried to
|
|
806
|
-
// coerce it to a string using `'' + value`, an exception was thrown.
|
|
807
|
-
//
|
|
808
|
-
// The most common types that will cause this exception are `Symbol` instances
|
|
809
|
-
// and Temporal objects like `Temporal.Instant`. But any object that has a
|
|
810
|
-
// `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this
|
|
811
|
-
// exception. (Library authors do this to prevent users from using built-in
|
|
812
|
-
// numeric operators like `+` or comparison operators like `>=` because custom
|
|
813
|
-
// methods are needed to perform accurate arithmetic or comparison.)
|
|
814
|
-
//
|
|
815
|
-
// To fix the problem, coerce this object or symbol value to a string before
|
|
816
|
-
// passing it to React. The most reliable way is usually `String(value)`.
|
|
817
|
-
//
|
|
818
|
-
// To find which value is throwing, check the browser or debugger console.
|
|
819
|
-
// Before this exception was thrown, there should be `console.error` output
|
|
820
|
-
// that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the
|
|
821
|
-
// problem and how that type was used: key, atrribute, input value prop, etc.
|
|
822
|
-
// In most cases, this console output also shows the component and its
|
|
823
|
-
// ancestor components where the exception happened.
|
|
824
|
-
//
|
|
825
|
-
// eslint-disable-next-line react-internal/safe-string-coercion
|
|
826
|
-
return '' + value;
|
|
827
|
-
}
|
|
828
|
-
function checkKeyStringCoercion(value) {
|
|
829
|
-
{
|
|
830
|
-
if (willCoercionThrow(value)) {
|
|
831
|
-
error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));
|
|
832
|
-
|
|
833
|
-
return testStringCoercion(value); // throw (to help callers find troubleshooting comments)
|
|
834
|
-
}
|
|
835
|
-
}
|
|
836
|
-
}
|
|
837
|
-
|
|
838
|
-
var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
|
|
839
|
-
var RESERVED_PROPS = {
|
|
840
|
-
key: true,
|
|
841
|
-
ref: true,
|
|
842
|
-
__self: true,
|
|
843
|
-
__source: true
|
|
844
|
-
};
|
|
845
|
-
var specialPropKeyWarningShown;
|
|
846
|
-
var specialPropRefWarningShown;
|
|
847
|
-
var didWarnAboutStringRefs;
|
|
848
|
-
|
|
849
|
-
{
|
|
850
|
-
didWarnAboutStringRefs = {};
|
|
851
|
-
}
|
|
852
|
-
|
|
853
|
-
function hasValidRef(config) {
|
|
854
|
-
{
|
|
855
|
-
if (hasOwnProperty.call(config, 'ref')) {
|
|
856
|
-
var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
|
|
857
|
-
|
|
858
|
-
if (getter && getter.isReactWarning) {
|
|
859
|
-
return false;
|
|
860
|
-
}
|
|
861
|
-
}
|
|
862
|
-
}
|
|
863
|
-
|
|
864
|
-
return config.ref !== undefined;
|
|
865
|
-
}
|
|
866
|
-
|
|
867
|
-
function hasValidKey(config) {
|
|
868
|
-
{
|
|
869
|
-
if (hasOwnProperty.call(config, 'key')) {
|
|
870
|
-
var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
|
|
871
|
-
|
|
872
|
-
if (getter && getter.isReactWarning) {
|
|
873
|
-
return false;
|
|
874
|
-
}
|
|
875
|
-
}
|
|
876
|
-
}
|
|
877
|
-
|
|
878
|
-
return config.key !== undefined;
|
|
879
|
-
}
|
|
880
|
-
|
|
881
|
-
function warnIfStringRefCannotBeAutoConverted(config, self) {
|
|
882
|
-
{
|
|
883
|
-
if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {
|
|
884
|
-
var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);
|
|
885
|
-
|
|
886
|
-
if (!didWarnAboutStringRefs[componentName]) {
|
|
887
|
-
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);
|
|
888
|
-
|
|
889
|
-
didWarnAboutStringRefs[componentName] = true;
|
|
890
|
-
}
|
|
891
|
-
}
|
|
892
|
-
}
|
|
893
|
-
}
|
|
894
|
-
|
|
895
|
-
function defineKeyPropWarningGetter(props, displayName) {
|
|
896
|
-
{
|
|
897
|
-
var warnAboutAccessingKey = function () {
|
|
898
|
-
if (!specialPropKeyWarningShown) {
|
|
899
|
-
specialPropKeyWarningShown = true;
|
|
900
|
-
|
|
901
|
-
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);
|
|
902
|
-
}
|
|
903
|
-
};
|
|
904
|
-
|
|
905
|
-
warnAboutAccessingKey.isReactWarning = true;
|
|
906
|
-
Object.defineProperty(props, 'key', {
|
|
907
|
-
get: warnAboutAccessingKey,
|
|
908
|
-
configurable: true
|
|
909
|
-
});
|
|
910
|
-
}
|
|
911
|
-
}
|
|
912
|
-
|
|
913
|
-
function defineRefPropWarningGetter(props, displayName) {
|
|
914
|
-
{
|
|
915
|
-
var warnAboutAccessingRef = function () {
|
|
916
|
-
if (!specialPropRefWarningShown) {
|
|
917
|
-
specialPropRefWarningShown = true;
|
|
918
|
-
|
|
919
|
-
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);
|
|
920
|
-
}
|
|
921
|
-
};
|
|
922
|
-
|
|
923
|
-
warnAboutAccessingRef.isReactWarning = true;
|
|
924
|
-
Object.defineProperty(props, 'ref', {
|
|
925
|
-
get: warnAboutAccessingRef,
|
|
926
|
-
configurable: true
|
|
927
|
-
});
|
|
928
|
-
}
|
|
929
|
-
}
|
|
930
|
-
/**
|
|
931
|
-
* Factory method to create a new React element. This no longer adheres to
|
|
932
|
-
* the class pattern, so do not use new to call it. Also, instanceof check
|
|
933
|
-
* will not work. Instead test $$typeof field against Symbol.for('react.element') to check
|
|
934
|
-
* if something is a React Element.
|
|
935
|
-
*
|
|
936
|
-
* @param {*} type
|
|
937
|
-
* @param {*} props
|
|
938
|
-
* @param {*} key
|
|
939
|
-
* @param {string|object} ref
|
|
940
|
-
* @param {*} owner
|
|
941
|
-
* @param {*} self A *temporary* helper to detect places where `this` is
|
|
942
|
-
* different from the `owner` when React.createElement is called, so that we
|
|
943
|
-
* can warn. We want to get rid of owner and replace string `ref`s with arrow
|
|
944
|
-
* functions, and as long as `this` and owner are the same, there will be no
|
|
945
|
-
* change in behavior.
|
|
946
|
-
* @param {*} source An annotation object (added by a transpiler or otherwise)
|
|
947
|
-
* indicating filename, line number, and/or other information.
|
|
948
|
-
* @internal
|
|
949
|
-
*/
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
var ReactElement = function (type, key, ref, self, source, owner, props) {
|
|
953
|
-
var element = {
|
|
954
|
-
// This tag allows us to uniquely identify this as a React Element
|
|
955
|
-
$$typeof: REACT_ELEMENT_TYPE,
|
|
956
|
-
// Built-in properties that belong on the element
|
|
957
|
-
type: type,
|
|
958
|
-
key: key,
|
|
959
|
-
ref: ref,
|
|
960
|
-
props: props,
|
|
961
|
-
// Record the component responsible for creating this element.
|
|
962
|
-
_owner: owner
|
|
963
|
-
};
|
|
964
|
-
|
|
965
|
-
{
|
|
966
|
-
// The validation flag is currently mutative. We put it on
|
|
967
|
-
// an external backing store so that we can freeze the whole object.
|
|
968
|
-
// This can be replaced with a WeakMap once they are implemented in
|
|
969
|
-
// commonly used development environments.
|
|
970
|
-
element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
|
|
971
|
-
// the validation flag non-enumerable (where possible, which should
|
|
972
|
-
// include every environment we run tests in), so the test framework
|
|
973
|
-
// ignores it.
|
|
974
|
-
|
|
975
|
-
Object.defineProperty(element._store, 'validated', {
|
|
976
|
-
configurable: false,
|
|
977
|
-
enumerable: false,
|
|
978
|
-
writable: true,
|
|
979
|
-
value: false
|
|
980
|
-
}); // self and source are DEV only properties.
|
|
981
|
-
|
|
982
|
-
Object.defineProperty(element, '_self', {
|
|
983
|
-
configurable: false,
|
|
984
|
-
enumerable: false,
|
|
985
|
-
writable: false,
|
|
986
|
-
value: self
|
|
987
|
-
}); // Two elements created in two different places should be considered
|
|
988
|
-
// equal for testing purposes and therefore we hide it from enumeration.
|
|
989
|
-
|
|
990
|
-
Object.defineProperty(element, '_source', {
|
|
991
|
-
configurable: false,
|
|
992
|
-
enumerable: false,
|
|
993
|
-
writable: false,
|
|
994
|
-
value: source
|
|
995
|
-
});
|
|
996
|
-
|
|
997
|
-
if (Object.freeze) {
|
|
998
|
-
Object.freeze(element.props);
|
|
999
|
-
Object.freeze(element);
|
|
1000
|
-
}
|
|
1001
|
-
}
|
|
1002
|
-
|
|
1003
|
-
return element;
|
|
1004
|
-
};
|
|
1005
|
-
/**
|
|
1006
|
-
* https://github.com/reactjs/rfcs/pull/107
|
|
1007
|
-
* @param {*} type
|
|
1008
|
-
* @param {object} props
|
|
1009
|
-
* @param {string} key
|
|
1010
|
-
*/
|
|
1011
|
-
|
|
1012
|
-
function jsxDEV(type, config, maybeKey, source, self) {
|
|
1013
|
-
{
|
|
1014
|
-
var propName; // Reserved names are extracted
|
|
1015
|
-
|
|
1016
|
-
var props = {};
|
|
1017
|
-
var key = null;
|
|
1018
|
-
var ref = null; // Currently, key can be spread in as a prop. This causes a potential
|
|
1019
|
-
// issue if key is also explicitly declared (ie. <div {...props} key="Hi" />
|
|
1020
|
-
// or <div key="Hi" {...props} /> ). We want to deprecate key spread,
|
|
1021
|
-
// but as an intermediary step, we will use jsxDEV for everything except
|
|
1022
|
-
// <div {...props} key="Hi" />, because we aren't currently able to tell if
|
|
1023
|
-
// key is explicitly declared to be undefined or not.
|
|
1024
|
-
|
|
1025
|
-
if (maybeKey !== undefined) {
|
|
1026
|
-
{
|
|
1027
|
-
checkKeyStringCoercion(maybeKey);
|
|
1028
|
-
}
|
|
1029
|
-
|
|
1030
|
-
key = '' + maybeKey;
|
|
1031
|
-
}
|
|
1032
|
-
|
|
1033
|
-
if (hasValidKey(config)) {
|
|
1034
|
-
{
|
|
1035
|
-
checkKeyStringCoercion(config.key);
|
|
1036
|
-
}
|
|
1037
|
-
|
|
1038
|
-
key = '' + config.key;
|
|
1039
|
-
}
|
|
1040
|
-
|
|
1041
|
-
if (hasValidRef(config)) {
|
|
1042
|
-
ref = config.ref;
|
|
1043
|
-
warnIfStringRefCannotBeAutoConverted(config, self);
|
|
1044
|
-
} // Remaining properties are added to a new props object
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
for (propName in config) {
|
|
1048
|
-
if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
|
1049
|
-
props[propName] = config[propName];
|
|
1050
|
-
}
|
|
1051
|
-
} // Resolve default props
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
if (type && type.defaultProps) {
|
|
1055
|
-
var defaultProps = type.defaultProps;
|
|
1056
|
-
|
|
1057
|
-
for (propName in defaultProps) {
|
|
1058
|
-
if (props[propName] === undefined) {
|
|
1059
|
-
props[propName] = defaultProps[propName];
|
|
1060
|
-
}
|
|
1061
|
-
}
|
|
1062
|
-
}
|
|
1063
|
-
|
|
1064
|
-
if (key || ref) {
|
|
1065
|
-
var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
|
|
1066
|
-
|
|
1067
|
-
if (key) {
|
|
1068
|
-
defineKeyPropWarningGetter(props, displayName);
|
|
1069
|
-
}
|
|
1070
|
-
|
|
1071
|
-
if (ref) {
|
|
1072
|
-
defineRefPropWarningGetter(props, displayName);
|
|
1073
|
-
}
|
|
1074
|
-
}
|
|
1075
|
-
|
|
1076
|
-
return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
|
|
1077
|
-
}
|
|
1078
|
-
}
|
|
1079
|
-
|
|
1080
|
-
var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
|
|
1081
|
-
var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
1082
|
-
|
|
1083
|
-
function setCurrentlyValidatingElement$1(element) {
|
|
1084
|
-
{
|
|
1085
|
-
if (element) {
|
|
1086
|
-
var owner = element._owner;
|
|
1087
|
-
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
1088
|
-
ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
|
|
1089
|
-
} else {
|
|
1090
|
-
ReactDebugCurrentFrame$1.setExtraStackFrame(null);
|
|
1091
|
-
}
|
|
1092
|
-
}
|
|
1093
|
-
}
|
|
1094
|
-
|
|
1095
|
-
var propTypesMisspellWarningShown;
|
|
1096
|
-
|
|
1097
|
-
{
|
|
1098
|
-
propTypesMisspellWarningShown = false;
|
|
1099
|
-
}
|
|
1100
|
-
/**
|
|
1101
|
-
* Verifies the object is a ReactElement.
|
|
1102
|
-
* See https://reactjs.org/docs/react-api.html#isvalidelement
|
|
1103
|
-
* @param {?object} object
|
|
1104
|
-
* @return {boolean} True if `object` is a ReactElement.
|
|
1105
|
-
* @final
|
|
1106
|
-
*/
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
function isValidElement(object) {
|
|
1110
|
-
{
|
|
1111
|
-
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
1112
|
-
}
|
|
1113
|
-
}
|
|
1114
|
-
|
|
1115
|
-
function getDeclarationErrorAddendum() {
|
|
1116
|
-
{
|
|
1117
|
-
if (ReactCurrentOwner$1.current) {
|
|
1118
|
-
var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);
|
|
1119
|
-
|
|
1120
|
-
if (name) {
|
|
1121
|
-
return '\n\nCheck the render method of `' + name + '`.';
|
|
1122
|
-
}
|
|
1123
|
-
}
|
|
1124
|
-
|
|
1125
|
-
return '';
|
|
1126
|
-
}
|
|
1127
|
-
}
|
|
1128
|
-
|
|
1129
|
-
function getSourceInfoErrorAddendum(source) {
|
|
1130
|
-
{
|
|
1131
|
-
if (source !== undefined) {
|
|
1132
|
-
var fileName = source.fileName.replace(/^.*[\\\/]/, '');
|
|
1133
|
-
var lineNumber = source.lineNumber;
|
|
1134
|
-
return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
|
|
1135
|
-
}
|
|
1136
|
-
|
|
1137
|
-
return '';
|
|
1138
|
-
}
|
|
1139
|
-
}
|
|
1140
|
-
/**
|
|
1141
|
-
* Warn if there's no key explicitly set on dynamic arrays of children or
|
|
1142
|
-
* object keys are not valid. This allows us to keep track of children between
|
|
1143
|
-
* updates.
|
|
1144
|
-
*/
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
var ownerHasKeyUseWarning = {};
|
|
1148
|
-
|
|
1149
|
-
function getCurrentComponentErrorInfo(parentType) {
|
|
1150
|
-
{
|
|
1151
|
-
var info = getDeclarationErrorAddendum();
|
|
1152
|
-
|
|
1153
|
-
if (!info) {
|
|
1154
|
-
var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
|
|
1155
|
-
|
|
1156
|
-
if (parentName) {
|
|
1157
|
-
info = "\n\nCheck the top-level render call using <" + parentName + ">.";
|
|
1158
|
-
}
|
|
1159
|
-
}
|
|
1160
|
-
|
|
1161
|
-
return info;
|
|
1162
|
-
}
|
|
1163
|
-
}
|
|
1164
|
-
/**
|
|
1165
|
-
* Warn if the element doesn't have an explicit key assigned to it.
|
|
1166
|
-
* This element is in an array. The array could grow and shrink or be
|
|
1167
|
-
* reordered. All children that haven't already been validated are required to
|
|
1168
|
-
* have a "key" property assigned to it. Error statuses are cached so a warning
|
|
1169
|
-
* will only be shown once.
|
|
1170
|
-
*
|
|
1171
|
-
* @internal
|
|
1172
|
-
* @param {ReactElement} element Element that requires a key.
|
|
1173
|
-
* @param {*} parentType element's parent's type.
|
|
1174
|
-
*/
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
function validateExplicitKey(element, parentType) {
|
|
1178
|
-
{
|
|
1179
|
-
if (!element._store || element._store.validated || element.key != null) {
|
|
1180
|
-
return;
|
|
1181
|
-
}
|
|
1182
|
-
|
|
1183
|
-
element._store.validated = true;
|
|
1184
|
-
var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
|
|
1185
|
-
|
|
1186
|
-
if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
|
|
1187
|
-
return;
|
|
1188
|
-
}
|
|
1189
|
-
|
|
1190
|
-
ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a
|
|
1191
|
-
// property, it may be the creator of the child that's responsible for
|
|
1192
|
-
// assigning it a key.
|
|
1193
|
-
|
|
1194
|
-
var childOwner = '';
|
|
1195
|
-
|
|
1196
|
-
if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {
|
|
1197
|
-
// Give the component that originally created this child.
|
|
1198
|
-
childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
|
|
1199
|
-
}
|
|
1200
|
-
|
|
1201
|
-
setCurrentlyValidatingElement$1(element);
|
|
1202
|
-
|
|
1203
|
-
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);
|
|
1204
|
-
|
|
1205
|
-
setCurrentlyValidatingElement$1(null);
|
|
1206
|
-
}
|
|
1207
|
-
}
|
|
1208
|
-
/**
|
|
1209
|
-
* Ensure that every element either is passed in a static location, in an
|
|
1210
|
-
* array with an explicit keys property defined, or in an object literal
|
|
1211
|
-
* with valid key property.
|
|
1212
|
-
*
|
|
1213
|
-
* @internal
|
|
1214
|
-
* @param {ReactNode} node Statically passed child of any type.
|
|
1215
|
-
* @param {*} parentType node's parent's type.
|
|
1216
|
-
*/
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
function validateChildKeys(node, parentType) {
|
|
1220
|
-
{
|
|
1221
|
-
if (typeof node !== 'object') {
|
|
1222
|
-
return;
|
|
1223
|
-
}
|
|
1224
|
-
|
|
1225
|
-
if (isArray(node)) {
|
|
1226
|
-
for (var i = 0; i < node.length; i++) {
|
|
1227
|
-
var child = node[i];
|
|
1228
|
-
|
|
1229
|
-
if (isValidElement(child)) {
|
|
1230
|
-
validateExplicitKey(child, parentType);
|
|
1231
|
-
}
|
|
1232
|
-
}
|
|
1233
|
-
} else if (isValidElement(node)) {
|
|
1234
|
-
// This element was passed in a valid location.
|
|
1235
|
-
if (node._store) {
|
|
1236
|
-
node._store.validated = true;
|
|
1237
|
-
}
|
|
1238
|
-
} else if (node) {
|
|
1239
|
-
var iteratorFn = getIteratorFn(node);
|
|
1240
|
-
|
|
1241
|
-
if (typeof iteratorFn === 'function') {
|
|
1242
|
-
// Entry iterators used to provide implicit keys,
|
|
1243
|
-
// but now we print a separate warning for them later.
|
|
1244
|
-
if (iteratorFn !== node.entries) {
|
|
1245
|
-
var iterator = iteratorFn.call(node);
|
|
1246
|
-
var step;
|
|
1247
|
-
|
|
1248
|
-
while (!(step = iterator.next()).done) {
|
|
1249
|
-
if (isValidElement(step.value)) {
|
|
1250
|
-
validateExplicitKey(step.value, parentType);
|
|
1251
|
-
}
|
|
1252
|
-
}
|
|
1253
|
-
}
|
|
1254
|
-
}
|
|
1255
|
-
}
|
|
1256
|
-
}
|
|
1257
|
-
}
|
|
1258
|
-
/**
|
|
1259
|
-
* Given an element, validate that its props follow the propTypes definition,
|
|
1260
|
-
* provided by the type.
|
|
1261
|
-
*
|
|
1262
|
-
* @param {ReactElement} element
|
|
1263
|
-
*/
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
function validatePropTypes(element) {
|
|
1267
|
-
{
|
|
1268
|
-
var type = element.type;
|
|
1269
|
-
|
|
1270
|
-
if (type === null || type === undefined || typeof type === 'string') {
|
|
1271
|
-
return;
|
|
1272
|
-
}
|
|
1273
|
-
|
|
1274
|
-
var propTypes;
|
|
1275
|
-
|
|
1276
|
-
if (typeof type === 'function') {
|
|
1277
|
-
propTypes = type.propTypes;
|
|
1278
|
-
} else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
|
|
1279
|
-
// Inner props are checked in the reconciler.
|
|
1280
|
-
type.$$typeof === REACT_MEMO_TYPE)) {
|
|
1281
|
-
propTypes = type.propTypes;
|
|
1282
|
-
} else {
|
|
1283
|
-
return;
|
|
1284
|
-
}
|
|
1285
|
-
|
|
1286
|
-
if (propTypes) {
|
|
1287
|
-
// Intentionally inside to avoid triggering lazy initializers:
|
|
1288
|
-
var name = getComponentNameFromType(type);
|
|
1289
|
-
checkPropTypes(propTypes, element.props, 'prop', name, element);
|
|
1290
|
-
} else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
|
|
1291
|
-
propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:
|
|
1292
|
-
|
|
1293
|
-
var _name = getComponentNameFromType(type);
|
|
1294
|
-
|
|
1295
|
-
error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');
|
|
1296
|
-
}
|
|
1297
|
-
|
|
1298
|
-
if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {
|
|
1299
|
-
error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
|
|
1300
|
-
}
|
|
1301
|
-
}
|
|
1302
|
-
}
|
|
1303
|
-
/**
|
|
1304
|
-
* Given a fragment, validate that it can only be provided with fragment props
|
|
1305
|
-
* @param {ReactElement} fragment
|
|
1306
|
-
*/
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
function validateFragmentProps(fragment) {
|
|
1310
|
-
{
|
|
1311
|
-
var keys = Object.keys(fragment.props);
|
|
1312
|
-
|
|
1313
|
-
for (var i = 0; i < keys.length; i++) {
|
|
1314
|
-
var key = keys[i];
|
|
1315
|
-
|
|
1316
|
-
if (key !== 'children' && key !== 'key') {
|
|
1317
|
-
setCurrentlyValidatingElement$1(fragment);
|
|
1318
|
-
|
|
1319
|
-
error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
|
|
1320
|
-
|
|
1321
|
-
setCurrentlyValidatingElement$1(null);
|
|
1322
|
-
break;
|
|
1323
|
-
}
|
|
1324
|
-
}
|
|
1325
|
-
|
|
1326
|
-
if (fragment.ref !== null) {
|
|
1327
|
-
setCurrentlyValidatingElement$1(fragment);
|
|
1328
|
-
|
|
1329
|
-
error('Invalid attribute `ref` supplied to `React.Fragment`.');
|
|
1330
|
-
|
|
1331
|
-
setCurrentlyValidatingElement$1(null);
|
|
1332
|
-
}
|
|
1333
|
-
}
|
|
1334
|
-
}
|
|
1335
|
-
|
|
1336
|
-
var didWarnAboutKeySpread = {};
|
|
1337
|
-
function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
|
|
1338
|
-
{
|
|
1339
|
-
var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
|
|
1340
|
-
// succeed and there will likely be errors in render.
|
|
1341
|
-
|
|
1342
|
-
if (!validType) {
|
|
1343
|
-
var info = '';
|
|
1344
|
-
|
|
1345
|
-
if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
|
|
1346
|
-
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.";
|
|
1347
|
-
}
|
|
1348
|
-
|
|
1349
|
-
var sourceInfo = getSourceInfoErrorAddendum(source);
|
|
1350
|
-
|
|
1351
|
-
if (sourceInfo) {
|
|
1352
|
-
info += sourceInfo;
|
|
1353
|
-
} else {
|
|
1354
|
-
info += getDeclarationErrorAddendum();
|
|
1355
|
-
}
|
|
1356
|
-
|
|
1357
|
-
var typeString;
|
|
1358
|
-
|
|
1359
|
-
if (type === null) {
|
|
1360
|
-
typeString = 'null';
|
|
1361
|
-
} else if (isArray(type)) {
|
|
1362
|
-
typeString = 'array';
|
|
1363
|
-
} else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
|
|
1364
|
-
typeString = "<" + (getComponentNameFromType(type.type) || 'Unknown') + " />";
|
|
1365
|
-
info = ' Did you accidentally export a JSX literal instead of a component?';
|
|
1366
|
-
} else {
|
|
1367
|
-
typeString = typeof type;
|
|
1368
|
-
}
|
|
1369
|
-
|
|
1370
|
-
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);
|
|
1371
|
-
}
|
|
1372
|
-
|
|
1373
|
-
var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.
|
|
1374
|
-
// TODO: Drop this when these are no longer allowed as the type argument.
|
|
1375
|
-
|
|
1376
|
-
if (element == null) {
|
|
1377
|
-
return element;
|
|
1378
|
-
} // Skip key warning if the type isn't valid since our key validation logic
|
|
1379
|
-
// doesn't expect a non-string/function type and can throw confusing errors.
|
|
1380
|
-
// We don't want exception behavior to differ between dev and prod.
|
|
1381
|
-
// (Rendering will throw with a helpful message and as soon as the type is
|
|
1382
|
-
// fixed, the key warnings will appear.)
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
if (validType) {
|
|
1386
|
-
var children = props.children;
|
|
1387
|
-
|
|
1388
|
-
if (children !== undefined) {
|
|
1389
|
-
if (isStaticChildren) {
|
|
1390
|
-
if (isArray(children)) {
|
|
1391
|
-
for (var i = 0; i < children.length; i++) {
|
|
1392
|
-
validateChildKeys(children[i], type);
|
|
1393
|
-
}
|
|
1394
|
-
|
|
1395
|
-
if (Object.freeze) {
|
|
1396
|
-
Object.freeze(children);
|
|
1397
|
-
}
|
|
1398
|
-
} else {
|
|
1399
|
-
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.');
|
|
1400
|
-
}
|
|
1401
|
-
} else {
|
|
1402
|
-
validateChildKeys(children, type);
|
|
1403
|
-
}
|
|
1404
|
-
}
|
|
1405
|
-
}
|
|
1406
|
-
|
|
1407
|
-
{
|
|
1408
|
-
if (hasOwnProperty.call(props, 'key')) {
|
|
1409
|
-
var componentName = getComponentNameFromType(type);
|
|
1410
|
-
var keys = Object.keys(props).filter(function (k) {
|
|
1411
|
-
return k !== 'key';
|
|
1412
|
-
});
|
|
1413
|
-
var beforeExample = keys.length > 0 ? '{key: someKey, ' + keys.join(': ..., ') + ': ...}' : '{key: someKey}';
|
|
1414
|
-
|
|
1415
|
-
if (!didWarnAboutKeySpread[componentName + beforeExample]) {
|
|
1416
|
-
var afterExample = keys.length > 0 ? '{' + keys.join(': ..., ') + ': ...}' : '{}';
|
|
1417
|
-
|
|
1418
|
-
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);
|
|
1419
|
-
|
|
1420
|
-
didWarnAboutKeySpread[componentName + beforeExample] = true;
|
|
1421
|
-
}
|
|
1422
|
-
}
|
|
1423
|
-
}
|
|
1424
|
-
|
|
1425
|
-
if (type === REACT_FRAGMENT_TYPE) {
|
|
1426
|
-
validateFragmentProps(element);
|
|
1427
|
-
} else {
|
|
1428
|
-
validatePropTypes(element);
|
|
1429
|
-
}
|
|
1430
|
-
|
|
1431
|
-
return element;
|
|
1432
|
-
}
|
|
1433
|
-
} // These two functions exist to still get child warnings in dev
|
|
1434
|
-
// even with the prod transform. This means that jsxDEV is purely
|
|
1435
|
-
// opt-in behavior for better messages but that we won't stop
|
|
1436
|
-
// giving you warnings if you use production apis.
|
|
1437
|
-
|
|
1438
|
-
function jsxWithValidationStatic(type, props, key) {
|
|
1439
|
-
{
|
|
1440
|
-
return jsxWithValidation(type, props, key, true);
|
|
1441
|
-
}
|
|
1442
|
-
}
|
|
1443
|
-
function jsxWithValidationDynamic(type, props, key) {
|
|
1444
|
-
{
|
|
1445
|
-
return jsxWithValidation(type, props, key, false);
|
|
1446
|
-
}
|
|
1447
|
-
}
|
|
1448
|
-
|
|
1449
|
-
var jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.
|
|
1450
|
-
// for now we can ship identical prod functions
|
|
1451
|
-
|
|
1452
|
-
var jsxs = jsxWithValidationStatic ;
|
|
1453
|
-
|
|
1454
|
-
reactJsxRuntime_development.Fragment = REACT_FRAGMENT_TYPE;
|
|
1455
|
-
reactJsxRuntime_development.jsx = jsx;
|
|
1456
|
-
reactJsxRuntime_development.jsxs = jsxs;
|
|
1457
|
-
})();
|
|
1458
|
-
}
|
|
1459
|
-
return reactJsxRuntime_development;
|
|
1460
|
-
}
|
|
1461
|
-
|
|
1462
|
-
var hasRequiredJsxRuntime;
|
|
1463
|
-
|
|
1464
|
-
function requireJsxRuntime () {
|
|
1465
|
-
if (hasRequiredJsxRuntime) return jsxRuntime.exports;
|
|
1466
|
-
hasRequiredJsxRuntime = 1;
|
|
1467
|
-
|
|
1468
|
-
if (process.env.NODE_ENV === 'production') {
|
|
1469
|
-
jsxRuntime.exports = requireReactJsxRuntime_production_min();
|
|
1470
|
-
} else {
|
|
1471
|
-
jsxRuntime.exports = requireReactJsxRuntime_development();
|
|
1472
|
-
}
|
|
1473
|
-
return jsxRuntime.exports;
|
|
1474
|
-
}
|
|
1475
|
-
|
|
1476
|
-
var jsxRuntimeExports = requireJsxRuntime();
|
|
1477
|
-
|
|
1478
95
|
const _excluded = ["doorDepth"];
|
|
1479
|
-
const ConfiguratorContext = /*#__PURE__*/
|
|
96
|
+
const ConfiguratorContext = /*#__PURE__*/react.createContext(undefined);
|
|
1480
97
|
const ConfiguratorProvider = _ref => {
|
|
1481
98
|
let {
|
|
1482
99
|
children
|
|
1483
100
|
} = _ref;
|
|
1484
|
-
const [isPlaneVisible, setIsPlaneVisible] =
|
|
1485
|
-
const [isFrameVisible, setIsFrameVisible] =
|
|
1486
|
-
const [cpid, setCpid] =
|
|
1487
|
-
const [totalHeight, setTotalHeight] =
|
|
1488
|
-
const [totalWidth, setTotalWidth] =
|
|
1489
|
-
const [glassVisible, setGlassVisible] =
|
|
1490
|
-
const [glassDepth, setGlassDepth] =
|
|
1491
|
-
const [door, setDoor] =
|
|
101
|
+
const [isPlaneVisible, setIsPlaneVisible] = react.useState(false);
|
|
102
|
+
const [isFrameVisible, setIsFrameVisible] = react.useState(true);
|
|
103
|
+
const [cpid, setCpid] = react.useState("");
|
|
104
|
+
const [totalHeight, setTotalHeight] = react.useState(2700);
|
|
105
|
+
const [totalWidth, setTotalWidth] = react.useState(974);
|
|
106
|
+
const [glassVisible, setGlassVisible] = react.useState(false);
|
|
107
|
+
const [glassDepth, setGlassDepth] = react.useState(8);
|
|
108
|
+
const [door, setDoor] = react.useState({
|
|
1492
109
|
doorMaterial: "door_material",
|
|
1493
110
|
doorWidth: 0,
|
|
1494
111
|
doorHeight: 0,
|
|
@@ -1496,7 +113,7 @@ const ConfiguratorProvider = _ref => {
|
|
|
1496
113
|
doorPivot: "left",
|
|
1497
114
|
doorOpening: "out"
|
|
1498
115
|
});
|
|
1499
|
-
const [doorFrame, setDoorFrame] =
|
|
116
|
+
const [doorFrame, setDoorFrame] = react.useState({
|
|
1500
117
|
frameMaterial: "doorFrame_material",
|
|
1501
118
|
doorStopMaterial: "doorStop_material",
|
|
1502
119
|
gasketMaterial: "gasket_material",
|
|
@@ -1517,18 +134,18 @@ const ConfiguratorProvider = _ref => {
|
|
|
1517
134
|
secondDoorStopDepth: 30,
|
|
1518
135
|
secondDoorStopOffset: 13
|
|
1519
136
|
});
|
|
1520
|
-
const [interiorFanlight, setInteriorFanlight] =
|
|
137
|
+
const [interiorFanlight, setInteriorFanlight] = react.useState({
|
|
1521
138
|
visible: false,
|
|
1522
139
|
height: 300,
|
|
1523
140
|
material: "interiorFanlight_material"
|
|
1524
141
|
});
|
|
1525
|
-
const [exteriorFanlight, setExteriorFanlight] =
|
|
142
|
+
const [exteriorFanlight, setExteriorFanlight] = react.useState({
|
|
1526
143
|
visible: false,
|
|
1527
144
|
height: 300,
|
|
1528
145
|
depth: 60,
|
|
1529
146
|
material: "exteriorFanlight_material"
|
|
1530
147
|
});
|
|
1531
|
-
const [occulus, setOcculus] =
|
|
148
|
+
const [occulus, setOcculus] = react.useState({
|
|
1532
149
|
visible: false,
|
|
1533
150
|
infillVisible: true,
|
|
1534
151
|
x1: 120,
|
|
@@ -1538,46 +155,46 @@ const ConfiguratorProvider = _ref => {
|
|
|
1538
155
|
material: "infill_material",
|
|
1539
156
|
depth: 20
|
|
1540
157
|
});
|
|
1541
|
-
const [frontCoverPanel, setFrontCoverPanel] =
|
|
158
|
+
const [frontCoverPanel, setFrontCoverPanel] = react.useState({
|
|
1542
159
|
visible: false,
|
|
1543
160
|
width: 73,
|
|
1544
161
|
height: 2200,
|
|
1545
162
|
depth: 12,
|
|
1546
163
|
material: "front_cover_material"
|
|
1547
164
|
});
|
|
1548
|
-
const [backCoverPanel, setBackCoverPanel] =
|
|
165
|
+
const [backCoverPanel, setBackCoverPanel] = react.useState({
|
|
1549
166
|
visible: false,
|
|
1550
167
|
width: 73,
|
|
1551
168
|
height: 2200,
|
|
1552
169
|
depth: 12,
|
|
1553
170
|
material: "back_cover_material"
|
|
1554
171
|
});
|
|
1555
|
-
const [glass, setGlass] =
|
|
172
|
+
const [glass, setGlass] = react.useState({
|
|
1556
173
|
visible: false,
|
|
1557
174
|
material: "infill_material",
|
|
1558
175
|
depth: 20
|
|
1559
176
|
});
|
|
1560
|
-
const [frameType, setFrameType] =
|
|
1561
|
-
const [bodyType, setBodyType] =
|
|
1562
|
-
const [exteriorFanlightType, setExteriorFanlightType] =
|
|
1563
|
-
const [testDoorMaterial, setTestDoorMaterial] =
|
|
1564
|
-
const [testFrameMaterial, setTestFrameMaterial] =
|
|
1565
|
-
const [testGasketMaterial, setTestGasketMaterial] =
|
|
1566
|
-
const [testInteriorFanlightMaterial, setTestInteriorFanlightMaterial] =
|
|
1567
|
-
const [testExteriorFanlightMaterial, setTestExteriorFanlightMaterial] =
|
|
1568
|
-
const [testOcculusInfillMaterial, setTestOcculusInfillMaterial] =
|
|
1569
|
-
const [testGlassInfillMaterial, setTestGlassInfillMaterial] =
|
|
1570
|
-
const [testDoorStopMaterial, setTestDoorStopMaterial] =
|
|
1571
|
-
const [testHingeMaterial, setTestHingeMaterial] =
|
|
1572
|
-
const [testFrontCoverPanelMaterial, setTestFrontCoverPanelMaterial] =
|
|
1573
|
-
const [testBackCoverPanelMaterial, setTestBackCoverPanelMaterial] =
|
|
177
|
+
const [frameType, setFrameType] = react.useState("AF20_40");
|
|
178
|
+
const [bodyType, setBodyType] = react.useState("40");
|
|
179
|
+
const [exteriorFanlightType, setExteriorFanlightType] = react.useState("WPFL");
|
|
180
|
+
const [testDoorMaterial, setTestDoorMaterial] = react.useState("brown");
|
|
181
|
+
const [testFrameMaterial, setTestFrameMaterial] = react.useState("black");
|
|
182
|
+
const [testGasketMaterial, setTestGasketMaterial] = react.useState("darkgrey");
|
|
183
|
+
const [testInteriorFanlightMaterial, setTestInteriorFanlightMaterial] = react.useState("grey");
|
|
184
|
+
const [testExteriorFanlightMaterial, setTestExteriorFanlightMaterial] = react.useState("metal");
|
|
185
|
+
const [testOcculusInfillMaterial, setTestOcculusInfillMaterial] = react.useState("glass");
|
|
186
|
+
const [testGlassInfillMaterial, setTestGlassInfillMaterial] = react.useState("glass");
|
|
187
|
+
const [testDoorStopMaterial, setTestDoorStopMaterial] = react.useState("black");
|
|
188
|
+
const [testHingeMaterial, setTestHingeMaterial] = react.useState("metal");
|
|
189
|
+
const [testFrontCoverPanelMaterial, setTestFrontCoverPanelMaterial] = react.useState("aluminum");
|
|
190
|
+
const [testBackCoverPanelMaterial, setTestBackCoverPanelMaterial] = react.useState("aluminum");
|
|
1574
191
|
|
|
1575
192
|
//
|
|
1576
|
-
const [parseMessage, setParseMessage] =
|
|
193
|
+
const [parseMessage, setParseMessage] = react.useState({
|
|
1577
194
|
type: "",
|
|
1578
195
|
text: ""
|
|
1579
196
|
});
|
|
1580
|
-
const handleParseCpid =
|
|
197
|
+
const handleParseCpid = react.useCallback(cpidToParse => {
|
|
1581
198
|
const showMessage = function (text) {
|
|
1582
199
|
let type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "error";
|
|
1583
200
|
setParseMessage({
|
|
@@ -1685,7 +302,7 @@ const ConfiguratorProvider = _ref => {
|
|
|
1685
302
|
}, [setBodyType, setExteriorFanlight, setExteriorFanlightType, setFrameType, setInteriorFanlight, setOcculus]);
|
|
1686
303
|
|
|
1687
304
|
// --- BodyType Effect ---
|
|
1688
|
-
|
|
305
|
+
react.useEffect(() => {
|
|
1689
306
|
let newDoorDepth = 40;
|
|
1690
307
|
let newMaterial = "brown";
|
|
1691
308
|
switch (bodyType) {
|
|
@@ -1712,7 +329,7 @@ const ConfiguratorProvider = _ref => {
|
|
|
1712
329
|
}, [bodyType]);
|
|
1713
330
|
|
|
1714
331
|
// --- FrameType Effect ---
|
|
1715
|
-
|
|
332
|
+
react.useEffect(() => {
|
|
1716
333
|
setIsFrameVisible(frameType !== "NOF");
|
|
1717
334
|
setGlassVisible(false);
|
|
1718
335
|
let newSettings = {};
|
|
@@ -1973,7 +590,7 @@ const ConfiguratorProvider = _ref => {
|
|
|
1973
590
|
}, [frameType]);
|
|
1974
591
|
|
|
1975
592
|
// --- Exterior Fanlight Logic ---
|
|
1976
|
-
|
|
593
|
+
react.useEffect(() => {
|
|
1977
594
|
if (!exteriorFanlight.visible) return;
|
|
1978
595
|
switch (exteriorFanlightType) {
|
|
1979
596
|
case "WPFL":
|
|
@@ -1996,7 +613,7 @@ const ConfiguratorProvider = _ref => {
|
|
|
1996
613
|
break;
|
|
1997
614
|
}
|
|
1998
615
|
}, [exteriorFanlight.visible, exteriorFanlightType, doorFrame.frameDepth, setTestExteriorFanlightMaterial, setExteriorFanlight]);
|
|
1999
|
-
|
|
616
|
+
react.useEffect(() => {
|
|
2000
617
|
const topThkValue = parseInt(doorFrame.topThk) || 0;
|
|
2001
618
|
const exteriorFanlightHeight = exteriorFanlight.visible ? exteriorFanlight.height : 0;
|
|
2002
619
|
const newDoorHeight = totalHeight - topThkValue - exteriorFanlightHeight;
|
|
@@ -2004,14 +621,14 @@ const ConfiguratorProvider = _ref => {
|
|
|
2004
621
|
doorHeight: newDoorHeight > 0 ? newDoorHeight : 0
|
|
2005
622
|
}));
|
|
2006
623
|
}, [totalHeight, doorFrame.topThk, exteriorFanlight.visible, exteriorFanlight.height]);
|
|
2007
|
-
|
|
624
|
+
react.useEffect(() => {
|
|
2008
625
|
const sidesThkValue = parseInt(doorFrame.sidesThk) || 0;
|
|
2009
626
|
const newDoorWidth = totalWidth - sidesThkValue * 2;
|
|
2010
627
|
setDoor(prevDoor => _objectSpread2(_objectSpread2({}, prevDoor), {}, {
|
|
2011
628
|
doorWidth: newDoorWidth > 0 ? newDoorWidth : 0
|
|
2012
629
|
}));
|
|
2013
630
|
}, [totalWidth, doorFrame.sidesThk]);
|
|
2014
|
-
return /*#__PURE__*/
|
|
631
|
+
return /*#__PURE__*/jsxRuntime.jsx(ConfiguratorContext.Provider, {
|
|
2015
632
|
value: {
|
|
2016
633
|
isPlaneVisible,
|
|
2017
634
|
setIsPlaneVisible,
|
|
@@ -2077,7 +694,7 @@ const ConfiguratorProvider = _ref => {
|
|
|
2077
694
|
});
|
|
2078
695
|
};
|
|
2079
696
|
const useConfigurator = () => {
|
|
2080
|
-
const context =
|
|
697
|
+
const context = react.useContext(ConfiguratorContext);
|
|
2081
698
|
if (!context) {
|
|
2082
699
|
throw new Error("useConfigurator must be used within a ConfiguratorProvider");
|
|
2083
700
|
}
|
|
@@ -2165,65 +782,65 @@ function GlassHinge(_ref) {
|
|
|
2165
782
|
const plateOffsetX = sideMultiplier * (plateWidth / 2 + frameSideWidth);
|
|
2166
783
|
const holeRadius = 10 / 1000;
|
|
2167
784
|
const holeSpacingX = 45 / 1000;
|
|
2168
|
-
return /*#__PURE__*/
|
|
785
|
+
return /*#__PURE__*/jsxRuntime.jsxs("group", {
|
|
2169
786
|
position: position,
|
|
2170
|
-
children: [/*#__PURE__*/
|
|
787
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("mesh", {
|
|
2171
788
|
material: material,
|
|
2172
789
|
castShadow: true,
|
|
2173
790
|
receiveShadow: true,
|
|
2174
791
|
"position-x": 0.01,
|
|
2175
|
-
children: /*#__PURE__*/
|
|
792
|
+
children: /*#__PURE__*/jsxRuntime.jsx("cylinderGeometry", {
|
|
2176
793
|
args: [pivotRadius, pivotRadius, pivotHeight, 32]
|
|
2177
794
|
})
|
|
2178
|
-
}), /*#__PURE__*/
|
|
795
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("group", {
|
|
2179
796
|
"position-x": plateOffsetX,
|
|
2180
|
-
children: [/*#__PURE__*/
|
|
797
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("mesh", {
|
|
2181
798
|
"position-z": -(doorDepthM / 2) - plateThickness / 2 - gasketThickness,
|
|
2182
799
|
material: material,
|
|
2183
800
|
castShadow: true,
|
|
2184
801
|
receiveShadow: true,
|
|
2185
|
-
children: /*#__PURE__*/
|
|
802
|
+
children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
|
|
2186
803
|
args: [plateWidth, plateHeight, plateThickness]
|
|
2187
804
|
})
|
|
2188
|
-
}), /*#__PURE__*/
|
|
805
|
+
}), /*#__PURE__*/jsxRuntime.jsx("mesh", {
|
|
2189
806
|
"position-z": -(doorDepthM / 2) - gasketThickness / 2,
|
|
2190
807
|
material: gasketMaterial,
|
|
2191
808
|
castShadow: true,
|
|
2192
809
|
receiveShadow: true,
|
|
2193
|
-
children: /*#__PURE__*/
|
|
810
|
+
children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
|
|
2194
811
|
args: [plateWidth, plateHeight, gasketThickness]
|
|
2195
812
|
})
|
|
2196
|
-
}), /*#__PURE__*/
|
|
813
|
+
}), /*#__PURE__*/jsxRuntime.jsx("mesh", {
|
|
2197
814
|
"position-z": doorDepthM / 2 + plateThickness / 2 + gasketThickness,
|
|
2198
815
|
castShadow: true,
|
|
2199
816
|
receiveShadow: true,
|
|
2200
|
-
children: /*#__PURE__*/
|
|
817
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(csg.Geometry, {
|
|
2201
818
|
useGroups: true,
|
|
2202
|
-
children: [/*#__PURE__*/
|
|
819
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(csg.Base, {
|
|
2203
820
|
material: material,
|
|
2204
|
-
children: /*#__PURE__*/
|
|
821
|
+
children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
|
|
2205
822
|
args: [plateWidth, plateHeight, plateThickness]
|
|
2206
823
|
})
|
|
2207
|
-
}), /*#__PURE__*/
|
|
824
|
+
}), /*#__PURE__*/jsxRuntime.jsx(csg.Subtraction, {
|
|
2208
825
|
position: [-sideMultiplier * (holeSpacingX / 2), 0, 0],
|
|
2209
826
|
rotation: [Math.PI / 2, 0, 0],
|
|
2210
|
-
children: /*#__PURE__*/
|
|
827
|
+
children: /*#__PURE__*/jsxRuntime.jsx("cylinderGeometry", {
|
|
2211
828
|
args: [holeRadius, holeRadius, plateThickness + 0.01, 32]
|
|
2212
829
|
})
|
|
2213
|
-
}), /*#__PURE__*/
|
|
830
|
+
}), /*#__PURE__*/jsxRuntime.jsx(csg.Subtraction, {
|
|
2214
831
|
position: [sideMultiplier * (holeSpacingX / 2), 0, 0],
|
|
2215
832
|
rotation: [Math.PI / 2, 0, 0],
|
|
2216
|
-
children: /*#__PURE__*/
|
|
833
|
+
children: /*#__PURE__*/jsxRuntime.jsx("cylinderGeometry", {
|
|
2217
834
|
args: [holeRadius, holeRadius, plateThickness + 0.01, 32]
|
|
2218
835
|
})
|
|
2219
836
|
})]
|
|
2220
837
|
})
|
|
2221
|
-
}), /*#__PURE__*/
|
|
838
|
+
}), /*#__PURE__*/jsxRuntime.jsx("mesh", {
|
|
2222
839
|
"position-z": doorDepthM / 2 + gasketThickness / 2,
|
|
2223
840
|
material: gasketMaterial,
|
|
2224
841
|
castShadow: true,
|
|
2225
842
|
receiveShadow: true,
|
|
2226
|
-
children: /*#__PURE__*/
|
|
843
|
+
children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
|
|
2227
844
|
args: [plateWidth, plateHeight, gasketThickness]
|
|
2228
845
|
})
|
|
2229
846
|
})]
|
|
@@ -2244,26 +861,26 @@ function DoorStopCuts(_ref2) {
|
|
|
2244
861
|
setName
|
|
2245
862
|
} = _ref2;
|
|
2246
863
|
if (!visible) return null;
|
|
2247
|
-
return /*#__PURE__*/
|
|
2248
|
-
children: [/*#__PURE__*/
|
|
864
|
+
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
865
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(csg.Subtraction, {
|
|
2249
866
|
name: "cut-top-".concat(setName),
|
|
2250
867
|
material: material,
|
|
2251
868
|
position: [0, height / 2 - stopWidth / 2 + 0.0001, stopPositionZ - centerZ],
|
|
2252
|
-
children: /*#__PURE__*/
|
|
869
|
+
children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
|
|
2253
870
|
args: [width + 0.01, stopWidth, stopDepth + 0.01]
|
|
2254
871
|
})
|
|
2255
|
-
}), /*#__PURE__*/
|
|
872
|
+
}), /*#__PURE__*/jsxRuntime.jsx(csg.Subtraction, {
|
|
2256
873
|
name: "cut-left-".concat(setName),
|
|
2257
874
|
material: material,
|
|
2258
875
|
position: [-width / 2 + stopWidth / 2 - 0.0001, 0, stopPositionZ - centerZ],
|
|
2259
|
-
children: /*#__PURE__*/
|
|
876
|
+
children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
|
|
2260
877
|
args: [stopWidth, height + 0.01, stopDepth + 0.01]
|
|
2261
878
|
})
|
|
2262
|
-
}), /*#__PURE__*/
|
|
879
|
+
}), /*#__PURE__*/jsxRuntime.jsx(csg.Subtraction, {
|
|
2263
880
|
name: "cut-right-".concat(setName),
|
|
2264
881
|
material: material,
|
|
2265
882
|
position: [width / 2 - stopWidth / 2 + 0.0001, 0, stopPositionZ - centerZ],
|
|
2266
|
-
children: /*#__PURE__*/
|
|
883
|
+
children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
|
|
2267
884
|
args: [stopWidth, height + 0.01, stopDepth + 0.01]
|
|
2268
885
|
})
|
|
2269
886
|
})]
|
|
@@ -2302,7 +919,7 @@ function DoorModels(_ref3) {
|
|
|
2302
919
|
glassDepth,
|
|
2303
920
|
handleParseCpid
|
|
2304
921
|
} = useConfigurator();
|
|
2305
|
-
|
|
922
|
+
react.useEffect(() => {
|
|
2306
923
|
if (doorName) {
|
|
2307
924
|
handleParseCpid(doorName);
|
|
2308
925
|
}
|
|
@@ -2338,26 +955,26 @@ function DoorModels(_ref3) {
|
|
|
2338
955
|
} = backCoverPanel;
|
|
2339
956
|
|
|
2340
957
|
// --- Material Logic ---
|
|
2341
|
-
const doorMaterial =
|
|
2342
|
-
const frameMaterial =
|
|
2343
|
-
const gasketMaterial =
|
|
958
|
+
const doorMaterial = react.useMemo(() => availableMaterials[testDoorMaterial] || availableMaterials[doorMaterialName] || placeholderMaterial, [testDoorMaterial, doorMaterialName]);
|
|
959
|
+
const frameMaterial = react.useMemo(() => availableMaterials[testFrameMaterial] || availableMaterials[frameMaterialName] || placeholderMaterialforFrames, [testFrameMaterial, frameMaterialName]);
|
|
960
|
+
const gasketMaterial = react.useMemo(() => availableMaterials[testGasketMaterial] || availableMaterials[gasketMaterialName] || new THREE__namespace.MeshStandardMaterial({
|
|
2344
961
|
color: "#111111"
|
|
2345
962
|
}), [testGasketMaterial, gasketMaterialName]);
|
|
2346
|
-
const doorStopMaterial =
|
|
963
|
+
const doorStopMaterial = react.useMemo(() => {
|
|
2347
964
|
return availableMaterials[testDoorStopMaterial] || availableMaterials[doorStopMaterialName || ""] || frameMaterial;
|
|
2348
965
|
}, [testDoorStopMaterial, doorStopMaterialName, frameType, frameMaterial]);
|
|
2349
|
-
const interiorFanlightMaterial =
|
|
2350
|
-
const exteriorFanlightMaterial =
|
|
2351
|
-
const occulusInfillMaterial =
|
|
2352
|
-
const glassInfillMaterial =
|
|
2353
|
-
const hingeBodyMaterial =
|
|
966
|
+
const interiorFanlightMaterial = react.useMemo(() => availableMaterials[testInteriorFanlightMaterial] || availableMaterials[interiorFanlightMaterialName] || placeholderMaterial, [testInteriorFanlightMaterial, interiorFanlightMaterialName]);
|
|
967
|
+
const exteriorFanlightMaterial = react.useMemo(() => availableMaterials[testExteriorFanlightMaterial] || availableMaterials[exteriorFanlightMaterialName] || placeholderMaterial, [testExteriorFanlightMaterial, exteriorFanlightMaterialName]);
|
|
968
|
+
const occulusInfillMaterial = react.useMemo(() => availableMaterials[testOcculusInfillMaterial] || availableMaterials[occulusInfillMaterialName] || placeholderMaterial, [testOcculusInfillMaterial, occulusInfillMaterialName]);
|
|
969
|
+
const glassInfillMaterial = react.useMemo(() => availableMaterials[testGlassInfillMaterial] || availableMaterials[glassInfillMaterialName] || placeholderMaterial, [testGlassInfillMaterial, glassInfillMaterialName]);
|
|
970
|
+
const hingeBodyMaterial = react.useMemo(() => availableMaterials[testHingeMaterial] || availableMaterials[hingeMaterialName] || new THREE__namespace.MeshStandardMaterial({
|
|
2354
971
|
color: "#d4d4d4",
|
|
2355
972
|
metalness: 1.0,
|
|
2356
973
|
roughness: 0.4
|
|
2357
974
|
}), [testHingeMaterial, hingeMaterialName]);
|
|
2358
|
-
const frontCoverPanelMaterial =
|
|
2359
|
-
const backCoverPanelMaterial =
|
|
2360
|
-
const hingeAccentMaterial =
|
|
975
|
+
const frontCoverPanelMaterial = react.useMemo(() => availableMaterials[testFrontCoverPanelMaterial] || availableMaterials[frontCoverPanelMaterialName] || placeholderMaterial, [testFrontCoverPanelMaterial, frontCoverPanelMaterialName]);
|
|
976
|
+
const backCoverPanelMaterial = react.useMemo(() => availableMaterials[testBackCoverPanelMaterial] || availableMaterials[backCoverPanelMaterialName] || placeholderMaterial, [testBackCoverPanelMaterial, backCoverPanelMaterialName]);
|
|
977
|
+
const hingeAccentMaterial = react.useMemo(() => new THREE__namespace.MeshStandardMaterial({
|
|
2361
978
|
color: "#1a1a1a",
|
|
2362
979
|
roughness: 0.1
|
|
2363
980
|
}), []);
|
|
@@ -2442,8 +1059,8 @@ function DoorModels(_ref3) {
|
|
|
2442
1059
|
const notchWidthM = notchWidthValue / 1000;
|
|
2443
1060
|
const notchDepthM = notchDepthValue / 1000;
|
|
2444
1061
|
const isOpeningIn = doorOpening === "in";
|
|
2445
|
-
const doorStopPositionZ =
|
|
2446
|
-
const gasketZPosition =
|
|
1062
|
+
const doorStopPositionZ = react.useMemo(() => isOpeningIn ? frameDepthM / 2 - doorStopOffsetFromEdgeM - doorStopDepthM / 2 : -frameDepthM / 2 + doorStopOffsetFromEdgeM + doorStopDepthM / 2, [isOpeningIn, frameDepthM, doorStopOffsetFromEdgeM, doorStopDepthM]);
|
|
1063
|
+
const gasketZPosition = react.useMemo(() => isOpeningIn ? doorStopPositionZ - doorStopDepthM / 2 - gasketDepthM / 2 : doorStopPositionZ + doorStopDepthM / 2 + gasketDepthM / 2, [isOpeningIn, doorStopPositionZ, doorStopDepthM, gasketDepthM]);
|
|
2447
1064
|
const secondDoorStopWidthM = secondDoorStopWidth / 1000;
|
|
2448
1065
|
const secondDoorStopDepthM = secondDoorStopDepth / 1000;
|
|
2449
1066
|
const secondDoorStopPositionZ = isOpeningIn ? frameDepthM / 2 - secondDoorStopDepthM / 2 : -frameDepthM / 2 + secondDoorStopDepthM / 2;
|
|
@@ -2451,7 +1068,7 @@ function DoorModels(_ref3) {
|
|
|
2451
1068
|
// Position the first glass panel against the primary doorstop
|
|
2452
1069
|
|
|
2453
1070
|
const secondGasketZPosition = isOpeningIn ? secondDoorStopPositionZ - secondDoorStopDepthM / 2 - gasketDepthM / 2 : secondDoorStopPositionZ + secondDoorStopDepthM / 2 + gasketDepthM / 2;
|
|
2454
|
-
const doorCenterZ =
|
|
1071
|
+
const doorCenterZ = react.useMemo(() => {
|
|
2455
1072
|
if (frameType === "WF_FLI") {
|
|
2456
1073
|
if (isOpeningIn) {
|
|
2457
1074
|
return frameDepthM / 2 - doorDepthM / 2;
|
|
@@ -2480,12 +1097,12 @@ function DoorModels(_ref3) {
|
|
|
2480
1097
|
const occulusHeightM = mainDoorHeightM - occulusY1M - occulusY2M;
|
|
2481
1098
|
const occulusPositionXM = (occulusX1M - occulusX2M) / 2;
|
|
2482
1099
|
const occulusPositionYM = (occulusY2M - occulusY1M) / 2;
|
|
2483
|
-
const [isOpen, setIsOpen] =
|
|
1100
|
+
const [isOpen, setIsOpen] = react.useState(false);
|
|
2484
1101
|
const hingeSideX = doorPivot === "left" ? -doorWidthM / 2 : doorWidthM / 2;
|
|
2485
1102
|
const leftGlass_Z = -frameDepthM / 2 + GlassPanelDepthM / 2 - GlassPanelDepthM;
|
|
2486
1103
|
const rightGlass_Z = frameDepthM / 2 - GlassPanelDepthM / 2 + GlassPanelDepthM;
|
|
2487
1104
|
// --- PIVOT ---
|
|
2488
|
-
const hingeZ =
|
|
1105
|
+
const hingeZ = react.useMemo(() => {
|
|
2489
1106
|
if (frameType === "WF_FLI") {
|
|
2490
1107
|
if (isOpeningIn) {
|
|
2491
1108
|
return doorCenterZ - doorDepthM / 2;
|
|
@@ -2495,7 +1112,7 @@ function DoorModels(_ref3) {
|
|
|
2495
1112
|
}
|
|
2496
1113
|
return isOpeningIn ? -frameDepthM / 2 : frameDepthM / 2;
|
|
2497
1114
|
}, [frameType, isOpeningIn, doorCenterZ, doorDepthM, frameDepthM]);
|
|
2498
|
-
const doorOffsetZ =
|
|
1115
|
+
const doorOffsetZ = react.useMemo(() => doorCenterZ - hingeZ, [doorCenterZ, hingeZ]);
|
|
2499
1116
|
const directionMultiplier = doorOpening === "in" ? 1 : -1;
|
|
2500
1117
|
const {
|
|
2501
1118
|
rotation
|
|
@@ -2543,10 +1160,10 @@ function DoorModels(_ref3) {
|
|
|
2543
1160
|
const barrelPartHeight = (hingeTotalHeightM - capHeightM * 2 - separatorHeightM) / 2;
|
|
2544
1161
|
|
|
2545
1162
|
// --- HINGE VISIBILITY LOGIC ---
|
|
2546
|
-
const isGlassDoor =
|
|
1163
|
+
const isGlassDoor = react.useMemo(() => ["SG8", "SG10", "SG12"].includes(bodyType), [bodyType]);
|
|
2547
1164
|
|
|
2548
1165
|
// Calculate evenly spaced hinge positions
|
|
2549
|
-
const standardHingeYPositions =
|
|
1166
|
+
const standardHingeYPositions = react.useMemo(() => {
|
|
2550
1167
|
const numHinges = 4;
|
|
2551
1168
|
const topMargin = 180 / 1000;
|
|
2552
1169
|
const bottomMargin = 180 / 1000;
|
|
@@ -2560,7 +1177,7 @@ function DoorModels(_ref3) {
|
|
|
2560
1177
|
}, [mainDoorHeightM]);
|
|
2561
1178
|
|
|
2562
1179
|
// Y positions for the new glass hinges
|
|
2563
|
-
const glassHingeYPositions =
|
|
1180
|
+
const glassHingeYPositions = react.useMemo(() => {
|
|
2564
1181
|
const topMargin = 250 / 1000;
|
|
2565
1182
|
const secondTopMargin = 450 / 1000;
|
|
2566
1183
|
const bottomMargin = 250 / 1000;
|
|
@@ -2569,7 +1186,7 @@ function DoorModels(_ref3) {
|
|
|
2569
1186
|
const bottom = -mainDoorHeightM / 2 + bottomMargin;
|
|
2570
1187
|
return [top, secondTop, bottom];
|
|
2571
1188
|
}, [mainDoorHeightM]);
|
|
2572
|
-
const isStandardHingeVisible =
|
|
1189
|
+
const isStandardHingeVisible = react.useMemo(() => {
|
|
2573
1190
|
if (isGlassDoor) return false;
|
|
2574
1191
|
if (!isFrameVisible) return false;
|
|
2575
1192
|
const invisibleFrameTypes = ["WDGF_WDG100", "WF_100", "WF_FLI"];
|
|
@@ -2578,345 +1195,345 @@ function DoorModels(_ref3) {
|
|
|
2578
1195
|
}
|
|
2579
1196
|
return true;
|
|
2580
1197
|
}, [isFrameVisible, frameType, isGlassDoor]);
|
|
2581
|
-
return /*#__PURE__*/
|
|
2582
|
-
children: [frontCoverPanel.visible && /*#__PURE__*/
|
|
1198
|
+
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1199
|
+
children: [frontCoverPanel.visible && /*#__PURE__*/jsxRuntime.jsxs("group", {
|
|
2583
1200
|
"position-z": frontArchitraveZ,
|
|
2584
|
-
children: [/*#__PURE__*/
|
|
1201
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("mesh", {
|
|
2585
1202
|
position: [0, topArchitraveY, 0],
|
|
2586
1203
|
castShadow: true,
|
|
2587
1204
|
material: frontCoverPanelMaterial,
|
|
2588
|
-
children: /*#__PURE__*/
|
|
1205
|
+
children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
|
|
2589
1206
|
args: [topArchitraveWidth, architraveProfileM, architraveDepthM]
|
|
2590
1207
|
})
|
|
2591
|
-
}), /*#__PURE__*/
|
|
1208
|
+
}), /*#__PURE__*/jsxRuntime.jsx("mesh", {
|
|
2592
1209
|
position: [leftArchitraveX, sideArchitraveCenterY, 0],
|
|
2593
1210
|
castShadow: true,
|
|
2594
1211
|
material: frontCoverPanelMaterial,
|
|
2595
|
-
children: /*#__PURE__*/
|
|
1212
|
+
children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
|
|
2596
1213
|
args: [architraveProfileM, sideArchitraveHeight, architraveDepthM]
|
|
2597
1214
|
})
|
|
2598
|
-
}), /*#__PURE__*/
|
|
1215
|
+
}), /*#__PURE__*/jsxRuntime.jsx("mesh", {
|
|
2599
1216
|
position: [rightArchitraveX, sideArchitraveCenterY, 0],
|
|
2600
1217
|
castShadow: true,
|
|
2601
1218
|
material: frontCoverPanelMaterial,
|
|
2602
|
-
children: /*#__PURE__*/
|
|
1219
|
+
children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
|
|
2603
1220
|
args: [architraveProfileM, sideArchitraveHeight, architraveDepthM]
|
|
2604
1221
|
})
|
|
2605
1222
|
})]
|
|
2606
|
-
}), backCoverPanel.visible && /*#__PURE__*/
|
|
1223
|
+
}), backCoverPanel.visible && /*#__PURE__*/jsxRuntime.jsxs("group", {
|
|
2607
1224
|
"position-z": backArchitraveZ,
|
|
2608
|
-
children: [/*#__PURE__*/
|
|
1225
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("mesh", {
|
|
2609
1226
|
position: [0, topArchitraveY, 0],
|
|
2610
1227
|
castShadow: true,
|
|
2611
1228
|
material: backCoverPanelMaterial,
|
|
2612
|
-
children: /*#__PURE__*/
|
|
1229
|
+
children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
|
|
2613
1230
|
args: [topArchitraveWidth, architraveProfileM, architraveDepthM]
|
|
2614
1231
|
})
|
|
2615
|
-
}), /*#__PURE__*/
|
|
1232
|
+
}), /*#__PURE__*/jsxRuntime.jsx("mesh", {
|
|
2616
1233
|
position: [leftArchitraveX, sideArchitraveCenterY, 0],
|
|
2617
1234
|
castShadow: true,
|
|
2618
1235
|
material: backCoverPanelMaterial,
|
|
2619
|
-
children: /*#__PURE__*/
|
|
1236
|
+
children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
|
|
2620
1237
|
args: [architraveProfileM, sideArchitraveHeight, architraveDepthM]
|
|
2621
1238
|
})
|
|
2622
|
-
}), /*#__PURE__*/
|
|
1239
|
+
}), /*#__PURE__*/jsxRuntime.jsx("mesh", {
|
|
2623
1240
|
position: [rightArchitraveX, sideArchitraveCenterY, 0],
|
|
2624
1241
|
castShadow: true,
|
|
2625
1242
|
material: backCoverPanelMaterial,
|
|
2626
|
-
children: /*#__PURE__*/
|
|
1243
|
+
children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
|
|
2627
1244
|
args: [architraveProfileM, sideArchitraveHeight, architraveDepthM]
|
|
2628
1245
|
})
|
|
2629
1246
|
})]
|
|
2630
|
-
}), exteriorFanlight.visible && /*#__PURE__*/
|
|
1247
|
+
}), exteriorFanlight.visible && /*#__PURE__*/jsxRuntime.jsx("mesh", {
|
|
2631
1248
|
position: [0, exteriorFanlightYPosition, exteriorFanlightZPosition],
|
|
2632
1249
|
castShadow: true,
|
|
2633
1250
|
material: exteriorFanlightMaterial,
|
|
2634
|
-
children: /*#__PURE__*/
|
|
1251
|
+
children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
|
|
2635
1252
|
args: [totalFrameWidth, exteriorFanlightHeightM, exteriorFanlightDepthM]
|
|
2636
1253
|
})
|
|
2637
|
-
}), isFrameVisible && /*#__PURE__*/
|
|
2638
|
-
children: [/*#__PURE__*/
|
|
1254
|
+
}), isFrameVisible && /*#__PURE__*/jsxRuntime.jsxs("group", {
|
|
1255
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("mesh", {
|
|
2639
1256
|
castShadow: true,
|
|
2640
1257
|
position: [0, topFrameCenterY, 0],
|
|
2641
|
-
children: /*#__PURE__*/
|
|
1258
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(csg.Geometry, {
|
|
2642
1259
|
useGroups: true,
|
|
2643
|
-
children: [/*#__PURE__*/
|
|
1260
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(csg.Base, {
|
|
2644
1261
|
name: "frame-base",
|
|
2645
1262
|
material: frameMaterial,
|
|
2646
|
-
children: /*#__PURE__*/
|
|
1263
|
+
children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
|
|
2647
1264
|
args: [doorWidthM, topFrameWidthM, frameDepthM]
|
|
2648
1265
|
})
|
|
2649
|
-
}), !["MXF_40", "MXF_50", "MXCAF_40", "MXCAF_50"].includes(frameType) && /*#__PURE__*/
|
|
1266
|
+
}), !["MXF_40", "MXF_50", "MXCAF_40", "MXCAF_50"].includes(frameType) && /*#__PURE__*/jsxRuntime.jsx(csg.Subtraction, {
|
|
2650
1267
|
name: "cut-exterior",
|
|
2651
1268
|
material: frameMaterial,
|
|
2652
1269
|
position: [0, notchposition, 0],
|
|
2653
|
-
children: /*#__PURE__*/
|
|
1270
|
+
children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
|
|
2654
1271
|
args: [doorWidthM + 0.01, notchWidthM, notchDepthM]
|
|
2655
1272
|
})
|
|
2656
1273
|
})]
|
|
2657
1274
|
})
|
|
2658
|
-
}), /*#__PURE__*/
|
|
1275
|
+
}), /*#__PURE__*/jsxRuntime.jsx("mesh", {
|
|
2659
1276
|
castShadow: true,
|
|
2660
1277
|
position: [-doorWidthM / 2 - sidesFrameWidthM / 2, sideFrameCenterY, 0],
|
|
2661
|
-
children: /*#__PURE__*/
|
|
1278
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(csg.Geometry, {
|
|
2662
1279
|
useGroups: true,
|
|
2663
|
-
children: [/*#__PURE__*/
|
|
1280
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(csg.Base, {
|
|
2664
1281
|
name: "frame-base",
|
|
2665
1282
|
material: frameMaterial,
|
|
2666
|
-
children: /*#__PURE__*/
|
|
1283
|
+
children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
|
|
2667
1284
|
args: [sidesFrameWidthM, totalFrameHeightM, frameDepthM]
|
|
2668
1285
|
})
|
|
2669
|
-
}), !["MXF_40", "MXF_50", "MXCAF_40", "MXCAF_50"].includes(frameType) && /*#__PURE__*/
|
|
1286
|
+
}), !["MXF_40", "MXF_50", "MXCAF_40", "MXCAF_50"].includes(frameType) && /*#__PURE__*/jsxRuntime.jsx(csg.Subtraction, {
|
|
2670
1287
|
name: "cut-exterior",
|
|
2671
1288
|
material: frameMaterial,
|
|
2672
1289
|
position: [-notchposition, 0, 0],
|
|
2673
|
-
children: /*#__PURE__*/
|
|
1290
|
+
children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
|
|
2674
1291
|
args: [notchWidthM, totalFrameHeightM + 0.01, notchDepthM]
|
|
2675
1292
|
})
|
|
2676
1293
|
})]
|
|
2677
1294
|
})
|
|
2678
|
-
}), /*#__PURE__*/
|
|
1295
|
+
}), /*#__PURE__*/jsxRuntime.jsx("mesh", {
|
|
2679
1296
|
castShadow: true,
|
|
2680
1297
|
position: [doorWidthM / 2 + sidesFrameWidthM / 2, sideFrameCenterY, 0],
|
|
2681
|
-
children: /*#__PURE__*/
|
|
1298
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(csg.Geometry, {
|
|
2682
1299
|
useGroups: true,
|
|
2683
|
-
children: [/*#__PURE__*/
|
|
1300
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(csg.Base, {
|
|
2684
1301
|
name: "frame-base",
|
|
2685
1302
|
material: frameMaterial,
|
|
2686
|
-
children: /*#__PURE__*/
|
|
1303
|
+
children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
|
|
2687
1304
|
args: [sidesFrameWidthM, totalFrameHeightM, frameDepthM]
|
|
2688
1305
|
})
|
|
2689
|
-
}), !["MXF_40", "MXF_50", "MXCAF_40", "MXCAF_50"].includes(frameType) && /*#__PURE__*/
|
|
1306
|
+
}), !["MXF_40", "MXF_50", "MXCAF_40", "MXCAF_50"].includes(frameType) && /*#__PURE__*/jsxRuntime.jsx(csg.Subtraction, {
|
|
2690
1307
|
name: "cut-exterior",
|
|
2691
1308
|
material: frameMaterial,
|
|
2692
1309
|
position: [notchposition, 0, 0],
|
|
2693
|
-
children: /*#__PURE__*/
|
|
1310
|
+
children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
|
|
2694
1311
|
args: [notchWidthM, totalFrameHeightM + 0.01, notchDepthM]
|
|
2695
1312
|
})
|
|
2696
1313
|
})]
|
|
2697
1314
|
})
|
|
2698
|
-
}), /*#__PURE__*/
|
|
1315
|
+
}), /*#__PURE__*/jsxRuntime.jsx("mesh", {
|
|
2699
1316
|
castShadow: true,
|
|
2700
1317
|
position: [0, totalOpeningHeightM / 2 - doorStopWidthM / 2, doorStopPositionZ],
|
|
2701
1318
|
material: doorStopMaterial,
|
|
2702
|
-
children: /*#__PURE__*/
|
|
1319
|
+
children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
|
|
2703
1320
|
args: [doorWidthM, doorStopWidthM, doorStopDepthM]
|
|
2704
1321
|
})
|
|
2705
|
-
}), /*#__PURE__*/
|
|
1322
|
+
}), /*#__PURE__*/jsxRuntime.jsx("mesh", {
|
|
2706
1323
|
castShadow: true,
|
|
2707
1324
|
position: [-doorWidthM / 2 + doorStopWidthM / 2, 0, doorStopPositionZ],
|
|
2708
1325
|
material: doorStopMaterial,
|
|
2709
|
-
children: /*#__PURE__*/
|
|
1326
|
+
children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
|
|
2710
1327
|
args: [doorStopWidthM, totalOpeningHeightM, doorStopDepthM]
|
|
2711
1328
|
})
|
|
2712
|
-
}), /*#__PURE__*/
|
|
1329
|
+
}), /*#__PURE__*/jsxRuntime.jsx("mesh", {
|
|
2713
1330
|
castShadow: true,
|
|
2714
1331
|
position: [doorWidthM / 2 - doorStopWidthM / 2, 0, doorStopPositionZ],
|
|
2715
1332
|
material: doorStopMaterial,
|
|
2716
|
-
children: /*#__PURE__*/
|
|
1333
|
+
children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
|
|
2717
1334
|
args: [doorStopWidthM, totalOpeningHeightM, doorStopDepthM]
|
|
2718
1335
|
})
|
|
2719
|
-
}), frameType !== "WF_FLI" && /*#__PURE__*/
|
|
2720
|
-
children: [/*#__PURE__*/
|
|
1336
|
+
}), frameType !== "WF_FLI" && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1337
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("mesh", {
|
|
2721
1338
|
castShadow: true,
|
|
2722
1339
|
position: [0, topGasketYPosition, gasketZPosition],
|
|
2723
1340
|
material: gasketMaterial,
|
|
2724
|
-
children: /*#__PURE__*/
|
|
1341
|
+
children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
|
|
2725
1342
|
args: [doorWidthM - 0.03, gasketWidthM + 0.005, gasketDepthM]
|
|
2726
1343
|
})
|
|
2727
|
-
}), /*#__PURE__*/
|
|
1344
|
+
}), /*#__PURE__*/jsxRuntime.jsx("mesh", {
|
|
2728
1345
|
castShadow: true,
|
|
2729
1346
|
position: [leftGasketXPosition - 0.005, -0.005, gasketZPosition],
|
|
2730
1347
|
material: gasketMaterial,
|
|
2731
|
-
children: /*#__PURE__*/
|
|
1348
|
+
children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
|
|
2732
1349
|
args: [gasketWidthM + 0.005, totalOpeningHeightM - 0.02, gasketDepthM]
|
|
2733
1350
|
})
|
|
2734
|
-
}), /*#__PURE__*/
|
|
1351
|
+
}), /*#__PURE__*/jsxRuntime.jsx("mesh", {
|
|
2735
1352
|
castShadow: true,
|
|
2736
1353
|
position: [rightGasketXPosition + 0.005, -0.005, gasketZPosition],
|
|
2737
1354
|
material: gasketMaterial,
|
|
2738
|
-
children: /*#__PURE__*/
|
|
1355
|
+
children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
|
|
2739
1356
|
args: [gasketWidthM + 0.005, totalOpeningHeightM - 0.02, gasketDepthM]
|
|
2740
1357
|
})
|
|
2741
1358
|
})]
|
|
2742
|
-
}), (frameType === "WDGF_WDG100" || frameType === "WF_100" || frameType === "WF_FLI") && /*#__PURE__*/
|
|
2743
|
-
children: [/*#__PURE__*/
|
|
2744
|
-
children: [/*#__PURE__*/
|
|
1359
|
+
}), (frameType === "WDGF_WDG100" || frameType === "WF_100" || frameType === "WF_FLI") && /*#__PURE__*/jsxRuntime.jsxs("group", {
|
|
1360
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("group", {
|
|
1361
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("mesh", {
|
|
2745
1362
|
castShadow: true,
|
|
2746
1363
|
position: [0, totalOpeningHeightM / 2 - secondDoorStopWidthM / 2, secondDoorStopPositionZ],
|
|
2747
1364
|
material: doorStopMaterial,
|
|
2748
|
-
children: /*#__PURE__*/
|
|
1365
|
+
children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
|
|
2749
1366
|
args: [doorWidthM, secondDoorStopWidthM, secondDoorStopDepthM]
|
|
2750
1367
|
})
|
|
2751
|
-
}), /*#__PURE__*/
|
|
1368
|
+
}), /*#__PURE__*/jsxRuntime.jsx("mesh", {
|
|
2752
1369
|
castShadow: true,
|
|
2753
1370
|
position: [-doorWidthM / 2 + secondDoorStopWidthM / 2, 0, secondDoorStopPositionZ],
|
|
2754
1371
|
material: doorStopMaterial,
|
|
2755
|
-
children: /*#__PURE__*/
|
|
1372
|
+
children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
|
|
2756
1373
|
args: [secondDoorStopWidthM, totalOpeningHeightM, secondDoorStopDepthM]
|
|
2757
1374
|
})
|
|
2758
|
-
}), /*#__PURE__*/
|
|
1375
|
+
}), /*#__PURE__*/jsxRuntime.jsx("mesh", {
|
|
2759
1376
|
castShadow: true,
|
|
2760
1377
|
position: [doorWidthM / 2 - secondDoorStopWidthM / 2, 0, secondDoorStopPositionZ],
|
|
2761
1378
|
material: doorStopMaterial,
|
|
2762
|
-
children: /*#__PURE__*/
|
|
1379
|
+
children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
|
|
2763
1380
|
args: [secondDoorStopWidthM, totalOpeningHeightM, secondDoorStopDepthM]
|
|
2764
1381
|
})
|
|
2765
1382
|
})]
|
|
2766
|
-
}), /*#__PURE__*/
|
|
2767
|
-
children: [/*#__PURE__*/
|
|
1383
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("group", {
|
|
1384
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("mesh", {
|
|
2768
1385
|
castShadow: true,
|
|
2769
1386
|
position: [0, secondTopGasketYPosition - 0.005, secondGasketZPosition],
|
|
2770
1387
|
material: gasketMaterial,
|
|
2771
|
-
children: /*#__PURE__*/
|
|
1388
|
+
children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
|
|
2772
1389
|
args: [doorWidthM - 0.03, gasketWidthM + 0.005, gasketDepthM]
|
|
2773
1390
|
})
|
|
2774
|
-
}), /*#__PURE__*/
|
|
1391
|
+
}), /*#__PURE__*/jsxRuntime.jsx("mesh", {
|
|
2775
1392
|
castShadow: true,
|
|
2776
1393
|
position: [secondLeftGasketXPosition - 0.005, -0.01, secondGasketZPosition],
|
|
2777
1394
|
material: gasketMaterial,
|
|
2778
|
-
children: /*#__PURE__*/
|
|
1395
|
+
children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
|
|
2779
1396
|
args: [gasketWidthM + 0.005, totalOpeningHeightM - 0.04, gasketDepthM]
|
|
2780
1397
|
})
|
|
2781
|
-
}), /*#__PURE__*/
|
|
1398
|
+
}), /*#__PURE__*/jsxRuntime.jsx("mesh", {
|
|
2782
1399
|
castShadow: true,
|
|
2783
1400
|
position: [secondRightGasketXPosition + 0.005, -0.01, secondGasketZPosition],
|
|
2784
1401
|
material: gasketMaterial,
|
|
2785
|
-
children: /*#__PURE__*/
|
|
1402
|
+
children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
|
|
2786
1403
|
args: [gasketWidthM + 0.004, totalOpeningHeightM - 0.04, gasketDepthM]
|
|
2787
1404
|
})
|
|
2788
1405
|
})]
|
|
2789
|
-
}), glassVisible && /*#__PURE__*/
|
|
2790
|
-
children: [/*#__PURE__*/
|
|
2791
|
-
children: [(frameType === "WDGF_WDG100" || frameType === "WF_100") && /*#__PURE__*/
|
|
1406
|
+
}), glassVisible && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1407
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("group", {
|
|
1408
|
+
children: [(frameType === "WDGF_WDG100" || frameType === "WF_100") && /*#__PURE__*/jsxRuntime.jsx("mesh", {
|
|
2792
1409
|
castShadow: true,
|
|
2793
1410
|
position: [0, topFrameCenterY - secondDoorStopWidthM / 2, leftGlass_Z],
|
|
2794
1411
|
material: glassInfillMaterial,
|
|
2795
|
-
children: /*#__PURE__*/
|
|
1412
|
+
children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
|
|
2796
1413
|
args: [doorWidthM - 2 * secondDoorStopWidthM, topFrameWidthM + secondDoorStopWidthM, GlassPanelDepthM]
|
|
2797
1414
|
})
|
|
2798
|
-
}), frameType !== "WDGF_WDG100" && frameType !== "WF_100" && /*#__PURE__*/
|
|
1415
|
+
}), frameType !== "WDGF_WDG100" && frameType !== "WF_100" && /*#__PURE__*/jsxRuntime.jsx("mesh", {
|
|
2799
1416
|
castShadow: true,
|
|
2800
1417
|
position: [0, topFrameCenterY, leftGlass_Z],
|
|
2801
1418
|
material: glassInfillMaterial,
|
|
2802
|
-
children: /*#__PURE__*/
|
|
1419
|
+
children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
|
|
2803
1420
|
args: [doorWidthM - 2 * secondDoorStopWidthM, topFrameWidthM, GlassPanelDepthM]
|
|
2804
1421
|
})
|
|
2805
|
-
}), /*#__PURE__*/
|
|
1422
|
+
}), /*#__PURE__*/jsxRuntime.jsx("mesh", {
|
|
2806
1423
|
castShadow: true,
|
|
2807
1424
|
position: [-doorWidthM / 2 - sidesFrameWidthM / 2 + secondDoorStopWidthM / 2, sideFrameCenterY, leftGlass_Z],
|
|
2808
1425
|
material: glassInfillMaterial,
|
|
2809
|
-
children: /*#__PURE__*/
|
|
1426
|
+
children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
|
|
2810
1427
|
args: [sidesFrameWidthM + secondDoorStopWidthM, totalFrameHeightM, GlassPanelDepthM]
|
|
2811
1428
|
})
|
|
2812
|
-
}), /*#__PURE__*/
|
|
1429
|
+
}), /*#__PURE__*/jsxRuntime.jsx("mesh", {
|
|
2813
1430
|
castShadow: true,
|
|
2814
1431
|
position: [doorWidthM / 2 + sidesFrameWidthM / 2 - secondDoorStopWidthM / 2, sideFrameCenterY, leftGlass_Z],
|
|
2815
1432
|
material: glassInfillMaterial,
|
|
2816
|
-
children: /*#__PURE__*/
|
|
1433
|
+
children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
|
|
2817
1434
|
args: [sidesFrameWidthM + secondDoorStopWidthM, totalFrameHeightM, GlassPanelDepthM]
|
|
2818
1435
|
})
|
|
2819
1436
|
})]
|
|
2820
|
-
}), /*#__PURE__*/
|
|
2821
|
-
children: [/*#__PURE__*/
|
|
1437
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("group", {
|
|
1438
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("mesh", {
|
|
2822
1439
|
castShadow: true,
|
|
2823
1440
|
position: [0, topFrameCenterY, rightGlass_Z],
|
|
2824
1441
|
material: glassInfillMaterial,
|
|
2825
|
-
children: /*#__PURE__*/
|
|
1442
|
+
children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
|
|
2826
1443
|
args: [doorWidthM, topFrameWidthM, GlassPanelDepthM]
|
|
2827
1444
|
})
|
|
2828
|
-
}), /*#__PURE__*/
|
|
1445
|
+
}), /*#__PURE__*/jsxRuntime.jsx("mesh", {
|
|
2829
1446
|
castShadow: true,
|
|
2830
1447
|
position: [-doorWidthM / 2 - sidesFrameWidthM / 2, sideFrameCenterY, rightGlass_Z],
|
|
2831
1448
|
material: glassInfillMaterial,
|
|
2832
|
-
children: /*#__PURE__*/
|
|
1449
|
+
children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
|
|
2833
1450
|
args: [sidesFrameWidthM, totalFrameHeightM, GlassPanelDepthM]
|
|
2834
1451
|
})
|
|
2835
|
-
}), /*#__PURE__*/
|
|
1452
|
+
}), /*#__PURE__*/jsxRuntime.jsx("mesh", {
|
|
2836
1453
|
castShadow: true,
|
|
2837
1454
|
position: [doorWidthM / 2 + sidesFrameWidthM / 2, sideFrameCenterY, rightGlass_Z],
|
|
2838
1455
|
material: glassInfillMaterial,
|
|
2839
|
-
children: /*#__PURE__*/
|
|
1456
|
+
children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
|
|
2840
1457
|
args: [sidesFrameWidthM, totalFrameHeightM, GlassPanelDepthM]
|
|
2841
1458
|
})
|
|
2842
1459
|
})]
|
|
2843
1460
|
})]
|
|
2844
1461
|
})]
|
|
2845
1462
|
})]
|
|
2846
|
-
}), interiorFanlight.visible && /*#__PURE__*/
|
|
1463
|
+
}), interiorFanlight.visible && /*#__PURE__*/jsxRuntime.jsx("mesh", {
|
|
2847
1464
|
position: [0, interiorFanlightYPosition, doorCenterZ],
|
|
2848
1465
|
castShadow: true,
|
|
2849
1466
|
material: interiorFanlightMaterial,
|
|
2850
|
-
children: /*#__PURE__*/
|
|
1467
|
+
children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
|
|
2851
1468
|
args: [doorWidthM, interiorFanlightHeightM, doorDepthM]
|
|
2852
1469
|
})
|
|
2853
|
-
}), isStandardHingeVisible && standardHingeYPositions.map((y, index) => /*#__PURE__*/
|
|
1470
|
+
}), isStandardHingeVisible && standardHingeYPositions.map((y, index) => /*#__PURE__*/jsxRuntime.jsxs("group", {
|
|
2854
1471
|
position: [hingeSideX, doorYPosition + y, hingeZ],
|
|
2855
|
-
children: [/*#__PURE__*/
|
|
1472
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("mesh", {
|
|
2856
1473
|
material: hingeBodyMaterial,
|
|
2857
1474
|
position: [0, separatorHeightM / 2 + barrelPartHeight / 2, 0],
|
|
2858
1475
|
castShadow: true,
|
|
2859
|
-
children: /*#__PURE__*/
|
|
1476
|
+
children: /*#__PURE__*/jsxRuntime.jsx("cylinderGeometry", {
|
|
2860
1477
|
args: [hingeRadiusM, hingeRadiusM, barrelPartHeight, 32]
|
|
2861
1478
|
})
|
|
2862
|
-
}), /*#__PURE__*/
|
|
1479
|
+
}), /*#__PURE__*/jsxRuntime.jsx("mesh", {
|
|
2863
1480
|
material: hingeAccentMaterial,
|
|
2864
1481
|
position: [0, separatorHeightM / 2 + barrelPartHeight + capHeightM / 2, 0],
|
|
2865
1482
|
castShadow: true,
|
|
2866
|
-
children: /*#__PURE__*/
|
|
1483
|
+
children: /*#__PURE__*/jsxRuntime.jsx("cylinderGeometry", {
|
|
2867
1484
|
args: [hingeRadiusM, hingeRadiusM, capHeightM, 32]
|
|
2868
1485
|
})
|
|
2869
1486
|
})]
|
|
2870
|
-
}, "frame-hinge-".concat(index))), /*#__PURE__*/
|
|
1487
|
+
}, "frame-hinge-".concat(index))), /*#__PURE__*/jsxRuntime.jsxs(three.a.group, {
|
|
2871
1488
|
position: [hingeSideX, doorYPosition, hingeZ],
|
|
2872
1489
|
rotation: rotation.to((x, y, z) => [x, y, z]),
|
|
2873
1490
|
onClick: handleClick,
|
|
2874
1491
|
onPointerOver: () => document.body.style.cursor = "pointer",
|
|
2875
1492
|
onPointerOut: () => document.body.style.cursor = "auto",
|
|
2876
|
-
children: [isStandardHingeVisible && standardHingeYPositions.map((y, index) => /*#__PURE__*/
|
|
1493
|
+
children: [isStandardHingeVisible && standardHingeYPositions.map((y, index) => /*#__PURE__*/jsxRuntime.jsxs("group", {
|
|
2877
1494
|
position: [0, y, 0],
|
|
2878
|
-
children: [/*#__PURE__*/
|
|
1495
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("mesh", {
|
|
2879
1496
|
material: hingeBodyMaterial,
|
|
2880
1497
|
position: [0, -separatorHeightM / 2 - barrelPartHeight / 2, 0],
|
|
2881
1498
|
castShadow: true,
|
|
2882
|
-
children: /*#__PURE__*/
|
|
1499
|
+
children: /*#__PURE__*/jsxRuntime.jsx("cylinderGeometry", {
|
|
2883
1500
|
args: [hingeRadiusM, hingeRadiusM, barrelPartHeight, 32]
|
|
2884
1501
|
})
|
|
2885
|
-
}), /*#__PURE__*/
|
|
1502
|
+
}), /*#__PURE__*/jsxRuntime.jsx("mesh", {
|
|
2886
1503
|
material: hingeAccentMaterial,
|
|
2887
1504
|
position: [0, -separatorHeightM / 2 - barrelPartHeight - capHeightM / 2, 0],
|
|
2888
1505
|
castShadow: true,
|
|
2889
|
-
children: /*#__PURE__*/
|
|
1506
|
+
children: /*#__PURE__*/jsxRuntime.jsx("cylinderGeometry", {
|
|
2890
1507
|
args: [hingeRadiusM, hingeRadiusM, capHeightM, 32]
|
|
2891
1508
|
})
|
|
2892
|
-
}), /*#__PURE__*/
|
|
1509
|
+
}), /*#__PURE__*/jsxRuntime.jsx("mesh", {
|
|
2893
1510
|
material: hingeAccentMaterial,
|
|
2894
1511
|
position: [0, 0, 0],
|
|
2895
1512
|
castShadow: true,
|
|
2896
|
-
children: /*#__PURE__*/
|
|
1513
|
+
children: /*#__PURE__*/jsxRuntime.jsx("cylinderGeometry", {
|
|
2897
1514
|
args: [hingeRadiusM, hingeRadiusM, separatorHeightM, 32]
|
|
2898
1515
|
})
|
|
2899
1516
|
})]
|
|
2900
|
-
}, "door-hinge-".concat(index))), isGlassDoor && isFrameVisible && glassHingeYPositions.map((y, index) => /*#__PURE__*/
|
|
1517
|
+
}, "door-hinge-".concat(index))), isGlassDoor && isFrameVisible && glassHingeYPositions.map((y, index) => /*#__PURE__*/jsxRuntime.jsx(GlassHinge, {
|
|
2901
1518
|
position: [0, y, doorOffsetZ],
|
|
2902
1519
|
pivot: doorPivot,
|
|
2903
1520
|
frameSideWidth: sidesFrameWidthM,
|
|
2904
1521
|
doorDepthM: doorDepthM,
|
|
2905
1522
|
material: hingeBodyMaterial,
|
|
2906
1523
|
gasketMaterial: gasketMaterial
|
|
2907
|
-
}, "glass-hinge-".concat(index))), /*#__PURE__*/
|
|
1524
|
+
}, "glass-hinge-".concat(index))), /*#__PURE__*/jsxRuntime.jsxs("group", {
|
|
2908
1525
|
position: [-hingeSideX, 0, doorOffsetZ],
|
|
2909
|
-
children: [/*#__PURE__*/
|
|
1526
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("mesh", {
|
|
2910
1527
|
castShadow: true,
|
|
2911
|
-
children: /*#__PURE__*/
|
|
1528
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(csg.Geometry, {
|
|
2912
1529
|
useGroups: true,
|
|
2913
|
-
children: [/*#__PURE__*/
|
|
1530
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(csg.Base, {
|
|
2914
1531
|
name: "door-base",
|
|
2915
1532
|
material: doorMaterial,
|
|
2916
|
-
children: /*#__PURE__*/
|
|
1533
|
+
children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
|
|
2917
1534
|
args: [doorWidthM, mainDoorHeightM, doorDepthM]
|
|
2918
1535
|
})
|
|
2919
|
-
}), /*#__PURE__*/
|
|
1536
|
+
}), /*#__PURE__*/jsxRuntime.jsx(DoorStopCuts, {
|
|
2920
1537
|
visible: frameType === "WDGF_WDG100" || frameType === "WF_100" || frameType === "WF_FLI",
|
|
2921
1538
|
width: doorWidthM,
|
|
2922
1539
|
height: totalOpeningHeightM,
|
|
@@ -2927,7 +1544,7 @@ function DoorModels(_ref3) {
|
|
|
2927
1544
|
glassDepthOffset: GlassPanelDepthM / 2,
|
|
2928
1545
|
material: doorMaterial,
|
|
2929
1546
|
setName: "1"
|
|
2930
|
-
}), /*#__PURE__*/
|
|
1547
|
+
}), /*#__PURE__*/jsxRuntime.jsx(DoorStopCuts, {
|
|
2931
1548
|
visible: frameType === "WDGF_WDG100" || frameType === "WF_100" || frameType === "WF_FLI",
|
|
2932
1549
|
width: doorWidthM,
|
|
2933
1550
|
height: totalOpeningHeightM,
|
|
@@ -2938,53 +1555,53 @@ function DoorModels(_ref3) {
|
|
|
2938
1555
|
glassDepthOffset: GlassPanelDepthM / 2,
|
|
2939
1556
|
material: doorMaterial,
|
|
2940
1557
|
setName: "2"
|
|
2941
|
-
}), glassVisible && /*#__PURE__*/
|
|
2942
|
-
children: [/*#__PURE__*/
|
|
1558
|
+
}), glassVisible && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1559
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("mesh", {
|
|
2943
1560
|
position: [0, 0, frontGlassOffsetZ],
|
|
2944
1561
|
castShadow: true,
|
|
2945
1562
|
material: glassInfillMaterial,
|
|
2946
|
-
children: /*#__PURE__*/
|
|
1563
|
+
children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
|
|
2947
1564
|
args: [doorWidthM, mainDoorHeightM, GlassPanelDepthM]
|
|
2948
1565
|
})
|
|
2949
|
-
}), frameType !== "WDGF_WDG100" && frameType !== "WF_100" && /*#__PURE__*/
|
|
1566
|
+
}), frameType !== "WDGF_WDG100" && frameType !== "WF_100" && /*#__PURE__*/jsxRuntime.jsx("mesh", {
|
|
2950
1567
|
position: [0, 0, backGlassOffsetZ],
|
|
2951
1568
|
castShadow: true,
|
|
2952
1569
|
material: glassInfillMaterial,
|
|
2953
|
-
children: /*#__PURE__*/
|
|
1570
|
+
children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
|
|
2954
1571
|
args: [doorWidthM, mainDoorHeightM, GlassPanelDepthM]
|
|
2955
1572
|
})
|
|
2956
|
-
}), (frameType === "WDGF_WDG100" || frameType === "WF_100") && /*#__PURE__*/
|
|
1573
|
+
}), (frameType === "WDGF_WDG100" || frameType === "WF_100") && /*#__PURE__*/jsxRuntime.jsx("mesh", {
|
|
2957
1574
|
position: [0, -secondDoorStopWidthM / 2, backGlassOffsetZ],
|
|
2958
1575
|
castShadow: true,
|
|
2959
1576
|
material: glassInfillMaterial,
|
|
2960
|
-
children: /*#__PURE__*/
|
|
1577
|
+
children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
|
|
2961
1578
|
args: [doorWidthM - 2 * secondDoorStopWidthM, mainDoorHeightM - secondDoorStopWidthM, GlassPanelDepthM]
|
|
2962
1579
|
})
|
|
2963
1580
|
})]
|
|
2964
|
-
}), occulus.visible && occulusWidthM > 0 && occulusHeightM > 0 && /*#__PURE__*/
|
|
1581
|
+
}), occulus.visible && occulusWidthM > 0 && occulusHeightM > 0 && /*#__PURE__*/jsxRuntime.jsx(csg.Subtraction, {
|
|
2965
1582
|
material: placeholderMaterial,
|
|
2966
1583
|
position: [occulusPositionXM, occulusPositionYM, 0],
|
|
2967
|
-
children: /*#__PURE__*/
|
|
1584
|
+
children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
|
|
2968
1585
|
args: [occulusWidthM, occulusHeightM, doorDepthM + 0.01]
|
|
2969
1586
|
})
|
|
2970
1587
|
})]
|
|
2971
1588
|
})
|
|
2972
|
-
}), occulus.visible && occulus.infillVisible && occulusWidthM > 0 && occulusHeightM > 0 && /*#__PURE__*/
|
|
1589
|
+
}), occulus.visible && occulus.infillVisible && occulusWidthM > 0 && occulusHeightM > 0 && /*#__PURE__*/jsxRuntime.jsx("mesh", {
|
|
2973
1590
|
position: [occulusPositionXM, occulusPositionYM, 0],
|
|
2974
1591
|
castShadow: true,
|
|
2975
1592
|
material: occulusInfillMaterial,
|
|
2976
|
-
children: /*#__PURE__*/
|
|
1593
|
+
children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
|
|
2977
1594
|
args: [occulusWidthM, occulusHeightM, occulusInfillDepthM]
|
|
2978
1595
|
})
|
|
2979
1596
|
})]
|
|
2980
1597
|
})]
|
|
2981
|
-
}), isPlaneVisible && /*#__PURE__*/
|
|
1598
|
+
}), isPlaneVisible && /*#__PURE__*/jsxRuntime.jsxs("mesh", {
|
|
2982
1599
|
receiveShadow: true,
|
|
2983
1600
|
rotation: [-Math.PI / 2, 0, 0],
|
|
2984
1601
|
position: [0, -totalOpeningHeightM / 2 - 0.01, 0],
|
|
2985
|
-
children: [/*#__PURE__*/
|
|
1602
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("planeGeometry", {
|
|
2986
1603
|
args: [10, 10]
|
|
2987
|
-
}), /*#__PURE__*/
|
|
1604
|
+
}), /*#__PURE__*/jsxRuntime.jsx("meshStandardMaterial", {
|
|
2988
1605
|
color: "#f9f9f9",
|
|
2989
1606
|
side: THREE__namespace.DoubleSide
|
|
2990
1607
|
})]
|
|
@@ -2997,8 +1614,8 @@ const DoorConfigurator = _ref => {
|
|
|
2997
1614
|
doorName,
|
|
2998
1615
|
showInterface = true
|
|
2999
1616
|
} = _ref;
|
|
3000
|
-
return /*#__PURE__*/
|
|
3001
|
-
children: /*#__PURE__*/
|
|
1617
|
+
return /*#__PURE__*/jsxRuntime.jsx(ConfiguratorProvider, {
|
|
1618
|
+
children: /*#__PURE__*/jsxRuntime.jsx(DoorModels, {
|
|
3002
1619
|
doorName: doorName
|
|
3003
1620
|
})
|
|
3004
1621
|
});
|