iflow-engine 3.9.212 → 3.9.213
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/iflow-engine.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('.bim-engine-wrapper{position:relative;width:100%;height:100%;font-family:sans-serif;box-sizing:border-box;overflow:hidden;background:linear-gradient(to bottom,#d6e0eb,#f6faff)}.bim-engine-opt-btn-container{z-index:100}.bim-construct-tree-btn{position:absolute;top:20px;left:20px!important;z-index:100}.bim-engine-footer-info{position:absolute;bottom:6px;left:10px;display:flex;align-items:center;gap:12px;z-index:1;font-family:system-ui,-apple-system,sans-serif;font-size:11px;letter-spacing:.3px;pointer-events:none;-webkit-user-select:none;user-select:none}.bim-engine-version{color:#00000040;white-space:nowrap}.bim-engine-stats{color:#00000059;white-space:nowrap}.bim-engine-size{position:absolute;bottom:6px;right:10px;font-size:11px;color:#00000059;pointer-events:none;-webkit-user-select:none;user-select:none;z-index:1;font-family:system-ui,-apple-system,sans-serif;letter-spacing:.3px}.versionText{position:absolute;right:10px;color:#86d9ff;z-index:1000;bottom:0;font-size:10px;background:transparent;pointer-events:none}.homeViewWrapper{position:absolute;cursor:pointer;pointer-events:auto;background-image:url(/assets/viewcube/home.png);background-size:100% 100%;background-repeat:no-repeat;background-color:#fff0;color:#fff;top:10px;right:100;width:20px;height:20px;z-index:999;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.bim-dialog{position:absolute;background:var(--bim-dialog-bg, var(--bim-bg-elevated));border:1px solid var(--bim-dialog-border-color, var(--bim-border-default));border-radius:var(--bim-dialog-radius, 4px);box-shadow:var(--bim-shadow-lg);display:flex;flex-direction:column;z-index:10001;color:var(--bim-dialog-text-color, var(--bim-text-secondary));overflow:hidden;min-width:200px;min-height:100px;pointer-events:auto}.bim-dialog-header{position:relative;min-height:58px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 10px 0 18px;cursor:default;-webkit-user-select:none;user-select:none;flex-shrink:0;border-bottom:1px solid var(--bim-border-subtle, var(--bim-dialog-border-color, var(--bim-border-default)));box-shadow:var(--bim-shadow-sm);z-index:1}.bim-dialog-header.draggable{cursor:move}.bim-dialog-title{flex:1;min-width:0;font-size:18px;font-weight:300;line-height:1.2;letter-spacing:.01em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--bim-dialog-title-color, var(--bim-text-primary))}.bim-dialog-close{display:flex;align-items:center;justify-content:center;width:38px;height:38px;cursor:pointer;color:var(--bim-text-secondary);border-radius:4px;transition:background-color .2s ease,color .2s ease,box-shadow .2s ease;flex-shrink:0;margin-left:8px}.bim-dialog-close:hover{color:var(--bim-text-primary);background-color:var(--bim-component-bg-hover, rgba(15, 23, 42, .06));box-shadow:inset 0 0 0 1px var(--bim-border-subtle, var(--bim-dialog-border-color, var(--bim-border-default)))}.bim-dialog-close svg{display:block;width:20px;height:20px}.bim-dialog-content{flex:1;overflow:auto;font-size:14px;color:var(--bim-dialog-text-color, var(--bim-text-secondary));background:var(--bim-dialog-bg, var(--bim-bg-elevated))}.bim-dialog-resize-handle{position:absolute;width:28px;height:28px;right:2px;bottom:2px;cursor:se-resize;z-index:10;border-radius:4px 0;transition:background-color .2s ease}.bim-dialog-resize-handle:hover{background:var(--bim-component-bg-hover, rgba(15, 23, 42, .04))}.bim-dialog-resize-handle:after{content:"";position:absolute;right:7px;bottom:7px;width:11px;height:11px;border-right:2px solid var(--bim-text-tertiary);border-bottom:2px solid var(--bim-text-tertiary)}.bim-dialog-resize-handle:before{content:"";position:absolute;right:11px;bottom:11px;width:6px;height:6px;border-right:2px solid var(--bim-text-tertiary);border-bottom:2px solid var(--bim-text-tertiary);opacity:.85}.bim-dialog-resize-handle:hover:after,.bim-dialog-resize-handle:hover:before{border-color:var(--bim-text-primary)}.bim-model-color-picker{position:fixed;z-index:10020;width:196px;padding:10px 12px 12px;box-sizing:border-box;border:1px solid var(--bim-model-color-picker-border, rgba(255, 255, 255, .14));border-radius:12px;background:var(--bim-model-color-picker-bg, rgba(24, 28, 34, .96));box-shadow:var(--bim-model-color-picker-shadow, 0 18px 48px rgba(0, 0, 0, .36));color:var(--bim-model-color-picker-text, #f4f7fb);-webkit-backdrop-filter:blur(18px);backdrop-filter:blur(18px);-webkit-user-select:none;user-select:none;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,system-ui,sans-serif}.bim-model-color-picker__header{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:10px}.bim-model-color-picker__title{font-size:13px;font-weight:600;letter-spacing:.02em;line-height:20px}.bim-model-color-picker__close{all:unset;display:flex;align-items:center;justify-content:center;flex:0 0 20px!important;width:20px!important;min-width:20px!important;max-width:20px!important;height:20px!important;min-height:20px!important;max-height:20px!important;box-sizing:border-box;padding:0!important;border:0!important;border-radius:4px;background:transparent!important;color:var(--bim-model-color-picker-muted, rgba(255, 255, 255, .82));cursor:pointer;font:600 16px/1 -apple-system,BlinkMacSystemFont,Segoe UI,system-ui,sans-serif;text-align:center;appearance:none!important}.bim-model-color-picker__close:hover{background:var(--bim-model-color-picker-btn-hover, rgba(255, 255, 255, .16));color:var(--bim-model-color-picker-text, #fff)}.bim-model-color-picker__presets{display:grid;grid-template-columns:repeat(4,24px);justify-content:space-between;gap:8px 10px;margin-bottom:12px}.bim-model-color-picker__swatch{display:block;width:24px;height:24px;min-width:24px;min-height:24px;box-sizing:border-box;padding:0;border:0;border-radius:999px;box-shadow:none;cursor:pointer;appearance:none;transition:transform .16s ease}.bim-model-color-picker__swatch:hover{transform:translateY(-1px) scale(1.08)}.bim-model-color-picker__opacity{display:block;margin-bottom:10px;color:var(--bim-model-color-picker-muted, rgba(255, 255, 255, .78));font-size:12px}.bim-model-color-picker__opacity-top{display:flex;align-items:center;justify-content:space-between;margin-bottom:6px}.bim-model-color-picker__opacity-value{color:var(--bim-model-color-picker-text, #f4f7fb);font-variant-numeric:tabular-nums}.bim-model-color-picker__opacity input{width:100%;height:16px;margin:0;padding:0;cursor:pointer;accent-color:var(--bim-model-color-picker-text, #2563eb)}.bim-model-color-picker__custom{display:flex;align-items:center;justify-content:space-between;gap:10px;color:var(--bim-model-color-picker-muted, rgba(255, 255, 255, .78));font-size:12px}.bim-model-color-picker__custom input{width:40px;height:24px;box-sizing:border-box;padding:2px;border:1px solid var(--bim-model-color-picker-border, rgba(255, 255, 255, .14));border-radius:8px;background:var(--bim-model-color-picker-input-bg, transparent);cursor:pointer}.bim-right-key{position:fixed;z-index:10000;display:none;background:transparent}.bim-right-key.visible{display:block}.bim-menu{display:flex;flex-direction:column;background:var(--bim-bg-elevated);border:1px solid var(--bim-border-default);border-radius:8px;padding:6px;margin:0;list-style:none;box-shadow:var(--bim-shadow-lg);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;-webkit-user-select:none;user-select:none;color:var(--bim-text-primary)}.bim-menu-group{display:flex;flex-direction:column}.bim-menu-divider{height:1px;background-color:var(--bim-divider);margin:4px 0}.bim-menu-item{display:flex;align-items:center;padding:8px 12px;cursor:pointer;transition:all .2s ease;font-size:13px;position:relative;color:var(--bim-text-primary);border-radius:6px}.bim-menu-item:hover{background-color:var(--bim-component-bg-hover)}.bim-menu-item.disabled{opacity:.5;cursor:not-allowed;pointer-events:none}.bim-menu-item-icon{display:none}.bim-menu.has-icons .bim-menu-item-icon{width:16px;height:16px;margin-right:8px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.bim-menu-item-icon svg{width:100%;height:100%;fill:currentColor}.bim-menu-item-label{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bim-menu-item-arrow{width:12px;height:12px;margin-left:8px;display:flex;align-items:center;justify-content:center;opacity:.7}.bim-menu-item-arrow svg{width:100%;height:100%;fill:currentColor}.radial-toolbar-wrapper{position:absolute;right:20px;bottom:20px;z-index:1000;pointer-events:none}.radial-main-btn,.radial-sub-btn{border:1px solid transparent;border-radius:9999px;display:flex;align-items:center;justify-content:center;cursor:pointer;pointer-events:auto;outline:none;transition:transform .22s ease,opacity .22s ease,box-shadow .22s ease,background-color .22s ease,color .22s ease}.radial-main-btn{position:absolute;right:0;bottom:0;width:var(--rt-main-size, 70px);height:var(--rt-main-size, 70px);background:var(--rt-main-bg, rgba(255, 255, 255, .92));border-color:var(--rt-main-border, rgba(203, 213, 225, .65));box-shadow:var(--rt-main-shadow, 0 4px 12px rgba(0, 0, 0, .12));color:var(--rt-main-icon, #334155)}.radial-main-btn:hover{transform:translateZ(0) scale(1.04);background:var(--rt-main-bg-hover, #ffffff);box-shadow:var(--rt-main-shadow-hover, 0 6px 20px rgba(0, 0, 0, .14));color:var(--rt-main-icon-hover, #1e293b)}.radial-main-btn:active{transform:translateZ(0) scale(.97)}.radial-main-btn svg{width:34px;height:34px}.radial-sub-btn{position:absolute;right:var(--rt-main-offset, 10px);bottom:var(--rt-main-offset, 10px);width:var(--rt-sub-size, 50px);height:var(--rt-sub-size, 50px);background:var(--rt-sub-bg, rgba(255, 255, 255, .9));border-color:var(--rt-sub-border, rgba(203, 213, 225, .65));box-shadow:var(--rt-sub-shadow, 0 2px 8px rgba(0, 0, 0, .1));color:var(--rt-sub-icon, #334155);opacity:0;transform:translate(0) scale(.76);transform-origin:center;--rt-delay-current: var(--rt-close-delay, 0s);transition-delay:var(--rt-delay-current)}.radial-toolbar-wrapper.is-active .radial-sub-btn{--rt-delay-current: var(--rt-open-delay, 0s);opacity:1;transform:translate(var(--rt-x),var(--rt-y)) scale(1)}.radial-sub-btn:hover{background:var(--rt-sub-bg-hover, var(--bim-primary, #2563eb));box-shadow:var(--rt-sub-shadow-hover, 0 4px 14px rgba(0, 0, 0, .16));color:var(--rt-sub-icon-hover, var(--bim-text-inverse, #ffffff))}.radial-sub-btn.is-active,.radial-sub-btn[data-active=true]{background:var(--bim-primary, #2563eb);border:1px solid var(--bim-primary-active, #1d4ed8);box-shadow:var(--bim-shadow-glow, 0 0 0 2px rgba(37, 99, 235, .28));color:var(--bim-text-inverse, #ffffff)}.radial-sub-btn.is-active:hover,.radial-sub-btn[data-active=true]:hover{background:var(--bim-primary-hover, #3b82f6)}.radial-sub-btn.is-active .radial-sub-btn-icon,.radial-sub-btn[data-active=true] .radial-sub-btn-icon{color:var(--bim-icon-inverse, #ffffff)}.radial-sub-btn:active{transform:translate(var(--rt-x),var(--rt-y)) scale(.94)}.radial-sub-btn-icon{width:22px;height:22px;display:flex;align-items:center;justify-content:center}.radial-sub-btn-icon svg{width:100%;height:100%}.bottom-dock-stack{position:absolute;left:50%;bottom:20px;transform:translate(-50%);width:0;height:0;z-index:1000;pointer-events:none}.bottom-dock-panel{position:absolute;left:50%;bottom:0;transform:translate(-50%);width:fit-content;max-width:calc(100vw - 40px);pointer-events:auto;border-radius:12px;border:1px solid var(--bd-border, rgba(148, 163, 184, .35));background:var(--bd-bg, rgba(255, 255, 255, .94));box-shadow:var(--bd-shadow, 0 2px 8px rgba(15, 23, 42, .1));transition:transform .22s ease,opacity .2s ease;overflow:visible;z-index:1}.bottom-dock-panel:hover,.bottom-dock-panel:focus-within{z-index:10}.bottom-dock-panel.is-entering{opacity:0}.bottom-dock-panel.is-leaving{opacity:0;pointer-events:none}.bottom-dock-panel-close{position:absolute;top:5px;right:5px;transform:translate(35%,-35%);z-index:2;width:16px;height:16px;border-radius:6px;border:1px solid transparent;background:transparent;color:var(--bd-close-color, #475569);display:inline-flex;align-items:center;justify-content:center;cursor:pointer;transition:background-color .16s ease,color .16s ease,border-color .16s ease}.bottom-dock-panel-close:hover{background:var(--bd-close-bg-hover, rgba(15, 23, 42, .08));color:var(--bd-close-color-hover, #0f172a);border-color:var(--bd-close-border-hover, rgba(148, 163, 184, .3))}.bottom-dock-panel-close:active{transform:translate(35%,-35%) scale(.96)}.bottom-dock-panel-body{min-height:50px;padding:10px;background:var(--bd-body-bg, transparent);width:fit-content;max-width:calc(100vw - 40px);box-sizing:border-box;border-radius:inherit}.bottom-dock-placeholder{border-radius:8px;border:1px dashed var(--bd-placeholder-border, rgba(148, 163, 184, .55));padding:10px;color:var(--bd-placeholder-text, #64748b);font-size:12px;line-height:1.5;text-align:center}.measure-dock-panel{width:fit-content;max-width:100%;padding:0;border-radius:8px;border:none;box-sizing:border-box;color:var(--bim-text-secondary, #475569);font-size:13px;line-height:1.5}.measure-dock-panel-main{display:block}.measure-dock-panel-settings{display:none;flex-direction:column;gap:6px;min-height:74px;box-sizing:border-box}.measure-dock-settings-row{display:flex;align-items:center;justify-content:space-between;gap:8px}.measure-dock-settings-label{color:var(--bim-text-secondary, #64748b);font-size:12px}.measure-dock-settings-select{width:88px;height:24px;border-radius:6px;border:1px solid rgba(148,163,184,.36);background:color-mix(in srgb,var(--bim-bg-inset, #edf1f6) 90%,#ffffff 10%);color:var(--bim-text-primary, #0f172a);font-size:12px;padding:0 6px;box-sizing:border-box}.measure-dock-settings-actions{display:flex;justify-content:flex-end;gap:8px}.measure-dock-settings-btn{height:24px;min-width:52px;border-radius:6px;border:1px solid rgba(148,163,184,.36);background:color-mix(in srgb,var(--bim-bg-inset, #edf1f6) 90%,#ffffff 10%);color:var(--bim-text-secondary, #64748b);font-size:12px;line-height:1;cursor:pointer}.measure-dock-settings-btn.is-save{border-color:color-mix(in srgb,var(--bim-primary, #4f88ff) 46%,transparent 54%);color:color-mix(in srgb,var(--bim-primary, #4f88ff) 78%,#6f9dff 22%)}.measure-dock-panel-top{display:flex;align-items:center;justify-content:space-between;gap:10px}.measure-dock-clearheight-options{display:none;flex-direction:column;gap:8px;margin-bottom:10px;padding:8px;border-radius:8px;border:1px solid rgba(148,163,184,.28);background:color-mix(in srgb,var(--bim-bg-inset, #edf1f6) 90%,#ffffff 10%)}.measure-dock-clearheight-options.is-visible{display:flex}.measure-dock-clearheight-group{display:flex;align-items:center;gap:8px}.measure-dock-clearheight-label{min-width:60px;color:var(--bim-text-secondary, #64748b);font-size:12px}.measure-dock-clearheight-buttons{display:flex;gap:8px}.measure-dock-clearheight-btn{height:28px;padding:0 10px;border-radius:6px;border:1px solid rgba(148,163,184,.36);background:color-mix(in srgb,var(--bim-bg-elevated, #f8fafc) 88%,#ffffff 12%);color:var(--bim-text-secondary, #64748b);font-size:12px;line-height:1;cursor:pointer;transition:all .15s ease}.measure-dock-clearheight-btn:hover{border-color:#94a3b88f}.measure-dock-clearheight-btn.is-active{border-color:color-mix(in srgb,var(--bim-primary, #4f88ff) 70%,#9db9ff 30%);background:color-mix(in srgb,var(--bim-primary-subtle, rgba(96, 140, 255, .18)) 72%,#ffffff 28%);color:color-mix(in srgb,var(--bim-primary, #4f88ff) 78%,#6f9dff 22%)}.measure-dock-panel-mode-zone{flex:1;min-width:0;display:flex;flex-direction:column;gap:10px}.measure-dock-panel-mode-row{display:grid;grid-template-columns:repeat(5,32px);gap:10px}.measure-dock-panel-mode-row-secondary{display:none}.measure-dock-panel-mode-btn{width:32px;height:32px;border-radius:8px;border:1px solid rgba(148,163,184,.28);background:color-mix(in srgb,var(--bim-bg-inset, #edf1f6) 92%,#ffffff 8%);color:color-mix(in srgb,var(--bim-text-secondary, #64748b) 94%,#475569 6%);display:inline-flex;align-items:center;justify-content:center;padding:0;box-sizing:border-box;cursor:pointer;transition:all .15s ease}.measure-dock-panel-mode-icon{width:20px;height:20px;display:inline-flex;align-items:center;justify-content:center}.measure-dock-panel-mode-icon svg{width:100%;height:100%;fill:currentColor}.measure-dock-panel-mode-btn:hover{border-color:#94a3b880;background:color-mix(in srgb,var(--bim-component-bg-hover, #dce5f2) 64%,#ffffff 36%)}.measure-dock-panel-mode-btn.is-active{border-color:color-mix(in srgb,var(--bim-primary, #4f88ff) 70%,#9db9ff 30%);color:color-mix(in srgb,var(--bim-primary, #4f88ff) 78%,#6f9dff 22%);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--bim-primary, #4f88ff) 35%,transparent 65%)}.measure-dock-panel-actions{flex:0 0 auto;display:flex;flex-direction:row;gap:10px;align-items:center}.measure-dock-panel-action-btn{width:32px;height:32px;border-radius:6px;border:1px solid rgba(148,163,184,.22);background:color-mix(in srgb,var(--bim-bg-inset, #edf1f6) 92%,#ffffff 8%);color:var(--bim-text-secondary, #475569);padding:0;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;transition:all .15s ease}.measure-dock-panel-action-btn:hover{border-color:#94a3b880;color:var(--bim-text-primary, #0f172a)}.measure-dock-panel-action-btn svg{width:18px;height:18px;fill:currentColor}.measure-dock-panel-action-expand{width:16px;height:32px}.measure-dock-panel-action-expand.is-expanded{height:74px}.measure-dock-panel-action-expand.is-collapsed{height:32px}.measure-dock-panel-action-clear{background:color-mix(in srgb,var(--bim-danger, #ef4444) 16%,#ffffff 84%);border-color:color-mix(in srgb,var(--bim-danger, #ef4444) 26%,transparent 74%);color:var(--bim-danger, #ef4444)}.measure-dock-panel-action-clear:hover{border-color:color-mix(in srgb,var(--bim-danger, #ef4444) 40%,transparent 60%);color:var(--bim-danger, #ef4444)}.measure-dock-panel-action-settings{color:color-mix(in srgb,var(--bim-text-primary, #0f172a) 86%,#000 14%)}.measure-dock-panel-mode-row .measure-dock-panel-action-btn{border-radius:8px}.measure-dock-panel-action-expand svg{transition:transform .15s ease}.measure-dock-panel-action-expand.is-expanded svg{transform:rotate(180deg)}.measure-dock-panel [data-tooltip]{position:relative}.measure-dock-panel [data-tooltip]:after{content:attr(data-tooltip);position:absolute;left:50%;bottom:calc(100% + 6px);transform:translate(-50%);padding:4px 8px;border-radius:6px;background:#0f172aeb;color:#f8fafc;font-size:12px;line-height:1.2;white-space:nowrap;pointer-events:none;opacity:0;visibility:hidden;z-index:8;transition:opacity 60ms ease}.measure-dock-panel [data-tooltip]:hover:after,.measure-dock-panel [data-tooltip]:focus-visible:after{opacity:1;visibility:visible}@media(max-width:720px){.measure-dock-panel-top{flex-direction:column}.measure-dock-clearheight-group{flex-direction:column;align-items:flex-start;gap:6px}.measure-dock-panel-actions{width:100%;flex-direction:row;justify-content:flex-end}.measure-dock-panel-action-btn,.measure-dock-panel-mode-btn{width:32px;height:32px}.measure-dock-panel-action-expand{width:16px;height:32px}.measure-dock-panel-action-expand.is-expanded{height:74px}}.section-dock-panel{position:relative;width:fit-content;max-width:100%;display:flex;flex-direction:column;gap:10px;color:var(--bim-text-secondary, #475569)}.section-dock-axis-panel{display:none;width:fit-content;border-radius:8px;padding:0;gap:10px}.section-dock-axis-panel.is-visible{display:flex}.section-dock-axis-btn{width:32px;height:32px;border-radius:8px;border:1px solid rgba(148,163,184,.28);background:color-mix(in srgb,var(--bim-bg-inset, #edf1f6) 92%,#ffffff 8%);color:color-mix(in srgb,var(--bim-text-secondary, #64748b) 94%,#475569 6%);font-size:16px;line-height:1;box-sizing:border-box;padding:0;cursor:pointer;transition:all .15s ease}.section-dock-axis-btn:hover{border-color:#94a3b880;background:color-mix(in srgb,var(--bim-component-bg-hover, #dce5f2) 64%,#ffffff 36%)}.section-dock-axis-btn.is-active{border-color:color-mix(in srgb,var(--bim-primary, #4f88ff) 70%,#9db9ff 30%);background:color-mix(in srgb,var(--bim-primary-subtle, rgba(96, 140, 255, .18)) 72%,#ffffff 28%);color:color-mix(in srgb,var(--bim-primary, #4f88ff) 78%,#6f9dff 22%)}.section-dock-main{display:flex;align-items:center;gap:10px;padding:0;border-radius:8px}.section-dock-types,.section-dock-tools{display:flex;align-items:center;gap:10px}.section-dock-divider{width:1px;height:32px;background:color-mix(in srgb,var(--bim-border-default, #cbd5e1) 84%,transparent 16%)}.section-dock-divider.is-hidden{display:none}.section-dock-type-btn,.section-dock-tool-btn{width:32px;height:32px;border:1px solid rgba(148,163,184,.28);border-radius:8px;background:color-mix(in srgb,var(--bim-bg-inset, #edf1f6) 92%,#ffffff 8%);color:color-mix(in srgb,var(--bim-text-secondary, #64748b) 94%,#475569 6%);display:inline-flex;align-items:center;justify-content:center;cursor:pointer;box-sizing:border-box;padding:0;transition:all .15s ease}.section-dock-type-btn:hover,.section-dock-tool-btn:hover{border-color:var(--bim-border-strong, rgba(100, 116, 139, .6));background:color-mix(in srgb,var(--bim-component-bg-hover, #dce5f2) 64%,#ffffff 36%)}.section-dock-type-btn.is-active,.section-dock-tool-btn.is-active{border-color:color-mix(in srgb,var(--bim-primary, #4f88ff) 70%,#9db9ff 30%);color:color-mix(in srgb,var(--bim-primary, #4f88ff) 78%,#6f9dff 22%)}.section-dock-type-icon,.section-dock-tool-icon{width:20px;height:20px;display:inline-flex;align-items:center;justify-content:center}.section-dock-type-icon svg,.section-dock-tool-icon svg{width:100%;height:100%;fill:currentColor}.section-dock-panel [data-tooltip]{position:relative}.section-dock-panel [data-tooltip]:after{content:attr(data-tooltip);position:absolute;left:50%;bottom:calc(100% + 6px);transform:translate(-50%);padding:4px 8px;border-radius:6px;background:#0f172aeb;color:#f8fafc;font-size:12px;line-height:1.2;white-space:nowrap;pointer-events:none;opacity:0;visibility:hidden;z-index:8;transition:opacity 60ms ease}.section-dock-panel [data-tooltip]:hover:after,.section-dock-panel [data-tooltip]:focus-visible:after{opacity:1;visibility:visible}.section-dock-toast{position:absolute;left:50%;top:calc(100% + 8px);transform:translate(-50%) translateY(-4px);padding:6px 10px;border-radius:8px;background:#0f172aeb;color:#f8fafc;font-size:12px;line-height:1.2;white-space:nowrap;pointer-events:none;opacity:0;visibility:hidden;transition:opacity .15s ease,transform .15s ease;z-index:9}.section-dock-toast.is-visible{opacity:1;visibility:visible;transform:translate(-50%) translateY(0)}.walk-dock-panel{display:flex;align-items:center;gap:10px;padding:0;background:transparent;border:none;border-radius:8px;box-shadow:none;color:var(--bim-text-secondary, #64748b);-webkit-user-select:none;user-select:none}.walk-dock-panel .walk-divider{height:32px;width:1px;background:var(--bim-divider);flex-shrink:0}.walk-dock-left{display:flex;gap:10px}.walk-dock-settings{display:flex;align-items:center;gap:10px;flex:1}.walk-icon-btn{position:relative;width:32px;height:32px;display:flex;align-items:center;justify-content:center;padding:0;border-radius:8px;border:1px solid rgba(148,163,184,.28);background:color-mix(in srgb,var(--bim-bg-inset, #edf1f6) 92%,#ffffff 8%);color:color-mix(in srgb,var(--bim-text-secondary, #64748b) 94%,#475569 6%);cursor:pointer;transition:all .2s ease}.walk-icon-btn[data-tooltip]:after{content:attr(data-tooltip);position:absolute;left:50%;bottom:calc(100% + 8px);z-index:10;transform:translate(-50%) translateY(4px);padding:4px 8px;border-radius:6px;background:color-mix(in srgb,var(--bim-bg-elevated, #1f2937) 94%,#000000 6%);color:var(--bim-text-primary, #ffffff);box-shadow:var(--bim-shadow-lg, 0 10px 24px rgba(0, 0, 0, .22));font-size:12px;line-height:1.4;white-space:nowrap;pointer-events:none;opacity:0;transition:opacity .16s ease,transform .16s ease}.walk-icon-btn[data-tooltip]:before{content:"";position:absolute;left:50%;bottom:calc(100% + 3px);z-index:10;transform:translate(-50%) translateY(4px);border:5px solid transparent;border-top-color:color-mix(in srgb,var(--bim-bg-elevated, #1f2937) 94%,#000000 6%);pointer-events:none;opacity:0;transition:opacity .16s ease,transform .16s ease}.walk-icon-btn[data-tooltip]:hover:after,.walk-icon-btn[data-tooltip]:hover:before,.walk-icon-btn[data-tooltip]:focus-visible:after,.walk-icon-btn[data-tooltip]:focus-visible:before{opacity:1;transform:translate(-50%) translateY(0)}.walk-icon-btn:hover{border-color:#94a3b880;background:color-mix(in srgb,var(--bim-component-bg-hover, #dce5f2) 64%,#ffffff 36%)}.walk-icon-btn.active{border-color:color-mix(in srgb,var(--bim-primary, #4f88ff) 70%,#9db9ff 30%);background:color-mix(in srgb,var(--bim-primary-subtle, rgba(96, 140, 255, .18)) 72%,#ffffff 28%);color:color-mix(in srgb,var(--bim-primary, #4f88ff) 78%,#6f9dff 22%)}.walk-icon-btn svg{width:20px;height:20px}.walk-icon-btn.active svg{fill:currentColor}.walk-speed-control{display:flex;align-items:center;gap:8px}.walk-speed-label,.walk-checkbox-label,.walk-select-label{font-size:12px;color:var(--bim-text-primary);white-space:nowrap}.walk-speed-group{display:flex;align-items:center;gap:8px;padding:2px;border:1px solid rgba(148,163,184,.28);background:color-mix(in srgb,var(--bim-bg-inset, #edf1f6) 92%,#ffffff 8%);border-radius:6px}.walk-speed-btn{width:24px;height:24px;font-size:14px;line-height:1;padding:0;display:inline-flex;align-items:center;justify-content:center;border:1px solid rgba(148,163,184,.28);background:color-mix(in srgb,var(--bim-bg-elevated, #f8fafc) 88%,#ffffff 12%);color:var(--bim-text-primary, #0f172a);border-radius:4px;cursor:pointer;transition:all .2s ease}.walk-speed-btn:hover{border-color:#94a3b880}.walk-speed-btn:disabled{opacity:.5;cursor:not-allowed}.walk-speed-display{min-width:30px;font-size:12px;color:var(--bim-text-primary, #0f172a);text-align:center;font-weight:700}.walk-checkbox-wrapper{display:flex;align-items:center;gap:8px;cursor:pointer}.walk-checkbox{width:14px;height:14px;accent-color:var(--bim-primary, #3b82f6);cursor:pointer}.walk-checkbox:disabled,.walk-checkbox-wrapper input:disabled+.walk-checkbox-label{opacity:.5;cursor:not-allowed}.walk-select-wrapper{display:flex;align-items:center;gap:8px}.walk-select{min-width:90px;height:24px;padding:2px 8px;font-size:12px;border:1px solid rgba(148,163,184,.28);background:color-mix(in srgb,var(--bim-bg-inset, #edf1f6) 92%,#ffffff 8%);color:var(--bim-text-primary, #0f172a);border-radius:6px;cursor:pointer}.walk-select option{background:var(--bim-bg-elevated);color:var(--bim-text-primary)}.walk-exit-btn{height:32px;padding:0 12px;border-radius:8px;font-size:12px;background:var(--bim-primary);border:none;color:var(--bim-text-inverse);font-weight:600;cursor:pointer;transition:all .2s ease;white-space:nowrap}.walk-exit-btn:hover{background:var(--bim-primary-hover);transform:scale(1.02)}.walk-path-panel{padding:16px;box-sizing:border-box}.walk-path-btn{border:none;border-radius:6px;cursor:pointer;font-size:14px;transition:all .2s;box-sizing:border-box}.walk-path-btn-group{display:flex;gap:8px;margin-top:16px}.walk-path-btn-play{flex:1;height:32px;padding:0 16px;background:var(--bim-primary, #3b82f6);color:#fff}.walk-path-btn-play:hover:not(:disabled){opacity:.9}.walk-path-btn-play:disabled{opacity:.5;cursor:not-allowed}.walk-path-btn-stop{flex:1;height:32px;padding:0 16px;background:#ef4444;color:#fff}.walk-path-btn-stop:hover:not(:disabled){opacity:.9}.walk-path-btn-stop:disabled{opacity:.5;cursor:not-allowed}.walk-path-btn-small{height:28px;padding:0 12px;font-size:12px;background:var(--bim-bg-elevated, #1f2d3e);color:var(--bim-text-primary, #fff);border:1px solid var(--bim-border-default, #334155)}.walk-path-btn-small:hover{background:var(--bim-border-default, #334155)}.walk-path-btn-danger{color:#ef4444}.walk-path-settings{display:flex;flex-direction:column;gap:12px;margin-bottom:16px}.walk-path-form-group{display:flex;flex-direction:column;gap:6px}.walk-path-form-group label{font-size:12px;color:var(--bim-text-secondary, #94a3b8)}.walk-path-form-group-inline{flex-direction:row;align-items:center}.walk-path-input{padding:8px 12px;border:1px solid var(--bim-border-default, #334155);border-radius:4px;background:var(--bim-bg-elevated, #1f2d3e);color:var(--bim-text-primary, #fff);font-size:14px;width:100%;box-sizing:border-box}.walk-path-input:focus{outline:none;border-color:var(--bim-primary, #3b82f6)}.walk-path-input-wrapper{display:flex;align-items:center;gap:8px}.walk-path-input-wrapper .walk-path-input{flex:1}.walk-path-unit{color:var(--bim-text-secondary, #94a3b8);font-size:14px}.walk-path-checkbox{width:16px;height:16px;margin-right:8px}.walk-path-points-section{margin-bottom:16px}.walk-path-points-toolbar{display:flex;gap:8px;margin-bottom:12px}.walk-path-points-list{height:200px;overflow-y:auto;display:flex;flex-direction:column;gap:8px}.walk-path-empty{text-align:center;padding:32px 16px;color:var(--bim-text-secondary, #94a3b8);font-size:14px}.walk-path-point-item{display:flex;justify-content:space-between;align-items:center;padding:6px 12px;background:var(--bim-bg-elevated, #1f2d3e);border-radius:4px;transition:all .2s}.walk-path-point-item:hover{background:var(--bim-border-default, #334155)}.walk-path-point-item:hover .walk-path-point-actions{opacity:1}.walk-path-point-item-active{background:var(--bim-primary, #3b82f6)}.walk-path-point-item-active .walk-path-point-name{color:#fff}.walk-path-point-item-active .walk-path-point-actions{opacity:1}.walk-path-point-name{font-size:14px;color:var(--bim-text-primary, #fff)}.walk-path-point-actions{display:flex;gap:8px;opacity:0;transition:opacity .2s}.walk-path-btn-icon{width:28px;height:28px;border:none;border-radius:4px;background:transparent;color:var(--bim-text-primary, #fff);cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:14px}.walk-path-btn-icon:hover{background:#ffffff1a}.walk-path-btn-icon-danger:hover{background:#ef444433;color:#ef4444}.model-calibration-dock-panel{width:min(760px,calc(100vw - 72px));color:var(--mcal-text-primary, #0f172a);font-size:12px;line-height:1.35}.model-calibration-btn{height:24px;border-radius:6px;border:1px solid color-mix(in srgb,var(--mcal-border, rgba(148, 163, 184, .35)) 88%,transparent 12%);background:color-mix(in srgb,var(--mcal-bg-elevated, #f8fafc) 90%,transparent 10%);color:var(--mcal-text-secondary, #64748b);font-size:12px;line-height:1;padding:0 8px;cursor:pointer;transition:background-color .15s ease,border-color .15s ease,color .15s ease,transform .15s ease}.model-calibration-btn:hover{border-color:color-mix(in srgb,var(--mcal-primary, #4f88ff) 38%,var(--mcal-border, rgba(148, 163, 184, .35)) 62%);color:var(--mcal-text-primary, #0f172a)}.model-calibration-btn:active{transform:translateY(1px)}.model-calibration-btn.is-primary{border-color:color-mix(in srgb,var(--mcal-primary, #4f88ff) 58%,transparent 42%);background:color-mix(in srgb,var(--mcal-primary-subtle, rgba(96, 140, 255, .18)) 82%,var(--mcal-bg-elevated, #f8fafc) 18%);color:color-mix(in srgb,var(--mcal-primary, #4f88ff) 80%,var(--mcal-text-primary, #0f172a) 20%)}.model-calibration-btn.is-error{border-color:#ef4444b8;color:#dc2626}.model-calibration-table-wrap{position:relative;max-height:176px;overflow:auto;border-radius:9px;border:1px solid color-mix(in srgb,var(--mcal-border, rgba(148, 163, 184, .35)) 80%,transparent 20%);background:color-mix(in srgb,var(--mcal-bg-inset, #edf1f6) 72%,transparent 28%)}.model-calibration-table{width:100%;min-width:620px;border-collapse:collapse}.model-calibration-table th,.model-calibration-table td{padding:5px 6px;border-bottom:1px solid color-mix(in srgb,var(--mcal-border, rgba(148, 163, 184, .35)) 56%,transparent 44%);text-align:left;vertical-align:middle}.model-calibration-table th{position:sticky;top:0;z-index:1;color:var(--mcal-text-secondary, #64748b);background:color-mix(in srgb,var(--mcal-bg-elevated, #f8fafc) 88%,transparent 12%);font-size:11px;font-weight:600;white-space:nowrap}.model-calibration-table tbody tr:last-child td{border-bottom:none}.model-calibration-model-cell{width:128px;max-width:128px}.model-calibration-model-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:116px}.model-calibration-model-name{color:var(--mcal-text-primary, #0f172a);font-weight:600}.model-calibration-input-cell{width:64px}.model-calibration-input{width:58px;height:24px;border-radius:6px;border:1px solid color-mix(in srgb,var(--mcal-border, rgba(148, 163, 184, .35)) 86%,transparent 14%);background:color-mix(in srgb,var(--mcal-bg-elevated, #f8fafc) 90%,transparent 10%);color:var(--mcal-text-primary, #0f172a);font-size:12px;padding:0 6px;box-sizing:border-box}.model-calibration-input:focus{outline:none;border-color:color-mix(in srgb,var(--mcal-primary, #4f88ff) 68%,transparent 32%);box-shadow:0 0 0 2px color-mix(in srgb,var(--mcal-primary-subtle, rgba(96, 140, 255, .18)) 80%,transparent 20%)}.model-calibration-action-cell{width:66px;white-space:nowrap}.model-calibration-action-cell .model-calibration-btn+.model-calibration-btn{margin-left:4px}.model-calibration-icon-btn{position:relative;width:26px;min-width:26px;padding:0;font-size:14px;font-weight:700}.model-calibration-icon-btn:after{content:attr(data-tooltip);position:absolute;left:50%;bottom:calc(100% + 6px);transform:translate(-50%,3px);opacity:0;pointer-events:none;padding:4px 7px;border-radius:6px;background:color-mix(in srgb,var(--mcal-text-primary, #0f172a) 92%,transparent 8%);color:color-mix(in srgb,var(--mcal-bg-elevated, #f8fafc) 96%,transparent 4%);font-size:11px;font-weight:500;line-height:1;white-space:nowrap;box-shadow:0 4px 12px #0f172a29;transition:opacity .12s ease,transform .12s ease;z-index:20}.model-calibration-icon-btn:hover:after,.model-calibration-icon-btn:focus-visible:after{opacity:1;transform:translate(-50%)}.model-calibration-empty{display:none;padding:18px 24px;color:var(--mcal-text-secondary, #64748b);text-align:center}.model-calibration-empty.is-visible{display:block}@media(max-width:760px){.model-calibration-dock-panel{width:calc(100vw - 44px)}.model-calibration-table-wrap{max-height:220px}}.component-tree-drawer{--bim-component-tree-bg: #ffffff;--bim-component-tree-blur: 0px;--bim-component-tree-border: rgba(148, 163, 184, .28);--bim-component-tree-shadow: 0 14px 36px rgba(15, 23, 42, .08);--bim-component-tree-text: #0f172a;--bim-component-tree-muted: #475569;--bim-component-tree-tab-bg: #f8fafc;--bim-component-tree-tab-hover: #f1f5f9;--bim-component-tree-tab-active: #eff6ff;--bim-component-tree-tab-active-border: #3b82f6;--bim-component-tree-tab-active-text: #1d4ed8;--bim-component-tree-close-bg: #f8fafc;--bim-component-tree-close-hover: #eef2f7;--bim-component-tree-page-title: var(--bim-component-tree-text);--bim-component-tree-page-description: var(--bim-component-tree-muted);--bim-component-tree-surface: #ffffff;--bim-component-tree-surface-border: rgba(148, 163, 184, .14);--bim-component-tree-subtab-nav-bg: #e2e8f0;--bim-component-tree-subtab-nav-border: rgba(148, 163, 184, .26);--bim-component-tree-subtab-text: #334155;--bim-component-tree-subtab-hover-bg: rgba(255, 255, 255, .72);--bim-component-tree-subtab-hover-text: #0f172a;--bim-component-tree-subtab-active-bg: #ffffff;--bim-component-tree-subtab-active-text: #0f172a;--bim-component-tree-subtab-active-border: rgba(59, 130, 246, .22);--bim-component-tree-subtab-active-shadow: 0 1px 2px rgba(15, 23, 42, .08);--bim-component-tree-tree-bg: #ffffff;--bim-component-tree-tree-border: rgba(148, 163, 184, .18);position:absolute;top:0;left:0;bottom:0;width:min(320px,100%);display:flex;flex-direction:column;border:1px solid var(--bim-component-tree-border);border-radius:0;background:var(--bim-component-tree-bg);backdrop-filter:blur(var(--bim-component-tree-blur));-webkit-backdrop-filter:blur(var(--bim-component-tree-blur));box-shadow:var(--bim-component-tree-shadow);color:var(--bim-component-tree-text);overflow:hidden;transform:translate(calc(-100% - 24px));opacity:0;pointer-events:none;transition:transform .22s ease,opacity .22s ease;z-index:1200}.component-tree-drawer.is-open{transform:translate(0);opacity:1;pointer-events:auto}.component-tree-drawer-header{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 10px 10px 12px;border-bottom:1px solid var(--bim-component-tree-border)}.component-tree-drawer-tabs{min-width:0;display:flex;align-items:center;flex-wrap:nowrap}.component-tree-drawer-tab{appearance:none;border:none;background:transparent;color:var(--bim-component-tree-muted);border-radius:0;padding:8px 14px;min-height:34px;font-size:14px;font-weight:500;line-height:1;cursor:pointer;transition:color .18s ease;position:relative}.component-tree-drawer-tab:not(:last-child):after{content:"";position:absolute;right:0;top:50%;transform:translateY(-50%);width:1px;height:16px;background-color:var(--bim-component-tree-border)}.component-tree-drawer-tab:hover{color:var(--bim-component-tree-text)}.component-tree-drawer-tab.is-active{color:var(--bim-component-tree-tab-active-text);font-weight:600}.component-tree-drawer-close{flex:0 0 auto;width:44px;height:44px;display:inline-flex;align-items:center;justify-content:center;border:1px solid transparent;border-radius:4px;background:var(--bim-component-tree-close-bg);color:var(--bim-component-tree-text);cursor:pointer;transition:background-color .18s ease,border-color .18s ease,color .18s ease;margin-left:8px}.component-tree-drawer-close:hover{background:var(--bim-component-tree-close-hover);border-color:var(--bim-component-tree-border);box-shadow:inset 0 0 0 1px var(--bim-component-tree-border)}.component-tree-drawer-close svg{width:24px;height:24px}.component-tree-drawer-body{flex:1;display:flex;flex-direction:column;min-height:0;padding:10px 12px 12px;overflow:hidden}.component-tree-drawer-panel{display:none;flex:1 1 auto;min-height:0;height:100%;overflow:hidden}.component-tree-drawer-panel.is-active{display:flex;flex-direction:column}.component-tree-drawer-page{min-height:100%;display:flex;flex-direction:column;justify-content:flex-start;gap:8px;padding:12px;border:1px solid var(--bim-component-tree-surface-border);border-radius:8px;background:var(--bim-component-tree-surface)}.component-tree-drawer-page-title{margin:0;font-size:15px;line-height:1.3;color:var(--bim-component-tree-page-title)}.component-tree-drawer-page-description{margin:0;font-size:12px;line-height:1.6;color:var(--bim-component-tree-page-description)}.component-tree-drawer-pin-page{gap:0;padding:0;border:none;background:transparent}.component-tree-drawer-add-pin-btn{appearance:none;border:none;background:var(--bim-pin-primary, #3b82f6);color:#fff;border-radius:10px;padding:12px 16px;font-size:14px;font-weight:600;line-height:1;cursor:pointer;transition:all .2s ease;display:flex;align-items:center;justify-content:center;gap:8px;width:100%;box-shadow:0 1px 3px #3b82f64d}.component-tree-drawer-add-pin-btn:hover{background:var(--bim-pin-primary-hover, #2563eb);transform:translateY(-1px);box-shadow:0 4px 12px #3b82f666}.component-tree-drawer-add-pin-btn:active{transform:translateY(0)}.component-tree-drawer-add-pin-btn svg{width:18px;height:18px;flex-shrink:0}.component-tree-drawer-pin-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:48px 20px;text-align:center}.component-tree-drawer-pin-empty-icon{width:48px;height:48px;display:flex;align-items:center;justify-content:center;color:var(--bim-pin-muted, #94a3b8);opacity:.5}.component-tree-drawer-pin-empty-icon svg{width:100%;height:100%}.component-tree-drawer-pin-empty-title{font-size:15px;font-weight:600;color:var(--bim-pin-text, #1e293b)}.component-tree-drawer-pin-empty-desc{font-size:13px;color:var(--bim-pin-muted, #64748b);line-height:1.5}.component-tree-drawer-pin-list{display:flex;flex-direction:column;gap:10px;overflow-y:auto;overflow-x:hidden;max-height:100%;padding:0 4px}.component-tree-drawer-pin-item{background:var(--bim-pin-card-bg, #ffffff);border:1px solid var(--bim-pin-border, #e2e8f0);border-radius:12px;padding:2px;cursor:pointer;transition:all .2s ease;box-shadow:var(--bim-pin-shadow, 0 1px 3px rgba(0, 0, 0, .05));overflow:hidden}.component-tree-drawer-pin-item:hover{border-color:var(--bim-component-tree-tab-active-border, #3b82f6);box-shadow:var(--bim-pin-shadow-hover, 0 4px 12px rgba(0, 0, 0, .1));transform:translateY(-1px)}.component-tree-drawer-pin-content{display:flex;align-items:center;gap:12px;padding:10px 14px;min-height:48px}.component-tree-drawer-pin-icon{flex:0 0 auto;width:36px;height:36px;display:flex;align-items:center;justify-content:center;background:var(--bim-component-tree-tab-active, #eff6ff);color:var(--bim-component-tree-tab-active-text, #1d4ed8);border-radius:10px}.component-tree-drawer-pin-icon svg{width:20px;height:20px}.component-tree-drawer-pin-info{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:2px}.component-tree-drawer-pin-name{font-size:14px;font-weight:600;color:var(--bim-pin-text, #1e293b);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.4}.component-tree-drawer-pin-index{font-size:11px;font-weight:500;color:var(--bim-pin-muted, #94a3b8);line-height:1.3}.component-tree-drawer-pin-actions{flex:0 0 auto;display:flex;align-items:center;gap:2px;opacity:0;transition:opacity .18s ease}.component-tree-drawer-pin-item:hover .component-tree-drawer-pin-actions{opacity:1}.component-tree-drawer-pin-action-btn{appearance:none;border:none;background:transparent;color:var(--bim-pin-muted, #94a3b8);width:32px;height:32px;display:inline-flex;align-items:center;justify-content:center;border-radius:8px;cursor:pointer;transition:all .18s ease;padding:0}.component-tree-drawer-pin-action-btn:hover{background:var(--bim-component-tree-tab-hover, #f1f5f9);color:var(--bim-pin-text, #1e293b)}.component-tree-drawer-pin-action-btn svg{width:16px;height:16px}.component-tree-drawer-pin-edit-wrapper{display:flex;align-items:center;gap:8px;padding:10px 14px}.component-tree-drawer-pin-input{flex:1 1 auto;min-width:0;appearance:none;border:2px solid var(--bim-component-tree-tab-active-border, #3b82f6);background:var(--bim-pin-bg, #ffffff);color:var(--bim-pin-text, #1e293b);border-radius:8px;padding:8px 12px;font-size:14px;font-weight:600;outline:none;transition:box-shadow .2s ease}.component-tree-drawer-pin-input:focus{box-shadow:0 0 0 3px #3b82f626}.component-tree-drawer-pin-edit-actions{flex:0 0 auto;display:flex;align-items:center;gap:4px}.component-tree-drawer-pin-edit-btn{appearance:none;border:none;width:32px;height:32px;display:inline-flex;align-items:center;justify-content:center;border-radius:8px;cursor:pointer;transition:all .18s ease;padding:0}.component-tree-drawer-pin-edit-save{background:#10b981;color:#fff}.component-tree-drawer-pin-edit-save:hover{background:#059669}.component-tree-drawer-pin-edit-cancel{background:#f1f5f9;color:#64748b}.component-tree-drawer-pin-edit-cancel:hover{background:#e2e8f0;color:#475569}.component-tree-drawer-pin-edit-btn svg{width:16px;height:16px}.component-tree-drawer-construct-tree,.component-tree-drawer-construct-tree-mount{flex:1;min-height:0;height:100%;display:flex;flex-direction:column;overflow:hidden}.component-tree-drawer-construct-tree-tab-container,.component-tree-drawer-construct-tree-tab-container .bim-tab,.component-tree-drawer-construct-tree-tab-container .bim-tab__content,.component-tree-drawer-construct-tree-tab-container .bim-tab__panel,.component-tree-drawer-construct-tree-panel,.component-tree-drawer-construct-tree-tab-container .construct-tab__panel-content,.component-tree-drawer-construct-tree-tab-container .bim-tree{height:100%;min-height:0;overflow:hidden}.component-tree-drawer-construct-tree-tab-container .bim-tab{display:flex;flex-direction:column;background:transparent}.component-tree-drawer-construct-tree-tab-container .bim-tab__nav{flex:0 0 auto;gap:6px;padding:4px;margin:0 0 8px;background:var(--bim-component-tree-subtab-nav-bg);border-color:var(--bim-component-tree-subtab-nav-border);border-radius:10px}.component-tree-drawer-construct-tree-tab-container .bim-tab__item{min-height:32px;padding:7px 10px;font-size:12px;font-weight:600;color:var(--bim-component-tree-subtab-text);border:1px solid transparent}.component-tree-drawer-construct-tree-tab-container .bim-tab__item:hover{color:var(--bim-component-tree-subtab-hover-text);background:var(--bim-component-tree-subtab-hover-bg)}.component-tree-drawer-construct-tree-tab-container .bim-tab__item.is-active{color:var(--bim-component-tree-subtab-active-text);background:var(--bim-component-tree-subtab-active-bg);border-color:var(--bim-component-tree-subtab-active-border);box-shadow:var(--bim-component-tree-subtab-active-shadow)}.component-tree-drawer-construct-tree-tab-container .bim-tab__content{flex:1;min-height:0;overflow:hidden}.component-tree-drawer-construct-tree-panel,.component-tree-drawer-construct-tree-tab-container .construct-tab__panel-content{overflow:hidden}.component-tree-drawer-construct-tree-tab-container .bim-tree{border:1px solid var(--bim-component-tree-tree-border);border-radius:10px;background:var(--bim-component-tree-tree-bg)}.component-tree-drawer-construct-tree-tab-container .bim-tree-search{padding:8px 8px 6px}.component-tree-drawer-construct-tree-tab-container .bim-tree-search-input{height:28px;font-size:12px}.component-tree-drawer-construct-tree-tab-container .bim-tree-content{flex:1 1 auto;min-height:0;padding:4px 6px 8px;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain}@media(max-width:768px){.component-tree-drawer{right:0}.component-tree-drawer-header{align-items:flex-start}.component-tree-drawer-tabs{gap:6px}.component-tree-drawer-tab{padding:8px 12px;min-height:34px}}.component-tree-drawer-view,.component-tree-drawer-view-mount{flex:1;min-height:0;height:100%;display:flex;flex-direction:column;overflow:hidden}.component-tree-drawer-view-mount .bim-tree{height:100%;min-height:0;border:1px solid var(--bim-component-tree-tree-border);border-radius:10px;background:var(--bim-component-tree-tree-bg);overflow:hidden}.component-tree-drawer-view-mount .bim-tree-search{padding:8px 8px 6px}.component-tree-drawer-view-mount .bim-tree-search-input{height:28px;font-size:12px}.component-tree-drawer-view-mount .bim-tree-content{flex:1 1 auto;min-height:0;padding:4px 6px 8px;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain}.component-tree-drawer-view-empty{display:flex;align-items:center;justify-content:center;height:100%;min-height:0;padding:24px;font-size:13px;color:var(--bim-component-tree-muted);text-align:center}.component-tree-drawer-pin-toolbar{position:relative;z-index:3;margin-bottom:10px;display:flex;align-items:center;justify-content:space-between;gap:8px;overflow:visible}.component-tree-drawer-pin-btn-group{display:flex;gap:6px;flex:1 1 auto;min-width:0;flex-wrap:nowrap}.component-tree-drawer-add-pin-btn,.component-tree-drawer-add-folder-btn,.component-tree-drawer-toggle-pins-btn{appearance:none;border:1px solid var(--bim-component-tree-tree-border);color:var(--bim-pin-text, #1e293b);border-radius:8px;padding:0 10px;height:30px;font-size:12px;font-weight:600;line-height:1;cursor:pointer;transition:background-color .18s ease,border-color .18s ease,color .18s ease,transform .18s ease;display:flex;align-items:center;justify-content:center;gap:6px;background:var(--bim-pin-card-bg, #ffffff);box-shadow:none;white-space:nowrap;flex:0 0 auto;min-width:0}.component-tree-drawer-add-pin-btn svg,.component-tree-drawer-add-folder-btn svg,.component-tree-drawer-toggle-pins-btn svg{width:14px;height:14px;flex-shrink:0}.component-tree-drawer-add-pin-btn{background:var(--bim-pin-soft, rgba(59, 130, 246, .12));border-color:color-mix(in srgb,var(--bim-pin-primary, #3b82f6) 26%,var(--bim-component-tree-tree-border));color:var(--bim-component-tree-tab-active-text, #1d4ed8);flex:1 1 0}.component-tree-drawer-add-pin-btn:hover{background:color-mix(in srgb,var(--bim-pin-primary, #3b82f6) 14%,var(--bim-pin-card-bg, #ffffff));border-color:color-mix(in srgb,var(--bim-pin-primary, #3b82f6) 38%,var(--bim-component-tree-tree-border));box-shadow:none;transform:none}.component-tree-drawer-add-folder-btn{background:transparent;padding-inline:9px;flex:1 1 0}.component-tree-drawer-add-folder-btn:hover,.component-tree-drawer-toggle-pins-btn:hover{background:var(--bim-component-tree-tab-hover, #f1f5f9);border-color:var(--bim-component-tree-tree-border);color:var(--bim-pin-text, #1e293b);box-shadow:none;transform:none}.component-tree-drawer-toggle-pins-btn{position:relative;width:30px;flex:0 0 30px;padding:0;background:var(--bim-pin-card-bg, #ffffff)}.component-tree-drawer-toggle-pins-btn.is-active{background:var(--bim-pin-soft, rgba(59, 130, 246, .12));border-color:color-mix(in srgb,var(--bim-pin-primary, #3b82f6) 34%,var(--bim-component-tree-tree-border));color:var(--bim-component-tree-tab-active-text, #1d4ed8)}.component-tree-drawer-toggle-pins-btn[data-tooltip]:after{content:attr(data-tooltip);position:absolute;right:0;top:calc(100% + 6px);z-index:20;transform:translateY(-3px);padding:4px 7px;border-radius:6px;background:color-mix(in srgb,var(--bim-pin-text, #0f172a) 92%,transparent 8%);color:var(--bim-pin-bg, #ffffff);box-shadow:0 4px 12px #0f172a29;font-size:11px;font-weight:500;line-height:1;white-space:nowrap;pointer-events:none;opacity:0;transition:opacity .12s ease,transform .12s ease}.component-tree-drawer-toggle-pins-btn[data-tooltip]:hover:after,.component-tree-drawer-toggle-pins-btn[data-tooltip]:focus-visible:after{opacity:1;transform:translateY(0)}.component-tree-drawer-add-pin-btn:focus-visible,.component-tree-drawer-add-folder-btn:focus-visible,.component-tree-drawer-toggle-pins-btn:focus-visible,.pin-node-action-btn:focus-visible,.pin-node-edit-btn:focus-visible,.pin-node-edit-input:focus-visible{outline:2px solid color-mix(in srgb,var(--bim-pin-primary, #3b82f6) 60%,white);outline-offset:2px}.component-tree-drawer-add-pin-btn:active,.component-tree-drawer-add-folder-btn:active,.component-tree-drawer-toggle-pins-btn:active{transform:translateY(-1px)}.component-tree-drawer-pin-tree-container{position:relative;z-index:1;flex:1;min-height:0;overflow:hidden}.component-tree-drawer-pin-tree-container .bim-tree{height:100%;border:1px solid var(--bim-component-tree-tree-border);border-radius:10px;background:var(--bim-component-tree-tree-bg);overflow:hidden}.component-tree-drawer-pin-tree-container .bim-tree-content{flex:1 1 auto;min-height:0;padding:6px 8px 10px;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain}.component-tree-drawer-pin-tree-container .bim-tree-node-content{min-height:34px;border-radius:8px;padding-right:6px}.component-tree-drawer-pin-tree-container .bim-tree-node-content.is-selected{background:color-mix(in srgb,var(--bim-pin-primary, #3b82f6) 12%,var(--bim-component-tree-tree-bg))}.component-tree-drawer-pin-tree-container .bim-tree-title{font-size:13px;font-weight:500}.component-tree-drawer-pin-tree-container .bim-tree-node-actions{display:flex}.pin-node-actions{display:flex;align-items:center;gap:4px;opacity:0;transition:opacity .18s ease}.bim-tree-node-content:hover .pin-node-actions,.bim-tree-node-content.is-selected .pin-node-actions,.bim-tree-node-content:focus-within .pin-node-actions{opacity:1}.pin-node-action-btn{appearance:none;border:none;background:transparent;color:var(--bim-pin-muted, #94a3b8);width:24px;height:24px;display:inline-flex;align-items:center;justify-content:center;border-radius:6px;cursor:pointer;transition:all .18s ease;padding:0}.pin-node-action-btn:hover{background:var(--bim-component-tree-tab-hover, #f1f5f9);color:var(--bim-pin-text, #1e293b)}.pin-node-action-btn svg{width:13px;height:13px}.pin-node-edit-wrapper{display:flex;align-items:center;gap:6px;flex:1;min-width:0}.pin-node-edit-input{flex:1;min-width:0;appearance:none;border:1px solid color-mix(in srgb,var(--bim-pin-primary, #3b82f6) 35%,var(--bim-component-tree-tree-border));background:var(--bim-pin-bg, #ffffff);color:var(--bim-pin-text, #1e293b);border-radius:6px;padding:5px 8px;font-size:13px;font-weight:500;outline:none;transition:box-shadow .2s ease}.pin-node-edit-input:focus{box-shadow:0 0 0 3px #3b82f626}.pin-node-edit-actions{display:flex;align-items:center;gap:4px;flex-shrink:0}.pin-node-edit-btn{appearance:none;border:none;width:24px;height:24px;display:inline-flex;align-items:center;justify-content:center;border-radius:6px;cursor:pointer;transition:all .18s ease;padding:0}.pin-node-edit-btn svg{width:12px;height:12px}.pin-node-edit-save{background:#10b981;color:#fff}.pin-node-edit-save:hover{background:#059669}.pin-node-edit-cancel{background:#f1f5f9;color:#64748b}.pin-node-edit-cancel:hover{background:#e2e8f0;color:#475569}.pin-delete-dialog{display:flex;flex-direction:column;align-items:center;gap:14px;min-width:0;padding:20px 22px 18px}.pin-delete-dialog-symbol{width:52px;height:52px;display:inline-flex;align-items:center;justify-content:center;border-radius:50%;background:color-mix(in srgb,#f59e0b 12%,var(--bim-pin-card-bg, #ffffff));color:#d97706;font-size:30px;font-weight:700;line-height:1}.pin-delete-dialog-text{font-size:14px;line-height:1.7;color:var(--bim-pin-text, #1e293b);word-break:break-word;text-align:center}.pin-delete-dialog-actions{display:flex;justify-content:flex-end;gap:8px;width:100%;margin-top:2px}.pin-delete-dialog-btn{min-width:88px;height:36px;padding:0 14px;border-radius:10px;border:1px solid var(--bim-component-tree-tree-border);background:var(--bim-pin-card-bg, #ffffff);color:var(--bim-pin-text, #1e293b);font-size:13px;font-weight:600;cursor:pointer;transition:background-color .18s ease,border-color .18s ease,color .18s ease}.pin-delete-dialog-btn.is-secondary:hover{background:var(--bim-component-tree-tab-hover, #f1f5f9)}.pin-delete-dialog-btn.is-danger{border-color:color-mix(in srgb,#ef4444 30%,var(--bim-component-tree-tree-border));background:color-mix(in srgb,#ef4444 10%,var(--bim-pin-card-bg, #ffffff));color:#b91c1c}.pin-delete-dialog-btn.is-danger:hover{background:color-mix(in srgb,#ef4444 16%,var(--bim-pin-card-bg, #ffffff))}.pin-delete-dialog-btn:focus-visible{outline:2px solid color-mix(in srgb,var(--bim-pin-primary, #3b82f6) 60%,white);outline-offset:2px}@media(max-width:560px){.component-tree-drawer-pin-btn-group{width:100%}.component-tree-drawer-add-pin-btn,.component-tree-drawer-add-folder-btn{flex:1 1 0}}@media(prefers-reduced-motion:reduce){.component-tree-drawer,.component-tree-drawer-tab,.component-tree-drawer-close{transition:none}}.bim-tab{display:flex;flex-direction:column;width:100%;height:100%;background:transparent;color:var(--bim-text-secondary)}.bim-tab__nav{display:flex;align-items:center;gap:4px;padding:4px;margin:8px 12px;background:var(--bim-bg-inset);border-radius:8px;border:1px solid var(--bim-border-subtle)}.bim-tab__item{flex:1;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:8px 12px;border:none;border-radius:6px;background:transparent;color:var(--bim-text-secondary);cursor:pointer;transition:all .2s ease;font-size:13px;font-weight:500}.bim-tab__item:hover{color:var(--bim-text-primary);background-color:var(--bim-component-bg-hover)}.bim-tab__item.is-active{color:var(--bim-primary);background-color:var(--bim-bg-elevated);box-shadow:0 1px 3px #0000001a}.bim-tab__item.is-disabled{opacity:.5;cursor:not-allowed}.bim-tab__icon{width:16px;height:16px;display:inline-flex;align-items:center;justify-content:center;color:var(--bim-tab-icon, currentColor)}.bim-tab__icon svg{width:100%;height:100%;fill:currentColor}.bim-tab__title{white-space:nowrap}.bim-tab__content{flex:1;display:flex;position:relative;min-height:0;overflow:hidden}.bim-tab__panel{display:none;width:100%;height:100%;flex:1}.bim-tab__panel.is-active{display:flex;flex-direction:column;height:100%}.construct-tab__container{height:100%;display:flex;flex-direction:column}.construct-tab__panel-content{flex:1;display:flex;flex-direction:column;min-height:0;overflow:hidden}.construct-tab__panel-content .bim-tree{flex:1}.bim-tree{width:100%;height:100%;display:flex;flex-direction:column;overflow:hidden;font-size:14px;color:var(--bim-text-primary);-webkit-user-select:none;user-select:none;position:relative;background:transparent}.bim-tree-search{padding:6px;background-color:transparent;flex-shrink:0;position:relative}.bim-tree-search-wrapper{position:relative;width:100%;display:flex;align-items:center}.bim-tree-search-icon{position:absolute;left:8px;width:16px;height:16px;color:var(--bim-text-secondary);pointer-events:none;display:flex;align-items:center;justify-content:center}.bim-tree-search-icon svg{width:100%;height:100%}.bim-tree-search-input{width:100%;height:30px;padding:4px 8px 4px 30px;border:1px solid var(--bim-border-default);border-radius:4px;outline:none;font-size:13px;color:inherit;background-color:var(--bim-bg-elevated);transition:all .2s;box-sizing:border-box}.bim-tree-search-input:focus{border-color:var(--bim-primary);box-shadow:var(--bim-focus-ring)}.bim-tree-search-results{position:absolute;top:100%;left:8px;right:8px;background-color:var(--bim-bg-elevated);border:1px solid var(--bim-border-default);box-shadow:var(--bim-shadow-md);border-radius:4px;max-height:200px;overflow-y:auto;z-index:10;display:none}.bim-tree-search-results.is-visible{display:block}.bim-tree-search-item{padding:8px 12px;cursor:pointer;border-bottom:1px solid rgba(0,0,0,.03)}.bim-tree-search-item:last-child{border-bottom:none}.bim-tree-search-item:hover{background-color:var(--bim-component-bg-hover)}.bim-tree-search-item-title{font-weight:500;display:block}.bim-tree-search-item-path{font-size:12px;color:var(--bim-text-secondary);margin-top:2px;display:block}.bim-tree-node-content:hover{background-color:var(--bim-component-bg-hover)}.bim-tree-switcher{width:24px;height:32px;display:flex;align-items:center;justify-content:center;cursor:pointer;color:var(--bim-text-secondary);transition:transform .2s;flex-shrink:0}.bim-tree-switcher svg{width:12px;height:12px;fill:currentColor;transition:transform .2s}.bim-tree-switcher.is-expanded svg{transform:rotate(90deg)}.bim-tree-switcher.is-hidden{visibility:hidden}.bim-tree-checkbox{width:16px;height:16px;border:1px solid var(--bim-border-default);border-radius:2px;margin-right:8px;background-color:var(--bim-bg-elevated);position:relative;cursor:pointer;flex-shrink:0;transition:all .2s}.bim-tree-checkbox:hover{border-color:var(--bim-primary)}.bim-tree-checkbox.is-checked{background-color:var(--bim-primary);border-color:var(--bim-primary)}.bim-tree-checkbox.is-checked:after{content:"";position:absolute;top:1px;left:4px;width:5px;height:9px;border:2px solid var(--bim-text-inverse);border-top:0;border-left:0;transform:rotate(45deg)}.bim-tree-checkbox.is-indeterminate{background-color:var(--bim-bg-elevated);border-color:var(--bim-primary)}.bim-tree-checkbox.is-indeterminate:after{content:"";position:absolute;top:6px;left:3px;width:8px;height:2px;background-color:var(--bim-primary)}.bim-tree-node.is-disabled .bim-tree-checkbox{background-color:var(--bim-component-bg-disabled);border-color:var(--bim-border-disabled);cursor:not-allowed}.bim-tree-node.is-disabled .bim-tree-checkbox.is-checked{background-color:var(--bim-text-disabled)}.bim-tree-node.is-disabled .bim-tree-node-content{color:var(--bim-text-disabled);cursor:not-allowed}.bim-tree-icon{width:16px;height:16px;margin-right:6px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.bim-tree-icon img,.bim-tree-icon svg{width:100%;height:100%}.bim-tree-title{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bim-tree-children{display:none;overflow:visible}.bim-tree-children.is-visible{display:block}.bim-tree-node-content.is-selected{background-color:var(--bim-component-bg-selected);color:var(--bim-primary)}.bim-tree-node-actions{display:none;align-items:center;margin-left:8px;flex-shrink:0}.bim-tree-node-content.is-selected .bim-tree-node-actions{display:flex}.bim-tree-content{flex:1;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scroll-behavior:auto;padding:2px 0;min-height:0}.bim-tree-node{display:flex;flex-direction:column;width:100%}.bim-tree-node-content{display:flex;align-items:center;height:32px;cursor:pointer;transition:background-color .2s;border-radius:4px;padding-right:8px;width:100%;box-sizing:border-box}.bim-measure-panel{width:100%;display:flex;flex-direction:column;box-sizing:border-box;color:var(--bim-text-secondary)}.bim-measure-settings{display:none;box-sizing:border-box;color:var(--bim-text-secondary)}.bim-measure-settings-title{font-size:14px;font-weight:600;margin-bottom:10px}.bim-measure-settings-row{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}.bim-measure-settings-row .label{color:var(--bim-text-secondary);font-size:13px;flex:0 0 auto}.bim-measure-settings-select{flex:0 0 auto;width:120px;height:28px;border-radius:6px;border:1px solid var(--bim-border-default);background:var(--bim-bg-inset);color:var(--bim-text-primary);padding:0 8px;box-sizing:border-box;outline:none}.bim-measure-settings-hint{font-size:12px;line-height:1.4;color:var(--bim-text-tertiary);margin-top:-4px;margin-bottom:8px}.bim-measure-settings-actions{margin-top:14px;display:flex;justify-content:flex-start;gap:10px}.bim-measure-settings-save,.bim-measure-settings-cancel{flex:0 0 auto!important;width:auto;min-width:0;height:30px;padding:0 12px;border-radius:4px;cursor:pointer;box-sizing:border-box}.bim-measure-settings-save{border:none;background:var(--bim-primary);color:var(--bim-text-inverse)}.bim-measure-settings-cancel{border:1px solid var(--bim-border-default);background:transparent;color:var(--bim-text-secondary)}.bim-measure-settings-save:hover,.bim-measure-settings-save:active,.bim-measure-settings-save:focus,.bim-measure-settings-cancel:hover,.bim-measure-settings-cancel:active,.bim-measure-settings-cancel:focus{background:inherit;outline:none}.bim-measure-settings-save:hover{background:var(--bim-primary-hover)}.bim-measure-tools{display:flex;flex-direction:column;gap:8px}.bim-measure-tool-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}.bim-measure-tool-btn{width:100%;height:42px;border-radius:6px;border:1px solid var(--bim-border-default);background:var(--bim-bg-inset);cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .2s ease;padding:0;box-sizing:border-box}.bim-measure-tool-btn:hover{background:var(--bim-component-bg-hover);border-color:var(--bim-border-strong)}.bim-measure-tool-btn.is-active{border-color:var(--bim-primary);background:var(--bim-primary-subtle)}.bim-measure-tool-btn.is-active .bim-measure-tool-icon{color:var(--bim-primary)}.bim-measure-tool-icon{width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center;color:var(--bim-icon-default)}.bim-measure-tool-icon svg{width:100%;height:100%;fill:currentColor}.bim-measure-toggle{display:flex;justify-content:flex-end}.bim-measure-toggle-btn{height:22px;border-radius:4px;border:1px solid var(--bim-border-default);background:var(--bim-bg-inset);cursor:pointer;display:inline-flex;align-items:center;justify-content:center;transition:all .2s ease;padding:0 6px;gap:4px;font-size:12px;line-height:1}.bim-measure-toggle-btn:hover{background:var(--bim-component-bg-hover);border-color:var(--bim-border-strong)}.bim-measure-toggle-text{color:var(--bim-text-secondary)}.bim-measure-toggle-icon svg{width:14px;height:14px;fill:currentColor;color:var(--bim-icon-default);transition:transform .15s ease}.bim-measure-toggle-btn.is-expanded .bim-measure-toggle-icon svg{transform:rotate(180deg)}.bim-measure-mode-options{display:none;flex-direction:column;gap:8px;margin-top:12px;padding-top:12px;border-top:1px solid var(--bim-divider)}.bim-measure-mode-options.is-visible{display:flex}.bim-measure-radio-group{display:flex;align-items:center;gap:8px;font-size:13px;line-height:1.4}.bim-measure-radio-group .bim-measure-radio-label{color:var(--bim-text-secondary);min-width:58px;flex:0 0 auto}.bim-measure-radio-group .bim-measure-radio-items{display:flex;gap:4px}.bim-measure-radio-item{display:inline-flex;align-items:center;justify-content:center;height:26px;padding:0 10px;border-radius:4px;border:1px solid var(--bim-border-default);background:var(--bim-bg-inset);color:var(--bim-text-secondary);font-size:12px;cursor:pointer;transition:all .15s ease;-webkit-user-select:none;user-select:none}.bim-measure-radio-item:hover{border-color:var(--bim-border-strong);color:var(--bim-text-primary)}.bim-measure-radio-item.is-active{background:var(--bim-primary-subtle);border-color:var(--bim-primary);color:var(--bim-primary)}.bim-measure-result{margin-top:12px;padding-top:12px;border-top:1px solid var(--bim-divider);display:flex;flex-direction:column;gap:10px}.bim-measure-row{display:flex;align-items:baseline;gap:8px;font-size:13px;line-height:1.4}.bim-measure-row .label{color:var(--bim-text-secondary);min-width:84px}.bim-measure-row .value{color:var(--bim-text-primary);flex:1;word-break:break-word}.bim-measure-main-number{color:#ffd24a}.bim-measure-main-number.is-laser-text,.bim-measure-main-unit{color:var(--bim-text-primary)}.bim-measure-xyz{display:flex;flex-direction:column;gap:6px}.bim-measure-xyz .value{font-variant-numeric:tabular-nums}.bim-measure-xyz-x{color:#ff4d4f!important}.bim-measure-xyz-y{color:#52c41a!important}.bim-measure-xyz-z{color:#1677ff!important}.bim-measure-footer{margin-top:12px;padding-top:10px;border-top:1px solid var(--bim-divider);display:flex;align-items:center;justify-content:flex-start;gap:10px}.bim-measure-clear-btn{background:transparent;border:none;color:var(--bim-danger);cursor:pointer;padding:0;font-size:13px;flex:0 0 auto!important;width:auto;min-width:0}.bim-measure-clear-btn:hover,.bim-measure-clear-btn:active,.bim-measure-clear-btn:focus{background:transparent;border:none;outline:none;text-decoration:none}.bim-measure-settings-btn{width:24px;height:24px;border-radius:4px;border:none;background:transparent;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;padding:0;margin-left:auto;flex:0 0 auto!important}.bim-measure-settings-btn:hover,.bim-measure-settings-btn:active,.bim-measure-settings-btn:focus{background:transparent;border:none;outline:none}.bim-measure-settings-btn svg{width:18px;height:18px;fill:currentColor;color:var(--bim-icon-default)}.section-plane-panel{display:flex;gap:8px;padding:12px 12px 16px;box-sizing:border-box}.section-plane-btn{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;padding:10px;border:1px solid var(--bim-border-default);background:var(--bim-bg-inset);border-radius:8px;cursor:pointer;transition:all .2s ease;min-width:60px;outline:none;color:var(--bim-text-primary)}.section-plane-btn:hover{background:var(--bim-component-bg-hover);border-color:var(--bim-border-strong)}.section-plane-btn:active{background:var(--bim-primary-subtle);border-color:var(--bim-primary)}.section-plane-btn.is-active{background:var(--bim-primary-subtle);border-color:var(--bim-primary);color:var(--bim-primary)}.section-plane-btn.is-active .section-plane-btn-icon{color:var(--bim-primary)}.section-plane-btn-icon{width:24px;height:24px;display:flex;align-items:center;justify-content:center;color:var(--bim-icon-default)}.section-plane-btn-icon svg{width:100%;height:100%;fill:currentColor}.section-plane-btn-label{font-size:12px;color:inherit;text-align:center;line-height:1.2}.section-axis-panel{display:flex;flex-direction:column;gap:8px;padding:12px 12px 16px;box-sizing:border-box}.section-axis-row-1{display:flex;gap:8px;padding-bottom:8px;border-bottom:1px solid var(--bim-divider)}.section-axis-row-2{display:flex;gap:8px;padding-top:8px}.section-axis-btn{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;padding:8px;background:var(--bim-bg-inset);border:1px solid var(--bim-border-default);border-radius:8px;cursor:pointer;transition:all .2s ease;outline:none;color:var(--bim-text-primary);min-height:48px}.section-axis-btn:hover{background:var(--bim-component-bg-hover);border-color:var(--bim-border-strong)}.section-axis-btn.active{background:var(--bim-primary-subtle);border-color:var(--bim-primary);color:var(--bim-primary)}.section-axis-btn.active .section-axis-btn-icon{color:var(--bim-primary)}.section-axis-btn-icon{width:24px;height:24px;display:inline-flex;align-items:center;justify-content:center;color:var(--bim-icon-default)}.section-axis-btn-icon svg{width:100%;height:100%}.section-axis-btn-label{font-size:12px;color:inherit;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}.section-axis-btn-text{min-height:40px}.section-axis-btn-text .section-axis-btn-label{font-size:18px;font-weight:600}.section-box-panel{display:flex;flex-direction:column;padding:12px;box-sizing:border-box;-webkit-user-select:none;user-select:none}.section-box-row-buttons{display:flex;gap:6px;padding-bottom:12px;border-bottom:1px solid var(--bim-divider)}.section-box-btn{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;padding:6px;background:var(--bim-bg-inset);border:1px solid var(--bim-border-default);border-radius:8px;cursor:pointer;color:var(--bim-text-primary);min-height:44px;transition:all .2s ease}.section-box-btn:hover{background:var(--bim-component-bg-hover);border-color:var(--bim-border-strong)}.section-box-btn.active{background:var(--bim-primary-subtle);border-color:var(--bim-primary);color:var(--bim-primary)}.section-box-btn.active .section-box-btn-icon{color:var(--bim-primary)}.section-box-btn-icon{width:24px;height:24px;color:var(--bim-icon-default)}.section-box-btn-icon svg{width:100%;height:100%}.section-box-btn-label{font-size:11px;white-space:nowrap}.section-box-sliders{display:flex;flex-direction:column;gap:16px;padding-top:16px}.section-box-slider{display:flex;align-items:center;gap:12px;position:relative;z-index:1}.section-box-slider:hover{z-index:10}.section-box-slider-label{font-size:13px;font-weight:700;color:var(--bim-text-primary);min-width:14px}.section-box-slider-track{position:relative;flex:1;height:4px;background:var(--bim-border-default);border-radius:2px}.section-box-slider-range{position:absolute;top:0;height:100%;background:var(--bim-primary);border-radius:2px;pointer-events:none}.section-box-slider-handle{position:absolute;top:50%;width:14px;height:14px;background:var(--bim-bg-elevated);border:2px solid var(--bim-primary);border-radius:50%;transform:translate(-50%,-50%);cursor:grab;z-index:5;touch-action:none;transition:transform .2s,box-shadow .2s}.section-box-slider-handle:hover{transform:translate(-50%,-50%) scale(1.2);box-shadow:0 0 0 4px var(--bim-primary-subtle)}.section-box-slider-handle.dragging{cursor:grabbing;transform:translate(-50%,-50%) scale(1.2);background:var(--bim-primary)}.bim-collapse{background-color:var(--bim-bg-elevated);border:1px solid var(--bim-border-default);border-radius:8px;font-size:14px;color:var(--bim-text-primary)}.bim-collapse.is-ghost{background-color:transparent;border:none}.bim-collapse.is-ghost .bim-collapse-item{border-bottom:none}.bim-collapse.is-ghost .bim-collapse-header{background-color:var(--bim-component-bg);padding-left:12px;padding-right:0;border-bottom:1px solid var(--bim-border-default)}.bim-collapse.is-ghost .bim-collapse-header:hover{background-color:var(--bim-component-bg-hover)}.bim-collapse.is-ghost .bim-collapse-content{background-color:transparent;border-top:none}.bim-collapse-item{border-bottom:1px solid var(--bim-border-subtle)}.bim-collapse-item:last-child{border-bottom:none}.bim-collapse-item.is-disabled .bim-collapse-header{color:var(--bim-text-disabled);cursor:not-allowed}.bim-collapse-header{display:flex;align-items:center;padding:12px 16px;background-color:var(--bim-component-bg);cursor:pointer;transition:all .2s ease;position:relative}.bim-collapse-header:hover{background-color:var(--bim-component-bg-hover)}.bim-collapse-arrow{margin-right:12px;font-size:12px;width:12px;height:12px;transition:transform .24s;display:inline-flex;align-items:center;justify-content:center}.bim-collapse-arrow svg{width:100%;height:100%;fill:currentColor}.bim-collapse-item.is-active .bim-collapse-arrow{transform:rotate(90deg)}.bim-collapse-icon{margin-right:8px;display:inline-flex;align-items:center}.bim-collapse-icon svg{width:16px;height:16px;fill:currentColor}.bim-collapse-title{flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.bim-collapse-extra{margin-left:auto}.bim-collapse-content{overflow:hidden;background-color:var(--bim-bg-elevated);border-top:1px solid var(--bim-border-subtle);transition:height .2s ease-in-out,opacity .2s ease-in-out}.bim-collapse-content.is-hidden{display:none}.bim-ai-chat{position:absolute;width:440px;height:600px;display:flex;flex-direction:column;background:var(--bim-ai-panel, rgba(11, 18, 32, .95));border:1px solid var(--bim-ai-border, rgba(255, 255, 255, .1));border-radius:16px;backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px);box-shadow:0 12px 32px var(--bim-ai-shadow, rgba(0, 0, 0, .4));z-index:1000;font-family:Public Sans,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;overflow:hidden;resize:both;min-width:360px;min-height:400px;max-width:90vw;max-height:90vh}.bim-ai-chat-header{display:flex;align-items:center;justify-content:space-between;height:56px;padding:12px 16px;border-bottom:1px solid var(--bim-ai-border, rgba(255, 255, 255, .1));flex-shrink:0;cursor:move;-webkit-user-select:none;user-select:none;border-radius:16px 16px 0 0}.bim-ai-chat-title{font-size:18px;font-weight:600;color:var(--bim-ai-text, #E5E7EB)}.bim-ai-chat-actions{display:flex;gap:8px}.bim-ai-chat-action-btn{width:32px;height:32px;border-radius:999px;border:1px solid var(--bim-ai-border, rgba(255, 255, 255, .1));background:transparent;color:var(--bim-ai-text, #E5E7EB);cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .2s ease}.bim-ai-chat-action-btn:hover{background:var(--bim-ai-subtle-fill, rgba(255, 255, 255, .05))}.bim-ai-chat-action-btn svg{width:18px;height:18px}.bim-ai-chat-messages{flex:1;overflow-y:auto;padding:12px;display:flex;flex-direction:column;gap:10px}.bim-ai-msg-ai{max-width:320px}.bim-ai-msg-ai .bim-ai-bubble{background:var(--bim-ai-panel2, rgba(15, 23, 42, .95));border:1px solid var(--bim-ai-border, rgba(255, 255, 255, .1));border-radius:16px;padding:10px}.bim-ai-msg-ai .bim-ai-bubble-content{font-size:13px;line-height:1.4;color:var(--bim-ai-text, #E5E7EB)}.bim-ai-msg-user{display:flex;justify-content:flex-end}.bim-ai-msg-user .bim-ai-bubble{max-width:300px;background:var(--bim-ai-user-bubble, rgba(29, 78, 216, .8));border-radius:16px;padding:10px;box-shadow:0 10px 26px #0003}.bim-ai-msg-user .bim-ai-bubble-content{font-size:13px;line-height:1.4;color:var(--bim-ai-user-text, #EEF2FF)}.bim-ai-step{display:flex;align-items:center;gap:10px;padding:10px;border-radius:14px;max-width:380px}.bim-ai-step-running{background:var(--bim-ai-info-soft, rgba(56, 189, 248, .1));border:1px solid rgba(56,189,248,.33)}.bim-ai-step-done{background:var(--bim-ai-success-soft, rgba(52, 211, 153, .1));border:1px solid rgba(52,211,153,.33)}.bim-ai-step-error{background:var(--bim-ai-danger-soft, rgba(239, 68, 68, .1));border:1px solid var(--bim-ai-danger-stroke, rgba(239, 68, 68, .33))}.bim-ai-step-icon{width:16px;height:16px;flex-shrink:0}.bim-ai-step-running .bim-ai-step-icon{color:var(--bim-ai-info, #38BDF8)}.bim-ai-step-done .bim-ai-step-icon{color:var(--bim-ai-success, #34D399)}.bim-ai-step-error .bim-ai-step-icon{color:var(--bim-ai-danger, #EF4444)}.bim-ai-step-text{font-size:12px;line-height:1.4;color:var(--bim-ai-text, #E5E7EB)}.bim-ai-thinking{display:flex;align-items:center;gap:10px;padding:10px;border-radius:14px;background:var(--bim-ai-panel2, rgba(15, 23, 42, .95));border:1px solid var(--bim-ai-border, rgba(255, 255, 255, .1));max-width:380px}.bim-ai-thinking-icon{width:16px;height:16px;color:var(--bim-ai-muted, #94A3B8);animation:bim-ai-spin 1s linear infinite}.bim-ai-thinking-text{font-size:12px;font-weight:600;color:var(--bim-ai-muted, #94A3B8)}@keyframes bim-ai-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.bim-ai-question-active{width:360px;border-radius:14px;background:var(--bim-ai-panel2, rgba(15, 23, 42, .95));border:1px solid var(--bim-ai-accent-stroke, rgba(59, 130, 246, .33));box-shadow:0 4px 16px var(--bim-ai-shadow, rgba(0, 0, 0, .4));overflow:hidden}.bim-ai-question-header{display:flex;align-items:center;gap:8px;padding:12px;border-bottom:1px solid var(--bim-ai-border, rgba(255, 255, 255, .1))}.bim-ai-question-icon{width:24px;height:24px;border-radius:6px;background:var(--bim-ai-accent-soft, rgba(59, 130, 246, .1));display:flex;align-items:center;justify-content:center;color:var(--bim-ai-accent, #3B82F6)}.bim-ai-question-icon svg{width:14px;height:14px}.bim-ai-question-title{font-size:13px;font-weight:600;color:var(--bim-ai-text, #E5E7EB)}.bim-ai-question-content{padding:12px;display:flex;flex-direction:column;gap:10px}.bim-ai-question-text{font-size:13px;line-height:1.4;color:var(--bim-ai-text, #E5E7EB)}.bim-ai-question-options{display:flex;flex-direction:column;gap:6px}.bim-ai-option{display:flex;align-items:center;gap:8px;padding:8px 10px;border-radius:8px;background:var(--bim-ai-subtle-fill, rgba(255, 255, 255, .05));border:1px solid var(--bim-ai-border, rgba(255, 255, 255, .1));cursor:pointer;transition:all .2s ease}.bim-ai-option:hover{background:var(--bim-ai-subtle-fill-hover, rgba(255, 255, 255, .08))}.bim-ai-option.selected{background:var(--bim-ai-accent-soft, rgba(59, 130, 246, .1));border-color:var(--bim-ai-accent-stroke, rgba(59, 130, 246, .33))}.bim-ai-option-radio{width:16px;height:16px;border-radius:50%;border:1.5px solid var(--bim-ai-muted, #94A3B8);flex-shrink:0;display:flex;align-items:center;justify-content:center}.bim-ai-option.selected .bim-ai-option-radio{background:var(--bim-ai-accent, #3B82F6);border-color:var(--bim-ai-accent, #3B82F6)}.bim-ai-option-radio-dot{width:6px;height:6px;border-radius:50%;background:var(--bim-ai-accent-ink, #FFFFFF);display:none}.bim-ai-option.selected .bim-ai-option-radio-dot{display:block}.bim-ai-option-text{font-size:12px;color:var(--bim-ai-text, #E5E7EB)}.bim-ai-option-input{flex:1;background:var(--bim-ai-textbox-fill, rgba(15, 23, 42, .6));border:1px solid var(--bim-ai-border, rgba(255, 255, 255, .1));border-radius:6px;padding:6px 8px;font-size:12px;color:var(--bim-ai-text, #E5E7EB);outline:none;margin-top:8px;width:100%}.bim-ai-option-input:focus{border-color:var(--bim-ai-accent-stroke, rgba(59, 130, 246, .33))}.bim-ai-question-footer{display:flex;justify-content:flex-end;padding:12px;border-top:1px solid var(--bim-ai-border, rgba(255, 255, 255, .1))}.bim-ai-question-submit{display:flex;align-items:center;gap:4px;padding:8px 12px;border-radius:8px;background:var(--bim-ai-accent, #3B82F6);color:var(--bim-ai-accent-ink, #FFFFFF);border:none;cursor:pointer;font-size:12px;font-weight:600;transition:all .2s ease}.bim-ai-question-submit:hover{filter:brightness(1.1)}.bim-ai-question-submit svg{width:12px;height:12px}.bim-ai-question-answered{max-width:340px;padding:10px;border-radius:12px;background:var(--bim-ai-panel2, rgba(15, 23, 42, .95));border:1px solid var(--bim-ai-border, rgba(255, 255, 255, .1));display:flex;flex-direction:column;gap:8px}.bim-ai-qa-row{display:flex;gap:8px;align-items:flex-start}.bim-ai-qa-badge{width:18px;height:18px;border-radius:5px;display:flex;align-items:center;justify-content:center;font-size:10px;font-weight:700;flex-shrink:0}.bim-ai-qa-badge-q{background:var(--bim-ai-accent-soft, rgba(59, 130, 246, .1));color:var(--bim-ai-accent, #3B82F6)}.bim-ai-qa-badge-a{background:var(--bim-ai-success-soft, rgba(52, 211, 153, .1));color:var(--bim-ai-success, #34D399)}.bim-ai-qa-question{font-size:12px;line-height:1.4;color:var(--bim-ai-muted, #94A3B8)}.bim-ai-qa-answer{font-size:12px;line-height:1.4;color:var(--bim-ai-text, #E5E7EB)}.bim-ai-chat-composer{padding:12px;border-top:1px solid var(--bim-ai-border, rgba(255, 255, 255, .1));display:flex;flex-direction:column;gap:8px;flex-shrink:0}.bim-ai-quick-prompts{display:flex;gap:8px;flex-wrap:wrap}.bim-ai-quick-prompt{padding:5px 8px;border-radius:999px;background:var(--bim-ai-subtle-fill, rgba(255, 255, 255, .05));border:1px solid var(--bim-ai-border, rgba(255, 255, 255, .1));color:var(--bim-ai-text, #E5E7EB);font-size:12px;font-weight:600;cursor:pointer;transition:all .2s ease}.bim-ai-quick-prompt:hover{background:var(--bim-ai-subtle-fill-hover, rgba(255, 255, 255, .08))}.bim-ai-input-row{display:flex;gap:8px;align-items:flex-end}.bim-ai-textbox{flex:1;display:flex;flex-direction:column;gap:6px;padding:10px;border-radius:16px;background:var(--bim-ai-textbox-fill, rgba(15, 23, 42, .6));border:1px solid var(--bim-ai-border, rgba(255, 255, 255, .1))}.bim-ai-textbox:focus-within{border-color:var(--bim-ai-accent-stroke, rgba(59, 130, 246, .33))}.bim-ai-textarea{background:transparent;border:none;outline:none;resize:none;font-size:13px;line-height:1.4;color:var(--bim-ai-text, #E5E7EB);min-height:20px;max-height:100px}.bim-ai-textarea::placeholder{color:var(--bim-ai-muted, #94A3B8)}.bim-ai-helper{display:flex;justify-content:space-between;font-size:11px;color:var(--bim-ai-muted, #94A3B8)}.bim-ai-send-btn{width:40px;height:40px;border-radius:14px;background:var(--bim-ai-accent, #3B82F6);border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;color:var(--bim-ai-accent-ink, #FFFFFF);transition:background .2s ease;flex-shrink:0}.bim-ai-send-btn:hover{background:var(--bim-ai-accent-hover, #2563EB)}.bim-ai-send-btn svg{width:18px;height:18px}.bim-ai-chat.light{--bim-ai-panel: rgba(255, 255, 255, .95);--bim-ai-panel2: #FFFFFF;--bim-ai-border: rgba(15, 23, 42, .1);--bim-ai-text: #0F172A;--bim-ai-muted: #475569;--bim-ai-shadow: rgba(11, 18, 32, .1);--bim-ai-subtle-fill: rgba(15, 23, 42, .05);--bim-ai-subtle-fill-hover: rgba(15, 23, 42, .08);--bim-ai-textbox-fill: #F1F5F9;--bim-ai-user-bubble: #2563EB;--bim-ai-user-text: #FFFFFF;--bim-ai-accent: #2563EB;--bim-ai-accent-soft: rgba(37, 99, 235, .08);--bim-ai-accent-stroke: rgba(37, 99, 235, .2);--bim-ai-success: #059669;--bim-ai-success-soft: rgba(5, 150, 105, .08);--bim-ai-danger: #DC2626;--bim-ai-danger-soft: rgba(220, 38, 38, .08);--bim-ai-danger-stroke: rgba(220, 38, 38, .2);--bim-ai-info: #0284C7;--bim-ai-info-soft: rgba(2, 132, 199, .08)}.bim-btn-group-root{display:flex;gap:8px;z-index:1000;position:absolute;pointer-events:auto;background:transparent}.bim-btn-group-root.static{position:relative;inset:auto;transform:none}.bim-btn-group-root.dir-row{flex-direction:row;align-items:center}.bim-btn-group-root.dir-column{flex-direction:column;align-items:stretch}.bim-btn-group-section{display:flex;gap:4px;background-color:var(--bim-btn-group-section-bg, rgba(17, 17, 17, .88));border-radius:6px;padding:4px;box-shadow:0 2px 8px #0000004d,0 1px 3px #0003}.bim-btn-group-root.dir-row .bim-btn-group-section{flex-direction:row;align-items:center}.bim-btn-group-root.dir-column .bim-btn-group-section{flex-direction:column}.opt-btn-wrapper{position:relative}.opt-btn{display:flex;cursor:pointer;border-radius:4px;transition:background-color .2s,color .2s,border-color .2s;color:var(--bim-btn-text-color, #ccc);background-color:var(--bim-btn-bg, transparent);padding:6px;align-items:center;position:relative;justify-content:center;border:1px solid transparent;outline:none}.opt-btn:hover{background-color:var(--bim-btn-hover-bg, #444)}.opt-btn.active{background-color:var(--bim-btn-active-bg, rgba(255, 255, 255, .15));color:var(--bim-btn-text-active-color, #fff)}.opt-btn.disabled{opacity:.5;cursor:not-allowed}.opt-btn-icon{width:var(--bim-icon-size, 24px);height:var(--bim-icon-size, 24px);display:flex;align-items:center;justify-content:center;color:var(--bim-icon-color, #ccc);flex-shrink:0}.opt-btn-icon svg{width:100%;height:100%;fill:currentColor}.opt-btn-arrow{font-size:10px;opacity:.6;transition:transform .2s;display:inline-block;margin-left:4px}.opt-btn-arrow.rotated{transform:rotate(180deg)}.opt-btn-text-wrapper{display:flex;align-items:center;justify-content:center;pointer-events:none}.opt-btn-label{display:inline}.opt-btn.no-label .opt-btn-label{display:none}.opt-btn.align-vertical:not(.no-label){flex-direction:column;text-align:center}.opt-btn.align-vertical:not(.no-label) .opt-btn-text-wrapper{margin-top:4px}.opt-btn.align-vertical:not(.no-label) .opt-btn-label{font-size:12px;line-height:1.2}.opt-btn.align-horizontal:not(.no-label){flex-direction:row}.opt-btn.align-horizontal:not(.no-label) .opt-btn-text-wrapper{margin-left:8px}.opt-btn.align-horizontal:not(.no-label) .opt-btn-label{font-size:14px}.opt-btn.no-label .opt-btn-text-wrapper{width:0;height:0;margin:0;padding:0;overflow:visible;position:absolute;top:0;right:0}.opt-btn.no-label .opt-btn-arrow{position:absolute;top:2px;right:2px;margin:0;font-size:8px}.opt-btn-dropdown{position:absolute;background-color:var(--bim-toolbar-bg, rgba(17, 17, 17, .95));border-radius:4px;padding:4px;box-shadow:0 4px 12px #0003;z-index:1001;display:flex;flex-direction:column;border:1px solid rgba(255,255,255,.1);opacity:0;visibility:hidden;transform:translateY(-10px);transition:opacity .2s ease,transform .2s cubic-bezier(.2,0,.2,1),visibility .2s}@keyframes dropdown-fade-in{0%{opacity:0;transform:translateY(-8px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}.opt-btn-dropdown{animation:dropdown-fade-in .2s cubic-bezier(.2,0,.2,1) forwards;opacity:1;visibility:visible;transform:none}.opt-btn-dropdown-item{display:flex;align-items:center;padding:8px 12px;cursor:pointer;border-radius:4px;color:var(--bim-btn-text-color, #ccc);transition:background .2s,border-color .2s,color .2s;box-sizing:border-box;border:1px solid transparent;outline:none}.opt-btn-dropdown-item .opt-btn-icon{color:var(--bim-icon-color, #ccc)}.opt-btn-dropdown-item:hover{background-color:var(--bim-btn-hover-bg, #444)}.opt-btn-dropdown-item.active{background-color:var(--bim-btn-active-bg, rgba(255, 255, 255, .15));color:var(--bim-btn-text-active-color, #fff)}.opt-btn-dropdown-item.align-horizontal{flex-direction:row}.opt-btn-dropdown-item.align-horizontal .opt-btn-icon{width:18px;height:18px;margin-right:8px}.opt-btn-dropdown-item.align-vertical{flex-direction:column;text-align:center}.opt-btn-dropdown-item.align-vertical .opt-btn-icon{width:24px;height:24px;margin-bottom:4px}.opt-btn-dropdown-item.align-vertical .opt-btn-dropdown-label{font-size:12px}.bim-btn-group-root.is-bottom-toolbar .opt-btn-icon{width:32px;height:32px}.bim-btn-group-root.is-bottom-toolbar .opt-btn{padding:8px}.bim-btn-group-root.is-bottom-toolbar.dir-row{max-width:calc(100% - 40px);overflow-x:auto;overflow-y:visible;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.2) transparent}.bim-btn-group-root.is-bottom-toolbar.dir-row .bim-btn-group-section{flex-shrink:0}.bim-btn-group-root.is-bottom-toolbar.dir-row::-webkit-scrollbar{height:4px}.bim-btn-group-root.is-bottom-toolbar.dir-row::-webkit-scrollbar-track{background:transparent}.bim-btn-group-root.is-bottom-toolbar.dir-row::-webkit-scrollbar-thumb{background:#fff3;border-radius:2px}.bim-btn-group-root.is-bottom-toolbar.dir-row::-webkit-scrollbar-thumb:hover{background:#fff6}.bim-btn-group-root.type-glass-pill .bim-btn-group-section{background:var(--bim-floating-bg);backdrop-filter:blur(24px);-webkit-backdrop-filter:blur(24px);border:1px solid var(--bim-floating-border);border-radius:9999px;box-shadow:none;padding:8px;gap:10px}.bim-btn-group-root.type-glass-pill .opt-btn{width:48px;height:48px;min-width:48px;border-radius:9999px;background:var(--bim-floating-btn-bg);border:1px solid var(--bim-floating-btn-border);box-shadow:var(--bim-floating-btn-shadow);color:var(--bim-text-primary);padding:0;transition:all .2s ease-out}.bim-btn-group-root.type-glass-pill .opt-btn:hover{background:var(--bim-floating-btn-bg-hover);transform:scale(1.05);box-shadow:var(--bim-floating-btn-shadow-hover)}.bim-btn-group-root.type-glass-pill .opt-btn:active{transform:scale(.98)}.bim-btn-group-root.type-glass-pill .opt-btn.active{background:var(--bim-primary);border:1px solid var(--bim-primary-active);color:var(--bim-text-inverse);box-shadow:var(--bim-shadow-glow)}.bim-btn-group-root.type-glass-pill .opt-btn.active:hover{background:var(--bim-primary-hover);transform:scale(1.05)}.bim-btn-group-root.type-glass-pill .opt-btn.active:active{transform:scale(.98)}.bim-btn-group-root.type-glass-pill .opt-btn.active .opt-btn-icon{color:var(--bim-icon-inverse)}.bim-btn-group-root.type-glass-pill .opt-btn.disabled{opacity:.3;cursor:not-allowed;transform:none;box-shadow:none}.bim-btn-group-root.type-glass-pill .opt-btn-icon{width:18px;height:18px;color:var(--bim-floating-icon-color);transition:color .2s ease-out}.bim-btn-group-root.type-glass-pill .opt-btn-icon svg{width:18px;height:18px}.bim-btn-group-root.type-glass-pill .opt-btn:hover .opt-btn-icon{color:var(--bim-floating-icon-color-hover)}.bim-btn-group-root.type-glass-pill .opt-btn-label{display:none!important}.bim-btn-group-root.type-glass-pill .opt-btn-text-wrapper{position:absolute;top:2px;right:2px;width:0;height:0;margin:0;padding:0}.bim-btn-group-root.type-glass-pill .opt-btn-arrow{font-size:8px;position:absolute;top:0;right:0;color:var(--bim-text-tertiary)}.opt-btn-dropdown.type-glass-pill{background:#fffffff2;backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);border:1px solid rgba(226,232,240,.6);border-radius:12px;box-shadow:0 8px 24px #0000001f;padding:6px}.opt-btn-dropdown.type-glass-pill .opt-btn-dropdown-item{display:flex;flex-direction:row;align-items:center;gap:10px;border-radius:8px;color:#334155;padding:8px 12px;font-size:13px;font-weight:400;transition:all .1s ease-out}.opt-btn-dropdown.type-glass-pill .opt-btn-dropdown-item:hover{background:#f1f5f9}.opt-btn-dropdown.type-glass-pill .opt-btn-dropdown-item:active{background:#e2e8f0}.opt-btn-dropdown.type-glass-pill .opt-btn-dropdown-item.active{background:#3b82f6;color:#fff}.opt-btn-dropdown.type-glass-pill .opt-btn-dropdown-item.active .opt-btn-icon,.opt-btn-dropdown.type-glass-pill .opt-btn-dropdown-item.active .opt-btn-dropdown-label{color:#fff}.opt-btn-dropdown.type-glass-pill .opt-btn-dropdown-item .opt-btn-icon{width:18px;height:18px;color:#334155;flex-shrink:0}.opt-btn-dropdown.type-glass-pill .opt-btn-dropdown-item .opt-btn-icon svg{width:18px;height:18px}.opt-btn-dropdown.type-glass-pill .opt-btn-dropdown-item .opt-btn-dropdown-label{white-space:nowrap;color:#334155}.opt-btn-dropdown.type-glass-pill.theme-dark{background:var(--bim-bg-overlay);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);border:1px solid var(--bim-border-default);box-shadow:var(--bim-shadow-lg)}.opt-btn-dropdown.type-glass-pill.theme-dark .opt-btn-dropdown-item{color:var(--bim-text-primary)}.opt-btn-dropdown.type-glass-pill.theme-dark .opt-btn-dropdown-item:hover{background:var(--bim-floating-btn-bg)}.opt-btn-dropdown.type-glass-pill.theme-dark .opt-btn-dropdown-item:active{background:var(--bim-floating-btn-bg-hover)}.opt-btn-dropdown.type-glass-pill.theme-dark .opt-btn-dropdown-item.active{background:var(--bim-primary);color:var(--bim-text-inverse)}.opt-btn-dropdown.type-glass-pill.theme-dark .opt-btn-dropdown-item .opt-btn-icon{color:var(--bim-floating-icon-color)}.opt-btn-dropdown.type-glass-pill.theme-dark .opt-btn-dropdown-item .opt-btn-dropdown-label{color:var(--bim-text-primary)}.engine-view-dropdown-host{position:relative}.engine-view-dropdown-trigger{position:absolute;top:50px;right:95px;z-index:999;width:32px;height:32px;display:flex;align-items:center;justify-content:center;cursor:pointer;color:#fff;filter:drop-shadow(0 2px 4px rgba(0,0,0,.3));transition:filter .2s ease;background:none;border:none;padding:0}.engine-view-dropdown-trigger:hover{filter:drop-shadow(0 3px 6px rgba(0,0,0,.5))}.engine-view-dropdown-trigger svg{width:24px;height:24px}.engine-view-dropdown-trigger--top-right{top:12px;right:12px}.engine-view-dropdown-menu{background:var(--bim-panel-bg, rgba(255, 255, 255, .95));border:1px solid var(--bim-panel-border, rgba(226, 232, 240, .6));border-radius:8px;box-shadow:var(--bim-shadow-lg, 0 10px 25px rgba(0, 0, 0, .15));min-width:160px;-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);animation:dropdownIn .15s ease-out}.engine-view-dropdown-item{padding:4px 8px;cursor:pointer;font-size:12px;color:var(--bim-text-primary, #0f172a);transition:all .15s ease;line-height:1.5;white-space:nowrap}.engine-view-dropdown-item:hover{background:var(--bim-component-bg-hover, rgba(15, 23, 42, .04));color:var(--bim-primary, #2563eb)}.engine-view-dropdown-item:active{background:var(--bim-component-bg-active, rgba(15, 23, 42, .08))}.engine-view-dropdown-item:not(:last-child){border-bottom:1px solid var(--bim-panel-border, rgba(226, 232, 240, .6))}@keyframes dropdownIn{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}.bim-help-panel-overlay{position:fixed;inset:0;background:#0009;display:flex;justify-content:center;align-items:center;z-index:10000;visibility:hidden;opacity:0;transition:opacity .2s ease}.bim-help-panel-overlay.active{visibility:visible;opacity:1}.bim-help-panel-container{background:var(--bim-panel-bg);width:720px;max-width:92%;max-height:85vh;border-radius:10px;box-shadow:var(--bim-shadow-lg);display:flex;flex-direction:column;overflow:hidden;border:1px solid var(--bim-panel-border)}.bim-help-panel-close{position:absolute;right:16px;top:12px;width:32px;height:32px;display:flex;align-items:center;justify-content:center;font-size:22px;cursor:pointer;color:var(--bim-text-tertiary);background:transparent;border:none;line-height:1;z-index:10;transition:color .15s ease}.bim-help-panel-close:hover{color:var(--bim-text-primary)}.bim-help-panel-header{display:flex;justify-content:center;padding:16px 20px;gap:8px;border-bottom:1px solid var(--bim-divider);background:var(--bim-panel-header-bg);flex-shrink:0}.bim-help-panel-tab-btn{background:var(--bim-component-bg);border:1px solid var(--bim-border-default);padding:8px 28px;font-size:14px;font-weight:600;cursor:pointer;transition:all .15s ease;border-radius:5px;color:var(--bim-text-secondary)}.bim-help-panel-tab-btn:hover{border-color:var(--bim-border-strong);color:var(--bim-text-primary)}.bim-help-panel-tab-btn.active{border:2px solid var(--bim-text-primary);color:var(--bim-text-primary);background:var(--bim-component-bg)}.bim-help-panel-body{padding:20px 24px;overflow-y:auto;flex:1}.bim-help-panel-body::-webkit-scrollbar{width:5px}.bim-help-panel-body::-webkit-scrollbar-track{background:transparent}.bim-help-panel-body::-webkit-scrollbar-thumb{background:var(--bim-scrollbar-thumb);border-radius:3px}.bim-help-panel-tab-content{display:none;grid-template-columns:repeat(3,1fr);gap:12px}.bim-help-panel-tab-content.active{display:grid}.bim-help-panel-card{background:var(--bim-component-bg);border:1px solid var(--bim-border-subtle);border-radius:8px;padding:16px 14px;display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:110px;gap:10px}.bim-help-panel-card-span-2{grid-column:span 2}.bim-help-panel-card-title{font-size:13px;color:var(--bim-text-primary);font-weight:700;width:100%;text-align:left;border-left:3px solid var(--bim-primary);padding-left:8px}.bim-help-panel-control-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap;color:var(--bim-text-primary);font-size:13px}.bim-help-panel-kbd{background:var(--bim-bg-base);border:1px solid var(--bim-border-default);border-radius:4px;box-shadow:0 2px 0 var(--bim-border-subtle);color:var(--bim-text-primary);display:inline-flex;align-items:center;justify-content:center;font-size:12px;font-weight:700;padding:4px 10px;min-width:24px;height:26px;font-family:ui-monospace,SFMono-Regular,monospace}.bim-help-panel-wasd-group{display:flex;flex-direction:column;align-items:center;gap:4px}.bim-help-panel-kbd-row{display:flex;gap:4px}.bim-help-panel-rule-desc{font-size:12px;color:var(--bim-text-secondary);line-height:1.5;text-align:center}.bim-help-panel-bold{color:var(--bim-text-primary);font-weight:700}.bim-help-panel-mouse-box{width:22px;height:32px;border:2px solid var(--bim-text-primary);border-radius:8px;position:relative;background:var(--bim-bg-base);flex-shrink:0}.bim-help-panel-mouse-box:after{content:"";position:absolute;top:4px;left:50%;height:10px;border-right:2px solid var(--bim-text-primary);transform:translate(-50%)}.bim-help-panel-mouse-left{position:absolute;top:0;left:0;width:50%;height:55%;border-radius:6px 0 0;background:var(--bim-text-primary)}.bim-help-panel-mouse-right{position:absolute;top:0;right:0;width:50%;height:55%;border-radius:0 6px 0 0;background:var(--bim-text-primary)}.bim-help-panel-mouse-wheel{position:absolute;top:6px;left:50%;width:4px;height:8px;background:var(--bim-text-primary);border-radius:2px;transform:translate(-50%);z-index:2}.bim-help-panel-teleport-icon{width:28px;height:28px;border:2px solid var(--bim-text-primary);border-radius:50%;position:relative;display:flex;justify-content:center;align-items:center;flex-shrink:0}.bim-help-panel-teleport-icon:before,.bim-help-panel-teleport-icon:after{content:"";position:absolute;background:var(--bim-text-primary)}.bim-help-panel-teleport-icon:before{width:36px;height:2px}.bim-help-panel-teleport-icon:after{width:2px;height:36px}.bim-help-panel-teleport-inner{width:6px;height:6px;background:var(--bim-text-primary);border-radius:50%;z-index:2}.bim-help-panel-footer{display:flex;justify-content:center;gap:16px;padding:16px 24px 24px;border-top:1px solid var(--bim-divider);flex-shrink:0}.bim-help-panel-btn{padding:10px 48px;border-radius:6px;border:none;font-size:14px;cursor:pointer;font-weight:600;transition:all .15s ease}.bim-help-panel-btn-primary{background:var(--bim-primary);color:var(--bim-text-inverse)}.bim-help-panel-btn-primary:hover{background:var(--bim-primary-hover)}.bim-help-panel-btn-secondary{background:var(--bim-component-bg-hover);color:var(--bim-text-secondary);border:1px solid var(--bim-border-default)}.bim-help-panel-btn-secondary:hover{background:var(--bim-component-bg-active);color:var(--bim-text-primary)}@media(max-width:640px){.bim-help-panel-container{width:96%;max-height:90vh}.bim-help-panel-tab-content{grid-template-columns:1fr}.bim-help-panel-card-span-2{grid-column:span 1}.bim-help-panel-tab-btn{padding:8px 20px;font-size:13px}.bim-help-panel-btn{padding:10px 24px}}.engine-info-button{position:absolute;bottom:20px;left:10px;z-index:999;width:32px;height:32px;display:flex;align-items:center;justify-content:center;cursor:pointer;color:#fff;filter:drop-shadow(0 2px 4px rgba(0,0,0,.3));transition:filter .2s ease;background:none;border:none;padding:0}.engine-info-button:hover{filter:drop-shadow(0 3px 6px rgba(0,0,0,.5))}.engine-info-button svg{width:24px;height:24px}.originRotate{width:10px;height:10px;background-color:red}.versionText{position:absolute;right:10px;color:#86d9ff;z-index:1000;bottom:10px;font-size:10px;background:transparent;pointer-events:none}.originDiv{position:absolute;top:100px;left:100px;width:30px;height:30px;border-radius:50%;z-index:1000;pointer-events:none}.tagDiv{color:gray;background:#fffc;padding:5px;font-size:12px}.catchPoint{pointer-events:none;stroke:#08dfd7;fill:transparent;stroke-width:2}.catchLine{position:absolute;width:10px;height:10px;pointer-events:none;background-color:green}.catchPlane{position:absolute;width:10px;height:10px;pointer-events:none;background-color:#ff0}.bim-mobile-roam-controls{position:absolute;left:0;right:0;bottom:max(18px,env(safe-area-inset-bottom));z-index:1200;display:flex;align-items:flex-end;justify-content:space-between;padding:0 22px;pointer-events:none;user-select:none;-webkit-user-select:none;touch-action:none}.bim-mobile-roam-pad,.bim-mobile-roam-look-group{pointer-events:auto}.bim-mobile-roam-move-pad{width:116px;height:116px;border:1px solid rgba(255,255,255,.34);border-radius:50%;display:flex;align-items:center;justify-content:center;background:#14182073;box-shadow:0 4px 16px #0000003d inset,0 4px 14px #0003;touch-action:none}.bim-mobile-roam-button{width:44px;height:44px;border:1px solid rgba(255,255,255,.46);border-radius:8px;color:#fff;background:#14182094;box-shadow:0 4px 14px #00000038;font-size:15px;font-weight:600;line-height:1;touch-action:none}.bim-mobile-roam-button.is-active{background:#267effc7;border-color:#ffffffb8}.bim-mobile-roam-move-pad.is-active{border-color:#267effd6;background:#142c4a8a}.bim-mobile-roam-look-group{display:flex;align-items:center;gap:12px}.bim-mobile-roam-vertical-pad{display:flex;flex-direction:column;gap:10px}.bim-mobile-roam-look-pad{width:116px;height:116px;border:1px solid rgba(255,255,255,.34);border-radius:50%;display:flex;align-items:center;justify-content:center;background:#14182073;box-shadow:0 4px 16px #0000003d inset,0 4px 14px #0003;touch-action:none}.bim-mobile-roam-look-pad.is-active{border-color:#267effd6;background:#142c4a8a}.bim-mobile-roam-look-knob,.bim-mobile-roam-move-knob{width:46px;height:46px;border-radius:50%;background:#ffffffb8;box-shadow:0 2px 10px #00000042}@media(max-width:520px){.bim-mobile-roam-controls{padding:0 14px;bottom:max(14px,env(safe-area-inset-bottom))}.bim-mobile-roam-move-pad{width:96px;height:96px}.bim-mobile-roam-button{width:38px;height:38px;font-size:13px}.bim-mobile-roam-look-pad{width:96px;height:96px}.bim-mobile-roam-look-knob,.bim-mobile-roam-move-knob{width:38px;height:38px}}.ViewCube{position:absolute;width:120px;height:120px;top:0;right:0;z-index:999}.homeViewWrapper{position:absolute;cursor:pointer;pointer-events:auto;background-size:100% 100%;background-repeat:no-repeat;background-color:#fff0;color:#fff;top:10px;right:100;width:20px;height:20px;z-index:999;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.viewSettingWrapper{position:absolute;cursor:pointer;pointer-events:auto;background-size:100% 100%;background-repeat:no-repeat;font-weight:800;background-color:#fff0;color:#fff;top:30px;right:100;width:20px;height:20px;z-index:999;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.cameraToggleWrapper{position:absolute;cursor:pointer;pointer-events:auto;background-color:#ffffffe6;color:#333;font-size:26px;font-weight:700;display:none;align-items:center;justify-content:center;border-radius:4px;box-shadow:0 2px 4px #0003;transition:all .3s ease;top:70px;right:90px;width:44px;height:44px;z-index:999;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.cameraToggleWrapper.show{display:flex}.cameraToggleWrapper:hover{background-color:#fff;box-shadow:0 3px 6px #0000004d;transform:scale(1.1)}.screenshotWrapper{position:absolute;cursor:pointer;pointer-events:auto;background-color:#ffffffe6;color:#333;font-size:20px;display:none;align-items:center;justify-content:center;border-radius:4px;box-shadow:0 2px 4px #0003;transition:all .3s ease;top:120px;right:90px;width:44px;height:44px;z-index:999;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.screenshotWrapper.show{display:flex}.screenshotWrapper:hover{background-color:#fff;box-shadow:0 3px 6px #0000004d;transform:scale(1.1)}.fullscreenWrapper{position:absolute;cursor:pointer;pointer-events:auto;background-color:#ffffffe6;color:#333;font-size:26px;font-weight:700;display:none;align-items:center;justify-content:center;border-radius:4px;box-shadow:0 2px 4px #0003;transition:all .3s ease;top:170px;right:90px;width:44px;height:44px;z-index:999;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.fullscreenWrapper.show{display:flex}.fullscreenWrapper:hover{background-color:#fff;box-shadow:0 3px 6px #0000004d;transform:scale(1.1)}.measure-elevation{position:absolute;pointer-events:none}.measureSvg{position:absolute;width:1920px;height:1080px}.catch-point{position:absolute;width:10px;height:10px;background-color:red;border-radius:50%;pointer-events:none}.annotation-container{position:absolute;pointer-events:none;top:0;left:0}.measureLine{position:absolute;pointer-events:none;stroke:#009bea;fill:#009bea;filter:drop-shadow(0px 0px 2px rgba(0,0,0,.3))}.measureBack{cursor:pointer;pointer-events:auto;fill:#fff;rx:5;ry:5;filter:drop-shadow(0px 0px 3px rgba(0,0,0,.3));text-align:center}.measureLabel{position:absolute;fill:#fff;font-family:tahoma;font-size:14px;stroke:#009bea;font-weight:200;pointer-events:none;text-anchor:middle}.measurePointer{fill:#009bea}.Hight{stroke:#fff;font-weight:500;filter:drop-shadow(0px 0px 2px rgb(0,195,255))}.allow-select{pointer-events:auto}.disallow-select{pointer-events:none}.angle-annotation{position:absolute;pointer-events:auto}.measure-2d-selected.measureLine{stroke:#fff;fill:#fff;filter:drop-shadow(0 0 3px rgb(0,195,255))}.measure-2d-selected.measurePointer{fill:#fff;stroke:#00c3ff;stroke-width:2px;filter:drop-shadow(0 0 3px rgb(0,195,255))}.measure-2d-selected.measureBack{fill:#009bea;stroke:#fff;stroke-width:1px;filter:drop-shadow(0 0 4px rgb(0,195,255))}.measure-2d-selected.measureLabel{fill:#fff;stroke:none;font-weight:600}polygon.measure-2d-selected{fill:#00c3ff38}.markup-2d-layer{position:absolute;inset:0;pointer-events:none;z-index:30}.markup-2d-svg{position:absolute;inset:0;overflow:visible;pointer-events:none}.markup-2d-toolbar{position:absolute;top:8px;left:50%;transform:translate(-50%);display:none;align-items:center;gap:6px;padding:6px;background:#fff;border:1px solid #d9d9d9;border-radius:8px;box-shadow:0 4px 14px #00000024;pointer-events:auto;-webkit-user-select:none;user-select:none;z-index:1300}.markup-2d-toolbar button,.markup-2d-toolbar input{height:28px;border:1px solid #d9d9d9;border-radius:4px;background:#fff;color:#1f2937;font-size:12px}.markup-2d-toolbar button{width:28px;min-width:28px;padding:0;cursor:pointer;display:inline-flex;align-items:center;justify-content:center}.markup-2d-toolbar button:hover,.markup-2d-toolbar button.active{color:#1677ff;border-color:#1677ff;background:#eef6ff}.markup-2d-toolbar input[type=color]{width:34px;padding:2px}.markup-2d-toolbar input[type=number]{width:54px;padding:0 4px}.markup-2d-icon-button img{width:16px;height:16px;display:block;pointer-events:none}.markup-2d-divider{width:1px;height:22px;background:#e5e7eb}.markup-2d-shape{pointer-events:auto;cursor:pointer}.markup-2d-shape.selected{filter:drop-shadow(0 0 4px rgba(22,119,255,.9))}.MapController{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.engine-2d-container{position:relative;width:100%;height:100%;overflow:hidden}.engine-2d-canvas{display:block;width:100%;height:100%;outline:none}.engine-2d-version-text{position:absolute;right:10px;bottom:0;z-index:1000;color:#86d9ff;font-size:10px;background:transparent;pointer-events:none}.engine-2d-cad-cursor{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;overflow:hidden}.engine-2d-cad-cursor__h{position:absolute;left:0;width:100%;height:1px;background:var(--e2d-cursor, rgba(255, 255, 255, .85));transform:translateY(-50%)}.engine-2d-cad-cursor__v{position:absolute;top:0;width:1px;height:100%;background:var(--e2d-cursor, rgba(255, 255, 255, .85));transform:translate(-50%)}.engine-2d-cad-cursor__box{position:absolute;width:8px;height:8px;border:1px solid var(--e2d-cursor, rgba(255, 255, 255, .85));transform:translate(-50%,-50%)}.engine-2d-cad-cursor--short-crosshair .engine-2d-cad-cursor__h{width:72px;left:0;transform:translate(-50%,-50%)}.engine-2d-cad-cursor--short-crosshair .engine-2d-cad-cursor__v{height:72px;top:0;transform:translate(-50%,-50%)}.engine-2d-context-menu{position:absolute;z-index:9999;min-width:140px;background:var(--e2d-bg2, #252526);border:1px solid var(--e2d-border, rgba(255, 255, 255, .12));border-radius:4px;box-shadow:0 4px 16px var(--e2d-shadow, rgba(0, 0, 0, .5));padding:4px 0;display:none;-webkit-user-select:none;user-select:none}.engine-2d-context-menu--visible{display:block}.engine-2d-context-menu__item{padding:7px 16px;font-size:13px;color:var(--e2d-text2, #cccccc);cursor:pointer;white-space:nowrap;transition:background .1s,color .1s}.engine-2d-context-menu__item:hover{background:var(--e2d-bg-accent, #094771);color:var(--e2d-text-accent, #ffffff)}.engine-2d-context-menu__divider{height:1px;background:var(--e2d-border, rgba(255, 255, 255, .1));margin:4px 0}.engine-2d-stats{position:absolute;top:10px;left:10px;background:var(--e2d-float-bg, rgba(0, 0, 0, .7));color:var(--e2d-text, #e0e0e0);padding:8px 12px;border-radius:4px;font-family:monospace;font-size:12px;pointer-events:none;-webkit-user-select:none;user-select:none}.engine-2d-stats div{margin:2px 0}.engine-2d-loading{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);background:var(--e2d-float-bg, rgba(0, 0, 0, .8));color:var(--e2d-text, #e0e0e0);padding:20px 40px;border-radius:8px;font-size:16px;text-align:center}.engine-2d-loading-spinner{border:3px solid var(--e2d-border, rgba(255, 255, 255, .3));border-top:3px solid var(--e2d-accent, #4fc3f7);border-radius:50%;width:40px;height:40px;animation:engine-2d-spin 1s linear infinite;margin:0 auto 10px}@keyframes engine-2d-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.engine-2d-error{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);background:#d32f2feb;color:#fff;padding:20px 40px;border-radius:8px;font-size:14px;max-width:80%;text-align:center}.engine-2d-controls-hint{position:absolute;bottom:10px;left:10px;background:var(--e2d-float-bg, rgba(0, 0, 0, .6));color:var(--e2d-text, #e0e0e0);border:1px solid var(--e2d-float-border, rgba(255, 255, 255, .08));padding:8px 12px;border-radius:4px;font-size:12px;pointer-events:none;-webkit-user-select:none;user-select:none}.engine-2d-controls-hint kbd{background:var(--e2d-icon-bg, rgba(255, 255, 255, .2));color:var(--e2d-text, #e0e0e0);padding:2px 6px;border-radius:3px;font-family:monospace}.engine-2d-workspace-tabs{position:absolute;left:12px;bottom:10px;z-index:40;display:flex;align-items:center;max-width:calc(100% - 24px);overflow-x:auto;background:var(--e2d-bg2, rgba(28, 33, 40, .92));border:1px solid var(--e2d-border, rgba(255, 255, 255, .14));border-radius:4px;box-shadow:0 4px 14px var(--e2d-shadow, rgba(0, 0, 0, .28))}.engine-2d-workspace-tabs__item{flex:0 0 auto;max-width:180px;height:28px;padding:0 12px;border:0;border-right:1px solid var(--e2d-border2, rgba(255, 255, 255, .1));background:transparent;color:var(--e2d-text2, #d7dde4);font-size:12px;line-height:28px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer}.engine-2d-workspace-tabs__item:last-child{border-right:0}.engine-2d-workspace-tabs__item:hover:not(:disabled){background:var(--e2d-bg-hover, rgba(79, 195, 247, .12));color:var(--e2d-text-accent, #ffffff)}.engine-2d-workspace-tabs__item--active{background:var(--e2d-accent, #2f80ed);color:#fff;cursor:default}.engine-2d-workspace-tabs__item:disabled{opacity:.9}.engine-2d-search{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;z-index:9998;display:none}.engine-2d-search--visible{display:block}.engine-2d-search__box{position:absolute;top:14%;left:50%;transform:translate(-50%);width:480px;max-width:calc(100% - 40px);background:var(--e2d-bg, #1e1f22);border:1px solid var(--e2d-border, rgba(255, 255, 255, .14));border-radius:10px;box-shadow:0 8px 40px var(--e2d-shadow-lg, rgba(0, 0, 0, .65)),0 2px 8px var(--e2d-shadow, rgba(0, 0, 0, .4));overflow:hidden;pointer-events:auto;animation:engine-2d-search-in .18s cubic-bezier(.34,1.2,.64,1)}@keyframes engine-2d-search-in{0%{opacity:0;transform:translate(-50%) translateY(-8px) scale(.97)}to{opacity:1;transform:translate(-50%) translateY(0) scale(1)}}.engine-2d-search__input-row{display:flex;align-items:center;padding:0 12px;gap:8px;height:48px}.engine-2d-search__icon{flex-shrink:0;color:var(--e2d-icon, rgba(255, 255, 255, .4));display:flex;align-items:center}.engine-2d-search__input{flex:1;background:transparent;border:none;outline:none;color:var(--e2d-text, #e0e0e0);font-size:14px;line-height:1.4;caret-color:var(--e2d-accent, #4fc3f7)}.engine-2d-search__input::placeholder{color:var(--e2d-text3, rgba(255, 255, 255, .25))}.engine-2d-search__clear{flex-shrink:0;background:var(--e2d-icon-bg, rgba(255, 255, 255, .08));border:none;border-radius:4px;color:var(--e2d-icon, rgba(255, 255, 255, .5));cursor:pointer;display:flex;align-items:center;justify-content:center;width:22px;height:22px;padding:0;opacity:0;pointer-events:none;transition:opacity .15s,background .15s,color .15s}.engine-2d-search__clear:hover{background:var(--e2d-icon-bg-hover, rgba(255, 255, 255, .16));color:var(--e2d-close-hover, #ffffff)}.engine-2d-search__divider{height:1px;background:var(--e2d-border2, rgba(255, 255, 255, .08));display:none}.engine-2d-search__status{padding:6px 16px;font-size:11px;color:var(--e2d-text3, rgba(255, 255, 255, .35));display:none;-webkit-user-select:none;user-select:none}.engine-2d-search__list{list-style:none;margin:0;padding:4px 0;max-height:320px;overflow-y:auto;display:none;scrollbar-width:thin;scrollbar-color:var(--e2d-scrollbar, rgba(255, 255, 255, .15)) transparent}.engine-2d-search__list::-webkit-scrollbar{width:4px}.engine-2d-search__list::-webkit-scrollbar-track{background:transparent}.engine-2d-search__list::-webkit-scrollbar-thumb{background:var(--e2d-scrollbar, rgba(255, 255, 255, .15));border-radius:2px}.engine-2d-search__item{display:flex;align-items:center;gap:8px;padding:8px 14px;cursor:pointer;transition:background .1s;min-height:38px;flex-wrap:nowrap}.engine-2d-search__item:hover,.engine-2d-search__item--active{background:var(--e2d-bg-hover, rgba(79, 195, 247, .08))}.engine-2d-search__item-badge{flex-shrink:0;font-size:10px;font-weight:500;padding:2px 6px;border-radius:3px;letter-spacing:.03em;white-space:nowrap;color:var(--e2d-accent, #4fc3f7);background:#4fc3f71f}.engine-2d-search__item-name{flex:1;font-size:13px;color:var(--e2d-text, #e0e0e0);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.engine-2d-search__item-layer{flex-shrink:0;font-size:11px;color:var(--e2d-text3, rgba(255, 255, 255, .3));white-space:nowrap;max-width:100px;overflow:hidden;text-overflow:ellipsis}.engine-2d-search__item-desc{flex-shrink:0;font-size:11px;color:var(--e2d-text4, rgba(255, 255, 255, .25));white-space:nowrap;max-width:120px;overflow:hidden;text-overflow:ellipsis}.engine-2d-search__mark{background:transparent;color:var(--e2d-accent, #4fc3f7);font-weight:600}.engine-2d-mouse-coord{position:absolute;bottom:10px;left:50%;transform:translate(-50%);display:flex;align-items:center;gap:12px;background:var(--e2d-float-bg, rgba(0, 0, 0, .65));color:var(--e2d-text, #e0e0e0);padding:5px 14px;border-radius:4px;font-family:monospace;font-size:12px;pointer-events:none;-webkit-user-select:none;user-select:none;border:1px solid var(--e2d-float-border, rgba(255, 255, 255, .08))}.engine-2d-mouse-coord__label{color:var(--e2d-coord-label, rgba(255, 255, 255, .45));font-size:11px;letter-spacing:.05em}.engine-2d-mouse-coord__value{min-width:90px;color:var(--e2d-coord-value, #76c8ff)}.panorama-annotation-container{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;z-index:1000;overflow:hidden}.panorama-annotation{position:absolute;pointer-events:auto;cursor:pointer;transform:translate(-50%,-50%);transition:opacity .2s ease,transform .2s ease;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.panorama-annotation:hover{z-index:1001;transform:translate(-50%,-50%) scale(1.1)}.panorama-annotation-icon{width:40px;height:40px}.panorama-annotation-icon img{width:100%;height:100%;object-fit:contain;display:block;filter:drop-shadow(0 2px 4px rgba(0,0,0,.3))}.panorama-annotation-text{max-width:200px;text-align:center;line-height:1.4}.panorama-annotation-link{transition:background-color .2s ease,transform .2s ease}.panorama-annotation-link:hover{z-index:1002}.panorama-annotation-link img{display:block;flex-shrink:0}.panorama-annotation.hidden{display:none!important}@keyframes pulse{0%,to{opacity:1}50%{opacity:.5}}.panorama-annotation.loading{animation:pulse 1.5s ease-in-out infinite}@media(max-width:768px){.panorama-annotation-icon{width:32px;height:32px}.panorama-annotation-text,.panorama-annotation-link{font-size:12px!important;padding:6px 10px!important}}.cesium-svgPath-svg{position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden}.cesium-button{display:inline-block;position:relative;background:#303336;border:1px solid #444;color:#edffff;fill:#edffff;border-radius:4px;padding:5px 12px;margin:2px 3px;cursor:pointer;overflow:hidden;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.cesium-button:focus{color:#fff;fill:#fff;border-color:#ea4;outline:none}.cesium-button:hover{color:#fff;fill:#fff;background:#48b;border-color:#aef;box-shadow:0 0 8px #fff}.cesium-button:active{color:#000;fill:#000;background:#adf;border-color:#fff;box-shadow:0 0 8px #fff}.cesium-button:disabled,.cesium-button-disabled,.cesium-button-disabled:focus,.cesium-button-disabled:hover,.cesium-button-disabled:active{background:#303336;border-color:#444;color:#646464;fill:#646464;box-shadow:none;cursor:default}.cesium-button option{background-color:#000;color:#eee}.cesium-button option:disabled{color:#777}.cesium-button input,.cesium-button label{cursor:pointer}.cesium-button input{vertical-align:sub}.cesium-toolbar-button{box-sizing:border-box;width:32px;height:32px;border-radius:14%;padding:0;vertical-align:middle;z-index:0}.cesium-performanceDisplay-defaultContainer{position:absolute;top:50px;right:10px;text-align:right}.cesium-performanceDisplay{background-color:#282828b3;padding:7px;border-radius:5px;border:1px solid #444;font:700 12px sans-serif}.cesium-performanceDisplay-fps{color:#e52}.cesium-performanceDisplay-throttled{color:#a42}.cesium-performanceDisplay-ms{color:#de3}.cesium-animation-theme{visibility:hidden;display:block;position:absolute;z-index:-100}.cesium-animation-themeNormal{color:#222}.cesium-animation-themeHover{color:#4488b0}.cesium-animation-themeSelect{color:#242}.cesium-animation-themeDisabled{color:#333}.cesium-animation-themeKnob{color:#222}.cesium-animation-themePointer{color:#2e2}.cesium-animation-themeSwoosh{color:#8ac}.cesium-animation-themeSwooshHover{color:#aef}.cesium-animation-svgText{fill:#edffff;font-family:Sans-Serif;font-size:15px;text-anchor:middle}.cesium-animation-blank{fill:#000;fill-opacity:.01;stroke:none}.cesium-animation-rectButton{cursor:pointer;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.cesium-animation-rectButton .cesium-animation-buttonGlow{fill:#fff;stroke:none;display:none}.cesium-animation-rectButton:hover .cesium-animation-buttonGlow{display:block}.cesium-animation-rectButton .cesium-animation-buttonPath{fill:#edffff}.cesium-animation-rectButton .cesium-animation-buttonMain{stroke:#444;stroke-width:1.2}.cesium-animation-rectButton:hover .cesium-animation-buttonMain{stroke:#aef}.cesium-animation-rectButton:active .cesium-animation-buttonMain{fill:#abd6ff}.cesium-animation-buttonDisabled{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.cesium-animation-buttonDisabled .cesium-animation-buttonMain{stroke:#555}.cesium-animation-buttonDisabled .cesium-animation-buttonPath{fill:#818181}.cesium-animation-buttonDisabled .cesium-animation-buttonGlow{display:none}.cesium-animation-buttonToggled .cesium-animation-buttonGlow{display:block;fill:#2e2}.cesium-animation-buttonToggled .cesium-animation-buttonMain{stroke:#2e2}.cesium-animation-buttonToggled:hover .cesium-animation-buttonGlow{fill:#fff}.cesium-animation-buttonToggled:hover .cesium-animation-buttonMain{stroke:#2e2}.cesium-animation-shuttleRingG,.cesium-animation-shuttleRingPointer,.cesium-animation-shuttleRingPausePointer{cursor:pointer}.cesium-animation-shuttleRingBack{fill:#181818;fill-opacity:.8;stroke:#333;stroke-width:1.2}.cesium-animation-shuttleRingSwoosh line{stroke:#8ac;stroke-width:3;stroke-opacity:.2;stroke-linecap:round}.cesium-animation-knobOuter{cursor:pointer;stroke:#444;stroke-width:1.2}.cesium-animation-knobInner{cursor:pointer}.cesium-baseLayerPicker-selected{position:absolute;top:0;left:0;width:100%;height:100%;border:none}.cesium-baseLayerPicker-dropDown{display:block;position:absolute;box-sizing:content-box;top:auto;right:0;width:320px;max-height:500px;margin-top:5px;background-color:#262626bf;border:1px solid #444;padding:6px;overflow:auto;border-radius:10px;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;transform:translateY(-20%);visibility:hidden;opacity:0;transition:visibility 0s .2s,opacity .2s ease-in,transform .2s ease-in}.cesium-baseLayerPicker-dropDown-visible{transform:translate(0);visibility:visible;opacity:1;transition:opacity .2s ease-out,transform .2s ease-out}.cesium-baseLayerPicker-sectionTitle{display:block;font-family:sans-serif;font-size:16pt;text-align:left;color:#edffff;margin-bottom:4px}.cesium-baseLayerPicker-choices{margin-bottom:5px}.cesium-baseLayerPicker-categoryTitle{color:#edffff;font-size:11pt}.cesium-baseLayerPicker-choices{display:block;border:1px solid #888;border-radius:5px;padding:5px 0}.cesium-baseLayerPicker-item{display:inline-block;vertical-align:top;margin:2px 5px;width:64px;text-align:center;cursor:pointer}.cesium-baseLayerPicker-itemLabel{display:block;font-family:sans-serif;font-size:8pt;text-align:center;vertical-align:middle;color:#edffff;cursor:pointer;word-wrap:break-word}.cesium-baseLayerPicker-item:hover .cesium-baseLayerPicker-itemLabel,.cesium-baseLayerPicker-item:focus .cesium-baseLayerPicker-itemLabel{text-decoration:underline}.cesium-baseLayerPicker-itemIcon{display:inline-block;position:relative;width:inherit;height:auto;background-size:100% 100%;border:solid 1px #444;border-radius:9px;color:#edffff;margin:0;padding:0;cursor:pointer;box-sizing:border-box}.cesium-baseLayerPicker-item:hover .cesium-baseLayerPicker-itemIcon{border-color:#fff;box-shadow:0 0 8px #fff,0 0 8px #fff}.cesium-baseLayerPicker-selectedItem .cesium-baseLayerPicker-itemLabel{color:#bdecf8}.cesium-baseLayerPicker-selectedItem .cesium-baseLayerPicker-itemIcon{border:double 4px rgb(189,236,248)}.cesium-widget{font-family:sans-serif;font-size:16px;overflow:hidden;display:block;position:relative;top:0;left:0;width:100%;height:100%}.cesium-widget,.cesium-widget canvas{width:100%;height:100%;touch-action:none}.cesium-widget-credits{display:block;position:absolute;bottom:0;left:0;color:#fff;font-size:10px;text-shadow:0px 0px 2px #000000;padding-right:5px}.cesium-widget-errorPanel{position:absolute;inset:0;text-align:center;background:#000000b3;z-index:99999}.cesium-widget-errorPanel:before{display:inline-block;vertical-align:middle;height:100%;content:""}.cesium-widget-errorPanel-content{width:75%;max-width:500px;display:inline-block;text-align:left;vertical-align:middle;border:1px solid #510c00;border-radius:7px;background-color:#f0d9d5;font-size:14px;color:#510c00}.cesium-widget-errorPanel-content.expanded{max-width:75%}.cesium-widget-errorPanel-header{font-size:18px;font-family:Open Sans,Verdana,Geneva,sans-serif;background:#d69d93;border-bottom:2px solid #510c00;border-radius:3px 3px 0 0;padding:15px}.cesium-widget-errorPanel-scroll{overflow:auto;font-family:Open Sans,Verdana,Geneva,sans-serif;white-space:pre-wrap;padding:0 15px;margin:10px 0 20px}.cesium-widget-errorPanel-buttonPanel{padding:0 15px;margin:10px 0 20px;text-align:right}.cesium-widget-errorPanel-buttonPanel button{border-color:#510c00;background:#d69d93;color:#202020;margin:0}.cesium-widget-errorPanel-buttonPanel button:focus{border-color:#510c00;background:#f0d9d5;color:#510c00}.cesium-widget-errorPanel-buttonPanel button:hover{border-color:#510c00;background:#f0d9d5;color:#510c00}.cesium-widget-errorPanel-buttonPanel button:active{border-color:#510c00;background:#b17b72;color:#510c00}.cesium-widget-errorPanel-more-details{text-decoration:underline;cursor:pointer}.cesium-widget-errorPanel-more-details:hover{color:#2b0700}.cesium-cesiumInspector{border-radius:5px;transition:width ease-in-out .25s;background:#303336cc;border:1px solid #444;color:#edffff;display:inline-block;position:relative;padding:4px 12px;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden}.cesium-cesiumInspector-button{text-align:center;font-size:11pt}.cesium-cesiumInspector-visible .cesium-cesiumInspector-button{border-bottom:1px solid #aaa;padding-bottom:3px}.cesium-cesiumInspector input:enabled,.cesium-cesiumInspector-button{cursor:pointer}.cesium-cesiumInspector-visible{width:185px;height:auto}.cesium-cesiumInspector-hidden{width:122px;height:17px}.cesium-cesiumInspector-sectionContent{max-height:600px}.cesium-cesiumInspector-section-collapsed .cesium-cesiumInspector-sectionContent{max-height:0;padding:0!important;overflow:hidden}.cesium-cesiumInspector-dropDown{margin:5px 0;font-family:sans-serif;font-size:10pt;width:185px}.cesium-cesiumInspector-frustumStatistics{padding:5px;background-color:#505050bf}.cesium-cesiumInspector-pickButton{background-color:#0000004d;border:1px solid #444;color:#edffff;border-radius:5px;padding:3px 7px;cursor:pointer;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;margin:0 auto}.cesium-cesiumInspector-pickButton:focus{outline:none}.cesium-cesiumInspector-pickButton:active,.cesium-cesiumInspector-pickButtonHighlight{color:#000;background:#adf;border-color:#fff;box-shadow:0 0 8px #fff}.cesium-cesiumInspector-center{text-align:center}.cesium-cesiumInspector-sectionHeader{font-weight:700;font-size:10pt;margin:0;cursor:pointer}.cesium-cesiumInspector-pickSection{border:1px solid #aaa;border-radius:5px;padding:3px;margin-bottom:5px}.cesium-cesiumInspector-sectionContent{margin-bottom:10px;transition:max-height .25s}.cesium-cesiumInspector-tileText{padding-bottom:10px;border-bottom:1px solid #aaa}.cesium-cesiumInspector-relativeText{padding-top:10px}.cesium-cesiumInspector-sectionHeader:before{margin-right:5px;content:"-";width:1ch;display:inline-block}.cesium-cesiumInspector-section-collapsed .cesium-cesiumInspector-sectionHeader:before{content:"+"}ul.cesium-cesiumInspector-statistics{margin:0;padding-top:3px;padding-bottom:3px}ul.cesium-cesiumInspector-statistics+ul.cesium-cesiumInspector-statistics{border-top:1px solid #aaa}.cesium-cesiumInspector-slider{margin-top:5px}.cesium-cesiumInspector-slider input[type=number]{text-align:left;background-color:#222;outline:none;border:1px solid #444;color:#edffff;width:100px;border-radius:3px;padding:1px;margin-left:10px;cursor:auto}.cesium-cesiumInspector-slider input[type=number]::-webkit-outer-spin-button,.cesium-cesiumInspector-slider input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.cesium-cesiumInspector-slider input[type=range]{margin-left:5px;vertical-align:middle}.cesium-cesiumInspector-hide .cesium-cesiumInspector-styleEditor{display:none}.cesium-cesiumInspector-styleEditor{padding:10px;border-radius:5px;background:#303336cc;border:1px solid #444}.cesium-cesiumInspector-styleEditor textarea{width:100%;height:300px;background:transparent;color:#edffff;border:none;padding:0;white-space:pre;overflow-wrap:normal;overflow-x:auto}.cesium-3DTilesInspector{width:300px;pointer-events:all}.cesium-3DTilesInspector-statistics{font-size:11px}.cesium-3DTilesInspector-disabledElementsInfo{margin:5px 0 0;padding:0 0 0 20px;color:#eed202}.cesium-3DTilesInspector div,.cesium-3DTilesInspector input[type=range]{width:100%;box-sizing:border-box}.cesium-cesiumInspector-error{color:#ff9e9e;overflow:auto}.cesium-3DTilesInspector .cesium-cesiumInspector-section{margin-top:3px}.cesium-3DTilesInspector .cesium-cesiumInspector-sectionHeader+.cesium-cesiumInspector-show{border-top:1px solid white}input.cesium-cesiumInspector-url{overflow:hidden;white-space:nowrap;overflow-x:scroll;background-color:transparent;color:#fff;outline:none;border:none;height:1em;width:100%}.cesium-cesiumInspector .field-group{display:table}.cesium-cesiumInspector .field-group>label{display:table-cell;font-weight:700}.cesium-cesiumInspector .field-group>.field{display:table-cell;width:100%}.cesium-VoxelInspector{width:300px;pointer-events:all}.cesium-VoxelInspector div,.cesium-VoxelInspector input[type=range]{width:100%;box-sizing:border-box}.cesium-VoxelInspector .cesium-cesiumInspector-section{margin-top:3px}.cesium-VoxelInspector .cesium-cesiumInspector-sectionHeader+.cesium-cesiumInspector-show{border-top:1px solid white}.cesium-button.cesium-fullscreenButton,.cesium-button.cesium-vrButton{display:block;width:100%;height:100%;margin:0;border-radius:0}.cesium-viewer-geocoderContainer .cesium-geocoder-input{border:solid 1px #444;background-color:#282828b3;color:#fff;display:inline-block;vertical-align:middle;width:0;height:32px;margin:0;padding:0 32px 0 0;border-radius:0;box-sizing:border-box;transition:width ease-in-out .25s,background-color .2s ease-in-out;-webkit-appearance:none}.cesium-viewer-geocoderContainer:hover .cesium-geocoder-input{border-color:#aef;box-shadow:0 0 8px #fff}.cesium-viewer-geocoderContainer .cesium-geocoder-input:focus{border-color:#ea4;background-color:#0f0f0fe6;box-shadow:none;outline:none}.cesium-viewer-geocoderContainer:hover .cesium-geocoder-input,.cesium-viewer-geocoderContainer .cesium-geocoder-input:focus,.cesium-viewer-geocoderContainer .cesium-geocoder-input-wide{padding-left:4px;width:250px}.cesium-viewer-geocoderContainer .search-results{position:absolute;background-color:#000;color:#eee;overflow-y:auto;opacity:.8;width:100%}.cesium-viewer-geocoderContainer .search-results ul{list-style-type:none;margin:0;padding:0}.cesium-viewer-geocoderContainer .search-results ul li{font-size:14px;padding:3px 10px}.cesium-viewer-geocoderContainer .search-results ul li:hover{cursor:pointer}.cesium-viewer-geocoderContainer .search-results ul li.active{background:#48b}.cesium-geocoder-searchButton{background-color:#303336;display:inline-block;position:absolute;cursor:pointer;width:32px;top:1px;right:1px;height:30px;vertical-align:middle;fill:#edffff}.cesium-geocoder-searchButton:hover{background-color:#48b}.cesium-infoBox{display:block;position:absolute;top:50px;right:0;width:40%;max-width:480px;background:#262626f2;color:#edffff;border:1px solid #444;border-right:none;border-top-left-radius:7px;border-bottom-left-radius:7px;box-shadow:0 0 10px 1px #000;transform:translate(100%);visibility:hidden;opacity:0;transition:visibility 0s .2s,opacity .2s ease-in,transform .2s ease-in}.cesium-infoBox-visible{transform:translate(0);visibility:visible;opacity:1;transition:opacity .2s ease-out,transform .2s ease-out}.cesium-infoBox-title{display:block;height:20px;padding:5px 30px 5px 25px;background:#545454;border-top-left-radius:7px;text-align:center;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;box-sizing:content-box}.cesium-infoBox-bodyless .cesium-infoBox-title{border-bottom-left-radius:7px}button.cesium-infoBox-camera{display:block;position:absolute;top:4px;left:4px;width:22px;height:22px;background:transparent;border-color:transparent;border-radius:3px;padding:0 5px;margin:0}button.cesium-infoBox-close{display:block;position:absolute;top:5px;right:5px;height:20px;background:transparent;border:none;border-radius:2px;font-weight:700;font-size:16px;padding:0 5px;margin:0;color:#edffff}button.cesium-infoBox-close:focus{background:#ee880070;outline:none}button.cesium-infoBox-close:hover{background:#888;color:#000}button.cesium-infoBox-close:active{background:#a00;color:#000}.cesium-infoBox-bodyless .cesium-infoBox-iframe{display:none}.cesium-infoBox-iframe{border:none;width:100%;width:calc(100% - 2px)}span.cesium-sceneModePicker-wrapper{display:inline-block;position:relative;margin:0 3px}.cesium-sceneModePicker-visible{visibility:visible;opacity:1;transition:opacity .25s linear}.cesium-sceneModePicker-hidden{visibility:hidden;opacity:0;transition:visibility 0s .25s,opacity .25s linear}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-none{display:none}.cesium-sceneModePicker-slide-svg{transition:left 2s;top:0;left:0}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-dropDown-icon{box-sizing:border-box;padding:0;margin:3px 0}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button3D,.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-buttonColumbusView,.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button2D{margin:0 0 3px}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button3D .cesium-sceneModePicker-icon2D{left:100%}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button3D .cesium-sceneModePicker-iconColumbusView{left:200%}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-buttonColumbusView .cesium-sceneModePicker-icon3D{left:-200%}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-buttonColumbusView .cesium-sceneModePicker-icon2D,.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button2D .cesium-sceneModePicker-icon3D{left:-100%}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button2D .cesium-sceneModePicker-iconColumbusView{left:100%}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-selected{border-color:#2e2;box-shadow:0 0 8px #fff,0 0 8px #fff}span.cesium-projectionPicker-wrapper{display:inline-block;position:relative;margin:0 3px}.cesium-projectionPicker-visible{visibility:visible;opacity:1;transition:opacity .25s linear}.cesium-projectionPicker-hidden{visibility:hidden;opacity:0;transition:visibility 0s .25s,opacity .25s linear}.cesium-projectionPicker-wrapper .cesium-projectionPicker-none{display:none}.cesium-projectionPicker-wrapper .cesium-projectionPicker-dropDown-icon{box-sizing:border-box;padding:0;margin:3px 0}.cesium-projectionPicker-wrapper .cesium-projectionPicker-buttonPerspective,.cesium-projectionPicker-wrapper .cesium-projectionPicker-buttonOrthographic{margin:0 0 3px}.cesium-projectionPicker-wrapper .cesium-projectionPicker-buttonPerspective .cesium-projectionPicker-iconOrthographic{left:100%}.cesium-projectionPicker-wrapper .cesium-projectionPicker-buttonOrthographic .cesium-projectionPicker-iconPerspective{left:-100%}.cesium-projectionPicker-wrapper .cesium-projectionPicker-selected{border-color:#2e2;box-shadow:0 0 8px #fff,0 0 8px #fff}.cesium-performance-watchdog-message-area{position:relative;background-color:#ff0;color:#000;padding:10px}.cesium-performance-watchdog-message{margin-right:30px}.cesium-performance-watchdog-message-dismiss{position:absolute;right:0;margin:0 10px 0 0}.cesium-navigationHelpButton-wrapper{position:relative;display:inline-block}.cesium-navigation-help{visibility:hidden;position:absolute;top:38px;right:2px;width:250px;border-radius:10px;transform:scale(.01);transform-origin:234px -10px;transition:visibility 0s .25s,transform .25s ease-in}.cesium-navigation-help-visible{visibility:visible;transform:scale(1);transition:transform .25s ease-out}.cesium-navigation-help-instructions{border:1px solid #444;background-color:#262626bf;padding-bottom:5px;border-radius:0 0 10px 10px}.cesium-click-navigation-help{display:none}.cesium-touch-navigation-help{display:none;padding-top:5px}.cesium-click-navigation-help-visible,.cesium-touch-navigation-help-visible{display:block}.cesium-navigation-help-pan{color:#6cf;font-weight:700}.cesium-navigation-help-zoom{color:#65fd00;font-weight:700}.cesium-navigation-help-rotate{color:#ffd800;font-weight:700}.cesium-navigation-help-tilt{color:#d800d8;font-weight:700}.cesium-navigation-help-details{color:#fff}.cesium-navigation-button{color:#fff;background-color:transparent;border-bottom:none;border-top:1px solid #444;border-right:1px solid #444;margin:0;width:50%;cursor:pointer}.cesium-navigation-button-icon{vertical-align:middle;padding:5px 1px}.cesium-navigation-button:focus{outline:none}.cesium-navigation-button-left{border-radius:10px 0 0;border-left:1px solid #444}.cesium-navigation-button-right{border-radius:0 10px 0 0;border-left:none}.cesium-navigation-button-selected{background-color:#262626bf}.cesium-navigation-button-unselected{background-color:#000000bf}.cesium-navigation-button-unselected:hover{background-color:#4c4c4cbf}.cesium-selection-wrapper{position:absolute;width:160px;height:160px;pointer-events:none;visibility:hidden;opacity:0;transition:visibility 0s .2s,opacity .2s ease-in}.cesium-selection-wrapper-visible{visibility:visible;opacity:1;transition:opacity .2s ease-out}.cesium-selection-wrapper svg{fill:#2e2;stroke:#000;stroke-width:1.1px}.cesium-timeline-main{position:relative;left:0;bottom:0;overflow:hidden;border:solid 1px #888;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.cesium-timeline-trackContainer{width:100%;overflow:auto;border-top:solid 1px #888;position:relative;top:0;left:0}.cesium-timeline-tracks{position:absolute;top:0;left:0;width:100%}.cesium-timeline-needle{position:absolute;left:0;top:1.7em;bottom:0;width:1px;background:red}.cesium-timeline-bar{position:relative;left:0;top:0;overflow:hidden;cursor:pointer;width:100%;height:1.7em;background:linear-gradient(to bottom,#747577cc,#3a4452cc 11%,#2e3238cc 46%,#353535cc 81% 100%)}.cesium-timeline-ruler{visibility:hidden;white-space:nowrap;font-size:80%;z-index:-200}.cesium-timeline-highlight{position:absolute;bottom:0;left:0;background:#08f}.cesium-timeline-ticLabel{position:absolute;top:0;left:0;white-space:nowrap;font-size:80%;color:#eee}.cesium-timeline-ticMain{position:absolute;bottom:0;left:0;width:1px;height:50%;background:#eee}.cesium-timeline-ticSub{position:absolute;bottom:0;left:0;width:1px;height:33%;background:#aaa}.cesium-timeline-ticTiny{position:absolute;bottom:0;left:0;width:1px;height:25%;background:#888}.cesium-timeline-icon16{display:block;position:absolute;width:16px;height:16px;background-image:url(data:text/plain;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAQCAYAAAB3AH1ZAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sIDBITKIVzLEMAAAKNSURBVEjHxdXNSxRhHAfw7zzrqhuoWJnSkrippUVSEKsHI9BTUYdAJA/RoYMREV26rAdn6tAfUARi16hQqkOBQRgUEYFWEC3OwczMjdZd92VmdWfmeelgTjO7q7gb0VzmmZnn85vvPPPMM8B/3qTcE2PPpuTZKB1eWuUQACgXYACYwVFbCTTVeZXB/i55o4LFelcAZfStYD4vpAoPGAGo4GBcQEgSOAUMQyAezwK6iQfDPXnhS/FkHZ+/8VLMWxxqWkfH3gbMRNOYi2roavbja0zHQmoFPYf8ED4Ko4aivm9MOG/u9I8mwrafeK7a/tVrNc/bARYN5noadeq7q0342vXw9CIMU6BmW8rVP9cPBPe52uu+v3O/y9sB4gkTWs6Qsk0mj5ExXMelejvA8WafYmkmGPHanTijdtvif8rx5RiCjdWKs2Cp3jWRDl96KhrbqlBeJqBOLyLQXg0IgbkZDS0dO8EZxZfPSTA9jvDDK3mT0OmP1FXh3XwEEAKdTX5MRWLgjCK4pwH3xt/YnjgLHAv4lHTCAKMMu/wV+KZGob6PoKyMQ0+sgBpZVJZn0NterxQaVqef/DRn+/EXYds/mZx2eVeAW9d65dhCEsaKCb7K8HH0gqTevyh9GDkn0VULRiaLzJKGBu9swfdaiie5RVo9ESURN8E8BE0n7ggACJy8KzghSCzp6DmwWxkaCm24EBXr8wI8Hrkq06QBiRC0t24HALS11IBTCyJl4vb1AXmzpbVYTwoVOXN0h7L8Mwtm8bXPybIQ/5FCX3dA2cr6XowvGCA02CvztAnz9+JiZk1AMxG6fEreSoBiPNmoyNnuWiWVzAIAtISO08E6pZi/3N96AIDn4E3h3P8L/wshP+txtEs4JAAAAABJRU5ErkJggg==);background-repeat:no-repeat}.cesium-viewer{font-family:sans-serif;font-size:16px;overflow:hidden;display:block;position:relative;top:0;left:0;width:100%;height:100%}.cesium-viewer-cesiumWidgetContainer{width:100%;height:100%}.cesium-viewer-bottom{display:block;position:absolute;bottom:0;left:0;padding-right:5px}.cesium-viewer .cesium-widget-credits{display:inline;position:static;bottom:auto;left:auto;padding-right:0;color:#fff;font-size:10px;text-shadow:0 0 2px #000000}.cesium-viewer-timelineContainer{position:absolute;bottom:0;left:169px;right:29px;height:27px;padding:0;margin:0;overflow:hidden;font-size:14px}.cesium-viewer-animationContainer{position:absolute;bottom:0;left:0;padding:0;width:169px;height:112px}.cesium-viewer-fullscreenContainer,.cesium-viewer-vrContainer{position:absolute;bottom:0;right:0;padding:0;width:29px;height:29px;overflow:hidden}.cesium-viewer-toolbar{display:block;position:absolute;top:5px;right:5px}.cesium-viewer-cesiumInspectorContainer{display:block;position:absolute;top:50px;right:10px}.cesium-viewer-geocoderContainer{position:relative;display:inline-block;margin:0 3px}.cesium-viewer-cesium3DTilesInspectorContainer,.cesium-viewer-voxelInspectorContainer{display:block;position:absolute;top:50px;right:10px;max-height:calc(100% - 120px);box-sizing:border-box;overflow-y:auto;overflow-x:hidden}.cesium-viewer-i3s-explorer ul{list-style-type:none}.cesium-viewer-i3s-explorer .layersList{padding:0}.cesium-viewer-i3s-explorer input{margin:0 3px 0 0}.cesium-viewer-i3s-explorer .expandItem{cursor:pointer;-webkit-user-select:none;user-select:none;width:20px}.cesium-viewer-i3s-explorer .nested,.cesium-viewer-i3s-explorer #bsl-wrapper{display:none}.cesium-viewer-i3s-explorer .active{display:block}.cesium-viewer-i3s-explorer .li-wrapper{display:flex;flex-direction:row;align-content:center}.bim-engine-gis-container,.bim-engine-gis-container .cesium-viewer,.bim-engine-gis-container .cesium-viewer-cesiumWidgetContainer,.bim-engine-gis-container .cesium-widget,.bim-engine-gis-container canvas{width:100%;height:100%}.bim-engine-gis-container{position:relative;overflow:hidden;background:#111827}.bim-engine-gis-container .cesium-widget canvas{display:block}.bim-engine-gis-performance-monitor{position:absolute;top:8px;right:8px;z-index:1200;width:96px;padding:6px 8px;border:1px solid rgba(148,163,184,.32);border-radius:4px;background:#0f172ac7;color:#e5edf7;font-family:Consolas,Monaco,monospace;font-size:11px;line-height:15px;pointer-events:none;box-sizing:border-box}.bim-engine-gis-performance-row{display:flex;align-items:center;justify-content:space-between;gap:6px}.bim-engine-gis-performance-value{color:#7dd3fc;font-weight:700;text-align:right}.gis-model-calibration-dock-panel{width:min(860px,calc(100vw - 72px));color:var(--gmcal-text-primary, #0f172a);font-size:12px;line-height:1.35}.gis-model-calibration-table-wrap{position:relative;max-height:206px;overflow:auto;border-radius:9px;border:1px solid color-mix(in srgb,var(--gmcal-border, rgba(148, 163, 184, .35)) 80%,transparent 20%);background:color-mix(in srgb,var(--gmcal-bg-inset, #edf1f6) 72%,transparent 28%)}.gis-model-calibration-table{width:100%;min-width:760px;border-collapse:collapse}.gis-model-calibration-table th,.gis-model-calibration-table td{padding:5px 6px;border-bottom:1px solid color-mix(in srgb,var(--gmcal-border, rgba(148, 163, 184, .35)) 56%,transparent 44%);text-align:left;vertical-align:middle}.gis-model-calibration-table th{position:sticky;top:0;z-index:1;color:var(--gmcal-text-secondary, #64748b);background:color-mix(in srgb,var(--gmcal-bg-elevated, #f8fafc) 88%,transparent 12%);font-size:11px;font-weight:600;white-space:nowrap}.gis-model-calibration-table tbody tr:last-child td{border-bottom:none}.gis-model-calibration-model-cell{width:150px;max-width:150px}.gis-model-calibration-model-name,.gis-model-calibration-model-url{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:138px}.gis-model-calibration-model-name{color:var(--gmcal-text-primary, #0f172a);font-weight:600}.gis-model-calibration-model-url{margin-top:2px;color:var(--gmcal-text-secondary, #64748b);font-size:11px}.gis-model-calibration-input-cell{width:66px}.gis-model-calibration-input{width:60px;height:24px;border-radius:6px;border:1px solid color-mix(in srgb,var(--gmcal-border, rgba(148, 163, 184, .35)) 86%,transparent 14%);background:color-mix(in srgb,var(--gmcal-bg-elevated, #f8fafc) 90%,transparent 10%);color:var(--gmcal-text-primary, #0f172a);font-size:12px;padding:0 6px;box-sizing:border-box}.gis-model-calibration-input:focus{outline:none;border-color:color-mix(in srgb,var(--gmcal-primary, #4f88ff) 68%,transparent 32%);box-shadow:0 0 0 2px color-mix(in srgb,var(--gmcal-primary-subtle, rgba(96, 140, 255, .18)) 80%,transparent 20%)}.gis-model-calibration-action-cell{width:68px;white-space:nowrap}.gis-model-calibration-btn{position:relative;width:26px;min-width:26px;height:24px;padding:0;border-radius:6px;border:1px solid color-mix(in srgb,var(--gmcal-border, rgba(148, 163, 184, .35)) 88%,transparent 12%);background:color-mix(in srgb,var(--gmcal-bg-elevated, #f8fafc) 90%,transparent 10%);color:var(--gmcal-text-secondary, #64748b);font-size:14px;font-weight:700;line-height:1;cursor:pointer;transition:background-color .15s ease,border-color .15s ease,color .15s ease,transform .15s ease}.gis-model-calibration-btn+.gis-model-calibration-btn{margin-left:4px}.gis-model-calibration-btn:hover{border-color:color-mix(in srgb,var(--gmcal-primary, #4f88ff) 38%,var(--gmcal-border, rgba(148, 163, 184, .35)) 62%);color:var(--gmcal-text-primary, #0f172a)}.gis-model-calibration-btn:active{transform:translateY(1px)}.gis-model-calibration-btn.is-primary{border-color:color-mix(in srgb,var(--gmcal-primary, #4f88ff) 58%,transparent 42%);background:color-mix(in srgb,var(--gmcal-primary-subtle, rgba(96, 140, 255, .18)) 82%,var(--gmcal-bg-elevated, #f8fafc) 18%);color:color-mix(in srgb,var(--gmcal-primary, #4f88ff) 80%,var(--gmcal-text-primary, #0f172a) 20%)}.gis-model-calibration-btn.is-error{border-color:#ef4444b8;color:#dc2626}.gis-model-calibration-empty{display:none;padding:18px 24px;color:var(--gmcal-text-secondary, #64748b);text-align:center}.gis-model-calibration-empty.is-visible{display:block}@media(max-width:760px){.gis-model-calibration-dock-panel{width:calc(100vw - 44px)}.gis-model-calibration-table-wrap{max-height:240px}}')),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('.bim-engine-wrapper{position:relative;width:100%;height:100%;font-family:sans-serif;box-sizing:border-box;overflow:hidden;background:linear-gradient(to bottom,#d6e0eb,#f6faff)}.bim-engine-opt-btn-container{z-index:100}.bim-construct-tree-btn{position:absolute;top:20px;left:20px!important;z-index:100}.bim-engine-footer-info{position:absolute;bottom:6px;left:10px;display:flex;align-items:center;gap:12px;z-index:1;font-family:system-ui,-apple-system,sans-serif;font-size:11px;letter-spacing:.3px;pointer-events:none;-webkit-user-select:none;user-select:none}.bim-engine-version{color:#00000040;white-space:nowrap}.bim-engine-stats{color:#00000059;white-space:nowrap}.bim-engine-size{position:absolute;bottom:6px;right:10px;font-size:11px;color:#00000059;pointer-events:none;-webkit-user-select:none;user-select:none;z-index:1;font-family:system-ui,-apple-system,sans-serif;letter-spacing:.3px}.versionText{position:absolute;right:10px;color:#86d9ff;z-index:1000;bottom:0;font-size:10px;background:transparent;pointer-events:none}.homeViewWrapper{position:absolute;cursor:pointer;pointer-events:auto;background-image:url(/assets/viewcube/home.png);background-size:100% 100%;background-repeat:no-repeat;background-color:#fff0;color:#fff;top:10px;right:100;width:20px;height:20px;z-index:999;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.bim-dialog{position:absolute;background:var(--bim-dialog-bg, var(--bim-bg-elevated));border:1px solid var(--bim-dialog-border-color, var(--bim-border-default));border-radius:var(--bim-dialog-radius, 4px);box-shadow:var(--bim-shadow-lg);display:flex;flex-direction:column;z-index:10001;color:var(--bim-dialog-text-color, var(--bim-text-secondary));overflow:hidden;min-width:200px;min-height:100px;pointer-events:auto}.bim-dialog-header{position:relative;min-height:58px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 10px 0 18px;cursor:default;-webkit-user-select:none;user-select:none;flex-shrink:0;border-bottom:1px solid var(--bim-border-subtle, var(--bim-dialog-border-color, var(--bim-border-default)));box-shadow:var(--bim-shadow-sm);z-index:1}.bim-dialog-header.draggable{cursor:move}.bim-dialog-title{flex:1;min-width:0;font-size:18px;font-weight:300;line-height:1.2;letter-spacing:.01em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--bim-dialog-title-color, var(--bim-text-primary))}.bim-dialog-close{display:flex;align-items:center;justify-content:center;width:38px;height:38px;cursor:pointer;color:var(--bim-text-secondary);border-radius:4px;transition:background-color .2s ease,color .2s ease,box-shadow .2s ease;flex-shrink:0;margin-left:8px}.bim-dialog-close:hover{color:var(--bim-text-primary);background-color:var(--bim-component-bg-hover, rgba(15, 23, 42, .06));box-shadow:inset 0 0 0 1px var(--bim-border-subtle, var(--bim-dialog-border-color, var(--bim-border-default)))}.bim-dialog-close svg{display:block;width:20px;height:20px}.bim-dialog-content{flex:1;overflow:auto;font-size:14px;color:var(--bim-dialog-text-color, var(--bim-text-secondary));background:var(--bim-dialog-bg, var(--bim-bg-elevated))}.bim-dialog-resize-handle{position:absolute;width:28px;height:28px;right:2px;bottom:2px;cursor:se-resize;z-index:10;border-radius:4px 0;transition:background-color .2s ease}.bim-dialog-resize-handle:hover{background:var(--bim-component-bg-hover, rgba(15, 23, 42, .04))}.bim-dialog-resize-handle:after{content:"";position:absolute;right:7px;bottom:7px;width:11px;height:11px;border-right:2px solid var(--bim-text-tertiary);border-bottom:2px solid var(--bim-text-tertiary)}.bim-dialog-resize-handle:before{content:"";position:absolute;right:11px;bottom:11px;width:6px;height:6px;border-right:2px solid var(--bim-text-tertiary);border-bottom:2px solid var(--bim-text-tertiary);opacity:.85}.bim-dialog-resize-handle:hover:after,.bim-dialog-resize-handle:hover:before{border-color:var(--bim-text-primary)}.bim-model-color-picker{position:fixed;z-index:10020;width:196px;padding:10px 12px 12px;box-sizing:border-box;border:1px solid var(--bim-model-color-picker-border, rgba(255, 255, 255, .14));border-radius:12px;background:var(--bim-model-color-picker-bg, rgba(24, 28, 34, .96));box-shadow:var(--bim-model-color-picker-shadow, 0 18px 48px rgba(0, 0, 0, .36));color:var(--bim-model-color-picker-text, #f4f7fb);-webkit-backdrop-filter:blur(18px);backdrop-filter:blur(18px);-webkit-user-select:none;user-select:none;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,system-ui,sans-serif}.bim-model-color-picker__header{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:10px}.bim-model-color-picker__title{font-size:13px;font-weight:600;letter-spacing:.02em;line-height:20px}.bim-model-color-picker__close{all:unset;display:flex;align-items:center;justify-content:center;flex:0 0 20px!important;width:20px!important;min-width:20px!important;max-width:20px!important;height:20px!important;min-height:20px!important;max-height:20px!important;box-sizing:border-box;padding:0!important;border:0!important;border-radius:4px;background:transparent!important;color:var(--bim-model-color-picker-muted, rgba(255, 255, 255, .82));cursor:pointer;font:600 16px/1 -apple-system,BlinkMacSystemFont,Segoe UI,system-ui,sans-serif;text-align:center;appearance:none!important}.bim-model-color-picker__close:hover{background:var(--bim-model-color-picker-btn-hover, rgba(255, 255, 255, .16));color:var(--bim-model-color-picker-text, #fff)}.bim-model-color-picker__presets{display:grid;grid-template-columns:repeat(4,24px);justify-content:space-between;gap:8px 10px;margin-bottom:12px}.bim-model-color-picker__swatch{display:block;width:24px;height:24px;min-width:24px;min-height:24px;box-sizing:border-box;padding:0;border:0;border-radius:999px;box-shadow:none;cursor:pointer;appearance:none;transition:transform .16s ease}.bim-model-color-picker__swatch:hover{transform:translateY(-1px) scale(1.08)}.bim-model-color-picker__opacity{display:block;margin-bottom:10px;color:var(--bim-model-color-picker-muted, rgba(255, 255, 255, .78));font-size:12px}.bim-model-color-picker__opacity-top{display:flex;align-items:center;justify-content:space-between;margin-bottom:6px}.bim-model-color-picker__opacity-value{color:var(--bim-model-color-picker-text, #f4f7fb);font-variant-numeric:tabular-nums}.bim-model-color-picker__opacity input{width:100%;height:16px;margin:0;padding:0;cursor:pointer;accent-color:var(--bim-model-color-picker-text, #2563eb)}.bim-model-color-picker__custom{display:flex;align-items:center;justify-content:space-between;gap:10px;color:var(--bim-model-color-picker-muted, rgba(255, 255, 255, .78));font-size:12px}.bim-model-color-picker__custom input{width:40px;height:24px;box-sizing:border-box;padding:2px;border:1px solid var(--bim-model-color-picker-border, rgba(255, 255, 255, .14));border-radius:8px;background:var(--bim-model-color-picker-input-bg, transparent);cursor:pointer}.bim-right-key{position:fixed;z-index:10000;display:none;background:transparent}.bim-right-key.visible{display:block}.bim-menu{display:flex;flex-direction:column;background:var(--bim-bg-elevated);border:1px solid var(--bim-border-default);border-radius:8px;padding:6px;margin:0;list-style:none;box-shadow:var(--bim-shadow-lg);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;-webkit-user-select:none;user-select:none;color:var(--bim-text-primary)}.bim-menu-group{display:flex;flex-direction:column}.bim-menu-divider{height:1px;background-color:var(--bim-divider);margin:4px 0}.bim-menu-item{display:flex;align-items:center;padding:8px 12px;cursor:pointer;transition:all .2s ease;font-size:13px;position:relative;color:var(--bim-text-primary);border-radius:6px}.bim-menu-item:hover{background-color:var(--bim-component-bg-hover)}.bim-menu-item.disabled{opacity:.5;cursor:not-allowed;pointer-events:none}.bim-menu-item-icon{display:none}.bim-menu.has-icons .bim-menu-item-icon{width:16px;height:16px;margin-right:8px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.bim-menu-item-icon svg{width:100%;height:100%;fill:currentColor}.bim-menu-item-label{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bim-menu-item-arrow{width:12px;height:12px;margin-left:8px;display:flex;align-items:center;justify-content:center;opacity:.7}.bim-menu-item-arrow svg{width:100%;height:100%;fill:currentColor}.radial-toolbar-wrapper{position:absolute;right:20px;bottom:20px;z-index:1000;pointer-events:none}.radial-main-btn,.radial-sub-btn{border:1px solid transparent;border-radius:9999px;display:flex;align-items:center;justify-content:center;cursor:pointer;pointer-events:auto;outline:none;transition:transform .22s ease,opacity .22s ease,box-shadow .22s ease,background-color .22s ease,color .22s ease}.radial-main-btn{position:absolute;right:0;bottom:0;width:var(--rt-main-size, 70px);height:var(--rt-main-size, 70px);background:var(--rt-main-bg, rgba(255, 255, 255, .92));border-color:var(--rt-main-border, rgba(203, 213, 225, .65));box-shadow:var(--rt-main-shadow, 0 4px 12px rgba(0, 0, 0, .12));color:var(--rt-main-icon, #334155)}.radial-main-btn:hover{transform:translateZ(0) scale(1.04);background:var(--rt-main-bg-hover, #ffffff);box-shadow:var(--rt-main-shadow-hover, 0 6px 20px rgba(0, 0, 0, .14));color:var(--rt-main-icon-hover, #1e293b)}.radial-main-btn:active{transform:translateZ(0) scale(.97)}.radial-main-btn svg{width:34px;height:34px}.radial-sub-btn{position:absolute;right:var(--rt-main-offset, 10px);bottom:var(--rt-main-offset, 10px);width:var(--rt-sub-size, 50px);height:var(--rt-sub-size, 50px);background:var(--rt-sub-bg, rgba(255, 255, 255, .9));border-color:var(--rt-sub-border, rgba(203, 213, 225, .65));box-shadow:var(--rt-sub-shadow, 0 2px 8px rgba(0, 0, 0, .1));color:var(--rt-sub-icon, #334155);opacity:0;transform:translate(0) scale(.76);transform-origin:center;--rt-delay-current: var(--rt-close-delay, 0s);transition-delay:var(--rt-delay-current)}.radial-toolbar-wrapper.is-active .radial-sub-btn{--rt-delay-current: var(--rt-open-delay, 0s);opacity:1;transform:translate(var(--rt-x),var(--rt-y)) scale(1)}.radial-sub-btn:hover{background:var(--rt-sub-bg-hover, var(--bim-primary, #2563eb));box-shadow:var(--rt-sub-shadow-hover, 0 4px 14px rgba(0, 0, 0, .16));color:var(--rt-sub-icon-hover, var(--bim-text-inverse, #ffffff))}.radial-sub-btn.is-active,.radial-sub-btn[data-active=true]{background:var(--bim-primary, #2563eb);border:1px solid var(--bim-primary-active, #1d4ed8);box-shadow:var(--bim-shadow-glow, 0 0 0 2px rgba(37, 99, 235, .28));color:var(--bim-text-inverse, #ffffff)}.radial-sub-btn.is-active:hover,.radial-sub-btn[data-active=true]:hover{background:var(--bim-primary-hover, #3b82f6)}.radial-sub-btn.is-active .radial-sub-btn-icon,.radial-sub-btn[data-active=true] .radial-sub-btn-icon{color:var(--bim-icon-inverse, #ffffff)}.radial-sub-btn:active{transform:translate(var(--rt-x),var(--rt-y)) scale(.94)}.radial-sub-btn-icon{width:22px;height:22px;display:flex;align-items:center;justify-content:center}.radial-sub-btn-icon svg{width:100%;height:100%}.bottom-dock-stack{position:absolute;left:50%;bottom:20px;transform:translate(-50%);width:0;height:0;z-index:1000;pointer-events:none}.bottom-dock-panel{position:absolute;left:50%;bottom:0;transform:translate(-50%);width:fit-content;max-width:calc(100vw - 40px);pointer-events:auto;border-radius:12px;border:1px solid var(--bd-border, rgba(148, 163, 184, .35));background:var(--bd-bg, rgba(255, 255, 255, .94));box-shadow:var(--bd-shadow, 0 2px 8px rgba(15, 23, 42, .1));transition:transform .22s ease,opacity .2s ease;overflow:visible;z-index:1}.bottom-dock-panel:hover,.bottom-dock-panel:focus-within{z-index:10}.bottom-dock-panel.is-entering{opacity:0}.bottom-dock-panel.is-leaving{opacity:0;pointer-events:none}.bottom-dock-panel-close{position:absolute;top:5px;right:5px;transform:translate(35%,-35%);z-index:2;width:16px;height:16px;border-radius:6px;border:1px solid transparent;background:transparent;color:var(--bd-close-color, #475569);display:inline-flex;align-items:center;justify-content:center;cursor:pointer;transition:background-color .16s ease,color .16s ease,border-color .16s ease}.bottom-dock-panel-close:hover{background:var(--bd-close-bg-hover, rgba(15, 23, 42, .08));color:var(--bd-close-color-hover, #0f172a);border-color:var(--bd-close-border-hover, rgba(148, 163, 184, .3))}.bottom-dock-panel-close:active{transform:translate(35%,-35%) scale(.96)}.bottom-dock-panel-body{min-height:50px;padding:10px;background:var(--bd-body-bg, transparent);width:fit-content;max-width:calc(100vw - 40px);box-sizing:border-box;border-radius:inherit}.bottom-dock-placeholder{border-radius:8px;border:1px dashed var(--bd-placeholder-border, rgba(148, 163, 184, .55));padding:10px;color:var(--bd-placeholder-text, #64748b);font-size:12px;line-height:1.5;text-align:center}.measure-dock-panel{width:fit-content;max-width:100%;padding:0;border-radius:8px;border:none;box-sizing:border-box;color:var(--bim-text-secondary, #475569);font-size:13px;line-height:1.5}.measure-dock-panel-main{display:block}.measure-dock-panel-settings{display:none;flex-direction:column;gap:6px;min-height:74px;box-sizing:border-box}.measure-dock-settings-row{display:flex;align-items:center;justify-content:space-between;gap:8px}.measure-dock-settings-label{color:var(--bim-text-secondary, #64748b);font-size:12px}.measure-dock-settings-select{width:88px;height:24px;border-radius:6px;border:1px solid rgba(148,163,184,.36);background:color-mix(in srgb,var(--bim-bg-inset, #edf1f6) 90%,#ffffff 10%);color:var(--bim-text-primary, #0f172a);font-size:12px;padding:0 6px;box-sizing:border-box}.measure-dock-settings-actions{display:flex;justify-content:flex-end;gap:8px}.measure-dock-settings-btn{height:24px;min-width:52px;border-radius:6px;border:1px solid rgba(148,163,184,.36);background:color-mix(in srgb,var(--bim-bg-inset, #edf1f6) 90%,#ffffff 10%);color:var(--bim-text-secondary, #64748b);font-size:12px;line-height:1;cursor:pointer}.measure-dock-settings-btn.is-save{border-color:color-mix(in srgb,var(--bim-primary, #4f88ff) 46%,transparent 54%);color:color-mix(in srgb,var(--bim-primary, #4f88ff) 78%,#6f9dff 22%)}.measure-dock-panel-top{display:flex;align-items:center;justify-content:space-between;gap:10px}.measure-dock-clearheight-options{display:none;flex-direction:column;gap:8px;margin-bottom:10px;padding:8px;border-radius:8px;border:1px solid rgba(148,163,184,.28);background:color-mix(in srgb,var(--bim-bg-inset, #edf1f6) 90%,#ffffff 10%)}.measure-dock-clearheight-options.is-visible{display:flex}.measure-dock-clearheight-group{display:flex;align-items:center;gap:8px}.measure-dock-clearheight-label{min-width:60px;color:var(--bim-text-secondary, #64748b);font-size:12px}.measure-dock-clearheight-buttons{display:flex;gap:8px}.measure-dock-clearheight-btn{height:28px;padding:0 10px;border-radius:6px;border:1px solid rgba(148,163,184,.36);background:color-mix(in srgb,var(--bim-bg-elevated, #f8fafc) 88%,#ffffff 12%);color:var(--bim-text-secondary, #64748b);font-size:12px;line-height:1;cursor:pointer;transition:all .15s ease}.measure-dock-clearheight-btn:hover{border-color:#94a3b88f}.measure-dock-clearheight-btn.is-active{border-color:color-mix(in srgb,var(--bim-primary, #4f88ff) 70%,#9db9ff 30%);background:color-mix(in srgb,var(--bim-primary-subtle, rgba(96, 140, 255, .18)) 72%,#ffffff 28%);color:color-mix(in srgb,var(--bim-primary, #4f88ff) 78%,#6f9dff 22%)}.measure-dock-panel-mode-zone{flex:1;min-width:0;display:flex;flex-direction:column;gap:10px}.measure-dock-panel-mode-row{display:grid;grid-template-columns:repeat(5,32px);gap:10px}.measure-dock-panel-mode-row-secondary{display:none}.measure-dock-panel-mode-btn{width:32px;height:32px;border-radius:8px;border:1px solid rgba(148,163,184,.28);background:color-mix(in srgb,var(--bim-bg-inset, #edf1f6) 92%,#ffffff 8%);color:color-mix(in srgb,var(--bim-text-secondary, #64748b) 94%,#475569 6%);display:inline-flex;align-items:center;justify-content:center;padding:0;box-sizing:border-box;cursor:pointer;transition:all .15s ease}.measure-dock-panel-mode-icon{width:20px;height:20px;display:inline-flex;align-items:center;justify-content:center}.measure-dock-panel-mode-icon svg{width:100%;height:100%;fill:currentColor}.measure-dock-panel-mode-btn:hover{border-color:#94a3b880;background:color-mix(in srgb,var(--bim-component-bg-hover, #dce5f2) 64%,#ffffff 36%)}.measure-dock-panel-mode-btn.is-active{border-color:color-mix(in srgb,var(--bim-primary, #4f88ff) 70%,#9db9ff 30%);color:color-mix(in srgb,var(--bim-primary, #4f88ff) 78%,#6f9dff 22%);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--bim-primary, #4f88ff) 35%,transparent 65%)}.measure-dock-panel-actions{flex:0 0 auto;display:flex;flex-direction:row;gap:10px;align-items:center}.measure-dock-panel-action-btn{width:32px;height:32px;border-radius:6px;border:1px solid rgba(148,163,184,.22);background:color-mix(in srgb,var(--bim-bg-inset, #edf1f6) 92%,#ffffff 8%);color:var(--bim-text-secondary, #475569);padding:0;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;transition:all .15s ease}.measure-dock-panel-action-btn:hover{border-color:#94a3b880;color:var(--bim-text-primary, #0f172a)}.measure-dock-panel-action-btn svg{width:18px;height:18px;fill:currentColor}.measure-dock-panel-action-expand{width:16px;height:32px}.measure-dock-panel-action-expand.is-expanded{height:74px}.measure-dock-panel-action-expand.is-collapsed{height:32px}.measure-dock-panel-action-clear{background:color-mix(in srgb,var(--bim-danger, #ef4444) 16%,#ffffff 84%);border-color:color-mix(in srgb,var(--bim-danger, #ef4444) 26%,transparent 74%);color:var(--bim-danger, #ef4444)}.measure-dock-panel-action-clear:hover{border-color:color-mix(in srgb,var(--bim-danger, #ef4444) 40%,transparent 60%);color:var(--bim-danger, #ef4444)}.measure-dock-panel-action-settings{color:color-mix(in srgb,var(--bim-text-primary, #0f172a) 86%,#000 14%)}.measure-dock-panel-mode-row .measure-dock-panel-action-btn{border-radius:8px}.measure-dock-panel-action-expand svg{transition:transform .15s ease}.measure-dock-panel-action-expand.is-expanded svg{transform:rotate(180deg)}.measure-dock-panel [data-tooltip]{position:relative}.measure-dock-panel [data-tooltip]:after{content:attr(data-tooltip);position:absolute;left:50%;bottom:calc(100% + 6px);transform:translate(-50%);padding:4px 8px;border-radius:6px;background:#0f172aeb;color:#f8fafc;font-size:12px;line-height:1.2;white-space:nowrap;pointer-events:none;opacity:0;visibility:hidden;z-index:8;transition:opacity 60ms ease}.measure-dock-panel [data-tooltip]:hover:after,.measure-dock-panel [data-tooltip]:focus-visible:after{opacity:1;visibility:visible}@media(max-width:720px){.measure-dock-panel-top{flex-direction:column}.measure-dock-clearheight-group{flex-direction:column;align-items:flex-start;gap:6px}.measure-dock-panel-actions{width:100%;flex-direction:row;justify-content:flex-end}.measure-dock-panel-action-btn,.measure-dock-panel-mode-btn{width:32px;height:32px}.measure-dock-panel-action-expand{width:16px;height:32px}.measure-dock-panel-action-expand.is-expanded{height:74px}}.section-dock-panel{position:relative;width:fit-content;max-width:100%;display:flex;flex-direction:column;gap:10px;color:var(--bim-text-secondary, #475569)}.section-dock-axis-panel{display:none;width:fit-content;border-radius:8px;padding:0;gap:10px}.section-dock-axis-panel.is-visible{display:flex}.section-dock-axis-btn{width:32px;height:32px;border-radius:8px;border:1px solid rgba(148,163,184,.28);background:color-mix(in srgb,var(--bim-bg-inset, #edf1f6) 92%,#ffffff 8%);color:color-mix(in srgb,var(--bim-text-secondary, #64748b) 94%,#475569 6%);font-size:16px;line-height:1;box-sizing:border-box;padding:0;cursor:pointer;transition:all .15s ease}.section-dock-axis-btn:hover{border-color:#94a3b880;background:color-mix(in srgb,var(--bim-component-bg-hover, #dce5f2) 64%,#ffffff 36%)}.section-dock-axis-btn.is-active{border-color:color-mix(in srgb,var(--bim-primary, #4f88ff) 70%,#9db9ff 30%);background:color-mix(in srgb,var(--bim-primary-subtle, rgba(96, 140, 255, .18)) 72%,#ffffff 28%);color:color-mix(in srgb,var(--bim-primary, #4f88ff) 78%,#6f9dff 22%)}.section-dock-main{display:flex;align-items:center;gap:10px;padding:0;border-radius:8px}.section-dock-types,.section-dock-tools{display:flex;align-items:center;gap:10px}.section-dock-divider{width:1px;height:32px;background:color-mix(in srgb,var(--bim-border-default, #cbd5e1) 84%,transparent 16%)}.section-dock-divider.is-hidden{display:none}.section-dock-type-btn,.section-dock-tool-btn{width:32px;height:32px;border:1px solid rgba(148,163,184,.28);border-radius:8px;background:color-mix(in srgb,var(--bim-bg-inset, #edf1f6) 92%,#ffffff 8%);color:color-mix(in srgb,var(--bim-text-secondary, #64748b) 94%,#475569 6%);display:inline-flex;align-items:center;justify-content:center;cursor:pointer;box-sizing:border-box;padding:0;transition:all .15s ease}.section-dock-type-btn:hover,.section-dock-tool-btn:hover{border-color:var(--bim-border-strong, rgba(100, 116, 139, .6));background:color-mix(in srgb,var(--bim-component-bg-hover, #dce5f2) 64%,#ffffff 36%)}.section-dock-type-btn.is-active,.section-dock-tool-btn.is-active{border-color:color-mix(in srgb,var(--bim-primary, #4f88ff) 70%,#9db9ff 30%);color:color-mix(in srgb,var(--bim-primary, #4f88ff) 78%,#6f9dff 22%)}.section-dock-type-icon,.section-dock-tool-icon{width:20px;height:20px;display:inline-flex;align-items:center;justify-content:center}.section-dock-type-icon svg,.section-dock-tool-icon svg{width:100%;height:100%;fill:currentColor}.section-dock-panel [data-tooltip]{position:relative}.section-dock-panel [data-tooltip]:after{content:attr(data-tooltip);position:absolute;left:50%;bottom:calc(100% + 6px);transform:translate(-50%);padding:4px 8px;border-radius:6px;background:#0f172aeb;color:#f8fafc;font-size:12px;line-height:1.2;white-space:nowrap;pointer-events:none;opacity:0;visibility:hidden;z-index:8;transition:opacity 60ms ease}.section-dock-panel [data-tooltip]:hover:after,.section-dock-panel [data-tooltip]:focus-visible:after{opacity:1;visibility:visible}.section-dock-toast{position:absolute;left:50%;top:calc(100% + 8px);transform:translate(-50%) translateY(-4px);padding:6px 10px;border-radius:8px;background:#0f172aeb;color:#f8fafc;font-size:12px;line-height:1.2;white-space:nowrap;pointer-events:none;opacity:0;visibility:hidden;transition:opacity .15s ease,transform .15s ease;z-index:9}.section-dock-toast.is-visible{opacity:1;visibility:visible;transform:translate(-50%) translateY(0)}.walk-dock-panel{display:flex;align-items:center;gap:10px;padding:0;background:transparent;border:none;border-radius:8px;box-shadow:none;color:var(--bim-text-secondary, #64748b);-webkit-user-select:none;user-select:none}.walk-dock-panel .walk-divider{height:32px;width:1px;background:var(--bim-divider);flex-shrink:0}.walk-dock-left{display:flex;gap:10px}.walk-dock-settings{display:flex;align-items:center;gap:10px;flex:1}.walk-icon-btn{position:relative;width:32px;height:32px;display:flex;align-items:center;justify-content:center;padding:0;border-radius:8px;border:1px solid rgba(148,163,184,.28);background:color-mix(in srgb,var(--bim-bg-inset, #edf1f6) 92%,#ffffff 8%);color:color-mix(in srgb,var(--bim-text-secondary, #64748b) 94%,#475569 6%);cursor:pointer;transition:all .2s ease}.walk-icon-btn[data-tooltip]:after{content:attr(data-tooltip);position:absolute;left:50%;bottom:calc(100% + 8px);z-index:10;transform:translate(-50%) translateY(4px);padding:4px 8px;border-radius:6px;background:color-mix(in srgb,var(--bim-bg-elevated, #1f2937) 94%,#000000 6%);color:var(--bim-text-primary, #ffffff);box-shadow:var(--bim-shadow-lg, 0 10px 24px rgba(0, 0, 0, .22));font-size:12px;line-height:1.4;white-space:nowrap;pointer-events:none;opacity:0;transition:opacity .16s ease,transform .16s ease}.walk-icon-btn[data-tooltip]:before{content:"";position:absolute;left:50%;bottom:calc(100% + 3px);z-index:10;transform:translate(-50%) translateY(4px);border:5px solid transparent;border-top-color:color-mix(in srgb,var(--bim-bg-elevated, #1f2937) 94%,#000000 6%);pointer-events:none;opacity:0;transition:opacity .16s ease,transform .16s ease}.walk-icon-btn[data-tooltip]:hover:after,.walk-icon-btn[data-tooltip]:hover:before,.walk-icon-btn[data-tooltip]:focus-visible:after,.walk-icon-btn[data-tooltip]:focus-visible:before{opacity:1;transform:translate(-50%) translateY(0)}.walk-icon-btn:hover{border-color:#94a3b880;background:color-mix(in srgb,var(--bim-component-bg-hover, #dce5f2) 64%,#ffffff 36%)}.walk-icon-btn.active{border-color:color-mix(in srgb,var(--bim-primary, #4f88ff) 70%,#9db9ff 30%);background:color-mix(in srgb,var(--bim-primary-subtle, rgba(96, 140, 255, .18)) 72%,#ffffff 28%);color:color-mix(in srgb,var(--bim-primary, #4f88ff) 78%,#6f9dff 22%)}.walk-icon-btn svg{width:20px;height:20px}.walk-icon-btn.active svg{fill:currentColor}.walk-speed-control{display:flex;align-items:center;gap:8px}.walk-speed-label,.walk-checkbox-label,.walk-select-label{font-size:12px;color:var(--bim-text-primary);white-space:nowrap}.walk-speed-group{display:flex;align-items:center;gap:8px;padding:2px;border:1px solid rgba(148,163,184,.28);background:color-mix(in srgb,var(--bim-bg-inset, #edf1f6) 92%,#ffffff 8%);border-radius:6px}.walk-speed-btn{width:24px;height:24px;font-size:14px;line-height:1;padding:0;display:inline-flex;align-items:center;justify-content:center;border:1px solid rgba(148,163,184,.28);background:color-mix(in srgb,var(--bim-bg-elevated, #f8fafc) 88%,#ffffff 12%);color:var(--bim-text-primary, #0f172a);border-radius:4px;cursor:pointer;transition:all .2s ease}.walk-speed-btn:hover{border-color:#94a3b880}.walk-speed-btn:disabled{opacity:.5;cursor:not-allowed}.walk-speed-display{min-width:30px;font-size:12px;color:var(--bim-text-primary, #0f172a);text-align:center;font-weight:700}.walk-checkbox-wrapper{display:flex;align-items:center;gap:8px;cursor:pointer}.walk-checkbox{width:14px;height:14px;accent-color:var(--bim-primary, #3b82f6);cursor:pointer}.walk-checkbox:disabled,.walk-checkbox-wrapper input:disabled+.walk-checkbox-label{opacity:.5;cursor:not-allowed}.walk-select-wrapper{display:flex;align-items:center;gap:8px}.walk-select{min-width:90px;height:24px;padding:2px 8px;font-size:12px;border:1px solid rgba(148,163,184,.28);background:color-mix(in srgb,var(--bim-bg-inset, #edf1f6) 92%,#ffffff 8%);color:var(--bim-text-primary, #0f172a);border-radius:6px;cursor:pointer}.walk-select option{background:var(--bim-bg-elevated);color:var(--bim-text-primary)}.walk-exit-btn{height:32px;padding:0 12px;border-radius:8px;font-size:12px;background:var(--bim-primary);border:none;color:var(--bim-text-inverse);font-weight:600;cursor:pointer;transition:all .2s ease;white-space:nowrap}.walk-exit-btn:hover{background:var(--bim-primary-hover);transform:scale(1.02)}.walk-path-panel{padding:16px;box-sizing:border-box}.walk-path-btn{border:none;border-radius:6px;cursor:pointer;font-size:14px;transition:all .2s;box-sizing:border-box}.walk-path-btn-group{display:flex;gap:8px;margin-top:16px}.walk-path-btn-play{flex:1;height:32px;padding:0 16px;background:var(--bim-primary, #3b82f6);color:#fff}.walk-path-btn-play:hover:not(:disabled){opacity:.9}.walk-path-btn-play:disabled{opacity:.5;cursor:not-allowed}.walk-path-btn-stop{flex:1;height:32px;padding:0 16px;background:#ef4444;color:#fff}.walk-path-btn-stop:hover:not(:disabled){opacity:.9}.walk-path-btn-stop:disabled{opacity:.5;cursor:not-allowed}.walk-path-btn-small{height:28px;padding:0 12px;font-size:12px;background:var(--bim-bg-elevated, #1f2d3e);color:var(--bim-text-primary, #fff);border:1px solid var(--bim-border-default, #334155)}.walk-path-btn-small:hover{background:var(--bim-border-default, #334155)}.walk-path-btn-danger{color:#ef4444}.walk-path-settings{display:flex;flex-direction:column;gap:12px;margin-bottom:16px}.walk-path-form-group{display:flex;flex-direction:column;gap:6px}.walk-path-form-group label{font-size:12px;color:var(--bim-text-secondary, #94a3b8)}.walk-path-form-group-inline{flex-direction:row;align-items:center}.walk-path-input{padding:8px 12px;border:1px solid var(--bim-border-default, #334155);border-radius:4px;background:var(--bim-bg-elevated, #1f2d3e);color:var(--bim-text-primary, #fff);font-size:14px;width:100%;box-sizing:border-box}.walk-path-input:focus{outline:none;border-color:var(--bim-primary, #3b82f6)}.walk-path-input-wrapper{display:flex;align-items:center;gap:8px}.walk-path-input-wrapper .walk-path-input{flex:1}.walk-path-unit{color:var(--bim-text-secondary, #94a3b8);font-size:14px}.walk-path-checkbox{width:16px;height:16px;margin-right:8px}.walk-path-points-section{margin-bottom:16px}.walk-path-points-toolbar{display:flex;gap:8px;margin-bottom:12px}.walk-path-points-list{height:200px;overflow-y:auto;display:flex;flex-direction:column;gap:8px}.walk-path-empty{text-align:center;padding:32px 16px;color:var(--bim-text-secondary, #94a3b8);font-size:14px}.walk-path-point-item{display:flex;justify-content:space-between;align-items:center;padding:6px 12px;background:var(--bim-bg-elevated, #1f2d3e);border-radius:4px;transition:all .2s}.walk-path-point-item:hover{background:var(--bim-border-default, #334155)}.walk-path-point-item:hover .walk-path-point-actions{opacity:1}.walk-path-point-item-active{background:var(--bim-primary, #3b82f6)}.walk-path-point-item-active .walk-path-point-name{color:#fff}.walk-path-point-item-active .walk-path-point-actions{opacity:1}.walk-path-point-name{font-size:14px;color:var(--bim-text-primary, #fff)}.walk-path-point-actions{display:flex;gap:8px;opacity:0;transition:opacity .2s}.walk-path-btn-icon{width:28px;height:28px;border:none;border-radius:4px;background:transparent;color:var(--bim-text-primary, #fff);cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:14px}.walk-path-btn-icon:hover{background:#ffffff1a}.walk-path-btn-icon-danger:hover{background:#ef444433;color:#ef4444}.model-calibration-dock-panel{width:min(760px,calc(100vw - 72px));color:var(--mcal-text-primary, #0f172a);font-size:12px;line-height:1.35}.model-calibration-btn{height:24px;border-radius:6px;border:1px solid color-mix(in srgb,var(--mcal-border, rgba(148, 163, 184, .35)) 88%,transparent 12%);background:color-mix(in srgb,var(--mcal-bg-elevated, #f8fafc) 90%,transparent 10%);color:var(--mcal-text-secondary, #64748b);font-size:12px;line-height:1;padding:0 8px;cursor:pointer;transition:background-color .15s ease,border-color .15s ease,color .15s ease,transform .15s ease}.model-calibration-btn:hover{border-color:color-mix(in srgb,var(--mcal-primary, #4f88ff) 38%,var(--mcal-border, rgba(148, 163, 184, .35)) 62%);color:var(--mcal-text-primary, #0f172a)}.model-calibration-btn:active{transform:translateY(1px)}.model-calibration-btn.is-primary{border-color:color-mix(in srgb,var(--mcal-primary, #4f88ff) 58%,transparent 42%);background:color-mix(in srgb,var(--mcal-primary-subtle, rgba(96, 140, 255, .18)) 82%,var(--mcal-bg-elevated, #f8fafc) 18%);color:color-mix(in srgb,var(--mcal-primary, #4f88ff) 80%,var(--mcal-text-primary, #0f172a) 20%)}.model-calibration-btn.is-error{border-color:#ef4444b8;color:#dc2626}.model-calibration-table-wrap{position:relative;max-height:176px;overflow:auto;border-radius:9px;border:1px solid color-mix(in srgb,var(--mcal-border, rgba(148, 163, 184, .35)) 80%,transparent 20%);background:color-mix(in srgb,var(--mcal-bg-inset, #edf1f6) 72%,transparent 28%)}.model-calibration-table{width:100%;min-width:620px;border-collapse:collapse}.model-calibration-table th,.model-calibration-table td{padding:5px 6px;border-bottom:1px solid color-mix(in srgb,var(--mcal-border, rgba(148, 163, 184, .35)) 56%,transparent 44%);text-align:left;vertical-align:middle}.model-calibration-table th{position:sticky;top:0;z-index:1;color:var(--mcal-text-secondary, #64748b);background:color-mix(in srgb,var(--mcal-bg-elevated, #f8fafc) 88%,transparent 12%);font-size:11px;font-weight:600;white-space:nowrap}.model-calibration-table tbody tr:last-child td{border-bottom:none}.model-calibration-model-cell{width:128px;max-width:128px}.model-calibration-model-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:116px}.model-calibration-model-name{color:var(--mcal-text-primary, #0f172a);font-weight:600}.model-calibration-input-cell{width:64px}.model-calibration-input{width:58px;height:24px;border-radius:6px;border:1px solid color-mix(in srgb,var(--mcal-border, rgba(148, 163, 184, .35)) 86%,transparent 14%);background:color-mix(in srgb,var(--mcal-bg-elevated, #f8fafc) 90%,transparent 10%);color:var(--mcal-text-primary, #0f172a);font-size:12px;padding:0 6px;box-sizing:border-box}.model-calibration-input:focus{outline:none;border-color:color-mix(in srgb,var(--mcal-primary, #4f88ff) 68%,transparent 32%);box-shadow:0 0 0 2px color-mix(in srgb,var(--mcal-primary-subtle, rgba(96, 140, 255, .18)) 80%,transparent 20%)}.model-calibration-action-cell{width:66px;white-space:nowrap}.model-calibration-action-cell .model-calibration-btn+.model-calibration-btn{margin-left:4px}.model-calibration-icon-btn{position:relative;width:26px;min-width:26px;padding:0;font-size:14px;font-weight:700}.model-calibration-icon-btn:after{content:attr(data-tooltip);position:absolute;left:50%;bottom:calc(100% + 6px);transform:translate(-50%,3px);opacity:0;pointer-events:none;padding:4px 7px;border-radius:6px;background:color-mix(in srgb,var(--mcal-text-primary, #0f172a) 92%,transparent 8%);color:color-mix(in srgb,var(--mcal-bg-elevated, #f8fafc) 96%,transparent 4%);font-size:11px;font-weight:500;line-height:1;white-space:nowrap;box-shadow:0 4px 12px #0f172a29;transition:opacity .12s ease,transform .12s ease;z-index:20}.model-calibration-icon-btn:hover:after,.model-calibration-icon-btn:focus-visible:after{opacity:1;transform:translate(-50%)}.model-calibration-empty{display:none;padding:18px 24px;color:var(--mcal-text-secondary, #64748b);text-align:center}.model-calibration-empty.is-visible{display:block}@media(max-width:760px){.model-calibration-dock-panel{width:calc(100vw - 44px)}.model-calibration-table-wrap{max-height:220px}}.component-tree-drawer{--bim-component-tree-bg: #ffffff;--bim-component-tree-blur: 0px;--bim-component-tree-border: rgba(148, 163, 184, .28);--bim-component-tree-shadow: 0 14px 36px rgba(15, 23, 42, .08);--bim-component-tree-text: #0f172a;--bim-component-tree-muted: #475569;--bim-component-tree-tab-bg: #f8fafc;--bim-component-tree-tab-hover: #f1f5f9;--bim-component-tree-tab-active: #eff6ff;--bim-component-tree-tab-active-border: #3b82f6;--bim-component-tree-tab-active-text: #1d4ed8;--bim-component-tree-close-bg: #f8fafc;--bim-component-tree-close-hover: #eef2f7;--bim-component-tree-page-title: var(--bim-component-tree-text);--bim-component-tree-page-description: var(--bim-component-tree-muted);--bim-component-tree-surface: #ffffff;--bim-component-tree-surface-border: rgba(148, 163, 184, .14);--bim-component-tree-subtab-nav-bg: #e2e8f0;--bim-component-tree-subtab-nav-border: rgba(148, 163, 184, .26);--bim-component-tree-subtab-text: #334155;--bim-component-tree-subtab-hover-bg: rgba(255, 255, 255, .72);--bim-component-tree-subtab-hover-text: #0f172a;--bim-component-tree-subtab-active-bg: #ffffff;--bim-component-tree-subtab-active-text: #0f172a;--bim-component-tree-subtab-active-border: rgba(59, 130, 246, .22);--bim-component-tree-subtab-active-shadow: 0 1px 2px rgba(15, 23, 42, .08);--bim-component-tree-tree-bg: #ffffff;--bim-component-tree-tree-border: rgba(148, 163, 184, .18);position:absolute;top:0;left:0;bottom:0;width:min(320px,100%);display:flex;flex-direction:column;border:1px solid var(--bim-component-tree-border);border-radius:0;background:var(--bim-component-tree-bg);backdrop-filter:blur(var(--bim-component-tree-blur));-webkit-backdrop-filter:blur(var(--bim-component-tree-blur));box-shadow:var(--bim-component-tree-shadow);color:var(--bim-component-tree-text);overflow:hidden;transform:translate(calc(-100% - 24px));opacity:0;pointer-events:none;transition:transform .22s ease,opacity .22s ease;z-index:1200}.component-tree-drawer.is-open{transform:translate(0);opacity:1;pointer-events:auto}.component-tree-drawer-header{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 10px 10px 12px;border-bottom:1px solid var(--bim-component-tree-border)}.component-tree-drawer-tabs{min-width:0;display:flex;align-items:center;flex-wrap:nowrap}.component-tree-drawer-tab{appearance:none;border:none;background:transparent;color:var(--bim-component-tree-muted);border-radius:0;padding:8px 14px;min-height:34px;font-size:14px;font-weight:500;line-height:1;cursor:pointer;transition:color .18s ease;position:relative}.component-tree-drawer-tab:not(:last-child):after{content:"";position:absolute;right:0;top:50%;transform:translateY(-50%);width:1px;height:16px;background-color:var(--bim-component-tree-border)}.component-tree-drawer-tab:hover{color:var(--bim-component-tree-text)}.component-tree-drawer-tab.is-active{color:var(--bim-component-tree-tab-active-text);font-weight:600}.component-tree-drawer-close{flex:0 0 auto;width:44px;height:44px;display:inline-flex;align-items:center;justify-content:center;border:1px solid transparent;border-radius:4px;background:var(--bim-component-tree-close-bg);color:var(--bim-component-tree-text);cursor:pointer;transition:background-color .18s ease,border-color .18s ease,color .18s ease;margin-left:8px}.component-tree-drawer-close:hover{background:var(--bim-component-tree-close-hover);border-color:var(--bim-component-tree-border);box-shadow:inset 0 0 0 1px var(--bim-component-tree-border)}.component-tree-drawer-close svg{width:24px;height:24px}.component-tree-drawer-body{flex:1;display:flex;flex-direction:column;min-height:0;padding:10px 12px 12px;overflow:hidden}.component-tree-drawer-panel{display:none;flex:1 1 auto;min-height:0;height:100%;overflow:hidden}.component-tree-drawer-panel.is-active{display:flex;flex-direction:column}.component-tree-drawer-page{min-height:100%;display:flex;flex-direction:column;justify-content:flex-start;gap:8px;padding:12px;border:1px solid var(--bim-component-tree-surface-border);border-radius:8px;background:var(--bim-component-tree-surface)}.component-tree-drawer-page-title{margin:0;font-size:15px;line-height:1.3;color:var(--bim-component-tree-page-title)}.component-tree-drawer-page-description{margin:0;font-size:12px;line-height:1.6;color:var(--bim-component-tree-page-description)}.component-tree-drawer-pin-page{gap:0;padding:0;border:none;background:transparent}.component-tree-drawer-add-pin-btn{appearance:none;border:none;background:var(--bim-pin-primary, #3b82f6);color:#fff;border-radius:10px;padding:12px 16px;font-size:14px;font-weight:600;line-height:1;cursor:pointer;transition:all .2s ease;display:flex;align-items:center;justify-content:center;gap:8px;width:100%;box-shadow:0 1px 3px #3b82f64d}.component-tree-drawer-add-pin-btn:hover{background:var(--bim-pin-primary-hover, #2563eb);transform:translateY(-1px);box-shadow:0 4px 12px #3b82f666}.component-tree-drawer-add-pin-btn:active{transform:translateY(0)}.component-tree-drawer-add-pin-btn svg{width:18px;height:18px;flex-shrink:0}.component-tree-drawer-pin-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:48px 20px;text-align:center}.component-tree-drawer-pin-empty-icon{width:48px;height:48px;display:flex;align-items:center;justify-content:center;color:var(--bim-pin-muted, #94a3b8);opacity:.5}.component-tree-drawer-pin-empty-icon svg{width:100%;height:100%}.component-tree-drawer-pin-empty-title{font-size:15px;font-weight:600;color:var(--bim-pin-text, #1e293b)}.component-tree-drawer-pin-empty-desc{font-size:13px;color:var(--bim-pin-muted, #64748b);line-height:1.5}.component-tree-drawer-pin-list{display:flex;flex-direction:column;gap:10px;overflow-y:auto;overflow-x:hidden;max-height:100%;padding:0 4px}.component-tree-drawer-pin-item{background:var(--bim-pin-card-bg, #ffffff);border:1px solid var(--bim-pin-border, #e2e8f0);border-radius:12px;padding:2px;cursor:pointer;transition:all .2s ease;box-shadow:var(--bim-pin-shadow, 0 1px 3px rgba(0, 0, 0, .05));overflow:hidden}.component-tree-drawer-pin-item:hover{border-color:var(--bim-component-tree-tab-active-border, #3b82f6);box-shadow:var(--bim-pin-shadow-hover, 0 4px 12px rgba(0, 0, 0, .1));transform:translateY(-1px)}.component-tree-drawer-pin-content{display:flex;align-items:center;gap:12px;padding:10px 14px;min-height:48px}.component-tree-drawer-pin-icon{flex:0 0 auto;width:36px;height:36px;display:flex;align-items:center;justify-content:center;background:var(--bim-component-tree-tab-active, #eff6ff);color:var(--bim-component-tree-tab-active-text, #1d4ed8);border-radius:10px}.component-tree-drawer-pin-icon svg{width:20px;height:20px}.component-tree-drawer-pin-info{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:2px}.component-tree-drawer-pin-name{font-size:14px;font-weight:600;color:var(--bim-pin-text, #1e293b);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.4}.component-tree-drawer-pin-index{font-size:11px;font-weight:500;color:var(--bim-pin-muted, #94a3b8);line-height:1.3}.component-tree-drawer-pin-actions{flex:0 0 auto;display:flex;align-items:center;gap:2px;opacity:0;transition:opacity .18s ease}.component-tree-drawer-pin-item:hover .component-tree-drawer-pin-actions{opacity:1}.component-tree-drawer-pin-action-btn{appearance:none;border:none;background:transparent;color:var(--bim-pin-muted, #94a3b8);width:32px;height:32px;display:inline-flex;align-items:center;justify-content:center;border-radius:8px;cursor:pointer;transition:all .18s ease;padding:0}.component-tree-drawer-pin-action-btn:hover{background:var(--bim-component-tree-tab-hover, #f1f5f9);color:var(--bim-pin-text, #1e293b)}.component-tree-drawer-pin-action-btn svg{width:16px;height:16px}.component-tree-drawer-pin-edit-wrapper{display:flex;align-items:center;gap:8px;padding:10px 14px}.component-tree-drawer-pin-input{flex:1 1 auto;min-width:0;appearance:none;border:2px solid var(--bim-component-tree-tab-active-border, #3b82f6);background:var(--bim-pin-bg, #ffffff);color:var(--bim-pin-text, #1e293b);border-radius:8px;padding:8px 12px;font-size:14px;font-weight:600;outline:none;transition:box-shadow .2s ease}.component-tree-drawer-pin-input:focus{box-shadow:0 0 0 3px #3b82f626}.component-tree-drawer-pin-edit-actions{flex:0 0 auto;display:flex;align-items:center;gap:4px}.component-tree-drawer-pin-edit-btn{appearance:none;border:none;width:32px;height:32px;display:inline-flex;align-items:center;justify-content:center;border-radius:8px;cursor:pointer;transition:all .18s ease;padding:0}.component-tree-drawer-pin-edit-save{background:#10b981;color:#fff}.component-tree-drawer-pin-edit-save:hover{background:#059669}.component-tree-drawer-pin-edit-cancel{background:#f1f5f9;color:#64748b}.component-tree-drawer-pin-edit-cancel:hover{background:#e2e8f0;color:#475569}.component-tree-drawer-pin-edit-btn svg{width:16px;height:16px}.component-tree-drawer-construct-tree,.component-tree-drawer-construct-tree-mount{flex:1;min-height:0;height:100%;display:flex;flex-direction:column;overflow:hidden}.component-tree-drawer-construct-tree-tab-container,.component-tree-drawer-construct-tree-tab-container .bim-tab,.component-tree-drawer-construct-tree-tab-container .bim-tab__content,.component-tree-drawer-construct-tree-tab-container .bim-tab__panel,.component-tree-drawer-construct-tree-panel,.component-tree-drawer-construct-tree-tab-container .construct-tab__panel-content,.component-tree-drawer-construct-tree-tab-container .bim-tree{height:100%;min-height:0;overflow:hidden}.component-tree-drawer-construct-tree-tab-container .bim-tab{display:flex;flex-direction:column;background:transparent}.component-tree-drawer-construct-tree-tab-container .bim-tab__nav{flex:0 0 auto;gap:6px;padding:4px;margin:0 0 8px;background:var(--bim-component-tree-subtab-nav-bg);border-color:var(--bim-component-tree-subtab-nav-border);border-radius:10px}.component-tree-drawer-construct-tree-tab-container .bim-tab__item{min-height:32px;padding:7px 10px;font-size:12px;font-weight:600;color:var(--bim-component-tree-subtab-text);border:1px solid transparent}.component-tree-drawer-construct-tree-tab-container .bim-tab__item:hover{color:var(--bim-component-tree-subtab-hover-text);background:var(--bim-component-tree-subtab-hover-bg)}.component-tree-drawer-construct-tree-tab-container .bim-tab__item.is-active{color:var(--bim-component-tree-subtab-active-text);background:var(--bim-component-tree-subtab-active-bg);border-color:var(--bim-component-tree-subtab-active-border);box-shadow:var(--bim-component-tree-subtab-active-shadow)}.component-tree-drawer-construct-tree-tab-container .bim-tab__content{flex:1;min-height:0;overflow:hidden}.component-tree-drawer-construct-tree-panel,.component-tree-drawer-construct-tree-tab-container .construct-tab__panel-content{overflow:hidden}.component-tree-drawer-construct-tree-tab-container .bim-tree{border:1px solid var(--bim-component-tree-tree-border);border-radius:10px;background:var(--bim-component-tree-tree-bg)}.component-tree-drawer-construct-tree-tab-container .bim-tree-search{padding:8px 8px 6px}.component-tree-drawer-construct-tree-tab-container .bim-tree-search-input{height:28px;font-size:12px}.component-tree-drawer-construct-tree-tab-container .bim-tree-content{flex:1 1 auto;min-height:0;padding:4px 6px 8px;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain}@media(max-width:768px){.component-tree-drawer{right:0}.component-tree-drawer-header{align-items:flex-start}.component-tree-drawer-tabs{gap:6px}.component-tree-drawer-tab{padding:8px 12px;min-height:34px}}.component-tree-drawer-view,.component-tree-drawer-view-mount{flex:1;min-height:0;height:100%;display:flex;flex-direction:column;overflow:hidden}.component-tree-drawer-view-mount .bim-tree{height:100%;min-height:0;border:1px solid var(--bim-component-tree-tree-border);border-radius:10px;background:var(--bim-component-tree-tree-bg);overflow:hidden}.component-tree-drawer-view-mount .bim-tree-search{padding:8px 8px 6px}.component-tree-drawer-view-mount .bim-tree-search-input{height:28px;font-size:12px}.component-tree-drawer-view-mount .bim-tree-content{flex:1 1 auto;min-height:0;padding:4px 6px 8px;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain}.component-tree-drawer-view-empty{display:flex;align-items:center;justify-content:center;height:100%;min-height:0;padding:24px;font-size:13px;color:var(--bim-component-tree-muted);text-align:center}.component-tree-drawer-pin-toolbar{position:relative;z-index:3;margin-bottom:10px;display:flex;align-items:center;justify-content:space-between;gap:8px;overflow:visible}.component-tree-drawer-pin-btn-group{display:flex;gap:6px;flex:1 1 auto;min-width:0;flex-wrap:nowrap}.component-tree-drawer-add-pin-btn,.component-tree-drawer-add-folder-btn,.component-tree-drawer-toggle-pins-btn{appearance:none;border:1px solid var(--bim-component-tree-tree-border);color:var(--bim-pin-text, #1e293b);border-radius:8px;padding:0 10px;height:30px;font-size:12px;font-weight:600;line-height:1;cursor:pointer;transition:background-color .18s ease,border-color .18s ease,color .18s ease,transform .18s ease;display:flex;align-items:center;justify-content:center;gap:6px;background:var(--bim-pin-card-bg, #ffffff);box-shadow:none;white-space:nowrap;flex:0 0 auto;min-width:0}.component-tree-drawer-add-pin-btn svg,.component-tree-drawer-add-folder-btn svg,.component-tree-drawer-toggle-pins-btn svg{width:14px;height:14px;flex-shrink:0}.component-tree-drawer-add-pin-btn{background:var(--bim-pin-soft, rgba(59, 130, 246, .12));border-color:color-mix(in srgb,var(--bim-pin-primary, #3b82f6) 26%,var(--bim-component-tree-tree-border));color:var(--bim-component-tree-tab-active-text, #1d4ed8);flex:1 1 0}.component-tree-drawer-add-pin-btn:hover{background:color-mix(in srgb,var(--bim-pin-primary, #3b82f6) 14%,var(--bim-pin-card-bg, #ffffff));border-color:color-mix(in srgb,var(--bim-pin-primary, #3b82f6) 38%,var(--bim-component-tree-tree-border));box-shadow:none;transform:none}.component-tree-drawer-add-folder-btn{background:transparent;padding-inline:9px;flex:1 1 0}.component-tree-drawer-add-folder-btn:hover,.component-tree-drawer-toggle-pins-btn:hover{background:var(--bim-component-tree-tab-hover, #f1f5f9);border-color:var(--bim-component-tree-tree-border);color:var(--bim-pin-text, #1e293b);box-shadow:none;transform:none}.component-tree-drawer-toggle-pins-btn{position:relative;width:30px;flex:0 0 30px;padding:0;background:var(--bim-pin-card-bg, #ffffff)}.component-tree-drawer-toggle-pins-btn.is-active{background:var(--bim-pin-soft, rgba(59, 130, 246, .12));border-color:color-mix(in srgb,var(--bim-pin-primary, #3b82f6) 34%,var(--bim-component-tree-tree-border));color:var(--bim-component-tree-tab-active-text, #1d4ed8)}.component-tree-drawer-toggle-pins-btn[data-tooltip]:after{content:attr(data-tooltip);position:absolute;right:0;top:calc(100% + 6px);z-index:20;transform:translateY(-3px);padding:4px 7px;border-radius:6px;background:color-mix(in srgb,var(--bim-pin-text, #0f172a) 92%,transparent 8%);color:var(--bim-pin-bg, #ffffff);box-shadow:0 4px 12px #0f172a29;font-size:11px;font-weight:500;line-height:1;white-space:nowrap;pointer-events:none;opacity:0;transition:opacity .12s ease,transform .12s ease}.component-tree-drawer-toggle-pins-btn[data-tooltip]:hover:after,.component-tree-drawer-toggle-pins-btn[data-tooltip]:focus-visible:after{opacity:1;transform:translateY(0)}.component-tree-drawer-add-pin-btn:focus-visible,.component-tree-drawer-add-folder-btn:focus-visible,.component-tree-drawer-toggle-pins-btn:focus-visible,.pin-node-action-btn:focus-visible,.pin-node-edit-btn:focus-visible,.pin-node-edit-input:focus-visible{outline:2px solid color-mix(in srgb,var(--bim-pin-primary, #3b82f6) 60%,white);outline-offset:2px}.component-tree-drawer-add-pin-btn:active,.component-tree-drawer-add-folder-btn:active,.component-tree-drawer-toggle-pins-btn:active{transform:translateY(-1px)}.component-tree-drawer-pin-tree-container{position:relative;z-index:1;flex:1;min-height:0;overflow:hidden}.component-tree-drawer-pin-tree-container .bim-tree{height:100%;border:1px solid var(--bim-component-tree-tree-border);border-radius:10px;background:var(--bim-component-tree-tree-bg);overflow:hidden}.component-tree-drawer-pin-tree-container .bim-tree-content{flex:1 1 auto;min-height:0;padding:6px 8px 10px;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain}.component-tree-drawer-pin-tree-container .bim-tree-node-content{min-height:34px;border-radius:8px;padding-right:6px}.component-tree-drawer-pin-tree-container .bim-tree-node-content.is-selected{background:color-mix(in srgb,var(--bim-pin-primary, #3b82f6) 12%,var(--bim-component-tree-tree-bg))}.component-tree-drawer-pin-tree-container .bim-tree-title{font-size:13px;font-weight:500}.component-tree-drawer-pin-tree-container .bim-tree-node-actions{display:flex}.pin-node-actions{display:flex;align-items:center;gap:4px;opacity:0;transition:opacity .18s ease}.bim-tree-node-content:hover .pin-node-actions,.bim-tree-node-content.is-selected .pin-node-actions,.bim-tree-node-content:focus-within .pin-node-actions{opacity:1}.pin-node-action-btn{appearance:none;border:none;background:transparent;color:var(--bim-pin-muted, #94a3b8);width:24px;height:24px;display:inline-flex;align-items:center;justify-content:center;border-radius:6px;cursor:pointer;transition:all .18s ease;padding:0}.pin-node-action-btn:hover{background:var(--bim-component-tree-tab-hover, #f1f5f9);color:var(--bim-pin-text, #1e293b)}.pin-node-action-btn svg{width:13px;height:13px}.pin-node-edit-wrapper{display:flex;align-items:center;gap:6px;flex:1;min-width:0}.pin-node-edit-input{flex:1;min-width:0;appearance:none;border:1px solid color-mix(in srgb,var(--bim-pin-primary, #3b82f6) 35%,var(--bim-component-tree-tree-border));background:var(--bim-pin-bg, #ffffff);color:var(--bim-pin-text, #1e293b);border-radius:6px;padding:5px 8px;font-size:13px;font-weight:500;outline:none;transition:box-shadow .2s ease}.pin-node-edit-input:focus{box-shadow:0 0 0 3px #3b82f626}.pin-node-edit-actions{display:flex;align-items:center;gap:4px;flex-shrink:0}.pin-node-edit-btn{appearance:none;border:none;width:24px;height:24px;display:inline-flex;align-items:center;justify-content:center;border-radius:6px;cursor:pointer;transition:all .18s ease;padding:0}.pin-node-edit-btn svg{width:12px;height:12px}.pin-node-edit-save{background:#10b981;color:#fff}.pin-node-edit-save:hover{background:#059669}.pin-node-edit-cancel{background:#f1f5f9;color:#64748b}.pin-node-edit-cancel:hover{background:#e2e8f0;color:#475569}.pin-delete-dialog{display:flex;flex-direction:column;align-items:center;gap:14px;min-width:0;padding:20px 22px 18px}.pin-delete-dialog-symbol{width:52px;height:52px;display:inline-flex;align-items:center;justify-content:center;border-radius:50%;background:color-mix(in srgb,#f59e0b 12%,var(--bim-pin-card-bg, #ffffff));color:#d97706;font-size:30px;font-weight:700;line-height:1}.pin-delete-dialog-text{font-size:14px;line-height:1.7;color:var(--bim-pin-text, #1e293b);word-break:break-word;text-align:center}.pin-delete-dialog-actions{display:flex;justify-content:flex-end;gap:8px;width:100%;margin-top:2px}.pin-delete-dialog-btn{min-width:88px;height:36px;padding:0 14px;border-radius:10px;border:1px solid var(--bim-component-tree-tree-border);background:var(--bim-pin-card-bg, #ffffff);color:var(--bim-pin-text, #1e293b);font-size:13px;font-weight:600;cursor:pointer;transition:background-color .18s ease,border-color .18s ease,color .18s ease}.pin-delete-dialog-btn.is-secondary:hover{background:var(--bim-component-tree-tab-hover, #f1f5f9)}.pin-delete-dialog-btn.is-danger{border-color:color-mix(in srgb,#ef4444 30%,var(--bim-component-tree-tree-border));background:color-mix(in srgb,#ef4444 10%,var(--bim-pin-card-bg, #ffffff));color:#b91c1c}.pin-delete-dialog-btn.is-danger:hover{background:color-mix(in srgb,#ef4444 16%,var(--bim-pin-card-bg, #ffffff))}.pin-delete-dialog-btn:focus-visible{outline:2px solid color-mix(in srgb,var(--bim-pin-primary, #3b82f6) 60%,white);outline-offset:2px}@media(max-width:560px){.component-tree-drawer-pin-btn-group{width:100%}.component-tree-drawer-add-pin-btn,.component-tree-drawer-add-folder-btn{flex:1 1 0}}@media(prefers-reduced-motion:reduce){.component-tree-drawer,.component-tree-drawer-tab,.component-tree-drawer-close{transition:none}}.bim-tab{display:flex;flex-direction:column;width:100%;height:100%;background:transparent;color:var(--bim-text-secondary)}.bim-tab__nav{display:flex;align-items:center;gap:4px;padding:4px;margin:8px 12px;background:var(--bim-bg-inset);border-radius:8px;border:1px solid var(--bim-border-subtle)}.bim-tab__item{flex:1;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:8px 12px;border:none;border-radius:6px;background:transparent;color:var(--bim-text-secondary);cursor:pointer;transition:all .2s ease;font-size:13px;font-weight:500}.bim-tab__item:hover{color:var(--bim-text-primary);background-color:var(--bim-component-bg-hover)}.bim-tab__item.is-active{color:var(--bim-primary);background-color:var(--bim-bg-elevated);box-shadow:0 1px 3px #0000001a}.bim-tab__item.is-disabled{opacity:.5;cursor:not-allowed}.bim-tab__icon{width:16px;height:16px;display:inline-flex;align-items:center;justify-content:center;color:var(--bim-tab-icon, currentColor)}.bim-tab__icon svg{width:100%;height:100%;fill:currentColor}.bim-tab__title{white-space:nowrap}.bim-tab__content{flex:1;display:flex;position:relative;min-height:0;overflow:hidden}.bim-tab__panel{display:none;width:100%;height:100%;flex:1}.bim-tab__panel.is-active{display:flex;flex-direction:column;height:100%}.construct-tab__container{height:100%;display:flex;flex-direction:column}.construct-tab__panel-content{flex:1;display:flex;flex-direction:column;min-height:0;overflow:hidden}.construct-tab__panel-content .bim-tree{flex:1}.bim-tree{width:100%;height:100%;display:flex;flex-direction:column;overflow:hidden;font-size:14px;color:var(--bim-text-primary);-webkit-user-select:none;user-select:none;position:relative;background:transparent}.bim-tree-search{padding:6px;background-color:transparent;flex-shrink:0;position:relative}.bim-tree-search-wrapper{position:relative;width:100%;display:flex;align-items:center}.bim-tree-search-icon{position:absolute;left:8px;width:16px;height:16px;color:var(--bim-text-secondary);pointer-events:none;display:flex;align-items:center;justify-content:center}.bim-tree-search-icon svg{width:100%;height:100%}.bim-tree-search-input{width:100%;height:30px;padding:4px 8px 4px 30px;border:1px solid var(--bim-border-default);border-radius:4px;outline:none;font-size:13px;color:inherit;background-color:var(--bim-bg-elevated);transition:all .2s;box-sizing:border-box}.bim-tree-search-input:focus{border-color:var(--bim-primary);box-shadow:var(--bim-focus-ring)}.bim-tree-search-results{position:absolute;top:100%;left:8px;right:8px;background-color:var(--bim-bg-elevated);border:1px solid var(--bim-border-default);box-shadow:var(--bim-shadow-md);border-radius:4px;max-height:200px;overflow-y:auto;z-index:10;display:none}.bim-tree-search-results.is-visible{display:block}.bim-tree-search-item{padding:8px 12px;cursor:pointer;border-bottom:1px solid rgba(0,0,0,.03)}.bim-tree-search-item:last-child{border-bottom:none}.bim-tree-search-item:hover{background-color:var(--bim-component-bg-hover)}.bim-tree-search-item-title{font-weight:500;display:block}.bim-tree-search-item-path{font-size:12px;color:var(--bim-text-secondary);margin-top:2px;display:block}.bim-tree-node-content:hover{background-color:var(--bim-component-bg-hover)}.bim-tree-switcher{width:24px;height:32px;display:flex;align-items:center;justify-content:center;cursor:pointer;color:var(--bim-text-secondary);transition:transform .2s;flex-shrink:0}.bim-tree-switcher svg{width:12px;height:12px;fill:currentColor;transition:transform .2s}.bim-tree-switcher.is-expanded svg{transform:rotate(90deg)}.bim-tree-switcher.is-hidden{visibility:hidden}.bim-tree-checkbox{width:16px;height:16px;border:1px solid var(--bim-border-default);border-radius:2px;margin-right:8px;background-color:var(--bim-bg-elevated);position:relative;cursor:pointer;flex-shrink:0;transition:all .2s}.bim-tree-checkbox:hover{border-color:var(--bim-primary)}.bim-tree-checkbox.is-checked{background-color:var(--bim-primary);border-color:var(--bim-primary)}.bim-tree-checkbox.is-checked:after{content:"";position:absolute;top:1px;left:4px;width:5px;height:9px;border:2px solid var(--bim-text-inverse);border-top:0;border-left:0;transform:rotate(45deg)}.bim-tree-checkbox.is-indeterminate{background-color:var(--bim-bg-elevated);border-color:var(--bim-primary)}.bim-tree-checkbox.is-indeterminate:after{content:"";position:absolute;top:6px;left:3px;width:8px;height:2px;background-color:var(--bim-primary)}.bim-tree-node.is-disabled .bim-tree-checkbox{background-color:var(--bim-component-bg-disabled);border-color:var(--bim-border-disabled);cursor:not-allowed}.bim-tree-node.is-disabled .bim-tree-checkbox.is-checked{background-color:var(--bim-text-disabled)}.bim-tree-node.is-disabled .bim-tree-node-content{color:var(--bim-text-disabled);cursor:not-allowed}.bim-tree-icon{width:16px;height:16px;margin-right:6px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.bim-tree-icon img,.bim-tree-icon svg{width:100%;height:100%}.bim-tree-title{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bim-tree-children{display:none;overflow:visible}.bim-tree-children.is-visible{display:block}.bim-tree-node-content.is-selected{background-color:var(--bim-component-bg-selected);color:var(--bim-primary)}.bim-tree-node-actions{display:none;align-items:center;margin-left:8px;flex-shrink:0}.bim-tree-node-content.is-selected .bim-tree-node-actions{display:flex}.bim-tree-content{flex:1;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scroll-behavior:auto;padding:2px 0;min-height:0}.bim-tree-node{display:flex;flex-direction:column;width:100%}.bim-tree-node-content{display:flex;align-items:center;height:32px;cursor:pointer;transition:background-color .2s;border-radius:4px;padding-right:8px;width:100%;box-sizing:border-box}.bim-measure-panel{width:100%;display:flex;flex-direction:column;box-sizing:border-box;color:var(--bim-text-secondary)}.bim-measure-settings{display:none;box-sizing:border-box;color:var(--bim-text-secondary)}.bim-measure-settings-title{font-size:14px;font-weight:600;margin-bottom:10px}.bim-measure-settings-row{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}.bim-measure-settings-row .label{color:var(--bim-text-secondary);font-size:13px;flex:0 0 auto}.bim-measure-settings-select{flex:0 0 auto;width:120px;height:28px;border-radius:6px;border:1px solid var(--bim-border-default);background:var(--bim-bg-inset);color:var(--bim-text-primary);padding:0 8px;box-sizing:border-box;outline:none}.bim-measure-settings-hint{font-size:12px;line-height:1.4;color:var(--bim-text-tertiary);margin-top:-4px;margin-bottom:8px}.bim-measure-settings-actions{margin-top:14px;display:flex;justify-content:flex-start;gap:10px}.bim-measure-settings-save,.bim-measure-settings-cancel{flex:0 0 auto!important;width:auto;min-width:0;height:30px;padding:0 12px;border-radius:4px;cursor:pointer;box-sizing:border-box}.bim-measure-settings-save{border:none;background:var(--bim-primary);color:var(--bim-text-inverse)}.bim-measure-settings-cancel{border:1px solid var(--bim-border-default);background:transparent;color:var(--bim-text-secondary)}.bim-measure-settings-save:hover,.bim-measure-settings-save:active,.bim-measure-settings-save:focus,.bim-measure-settings-cancel:hover,.bim-measure-settings-cancel:active,.bim-measure-settings-cancel:focus{background:inherit;outline:none}.bim-measure-settings-save:hover{background:var(--bim-primary-hover)}.bim-measure-tools{display:flex;flex-direction:column;gap:8px}.bim-measure-tool-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}.bim-measure-tool-btn{width:100%;height:42px;border-radius:6px;border:1px solid var(--bim-border-default);background:var(--bim-bg-inset);cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .2s ease;padding:0;box-sizing:border-box}.bim-measure-tool-btn:hover{background:var(--bim-component-bg-hover);border-color:var(--bim-border-strong)}.bim-measure-tool-btn.is-active{border-color:var(--bim-primary);background:var(--bim-primary-subtle)}.bim-measure-tool-btn.is-active .bim-measure-tool-icon{color:var(--bim-primary)}.bim-measure-tool-icon{width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center;color:var(--bim-icon-default)}.bim-measure-tool-icon svg{width:100%;height:100%;fill:currentColor}.bim-measure-toggle{display:flex;justify-content:flex-end}.bim-measure-toggle-btn{height:22px;border-radius:4px;border:1px solid var(--bim-border-default);background:var(--bim-bg-inset);cursor:pointer;display:inline-flex;align-items:center;justify-content:center;transition:all .2s ease;padding:0 6px;gap:4px;font-size:12px;line-height:1}.bim-measure-toggle-btn:hover{background:var(--bim-component-bg-hover);border-color:var(--bim-border-strong)}.bim-measure-toggle-text{color:var(--bim-text-secondary)}.bim-measure-toggle-icon svg{width:14px;height:14px;fill:currentColor;color:var(--bim-icon-default);transition:transform .15s ease}.bim-measure-toggle-btn.is-expanded .bim-measure-toggle-icon svg{transform:rotate(180deg)}.bim-measure-mode-options{display:none;flex-direction:column;gap:8px;margin-top:12px;padding-top:12px;border-top:1px solid var(--bim-divider)}.bim-measure-mode-options.is-visible{display:flex}.bim-measure-radio-group{display:flex;align-items:center;gap:8px;font-size:13px;line-height:1.4}.bim-measure-radio-group .bim-measure-radio-label{color:var(--bim-text-secondary);min-width:58px;flex:0 0 auto}.bim-measure-radio-group .bim-measure-radio-items{display:flex;gap:4px}.bim-measure-radio-item{display:inline-flex;align-items:center;justify-content:center;height:26px;padding:0 10px;border-radius:4px;border:1px solid var(--bim-border-default);background:var(--bim-bg-inset);color:var(--bim-text-secondary);font-size:12px;cursor:pointer;transition:all .15s ease;-webkit-user-select:none;user-select:none}.bim-measure-radio-item:hover{border-color:var(--bim-border-strong);color:var(--bim-text-primary)}.bim-measure-radio-item.is-active{background:var(--bim-primary-subtle);border-color:var(--bim-primary);color:var(--bim-primary)}.bim-measure-result{margin-top:12px;padding-top:12px;border-top:1px solid var(--bim-divider);display:flex;flex-direction:column;gap:10px}.bim-measure-row{display:flex;align-items:baseline;gap:8px;font-size:13px;line-height:1.4}.bim-measure-row .label{color:var(--bim-text-secondary);min-width:84px}.bim-measure-row .value{color:var(--bim-text-primary);flex:1;word-break:break-word}.bim-measure-main-number{color:#ffd24a}.bim-measure-main-number.is-laser-text,.bim-measure-main-unit{color:var(--bim-text-primary)}.bim-measure-xyz{display:flex;flex-direction:column;gap:6px}.bim-measure-xyz .value{font-variant-numeric:tabular-nums}.bim-measure-xyz-x{color:#ff4d4f!important}.bim-measure-xyz-y{color:#52c41a!important}.bim-measure-xyz-z{color:#1677ff!important}.bim-measure-footer{margin-top:12px;padding-top:10px;border-top:1px solid var(--bim-divider);display:flex;align-items:center;justify-content:flex-start;gap:10px}.bim-measure-clear-btn{background:transparent;border:none;color:var(--bim-danger);cursor:pointer;padding:0;font-size:13px;flex:0 0 auto!important;width:auto;min-width:0}.bim-measure-clear-btn:hover,.bim-measure-clear-btn:active,.bim-measure-clear-btn:focus{background:transparent;border:none;outline:none;text-decoration:none}.bim-measure-settings-btn{width:24px;height:24px;border-radius:4px;border:none;background:transparent;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;padding:0;margin-left:auto;flex:0 0 auto!important}.bim-measure-settings-btn:hover,.bim-measure-settings-btn:active,.bim-measure-settings-btn:focus{background:transparent;border:none;outline:none}.bim-measure-settings-btn svg{width:18px;height:18px;fill:currentColor;color:var(--bim-icon-default)}.section-plane-panel{display:flex;gap:8px;padding:12px 12px 16px;box-sizing:border-box}.section-plane-btn{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;padding:10px;border:1px solid var(--bim-border-default);background:var(--bim-bg-inset);border-radius:8px;cursor:pointer;transition:all .2s ease;min-width:60px;outline:none;color:var(--bim-text-primary)}.section-plane-btn:hover{background:var(--bim-component-bg-hover);border-color:var(--bim-border-strong)}.section-plane-btn:active{background:var(--bim-primary-subtle);border-color:var(--bim-primary)}.section-plane-btn.is-active{background:var(--bim-primary-subtle);border-color:var(--bim-primary);color:var(--bim-primary)}.section-plane-btn.is-active .section-plane-btn-icon{color:var(--bim-primary)}.section-plane-btn-icon{width:24px;height:24px;display:flex;align-items:center;justify-content:center;color:var(--bim-icon-default)}.section-plane-btn-icon svg{width:100%;height:100%;fill:currentColor}.section-plane-btn-label{font-size:12px;color:inherit;text-align:center;line-height:1.2}.section-axis-panel{display:flex;flex-direction:column;gap:8px;padding:12px 12px 16px;box-sizing:border-box}.section-axis-row-1{display:flex;gap:8px;padding-bottom:8px;border-bottom:1px solid var(--bim-divider)}.section-axis-row-2{display:flex;gap:8px;padding-top:8px}.section-axis-btn{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;padding:8px;background:var(--bim-bg-inset);border:1px solid var(--bim-border-default);border-radius:8px;cursor:pointer;transition:all .2s ease;outline:none;color:var(--bim-text-primary);min-height:48px}.section-axis-btn:hover{background:var(--bim-component-bg-hover);border-color:var(--bim-border-strong)}.section-axis-btn.active{background:var(--bim-primary-subtle);border-color:var(--bim-primary);color:var(--bim-primary)}.section-axis-btn.active .section-axis-btn-icon{color:var(--bim-primary)}.section-axis-btn-icon{width:24px;height:24px;display:inline-flex;align-items:center;justify-content:center;color:var(--bim-icon-default)}.section-axis-btn-icon svg{width:100%;height:100%}.section-axis-btn-label{font-size:12px;color:inherit;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}.section-axis-btn-text{min-height:40px}.section-axis-btn-text .section-axis-btn-label{font-size:18px;font-weight:600}.section-box-panel{display:flex;flex-direction:column;padding:12px;box-sizing:border-box;-webkit-user-select:none;user-select:none}.section-box-row-buttons{display:flex;gap:6px;padding-bottom:12px;border-bottom:1px solid var(--bim-divider)}.section-box-btn{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;padding:6px;background:var(--bim-bg-inset);border:1px solid var(--bim-border-default);border-radius:8px;cursor:pointer;color:var(--bim-text-primary);min-height:44px;transition:all .2s ease}.section-box-btn:hover{background:var(--bim-component-bg-hover);border-color:var(--bim-border-strong)}.section-box-btn.active{background:var(--bim-primary-subtle);border-color:var(--bim-primary);color:var(--bim-primary)}.section-box-btn.active .section-box-btn-icon{color:var(--bim-primary)}.section-box-btn-icon{width:24px;height:24px;color:var(--bim-icon-default)}.section-box-btn-icon svg{width:100%;height:100%}.section-box-btn-label{font-size:11px;white-space:nowrap}.section-box-sliders{display:flex;flex-direction:column;gap:16px;padding-top:16px}.section-box-slider{display:flex;align-items:center;gap:12px;position:relative;z-index:1}.section-box-slider:hover{z-index:10}.section-box-slider-label{font-size:13px;font-weight:700;color:var(--bim-text-primary);min-width:14px}.section-box-slider-track{position:relative;flex:1;height:4px;background:var(--bim-border-default);border-radius:2px}.section-box-slider-range{position:absolute;top:0;height:100%;background:var(--bim-primary);border-radius:2px;pointer-events:none}.section-box-slider-handle{position:absolute;top:50%;width:14px;height:14px;background:var(--bim-bg-elevated);border:2px solid var(--bim-primary);border-radius:50%;transform:translate(-50%,-50%);cursor:grab;z-index:5;touch-action:none;transition:transform .2s,box-shadow .2s}.section-box-slider-handle:hover{transform:translate(-50%,-50%) scale(1.2);box-shadow:0 0 0 4px var(--bim-primary-subtle)}.section-box-slider-handle.dragging{cursor:grabbing;transform:translate(-50%,-50%) scale(1.2);background:var(--bim-primary)}.bim-collapse{background-color:var(--bim-bg-elevated);border:1px solid var(--bim-border-default);border-radius:8px;font-size:14px;color:var(--bim-text-primary)}.bim-collapse.is-ghost{background-color:transparent;border:none}.bim-collapse.is-ghost .bim-collapse-item{border-bottom:none}.bim-collapse.is-ghost .bim-collapse-header{background-color:var(--bim-component-bg);padding-left:12px;padding-right:0;border-bottom:1px solid var(--bim-border-default)}.bim-collapse.is-ghost .bim-collapse-header:hover{background-color:var(--bim-component-bg-hover)}.bim-collapse.is-ghost .bim-collapse-content{background-color:transparent;border-top:none}.bim-collapse-item{border-bottom:1px solid var(--bim-border-subtle)}.bim-collapse-item:last-child{border-bottom:none}.bim-collapse-item.is-disabled .bim-collapse-header{color:var(--bim-text-disabled);cursor:not-allowed}.bim-collapse-header{display:flex;align-items:center;padding:12px 16px;background-color:var(--bim-component-bg);cursor:pointer;transition:all .2s ease;position:relative}.bim-collapse-header:hover{background-color:var(--bim-component-bg-hover)}.bim-collapse-arrow{margin-right:12px;font-size:12px;width:12px;height:12px;transition:transform .24s;display:inline-flex;align-items:center;justify-content:center}.bim-collapse-arrow svg{width:100%;height:100%;fill:currentColor}.bim-collapse-item.is-active .bim-collapse-arrow{transform:rotate(90deg)}.bim-collapse-icon{margin-right:8px;display:inline-flex;align-items:center}.bim-collapse-icon svg{width:16px;height:16px;fill:currentColor}.bim-collapse-title{flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.bim-collapse-extra{margin-left:auto}.bim-collapse-content{overflow:hidden;background-color:var(--bim-bg-elevated);border-top:1px solid var(--bim-border-subtle);transition:height .2s ease-in-out,opacity .2s ease-in-out}.bim-collapse-content.is-hidden{display:none}.bim-ai-chat{position:absolute;width:440px;height:600px;display:flex;flex-direction:column;background:var(--bim-ai-panel, rgba(11, 18, 32, .95));border:1px solid var(--bim-ai-border, rgba(255, 255, 255, .1));border-radius:16px;backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px);box-shadow:0 12px 32px var(--bim-ai-shadow, rgba(0, 0, 0, .4));z-index:1000;font-family:Public Sans,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;overflow:hidden;resize:both;min-width:360px;min-height:400px;max-width:90vw;max-height:90vh}.bim-ai-chat-header{display:flex;align-items:center;justify-content:space-between;height:56px;padding:12px 16px;border-bottom:1px solid var(--bim-ai-border, rgba(255, 255, 255, .1));flex-shrink:0;cursor:move;-webkit-user-select:none;user-select:none;border-radius:16px 16px 0 0}.bim-ai-chat-title{font-size:18px;font-weight:600;color:var(--bim-ai-text, #E5E7EB)}.bim-ai-chat-actions{display:flex;gap:8px}.bim-ai-chat-action-btn{width:32px;height:32px;border-radius:999px;border:1px solid var(--bim-ai-border, rgba(255, 255, 255, .1));background:transparent;color:var(--bim-ai-text, #E5E7EB);cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .2s ease}.bim-ai-chat-action-btn:hover{background:var(--bim-ai-subtle-fill, rgba(255, 255, 255, .05))}.bim-ai-chat-action-btn svg{width:18px;height:18px}.bim-ai-chat-messages{flex:1;overflow-y:auto;padding:12px;display:flex;flex-direction:column;gap:10px}.bim-ai-msg-ai{max-width:320px}.bim-ai-msg-ai .bim-ai-bubble{background:var(--bim-ai-panel2, rgba(15, 23, 42, .95));border:1px solid var(--bim-ai-border, rgba(255, 255, 255, .1));border-radius:16px;padding:10px}.bim-ai-msg-ai .bim-ai-bubble-content{font-size:13px;line-height:1.4;color:var(--bim-ai-text, #E5E7EB)}.bim-ai-msg-user{display:flex;justify-content:flex-end}.bim-ai-msg-user .bim-ai-bubble{max-width:300px;background:var(--bim-ai-user-bubble, rgba(29, 78, 216, .8));border-radius:16px;padding:10px;box-shadow:0 10px 26px #0003}.bim-ai-msg-user .bim-ai-bubble-content{font-size:13px;line-height:1.4;color:var(--bim-ai-user-text, #EEF2FF)}.bim-ai-step{display:flex;align-items:center;gap:10px;padding:10px;border-radius:14px;max-width:380px}.bim-ai-step-running{background:var(--bim-ai-info-soft, rgba(56, 189, 248, .1));border:1px solid rgba(56,189,248,.33)}.bim-ai-step-done{background:var(--bim-ai-success-soft, rgba(52, 211, 153, .1));border:1px solid rgba(52,211,153,.33)}.bim-ai-step-error{background:var(--bim-ai-danger-soft, rgba(239, 68, 68, .1));border:1px solid var(--bim-ai-danger-stroke, rgba(239, 68, 68, .33))}.bim-ai-step-icon{width:16px;height:16px;flex-shrink:0}.bim-ai-step-running .bim-ai-step-icon{color:var(--bim-ai-info, #38BDF8)}.bim-ai-step-done .bim-ai-step-icon{color:var(--bim-ai-success, #34D399)}.bim-ai-step-error .bim-ai-step-icon{color:var(--bim-ai-danger, #EF4444)}.bim-ai-step-text{font-size:12px;line-height:1.4;color:var(--bim-ai-text, #E5E7EB)}.bim-ai-thinking{display:flex;align-items:center;gap:10px;padding:10px;border-radius:14px;background:var(--bim-ai-panel2, rgba(15, 23, 42, .95));border:1px solid var(--bim-ai-border, rgba(255, 255, 255, .1));max-width:380px}.bim-ai-thinking-icon{width:16px;height:16px;color:var(--bim-ai-muted, #94A3B8);animation:bim-ai-spin 1s linear infinite}.bim-ai-thinking-text{font-size:12px;font-weight:600;color:var(--bim-ai-muted, #94A3B8)}@keyframes bim-ai-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.bim-ai-question-active{width:360px;border-radius:14px;background:var(--bim-ai-panel2, rgba(15, 23, 42, .95));border:1px solid var(--bim-ai-accent-stroke, rgba(59, 130, 246, .33));box-shadow:0 4px 16px var(--bim-ai-shadow, rgba(0, 0, 0, .4));overflow:hidden}.bim-ai-question-header{display:flex;align-items:center;gap:8px;padding:12px;border-bottom:1px solid var(--bim-ai-border, rgba(255, 255, 255, .1))}.bim-ai-question-icon{width:24px;height:24px;border-radius:6px;background:var(--bim-ai-accent-soft, rgba(59, 130, 246, .1));display:flex;align-items:center;justify-content:center;color:var(--bim-ai-accent, #3B82F6)}.bim-ai-question-icon svg{width:14px;height:14px}.bim-ai-question-title{font-size:13px;font-weight:600;color:var(--bim-ai-text, #E5E7EB)}.bim-ai-question-content{padding:12px;display:flex;flex-direction:column;gap:10px}.bim-ai-question-text{font-size:13px;line-height:1.4;color:var(--bim-ai-text, #E5E7EB)}.bim-ai-question-options{display:flex;flex-direction:column;gap:6px}.bim-ai-option{display:flex;align-items:center;gap:8px;padding:8px 10px;border-radius:8px;background:var(--bim-ai-subtle-fill, rgba(255, 255, 255, .05));border:1px solid var(--bim-ai-border, rgba(255, 255, 255, .1));cursor:pointer;transition:all .2s ease}.bim-ai-option:hover{background:var(--bim-ai-subtle-fill-hover, rgba(255, 255, 255, .08))}.bim-ai-option.selected{background:var(--bim-ai-accent-soft, rgba(59, 130, 246, .1));border-color:var(--bim-ai-accent-stroke, rgba(59, 130, 246, .33))}.bim-ai-option-radio{width:16px;height:16px;border-radius:50%;border:1.5px solid var(--bim-ai-muted, #94A3B8);flex-shrink:0;display:flex;align-items:center;justify-content:center}.bim-ai-option.selected .bim-ai-option-radio{background:var(--bim-ai-accent, #3B82F6);border-color:var(--bim-ai-accent, #3B82F6)}.bim-ai-option-radio-dot{width:6px;height:6px;border-radius:50%;background:var(--bim-ai-accent-ink, #FFFFFF);display:none}.bim-ai-option.selected .bim-ai-option-radio-dot{display:block}.bim-ai-option-text{font-size:12px;color:var(--bim-ai-text, #E5E7EB)}.bim-ai-option-input{flex:1;background:var(--bim-ai-textbox-fill, rgba(15, 23, 42, .6));border:1px solid var(--bim-ai-border, rgba(255, 255, 255, .1));border-radius:6px;padding:6px 8px;font-size:12px;color:var(--bim-ai-text, #E5E7EB);outline:none;margin-top:8px;width:100%}.bim-ai-option-input:focus{border-color:var(--bim-ai-accent-stroke, rgba(59, 130, 246, .33))}.bim-ai-question-footer{display:flex;justify-content:flex-end;padding:12px;border-top:1px solid var(--bim-ai-border, rgba(255, 255, 255, .1))}.bim-ai-question-submit{display:flex;align-items:center;gap:4px;padding:8px 12px;border-radius:8px;background:var(--bim-ai-accent, #3B82F6);color:var(--bim-ai-accent-ink, #FFFFFF);border:none;cursor:pointer;font-size:12px;font-weight:600;transition:all .2s ease}.bim-ai-question-submit:hover{filter:brightness(1.1)}.bim-ai-question-submit svg{width:12px;height:12px}.bim-ai-question-answered{max-width:340px;padding:10px;border-radius:12px;background:var(--bim-ai-panel2, rgba(15, 23, 42, .95));border:1px solid var(--bim-ai-border, rgba(255, 255, 255, .1));display:flex;flex-direction:column;gap:8px}.bim-ai-qa-row{display:flex;gap:8px;align-items:flex-start}.bim-ai-qa-badge{width:18px;height:18px;border-radius:5px;display:flex;align-items:center;justify-content:center;font-size:10px;font-weight:700;flex-shrink:0}.bim-ai-qa-badge-q{background:var(--bim-ai-accent-soft, rgba(59, 130, 246, .1));color:var(--bim-ai-accent, #3B82F6)}.bim-ai-qa-badge-a{background:var(--bim-ai-success-soft, rgba(52, 211, 153, .1));color:var(--bim-ai-success, #34D399)}.bim-ai-qa-question{font-size:12px;line-height:1.4;color:var(--bim-ai-muted, #94A3B8)}.bim-ai-qa-answer{font-size:12px;line-height:1.4;color:var(--bim-ai-text, #E5E7EB)}.bim-ai-chat-composer{padding:12px;border-top:1px solid var(--bim-ai-border, rgba(255, 255, 255, .1));display:flex;flex-direction:column;gap:8px;flex-shrink:0}.bim-ai-quick-prompts{display:flex;gap:8px;flex-wrap:wrap}.bim-ai-quick-prompt{padding:5px 8px;border-radius:999px;background:var(--bim-ai-subtle-fill, rgba(255, 255, 255, .05));border:1px solid var(--bim-ai-border, rgba(255, 255, 255, .1));color:var(--bim-ai-text, #E5E7EB);font-size:12px;font-weight:600;cursor:pointer;transition:all .2s ease}.bim-ai-quick-prompt:hover{background:var(--bim-ai-subtle-fill-hover, rgba(255, 255, 255, .08))}.bim-ai-input-row{display:flex;gap:8px;align-items:flex-end}.bim-ai-textbox{flex:1;display:flex;flex-direction:column;gap:6px;padding:10px;border-radius:16px;background:var(--bim-ai-textbox-fill, rgba(15, 23, 42, .6));border:1px solid var(--bim-ai-border, rgba(255, 255, 255, .1))}.bim-ai-textbox:focus-within{border-color:var(--bim-ai-accent-stroke, rgba(59, 130, 246, .33))}.bim-ai-textarea{background:transparent;border:none;outline:none;resize:none;font-size:13px;line-height:1.4;color:var(--bim-ai-text, #E5E7EB);min-height:20px;max-height:100px}.bim-ai-textarea::placeholder{color:var(--bim-ai-muted, #94A3B8)}.bim-ai-helper{display:flex;justify-content:space-between;font-size:11px;color:var(--bim-ai-muted, #94A3B8)}.bim-ai-send-btn{width:40px;height:40px;border-radius:14px;background:var(--bim-ai-accent, #3B82F6);border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;color:var(--bim-ai-accent-ink, #FFFFFF);transition:background .2s ease;flex-shrink:0}.bim-ai-send-btn:hover{background:var(--bim-ai-accent-hover, #2563EB)}.bim-ai-send-btn svg{width:18px;height:18px}.bim-ai-chat.light{--bim-ai-panel: rgba(255, 255, 255, .95);--bim-ai-panel2: #FFFFFF;--bim-ai-border: rgba(15, 23, 42, .1);--bim-ai-text: #0F172A;--bim-ai-muted: #475569;--bim-ai-shadow: rgba(11, 18, 32, .1);--bim-ai-subtle-fill: rgba(15, 23, 42, .05);--bim-ai-subtle-fill-hover: rgba(15, 23, 42, .08);--bim-ai-textbox-fill: #F1F5F9;--bim-ai-user-bubble: #2563EB;--bim-ai-user-text: #FFFFFF;--bim-ai-accent: #2563EB;--bim-ai-accent-soft: rgba(37, 99, 235, .08);--bim-ai-accent-stroke: rgba(37, 99, 235, .2);--bim-ai-success: #059669;--bim-ai-success-soft: rgba(5, 150, 105, .08);--bim-ai-danger: #DC2626;--bim-ai-danger-soft: rgba(220, 38, 38, .08);--bim-ai-danger-stroke: rgba(220, 38, 38, .2);--bim-ai-info: #0284C7;--bim-ai-info-soft: rgba(2, 132, 199, .08)}.bim-btn-group-root{display:flex;gap:8px;z-index:1000;position:absolute;pointer-events:auto;background:transparent}.bim-btn-group-root.static{position:relative;inset:auto;transform:none}.bim-btn-group-root.dir-row{flex-direction:row;align-items:center}.bim-btn-group-root.dir-column{flex-direction:column;align-items:stretch}.bim-btn-group-section{display:flex;gap:4px;background-color:var(--bim-btn-group-section-bg, rgba(17, 17, 17, .88));border-radius:6px;padding:4px;box-shadow:0 2px 8px #0000004d,0 1px 3px #0003}.bim-btn-group-root.dir-row .bim-btn-group-section{flex-direction:row;align-items:center}.bim-btn-group-root.dir-column .bim-btn-group-section{flex-direction:column}.opt-btn-wrapper{position:relative}.opt-btn{display:flex;cursor:pointer;border-radius:4px;transition:background-color .2s,color .2s,border-color .2s;color:var(--bim-btn-text-color, #ccc);background-color:var(--bim-btn-bg, transparent);padding:6px;align-items:center;position:relative;justify-content:center;border:1px solid transparent;outline:none}.opt-btn:hover{background-color:var(--bim-btn-hover-bg, #444)}.opt-btn.active{background-color:var(--bim-btn-active-bg, rgba(255, 255, 255, .15));color:var(--bim-btn-text-active-color, #fff)}.opt-btn.disabled{opacity:.5;cursor:not-allowed}.opt-btn-icon{width:var(--bim-icon-size, 24px);height:var(--bim-icon-size, 24px);display:flex;align-items:center;justify-content:center;color:var(--bim-icon-color, #ccc);flex-shrink:0}.opt-btn-icon svg{width:100%;height:100%;fill:currentColor}.opt-btn-arrow{font-size:10px;opacity:.6;transition:transform .2s;display:inline-block;margin-left:4px}.opt-btn-arrow.rotated{transform:rotate(180deg)}.opt-btn-text-wrapper{display:flex;align-items:center;justify-content:center;pointer-events:none}.opt-btn-label{display:inline}.opt-btn.no-label .opt-btn-label{display:none}.opt-btn.align-vertical:not(.no-label){flex-direction:column;text-align:center}.opt-btn.align-vertical:not(.no-label) .opt-btn-text-wrapper{margin-top:4px}.opt-btn.align-vertical:not(.no-label) .opt-btn-label{font-size:12px;line-height:1.2}.opt-btn.align-horizontal:not(.no-label){flex-direction:row}.opt-btn.align-horizontal:not(.no-label) .opt-btn-text-wrapper{margin-left:8px}.opt-btn.align-horizontal:not(.no-label) .opt-btn-label{font-size:14px}.opt-btn.no-label .opt-btn-text-wrapper{width:0;height:0;margin:0;padding:0;overflow:visible;position:absolute;top:0;right:0}.opt-btn.no-label .opt-btn-arrow{position:absolute;top:2px;right:2px;margin:0;font-size:8px}.opt-btn-dropdown{position:absolute;background-color:var(--bim-toolbar-bg, rgba(17, 17, 17, .95));border-radius:4px;padding:4px;box-shadow:0 4px 12px #0003;z-index:1001;display:flex;flex-direction:column;border:1px solid rgba(255,255,255,.1);opacity:0;visibility:hidden;transform:translateY(-10px);transition:opacity .2s ease,transform .2s cubic-bezier(.2,0,.2,1),visibility .2s}@keyframes dropdown-fade-in{0%{opacity:0;transform:translateY(-8px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}.opt-btn-dropdown{animation:dropdown-fade-in .2s cubic-bezier(.2,0,.2,1) forwards;opacity:1;visibility:visible;transform:none}.opt-btn-dropdown-item{display:flex;align-items:center;padding:8px 12px;cursor:pointer;border-radius:4px;color:var(--bim-btn-text-color, #ccc);transition:background .2s,border-color .2s,color .2s;box-sizing:border-box;border:1px solid transparent;outline:none}.opt-btn-dropdown-item .opt-btn-icon{color:var(--bim-icon-color, #ccc)}.opt-btn-dropdown-item:hover{background-color:var(--bim-btn-hover-bg, #444)}.opt-btn-dropdown-item.active{background-color:var(--bim-btn-active-bg, rgba(255, 255, 255, .15));color:var(--bim-btn-text-active-color, #fff)}.opt-btn-dropdown-item.align-horizontal{flex-direction:row}.opt-btn-dropdown-item.align-horizontal .opt-btn-icon{width:18px;height:18px;margin-right:8px}.opt-btn-dropdown-item.align-vertical{flex-direction:column;text-align:center}.opt-btn-dropdown-item.align-vertical .opt-btn-icon{width:24px;height:24px;margin-bottom:4px}.opt-btn-dropdown-item.align-vertical .opt-btn-dropdown-label{font-size:12px}.bim-btn-group-root.is-bottom-toolbar .opt-btn-icon{width:32px;height:32px}.bim-btn-group-root.is-bottom-toolbar .opt-btn{padding:8px}.bim-btn-group-root.is-bottom-toolbar.dir-row{max-width:calc(100% - 40px);overflow-x:auto;overflow-y:visible;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.2) transparent}.bim-btn-group-root.is-bottom-toolbar.dir-row .bim-btn-group-section{flex-shrink:0}.bim-btn-group-root.is-bottom-toolbar.dir-row::-webkit-scrollbar{height:4px}.bim-btn-group-root.is-bottom-toolbar.dir-row::-webkit-scrollbar-track{background:transparent}.bim-btn-group-root.is-bottom-toolbar.dir-row::-webkit-scrollbar-thumb{background:#fff3;border-radius:2px}.bim-btn-group-root.is-bottom-toolbar.dir-row::-webkit-scrollbar-thumb:hover{background:#fff6}.bim-btn-group-root.type-glass-pill .bim-btn-group-section{background:var(--bim-floating-bg);backdrop-filter:blur(24px);-webkit-backdrop-filter:blur(24px);border:1px solid var(--bim-floating-border);border-radius:9999px;box-shadow:none;padding:8px;gap:10px}.bim-btn-group-root.type-glass-pill .opt-btn{width:48px;height:48px;min-width:48px;border-radius:9999px;background:var(--bim-floating-btn-bg);border:1px solid var(--bim-floating-btn-border);box-shadow:var(--bim-floating-btn-shadow);color:var(--bim-text-primary);padding:0;transition:all .2s ease-out}.bim-btn-group-root.type-glass-pill .opt-btn:hover{background:var(--bim-floating-btn-bg-hover);transform:scale(1.05);box-shadow:var(--bim-floating-btn-shadow-hover)}.bim-btn-group-root.type-glass-pill .opt-btn:active{transform:scale(.98)}.bim-btn-group-root.type-glass-pill .opt-btn.active{background:var(--bim-primary);border:1px solid var(--bim-primary-active);color:var(--bim-text-inverse);box-shadow:var(--bim-shadow-glow)}.bim-btn-group-root.type-glass-pill .opt-btn.active:hover{background:var(--bim-primary-hover);transform:scale(1.05)}.bim-btn-group-root.type-glass-pill .opt-btn.active:active{transform:scale(.98)}.bim-btn-group-root.type-glass-pill .opt-btn.active .opt-btn-icon{color:var(--bim-icon-inverse)}.bim-btn-group-root.type-glass-pill .opt-btn.disabled{opacity:.3;cursor:not-allowed;transform:none;box-shadow:none}.bim-btn-group-root.type-glass-pill .opt-btn-icon{width:18px;height:18px;color:var(--bim-floating-icon-color);transition:color .2s ease-out}.bim-btn-group-root.type-glass-pill .opt-btn-icon svg{width:18px;height:18px}.bim-btn-group-root.type-glass-pill .opt-btn:hover .opt-btn-icon{color:var(--bim-floating-icon-color-hover)}.bim-btn-group-root.type-glass-pill .opt-btn-label{display:none!important}.bim-btn-group-root.type-glass-pill .opt-btn-text-wrapper{position:absolute;top:2px;right:2px;width:0;height:0;margin:0;padding:0}.bim-btn-group-root.type-glass-pill .opt-btn-arrow{font-size:8px;position:absolute;top:0;right:0;color:var(--bim-text-tertiary)}.opt-btn-dropdown.type-glass-pill{background:#fffffff2;backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);border:1px solid rgba(226,232,240,.6);border-radius:12px;box-shadow:0 8px 24px #0000001f;padding:6px}.opt-btn-dropdown.type-glass-pill .opt-btn-dropdown-item{display:flex;flex-direction:row;align-items:center;gap:10px;border-radius:8px;color:#334155;padding:8px 12px;font-size:13px;font-weight:400;transition:all .1s ease-out}.opt-btn-dropdown.type-glass-pill .opt-btn-dropdown-item:hover{background:#f1f5f9}.opt-btn-dropdown.type-glass-pill .opt-btn-dropdown-item:active{background:#e2e8f0}.opt-btn-dropdown.type-glass-pill .opt-btn-dropdown-item.active{background:#3b82f6;color:#fff}.opt-btn-dropdown.type-glass-pill .opt-btn-dropdown-item.active .opt-btn-icon,.opt-btn-dropdown.type-glass-pill .opt-btn-dropdown-item.active .opt-btn-dropdown-label{color:#fff}.opt-btn-dropdown.type-glass-pill .opt-btn-dropdown-item .opt-btn-icon{width:18px;height:18px;color:#334155;flex-shrink:0}.opt-btn-dropdown.type-glass-pill .opt-btn-dropdown-item .opt-btn-icon svg{width:18px;height:18px}.opt-btn-dropdown.type-glass-pill .opt-btn-dropdown-item .opt-btn-dropdown-label{white-space:nowrap;color:#334155}.opt-btn-dropdown.type-glass-pill.theme-dark{background:var(--bim-bg-overlay);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);border:1px solid var(--bim-border-default);box-shadow:var(--bim-shadow-lg)}.opt-btn-dropdown.type-glass-pill.theme-dark .opt-btn-dropdown-item{color:var(--bim-text-primary)}.opt-btn-dropdown.type-glass-pill.theme-dark .opt-btn-dropdown-item:hover{background:var(--bim-floating-btn-bg)}.opt-btn-dropdown.type-glass-pill.theme-dark .opt-btn-dropdown-item:active{background:var(--bim-floating-btn-bg-hover)}.opt-btn-dropdown.type-glass-pill.theme-dark .opt-btn-dropdown-item.active{background:var(--bim-primary);color:var(--bim-text-inverse)}.opt-btn-dropdown.type-glass-pill.theme-dark .opt-btn-dropdown-item .opt-btn-icon{color:var(--bim-floating-icon-color)}.opt-btn-dropdown.type-glass-pill.theme-dark .opt-btn-dropdown-item .opt-btn-dropdown-label{color:var(--bim-text-primary)}.engine-view-dropdown-host{position:relative}.engine-view-dropdown-trigger{position:absolute;top:50px;right:95px;z-index:1201;width:32px;height:32px;display:flex;align-items:center;justify-content:center;cursor:pointer;color:#fff;filter:drop-shadow(0 2px 4px rgba(0,0,0,.3));transition:filter .2s ease;background:none;border:none;padding:0}.engine-view-dropdown-trigger:hover{filter:drop-shadow(0 3px 6px rgba(0,0,0,.5))}.engine-view-dropdown-trigger svg{width:24px;height:24px}.engine-view-dropdown-trigger--top-right{top:12px;right:12px}.engine-view-dropdown-menu{background:var(--bim-panel-bg, rgba(255, 255, 255, .95));border:1px solid var(--bim-panel-border, rgba(226, 232, 240, .6));border-radius:8px;box-shadow:var(--bim-shadow-lg, 0 10px 25px rgba(0, 0, 0, .15));min-width:160px;-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);animation:dropdownIn .15s ease-out}.engine-view-dropdown-item{padding:4px 8px;cursor:pointer;font-size:12px;color:var(--bim-text-primary, #0f172a);transition:all .15s ease;line-height:1.5;white-space:nowrap}.engine-view-dropdown-item:hover{background:var(--bim-component-bg-hover, rgba(15, 23, 42, .04));color:var(--bim-primary, #2563eb)}.engine-view-dropdown-item:active{background:var(--bim-component-bg-active, rgba(15, 23, 42, .08))}.engine-view-dropdown-item:not(:last-child){border-bottom:1px solid var(--bim-panel-border, rgba(226, 232, 240, .6))}@keyframes dropdownIn{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}.bim-help-panel-overlay{position:fixed;inset:0;background:#0009;display:flex;justify-content:center;align-items:center;z-index:10000;visibility:hidden;opacity:0;transition:opacity .2s ease}.bim-help-panel-overlay.active{visibility:visible;opacity:1}.bim-help-panel-container{background:var(--bim-panel-bg);width:720px;max-width:92%;max-height:85vh;border-radius:10px;box-shadow:var(--bim-shadow-lg);display:flex;flex-direction:column;overflow:hidden;border:1px solid var(--bim-panel-border)}.bim-help-panel-close{position:absolute;right:16px;top:12px;width:32px;height:32px;display:flex;align-items:center;justify-content:center;font-size:22px;cursor:pointer;color:var(--bim-text-tertiary);background:transparent;border:none;line-height:1;z-index:10;transition:color .15s ease}.bim-help-panel-close:hover{color:var(--bim-text-primary)}.bim-help-panel-header{display:flex;justify-content:center;padding:16px 20px;gap:8px;border-bottom:1px solid var(--bim-divider);background:var(--bim-panel-header-bg);flex-shrink:0}.bim-help-panel-tab-btn{background:var(--bim-component-bg);border:1px solid var(--bim-border-default);padding:8px 28px;font-size:14px;font-weight:600;cursor:pointer;transition:all .15s ease;border-radius:5px;color:var(--bim-text-secondary)}.bim-help-panel-tab-btn:hover{border-color:var(--bim-border-strong);color:var(--bim-text-primary)}.bim-help-panel-tab-btn.active{border:2px solid var(--bim-text-primary);color:var(--bim-text-primary);background:var(--bim-component-bg)}.bim-help-panel-body{padding:20px 24px;overflow-y:auto;flex:1}.bim-help-panel-body::-webkit-scrollbar{width:5px}.bim-help-panel-body::-webkit-scrollbar-track{background:transparent}.bim-help-panel-body::-webkit-scrollbar-thumb{background:var(--bim-scrollbar-thumb);border-radius:3px}.bim-help-panel-tab-content{display:none;grid-template-columns:repeat(3,1fr);gap:12px}.bim-help-panel-tab-content.active{display:grid}.bim-help-panel-card{background:var(--bim-component-bg);border:1px solid var(--bim-border-subtle);border-radius:8px;padding:16px 14px;display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:110px;gap:10px}.bim-help-panel-card-span-2{grid-column:span 2}.bim-help-panel-card-title{font-size:13px;color:var(--bim-text-primary);font-weight:700;width:100%;text-align:left;border-left:3px solid var(--bim-primary);padding-left:8px}.bim-help-panel-control-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap;color:var(--bim-text-primary);font-size:13px}.bim-help-panel-kbd{background:var(--bim-bg-base);border:1px solid var(--bim-border-default);border-radius:4px;box-shadow:0 2px 0 var(--bim-border-subtle);color:var(--bim-text-primary);display:inline-flex;align-items:center;justify-content:center;font-size:12px;font-weight:700;padding:4px 10px;min-width:24px;height:26px;font-family:ui-monospace,SFMono-Regular,monospace}.bim-help-panel-wasd-group{display:flex;flex-direction:column;align-items:center;gap:4px}.bim-help-panel-kbd-row{display:flex;gap:4px}.bim-help-panel-rule-desc{font-size:12px;color:var(--bim-text-secondary);line-height:1.5;text-align:center}.bim-help-panel-bold{color:var(--bim-text-primary);font-weight:700}.bim-help-panel-mouse-box{width:22px;height:32px;border:2px solid var(--bim-text-primary);border-radius:8px;position:relative;background:var(--bim-bg-base);flex-shrink:0}.bim-help-panel-mouse-box:after{content:"";position:absolute;top:4px;left:50%;height:10px;border-right:2px solid var(--bim-text-primary);transform:translate(-50%)}.bim-help-panel-mouse-left{position:absolute;top:0;left:0;width:50%;height:55%;border-radius:6px 0 0;background:var(--bim-text-primary)}.bim-help-panel-mouse-right{position:absolute;top:0;right:0;width:50%;height:55%;border-radius:0 6px 0 0;background:var(--bim-text-primary)}.bim-help-panel-mouse-wheel{position:absolute;top:6px;left:50%;width:4px;height:8px;background:var(--bim-text-primary);border-radius:2px;transform:translate(-50%);z-index:2}.bim-help-panel-teleport-icon{width:28px;height:28px;border:2px solid var(--bim-text-primary);border-radius:50%;position:relative;display:flex;justify-content:center;align-items:center;flex-shrink:0}.bim-help-panel-teleport-icon:before,.bim-help-panel-teleport-icon:after{content:"";position:absolute;background:var(--bim-text-primary)}.bim-help-panel-teleport-icon:before{width:36px;height:2px}.bim-help-panel-teleport-icon:after{width:2px;height:36px}.bim-help-panel-teleport-inner{width:6px;height:6px;background:var(--bim-text-primary);border-radius:50%;z-index:2}.bim-help-panel-footer{display:flex;justify-content:center;gap:16px;padding:16px 24px 24px;border-top:1px solid var(--bim-divider);flex-shrink:0}.bim-help-panel-btn{padding:10px 48px;border-radius:6px;border:none;font-size:14px;cursor:pointer;font-weight:600;transition:all .15s ease}.bim-help-panel-btn-primary{background:var(--bim-primary);color:var(--bim-text-inverse)}.bim-help-panel-btn-primary:hover{background:var(--bim-primary-hover)}.bim-help-panel-btn-secondary{background:var(--bim-component-bg-hover);color:var(--bim-text-secondary);border:1px solid var(--bim-border-default)}.bim-help-panel-btn-secondary:hover{background:var(--bim-component-bg-active);color:var(--bim-text-primary)}@media(max-width:640px){.bim-help-panel-container{width:96%;max-height:90vh}.bim-help-panel-tab-content{grid-template-columns:1fr}.bim-help-panel-card-span-2{grid-column:span 1}.bim-help-panel-tab-btn{padding:8px 20px;font-size:13px}.bim-help-panel-btn{padding:10px 24px}}.engine-info-button{position:absolute;bottom:20px;left:10px;z-index:999;width:32px;height:32px;display:flex;align-items:center;justify-content:center;cursor:pointer;color:#fff;filter:drop-shadow(0 2px 4px rgba(0,0,0,.3));transition:filter .2s ease;background:none;border:none;padding:0}.engine-info-button:hover{filter:drop-shadow(0 3px 6px rgba(0,0,0,.5))}.engine-info-button svg{width:24px;height:24px}.originRotate{width:10px;height:10px;background-color:red}.versionText{position:absolute;right:10px;color:#86d9ff;z-index:1000;bottom:10px;font-size:10px;background:transparent;pointer-events:none}.originDiv{position:absolute;top:100px;left:100px;width:30px;height:30px;border-radius:50%;z-index:1000;pointer-events:none}.tagDiv{color:gray;background:#fffc;padding:5px;font-size:12px}.catchPoint{pointer-events:none;stroke:#08dfd7;fill:transparent;stroke-width:2}.catchLine{position:absolute;width:10px;height:10px;pointer-events:none;background-color:green}.catchPlane{position:absolute;width:10px;height:10px;pointer-events:none;background-color:#ff0}.bim-mobile-roam-controls{position:absolute;left:0;right:0;bottom:max(18px,env(safe-area-inset-bottom));z-index:1200;display:flex;align-items:flex-end;justify-content:space-between;padding:0 22px;pointer-events:none;user-select:none;-webkit-user-select:none;touch-action:none}.bim-mobile-roam-pad,.bim-mobile-roam-look-group{pointer-events:auto}.bim-mobile-roam-move-pad{width:116px;height:116px;border:1px solid rgba(255,255,255,.34);border-radius:50%;display:flex;align-items:center;justify-content:center;background:#14182073;box-shadow:0 4px 16px #0000003d inset,0 4px 14px #0003;touch-action:none}.bim-mobile-roam-button{width:44px;height:44px;border:1px solid rgba(255,255,255,.46);border-radius:8px;color:#fff;background:#14182094;box-shadow:0 4px 14px #00000038;font-size:15px;font-weight:600;line-height:1;touch-action:none}.bim-mobile-roam-button.is-active{background:#267effc7;border-color:#ffffffb8}.bim-mobile-roam-move-pad.is-active{border-color:#267effd6;background:#142c4a8a}.bim-mobile-roam-look-group{display:flex;align-items:center;gap:12px}.bim-mobile-roam-vertical-pad{display:flex;flex-direction:column;gap:10px}.bim-mobile-roam-look-pad{width:116px;height:116px;border:1px solid rgba(255,255,255,.34);border-radius:50%;display:flex;align-items:center;justify-content:center;background:#14182073;box-shadow:0 4px 16px #0000003d inset,0 4px 14px #0003;touch-action:none}.bim-mobile-roam-look-pad.is-active{border-color:#267effd6;background:#142c4a8a}.bim-mobile-roam-look-knob,.bim-mobile-roam-move-knob{width:46px;height:46px;border-radius:50%;background:#ffffffb8;box-shadow:0 2px 10px #00000042}@media(max-width:520px){.bim-mobile-roam-controls{padding:0 14px;bottom:max(14px,env(safe-area-inset-bottom))}.bim-mobile-roam-move-pad{width:96px;height:96px}.bim-mobile-roam-button{width:38px;height:38px;font-size:13px}.bim-mobile-roam-look-pad{width:96px;height:96px}.bim-mobile-roam-look-knob,.bim-mobile-roam-move-knob{width:38px;height:38px}}.ViewCube{position:absolute;width:120px;height:120px;top:0;right:0;z-index:999}.homeViewWrapper{position:absolute;cursor:pointer;pointer-events:auto;background-size:100% 100%;background-repeat:no-repeat;background-color:#fff0;color:#fff;top:10px;right:100;width:20px;height:20px;z-index:999;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.viewSettingWrapper{position:absolute;cursor:pointer;pointer-events:auto;background-size:100% 100%;background-repeat:no-repeat;font-weight:800;background-color:#fff0;color:#fff;top:30px;right:100;width:20px;height:20px;z-index:999;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.cameraToggleWrapper{position:absolute;cursor:pointer;pointer-events:auto;background-color:#ffffffe6;color:#333;font-size:26px;font-weight:700;display:none;align-items:center;justify-content:center;border-radius:4px;box-shadow:0 2px 4px #0003;transition:all .3s ease;top:70px;right:90px;width:44px;height:44px;z-index:999;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.cameraToggleWrapper.show{display:flex}.cameraToggleWrapper:hover{background-color:#fff;box-shadow:0 3px 6px #0000004d;transform:scale(1.1)}.screenshotWrapper{position:absolute;cursor:pointer;pointer-events:auto;background-color:#ffffffe6;color:#333;font-size:20px;display:none;align-items:center;justify-content:center;border-radius:4px;box-shadow:0 2px 4px #0003;transition:all .3s ease;top:120px;right:90px;width:44px;height:44px;z-index:999;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.screenshotWrapper.show{display:flex}.screenshotWrapper:hover{background-color:#fff;box-shadow:0 3px 6px #0000004d;transform:scale(1.1)}.fullscreenWrapper{position:absolute;cursor:pointer;pointer-events:auto;background-color:#ffffffe6;color:#333;font-size:26px;font-weight:700;display:none;align-items:center;justify-content:center;border-radius:4px;box-shadow:0 2px 4px #0003;transition:all .3s ease;top:170px;right:90px;width:44px;height:44px;z-index:999;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.fullscreenWrapper.show{display:flex}.fullscreenWrapper:hover{background-color:#fff;box-shadow:0 3px 6px #0000004d;transform:scale(1.1)}.measure-elevation{position:absolute;pointer-events:none}.measureSvg{position:absolute;width:1920px;height:1080px}.catch-point{position:absolute;width:10px;height:10px;background-color:red;border-radius:50%;pointer-events:none}.annotation-container{position:absolute;pointer-events:none;top:0;left:0}.measureLine{position:absolute;pointer-events:none;stroke:#009bea;fill:#009bea;filter:drop-shadow(0px 0px 2px rgba(0,0,0,.3))}.measureBack{cursor:pointer;pointer-events:auto;fill:#fff;rx:5;ry:5;filter:drop-shadow(0px 0px 3px rgba(0,0,0,.3));text-align:center}.measureLabel{position:absolute;fill:#fff;font-family:tahoma;font-size:14px;stroke:#009bea;font-weight:200;pointer-events:none;text-anchor:middle}.measurePointer{fill:#009bea}.Hight{stroke:#fff;font-weight:500;filter:drop-shadow(0px 0px 2px rgb(0,195,255))}.allow-select{pointer-events:auto}.disallow-select{pointer-events:none}.angle-annotation{position:absolute;pointer-events:auto}.measure-2d-selected.measureLine{stroke:#fff;fill:#fff;filter:drop-shadow(0 0 3px rgb(0,195,255))}.measure-2d-selected.measurePointer{fill:#fff;stroke:#00c3ff;stroke-width:2px;filter:drop-shadow(0 0 3px rgb(0,195,255))}.measure-2d-selected.measureBack{fill:#009bea;stroke:#fff;stroke-width:1px;filter:drop-shadow(0 0 4px rgb(0,195,255))}.measure-2d-selected.measureLabel{fill:#fff;stroke:none;font-weight:600}polygon.measure-2d-selected{fill:#00c3ff38}.markup-2d-layer{position:absolute;inset:0;pointer-events:none;z-index:30}.markup-2d-svg{position:absolute;inset:0;overflow:visible;pointer-events:none}.markup-2d-toolbar{position:absolute;top:8px;left:50%;transform:translate(-50%);display:none;align-items:center;gap:6px;padding:6px;background:#fff;border:1px solid #d9d9d9;border-radius:8px;box-shadow:0 4px 14px #00000024;pointer-events:auto;-webkit-user-select:none;user-select:none;z-index:1300}.markup-2d-toolbar button,.markup-2d-toolbar input{height:28px;border:1px solid #d9d9d9;border-radius:4px;background:#fff;color:#1f2937;font-size:12px}.markup-2d-toolbar button{width:28px;min-width:28px;padding:0;cursor:pointer;display:inline-flex;align-items:center;justify-content:center}.markup-2d-toolbar button:hover,.markup-2d-toolbar button.active{color:#1677ff;border-color:#1677ff;background:#eef6ff}.markup-2d-toolbar input[type=color]{width:34px;padding:2px}.markup-2d-toolbar input[type=number]{width:54px;padding:0 4px}.markup-2d-icon-button img{width:16px;height:16px;display:block;pointer-events:none}.markup-2d-divider{width:1px;height:22px;background:#e5e7eb}.markup-2d-shape{pointer-events:auto;cursor:pointer}.markup-2d-shape.selected{filter:drop-shadow(0 0 4px rgba(22,119,255,.9))}.MapController{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.engine-2d-container{position:relative;width:100%;height:100%;overflow:hidden}.engine-2d-canvas{display:block;width:100%;height:100%;outline:none}.engine-2d-version-text{position:absolute;right:10px;bottom:0;z-index:1000;color:#86d9ff;font-size:10px;background:transparent;pointer-events:none}.engine-2d-cad-cursor{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;overflow:hidden}.engine-2d-cad-cursor__h{position:absolute;left:0;width:100%;height:1px;background:var(--e2d-cursor, rgba(255, 255, 255, .85));transform:translateY(-50%)}.engine-2d-cad-cursor__v{position:absolute;top:0;width:1px;height:100%;background:var(--e2d-cursor, rgba(255, 255, 255, .85));transform:translate(-50%)}.engine-2d-cad-cursor__box{position:absolute;width:8px;height:8px;border:1px solid var(--e2d-cursor, rgba(255, 255, 255, .85));transform:translate(-50%,-50%)}.engine-2d-cad-cursor--short-crosshair .engine-2d-cad-cursor__h{width:72px;left:0;transform:translate(-50%,-50%)}.engine-2d-cad-cursor--short-crosshair .engine-2d-cad-cursor__v{height:72px;top:0;transform:translate(-50%,-50%)}.engine-2d-context-menu{position:absolute;z-index:9999;min-width:140px;background:var(--e2d-bg2, #252526);border:1px solid var(--e2d-border, rgba(255, 255, 255, .12));border-radius:4px;box-shadow:0 4px 16px var(--e2d-shadow, rgba(0, 0, 0, .5));padding:4px 0;display:none;-webkit-user-select:none;user-select:none}.engine-2d-context-menu--visible{display:block}.engine-2d-context-menu__item{padding:7px 16px;font-size:13px;color:var(--e2d-text2, #cccccc);cursor:pointer;white-space:nowrap;transition:background .1s,color .1s}.engine-2d-context-menu__item:hover{background:var(--e2d-bg-accent, #094771);color:var(--e2d-text-accent, #ffffff)}.engine-2d-context-menu__divider{height:1px;background:var(--e2d-border, rgba(255, 255, 255, .1));margin:4px 0}.engine-2d-stats{position:absolute;top:10px;left:10px;background:var(--e2d-float-bg, rgba(0, 0, 0, .7));color:var(--e2d-text, #e0e0e0);padding:8px 12px;border-radius:4px;font-family:monospace;font-size:12px;pointer-events:none;-webkit-user-select:none;user-select:none}.engine-2d-stats div{margin:2px 0}.engine-2d-loading{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);background:var(--e2d-float-bg, rgba(0, 0, 0, .8));color:var(--e2d-text, #e0e0e0);padding:20px 40px;border-radius:8px;font-size:16px;text-align:center}.engine-2d-loading-spinner{border:3px solid var(--e2d-border, rgba(255, 255, 255, .3));border-top:3px solid var(--e2d-accent, #4fc3f7);border-radius:50%;width:40px;height:40px;animation:engine-2d-spin 1s linear infinite;margin:0 auto 10px}@keyframes engine-2d-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.engine-2d-error{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);background:#d32f2feb;color:#fff;padding:20px 40px;border-radius:8px;font-size:14px;max-width:80%;text-align:center}.engine-2d-controls-hint{position:absolute;bottom:10px;left:10px;background:var(--e2d-float-bg, rgba(0, 0, 0, .6));color:var(--e2d-text, #e0e0e0);border:1px solid var(--e2d-float-border, rgba(255, 255, 255, .08));padding:8px 12px;border-radius:4px;font-size:12px;pointer-events:none;-webkit-user-select:none;user-select:none}.engine-2d-controls-hint kbd{background:var(--e2d-icon-bg, rgba(255, 255, 255, .2));color:var(--e2d-text, #e0e0e0);padding:2px 6px;border-radius:3px;font-family:monospace}.engine-2d-workspace-tabs{position:absolute;left:12px;bottom:10px;z-index:40;display:flex;align-items:center;max-width:calc(100% - 24px);overflow-x:auto;background:var(--e2d-bg2, rgba(28, 33, 40, .92));border:1px solid var(--e2d-border, rgba(255, 255, 255, .14));border-radius:4px;box-shadow:0 4px 14px var(--e2d-shadow, rgba(0, 0, 0, .28))}.engine-2d-workspace-tabs__item{flex:0 0 auto;max-width:180px;height:28px;padding:0 12px;border:0;border-right:1px solid var(--e2d-border2, rgba(255, 255, 255, .1));background:transparent;color:var(--e2d-text2, #d7dde4);font-size:12px;line-height:28px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer}.engine-2d-workspace-tabs__item:last-child{border-right:0}.engine-2d-workspace-tabs__item:hover:not(:disabled){background:var(--e2d-bg-hover, rgba(79, 195, 247, .12));color:var(--e2d-text-accent, #ffffff)}.engine-2d-workspace-tabs__item--active{background:var(--e2d-accent, #2f80ed);color:#fff;cursor:default}.engine-2d-workspace-tabs__item:disabled{opacity:.9}.engine-2d-search{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;z-index:9998;display:none}.engine-2d-search--visible{display:block}.engine-2d-search__box{position:absolute;top:14%;left:50%;transform:translate(-50%);width:480px;max-width:calc(100% - 40px);background:var(--e2d-bg, #1e1f22);border:1px solid var(--e2d-border, rgba(255, 255, 255, .14));border-radius:10px;box-shadow:0 8px 40px var(--e2d-shadow-lg, rgba(0, 0, 0, .65)),0 2px 8px var(--e2d-shadow, rgba(0, 0, 0, .4));overflow:hidden;pointer-events:auto;animation:engine-2d-search-in .18s cubic-bezier(.34,1.2,.64,1)}@keyframes engine-2d-search-in{0%{opacity:0;transform:translate(-50%) translateY(-8px) scale(.97)}to{opacity:1;transform:translate(-50%) translateY(0) scale(1)}}.engine-2d-search__input-row{display:flex;align-items:center;padding:0 12px;gap:8px;height:48px}.engine-2d-search__icon{flex-shrink:0;color:var(--e2d-icon, rgba(255, 255, 255, .4));display:flex;align-items:center}.engine-2d-search__input{flex:1;background:transparent;border:none;outline:none;color:var(--e2d-text, #e0e0e0);font-size:14px;line-height:1.4;caret-color:var(--e2d-accent, #4fc3f7)}.engine-2d-search__input::placeholder{color:var(--e2d-text3, rgba(255, 255, 255, .25))}.engine-2d-search__clear{flex-shrink:0;background:var(--e2d-icon-bg, rgba(255, 255, 255, .08));border:none;border-radius:4px;color:var(--e2d-icon, rgba(255, 255, 255, .5));cursor:pointer;display:flex;align-items:center;justify-content:center;width:22px;height:22px;padding:0;opacity:0;pointer-events:none;transition:opacity .15s,background .15s,color .15s}.engine-2d-search__clear:hover{background:var(--e2d-icon-bg-hover, rgba(255, 255, 255, .16));color:var(--e2d-close-hover, #ffffff)}.engine-2d-search__divider{height:1px;background:var(--e2d-border2, rgba(255, 255, 255, .08));display:none}.engine-2d-search__status{padding:6px 16px;font-size:11px;color:var(--e2d-text3, rgba(255, 255, 255, .35));display:none;-webkit-user-select:none;user-select:none}.engine-2d-search__list{list-style:none;margin:0;padding:4px 0;max-height:320px;overflow-y:auto;display:none;scrollbar-width:thin;scrollbar-color:var(--e2d-scrollbar, rgba(255, 255, 255, .15)) transparent}.engine-2d-search__list::-webkit-scrollbar{width:4px}.engine-2d-search__list::-webkit-scrollbar-track{background:transparent}.engine-2d-search__list::-webkit-scrollbar-thumb{background:var(--e2d-scrollbar, rgba(255, 255, 255, .15));border-radius:2px}.engine-2d-search__item{display:flex;align-items:center;gap:8px;padding:8px 14px;cursor:pointer;transition:background .1s;min-height:38px;flex-wrap:nowrap}.engine-2d-search__item:hover,.engine-2d-search__item--active{background:var(--e2d-bg-hover, rgba(79, 195, 247, .08))}.engine-2d-search__item-badge{flex-shrink:0;font-size:10px;font-weight:500;padding:2px 6px;border-radius:3px;letter-spacing:.03em;white-space:nowrap;color:var(--e2d-accent, #4fc3f7);background:#4fc3f71f}.engine-2d-search__item-name{flex:1;font-size:13px;color:var(--e2d-text, #e0e0e0);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.engine-2d-search__item-layer{flex-shrink:0;font-size:11px;color:var(--e2d-text3, rgba(255, 255, 255, .3));white-space:nowrap;max-width:100px;overflow:hidden;text-overflow:ellipsis}.engine-2d-search__item-desc{flex-shrink:0;font-size:11px;color:var(--e2d-text4, rgba(255, 255, 255, .25));white-space:nowrap;max-width:120px;overflow:hidden;text-overflow:ellipsis}.engine-2d-search__mark{background:transparent;color:var(--e2d-accent, #4fc3f7);font-weight:600}.engine-2d-mouse-coord{position:absolute;bottom:10px;left:50%;transform:translate(-50%);display:flex;align-items:center;gap:12px;background:var(--e2d-float-bg, rgba(0, 0, 0, .65));color:var(--e2d-text, #e0e0e0);padding:5px 14px;border-radius:4px;font-family:monospace;font-size:12px;pointer-events:none;-webkit-user-select:none;user-select:none;border:1px solid var(--e2d-float-border, rgba(255, 255, 255, .08))}.engine-2d-mouse-coord__label{color:var(--e2d-coord-label, rgba(255, 255, 255, .45));font-size:11px;letter-spacing:.05em}.engine-2d-mouse-coord__value{min-width:90px;color:var(--e2d-coord-value, #76c8ff)}.panorama-annotation-container{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;z-index:1000;overflow:hidden}.panorama-annotation{position:absolute;pointer-events:auto;cursor:pointer;transform:translate(-50%,-50%);transition:opacity .2s ease,transform .2s ease;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.panorama-annotation:hover{z-index:1001;transform:translate(-50%,-50%) scale(1.1)}.panorama-annotation-icon{width:40px;height:40px}.panorama-annotation-icon img{width:100%;height:100%;object-fit:contain;display:block;filter:drop-shadow(0 2px 4px rgba(0,0,0,.3))}.panorama-annotation-text{max-width:200px;text-align:center;line-height:1.4}.panorama-annotation-link{transition:background-color .2s ease,transform .2s ease}.panorama-annotation-link:hover{z-index:1002}.panorama-annotation-link img{display:block;flex-shrink:0}.panorama-annotation.hidden{display:none!important}@keyframes pulse{0%,to{opacity:1}50%{opacity:.5}}.panorama-annotation.loading{animation:pulse 1.5s ease-in-out infinite}@media(max-width:768px){.panorama-annotation-icon{width:32px;height:32px}.panorama-annotation-text,.panorama-annotation-link{font-size:12px!important;padding:6px 10px!important}}.cesium-svgPath-svg{position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden}.cesium-button{display:inline-block;position:relative;background:#303336;border:1px solid #444;color:#edffff;fill:#edffff;border-radius:4px;padding:5px 12px;margin:2px 3px;cursor:pointer;overflow:hidden;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.cesium-button:focus{color:#fff;fill:#fff;border-color:#ea4;outline:none}.cesium-button:hover{color:#fff;fill:#fff;background:#48b;border-color:#aef;box-shadow:0 0 8px #fff}.cesium-button:active{color:#000;fill:#000;background:#adf;border-color:#fff;box-shadow:0 0 8px #fff}.cesium-button:disabled,.cesium-button-disabled,.cesium-button-disabled:focus,.cesium-button-disabled:hover,.cesium-button-disabled:active{background:#303336;border-color:#444;color:#646464;fill:#646464;box-shadow:none;cursor:default}.cesium-button option{background-color:#000;color:#eee}.cesium-button option:disabled{color:#777}.cesium-button input,.cesium-button label{cursor:pointer}.cesium-button input{vertical-align:sub}.cesium-toolbar-button{box-sizing:border-box;width:32px;height:32px;border-radius:14%;padding:0;vertical-align:middle;z-index:0}.cesium-performanceDisplay-defaultContainer{position:absolute;top:50px;right:10px;text-align:right}.cesium-performanceDisplay{background-color:#282828b3;padding:7px;border-radius:5px;border:1px solid #444;font:700 12px sans-serif}.cesium-performanceDisplay-fps{color:#e52}.cesium-performanceDisplay-throttled{color:#a42}.cesium-performanceDisplay-ms{color:#de3}.cesium-animation-theme{visibility:hidden;display:block;position:absolute;z-index:-100}.cesium-animation-themeNormal{color:#222}.cesium-animation-themeHover{color:#4488b0}.cesium-animation-themeSelect{color:#242}.cesium-animation-themeDisabled{color:#333}.cesium-animation-themeKnob{color:#222}.cesium-animation-themePointer{color:#2e2}.cesium-animation-themeSwoosh{color:#8ac}.cesium-animation-themeSwooshHover{color:#aef}.cesium-animation-svgText{fill:#edffff;font-family:Sans-Serif;font-size:15px;text-anchor:middle}.cesium-animation-blank{fill:#000;fill-opacity:.01;stroke:none}.cesium-animation-rectButton{cursor:pointer;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.cesium-animation-rectButton .cesium-animation-buttonGlow{fill:#fff;stroke:none;display:none}.cesium-animation-rectButton:hover .cesium-animation-buttonGlow{display:block}.cesium-animation-rectButton .cesium-animation-buttonPath{fill:#edffff}.cesium-animation-rectButton .cesium-animation-buttonMain{stroke:#444;stroke-width:1.2}.cesium-animation-rectButton:hover .cesium-animation-buttonMain{stroke:#aef}.cesium-animation-rectButton:active .cesium-animation-buttonMain{fill:#abd6ff}.cesium-animation-buttonDisabled{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.cesium-animation-buttonDisabled .cesium-animation-buttonMain{stroke:#555}.cesium-animation-buttonDisabled .cesium-animation-buttonPath{fill:#818181}.cesium-animation-buttonDisabled .cesium-animation-buttonGlow{display:none}.cesium-animation-buttonToggled .cesium-animation-buttonGlow{display:block;fill:#2e2}.cesium-animation-buttonToggled .cesium-animation-buttonMain{stroke:#2e2}.cesium-animation-buttonToggled:hover .cesium-animation-buttonGlow{fill:#fff}.cesium-animation-buttonToggled:hover .cesium-animation-buttonMain{stroke:#2e2}.cesium-animation-shuttleRingG,.cesium-animation-shuttleRingPointer,.cesium-animation-shuttleRingPausePointer{cursor:pointer}.cesium-animation-shuttleRingBack{fill:#181818;fill-opacity:.8;stroke:#333;stroke-width:1.2}.cesium-animation-shuttleRingSwoosh line{stroke:#8ac;stroke-width:3;stroke-opacity:.2;stroke-linecap:round}.cesium-animation-knobOuter{cursor:pointer;stroke:#444;stroke-width:1.2}.cesium-animation-knobInner{cursor:pointer}.cesium-baseLayerPicker-selected{position:absolute;top:0;left:0;width:100%;height:100%;border:none}.cesium-baseLayerPicker-dropDown{display:block;position:absolute;box-sizing:content-box;top:auto;right:0;width:320px;max-height:500px;margin-top:5px;background-color:#262626bf;border:1px solid #444;padding:6px;overflow:auto;border-radius:10px;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;transform:translateY(-20%);visibility:hidden;opacity:0;transition:visibility 0s .2s,opacity .2s ease-in,transform .2s ease-in}.cesium-baseLayerPicker-dropDown-visible{transform:translate(0);visibility:visible;opacity:1;transition:opacity .2s ease-out,transform .2s ease-out}.cesium-baseLayerPicker-sectionTitle{display:block;font-family:sans-serif;font-size:16pt;text-align:left;color:#edffff;margin-bottom:4px}.cesium-baseLayerPicker-choices{margin-bottom:5px}.cesium-baseLayerPicker-categoryTitle{color:#edffff;font-size:11pt}.cesium-baseLayerPicker-choices{display:block;border:1px solid #888;border-radius:5px;padding:5px 0}.cesium-baseLayerPicker-item{display:inline-block;vertical-align:top;margin:2px 5px;width:64px;text-align:center;cursor:pointer}.cesium-baseLayerPicker-itemLabel{display:block;font-family:sans-serif;font-size:8pt;text-align:center;vertical-align:middle;color:#edffff;cursor:pointer;word-wrap:break-word}.cesium-baseLayerPicker-item:hover .cesium-baseLayerPicker-itemLabel,.cesium-baseLayerPicker-item:focus .cesium-baseLayerPicker-itemLabel{text-decoration:underline}.cesium-baseLayerPicker-itemIcon{display:inline-block;position:relative;width:inherit;height:auto;background-size:100% 100%;border:solid 1px #444;border-radius:9px;color:#edffff;margin:0;padding:0;cursor:pointer;box-sizing:border-box}.cesium-baseLayerPicker-item:hover .cesium-baseLayerPicker-itemIcon{border-color:#fff;box-shadow:0 0 8px #fff,0 0 8px #fff}.cesium-baseLayerPicker-selectedItem .cesium-baseLayerPicker-itemLabel{color:#bdecf8}.cesium-baseLayerPicker-selectedItem .cesium-baseLayerPicker-itemIcon{border:double 4px rgb(189,236,248)}.cesium-widget{font-family:sans-serif;font-size:16px;overflow:hidden;display:block;position:relative;top:0;left:0;width:100%;height:100%}.cesium-widget,.cesium-widget canvas{width:100%;height:100%;touch-action:none}.cesium-widget-credits{display:block;position:absolute;bottom:0;left:0;color:#fff;font-size:10px;text-shadow:0px 0px 2px #000000;padding-right:5px}.cesium-widget-errorPanel{position:absolute;inset:0;text-align:center;background:#000000b3;z-index:99999}.cesium-widget-errorPanel:before{display:inline-block;vertical-align:middle;height:100%;content:""}.cesium-widget-errorPanel-content{width:75%;max-width:500px;display:inline-block;text-align:left;vertical-align:middle;border:1px solid #510c00;border-radius:7px;background-color:#f0d9d5;font-size:14px;color:#510c00}.cesium-widget-errorPanel-content.expanded{max-width:75%}.cesium-widget-errorPanel-header{font-size:18px;font-family:Open Sans,Verdana,Geneva,sans-serif;background:#d69d93;border-bottom:2px solid #510c00;border-radius:3px 3px 0 0;padding:15px}.cesium-widget-errorPanel-scroll{overflow:auto;font-family:Open Sans,Verdana,Geneva,sans-serif;white-space:pre-wrap;padding:0 15px;margin:10px 0 20px}.cesium-widget-errorPanel-buttonPanel{padding:0 15px;margin:10px 0 20px;text-align:right}.cesium-widget-errorPanel-buttonPanel button{border-color:#510c00;background:#d69d93;color:#202020;margin:0}.cesium-widget-errorPanel-buttonPanel button:focus{border-color:#510c00;background:#f0d9d5;color:#510c00}.cesium-widget-errorPanel-buttonPanel button:hover{border-color:#510c00;background:#f0d9d5;color:#510c00}.cesium-widget-errorPanel-buttonPanel button:active{border-color:#510c00;background:#b17b72;color:#510c00}.cesium-widget-errorPanel-more-details{text-decoration:underline;cursor:pointer}.cesium-widget-errorPanel-more-details:hover{color:#2b0700}.cesium-cesiumInspector{border-radius:5px;transition:width ease-in-out .25s;background:#303336cc;border:1px solid #444;color:#edffff;display:inline-block;position:relative;padding:4px 12px;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden}.cesium-cesiumInspector-button{text-align:center;font-size:11pt}.cesium-cesiumInspector-visible .cesium-cesiumInspector-button{border-bottom:1px solid #aaa;padding-bottom:3px}.cesium-cesiumInspector input:enabled,.cesium-cesiumInspector-button{cursor:pointer}.cesium-cesiumInspector-visible{width:185px;height:auto}.cesium-cesiumInspector-hidden{width:122px;height:17px}.cesium-cesiumInspector-sectionContent{max-height:600px}.cesium-cesiumInspector-section-collapsed .cesium-cesiumInspector-sectionContent{max-height:0;padding:0!important;overflow:hidden}.cesium-cesiumInspector-dropDown{margin:5px 0;font-family:sans-serif;font-size:10pt;width:185px}.cesium-cesiumInspector-frustumStatistics{padding:5px;background-color:#505050bf}.cesium-cesiumInspector-pickButton{background-color:#0000004d;border:1px solid #444;color:#edffff;border-radius:5px;padding:3px 7px;cursor:pointer;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;margin:0 auto}.cesium-cesiumInspector-pickButton:focus{outline:none}.cesium-cesiumInspector-pickButton:active,.cesium-cesiumInspector-pickButtonHighlight{color:#000;background:#adf;border-color:#fff;box-shadow:0 0 8px #fff}.cesium-cesiumInspector-center{text-align:center}.cesium-cesiumInspector-sectionHeader{font-weight:700;font-size:10pt;margin:0;cursor:pointer}.cesium-cesiumInspector-pickSection{border:1px solid #aaa;border-radius:5px;padding:3px;margin-bottom:5px}.cesium-cesiumInspector-sectionContent{margin-bottom:10px;transition:max-height .25s}.cesium-cesiumInspector-tileText{padding-bottom:10px;border-bottom:1px solid #aaa}.cesium-cesiumInspector-relativeText{padding-top:10px}.cesium-cesiumInspector-sectionHeader:before{margin-right:5px;content:"-";width:1ch;display:inline-block}.cesium-cesiumInspector-section-collapsed .cesium-cesiumInspector-sectionHeader:before{content:"+"}ul.cesium-cesiumInspector-statistics{margin:0;padding-top:3px;padding-bottom:3px}ul.cesium-cesiumInspector-statistics+ul.cesium-cesiumInspector-statistics{border-top:1px solid #aaa}.cesium-cesiumInspector-slider{margin-top:5px}.cesium-cesiumInspector-slider input[type=number]{text-align:left;background-color:#222;outline:none;border:1px solid #444;color:#edffff;width:100px;border-radius:3px;padding:1px;margin-left:10px;cursor:auto}.cesium-cesiumInspector-slider input[type=number]::-webkit-outer-spin-button,.cesium-cesiumInspector-slider input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.cesium-cesiumInspector-slider input[type=range]{margin-left:5px;vertical-align:middle}.cesium-cesiumInspector-hide .cesium-cesiumInspector-styleEditor{display:none}.cesium-cesiumInspector-styleEditor{padding:10px;border-radius:5px;background:#303336cc;border:1px solid #444}.cesium-cesiumInspector-styleEditor textarea{width:100%;height:300px;background:transparent;color:#edffff;border:none;padding:0;white-space:pre;overflow-wrap:normal;overflow-x:auto}.cesium-3DTilesInspector{width:300px;pointer-events:all}.cesium-3DTilesInspector-statistics{font-size:11px}.cesium-3DTilesInspector-disabledElementsInfo{margin:5px 0 0;padding:0 0 0 20px;color:#eed202}.cesium-3DTilesInspector div,.cesium-3DTilesInspector input[type=range]{width:100%;box-sizing:border-box}.cesium-cesiumInspector-error{color:#ff9e9e;overflow:auto}.cesium-3DTilesInspector .cesium-cesiumInspector-section{margin-top:3px}.cesium-3DTilesInspector .cesium-cesiumInspector-sectionHeader+.cesium-cesiumInspector-show{border-top:1px solid white}input.cesium-cesiumInspector-url{overflow:hidden;white-space:nowrap;overflow-x:scroll;background-color:transparent;color:#fff;outline:none;border:none;height:1em;width:100%}.cesium-cesiumInspector .field-group{display:table}.cesium-cesiumInspector .field-group>label{display:table-cell;font-weight:700}.cesium-cesiumInspector .field-group>.field{display:table-cell;width:100%}.cesium-VoxelInspector{width:300px;pointer-events:all}.cesium-VoxelInspector div,.cesium-VoxelInspector input[type=range]{width:100%;box-sizing:border-box}.cesium-VoxelInspector .cesium-cesiumInspector-section{margin-top:3px}.cesium-VoxelInspector .cesium-cesiumInspector-sectionHeader+.cesium-cesiumInspector-show{border-top:1px solid white}.cesium-button.cesium-fullscreenButton,.cesium-button.cesium-vrButton{display:block;width:100%;height:100%;margin:0;border-radius:0}.cesium-viewer-geocoderContainer .cesium-geocoder-input{border:solid 1px #444;background-color:#282828b3;color:#fff;display:inline-block;vertical-align:middle;width:0;height:32px;margin:0;padding:0 32px 0 0;border-radius:0;box-sizing:border-box;transition:width ease-in-out .25s,background-color .2s ease-in-out;-webkit-appearance:none}.cesium-viewer-geocoderContainer:hover .cesium-geocoder-input{border-color:#aef;box-shadow:0 0 8px #fff}.cesium-viewer-geocoderContainer .cesium-geocoder-input:focus{border-color:#ea4;background-color:#0f0f0fe6;box-shadow:none;outline:none}.cesium-viewer-geocoderContainer:hover .cesium-geocoder-input,.cesium-viewer-geocoderContainer .cesium-geocoder-input:focus,.cesium-viewer-geocoderContainer .cesium-geocoder-input-wide{padding-left:4px;width:250px}.cesium-viewer-geocoderContainer .search-results{position:absolute;background-color:#000;color:#eee;overflow-y:auto;opacity:.8;width:100%}.cesium-viewer-geocoderContainer .search-results ul{list-style-type:none;margin:0;padding:0}.cesium-viewer-geocoderContainer .search-results ul li{font-size:14px;padding:3px 10px}.cesium-viewer-geocoderContainer .search-results ul li:hover{cursor:pointer}.cesium-viewer-geocoderContainer .search-results ul li.active{background:#48b}.cesium-geocoder-searchButton{background-color:#303336;display:inline-block;position:absolute;cursor:pointer;width:32px;top:1px;right:1px;height:30px;vertical-align:middle;fill:#edffff}.cesium-geocoder-searchButton:hover{background-color:#48b}.cesium-infoBox{display:block;position:absolute;top:50px;right:0;width:40%;max-width:480px;background:#262626f2;color:#edffff;border:1px solid #444;border-right:none;border-top-left-radius:7px;border-bottom-left-radius:7px;box-shadow:0 0 10px 1px #000;transform:translate(100%);visibility:hidden;opacity:0;transition:visibility 0s .2s,opacity .2s ease-in,transform .2s ease-in}.cesium-infoBox-visible{transform:translate(0);visibility:visible;opacity:1;transition:opacity .2s ease-out,transform .2s ease-out}.cesium-infoBox-title{display:block;height:20px;padding:5px 30px 5px 25px;background:#545454;border-top-left-radius:7px;text-align:center;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;box-sizing:content-box}.cesium-infoBox-bodyless .cesium-infoBox-title{border-bottom-left-radius:7px}button.cesium-infoBox-camera{display:block;position:absolute;top:4px;left:4px;width:22px;height:22px;background:transparent;border-color:transparent;border-radius:3px;padding:0 5px;margin:0}button.cesium-infoBox-close{display:block;position:absolute;top:5px;right:5px;height:20px;background:transparent;border:none;border-radius:2px;font-weight:700;font-size:16px;padding:0 5px;margin:0;color:#edffff}button.cesium-infoBox-close:focus{background:#ee880070;outline:none}button.cesium-infoBox-close:hover{background:#888;color:#000}button.cesium-infoBox-close:active{background:#a00;color:#000}.cesium-infoBox-bodyless .cesium-infoBox-iframe{display:none}.cesium-infoBox-iframe{border:none;width:100%;width:calc(100% - 2px)}span.cesium-sceneModePicker-wrapper{display:inline-block;position:relative;margin:0 3px}.cesium-sceneModePicker-visible{visibility:visible;opacity:1;transition:opacity .25s linear}.cesium-sceneModePicker-hidden{visibility:hidden;opacity:0;transition:visibility 0s .25s,opacity .25s linear}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-none{display:none}.cesium-sceneModePicker-slide-svg{transition:left 2s;top:0;left:0}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-dropDown-icon{box-sizing:border-box;padding:0;margin:3px 0}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button3D,.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-buttonColumbusView,.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button2D{margin:0 0 3px}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button3D .cesium-sceneModePicker-icon2D{left:100%}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button3D .cesium-sceneModePicker-iconColumbusView{left:200%}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-buttonColumbusView .cesium-sceneModePicker-icon3D{left:-200%}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-buttonColumbusView .cesium-sceneModePicker-icon2D,.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button2D .cesium-sceneModePicker-icon3D{left:-100%}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button2D .cesium-sceneModePicker-iconColumbusView{left:100%}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-selected{border-color:#2e2;box-shadow:0 0 8px #fff,0 0 8px #fff}span.cesium-projectionPicker-wrapper{display:inline-block;position:relative;margin:0 3px}.cesium-projectionPicker-visible{visibility:visible;opacity:1;transition:opacity .25s linear}.cesium-projectionPicker-hidden{visibility:hidden;opacity:0;transition:visibility 0s .25s,opacity .25s linear}.cesium-projectionPicker-wrapper .cesium-projectionPicker-none{display:none}.cesium-projectionPicker-wrapper .cesium-projectionPicker-dropDown-icon{box-sizing:border-box;padding:0;margin:3px 0}.cesium-projectionPicker-wrapper .cesium-projectionPicker-buttonPerspective,.cesium-projectionPicker-wrapper .cesium-projectionPicker-buttonOrthographic{margin:0 0 3px}.cesium-projectionPicker-wrapper .cesium-projectionPicker-buttonPerspective .cesium-projectionPicker-iconOrthographic{left:100%}.cesium-projectionPicker-wrapper .cesium-projectionPicker-buttonOrthographic .cesium-projectionPicker-iconPerspective{left:-100%}.cesium-projectionPicker-wrapper .cesium-projectionPicker-selected{border-color:#2e2;box-shadow:0 0 8px #fff,0 0 8px #fff}.cesium-performance-watchdog-message-area{position:relative;background-color:#ff0;color:#000;padding:10px}.cesium-performance-watchdog-message{margin-right:30px}.cesium-performance-watchdog-message-dismiss{position:absolute;right:0;margin:0 10px 0 0}.cesium-navigationHelpButton-wrapper{position:relative;display:inline-block}.cesium-navigation-help{visibility:hidden;position:absolute;top:38px;right:2px;width:250px;border-radius:10px;transform:scale(.01);transform-origin:234px -10px;transition:visibility 0s .25s,transform .25s ease-in}.cesium-navigation-help-visible{visibility:visible;transform:scale(1);transition:transform .25s ease-out}.cesium-navigation-help-instructions{border:1px solid #444;background-color:#262626bf;padding-bottom:5px;border-radius:0 0 10px 10px}.cesium-click-navigation-help{display:none}.cesium-touch-navigation-help{display:none;padding-top:5px}.cesium-click-navigation-help-visible,.cesium-touch-navigation-help-visible{display:block}.cesium-navigation-help-pan{color:#6cf;font-weight:700}.cesium-navigation-help-zoom{color:#65fd00;font-weight:700}.cesium-navigation-help-rotate{color:#ffd800;font-weight:700}.cesium-navigation-help-tilt{color:#d800d8;font-weight:700}.cesium-navigation-help-details{color:#fff}.cesium-navigation-button{color:#fff;background-color:transparent;border-bottom:none;border-top:1px solid #444;border-right:1px solid #444;margin:0;width:50%;cursor:pointer}.cesium-navigation-button-icon{vertical-align:middle;padding:5px 1px}.cesium-navigation-button:focus{outline:none}.cesium-navigation-button-left{border-radius:10px 0 0;border-left:1px solid #444}.cesium-navigation-button-right{border-radius:0 10px 0 0;border-left:none}.cesium-navigation-button-selected{background-color:#262626bf}.cesium-navigation-button-unselected{background-color:#000000bf}.cesium-navigation-button-unselected:hover{background-color:#4c4c4cbf}.cesium-selection-wrapper{position:absolute;width:160px;height:160px;pointer-events:none;visibility:hidden;opacity:0;transition:visibility 0s .2s,opacity .2s ease-in}.cesium-selection-wrapper-visible{visibility:visible;opacity:1;transition:opacity .2s ease-out}.cesium-selection-wrapper svg{fill:#2e2;stroke:#000;stroke-width:1.1px}.cesium-timeline-main{position:relative;left:0;bottom:0;overflow:hidden;border:solid 1px #888;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.cesium-timeline-trackContainer{width:100%;overflow:auto;border-top:solid 1px #888;position:relative;top:0;left:0}.cesium-timeline-tracks{position:absolute;top:0;left:0;width:100%}.cesium-timeline-needle{position:absolute;left:0;top:1.7em;bottom:0;width:1px;background:red}.cesium-timeline-bar{position:relative;left:0;top:0;overflow:hidden;cursor:pointer;width:100%;height:1.7em;background:linear-gradient(to bottom,#747577cc,#3a4452cc 11%,#2e3238cc 46%,#353535cc 81% 100%)}.cesium-timeline-ruler{visibility:hidden;white-space:nowrap;font-size:80%;z-index:-200}.cesium-timeline-highlight{position:absolute;bottom:0;left:0;background:#08f}.cesium-timeline-ticLabel{position:absolute;top:0;left:0;white-space:nowrap;font-size:80%;color:#eee}.cesium-timeline-ticMain{position:absolute;bottom:0;left:0;width:1px;height:50%;background:#eee}.cesium-timeline-ticSub{position:absolute;bottom:0;left:0;width:1px;height:33%;background:#aaa}.cesium-timeline-ticTiny{position:absolute;bottom:0;left:0;width:1px;height:25%;background:#888}.cesium-timeline-icon16{display:block;position:absolute;width:16px;height:16px;background-image:url(data:text/plain;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAQCAYAAAB3AH1ZAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sIDBITKIVzLEMAAAKNSURBVEjHxdXNSxRhHAfw7zzrqhuoWJnSkrippUVSEKsHI9BTUYdAJA/RoYMREV26rAdn6tAfUARi16hQqkOBQRgUEYFWEC3OwczMjdZd92VmdWfmeelgTjO7q7gb0VzmmZnn85vvPPPMM8B/3qTcE2PPpuTZKB1eWuUQACgXYACYwVFbCTTVeZXB/i55o4LFelcAZfStYD4vpAoPGAGo4GBcQEgSOAUMQyAezwK6iQfDPXnhS/FkHZ+/8VLMWxxqWkfH3gbMRNOYi2roavbja0zHQmoFPYf8ED4Ko4aivm9MOG/u9I8mwrafeK7a/tVrNc/bARYN5noadeq7q0342vXw9CIMU6BmW8rVP9cPBPe52uu+v3O/y9sB4gkTWs6Qsk0mj5ExXMelejvA8WafYmkmGPHanTijdtvif8rx5RiCjdWKs2Cp3jWRDl96KhrbqlBeJqBOLyLQXg0IgbkZDS0dO8EZxZfPSTA9jvDDK3mT0OmP1FXh3XwEEAKdTX5MRWLgjCK4pwH3xt/YnjgLHAv4lHTCAKMMu/wV+KZGob6PoKyMQ0+sgBpZVJZn0NterxQaVqef/DRn+/EXYds/mZx2eVeAW9d65dhCEsaKCb7K8HH0gqTevyh9GDkn0VULRiaLzJKGBu9swfdaiie5RVo9ESURN8E8BE0n7ggACJy8KzghSCzp6DmwWxkaCm24EBXr8wI8Hrkq06QBiRC0t24HALS11IBTCyJl4vb1AXmzpbVYTwoVOXN0h7L8Mwtm8bXPybIQ/5FCX3dA2cr6XowvGCA02CvztAnz9+JiZk1AMxG6fEreSoBiPNmoyNnuWiWVzAIAtISO08E6pZi/3N96AIDn4E3h3P8L/wshP+txtEs4JAAAAABJRU5ErkJggg==);background-repeat:no-repeat}.cesium-viewer{font-family:sans-serif;font-size:16px;overflow:hidden;display:block;position:relative;top:0;left:0;width:100%;height:100%}.cesium-viewer-cesiumWidgetContainer{width:100%;height:100%}.cesium-viewer-bottom{display:block;position:absolute;bottom:0;left:0;padding-right:5px}.cesium-viewer .cesium-widget-credits{display:inline;position:static;bottom:auto;left:auto;padding-right:0;color:#fff;font-size:10px;text-shadow:0 0 2px #000000}.cesium-viewer-timelineContainer{position:absolute;bottom:0;left:169px;right:29px;height:27px;padding:0;margin:0;overflow:hidden;font-size:14px}.cesium-viewer-animationContainer{position:absolute;bottom:0;left:0;padding:0;width:169px;height:112px}.cesium-viewer-fullscreenContainer,.cesium-viewer-vrContainer{position:absolute;bottom:0;right:0;padding:0;width:29px;height:29px;overflow:hidden}.cesium-viewer-toolbar{display:block;position:absolute;top:5px;right:5px}.cesium-viewer-cesiumInspectorContainer{display:block;position:absolute;top:50px;right:10px}.cesium-viewer-geocoderContainer{position:relative;display:inline-block;margin:0 3px}.cesium-viewer-cesium3DTilesInspectorContainer,.cesium-viewer-voxelInspectorContainer{display:block;position:absolute;top:50px;right:10px;max-height:calc(100% - 120px);box-sizing:border-box;overflow-y:auto;overflow-x:hidden}.cesium-viewer-i3s-explorer ul{list-style-type:none}.cesium-viewer-i3s-explorer .layersList{padding:0}.cesium-viewer-i3s-explorer input{margin:0 3px 0 0}.cesium-viewer-i3s-explorer .expandItem{cursor:pointer;-webkit-user-select:none;user-select:none;width:20px}.cesium-viewer-i3s-explorer .nested,.cesium-viewer-i3s-explorer #bsl-wrapper{display:none}.cesium-viewer-i3s-explorer .active{display:block}.cesium-viewer-i3s-explorer .li-wrapper{display:flex;flex-direction:row;align-content:center}.bim-engine-gis-container,.bim-engine-gis-container .cesium-viewer,.bim-engine-gis-container .cesium-viewer-cesiumWidgetContainer,.bim-engine-gis-container .cesium-widget,.bim-engine-gis-container canvas{width:100%;height:100%}.bim-engine-gis-container{position:relative;overflow:hidden;background:#111827}.bim-engine-gis-container .cesium-widget canvas{display:block}.bim-engine-gis-performance-monitor{position:absolute;top:8px;right:8px;z-index:1200;width:96px;padding:6px 8px;border:1px solid rgba(148,163,184,.32);border-radius:4px;background:#0f172ac7;color:#e5edf7;font-family:Consolas,Monaco,monospace;font-size:11px;line-height:15px;pointer-events:none;box-sizing:border-box}.bim-engine-gis-performance-row{display:flex;align-items:center;justify-content:space-between;gap:6px}.bim-engine-gis-performance-value{color:#7dd3fc;font-weight:700;text-align:right}.gis-model-calibration-dock-panel{width:min(860px,calc(100vw - 72px));color:var(--gmcal-text-primary, #0f172a);font-size:12px;line-height:1.35}.gis-model-calibration-table-wrap{position:relative;max-height:206px;overflow:auto;border-radius:9px;border:1px solid color-mix(in srgb,var(--gmcal-border, rgba(148, 163, 184, .35)) 80%,transparent 20%);background:color-mix(in srgb,var(--gmcal-bg-inset, #edf1f6) 72%,transparent 28%)}.gis-model-calibration-table{width:100%;min-width:760px;border-collapse:collapse}.gis-model-calibration-table th,.gis-model-calibration-table td{padding:5px 6px;border-bottom:1px solid color-mix(in srgb,var(--gmcal-border, rgba(148, 163, 184, .35)) 56%,transparent 44%);text-align:left;vertical-align:middle}.gis-model-calibration-table th{position:sticky;top:0;z-index:1;color:var(--gmcal-text-secondary, #64748b);background:color-mix(in srgb,var(--gmcal-bg-elevated, #f8fafc) 88%,transparent 12%);font-size:11px;font-weight:600;white-space:nowrap}.gis-model-calibration-table tbody tr:last-child td{border-bottom:none}.gis-model-calibration-model-cell{width:150px;max-width:150px}.gis-model-calibration-model-name,.gis-model-calibration-model-url{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:138px}.gis-model-calibration-model-name{color:var(--gmcal-text-primary, #0f172a);font-weight:600}.gis-model-calibration-model-url{margin-top:2px;color:var(--gmcal-text-secondary, #64748b);font-size:11px}.gis-model-calibration-input-cell{width:66px}.gis-model-calibration-input{width:60px;height:24px;border-radius:6px;border:1px solid color-mix(in srgb,var(--gmcal-border, rgba(148, 163, 184, .35)) 86%,transparent 14%);background:color-mix(in srgb,var(--gmcal-bg-elevated, #f8fafc) 90%,transparent 10%);color:var(--gmcal-text-primary, #0f172a);font-size:12px;padding:0 6px;box-sizing:border-box}.gis-model-calibration-input:focus{outline:none;border-color:color-mix(in srgb,var(--gmcal-primary, #4f88ff) 68%,transparent 32%);box-shadow:0 0 0 2px color-mix(in srgb,var(--gmcal-primary-subtle, rgba(96, 140, 255, .18)) 80%,transparent 20%)}.gis-model-calibration-action-cell{width:68px;white-space:nowrap}.gis-model-calibration-btn{position:relative;width:26px;min-width:26px;height:24px;padding:0;border-radius:6px;border:1px solid color-mix(in srgb,var(--gmcal-border, rgba(148, 163, 184, .35)) 88%,transparent 12%);background:color-mix(in srgb,var(--gmcal-bg-elevated, #f8fafc) 90%,transparent 10%);color:var(--gmcal-text-secondary, #64748b);font-size:14px;font-weight:700;line-height:1;cursor:pointer;transition:background-color .15s ease,border-color .15s ease,color .15s ease,transform .15s ease}.gis-model-calibration-btn+.gis-model-calibration-btn{margin-left:4px}.gis-model-calibration-btn:hover{border-color:color-mix(in srgb,var(--gmcal-primary, #4f88ff) 38%,var(--gmcal-border, rgba(148, 163, 184, .35)) 62%);color:var(--gmcal-text-primary, #0f172a)}.gis-model-calibration-btn:active{transform:translateY(1px)}.gis-model-calibration-btn.is-primary{border-color:color-mix(in srgb,var(--gmcal-primary, #4f88ff) 58%,transparent 42%);background:color-mix(in srgb,var(--gmcal-primary-subtle, rgba(96, 140, 255, .18)) 82%,var(--gmcal-bg-elevated, #f8fafc) 18%);color:color-mix(in srgb,var(--gmcal-primary, #4f88ff) 80%,var(--gmcal-text-primary, #0f172a) 20%)}.gis-model-calibration-btn.is-error{border-color:#ef4444b8;color:#dc2626}.gis-model-calibration-empty{display:none;padding:18px 24px;color:var(--gmcal-text-secondary, #64748b);text-align:center}.gis-model-calibration-empty.is-visible{display:block}@media(max-width:760px){.gis-model-calibration-dock-panel{width:calc(100vw - 44px)}.gis-model-calibration-table-wrap{max-height:240px}}')),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
|
|
2
2
|
(function(Zt,Kt){typeof exports=="object"&&typeof module<"u"?Kt(exports):typeof define=="function"&&define.amd?define(["exports"],Kt):(Zt=typeof globalThis<"u"?globalThis:Zt||self,Kt(Zt.IflowEngine={}))})(this,(function(Zt){"use strict";var Kt=typeof document<"u"?document.currentScript:null;const Tye={name:"light",primary:"#2563eb",primaryHover:"#1d4ed8",primaryActive:"#1e40af",primarySubtle:"rgba(37, 99, 235, 0.1)",success:"#16a34a",successHover:"#15803d",successSubtle:"rgba(22, 163, 74, 0.1)",warning:"#d97706",warningHover:"#b45309",warningSubtle:"rgba(217, 119, 6, 0.1)",danger:"#dc2626",dangerHover:"#b91c1c",dangerSubtle:"rgba(220, 38, 38, 0.1)",info:"#0891b2",infoHover:"#0e7490",infoSubtle:"rgba(8, 145, 178, 0.1)",bgBase:"#f8fafc",bgElevated:"#ffffff",bgOverlay:"rgba(255, 255, 255, 0.98)",bgInset:"#f1f5f9",bgGlass:"rgba(255, 255, 255, 0.8)",bgGlassBlur:"24px",textPrimary:"#0f172a",textSecondary:"#475569",textTertiary:"#94a3b8",textDisabled:"#cbd5e1",textInverse:"#ffffff",textLink:"#2563eb",textLinkHover:"#1d4ed8",iconDefault:"#64748b",iconHover:"#334155",iconActive:"#2563eb",iconDisabled:"#cbd5e1",iconInverse:"#ffffff",borderDefault:"#e2e8f0",borderSubtle:"#f1f5f9",borderStrong:"#cbd5e1",borderDisabled:"#f1f5f9",divider:"#e2e8f0",componentBg:"transparent",componentBgHover:"rgba(15, 23, 42, 0.04)",componentBgActive:"rgba(15, 23, 42, 0.08)",componentBgSelected:"rgba(37, 99, 235, 0.08)",componentBgDisabled:"#f8fafc",focusRing:"rgba(37, 99, 235, 0.5)",focusRingOffset:"#ffffff",selectionBg:"rgba(37, 99, 235, 0.15)",selectionText:"#0f172a",shadowSm:"0 2px 8px rgba(0, 0, 0, 0.1), 0 4px 12px rgba(0, 0, 0, 0.08)",shadowMd:"0 4px 12px rgba(0, 0, 0, 0.12), 0 6px 20px rgba(0, 0, 0, 0.1)",shadowLg:"0 10px 25px rgba(0, 0, 0, 0.15), 0 6px 10px rgba(0, 0, 0, 0.1)",shadowXl:"0 20px 40px rgba(0, 0, 0, 0.2), 0 10px 15px rgba(0, 0, 0, 0.1)",shadowGlow:"0 2px 8px rgba(59, 130, 246, 0.3), 0 4px 16px rgba(59, 130, 246, 0.2)",scrollbarTrack:"#f1f5f9",scrollbarThumb:"#cbd5e1",scrollbarThumbHover:"#94a3b8",floatingBg:"rgba(255, 255, 255, 0.8)",floatingBorder:"rgba(226, 232, 240, 0.5)",floatingShadow:"0 4px 24px rgba(0, 0, 0, 0.06)",floatingBtnBg:"rgba(255, 255, 255, 0.9)",floatingBtnBorder:"rgba(203, 213, 225, 0.6)",floatingBtnShadow:"0 2px 8px rgba(0, 0, 0, 0.1), 0 4px 12px rgba(0, 0, 0, 0.08)",floatingBtnBgHover:"#ffffff",floatingBtnShadowHover:"0 4px 12px rgba(0, 0, 0, 0.12), 0 6px 20px rgba(0, 0, 0, 0.1)",floatingIconColor:"#334155",floatingIconColorHover:"#1e293b",panelBg:"rgba(255, 255, 255, 0.95)",panelBorder:"rgba(226, 232, 240, 0.6)",panelHeaderBg:"rgba(248, 250, 252, 0.9)",panelRadius:"12px",tabBg:"#f1f5f9",tabItemBg:"transparent",tabItemBgHover:"rgba(255, 255, 255, 0.6)",tabItemBgActive:"#ffffff",tabItemTextActive:"#2563eb",overrides:{dialog:{headerBg:"#f8fafc"},toolbar:{bg:"rgba(255, 255, 255, 0.9)",buttonBg:"rgba(255, 255, 255, 0.95)",buttonBgHover:"#ffffff",buttonBgActive:"#2563eb"},input:{bg:"#ffffff",bgFocus:"#ffffff",placeholder:"#94a3b8"}}},ynt={name:"dark",primary:"#3b82f6",primaryHover:"#60a5fa",primaryActive:"#2563eb",primarySubtle:"rgba(59, 130, 246, 0.15)",success:"#22c55e",successHover:"#4ade80",successSubtle:"rgba(34, 197, 94, 0.15)",warning:"#f59e0b",warningHover:"#fbbf24",warningSubtle:"rgba(245, 158, 11, 0.15)",danger:"#ef4444",dangerHover:"#f87171",dangerSubtle:"rgba(239, 68, 68, 0.15)",info:"#06b6d4",infoHover:"#22d3ee",infoSubtle:"rgba(6, 182, 212, 0.15)",bgBase:"#152232",bgElevated:"#1f2d3e",bgOverlay:"rgba(21, 34, 50, 0.98)",bgInset:"#152232",bgGlass:"rgba(21, 34, 50, 0.85)",bgGlassBlur:"24px",textPrimary:"#ffffff",textSecondary:"#94a3b8",textTertiary:"#64748b",textDisabled:"#475569",textInverse:"#152232",textLink:"#60a5fa",textLinkHover:"#93c5fd",iconDefault:"#ffffff",iconHover:"#ffffff",iconActive:"#3b82f6",iconDisabled:"#475569",iconInverse:"#152232",borderDefault:"rgba(51, 65, 85, 0.5)",borderSubtle:"rgba(51, 65, 85, 0.5)",borderStrong:"#475569",borderDisabled:"#1e293b",divider:"#334155",componentBg:"transparent",componentBgHover:"rgba(248, 250, 252, 0.06)",componentBgActive:"rgba(248, 250, 252, 0.1)",componentBgSelected:"rgba(59, 130, 246, 0.2)",componentBgDisabled:"#1e293b",focusRing:"rgba(59, 130, 246, 0.5)",focusRingOffset:"#1e293b",selectionBg:"rgba(59, 130, 246, 0.3)",selectionText:"#f8fafc",shadowSm:"0 2px 8px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.3)",shadowMd:"0 4px 12px rgba(0, 0, 0, 0.5), 0 6px 20px rgba(0, 0, 0, 0.4)",shadowLg:"0 10px 25px rgba(0, 0, 0, 0.6), 0 6px 10px rgba(0, 0, 0, 0.4)",shadowXl:"0 20px 40px rgba(0, 0, 0, 0.7), 0 10px 15px rgba(0, 0, 0, 0.5)",shadowGlow:"0 2px 8px rgba(59, 130, 246, 0.4), 0 4px 16px rgba(59, 130, 246, 0.25)",scrollbarTrack:"#1e293b",scrollbarThumb:"#475569",scrollbarThumbHover:"#64748b",floatingBg:"rgba(15, 23, 42, 0.85)",floatingBorder:"rgba(51, 65, 85, 0.4)",floatingShadow:"0 4px 24px rgba(0, 0, 0, 0.25)",floatingBtnBg:"rgba(51, 65, 85, 0.6)",floatingBtnBorder:"rgba(100, 116, 139, 0.5)",floatingBtnShadow:"0 2px 8px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.25)",floatingBtnBgHover:"rgba(71, 85, 105, 0.7)",floatingBtnShadowHover:"0 4px 12px rgba(0, 0, 0, 0.35), 0 6px 20px rgba(0, 0, 0, 0.3)",floatingIconColor:"#e2e8f0",floatingIconColorHover:"#f8fafc",panelBg:"rgba(15, 23, 42, 0.95)",panelBorder:"rgba(51, 65, 85, 0.5)",panelHeaderBg:"rgba(15, 23, 42, 0.9)",panelRadius:"12px",tabBg:"rgba(30, 41, 59, 0.6)",tabItemBg:"transparent",tabItemBgHover:"rgba(51, 65, 85, 0.5)",tabItemBgActive:"rgba(51, 65, 85, 0.8)",tabItemTextActive:"#60a5fa",overrides:{dialog:{headerBg:"#0f172a"},toolbar:{bg:"rgba(30, 41, 59, 0.9)",buttonBg:"rgba(51, 65, 85, 0.6)",buttonBgHover:"rgba(71, 85, 105, 0.7)",buttonBgActive:"#3b82f6"},input:{bg:"#0f172a",bgFocus:"#1e293b",placeholder:"#64748b"}}};class vnt{currentTheme=Tye;listeners=[];constructor(){}getTheme(){return this.currentTheme}setTheme(e){e==="light"?this.applyTheme(Tye):this.applyTheme(ynt)}setCustomTheme(e){this.applyTheme(e)}applyTheme(e){this.currentTheme=e,this.notifyListeners()}subscribe(e){return this.listeners.push(e),e(this.currentTheme),()=>{this.listeners=this.listeners.filter(t=>t!==e)}}notifyListeners(){this.listeners.forEach(e=>e(this.currentTheme))}}const qi=new vnt,bnt={common:{title:"BimEngine",description:"这是一个使用 BIM-ENGINE。",openTestDialog:"打开测试弹窗",openInfoDialog:"打开信息弹窗 (封装版)"},toolbar:{home:"首页",measure:"测量",zoomBox:"选框放大",info:"信息",location:"定位",setting:"设置",walk:"漫游",map:"地图",property:"构件详情",fullscreen:"全屏",walkMenu:"漫游菜单",walkPerson:"第一人称",walkBird:"第三人称",tree:"模型树",section:"剖切",sectionPlane:"拾取面剖切",sectionAxis:"轴向剖切",sectionBox:"剖切盒",sectionSelected:"剖切选中构件",modelLink3d:"联动模型",cameraSwitch:"相机切换"},dialog:{testTitle:"测试弹窗",testContent:'<div style="padding: 10px;">这是一个 <b>可拖拽</b> 且 <b>可缩放</b> 的弹窗。<br><br>你可以尝试拖动标题栏,或者拖动右下角改变大小。</div>'},menu:{info:"信息",home:"首页",componentDetail:"构件详情",hideSelected:"隐藏选中构件",transparentSelected:"半透明选中构件",cancelTranslucent:"取消半透明",componentColor:"构件颜色",setSelectedColor:"设置选中颜色",restoreSelectedColor:"取消选中颜色",restoreAllColors:"取消全部颜色",isolateSelected:"隔离选中构件",hideOthers:"其他构件隐藏",transparentOthers:"其他构件半透明",fitSectionBox:"剖切盒适应",modelLink3d:"联动模型",showAll:"显示全部",quickSelect:"快速选择",selectSameType:"选择同类模型",selectSameLevel:"选择同层模型",selectSameLevelType:"选择同层同类模型"},modelColorPicker:{title:"构件颜色",opacity:"透明度",custom:"自定义颜色",close:"关闭颜色选择"},tree:{searchPlaceholder:"请输入要搜索的内容",noResults:"未找到匹配结果"},constructTree:{title:"目录树"},componentTreeDrawer:{actions:{close:"关闭抽屉",add:"新增",addPin:"新增图钉",addFolder:"新增文件夹",showAllPins:"显示所有图钉",hideAllPins:"隐藏所有图钉",edit:"编辑",delete:"删除",save:"保存",cancel:"取消"},tabs:{view:"视图",pin:"图钉",constructTree:"构件树"},empty:{pinTitle:"暂无图钉",pinDesc:"点击上方按钮添加第一个图钉"},defaultNames:{pin:"图钉",folder:"文件夹"},dialogs:{noticeTitle:"提示",deleteFolderTitle:"删除文件夹",deleteFolderMessage:"确认删除该文件夹以及文件夹下面的所有图钉吗?",deleteFolderMessagePrefix:"是否删除【",deleteFolderMessageSuffix:"】文件夹以及文件夹下面所有的图钉数据。",confirm:"确定"},placeholders:{view:"视图页面占位,后续在这里接入视图相关内容。",pin:"暂无图钉,点击上方按钮添加",constructTree:"构件树页面占位,后续在这里接入新的构件树能力。"}},viewTab:{category:{ceilingPlans:"天花板平面",elevations:"立面",floorPlans:"楼层平面",sections:"剖面"},empty:"暂无视图数据",default3D:"默认三维"},tab:{component:"构件",system:"系统",space:"空间",type:"类型",major:"专业"},panel:{property:{title:"构件详情",base:"基本属性",material:"材质信息",advanced:"高级设置",tab:{props:"属性",material:"材质"}},componentDetail:{title:"构件详情",noSelection:"请先选中构件",loading:"加载中...",searchPlaceholder:"搜索属性名称或属性值",noData:"无属性数据",noSearchResults:"未找到匹配属性",categoryFallback:"分类"}},measure:{btnName:"测量",dialogTitle:"测量",modes:{clearHeight:"净高",clearDistance:"净距",distance:"距离",elevation:"标高",point:"坐标",angle:"角度",area:"面积",slope:"坡度"},actions:{expand:"展开",collapse:"收起",clearAll:"删除全部",settings:"设置"},labels:{currentMode:"当前测量方式:",x:"X:",y:"Y:",z:"Z:",value:{clearHeight:"净高:",clearDistance:"净距:",distance:"距离:",elevation:"标高:",point:"坐标:",angle:"角度:",area:"面积:",slope:"坡度:"}},settings:{title:"设置",unit:"单位:",precision:"精度:",hint:"距离、净距、净高和标高默认使用该单位;角度和面积有各自默认单位。",save:"保存设置",cancel:"取消"},clearHeight:{direction:"朝向:",directionDown:"朝下",directionUp:"朝上",selectType:"选择对象:",selectPoint:"选择点",selectElement:"选择构件"}},sectionPlane:{dialogTitle:"拾取面剖切",actions:{hide:"隐藏",reverse:"反向",reset:"重置",fill:"填充"}},sectionAxis:{dialogTitle:"轴向剖切",actions:{hide:"隐藏",reverse:"反向",reset:"重置",axisX:"X",axisY:"Y",axisZ:"Z",fill:"填充"}},sectionBox:{dialogTitle:"剖切盒",actions:{hide:"隐藏",reverse:"反向",fitToModel:"适应",reset:"重置",fill:"填充"},axes:{x:"X",y:"Y",z:"Z"}},walkControl:{speed:"移动速度:",gravity:"重力",collision:"碰撞",planView:"地图",viewMode:{firstPerson:"第一人称",thirdPerson:"第三人称"},characterModel:{label:"建筑工人",constructionWorker:"建筑工人",officeMale:"办公室男性"},walkMode:{label:"行走模式",walk:"行走模式",run:"奔跑模式"},exit:"退出",path:{dialogTitle:"路径漫游",duration:"漫游时间",durationUnit:"秒",loop:"循环播放",addPoint:"添加漫游点",deleteAll:"删除全部",point:"漫游点",play:"播放漫游",stop:"停止漫游",noPoints:"暂无漫游点,请添加"}},info:{dialogTitle:"基本信息",meshCount:"构件数量",totalTriangles:"三角面数量",totalVertices:"顶点数量"},engine2d:{contextMenu:{search:"搜索",hideElement:"隐藏元素",showAll:"显示全部",hideLayer:"隐藏图层",showAllLayers:"显示所有图层",layerManage:"图层管理",toggleBg:"切换背景",linkElement2d3d:"模型联动",linkView2d3d:"视角关联"}},aiChat:{title:"AI 助手",placeholder:"输入你的问题...",quickPrompt:{summarize:"总结这个模型",explain:"解释选中的构件",generate:"生成报告"},action:{new:"新建对话",history:"历史记录",settings:"设置",close:"关闭"},helper:{newline:"Shift + Enter 换行",send:"Enter 发送"},thinking:"正在思考...",other:"其他",otherPlaceholder:"请输入自定义答案",submit:"提交"},viewDropdown:{triggerTitle:"视图控制",switchOrthographic:"切换到正交视图",switchPerspective:"切换到透视视图",saveMainView:"将当前视图设为主视图",restoreMainView:"重置主视图",captureScreenshot:"截图保存",modelCalibration:"模型校准"},modelCalibration:{title:"模型校准",hint:"设置模型偏移与旋转,调整后会向外部抛出校准数据",refresh:"刷新",modelCount:"{count} 个模型",empty:"暂无已加载模型",model:"模型",offsetX:"X偏移",offsetY:"Y偏移",offsetZ:"Z偏移",rotationX:"X旋转",rotationY:"Y旋转",rotationZ:"Z旋转",actions:"操作",apply:"调整",reset:"重置"},gisModelCalibration:{empty:"暂无可校验的 GIS 3D Tiles 模型",model:"模型",longitude:"经度",latitude:"纬度",height:"高程",heading:"航向角",pitch:"俯仰角",roll:"横滚角",actions:"操作",apply:"调整",reset:"重置"},setting:{dialogTitle:"设置",presetSelect:"选择预设",presetSelectPlaceholder:"请选择预设",defaultPresetLabel:"默认预设",savePreset:"保存预设",deletePreset:"删除预设",deletePresetForbidden:"默认预设不允许删除",presetDefaultName:"预设",presetNamePrompt:"请输入预设名称",presetNameRequired:"预设名称不能为空",presetNameDuplicate:"预设名称已存在,请使用其他名称",restorePreset:"恢复预设",saveAsNewPreset:"存为新预设",selectPresetFirst:"请先选择预设",presetButton:"预设",undoChanges:"撤销修改",saveAsDialogTitle:"存为新预设",deleteDialogTitle:"删除预设",deleteDialogMessage:"确认删除当前预设吗?删除后不可恢复。",presetNamePlaceholder:"请输入预设名称",confirm:"确定",cancel:"取消",presetPickPrompt:"请输入预设序号",presetPickInvalid:"预设序号无效",renderMode:"渲染模式",modes:{simple:"性能模式",balance:"平衡模式",advanced:"效果模式"},displaySection:"显示设置",edgeLine:"边线",edgeOpacity:"边线透明度",showGrid:"显示轴网",showLevel:"显示标高",contrast:"对比度",saturation:"饱和度",lightIntensity:"光照强度",environment:"环境背景",environmentType:{none:"无",hdr:"HDR背景",sky:"天空盒"},backgroundVisible:"显示背景",ground:"显示地面",groundElevation:"地面高度",groundElevationUnit:"m"},help:{engineControl:"引擎控制",fpsControl:"第一视角控制",gotIt:"好的,知道了",dontRemind:"不再提醒我",rotate:"旋转",mouseLeftDrag:"鼠标左键拖拽",pan:"平移",shiftLeftDrag:"Shift + 左键 / 右键拖拽",zoom:"缩放",mouseWheel:"鼠标滚轮",boxSelect:"框选",ctrlLeftDrag:"Ctrl + 左键拖拽",multiSelect:"加选 / 减选",ctrlShiftClick:"Ctrl + 单击 (加) / Shift + 单击 (减)",homeView:"回到主视图",doubleClickBlank:"双击空白区域",rotateRuleTitle:"旋转点变换规则",rotateRuleDesc:"鼠标悬停构件时,按当前位置设定旋转中心;悬停空白区域时,保持上一次旋转中心。",roam:"漫游",or:"或",upDown:"向上和向下移动",qeKey:"Q / E",landOnFloor:"开启重力将落在最近楼层",run:"运行 (加速)",shiftArrow:"Shift + 方向键",teleport:"传送",doubleClick:"双击目标",lookAround:"环视",leftDrag:"使用左键拖动视图",adjustSpeed:"调整速度",rotateView:"旋转视图",panView:"平移视图",zoomView:"缩放视图",resetView:"视图复位",mouseLeftDragShort:"鼠标左键拖拽",mouseRightDragShort:"鼠标右键拖拽/Shift+左键",mouseWheelShort:"滚动鼠标滚轮",componentSelect:"构件选择",click:"单击",addSelect:"加选构件",removeSelect:"减选构件",doubleClickBlankShort:"双击空白区域",pointToComponent:"指向构件:",pointToComponentDesc:"以鼠标点击位置为旋转中心",pointToBlank:"指向空白:",pointToBlankDesc:"保持上一次确定的旋转中心",roamMove:"漫游移动",roamMoveDesc:"使用 WASD 键进行移动",speedUp:"加速移动",lookAroundDesc:"左键拖动视图查看四周",teleportDesc:"双击目标构件或地面"}},Ant={common:{title:"BimEngine",description:"This is a BIM-ENGINE demo.",openTestDialog:"Open Test Dialog",openInfoDialog:"Open Info Dialog (Wrapped)"},toolbar:{home:"Home",measure:"Measure",zoomBox:"Zoom Box",info:"Info",location:"Location",setting:"Settings",walk:"Walk",map:"Map",property:"Property",fullscreen:"Fullscreen",walkPerson:"Person",walkBird:"Bird Eye",walkMenu:"Menu",tree:"Tree",section:"Section",sectionPlane:"Plane Section",sectionAxis:"Axis Section",sectionBox:"Section Box",sectionSelected:"Section Selected",modelLink3d:"Link Model",cameraSwitch:"Camera"},dialog:{testTitle:"Test Dialog",testContent:'<div style="padding: 10px;">This is a <b>draggable</b> and <b>resizable</b> dialog.<br><br>Try dragging the title bar or resizing from the bottom-right corner.</div>'},menu:{info:"Info",home:"Home",componentDetail:"Component Detail",hideSelected:"Hide Selected",transparentSelected:"Transparent Selected",cancelTranslucent:"Cancel Translucent",componentColor:"Component Color",setSelectedColor:"Set Selected Color",restoreSelectedColor:"Clear Selected Color",restoreAllColors:"Clear All Colors",isolateSelected:"Isolate Selected",hideOthers:"Hide Others",transparentOthers:"Transparent Others",fitSectionBox:"Fit Section Box",modelLink3d:"Link Model",showAll:"Show All",quickSelect:"Quick Select",selectSameType:"Select Same Type",selectSameLevel:"Select Same Level",selectSameLevelType:"Select Same Level & Type"},modelColorPicker:{title:"Component Color",opacity:"Opacity",custom:"Custom color",close:"Close color picker"},tree:{searchPlaceholder:"Please enter content to search",noResults:"No matching results"},constructTree:{title:"Construct Tree"},componentTreeDrawer:{actions:{close:"Close drawer",add:"Add",addPin:"Add Pin",addFolder:"Add Folder",showAllPins:"Show All Pins",hideAllPins:"Hide All Pins",edit:"Edit",delete:"Delete",save:"Save",cancel:"Cancel"},tabs:{view:"View",pin:"Pins",constructTree:"Component Tree"},empty:{pinTitle:"No pins yet",pinDesc:"Click the button above to add your first pin"},defaultNames:{pin:"Pin ",folder:"Folder "},dialogs:{noticeTitle:"Notice",deleteFolderTitle:"Delete Folder",deleteFolderMessage:"Delete this folder and all pins inside it?",deleteFolderMessagePrefix:'Delete folder "',deleteFolderMessageSuffix:'" and all pin data inside it?',confirm:"Confirm"},placeholders:{view:"View page placeholder. View-related content will be added here later.",pin:"No pins yet. Click the button above to add one.",constructTree:"Component tree placeholder. The new tree capability will be added here later."}},viewTab:{category:{ceilingPlans:"Ceiling Plans",elevations:"Elevations",floorPlans:"Floor Plans",sections:"Sections"},empty:"No view data available",default3D:"Default 3D View"},tab:{component:"Component",system:"System",space:"Space",type:"Type",major:"Major"},panel:{property:{title:"Component Details",base:"Basic Info",material:"Material",advanced:"Advanced",tab:{props:"Properties",material:"Material"}},componentDetail:{title:"Component Detail",noSelection:"Please select a component first",loading:"Loading...",searchPlaceholder:"Search property names or values",noData:"No property data",noSearchResults:"No matching properties found",categoryFallback:"Category"}},measure:{btnName:"Measure",dialogTitle:"Measure",modes:{clearHeight:"Clear Height",clearDistance:"Clear Distance",distance:"Distance",elevation:"Elevation",point:"Point",angle:"Angle",area:"Area",slope:"Slope"},actions:{expand:"Expand",collapse:"Collapse",clearAll:"Clear All",settings:"Settings"},labels:{currentMode:"Mode:",x:"X:",y:"Y:",z:"Z:",value:{clearHeight:"Clear Height:",clearDistance:"Clear Distance:",distance:"Distance:",elevation:"Elevation:",point:"Point:",angle:"Angle:",area:"Area:",slope:"Slope:"}},settings:{title:"Settings",unit:"Unit:",precision:"Precision:",hint:"Distance, clear distance, clear height and elevation use this unit by default; angle and area use their own units.",save:"Save",cancel:"Cancel"},clearHeight:{direction:"Direction:",directionDown:"Down",directionUp:"Up",selectType:"Select:",selectPoint:"Point",selectElement:"Element"}},sectionPlane:{dialogTitle:"Plane Section",actions:{hide:"Hide",reverse:"Reverse",reset:"Reset",fill:"Fill"}},sectionAxis:{dialogTitle:"Axis Section",actions:{hide:"Hide",reverse:"Reverse",reset:"Reset",axisX:"X",axisY:"Y",axisZ:"Z",fill:"Fill"}},sectionBox:{dialogTitle:"Section Box",actions:{hide:"Hide",reverse:"Reverse",fitToModel:"Fit",reset:"Reset",fill:"Fill"},axes:{x:"X",y:"Y",z:"Z"}},walkControl:{speed:"Speed:",gravity:"Gravity",collision:"Collision",planView:"Map",viewMode:{firstPerson:"First Person",thirdPerson:"Third Person"},characterModel:{label:"Construction Worker",constructionWorker:"Construction Worker",officeMale:"Office Male"},walkMode:{label:"Walk Mode",walk:"Walk",run:"Run"},exit:"Exit",path:{dialogTitle:"Path Roaming",duration:"Duration",durationUnit:"s",loop:"Loop",addPoint:"Add Point",deleteAll:"Delete All",point:"Point",play:"Play",stop:"Stop",noPoints:"No points yet"}},info:{dialogTitle:"Basic Info",meshCount:"Mesh Count",totalTriangles:"Total Triangles",totalVertices:"Total Vertices"},engine2d:{contextMenu:{search:"Search",hideElement:"Hide Element",showAll:"Show All",hideLayer:"Hide Layer",showAllLayers:"Show All Layers",layerManage:"Layer Manager",toggleBg:"Toggle Background",linkElement2d3d:"Link 2D/3D Elements",linkView2d3d:"Link 2D/3D View"}},aiChat:{title:"AI Assistant",placeholder:"Ask a question...",quickPrompt:{summarize:"Summarize this model",explain:"Explain selected component",generate:"Generate report"},action:{new:"New Chat",history:"History",settings:"Settings",close:"Close"},helper:{newline:"Shift + Enter for new line",send:"Enter to send"},thinking:"Thinking...",other:"Other",otherPlaceholder:"Enter custom answer",submit:"Submit"},viewDropdown:{triggerTitle:"View Controls",switchOrthographic:"Switch to Orthographic",switchPerspective:"Switch to Perspective",saveMainView:"Set Current as Main View",restoreMainView:"Reset Main View",captureScreenshot:"Capture Screenshot",modelCalibration:"Model Calibration"},modelCalibration:{title:"Model Calibration",hint:"Set model offsets and rotations, then emit calibration data externally",refresh:"Refresh",modelCount:"{count} models",empty:"No loaded models",model:"Model",offsetX:"X Offset",offsetY:"Y Offset",offsetZ:"Z Offset",rotationX:"X Rotation",rotationY:"Y Rotation",rotationZ:"Z Rotation",actions:"Actions",apply:"Apply",reset:"Reset"},gisModelCalibration:{empty:"No GIS 3D Tiles models available",model:"Model",longitude:"Longitude",latitude:"Latitude",height:"Elevation",heading:"Heading",pitch:"Pitch",roll:"Roll",actions:"Actions",apply:"Apply",reset:"Reset"},setting:{dialogTitle:"Settings",presetSelect:"Preset",presetSelectPlaceholder:"Select preset",defaultPresetLabel:"Default Preset",savePreset:"Save Preset",deletePreset:"Delete",deletePresetForbidden:"Default preset cannot be deleted",presetDefaultName:"Preset",presetNamePrompt:"Enter preset name",presetNameRequired:"Preset name is required",presetNameDuplicate:"Preset name already exists",restorePreset:"Restore Preset",saveAsNewPreset:"Save As Preset",selectPresetFirst:"Please select a preset first",presetButton:"Preset",undoChanges:"Undo Changes",saveAsDialogTitle:"Save As Preset",deleteDialogTitle:"Delete Preset",deleteDialogMessage:"Delete current preset? This action cannot be undone.",presetNamePlaceholder:"Enter preset name",confirm:"Confirm",cancel:"Cancel",presetPickPrompt:"Please input preset number",presetPickInvalid:"Invalid preset number",renderMode:"Render Mode",modes:{simple:"Performance",balance:"Balanced",advanced:"Quality"},displaySection:"Display",edgeLine:"Edge Lines",edgeOpacity:"Edge Opacity",showGrid:"Show Grid",showLevel:"Show Level",contrast:"Contrast",saturation:"Saturation",lightIntensity:"Light Intensity",environment:"Environment",environmentType:{none:"None",hdr:"HDR",sky:"Sky"},backgroundVisible:"Show Background",ground:"Ground",groundElevation:"Ground Elevation",groundElevationUnit:"m"},help:{engineControl:"Engine Controls",fpsControl:"First Person Controls",gotIt:"Got it",dontRemind:"Don't remind me again",rotate:"Rotate",mouseLeftDrag:"Left mouse drag",pan:"Pan",shiftLeftDrag:"Shift + Left/Right drag",zoom:"Zoom",mouseWheel:"Mouse wheel",boxSelect:"Box Select",ctrlLeftDrag:"Ctrl + Left drag",multiSelect:"Add/Remove Selection",ctrlShiftClick:"Ctrl + Click (Add) / Shift + Click (Remove)",homeView:"Home View",doubleClickBlank:"Double click empty area",rotateRuleTitle:"Rotation Center Rule",rotateRuleDesc:"Hovering over a component sets the rotation center to that position; hovering over empty area keeps the last rotation center.",roam:"Roam",or:"or",upDown:"Move Up/Down",qeKey:"Q / E",landOnFloor:"Enable gravity to land on nearest floor",run:"Run (Speed up)",shiftArrow:"Shift + Arrow keys",teleport:"Teleport",doubleClick:"Double click target",lookAround:"Look Around",leftDrag:"Drag view with left button",adjustSpeed:"Adjust Speed",rotateView:"Rotate View",panView:"Pan View",zoomView:"Zoom View",resetView:"Reset View",mouseLeftDragShort:"Left mouse drag",mouseRightDragShort:"Right-click and drag / Shift + Left-click",mouseWheelShort:"Scroll mouse wheel",componentSelect:"Component Selection",click:"Click",addSelect:"Add to selection",removeSelect:"Remove from selection",doubleClickBlankShort:"Double click empty area",pointToComponent:"Point to component:",pointToComponentDesc:"Set rotation center at click position",pointToBlank:"Point to blank:",pointToBlankDesc:"Keep last rotation center",roamMove:"Roam Move",roamMoveDesc:"Use WASD keys to move",speedUp:"Speed Up",lookAroundDesc:"Drag view with left button",teleportDesc:"Double click target component or ground"}},xnt={common:{title:"BimEngine",description:"這是一個使用 BIM-ENGINE。",openTestDialog:"打開測試彈窗",openInfoDialog:"打開資訊彈窗 (封裝版)"},toolbar:{home:"首頁",measure:"測量",zoomBox:"選框放大",info:"資訊",location:"定位",setting:"設定",walk:"漫遊",map:"地圖",property:"構件詳情",fullscreen:"全屏",walkMenu:"漫遊選單",walkPerson:"第一人稱",walkBird:"第三人稱",tree:"模型樹",section:"剖切",sectionPlane:"拾取面剖切",sectionAxis:"軸向剖切",sectionBox:"剖切盒",sectionSelected:"剖切選中構件",modelLink3d:"聯動模型",cameraSwitch:"相機切換"},dialog:{testTitle:"測試彈窗",testContent:'<div style="padding: 10px;">這是一個 <b>可拖曳</b> 且 <b>可縮放</b> 的彈窗。<br><br>你可以嘗試拖動標題欄,或者拖動右下角改變大小。</div>'},menu:{info:"資訊",home:"首頁",componentDetail:"構件詳情",hideSelected:"隱藏選中構件",transparentSelected:"半透明選中構件",cancelTranslucent:"取消半透明",componentColor:"構件顏色",setSelectedColor:"設定選中顏色",restoreSelectedColor:"取消選中顏色",restoreAllColors:"取消全部顏色",isolateSelected:"隔離選中構件",hideOthers:"其他構件隱藏",transparentOthers:"其他構件半透明",fitSectionBox:"剖切盒適應",modelLink3d:"聯動模型",showAll:"顯示全部",quickSelect:"快速選擇",selectSameType:"選擇同類模型",selectSameLevel:"選擇同層模型",selectSameLevelType:"選擇同層同類模型"},modelColorPicker:{title:"構件顏色",opacity:"透明度",custom:"自訂顏色",close:"關閉顏色選擇"},tree:{searchPlaceholder:"請輸入要搜尋的內容",noResults:"未找到符合結果"},constructTree:{title:"目錄樹"},componentTreeDrawer:{actions:{close:"關閉抽屜",add:"新增",addPin:"新增圖釘",addFolder:"新增文件夾",showAllPins:"顯示所有圖釘",hideAllPins:"隱藏所有圖釘",edit:"編輯",delete:"刪除",save:"保存",cancel:"取消"},tabs:{view:"視圖",pin:"圖釘",constructTree:"構件樹"},empty:{pinTitle:"暫無圖釘",pinDesc:"點擊上方按鈕添加第一個圖釘"},defaultNames:{pin:"圖釘",folder:"文件夾"},dialogs:{noticeTitle:"提示",deleteFolderTitle:"刪除文件夾",deleteFolderMessage:"確認刪除該文件夾以及文件夾下面的所有圖釘嗎?",deleteFolderMessagePrefix:"是否刪除【",deleteFolderMessageSuffix:"】文件夾以及文件夾下面所有的圖釘資料。",confirm:"確定"},placeholders:{view:"視圖頁面占位,後續會在這裡接入視圖相關內容。",pin:"暫無圖釘,點擊上方按鈕添加",constructTree:"構件樹頁面占位,後續會在這裡接入新的構件樹能力。"}},viewTab:{category:{ceilingPlans:"天花板平面",elevations:"立面",floorPlans:"樓層平面",sections:"剖面"},empty:"暫無視圖數據",default3D:"預設三維"},tab:{component:"構件",system:"系統",space:"空間",type:"類型",major:"專業"},panel:{property:{title:"構件詳情",base:"基本屬性",material:"材質資訊",advanced:"進階設定",tab:{props:"屬性",material:"材質"}},componentDetail:{title:"構件詳情",noSelection:"請先選中構件",loading:"載入中...",searchPlaceholder:"搜尋屬性名稱或屬性值",noData:"無屬性資料",noSearchResults:"未找到匹配屬性",categoryFallback:"分類"}},measure:{btnName:"測量",dialogTitle:"測量",modes:{clearHeight:"淨高",clearDistance:"淨距",distance:"距離",elevation:"標高",point:"座標",angle:"角度",area:"面積",slope:"坡度"},actions:{expand:"展開",collapse:"收起",clearAll:"刪除全部",settings:"設定"},labels:{currentMode:"當前測量方式:",x:"X:",y:"Y:",z:"Z:",value:{clearHeight:"淨高:",clearDistance:"淨距:",distance:"距離:",elevation:"標高:",point:"座標:",angle:"角度:",area:"面積:",slope:"坡度:"}},settings:{title:"設定",unit:"單位:",precision:"精度:",hint:"距離、淨距、淨高和標高預設使用該單位;角度和面積有各自預設單位。",save:"儲存設定",cancel:"取消"},clearHeight:{direction:"朝向:",directionDown:"朝下",directionUp:"朝上",selectType:"選擇對象:",selectPoint:"選擇點",selectElement:"選擇構件"}},sectionPlane:{dialogTitle:"拾取面剖切",actions:{hide:"隱藏",reverse:"反向",reset:"重設",fill:"填充"}},sectionAxis:{dialogTitle:"軸向剖切",actions:{hide:"隱藏",reverse:"反向",reset:"重設",axisX:"X",axisY:"Y",axisZ:"Z",fill:"填充"}},sectionBox:{dialogTitle:"剖切盒",actions:{hide:"隱藏",reverse:"反向",fitToModel:"適應",reset:"重設",fill:"填充"},axes:{x:"X",y:"Y",z:"Z"}},walkControl:{speed:"移動速度:",gravity:"重力",collision:"碰撞",planView:"地圖",viewMode:{firstPerson:"第一人稱",thirdPerson:"第三人稱"},characterModel:{label:"建築工人",constructionWorker:"建築工人",officeMale:"辦公室男性"},walkMode:{label:"行走模式",walk:"行走模式",run:"奔跑模式"},exit:"退出",path:{dialogTitle:"路徑漫遊",duration:"漫遊時間",durationUnit:"秒",loop:"循環播放",addPoint:"新增漫遊點",deleteAll:"刪除全部",point:"漫遊點",play:"播放漫遊",stop:"停止漫遊",noPoints:"暫無漫遊點,請新增"}},info:{dialogTitle:"基本資訊",meshCount:"構件數量",totalTriangles:"三角面數量",totalVertices:"頂點數量"},engine2d:{contextMenu:{search:"搜尋",hideElement:"隱藏元素",showAll:"顯示全部",hideLayer:"隱藏圖層",showAllLayers:"顯示所有圖層",layerManage:"圖層管理",toggleBg:"切換背景",linkElement2d3d:"模型聯動",linkView2d3d:"視角關聯"}},aiChat:{title:"AI 助手",placeholder:"輸入你的問題...",quickPrompt:{summarize:"總結這個模型",explain:"解釋選中的構件",generate:"生成報告"},action:{new:"新建對話",history:"歷史記錄",settings:"設定",close:"關閉"},helper:{newline:"Shift + Enter 換行",send:"Enter 傳送"},thinking:"正在思考...",other:"其他",otherPlaceholder:"請輸入自定義答案",submit:"提交"},viewDropdown:{triggerTitle:"視圖控制",switchOrthographic:"切換到正交視圖",switchPerspective:"切換到透視視圖",saveMainView:"將當前視圖設為主視圖",restoreMainView:"重置主視圖",captureScreenshot:"截圖保存",modelCalibration:"模型校準"},modelCalibration:{title:"模型校準",hint:"設定模型偏移與旋轉,調整後會向外部拋出校準資料",refresh:"重新整理",modelCount:"{count} 個模型",empty:"暫無已載入模型",model:"模型",offsetX:"X偏移",offsetY:"Y偏移",offsetZ:"Z偏移",rotationX:"X旋轉",rotationY:"Y旋轉",rotationZ:"Z旋轉",actions:"操作",apply:"調整",reset:"重置"},gisModelCalibration:{empty:"暫無可校驗的 GIS 3D Tiles 模型",model:"模型",longitude:"經度",latitude:"緯度",height:"高程",heading:"航向角",pitch:"俯仰角",roll:"橫滾角",actions:"操作",apply:"調整",reset:"重置"},setting:{dialogTitle:"設定",presetSelect:"選擇預設",presetSelectPlaceholder:"請選擇預設",defaultPresetLabel:"預設預設",savePreset:"儲存預設",deletePreset:"刪除預設",deletePresetForbidden:"預設預設不允許刪除",presetDefaultName:"預設",presetNamePrompt:"請輸入預設名稱",presetNameRequired:"預設名稱不能為空",presetNameDuplicate:"預設名稱已存在,請使用其他名稱",restorePreset:"還原預設",saveAsNewPreset:"另存為新預設",selectPresetFirst:"請先選擇預設",presetButton:"預設",undoChanges:"撤銷修改",saveAsDialogTitle:"另存為新預設",deleteDialogTitle:"刪除預設",deleteDialogMessage:"確認刪除目前預設嗎?刪除後無法復原。",presetNamePlaceholder:"請輸入預設名稱",confirm:"確定",cancel:"取消",presetPickPrompt:"請輸入預設序號",presetPickInvalid:"預設序號無效",renderMode:"渲染模式",modes:{simple:"效能模式",balance:"平衡模式",advanced:"效果模式"},displaySection:"顯示設定",edgeLine:"邊線",edgeOpacity:"邊線透明度",showGrid:"顯示軸網",showLevel:"顯示標高",contrast:"對比度",saturation:"飽和度",lightIntensity:"光照強度",environment:"環境背景",environmentType:{none:"無",hdr:"HDR背景",sky:"天空盒"},backgroundVisible:"顯示背景",ground:"顯示地面",groundElevation:"地面高度",groundElevationUnit:"m"},help:{engineControl:"引擎控制",fpsControl:"第一人稱控制",gotIt:"好的,知道了",dontRemind:"不再提醒我",rotate:"旋轉",mouseLeftDrag:"滑鼠左鍵拖曳",pan:"平移",shiftLeftDrag:"Shift + 左鍵 / 右鍵拖曳",zoom:"縮放",mouseWheel:"滑鼠滾輪",boxSelect:"框選",ctrlLeftDrag:"Ctrl + 左鍵拖曳",multiSelect:"加選 / 減選",ctrlShiftClick:"Ctrl + 點擊 (加) / Shift + 點擊 (減)",homeView:"回到主視圖",doubleClickBlank:"雙擊空白區域",rotateRuleTitle:"旋轉點變換規則",rotateRuleDesc:"滑鼠懸停構件時,按當前位置設定旋轉中心;懸停空白區域時,保持上一次旋轉中心。",roam:"漫遊",or:"或",upDown:"向上和向下移動",qeKey:"Q / E",landOnFloor:"開啟重力將落在最近樓層",run:"運行 (加速)",shiftArrow:"Shift + 方向鍵",teleport:"傳送",doubleClick:"雙擊目標",lookAround:"環視",leftDrag:"使用左鍵拖動視圖",adjustSpeed:"調整速度",rotateView:"旋轉視圖",panView:"平移視圖",zoomView:"縮放視圖",resetView:"視圖復位",mouseLeftDragShort:"滑鼠左鍵拖曳",mouseRightDragShort:"滑鼠右鍵拖曳/Shift+左鍵",mouseWheelShort:"滾動滑鼠滾輪",componentSelect:"構件選擇",click:"點擊",addSelect:"加選構件",removeSelect:"減選構件",doubleClickBlankShort:"雙擊空白區域",pointToComponent:"指向構件:",pointToComponentDesc:"以滑鼠點擊位置為旋轉中心",pointToBlank:"指向空白:",pointToBlankDesc:"保持上一次確定的旋轉中心",roamMove:"漫遊移動",roamMoveDesc:"使用 WASD 鍵進行移動",speedUp:"加速移動",lookAroundDesc:"左鍵拖動視圖查看四周",teleportDesc:"雙擊目標構件或地面"}};class wnt{currentLocale="zh-CN";messages={"zh-CN":bnt,"en-US":Ant,"zh-TW":xnt};listeners=[];constructor(){}getLocale(){return this.currentLocale}setLocale(e){this.messages[e]&&this.currentLocale!==e&&(this.currentLocale=e,this.notifyListeners())}t(e){if(!e)return"";const t=e.split(".");let n=this.messages[this.currentLocale];for(const r of t)if(n&&typeof n=="object"&&r in n)n=n[r];else return e;return n}subscribe(e){return this.listeners.push(e),()=>{this.listeners=this.listeners.filter(t=>t!==e)}}notifyListeners(){this.listeners.forEach(e=>e(this.currentLocale))}}const dr=new wnt,At=i=>dr.t(i);class Ent{element;options;container;header;contentArea;_isDestroyed=!1;_isInitialized=!1;unsubscribeTheme=null;unsubscribeLocale=null;rafId=null;constructor(e){this.options={title:"Dialog",width:300,height:"auto",position:"center",draggable:!0,resizable:!1,minWidth:200,minHeight:100,...e},this.container=e.container,this.element=this.createDom(),this.header=this.element.querySelector(".bim-dialog-header"),this.contentArea=this.element.querySelector(".bim-dialog-content"),this.init()}setTheme(e){const t=this.element.style;this.options.backgroundColor||t.setProperty("--bim-dialog-bg",e.bgElevated),this.options.headerBackgroundColor||t.setProperty("--bim-dialog-header-bg",e.bgInset),this.options.titleColor||t.setProperty("--bim-dialog-title-color",e.textPrimary),this.options.textColor||t.setProperty("--bim-dialog-text-color",e.textSecondary),this.options.borderColor||t.setProperty("--bim-dialog-border-color",e.borderDefault),t.setProperty("--bim-bg-elevated",e.bgElevated),t.setProperty("--bim-bg-inset",e.bgInset),t.setProperty("--bim-text-primary",e.textPrimary),t.setProperty("--bim-text-secondary",e.textSecondary),t.setProperty("--bim-text-tertiary",e.textTertiary),t.setProperty("--bim-border-default",e.borderDefault),t.setProperty("--bim-border-subtle",e.borderSubtle),t.setProperty("--bim-component-bg-hover",e.componentBgHover),t.setProperty("--bim-shadow-sm",e.shadowSm),t.setProperty("--bim-shadow-lg",e.shadowLg)}init(){this._isInitialized||(this.container.appendChild(this.element),this.initPosition(),this.options.draggable&&this.initDrag(),this.options.resizable&&this.initResize(),this._isInitialized=!0,this.options.onOpen&&this.options.onOpen(),this.unsubscribeTheme=qi.subscribe(e=>{this.setTheme(e)}),this.unsubscribeLocale=dr.subscribe(()=>{this.setLocales()}))}setLocales(){if(this.options.title&&!this.options.header){const e=this.header.querySelector(".bim-dialog-title");e&&(e.textContent=At(this.options.title))}}createDom(){const e=document.createElement("div");e.className="bim-dialog",this.options.id&&(e.id=this.options.id);const t=e.style;this.options.backgroundColor&&t.setProperty("--bim-dialog-bg",this.options.backgroundColor),this.options.headerBackgroundColor&&t.setProperty("--bim-dialog-header-bg",this.options.headerBackgroundColor),this.options.titleColor&&t.setProperty("--bim-dialog-title-color",this.options.titleColor),this.options.textColor&&t.setProperty("--bim-dialog-text-color",this.options.textColor),this.options.borderColor&&t.setProperty("--bim-dialog-border-color",this.options.borderColor),this.setSize(e,this.options.width,this.options.height),this.options.minWidth&&(e.style.minWidth=`${this.options.minWidth}px`);const n=document.createElement("div");if(n.className="bim-dialog-header",this.options.draggable&&n.classList.add("draggable"),this.options.header)n.appendChild(this.options.header);else{const a=document.createElement("span");a.className="bim-dialog-title",a.textContent=this.options.title?At(this.options.title):"",n.appendChild(a)}if(!this.options.hideCloseButton){const a=document.createElement("span");a.className="bim-dialog-close",this.options.closeIcon?typeof this.options.closeIcon=="string"?a.innerHTML=this.options.closeIcon:a.appendChild(this.options.closeIcon):a.innerHTML=`<svg width="24" height="24" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
3
3
|
<path d="M12 4L4 12M4 4L12 12" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"/>
|
|
4
4
|
</svg>`,a.onclick=()=>{this.close()},n.appendChild(a)}const r=document.createElement("div");if(r.className="bim-dialog-content",typeof this.options.content=="string"?r.innerHTML=this.options.content:this.options.content instanceof HTMLElement&&r.appendChild(this.options.content),e.appendChild(n),e.appendChild(r),this.options.resizable){const a=document.createElement("div");a.className="bim-dialog-resize-handle",e.appendChild(a)}const s=a=>{a.stopPropagation()};return["click","dblclick","contextmenu","wheel","mousedown","mouseup","mousemove","touchstart","touchend","touchmove","pointerdown","pointerup","pointermove","pointerenter","pointerleave","pointerover","pointerout"].forEach(a=>{e.addEventListener(a,s,{passive:!1})}),e}setSize(e,t,n){t!==void 0&&(t==="auto"||t==="fit-content"?e.style.width=t:e.style.width=typeof t=="number"?`${t}px`:t),n!==void 0&&(n==="auto"||n==="fit-content"?e.style.height=n:e.style.height=typeof n=="number"?`${n}px`:n)}fitWidth(e=!1){this.element.style.width="fit-content",e&&this.initPosition()}fitHeight(e=!1){this.element.style.height="auto";const t=this.element.getBoundingClientRect().height,n=this.options.minHeight??100,r=this.container.clientHeight||0;let s=Math.max(n,t);r>0&&(s=Math.min(s,r)),this.element.style.height=`${s}px`,e?this.initPosition():this.clampToContainer()}clampToContainer(){const e=this.container.clientWidth,t=this.container.clientHeight,n=this.element.offsetWidth,r=this.element.offsetHeight,s=this.options.bottomOffset??70,o=this.element.offsetLeft,a=this.element.offsetTop,l=Math.max(0,e-n),c=Math.max(0,t-r-s),h=Math.max(0,Math.min(o,l)),u=Math.max(0,Math.min(a,c));this.element.style.left=`${h}px`,this.element.style.top=`${u}px`}initPosition(){const e=this.options.position,t=this.element.getBoundingClientRect(),n=this.options.bottomOffset??70;let r=0,s=0;const o=this.container.clientWidth,a=this.container.clientHeight,l=t.width,c=t.height;if(typeof e=="object"&&"x"in e)r=e.x,s=e.y;else switch(e){case"center":r=(o-l)/2,s=(a-c)/2;break;case"top-left":r=0,s=0;break;case"top-center":r=(o-l)/2,s=0;break;case"top-right":r=o-l,s=0;break;case"left-center":r=0,s=(a-c)/2;break;case"right-center":r=o-l,s=(a-c)/2;break;case"bottom-left":r=0,s=a-c-n;break;case"bottom-center":r=(o-l)/2,s=a-c-n;break;case"bottom-right":r=o-l,s=a-c-n;break;default:r=(o-l)/2,s=(a-c)/2}r=Math.max(0,Math.min(r,o-l)),s=Math.max(0,Math.min(s,a-c-n)),this.element.style.left=`${r}px`,this.element.style.top=`${s}px`}initDrag(){let e=0,t=0,n=0,r=0,s=0,o=0,a=0,l=0,c=0;const h=p=>{p.preventDefault(),p.stopPropagation(),e=p.clientX,t=p.clientY,n=this.element.offsetLeft,r=this.element.offsetTop,s=this.container.clientWidth,o=this.container.clientHeight,a=this.element.offsetWidth,l=this.element.offsetHeight,c=this.options.bottomOffset??70,document.addEventListener("mousemove",u,{capture:!0}),document.addEventListener("mouseup",d,{capture:!0})},u=p=>{p.preventDefault(),p.stopPropagation(),!this.rafId&&(this.rafId=requestAnimationFrame(()=>{const f=p.clientX-e,g=p.clientY-t;let _=n+f,y=r+g;const A=s-a,x=o-l-c;_=Math.max(0,Math.min(_,A)),y=Math.max(0,Math.min(y,x)),this.element.style.left=`${_}px`,this.element.style.top=`${y}px`,this.rafId=null}))},d=()=>{this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=null),document.removeEventListener("mousemove",u,{capture:!0}),document.removeEventListener("mouseup",d,{capture:!0})};this.header.addEventListener("mousedown",h)}initResize(){const e=this.element.querySelector(".bim-dialog-resize-handle");if(!e)return;let t=0,n=0,r=0,s=0,o=0,a=0,l=0,c=0;const h=p=>{p.preventDefault(),p.stopPropagation(),t=p.clientX,n=p.clientY,r=this.element.offsetWidth,s=this.element.offsetHeight,o=this.container.clientWidth,a=this.container.clientHeight,l=this.element.offsetLeft,c=this.element.offsetTop,document.addEventListener("mousemove",u,{capture:!0}),document.addEventListener("mouseup",d,{capture:!0})},u=p=>{p.preventDefault(),p.stopPropagation(),!this.rafId&&(this.rafId=requestAnimationFrame(()=>{const f=p.clientX-t,g=p.clientY-n,_=o-l,y=a-c,A=Math.min(_,Math.max(this.options.minWidth||100,r+f)),x=Math.min(y,Math.max(this.options.minHeight||50,s+g));this.element.style.width=`${A}px`,this.element.style.height=`${x}px`,this.rafId=null}))},d=()=>{this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=null),document.removeEventListener("mousemove",u,{capture:!0}),document.removeEventListener("mouseup",d,{capture:!0})};e.addEventListener("mousedown",h)}setContent(e){this.contentArea.innerHTML="",typeof e=="string"?this.contentArea.innerHTML=e:this.contentArea.appendChild(e)}close(){this._isDestroyed||(this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.unsubscribeTheme&&(this.unsubscribeTheme(),this.unsubscribeTheme=null),this.unsubscribeLocale&&(this.unsubscribeLocale(),this.unsubscribeLocale=null),this.element.remove(),this._isDestroyed=!0,this.options.onClose&&this.options.onClose())}destroy(){this.close()}}class Mc{registry;subscriptions=[];constructor(e){this.registry=e}get engineComponent(){return this.registry.engine3d?.getEngineComponent?.()??null}subscribe(e,t){const n=this.registry.on(e,t);this.subscriptions.push(n)}emit(e,t){this.registry.emit(e,t)}destroy(){this.subscriptions.forEach(e=>e()),this.subscriptions=[]}}class Cye extends Mc{container;activeDialogs=[];constructor(e,t){super(t),this.container=e}create(e){const t=new Ent({container:this.container,...e,onClose:()=>{this.activeDialogs=this.activeDialogs.filter(n=>n!==t),e.onClose&&e.onClose()}});return t.setTheme(qi.getTheme()),this.activeDialogs.push(t),t}updateTheme(e){this.activeDialogs.forEach(t=>{t.setTheme&&t.setTheme(e)})}destroy(){this.activeDialogs.forEach(e=>e.destroy()),this.activeDialogs=[],super.destroy()}}const oJ="182",_I={ROTATE:0,DOLLY:1,PAN:2},yI={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},Snt=0,Mye=1,Tnt=2,Tz=1,Cnt=2,kL=3,f_=0,lp=1,gm=2,vv=0,UA=1,Iye=2,Pye=3,Dye=4,Rye=5,gE=100,Mnt=101,Int=102,Pnt=103,Dnt=104,Rnt=200,Lnt=201,Ont=202,Nnt=203,UL=204,zL=205,Bnt=206,Fnt=207,knt=208,Unt=209,znt=210,Hnt=211,Vnt=212,Gnt=213,jnt=214,aJ=0,lJ=1,cJ=2,vI=3,hJ=4,uJ=5,dJ=6,pJ=7,Lye=0,Wnt=1,$nt=2,m_=0,Oye=1,Nye=2,Bye=3,Fye=4,kye=5,Uye=6,zye=7,Hye=300,_E=301,bI=302,fJ=303,mJ=304,Cz=306,gJ=1e3,bv=1001,_J=1002,Oh=1003,qnt=1004,Mz=1005,fu=1006,yJ=1007,yE=1008,af=1009,Vye=1010,Gye=1011,HL=1012,vJ=1013,nd=1014,_m=1015,g_=1016,bJ=1017,AJ=1018,VL=1020,jye=35902,Wye=35899,$ye=1021,qye=1022,rd=1023,__=1026,vE=1027,Xye=1028,Iz=1029,AI=1030,xJ=1031,xI=1033,Pz=33776,Dz=33777,Rz=33778,Lz=33779,wJ=35840,EJ=35841,SJ=35842,TJ=35843,CJ=36196,MJ=37492,IJ=37496,PJ=37488,DJ=37489,RJ=37490,LJ=37491,OJ=37808,NJ=37809,BJ=37810,FJ=37811,kJ=37812,UJ=37813,zJ=37814,HJ=37815,VJ=37816,GJ=37817,jJ=37818,WJ=37819,$J=37820,qJ=37821,XJ=36492,YJ=36494,QJ=36495,KJ=36283,JJ=36284,ZJ=36285,eZ=36286,Xnt=3200,Ynt=0,Qnt=1,zA="",ym="srgb",wI="srgb-linear",Oz="linear",_o="srgb",EI=7680,Yye=519,Knt=512,Jnt=513,Znt=514,tZ=515,ert=516,trt=517,iZ=518,irt=519,Qye=35044,nrt=35048,Kye="300 es",y_=2e3,Nz=2001;function Jye(i){for(let e=i.length-1;e>=0;--e)if(i[e]>=65535)return!0;return!1}function Bz(i){return document.createElementNS("http://www.w3.org/1999/xhtml",i)}function rrt(){const i=Bz("canvas");return i.style.display="block",i}const Zye={};function eve(...i){const e="THREE."+i.shift();console.log(e,...i)}function pr(...i){const e="THREE."+i.shift();console.warn(e,...i)}function Ws(...i){const e="THREE."+i.shift();console.error(e,...i)}function GL(...i){const e=i.join(" ");e in Zye||(Zye[e]=!0,pr(...i))}function srt(i,e,t){return new Promise(function(n,r){function s(){switch(i.clientWaitSync(e,i.SYNC_FLUSH_COMMANDS_BIT,0)){case i.WAIT_FAILED:r();break;case i.TIMEOUT_EXPIRED:setTimeout(s,t);break;default:n()}}setTimeout(s,t)})}let bE=class{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){const n=this._listeners;return n===void 0?!1:n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){const n=this._listeners;if(n===void 0)return;const r=n[e];if(r!==void 0){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}}dispatchEvent(e){const t=this._listeners;if(t===void 0)return;const n=t[e.type];if(n!==void 0){e.target=this;const r=n.slice(0);for(let s=0,o=r.length;s<o;s++)r[s].call(this,e);e.target=null}}};const mu=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"],Fz=Math.PI/180,nZ=180/Math.PI;function jL(){const i=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(mu[i&255]+mu[i>>8&255]+mu[i>>16&255]+mu[i>>24&255]+"-"+mu[e&255]+mu[e>>8&255]+"-"+mu[e>>16&15|64]+mu[e>>24&255]+"-"+mu[t&63|128]+mu[t>>8&255]+"-"+mu[t>>16&255]+mu[t>>24&255]+mu[n&255]+mu[n>>8&255]+mu[n>>16&255]+mu[n>>24&255]).toLowerCase()}function Zr(i,e,t){return Math.max(e,Math.min(t,i))}function ort(i,e){return(i%e+e)%e}function rZ(i,e,t){return(1-t)*i+t*e}function WL(i,e){switch(e.constructor){case Float32Array:return i;case Uint32Array:return i/4294967295;case Uint16Array:return i/65535;case Uint8Array:return i/255;case Int32Array:return Math.max(i/2147483647,-1);case Int16Array:return Math.max(i/32767,-1);case Int8Array:return Math.max(i/127,-1);default:throw new Error("Invalid component type.")}}function cp(i,e){switch(e.constructor){case Float32Array:return i;case Uint32Array:return Math.round(i*4294967295);case Uint16Array:return Math.round(i*65535);case Uint8Array:return Math.round(i*255);case Int32Array:return Math.round(i*2147483647);case Int16Array:return Math.round(i*32767);case Int8Array:return Math.round(i*127);default:throw new Error("Invalid component type.")}}const tve={DEG2RAD:Fz};let gn=class Utt{constructor(e=0,t=0){Utt.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Zr(this.x,e.x,t.x),this.y=Zr(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=Zr(this.x,e,t),this.y=Zr(this.y,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Zr(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(Zr(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const n=Math.cos(t),r=Math.sin(t),s=this.x-e.x,o=this.y-e.y;return this.x=s*n-o*r+e.x,this.y=s*r+o*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},ia=class{constructor(e=0,t=0,n=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=r}static slerpFlat(e,t,n,r,s,o,a){let l=n[r+0],c=n[r+1],h=n[r+2],u=n[r+3],d=s[o+0],p=s[o+1],f=s[o+2],g=s[o+3];if(a<=0){e[t+0]=l,e[t+1]=c,e[t+2]=h,e[t+3]=u;return}if(a>=1){e[t+0]=d,e[t+1]=p,e[t+2]=f,e[t+3]=g;return}if(u!==g||l!==d||c!==p||h!==f){let _=l*d+c*p+h*f+u*g;_<0&&(d=-d,p=-p,f=-f,g=-g,_=-_);let y=1-a;if(_<.9995){const A=Math.acos(_),x=Math.sin(A);y=Math.sin(y*A)/x,a=Math.sin(a*A)/x,l=l*y+d*a,c=c*y+p*a,h=h*y+f*a,u=u*y+g*a}else{l=l*y+d*a,c=c*y+p*a,h=h*y+f*a,u=u*y+g*a;const A=1/Math.sqrt(l*l+c*c+h*h+u*u);l*=A,c*=A,h*=A,u*=A}}e[t]=l,e[t+1]=c,e[t+2]=h,e[t+3]=u}static multiplyQuaternionsFlat(e,t,n,r,s,o){const a=n[r],l=n[r+1],c=n[r+2],h=n[r+3],u=s[o],d=s[o+1],p=s[o+2],f=s[o+3];return e[t]=a*f+h*u+l*p-c*d,e[t+1]=l*f+h*d+c*u-a*p,e[t+2]=c*f+h*p+a*d-l*u,e[t+3]=h*f-a*u-l*d-c*p,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const n=e._x,r=e._y,s=e._z,o=e._order,a=Math.cos,l=Math.sin,c=a(n/2),h=a(r/2),u=a(s/2),d=l(n/2),p=l(r/2),f=l(s/2);switch(o){case"XYZ":this._x=d*h*u+c*p*f,this._y=c*p*u-d*h*f,this._z=c*h*f+d*p*u,this._w=c*h*u-d*p*f;break;case"YXZ":this._x=d*h*u+c*p*f,this._y=c*p*u-d*h*f,this._z=c*h*f-d*p*u,this._w=c*h*u+d*p*f;break;case"ZXY":this._x=d*h*u-c*p*f,this._y=c*p*u+d*h*f,this._z=c*h*f+d*p*u,this._w=c*h*u-d*p*f;break;case"ZYX":this._x=d*h*u-c*p*f,this._y=c*p*u+d*h*f,this._z=c*h*f-d*p*u,this._w=c*h*u+d*p*f;break;case"YZX":this._x=d*h*u+c*p*f,this._y=c*p*u+d*h*f,this._z=c*h*f-d*p*u,this._w=c*h*u-d*p*f;break;case"XZY":this._x=d*h*u-c*p*f,this._y=c*p*u-d*h*f,this._z=c*h*f+d*p*u,this._w=c*h*u+d*p*f;break;default:pr("Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],r=t[4],s=t[8],o=t[1],a=t[5],l=t[9],c=t[2],h=t[6],u=t[10],d=n+a+u;if(d>0){const p=.5/Math.sqrt(d+1);this._w=.25/p,this._x=(h-l)*p,this._y=(s-c)*p,this._z=(o-r)*p}else if(n>a&&n>u){const p=2*Math.sqrt(1+n-a-u);this._w=(h-l)/p,this._x=.25*p,this._y=(r+o)/p,this._z=(s+c)/p}else if(a>u){const p=2*Math.sqrt(1+a-n-u);this._w=(s-c)/p,this._x=(r+o)/p,this._y=.25*p,this._z=(l+h)/p}else{const p=2*Math.sqrt(1+u-n-a);this._w=(o-r)/p,this._x=(s+c)/p,this._y=(l+h)/p,this._z=.25*p}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<1e-8?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Zr(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(n===0)return this;const r=Math.min(1,t/n);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,r=e._y,s=e._z,o=e._w,a=t._x,l=t._y,c=t._z,h=t._w;return this._x=n*h+o*a+r*c-s*l,this._y=r*h+o*l+s*a-n*c,this._z=s*h+o*c+n*l-r*a,this._w=o*h-n*a-r*l-s*c,this._onChangeCallback(),this}slerp(e,t){if(t<=0)return this;if(t>=1)return this.copy(e);let n=e._x,r=e._y,s=e._z,o=e._w,a=this.dot(e);a<0&&(n=-n,r=-r,s=-s,o=-o,a=-a);let l=1-t;if(a<.9995){const c=Math.acos(a),h=Math.sin(c);l=Math.sin(l*c)/h,t=Math.sin(t*c)/h,this._x=this._x*l+n*t,this._y=this._y*l+r*t,this._z=this._z*l+s*t,this._w=this._w*l+o*t,this._onChangeCallback()}else this._x=this._x*l+n*t,this._y=this._y*l+r*t,this._z=this._z*l+s*t,this._w=this._w*l+o*t,this.normalize();return this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),r=Math.sqrt(1-n),s=Math.sqrt(n);return this.set(r*Math.sin(e),r*Math.cos(e),s*Math.sin(t),s*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}},pt=class ztt{constructor(e=0,t=0,n=0){ztt.prototype.isVector3=!0,this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(ive.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(ive.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[3]*n+s[6]*r,this.y=s[1]*t+s[4]*n+s[7]*r,this.z=s[2]*t+s[5]*n+s[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,r=this.z,s=e.elements,o=1/(s[3]*t+s[7]*n+s[11]*r+s[15]);return this.x=(s[0]*t+s[4]*n+s[8]*r+s[12])*o,this.y=(s[1]*t+s[5]*n+s[9]*r+s[13])*o,this.z=(s[2]*t+s[6]*n+s[10]*r+s[14])*o,this}applyQuaternion(e){const t=this.x,n=this.y,r=this.z,s=e.x,o=e.y,a=e.z,l=e.w,c=2*(o*r-a*n),h=2*(a*t-s*r),u=2*(s*n-o*t);return this.x=t+l*c+o*u-a*h,this.y=n+l*h+a*c-s*u,this.z=r+l*u+s*h-o*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,n=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[4]*n+s[8]*r,this.y=s[1]*t+s[5]*n+s[9]*r,this.z=s[2]*t+s[6]*n+s[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Zr(this.x,e.x,t.x),this.y=Zr(this.y,e.y,t.y),this.z=Zr(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=Zr(this.x,e,t),this.y=Zr(this.y,e,t),this.z=Zr(this.z,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Zr(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,r=e.y,s=e.z,o=t.x,a=t.y,l=t.z;return this.x=r*l-s*a,this.y=s*o-n*l,this.z=n*a-r*o,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return sZ.copy(this).projectOnVector(e),this.sub(sZ)}reflect(e){return this.sub(sZ.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(Zr(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){const r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}};const sZ=new pt,ive=new ia;let lr=class Htt{constructor(e,t,n,r,s,o,a,l,c){Htt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,n,r,s,o,a,l,c)}set(e,t,n,r,s,o,a,l,c){const h=this.elements;return h[0]=e,h[1]=r,h[2]=a,h[3]=t,h[4]=s,h[5]=l,h[6]=n,h[7]=o,h[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,r=t.elements,s=this.elements,o=n[0],a=n[3],l=n[6],c=n[1],h=n[4],u=n[7],d=n[2],p=n[5],f=n[8],g=r[0],_=r[3],y=r[6],A=r[1],x=r[4],w=r[7],E=r[2],S=r[5],I=r[8];return s[0]=o*g+a*A+l*E,s[3]=o*_+a*x+l*S,s[6]=o*y+a*w+l*I,s[1]=c*g+h*A+u*E,s[4]=c*_+h*x+u*S,s[7]=c*y+h*w+u*I,s[2]=d*g+p*A+f*E,s[5]=d*_+p*x+f*S,s[8]=d*y+p*w+f*I,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],h=e[8];return t*o*h-t*a*c-n*s*h+n*a*l+r*s*c-r*o*l}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],h=e[8],u=h*o-a*c,d=a*l-h*s,p=c*s-o*l,f=t*u+n*d+r*p;if(f===0)return this.set(0,0,0,0,0,0,0,0,0);const g=1/f;return e[0]=u*g,e[1]=(r*c-h*n)*g,e[2]=(a*n-r*o)*g,e[3]=d*g,e[4]=(h*t-r*l)*g,e[5]=(r*s-a*t)*g,e[6]=p*g,e[7]=(n*l-c*t)*g,e[8]=(o*t-n*s)*g,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,r,s,o,a){const l=Math.cos(s),c=Math.sin(s);return this.set(n*l,n*c,-n*(l*o+c*a)+o+e,-r*c,r*l,-r*(-c*o+l*a)+a+t,0,0,1),this}scale(e,t){return this.premultiply(oZ.makeScale(e,t)),this}rotate(e){return this.premultiply(oZ.makeRotation(-e)),this}translate(e,t){return this.premultiply(oZ.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,n=e.elements;for(let r=0;r<9;r++)if(t[r]!==n[r])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}};const oZ=new lr,nve=new lr().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),rve=new lr().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function art(){const i={enabled:!0,workingColorSpace:wI,spaces:{},convert:function(r,s,o){return this.enabled===!1||s===o||!s||!o||(this.spaces[s].transfer===_o&&(r.r=Av(r.r),r.g=Av(r.g),r.b=Av(r.b)),this.spaces[s].primaries!==this.spaces[o].primaries&&(r.applyMatrix3(this.spaces[s].toXYZ),r.applyMatrix3(this.spaces[o].fromXYZ)),this.spaces[o].transfer===_o&&(r.r=SI(r.r),r.g=SI(r.g),r.b=SI(r.b))),r},workingToColorSpace:function(r,s){return this.convert(r,this.workingColorSpace,s)},colorSpaceToWorking:function(r,s){return this.convert(r,s,this.workingColorSpace)},getPrimaries:function(r){return this.spaces[r].primaries},getTransfer:function(r){return r===zA?Oz:this.spaces[r].transfer},getToneMappingMode:function(r){return this.spaces[r].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(r,s=this.workingColorSpace){return r.fromArray(this.spaces[s].luminanceCoefficients)},define:function(r){Object.assign(this.spaces,r)},_getMatrix:function(r,s,o){return r.copy(this.spaces[s].toXYZ).multiply(this.spaces[o].fromXYZ)},_getDrawingBufferColorSpace:function(r){return this.spaces[r].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(r=this.workingColorSpace){return this.spaces[r].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(r,s){return GL("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),i.workingToColorSpace(r,s)},toWorkingColorSpace:function(r,s){return GL("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),i.colorSpaceToWorking(r,s)}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],n=[.3127,.329];return i.define({[wI]:{primaries:e,whitePoint:n,transfer:Oz,toXYZ:nve,fromXYZ:rve,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:ym},outputColorSpaceConfig:{drawingBufferColorSpace:ym}},[ym]:{primaries:e,whitePoint:n,transfer:_o,toXYZ:nve,fromXYZ:rve,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:ym}}}),i}const Rs=art();function Av(i){return i<.04045?i*.0773993808:Math.pow(i*.9478672986+.0521327014,2.4)}function SI(i){return i<.0031308?i*12.92:1.055*Math.pow(i,.41666)-.055}let TI,lrt=class{static getDataURL(e,t="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{TI===void 0&&(TI=Bz("canvas")),TI.width=e.width,TI.height=e.height;const r=TI.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),n=TI}return n.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=Bz("canvas");t.width=e.width,t.height=e.height;const n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);const r=n.getImageData(0,0,e.width,e.height),s=r.data;for(let o=0;o<s.length;o++)s[o]=Av(s[o]/255)*255;return n.putImageData(r,0,0),t}else if(e.data){const t=e.data.slice(0);for(let n=0;n<t.length;n++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[n]=Math.floor(Av(t[n]/255)*255):t[n]=Av(t[n]);return{data:t,width:e.width,height:e.height}}else return pr("ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}},crt=0,aZ=class{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:crt++}),this.uuid=jL(),this.data=e,this.dataReady=!0,this.version=0}getSize(e){const t=this.data;return typeof HTMLVideoElement<"u"&&t instanceof HTMLVideoElement?e.set(t.videoWidth,t.videoHeight,0):typeof VideoFrame<"u"&&t instanceof VideoFrame?e.set(t.displayHeight,t.displayWidth,0):t!==null?e.set(t.width,t.height,t.depth||0):e.set(0,0,0),e}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const n={uuid:this.uuid,url:""},r=this.data;if(r!==null){let s;if(Array.isArray(r)){s=[];for(let o=0,a=r.length;o<a;o++)r[o].isDataTexture?s.push(lZ(r[o].image)):s.push(lZ(r[o]))}else s=lZ(r);n.url=s}return t||(e.images[this.uuid]=n),n}};function lZ(i){return typeof HTMLImageElement<"u"&&i instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&i instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&i instanceof ImageBitmap?lrt.getDataURL(i):i.data?{data:Array.from(i.data),width:i.width,height:i.height,type:i.data.constructor.name}:(pr("Texture: Unable to serialize Texture."),{})}let hrt=0;const cZ=new pt;let Ug=class XK extends bE{constructor(e=XK.DEFAULT_IMAGE,t=XK.DEFAULT_MAPPING,n=bv,r=bv,s=fu,o=yE,a=rd,l=af,c=XK.DEFAULT_ANISOTROPY,h=zA){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:hrt++}),this.uuid=jL(),this.name="",this.source=new aZ(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=r,this.magFilter=s,this.minFilter=o,this.anisotropy=c,this.format=a,this.internalFormat=null,this.type=l,this.offset=new gn(0,0),this.repeat=new gn(1,1),this.center=new gn(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new lr,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=h,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!(e&&e.depth&&e.depth>1),this.pmremVersion=0}get width(){return this.source.getSize(cZ).x}get height(){return this.source.getSize(cZ).y}get depth(){return this.source.getSize(cZ).z}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(const t in e){const n=e[t];if(n===void 0){pr(`Texture.setValues(): parameter '${t}' has value of undefined.`);continue}const r=this[t];if(r===void 0){pr(`Texture.setValues(): property '${t}' does not exist.`);continue}r&&n&&r.isVector2&&n.isVector2||r&&n&&r.isVector3&&n.isVector3||r&&n&&r.isMatrix3&&n.isMatrix3?r.copy(n):this[t]=n}}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const n={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==Hye)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case gJ:e.x=e.x-Math.floor(e.x);break;case bv:e.x=e.x<0?0:1;break;case _J:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case gJ:e.y=e.y-Math.floor(e.y);break;case bv:e.y=e.y<0?0:1;break;case _J:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}};Ug.DEFAULT_IMAGE=null,Ug.DEFAULT_MAPPING=Hye,Ug.DEFAULT_ANISOTROPY=1;let hl=class Vtt{constructor(e=0,t=0,n=0,r=1){Vtt.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,n=this.y,r=this.z,s=this.w,o=e.elements;return this.x=o[0]*t+o[4]*n+o[8]*r+o[12]*s,this.y=o[1]*t+o[5]*n+o[9]*r+o[13]*s,this.z=o[2]*t+o[6]*n+o[10]*r+o[14]*s,this.w=o[3]*t+o[7]*n+o[11]*r+o[15]*s,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,r,s;const l=e.elements,c=l[0],h=l[4],u=l[8],d=l[1],p=l[5],f=l[9],g=l[2],_=l[6],y=l[10];if(Math.abs(h-d)<.01&&Math.abs(u-g)<.01&&Math.abs(f-_)<.01){if(Math.abs(h+d)<.1&&Math.abs(u+g)<.1&&Math.abs(f+_)<.1&&Math.abs(c+p+y-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const x=(c+1)/2,w=(p+1)/2,E=(y+1)/2,S=(h+d)/4,I=(u+g)/4,C=(f+_)/4;return x>w&&x>E?x<.01?(n=0,r=.707106781,s=.707106781):(n=Math.sqrt(x),r=S/n,s=I/n):w>E?w<.01?(n=.707106781,r=0,s=.707106781):(r=Math.sqrt(w),n=S/r,s=C/r):E<.01?(n=.707106781,r=.707106781,s=0):(s=Math.sqrt(E),n=I/s,r=C/s),this.set(n,r,s,t),this}let A=Math.sqrt((_-f)*(_-f)+(u-g)*(u-g)+(d-h)*(d-h));return Math.abs(A)<.001&&(A=1),this.x=(_-f)/A,this.y=(u-g)/A,this.z=(d-h)/A,this.w=Math.acos((c+p+y-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Zr(this.x,e.x,t.x),this.y=Zr(this.y,e.y,t.y),this.z=Zr(this.z,e.z,t.z),this.w=Zr(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=Zr(this.x,e,t),this.y=Zr(this.y,e,t),this.z=Zr(this.z,e,t),this.w=Zr(this.w,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Zr(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}},urt=class extends bE{constructor(e=1,t=1,n={}){super(),n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:fu,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},n),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=n.depth,this.scissor=new hl(0,0,e,t),this.scissorTest=!1,this.viewport=new hl(0,0,e,t);const r={width:e,height:t,depth:n.depth},s=new Ug(r);this.textures=[];const o=n.count;for(let a=0;a<o;a++)this.textures[a]=s.clone(),this.textures[a].isRenderTargetTexture=!0,this.textures[a].renderTarget=this;this._setTextureOptions(n),this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=n.depthTexture,this.samples=n.samples,this.multiview=n.multiview}_setTextureOptions(e={}){const t={minFilter:fu,generateMipmaps:!1,flipY:!1,internalFormat:null};e.mapping!==void 0&&(t.mapping=e.mapping),e.wrapS!==void 0&&(t.wrapS=e.wrapS),e.wrapT!==void 0&&(t.wrapT=e.wrapT),e.wrapR!==void 0&&(t.wrapR=e.wrapR),e.magFilter!==void 0&&(t.magFilter=e.magFilter),e.minFilter!==void 0&&(t.minFilter=e.minFilter),e.format!==void 0&&(t.format=e.format),e.type!==void 0&&(t.type=e.type),e.anisotropy!==void 0&&(t.anisotropy=e.anisotropy),e.colorSpace!==void 0&&(t.colorSpace=e.colorSpace),e.flipY!==void 0&&(t.flipY=e.flipY),e.generateMipmaps!==void 0&&(t.generateMipmaps=e.generateMipmaps),e.internalFormat!==void 0&&(t.internalFormat=e.internalFormat);for(let n=0;n<this.textures.length;n++)this.textures[n].setValues(t)}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}set depthTexture(e){this._depthTexture!==null&&(this._depthTexture.renderTarget=null),e!==null&&(e.renderTarget=this),this._depthTexture=e}get depthTexture(){return this._depthTexture}setSize(e,t,n=1){if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(let r=0,s=this.textures.length;r<s;r++)this.textures[r].image.width=e,this.textures[r].image.height=t,this.textures[r].image.depth=n,this.textures[r].isData3DTexture!==!0&&(this.textures[r].isArrayTexture=this.textures[r].image.depth>1);this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let t=0,n=e.textures.length;t<n;t++){this.textures[t]=e.textures[t].clone(),this.textures[t].isRenderTargetTexture=!0,this.textures[t].renderTarget=this;const r=Object.assign({},e.textures[t].image);this.textures[t].source=new aZ(r)}return this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}},zg=class extends urt{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}},sve=class extends Ug{constructor(e=null,t=1,n=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:r},this.magFilter=Oh,this.minFilter=Oh,this.wrapR=bv,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}},drt=class extends Ug{constructor(e=null,t=1,n=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:r},this.magFilter=Oh,this.minFilter=Oh,this.wrapR=bv,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}},v_=class{constructor(e=new pt(1/0,1/0,1/0),t=new pt(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t+=3)this.expandByPoint(Hg.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(Hg.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=Hg.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);const n=e.geometry;if(n!==void 0){const s=n.getAttribute("position");if(t===!0&&s!==void 0&&e.isInstancedMesh!==!0)for(let o=0,a=s.count;o<a;o++)e.isMesh===!0?e.getVertexPosition(o,Hg):Hg.fromBufferAttribute(s,o),Hg.applyMatrix4(e.matrixWorld),this.expandByPoint(Hg);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),kz.copy(e.boundingBox)):(n.boundingBox===null&&n.computeBoundingBox(),kz.copy(n.boundingBox)),kz.applyMatrix4(e.matrixWorld),this.union(kz)}const r=e.children;for(let s=0,o=r.length;s<o;s++)this.expandByObject(r[s],t);return this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,Hg),Hg.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter($L),Uz.subVectors(this.max,$L),CI.subVectors(e.a,$L),MI.subVectors(e.b,$L),II.subVectors(e.c,$L),HA.subVectors(MI,CI),VA.subVectors(II,MI),AE.subVectors(CI,II);let t=[0,-HA.z,HA.y,0,-VA.z,VA.y,0,-AE.z,AE.y,HA.z,0,-HA.x,VA.z,0,-VA.x,AE.z,0,-AE.x,-HA.y,HA.x,0,-VA.y,VA.x,0,-AE.y,AE.x,0];return!hZ(t,CI,MI,II,Uz)||(t=[1,0,0,0,1,0,0,0,1],!hZ(t,CI,MI,II,Uz))?!1:(zz.crossVectors(HA,VA),t=[zz.x,zz.y,zz.z],hZ(t,CI,MI,II,Uz))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Hg).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Hg).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(xv[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),xv[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),xv[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),xv[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),xv[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),xv[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),xv[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),xv[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(xv),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}};const xv=[new pt,new pt,new pt,new pt,new pt,new pt,new pt,new pt],Hg=new pt,kz=new v_,CI=new pt,MI=new pt,II=new pt,HA=new pt,VA=new pt,AE=new pt,$L=new pt,Uz=new pt,zz=new pt,xE=new pt;function hZ(i,e,t,n,r){for(let s=0,o=i.length-3;s<=o;s+=3){xE.fromArray(i,s);const a=r.x*Math.abs(xE.x)+r.y*Math.abs(xE.y)+r.z*Math.abs(xE.z),l=e.dot(xE),c=t.dot(xE),h=n.dot(xE);if(Math.max(-Math.max(l,c,h),Math.min(l,c,h))>a)return!1}return!0}const prt=new v_,qL=new pt,uZ=new pt;let dZ=class{constructor(e=new pt,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;t!==void 0?n.copy(t):prt.setFromPoints(e).getCenter(n);let r=0;for(let s=0,o=e.length;s<o;s++)r=Math.max(r,n.distanceToSquared(e[s]));return this.radius=Math.sqrt(r),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const n=this.center.distanceToSquared(e);return t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;qL.subVectors(e,this.center);const t=qL.lengthSq();if(t>this.radius*this.radius){const n=Math.sqrt(t),r=(n-this.radius)*.5;this.center.addScaledVector(qL,r/n),this.radius+=r}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(uZ.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(qL.copy(e.center).add(uZ)),this.expandByPoint(qL.copy(e.center).sub(uZ))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}};const wv=new pt,pZ=new pt,Hz=new pt,GA=new pt,fZ=new pt,Vz=new pt,mZ=new pt;let ove=class{constructor(e=new pt,t=new pt(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,wv)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=wv.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(wv.copy(this.origin).addScaledVector(this.direction,t),wv.distanceToSquared(e))}distanceSqToSegment(e,t,n,r){pZ.copy(e).add(t).multiplyScalar(.5),Hz.copy(t).sub(e).normalize(),GA.copy(this.origin).sub(pZ);const s=e.distanceTo(t)*.5,o=-this.direction.dot(Hz),a=GA.dot(this.direction),l=-GA.dot(Hz),c=GA.lengthSq(),h=Math.abs(1-o*o);let u,d,p,f;if(h>0)if(u=o*l-a,d=o*a-l,f=s*h,u>=0)if(d>=-f)if(d<=f){const g=1/h;u*=g,d*=g,p=u*(u+o*d+2*a)+d*(o*u+d+2*l)+c}else d=s,u=Math.max(0,-(o*d+a)),p=-u*u+d*(d+2*l)+c;else d=-s,u=Math.max(0,-(o*d+a)),p=-u*u+d*(d+2*l)+c;else d<=-f?(u=Math.max(0,-(-o*s+a)),d=u>0?-s:Math.min(Math.max(-s,-l),s),p=-u*u+d*(d+2*l)+c):d<=f?(u=0,d=Math.min(Math.max(-s,-l),s),p=d*(d+2*l)+c):(u=Math.max(0,-(o*s+a)),d=u>0?s:Math.min(Math.max(-s,-l),s),p=-u*u+d*(d+2*l)+c);else d=o>0?-s:s,u=Math.max(0,-(o*d+a)),p=-u*u+d*(d+2*l)+c;return n&&n.copy(this.origin).addScaledVector(this.direction,u),r&&r.copy(pZ).addScaledVector(Hz,d),p}intersectSphere(e,t){wv.subVectors(e.center,this.origin);const n=wv.dot(this.direction),r=wv.dot(wv)-n*n,s=e.radius*e.radius;if(r>s)return null;const o=Math.sqrt(s-r),a=n-o,l=n+o;return l<0?null:a<0?this.at(l,t):this.at(a,t)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,r,s,o,a,l;const c=1/this.direction.x,h=1/this.direction.y,u=1/this.direction.z,d=this.origin;return c>=0?(n=(e.min.x-d.x)*c,r=(e.max.x-d.x)*c):(n=(e.max.x-d.x)*c,r=(e.min.x-d.x)*c),h>=0?(s=(e.min.y-d.y)*h,o=(e.max.y-d.y)*h):(s=(e.max.y-d.y)*h,o=(e.min.y-d.y)*h),n>o||s>r||((s>n||isNaN(n))&&(n=s),(o<r||isNaN(r))&&(r=o),u>=0?(a=(e.min.z-d.z)*u,l=(e.max.z-d.z)*u):(a=(e.max.z-d.z)*u,l=(e.min.z-d.z)*u),n>l||a>r)||((a>n||n!==n)&&(n=a),(l<r||r!==r)&&(r=l),r<0)?null:this.at(n>=0?n:r,t)}intersectsBox(e){return this.intersectBox(e,wv)!==null}intersectTriangle(e,t,n,r,s){fZ.subVectors(t,e),Vz.subVectors(n,e),mZ.crossVectors(fZ,Vz);let o=this.direction.dot(mZ),a;if(o>0){if(r)return null;a=1}else if(o<0)a=-1,o=-o;else return null;GA.subVectors(this.origin,e);const l=a*this.direction.dot(Vz.crossVectors(GA,Vz));if(l<0)return null;const c=a*this.direction.dot(fZ.cross(GA));if(c<0||l+c>o)return null;const h=-a*GA.dot(mZ);return h<0?null:this.at(h/o,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}},rr=class lye{constructor(e,t,n,r,s,o,a,l,c,h,u,d,p,f,g,_){lye.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,n,r,s,o,a,l,c,h,u,d,p,f,g,_)}set(e,t,n,r,s,o,a,l,c,h,u,d,p,f,g,_){const y=this.elements;return y[0]=e,y[4]=t,y[8]=n,y[12]=r,y[1]=s,y[5]=o,y[9]=a,y[13]=l,y[2]=c,y[6]=h,y[10]=u,y[14]=d,y[3]=p,y[7]=f,y[11]=g,y[15]=_,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new lye().fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return this.determinant()===0?(e.set(1,0,0),t.set(0,1,0),n.set(0,0,1),this):(e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this)}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){if(e.determinant()===0)return this.identity();const t=this.elements,n=e.elements,r=1/PI.setFromMatrixColumn(e,0).length(),s=1/PI.setFromMatrixColumn(e,1).length(),o=1/PI.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*s,t[5]=n[5]*s,t[6]=n[6]*s,t[7]=0,t[8]=n[8]*o,t[9]=n[9]*o,t[10]=n[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,n=e.x,r=e.y,s=e.z,o=Math.cos(n),a=Math.sin(n),l=Math.cos(r),c=Math.sin(r),h=Math.cos(s),u=Math.sin(s);if(e.order==="XYZ"){const d=o*h,p=o*u,f=a*h,g=a*u;t[0]=l*h,t[4]=-l*u,t[8]=c,t[1]=p+f*c,t[5]=d-g*c,t[9]=-a*l,t[2]=g-d*c,t[6]=f+p*c,t[10]=o*l}else if(e.order==="YXZ"){const d=l*h,p=l*u,f=c*h,g=c*u;t[0]=d+g*a,t[4]=f*a-p,t[8]=o*c,t[1]=o*u,t[5]=o*h,t[9]=-a,t[2]=p*a-f,t[6]=g+d*a,t[10]=o*l}else if(e.order==="ZXY"){const d=l*h,p=l*u,f=c*h,g=c*u;t[0]=d-g*a,t[4]=-o*u,t[8]=f+p*a,t[1]=p+f*a,t[5]=o*h,t[9]=g-d*a,t[2]=-o*c,t[6]=a,t[10]=o*l}else if(e.order==="ZYX"){const d=o*h,p=o*u,f=a*h,g=a*u;t[0]=l*h,t[4]=f*c-p,t[8]=d*c+g,t[1]=l*u,t[5]=g*c+d,t[9]=p*c-f,t[2]=-c,t[6]=a*l,t[10]=o*l}else if(e.order==="YZX"){const d=o*l,p=o*c,f=a*l,g=a*c;t[0]=l*h,t[4]=g-d*u,t[8]=f*u+p,t[1]=u,t[5]=o*h,t[9]=-a*h,t[2]=-c*h,t[6]=p*u+f,t[10]=d-g*u}else if(e.order==="XZY"){const d=o*l,p=o*c,f=a*l,g=a*c;t[0]=l*h,t[4]=-u,t[8]=c*h,t[1]=d*u+g,t[5]=o*h,t[9]=p*u-f,t[2]=f*u-p,t[6]=a*h,t[10]=g*u+d}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(frt,e,mrt)}lookAt(e,t,n){const r=this.elements;return lf.subVectors(e,t),lf.lengthSq()===0&&(lf.z=1),lf.normalize(),jA.crossVectors(n,lf),jA.lengthSq()===0&&(Math.abs(n.z)===1?lf.x+=1e-4:lf.z+=1e-4,lf.normalize(),jA.crossVectors(n,lf)),jA.normalize(),Gz.crossVectors(lf,jA),r[0]=jA.x,r[4]=Gz.x,r[8]=lf.x,r[1]=jA.y,r[5]=Gz.y,r[9]=lf.y,r[2]=jA.z,r[6]=Gz.z,r[10]=lf.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,r=t.elements,s=this.elements,o=n[0],a=n[4],l=n[8],c=n[12],h=n[1],u=n[5],d=n[9],p=n[13],f=n[2],g=n[6],_=n[10],y=n[14],A=n[3],x=n[7],w=n[11],E=n[15],S=r[0],I=r[4],C=r[8],T=r[12],D=r[1],M=r[5],R=r[9],v=r[13],P=r[2],O=r[6],B=r[10],k=r[14],H=r[3],z=r[7],j=r[11],$=r[15];return s[0]=o*S+a*D+l*P+c*H,s[4]=o*I+a*M+l*O+c*z,s[8]=o*C+a*R+l*B+c*j,s[12]=o*T+a*v+l*k+c*$,s[1]=h*S+u*D+d*P+p*H,s[5]=h*I+u*M+d*O+p*z,s[9]=h*C+u*R+d*B+p*j,s[13]=h*T+u*v+d*k+p*$,s[2]=f*S+g*D+_*P+y*H,s[6]=f*I+g*M+_*O+y*z,s[10]=f*C+g*R+_*B+y*j,s[14]=f*T+g*v+_*k+y*$,s[3]=A*S+x*D+w*P+E*H,s[7]=A*I+x*M+w*O+E*z,s[11]=A*C+x*R+w*B+E*j,s[15]=A*T+x*v+w*k+E*$,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[4],r=e[8],s=e[12],o=e[1],a=e[5],l=e[9],c=e[13],h=e[2],u=e[6],d=e[10],p=e[14],f=e[3],g=e[7],_=e[11],y=e[15],A=l*p-c*d,x=a*p-c*u,w=a*d-l*u,E=o*p-c*h,S=o*d-l*h,I=o*u-a*h;return t*(g*A-_*x+y*w)-n*(f*A-_*E+y*S)+r*(f*x-g*E+y*I)-s*(f*w-g*S+_*I)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],h=e[8],u=e[9],d=e[10],p=e[11],f=e[12],g=e[13],_=e[14],y=e[15],A=u*_*c-g*d*c+g*l*p-a*_*p-u*l*y+a*d*y,x=f*d*c-h*_*c-f*l*p+o*_*p+h*l*y-o*d*y,w=h*g*c-f*u*c+f*a*p-o*g*p-h*a*y+o*u*y,E=f*u*l-h*g*l-f*a*d+o*g*d+h*a*_-o*u*_,S=t*A+n*x+r*w+s*E;if(S===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const I=1/S;return e[0]=A*I,e[1]=(g*d*s-u*_*s-g*r*p+n*_*p+u*r*y-n*d*y)*I,e[2]=(a*_*s-g*l*s+g*r*c-n*_*c-a*r*y+n*l*y)*I,e[3]=(u*l*s-a*d*s-u*r*c+n*d*c+a*r*p-n*l*p)*I,e[4]=x*I,e[5]=(h*_*s-f*d*s+f*r*p-t*_*p-h*r*y+t*d*y)*I,e[6]=(f*l*s-o*_*s-f*r*c+t*_*c+o*r*y-t*l*y)*I,e[7]=(o*d*s-h*l*s+h*r*c-t*d*c-o*r*p+t*l*p)*I,e[8]=w*I,e[9]=(f*u*s-h*g*s-f*n*p+t*g*p+h*n*y-t*u*y)*I,e[10]=(o*g*s-f*a*s+f*n*c-t*g*c-o*n*y+t*a*y)*I,e[11]=(h*a*s-o*u*s-h*n*c+t*u*c+o*n*p-t*a*p)*I,e[12]=E*I,e[13]=(h*g*r-f*u*r+f*n*d-t*g*d-h*n*_+t*u*_)*I,e[14]=(f*a*r-o*g*r-f*n*l+t*g*l+o*n*_-t*a*_)*I,e[15]=(o*u*r-h*a*r+h*n*l-t*u*l-o*n*d+t*a*d)*I,this}scale(e){const t=this.elements,n=e.x,r=e.y,s=e.z;return t[0]*=n,t[4]*=r,t[8]*=s,t[1]*=n,t[5]*=r,t[9]*=s,t[2]*=n,t[6]*=r,t[10]*=s,t[3]*=n,t[7]*=r,t[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))}makeTranslation(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),r=Math.sin(t),s=1-n,o=e.x,a=e.y,l=e.z,c=s*o,h=s*a;return this.set(c*o+n,c*a-r*l,c*l+r*a,0,c*a+r*l,h*a+n,h*l-r*o,0,c*l-r*a,h*l+r*o,s*l*l+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,r,s,o){return this.set(1,n,s,0,e,1,o,0,t,r,1,0,0,0,0,1),this}compose(e,t,n){const r=this.elements,s=t._x,o=t._y,a=t._z,l=t._w,c=s+s,h=o+o,u=a+a,d=s*c,p=s*h,f=s*u,g=o*h,_=o*u,y=a*u,A=l*c,x=l*h,w=l*u,E=n.x,S=n.y,I=n.z;return r[0]=(1-(g+y))*E,r[1]=(p+w)*E,r[2]=(f-x)*E,r[3]=0,r[4]=(p-w)*S,r[5]=(1-(d+y))*S,r[6]=(_+A)*S,r[7]=0,r[8]=(f+x)*I,r[9]=(_-A)*I,r[10]=(1-(d+g))*I,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,n){const r=this.elements;if(e.x=r[12],e.y=r[13],e.z=r[14],this.determinant()===0)return n.set(1,1,1),t.identity(),this;let s=PI.set(r[0],r[1],r[2]).length();const o=PI.set(r[4],r[5],r[6]).length(),a=PI.set(r[8],r[9],r[10]).length();this.determinant()<0&&(s=-s),Vg.copy(this);const c=1/s,h=1/o,u=1/a;return Vg.elements[0]*=c,Vg.elements[1]*=c,Vg.elements[2]*=c,Vg.elements[4]*=h,Vg.elements[5]*=h,Vg.elements[6]*=h,Vg.elements[8]*=u,Vg.elements[9]*=u,Vg.elements[10]*=u,t.setFromRotationMatrix(Vg),n.x=s,n.y=o,n.z=a,this}makePerspective(e,t,n,r,s,o,a=y_,l=!1){const c=this.elements,h=2*s/(t-e),u=2*s/(n-r),d=(t+e)/(t-e),p=(n+r)/(n-r);let f,g;if(l)f=s/(o-s),g=o*s/(o-s);else if(a===y_)f=-(o+s)/(o-s),g=-2*o*s/(o-s);else if(a===Nz)f=-o/(o-s),g=-o*s/(o-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return c[0]=h,c[4]=0,c[8]=d,c[12]=0,c[1]=0,c[5]=u,c[9]=p,c[13]=0,c[2]=0,c[6]=0,c[10]=f,c[14]=g,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}makeOrthographic(e,t,n,r,s,o,a=y_,l=!1){const c=this.elements,h=2/(t-e),u=2/(n-r),d=-(t+e)/(t-e),p=-(n+r)/(n-r);let f,g;if(l)f=1/(o-s),g=o/(o-s);else if(a===y_)f=-2/(o-s),g=-(o+s)/(o-s);else if(a===Nz)f=-1/(o-s),g=-s/(o-s);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return c[0]=h,c[4]=0,c[8]=0,c[12]=d,c[1]=0,c[5]=u,c[9]=0,c[13]=p,c[2]=0,c[6]=0,c[10]=f,c[14]=g,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let r=0;r<16;r++)if(t[r]!==n[r])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}};const PI=new pt,Vg=new rr,frt=new pt(0,0,0),mrt=new pt(1,1,1),jA=new pt,Gz=new pt,lf=new pt,ave=new rr,lve=new ia;let Ev=class Gtt{constructor(e=0,t=0,n=0,r=Gtt.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,r=this._order){return this._x=e,this._y=t,this._z=n,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){const r=e.elements,s=r[0],o=r[4],a=r[8],l=r[1],c=r[5],h=r[9],u=r[2],d=r[6],p=r[10];switch(t){case"XYZ":this._y=Math.asin(Zr(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-h,p),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-Zr(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(a,p),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-u,s),this._z=0);break;case"ZXY":this._x=Math.asin(Zr(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-u,p),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-Zr(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(d,p),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(Zr(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,c),this._y=Math.atan2(-u,s)):(this._x=0,this._y=Math.atan2(a,p));break;case"XZY":this._z=Math.asin(-Zr(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-h,p),this._y=0);break;default:pr("Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return ave.makeRotationFromQuaternion(e),this.setFromRotationMatrix(ave,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return lve.setFromEuler(this),this.setFromQuaternion(lve,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}};Ev.DEFAULT_ORDER="XYZ";let cve=class{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}},grt=0;const hve=new pt,DI=new ia,Sv=new rr,jz=new pt,XL=new pt,_rt=new pt,yrt=new ia,uve=new pt(1,0,0),dve=new pt(0,1,0),pve=new pt(0,0,1),fve={type:"added"},vrt={type:"removed"},RI={type:"childadded",child:null},gZ={type:"childremoved",child:null};let sd=class YK extends bE{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:grt++}),this.uuid=jL(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=YK.DEFAULT_UP.clone();const e=new pt,t=new Ev,n=new ia,r=new pt(1,1,1);function s(){n.setFromEuler(t,!1)}function o(){t.setFromQuaternion(n,void 0,!1)}t._onChange(s),n._onChange(o),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new rr},normalMatrix:{value:new lr}}),this.matrix=new rr,this.matrixWorld=new rr,this.matrixAutoUpdate=YK.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=YK.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new cve,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return DI.setFromAxisAngle(e,t),this.quaternion.multiply(DI),this}rotateOnWorldAxis(e,t){return DI.setFromAxisAngle(e,t),this.quaternion.premultiply(DI),this}rotateX(e){return this.rotateOnAxis(uve,e)}rotateY(e){return this.rotateOnAxis(dve,e)}rotateZ(e){return this.rotateOnAxis(pve,e)}translateOnAxis(e,t){return hve.copy(e).applyQuaternion(this.quaternion),this.position.add(hve.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(uve,e)}translateY(e){return this.translateOnAxis(dve,e)}translateZ(e){return this.translateOnAxis(pve,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(Sv.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?jz.copy(e):jz.set(e,t,n);const r=this.parent;this.updateWorldMatrix(!0,!1),XL.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Sv.lookAt(XL,jz,this.up):Sv.lookAt(jz,XL,this.up),this.quaternion.setFromRotationMatrix(Sv),r&&(Sv.extractRotation(r.matrixWorld),DI.setFromRotationMatrix(Sv),this.quaternion.premultiply(DI.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(Ws("Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(fve),RI.child=e,this.dispatchEvent(RI),RI.child=null):Ws("Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}const t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(vrt),gZ.child=e,this.dispatchEvent(gZ),gZ.child=null),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),Sv.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),Sv.multiply(e.parent.matrixWorld)),e.applyMatrix4(Sv),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(fve),RI.child=e,this.dispatchEvent(RI),RI.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let n=0,r=this.children.length;n<r;n++){const o=this.children[n].getObjectByProperty(e,t);if(o!==void 0)return o}}getObjectsByProperty(e,t,n=[]){this[e]===t&&n.push(this);const r=this.children;for(let s=0,o=r.length;s<o;s++)r[s].getObjectsByProperty(e,t,n);return n}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(XL,e,_rt),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(XL,yrt,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverseVisible(e)}traverseAncestors(e){const t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].updateMatrixWorld(e)}updateWorldMatrix(e,t){const n=this.parent;if(e===!0&&n!==null&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),t===!0){const r=this.children;for(let s=0,o=r.length;s<o;s++)r[s].updateWorldMatrix(!1,!0)}}toJSON(e){const t=e===void 0||typeof e=="string",n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});const r={};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.castShadow===!0&&(r.castShadow=!0),this.receiveShadow===!0&&(r.receiveShadow=!0),this.visible===!1&&(r.visible=!1),this.frustumCulled===!1&&(r.frustumCulled=!1),this.renderOrder!==0&&(r.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.geometryInfo=this._geometryInfo.map(a=>({...a,boundingBox:a.boundingBox?a.boundingBox.toJSON():void 0,boundingSphere:a.boundingSphere?a.boundingSphere.toJSON():void 0})),r.instanceInfo=this._instanceInfo.map(a=>({...a})),r.availableInstanceIds=this._availableInstanceIds.slice(),r.availableGeometryIds=this._availableGeometryIds.slice(),r.nextIndexStart=this._nextIndexStart,r.nextVertexStart=this._nextVertexStart,r.geometryCount=this._geometryCount,r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.matricesTexture=this._matricesTexture.toJSON(e),r.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(r.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(r.boundingBox=this.boundingBox.toJSON()));function s(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=s(e.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const l=a.shapes;if(Array.isArray(l))for(let c=0,h=l.length;c<h;c++){const u=l[c];s(e.shapes,u)}else s(e.shapes,l)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(e.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const a=[];for(let l=0,c=this.material.length;l<c;l++)a.push(s(e.materials,this.material[l]));r.material=a}else r.material=s(e.materials,this.material);if(this.children.length>0){r.children=[];for(let a=0;a<this.children.length;a++)r.children.push(this.children[a].toJSON(e).object)}if(this.animations.length>0){r.animations=[];for(let a=0;a<this.animations.length;a++){const l=this.animations[a];r.animations.push(s(e.animations,l))}}if(t){const a=o(e.geometries),l=o(e.materials),c=o(e.textures),h=o(e.images),u=o(e.shapes),d=o(e.skeletons),p=o(e.animations),f=o(e.nodes);a.length>0&&(n.geometries=a),l.length>0&&(n.materials=l),c.length>0&&(n.textures=c),h.length>0&&(n.images=h),u.length>0&&(n.shapes=u),d.length>0&&(n.skeletons=d),p.length>0&&(n.animations=p),f.length>0&&(n.nodes=f)}return n.object=r,n;function o(a){const l=[];for(const c in a){const h=a[c];delete h.metadata,l.push(h)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let n=0;n<e.children.length;n++){const r=e.children[n];this.add(r.clone())}return this}};sd.DEFAULT_UP=new pt(0,1,0),sd.DEFAULT_MATRIX_AUTO_UPDATE=!0,sd.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const Gg=new pt,Tv=new pt,_Z=new pt,Cv=new pt,LI=new pt,OI=new pt,mve=new pt,yZ=new pt,vZ=new pt,bZ=new pt,AZ=new hl,xZ=new hl,wZ=new hl;let YL=class DL{constructor(e=new pt,t=new pt,n=new pt){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,r){r.subVectors(n,t),Gg.subVectors(e,t),r.cross(Gg);const s=r.lengthSq();return s>0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(e,t,n,r,s){Gg.subVectors(r,t),Tv.subVectors(n,t),_Z.subVectors(e,t);const o=Gg.dot(Gg),a=Gg.dot(Tv),l=Gg.dot(_Z),c=Tv.dot(Tv),h=Tv.dot(_Z),u=o*c-a*a;if(u===0)return s.set(0,0,0),null;const d=1/u,p=(c*l-a*h)*d,f=(o*h-a*l)*d;return s.set(1-p-f,f,p)}static containsPoint(e,t,n,r){return this.getBarycoord(e,t,n,r,Cv)===null?!1:Cv.x>=0&&Cv.y>=0&&Cv.x+Cv.y<=1}static getInterpolation(e,t,n,r,s,o,a,l){return this.getBarycoord(e,t,n,r,Cv)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(s,Cv.x),l.addScaledVector(o,Cv.y),l.addScaledVector(a,Cv.z),l)}static getInterpolatedAttribute(e,t,n,r,s,o){return AZ.setScalar(0),xZ.setScalar(0),wZ.setScalar(0),AZ.fromBufferAttribute(e,t),xZ.fromBufferAttribute(e,n),wZ.fromBufferAttribute(e,r),o.setScalar(0),o.addScaledVector(AZ,s.x),o.addScaledVector(xZ,s.y),o.addScaledVector(wZ,s.z),o}static isFrontFacing(e,t,n,r){return Gg.subVectors(n,t),Tv.subVectors(e,t),Gg.cross(Tv).dot(r)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,n,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Gg.subVectors(this.c,this.b),Tv.subVectors(this.a,this.b),Gg.cross(Tv).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return DL.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return DL.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,r,s){return DL.getInterpolation(e,this.a,this.b,this.c,t,n,r,s)}containsPoint(e){return DL.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return DL.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,r=this.b,s=this.c;let o,a;LI.subVectors(r,n),OI.subVectors(s,n),yZ.subVectors(e,n);const l=LI.dot(yZ),c=OI.dot(yZ);if(l<=0&&c<=0)return t.copy(n);vZ.subVectors(e,r);const h=LI.dot(vZ),u=OI.dot(vZ);if(h>=0&&u<=h)return t.copy(r);const d=l*u-h*c;if(d<=0&&l>=0&&h<=0)return o=l/(l-h),t.copy(n).addScaledVector(LI,o);bZ.subVectors(e,s);const p=LI.dot(bZ),f=OI.dot(bZ);if(f>=0&&p<=f)return t.copy(s);const g=p*c-l*f;if(g<=0&&c>=0&&f<=0)return a=c/(c-f),t.copy(n).addScaledVector(OI,a);const _=h*f-p*u;if(_<=0&&u-h>=0&&p-f>=0)return mve.subVectors(s,r),a=(u-h)/(u-h+(p-f)),t.copy(r).addScaledVector(mve,a);const y=1/(_+g+d);return o=g*y,a=d*y,t.copy(n).addScaledVector(LI,o).addScaledVector(OI,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}};const gve={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},WA={h:0,s:0,l:0},Wz={h:0,s:0,l:0};function EZ(i,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?i+(e-i)*6*t:t<1/2?e:t<2/3?i+(e-i)*6*(2/3-t):i}let $s=class{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(t===void 0&&n===void 0){const r=e;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=ym){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Rs.colorSpaceToWorking(this,t),this}setRGB(e,t,n,r=Rs.workingColorSpace){return this.r=e,this.g=t,this.b=n,Rs.colorSpaceToWorking(this,r),this}setHSL(e,t,n,r=Rs.workingColorSpace){if(e=ort(e,1),t=Zr(t,0,1),n=Zr(n,0,1),t===0)this.r=this.g=this.b=n;else{const s=n<=.5?n*(1+t):n+t-n*t,o=2*n-s;this.r=EZ(o,s,e+1/3),this.g=EZ(o,s,e),this.b=EZ(o,s,e-1/3)}return Rs.colorSpaceToWorking(this,r),this}setStyle(e,t=ym){function n(s){s!==void 0&&parseFloat(s)<1&&pr("Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const o=r[1],a=r[2];switch(o){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,t);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,t);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,t);break;default:pr("Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=r[1],o=s.length;if(o===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(s,16),t);pr("Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=ym){const n=gve[e.toLowerCase()];return n!==void 0?this.setHex(n,t):pr("Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=Av(e.r),this.g=Av(e.g),this.b=Av(e.b),this}copyLinearToSRGB(e){return this.r=SI(e.r),this.g=SI(e.g),this.b=SI(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=ym){return Rs.workingToColorSpace(gu.copy(this),e),Math.round(Zr(gu.r*255,0,255))*65536+Math.round(Zr(gu.g*255,0,255))*256+Math.round(Zr(gu.b*255,0,255))}getHexString(e=ym){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Rs.workingColorSpace){Rs.workingToColorSpace(gu.copy(this),t);const n=gu.r,r=gu.g,s=gu.b,o=Math.max(n,r,s),a=Math.min(n,r,s);let l,c;const h=(a+o)/2;if(a===o)l=0,c=0;else{const u=o-a;switch(c=h<=.5?u/(o+a):u/(2-o-a),o){case n:l=(r-s)/u+(r<s?6:0);break;case r:l=(s-n)/u+2;break;case s:l=(n-r)/u+4;break}l/=6}return e.h=l,e.s=c,e.l=h,e}getRGB(e,t=Rs.workingColorSpace){return Rs.workingToColorSpace(gu.copy(this),t),e.r=gu.r,e.g=gu.g,e.b=gu.b,e}getStyle(e=ym){Rs.workingToColorSpace(gu.copy(this),e);const t=gu.r,n=gu.g,r=gu.b;return e!==ym?`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${r.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(n*255)},${Math.round(r*255)})`}offsetHSL(e,t,n){return this.getHSL(WA),this.setHSL(WA.h+e,WA.s+t,WA.l+n)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){this.getHSL(WA),e.getHSL(Wz);const n=rZ(WA.h,Wz.h,t),r=rZ(WA.s,Wz.s,t),s=rZ(WA.l,Wz.l,t);return this.setHSL(n,r,s),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,n=this.g,r=this.b,s=e.elements;return this.r=s[0]*t+s[3]*n+s[6]*r,this.g=s[1]*t+s[4]*n+s[7]*r,this.b=s[2]*t+s[5]*n+s[8]*r,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}};const gu=new $s;$s.NAMES=gve;let brt=0,$z=class extends bE{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:brt++}),this.uuid=jL(),this.name="",this.type="Material",this.blending=UA,this.side=f_,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=UL,this.blendDst=zL,this.blendEquation=gE,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new $s(0,0,0),this.blendAlpha=0,this.depthFunc=vI,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=Yye,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=EI,this.stencilZFail=EI,this.stencilZPass=EI,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const n=e[t];if(n===void 0){pr(`Material: parameter '${t}' has value of undefined.`);continue}const r=this[t];if(r===void 0){pr(`Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[t]=n}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const n={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(n.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(n.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),this.dispersion!==void 0&&(n.dispersion=this.dispersion),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==UA&&(n.blending=this.blending),this.side!==f_&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==UL&&(n.blendSrc=this.blendSrc),this.blendDst!==zL&&(n.blendDst=this.blendDst),this.blendEquation!==gE&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==vI&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==Yye&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==EI&&(n.stencilFail=this.stencilFail),this.stencilZFail!==EI&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==EI&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.allowOverride===!1&&(n.allowOverride=!1),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function r(s){const o=[];for(const a in s){const l=s[a];delete l.metadata,o.push(l)}return o}if(t){const s=r(e.textures),o=r(e.images);s.length>0&&(n.textures=s),o.length>0&&(n.images=o)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let n=null;if(t!==null){const r=t.length;n=new Array(r);for(let s=0;s!==r;++s)n[s]=t[s].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.allowOverride=e.allowOverride,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}},$A=class extends $z{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new $s(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Ev,this.combine=Lye,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}};const Mv=Art();function Art(){const i=new ArrayBuffer(4),e=new Float32Array(i),t=new Uint32Array(i),n=new Uint32Array(512),r=new Uint32Array(512);for(let l=0;l<256;++l){const c=l-127;c<-27?(n[l]=0,n[l|256]=32768,r[l]=24,r[l|256]=24):c<-14?(n[l]=1024>>-c-14,n[l|256]=1024>>-c-14|32768,r[l]=-c-1,r[l|256]=-c-1):c<=15?(n[l]=c+15<<10,n[l|256]=c+15<<10|32768,r[l]=13,r[l|256]=13):c<128?(n[l]=31744,n[l|256]=64512,r[l]=24,r[l|256]=24):(n[l]=31744,n[l|256]=64512,r[l]=13,r[l|256]=13)}const s=new Uint32Array(2048),o=new Uint32Array(64),a=new Uint32Array(64);for(let l=1;l<1024;++l){let c=l<<13,h=0;for(;(c&8388608)===0;)c<<=1,h-=8388608;c&=-8388609,h+=947912704,s[l]=c|h}for(let l=1024;l<2048;++l)s[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)o[l]=l<<23;o[31]=1199570944,o[32]=2147483648;for(let l=33;l<63;++l)o[l]=2147483648+(l-32<<23);o[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(a[l]=1024);return{floatView:e,uint32View:t,baseTable:n,shiftTable:r,mantissaTable:s,exponentTable:o,offsetTable:a}}function xrt(i){Math.abs(i)>65504&&pr("DataUtils.toHalfFloat(): Value out of range."),i=Zr(i,-65504,65504),Mv.floatView[0]=i;const e=Mv.uint32View[0],t=e>>23&511;return Mv.baseTable[t]+((e&8388607)>>Mv.shiftTable[t])}function wrt(i){const e=i>>10;return Mv.uint32View[0]=Mv.mantissaTable[Mv.offsetTable[e]+(i&1023)]+Mv.exponentTable[e],Mv.floatView[0]}let QL=class{static toHalfFloat(e){return xrt(e)}static fromHalfFloat(e){return wrt(e)}};const sc=new pt,qz=new gn;let Ert=0,vm=class{constructor(e,t,n=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:Ert++}),this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=n,this.usage=Qye,this.updateRanges=[],this.gpuType=_m,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let r=0,s=this.itemSize;r<s;r++)this.array[e+r]=t.array[n+r];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,n=this.count;t<n;t++)qz.fromBufferAttribute(this,t),qz.applyMatrix3(e),this.setXY(t,qz.x,qz.y);else if(this.itemSize===3)for(let t=0,n=this.count;t<n;t++)sc.fromBufferAttribute(this,t),sc.applyMatrix3(e),this.setXYZ(t,sc.x,sc.y,sc.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)sc.fromBufferAttribute(this,t),sc.applyMatrix4(e),this.setXYZ(t,sc.x,sc.y,sc.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)sc.fromBufferAttribute(this,t),sc.applyNormalMatrix(e),this.setXYZ(t,sc.x,sc.y,sc.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)sc.fromBufferAttribute(this,t),sc.transformDirection(e),this.setXYZ(t,sc.x,sc.y,sc.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let n=this.array[e*this.itemSize+t];return this.normalized&&(n=WL(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=cp(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=WL(t,this.array)),t}setX(e,t){return this.normalized&&(t=cp(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=WL(t,this.array)),t}setY(e,t){return this.normalized&&(t=cp(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=WL(t,this.array)),t}setZ(e,t){return this.normalized&&(t=cp(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=WL(t,this.array)),t}setW(e,t){return this.normalized&&(t=cp(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=cp(t,this.array),n=cp(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,r){return e*=this.itemSize,this.normalized&&(t=cp(t,this.array),n=cp(n,this.array),r=cp(r,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this}setXYZW(e,t,n,r,s){return e*=this.itemSize,this.normalized&&(t=cp(t,this.array),n=cp(n,this.array),r=cp(r,this.array),s=cp(s,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this.array[e+3]=s,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==Qye&&(e.usage=this.usage),e}},_ve=class extends vm{constructor(e,t,n){super(new Uint16Array(e),t,n)}},yve=class extends vm{constructor(e,t,n){super(new Uint32Array(e),t,n)}},od=class extends vm{constructor(e,t,n){super(new Float32Array(e),t,n)}},Srt=0;const bm=new rr,SZ=new sd,NI=new pt,cf=new v_,KL=new v_,ih=new pt;let Am=class jtt extends bE{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:Srt++}),this.uuid=jL(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.indirectOffset=0,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(Jye(e)?yve:_ve)(e,1):this.index=e,this}setIndirect(e,t=0){return this.indirect=e,this.indirectOffset=t,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);const n=this.attributes.normal;if(n!==void 0){const s=new lr().getNormalMatrix(e);n.applyNormalMatrix(s),n.needsUpdate=!0}const r=this.attributes.tangent;return r!==void 0&&(r.transformDirection(e),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return bm.makeRotationFromQuaternion(e),this.applyMatrix4(bm),this}rotateX(e){return bm.makeRotationX(e),this.applyMatrix4(bm),this}rotateY(e){return bm.makeRotationY(e),this.applyMatrix4(bm),this}rotateZ(e){return bm.makeRotationZ(e),this.applyMatrix4(bm),this}translate(e,t,n){return bm.makeTranslation(e,t,n),this.applyMatrix4(bm),this}scale(e,t,n){return bm.makeScale(e,t,n),this.applyMatrix4(bm),this}lookAt(e){return SZ.lookAt(e),SZ.updateMatrix(),this.applyMatrix4(SZ.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(NI).negate(),this.translate(NI.x,NI.y,NI.z),this}setFromPoints(e){const t=this.getAttribute("position");if(t===void 0){const n=[];for(let r=0,s=e.length;r<s;r++){const o=e[r];n.push(o.x,o.y,o.z||0)}this.setAttribute("position",new od(n,3))}else{const n=Math.min(e.length,t.count);for(let r=0;r<n;r++){const s=e[r];t.setXYZ(r,s.x,s.y,s.z||0)}e.length>t.count&&pr("BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),t.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new v_);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){Ws("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new pt(-1/0,-1/0,-1/0),new pt(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let n=0,r=t.length;n<r;n++){const s=t[n];cf.setFromBufferAttribute(s),this.morphTargetsRelative?(ih.addVectors(this.boundingBox.min,cf.min),this.boundingBox.expandByPoint(ih),ih.addVectors(this.boundingBox.max,cf.max),this.boundingBox.expandByPoint(ih)):(this.boundingBox.expandByPoint(cf.min),this.boundingBox.expandByPoint(cf.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&Ws('BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new dZ);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){Ws("BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new pt,1/0);return}if(e){const n=this.boundingSphere.center;if(cf.setFromBufferAttribute(e),t)for(let s=0,o=t.length;s<o;s++){const a=t[s];KL.setFromBufferAttribute(a),this.morphTargetsRelative?(ih.addVectors(cf.min,KL.min),cf.expandByPoint(ih),ih.addVectors(cf.max,KL.max),cf.expandByPoint(ih)):(cf.expandByPoint(KL.min),cf.expandByPoint(KL.max))}cf.getCenter(n);let r=0;for(let s=0,o=e.count;s<o;s++)ih.fromBufferAttribute(e,s),r=Math.max(r,n.distanceToSquared(ih));if(t)for(let s=0,o=t.length;s<o;s++){const a=t[s],l=this.morphTargetsRelative;for(let c=0,h=a.count;c<h;c++)ih.fromBufferAttribute(a,c),l&&(NI.fromBufferAttribute(e,c),ih.add(NI)),r=Math.max(r,n.distanceToSquared(ih))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&Ws('BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){Ws("BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const n=t.position,r=t.normal,s=t.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new vm(new Float32Array(4*n.count),4));const o=this.getAttribute("tangent"),a=[],l=[];for(let C=0;C<n.count;C++)a[C]=new pt,l[C]=new pt;const c=new pt,h=new pt,u=new pt,d=new gn,p=new gn,f=new gn,g=new pt,_=new pt;function y(C,T,D){c.fromBufferAttribute(n,C),h.fromBufferAttribute(n,T),u.fromBufferAttribute(n,D),d.fromBufferAttribute(s,C),p.fromBufferAttribute(s,T),f.fromBufferAttribute(s,D),h.sub(c),u.sub(c),p.sub(d),f.sub(d);const M=1/(p.x*f.y-f.x*p.y);isFinite(M)&&(g.copy(h).multiplyScalar(f.y).addScaledVector(u,-p.y).multiplyScalar(M),_.copy(u).multiplyScalar(p.x).addScaledVector(h,-f.x).multiplyScalar(M),a[C].add(g),a[T].add(g),a[D].add(g),l[C].add(_),l[T].add(_),l[D].add(_))}let A=this.groups;A.length===0&&(A=[{start:0,count:e.count}]);for(let C=0,T=A.length;C<T;++C){const D=A[C],M=D.start,R=D.count;for(let v=M,P=M+R;v<P;v+=3)y(e.getX(v+0),e.getX(v+1),e.getX(v+2))}const x=new pt,w=new pt,E=new pt,S=new pt;function I(C){E.fromBufferAttribute(r,C),S.copy(E);const T=a[C];x.copy(T),x.sub(E.multiplyScalar(E.dot(T))).normalize(),w.crossVectors(S,T);const M=w.dot(l[C])<0?-1:1;o.setXYZW(C,x.x,x.y,x.z,M)}for(let C=0,T=A.length;C<T;++C){const D=A[C],M=D.start,R=D.count;for(let v=M,P=M+R;v<P;v+=3)I(e.getX(v+0)),I(e.getX(v+1)),I(e.getX(v+2))}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(t!==void 0){let n=this.getAttribute("normal");if(n===void 0)n=new vm(new Float32Array(t.count*3),3),this.setAttribute("normal",n);else for(let d=0,p=n.count;d<p;d++)n.setXYZ(d,0,0,0);const r=new pt,s=new pt,o=new pt,a=new pt,l=new pt,c=new pt,h=new pt,u=new pt;if(e)for(let d=0,p=e.count;d<p;d+=3){const f=e.getX(d+0),g=e.getX(d+1),_=e.getX(d+2);r.fromBufferAttribute(t,f),s.fromBufferAttribute(t,g),o.fromBufferAttribute(t,_),h.subVectors(o,s),u.subVectors(r,s),h.cross(u),a.fromBufferAttribute(n,f),l.fromBufferAttribute(n,g),c.fromBufferAttribute(n,_),a.add(h),l.add(h),c.add(h),n.setXYZ(f,a.x,a.y,a.z),n.setXYZ(g,l.x,l.y,l.z),n.setXYZ(_,c.x,c.y,c.z)}else for(let d=0,p=t.count;d<p;d+=3)r.fromBufferAttribute(t,d+0),s.fromBufferAttribute(t,d+1),o.fromBufferAttribute(t,d+2),h.subVectors(o,s),u.subVectors(r,s),h.cross(u),n.setXYZ(d+0,h.x,h.y,h.z),n.setXYZ(d+1,h.x,h.y,h.z),n.setXYZ(d+2,h.x,h.y,h.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)ih.fromBufferAttribute(e,t),ih.normalize(),e.setXYZ(t,ih.x,ih.y,ih.z)}toNonIndexed(){function e(a,l){const c=a.array,h=a.itemSize,u=a.normalized,d=new c.constructor(l.length*h);let p=0,f=0;for(let g=0,_=l.length;g<_;g++){a.isInterleavedBufferAttribute?p=l[g]*a.data.stride+a.offset:p=l[g]*h;for(let y=0;y<h;y++)d[f++]=c[p++]}return new vm(d,h,u)}if(this.index===null)return pr("BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new jtt,n=this.index.array,r=this.attributes;for(const a in r){const l=r[a],c=e(l,n);t.setAttribute(a,c)}const s=this.morphAttributes;for(const a in s){const l=[],c=s[a];for(let h=0,u=c.length;h<u;h++){const d=c[h],p=e(d,n);l.push(p)}t.morphAttributes[a]=l}t.morphTargetsRelative=this.morphTargetsRelative;const o=this.groups;for(let a=0,l=o.length;a<l;a++){const c=o[a];t.addGroup(c.start,c.count,c.materialIndex)}return t}toJSON(){const e={metadata:{version:4.7,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const n=this.attributes;for(const l in n){const c=n[l];e.data.attributes[l]=c.toJSON(e.data)}const r={};let s=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],h=[];for(let u=0,d=c.length;u<d;u++){const p=c[u];h.push(p.toJSON(e.data))}h.length>0&&(r[l]=h,s=!0)}s&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere=a.toJSON()),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const n=e.index;n!==null&&this.setIndex(n.clone());const r=e.attributes;for(const c in r){const h=r[c];this.setAttribute(c,h.clone(t))}const s=e.morphAttributes;for(const c in s){const h=[],u=s[c];for(let d=0,p=u.length;d<p;d++)h.push(u[d].clone(t));this.morphAttributes[c]=h}this.morphTargetsRelative=e.morphTargetsRelative;const o=e.groups;for(let c=0,h=o.length;c<h;c++){const u=o[c];this.addGroup(u.start,u.count,u.materialIndex)}const a=e.boundingBox;a!==null&&(this.boundingBox=a.clone());const l=e.boundingSphere;return l!==null&&(this.boundingSphere=l.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}};const vve=new rr,wE=new ove,Xz=new dZ,bve=new pt,Yz=new pt,Qz=new pt,Kz=new pt,TZ=new pt,Jz=new pt,Ave=new pt,Zz=new pt;let ul=class extends sd{constructor(e=new Am,t=new $A){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const r=t[n[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s<o;s++){const a=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=s}}}}getVertexPosition(e,t){const n=this.geometry,r=n.attributes.position,s=n.morphAttributes.position,o=n.morphTargetsRelative;t.fromBufferAttribute(r,e);const a=this.morphTargetInfluences;if(s&&a){Jz.set(0,0,0);for(let l=0,c=s.length;l<c;l++){const h=a[l],u=s[l];h!==0&&(TZ.fromBufferAttribute(u,e),o?Jz.addScaledVector(TZ,h):Jz.addScaledVector(TZ.sub(t),h))}t.add(Jz)}return t}raycast(e,t){const n=this.geometry,r=this.material,s=this.matrixWorld;r!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),Xz.copy(n.boundingSphere),Xz.applyMatrix4(s),wE.copy(e.ray).recast(e.near),!(Xz.containsPoint(wE.origin)===!1&&(wE.intersectSphere(Xz,bve)===null||wE.origin.distanceToSquared(bve)>(e.far-e.near)**2))&&(vve.copy(s).invert(),wE.copy(e.ray).applyMatrix4(vve),!(n.boundingBox!==null&&wE.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(e,t,wE)))}_computeIntersections(e,t,n){let r;const s=this.geometry,o=this.material,a=s.index,l=s.attributes.position,c=s.attributes.uv,h=s.attributes.uv1,u=s.attributes.normal,d=s.groups,p=s.drawRange;if(a!==null)if(Array.isArray(o))for(let f=0,g=d.length;f<g;f++){const _=d[f],y=o[_.materialIndex],A=Math.max(_.start,p.start),x=Math.min(a.count,Math.min(_.start+_.count,p.start+p.count));for(let w=A,E=x;w<E;w+=3){const S=a.getX(w),I=a.getX(w+1),C=a.getX(w+2);r=e8(this,y,e,n,c,h,u,S,I,C),r&&(r.faceIndex=Math.floor(w/3),r.face.materialIndex=_.materialIndex,t.push(r))}}else{const f=Math.max(0,p.start),g=Math.min(a.count,p.start+p.count);for(let _=f,y=g;_<y;_+=3){const A=a.getX(_),x=a.getX(_+1),w=a.getX(_+2);r=e8(this,o,e,n,c,h,u,A,x,w),r&&(r.faceIndex=Math.floor(_/3),t.push(r))}}else if(l!==void 0)if(Array.isArray(o))for(let f=0,g=d.length;f<g;f++){const _=d[f],y=o[_.materialIndex],A=Math.max(_.start,p.start),x=Math.min(l.count,Math.min(_.start+_.count,p.start+p.count));for(let w=A,E=x;w<E;w+=3){const S=w,I=w+1,C=w+2;r=e8(this,y,e,n,c,h,u,S,I,C),r&&(r.faceIndex=Math.floor(w/3),r.face.materialIndex=_.materialIndex,t.push(r))}}else{const f=Math.max(0,p.start),g=Math.min(l.count,p.start+p.count);for(let _=f,y=g;_<y;_+=3){const A=_,x=_+1,w=_+2;r=e8(this,o,e,n,c,h,u,A,x,w),r&&(r.faceIndex=Math.floor(_/3),t.push(r))}}}};function Trt(i,e,t,n,r,s,o,a){let l;if(e.side===lp?l=n.intersectTriangle(o,s,r,!0,a):l=n.intersectTriangle(r,s,o,e.side===f_,a),l===null)return null;Zz.copy(a),Zz.applyMatrix4(i.matrixWorld);const c=t.ray.origin.distanceTo(Zz);return c<t.near||c>t.far?null:{distance:c,point:Zz.clone(),object:i}}function e8(i,e,t,n,r,s,o,a,l,c){i.getVertexPosition(a,Yz),i.getVertexPosition(l,Qz),i.getVertexPosition(c,Kz);const h=Trt(i,e,t,n,Yz,Qz,Kz,Ave);if(h){const u=new pt;YL.getBarycoord(Ave,Yz,Qz,Kz,u),r&&(h.uv=YL.getInterpolatedAttribute(r,a,l,c,u,new gn)),s&&(h.uv1=YL.getInterpolatedAttribute(s,a,l,c,u,new gn)),o&&(h.normal=YL.getInterpolatedAttribute(o,a,l,c,u,new pt),h.normal.dot(n.direction)>0&&h.normal.multiplyScalar(-1));const d={a,b:l,c,normal:new pt,materialIndex:0};YL.getNormal(Yz,Qz,Kz,d.normal),h.face=d,h.barycoord=u}return h}let t8=class Wtt extends Am{constructor(e=1,t=1,n=1,r=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:s,depthSegments:o};const a=this;r=Math.floor(r),s=Math.floor(s),o=Math.floor(o);const l=[],c=[],h=[],u=[];let d=0,p=0;f("z","y","x",-1,-1,n,t,e,o,s,0),f("z","y","x",1,-1,n,t,-e,o,s,1),f("x","z","y",1,1,e,n,t,r,o,2),f("x","z","y",1,-1,e,n,-t,r,o,3),f("x","y","z",1,-1,e,t,n,r,s,4),f("x","y","z",-1,-1,e,t,-n,r,s,5),this.setIndex(l),this.setAttribute("position",new od(c,3)),this.setAttribute("normal",new od(h,3)),this.setAttribute("uv",new od(u,2));function f(g,_,y,A,x,w,E,S,I,C,T){const D=w/I,M=E/C,R=w/2,v=E/2,P=S/2,O=I+1,B=C+1;let k=0,H=0;const z=new pt;for(let j=0;j<B;j++){const $=j*M-v;for(let Q=0;Q<O;Q++){const se=Q*D-R;z[g]=se*A,z[_]=$*x,z[y]=P,c.push(z.x,z.y,z.z),z[g]=0,z[_]=0,z[y]=S>0?1:-1,h.push(z.x,z.y,z.z),u.push(Q/I),u.push(1-j/C),k+=1}}for(let j=0;j<C;j++)for(let $=0;$<I;$++){const Q=d+$+O*j,se=d+$+O*(j+1),te=d+($+1)+O*(j+1),ue=d+($+1)+O*j;l.push(Q,se,ue),l.push(se,te,ue),H+=6}a.addGroup(p,H,T),p+=H,d+=k}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Wtt(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}};function BI(i){const e={};for(const t in i){e[t]={};for(const n in i[t]){const r=i[t][n];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?r.isRenderTargetTexture?(pr("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][n]=null):e[t][n]=r.clone():Array.isArray(r)?e[t][n]=r.slice():e[t][n]=r}}return e}function ad(i){const e={};for(let t=0;t<i.length;t++){const n=BI(i[t]);for(const r in n)e[r]=n[r]}return e}function Crt(i){const e=[];for(let t=0;t<i.length;t++)e.push(i[t].clone());return e}function xve(i){const e=i.getRenderTarget();return e===null?i.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:Rs.workingColorSpace}const Mrt={clone:BI,merge:ad};var Irt=`void main() {
|
|
@@ -4011,7 +4011,7 @@ void main() {
|
|
|
4011
4011
|
|
|
4012
4012
|
}
|
|
4013
4013
|
|
|
4014
|
-
}`;let Jlt=class{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t){if(this.texture===null){const n=new Ive(e.texture);(e.depthNear!==t.depthNear||e.depthFar!==t.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=n}}getMesh(e){if(this.texture!==null&&this.mesh===null){const t=e.cameras[0].viewport,n=new ld({vertexShader:Qlt,fragmentShader:Klt,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new ul(new n8(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}},Zlt=class extends bE{constructor(e,t){super();const n=this;let r=null,s=1,o=null,a="local-floor",l=1,c=null,h=null,u=null,d=null,p=null,f=null;const g=typeof XRWebGLBinding<"u",_=new Jlt,y={},A=t.getContextAttributes();let x=null,w=null;const E=[],S=[],I=new gn;let C=null;const T=new xm;T.viewport=new hl;const D=new xm;D.viewport=new hl;const M=[T,D],R=new jrt;let v=null,P=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(V){let ee=E[V];return ee===void 0&&(ee=new CZ,E[V]=ee),ee.getTargetRaySpace()},this.getControllerGrip=function(V){let ee=E[V];return ee===void 0&&(ee=new CZ,E[V]=ee),ee.getGripSpace()},this.getHand=function(V){let ee=E[V];return ee===void 0&&(ee=new CZ,E[V]=ee),ee.getHandSpace()};function O(V){const ee=S.indexOf(V.inputSource);if(ee===-1)return;const oe=E[ee];oe!==void 0&&(oe.update(V.inputSource,V.frame,c||o),oe.dispatchEvent({type:V.type,data:V.inputSource}))}function B(){r.removeEventListener("select",O),r.removeEventListener("selectstart",O),r.removeEventListener("selectend",O),r.removeEventListener("squeeze",O),r.removeEventListener("squeezestart",O),r.removeEventListener("squeezeend",O),r.removeEventListener("end",B),r.removeEventListener("inputsourceschange",k);for(let V=0;V<E.length;V++){const ee=S[V];ee!==null&&(S[V]=null,E[V].disconnect(ee))}v=null,P=null,_.reset();for(const V in y)delete y[V];e.setRenderTarget(x),p=null,d=null,u=null,r=null,w=null,ue.stop(),n.isPresenting=!1,e.setPixelRatio(C),e.setSize(I.width,I.height,!1),n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(V){s=V,n.isPresenting===!0&&pr("WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(V){a=V,n.isPresenting===!0&&pr("WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return c||o},this.setReferenceSpace=function(V){c=V},this.getBaseLayer=function(){return d!==null?d:p},this.getBinding=function(){return u===null&&g&&(u=new XRWebGLBinding(r,t)),u},this.getFrame=function(){return f},this.getSession=function(){return r},this.setSession=async function(V){if(r=V,r!==null){if(x=e.getRenderTarget(),r.addEventListener("select",O),r.addEventListener("selectstart",O),r.addEventListener("selectend",O),r.addEventListener("squeeze",O),r.addEventListener("squeezestart",O),r.addEventListener("squeezeend",O),r.addEventListener("end",B),r.addEventListener("inputsourceschange",k),A.xrCompatible!==!0&&await t.makeXRCompatible(),C=e.getPixelRatio(),e.getSize(I),g&&"createProjectionLayer"in XRWebGLBinding.prototype){let oe=null,pe=null,ve=null;A.depth&&(ve=A.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,oe=A.stencil?vE:__,pe=A.stencil?VL:nd);const ge={colorFormat:t.RGBA8,depthFormat:ve,scaleFactor:s};u=this.getBinding(),d=u.createProjectionLayer(ge),r.updateRenderState({layers:[d]}),e.setPixelRatio(1),e.setSize(d.textureWidth,d.textureHeight,!1),w=new zg(d.textureWidth,d.textureHeight,{format:rd,type:af,depthTexture:new UI(d.textureWidth,d.textureHeight,pe,void 0,void 0,void 0,void 0,void 0,void 0,oe),stencilBuffer:A.stencil,colorSpace:e.outputColorSpace,samples:A.antialias?4:0,resolveDepthBuffer:d.ignoreDepthValues===!1,resolveStencilBuffer:d.ignoreDepthValues===!1})}else{const oe={antialias:A.antialias,alpha:!0,depth:A.depth,stencil:A.stencil,framebufferScaleFactor:s};p=new XRWebGLLayer(r,t,oe),r.updateRenderState({baseLayer:p}),e.setPixelRatio(1),e.setSize(p.framebufferWidth,p.framebufferHeight,!1),w=new zg(p.framebufferWidth,p.framebufferHeight,{format:rd,type:af,colorSpace:e.outputColorSpace,stencilBuffer:A.stencil,resolveDepthBuffer:p.ignoreDepthValues===!1,resolveStencilBuffer:p.ignoreDepthValues===!1})}w.isXRRenderTarget=!0,this.setFoveation(l),c=null,o=await r.requestReferenceSpace(a),ue.setContext(r),ue.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(r!==null)return r.environmentBlendMode},this.getDepthTexture=function(){return _.getDepthTexture()};function k(V){for(let ee=0;ee<V.removed.length;ee++){const oe=V.removed[ee],pe=S.indexOf(oe);pe>=0&&(S[pe]=null,E[pe].disconnect(oe))}for(let ee=0;ee<V.added.length;ee++){const oe=V.added[ee];let pe=S.indexOf(oe);if(pe===-1){for(let ge=0;ge<E.length;ge++)if(ge>=S.length){S.push(oe),pe=ge;break}else if(S[ge]===null){S[ge]=oe,pe=ge;break}if(pe===-1)break}const ve=E[pe];ve&&ve.connect(oe)}}const H=new pt,z=new pt;function j(V,ee,oe){H.setFromMatrixPosition(ee.matrixWorld),z.setFromMatrixPosition(oe.matrixWorld);const pe=H.distanceTo(z),ve=ee.projectionMatrix.elements,ge=oe.projectionMatrix.elements,je=ve[14]/(ve[10]-1),fe=ve[14]/(ve[10]+1),X=(ve[9]+1)/ve[5],ce=(ve[9]-1)/ve[5],_e=(ve[8]-1)/ve[0],le=(ge[8]+1)/ge[0],G=je*_e,xe=je*le,ze=pe/(-_e+le),Ke=ze*-_e;if(ee.matrixWorld.decompose(V.position,V.quaternion,V.scale),V.translateX(Ke),V.translateZ(ze),V.matrixWorld.compose(V.position,V.quaternion,V.scale),V.matrixWorldInverse.copy(V.matrixWorld).invert(),ve[10]===-1)V.projectionMatrix.copy(ee.projectionMatrix),V.projectionMatrixInverse.copy(ee.projectionMatrixInverse);else{const we=je+ze,U=fe+ze,N=G-Ke,Y=xe+(pe-Ke),de=X*fe/U*we,he=ce*fe/U*we;V.projectionMatrix.makePerspective(N,Y,de,he,we,U),V.projectionMatrixInverse.copy(V.projectionMatrix).invert()}}function $(V,ee){ee===null?V.matrixWorld.copy(V.matrix):V.matrixWorld.multiplyMatrices(ee.matrixWorld,V.matrix),V.matrixWorldInverse.copy(V.matrixWorld).invert()}this.updateCamera=function(V){if(r===null)return;let ee=V.near,oe=V.far;_.texture!==null&&(_.depthNear>0&&(ee=_.depthNear),_.depthFar>0&&(oe=_.depthFar)),R.near=D.near=T.near=ee,R.far=D.far=T.far=oe,(v!==R.near||P!==R.far)&&(r.updateRenderState({depthNear:R.near,depthFar:R.far}),v=R.near,P=R.far),R.layers.mask=V.layers.mask|6,T.layers.mask=R.layers.mask&3,D.layers.mask=R.layers.mask&5;const pe=V.parent,ve=R.cameras;$(R,pe);for(let ge=0;ge<ve.length;ge++)$(ve[ge],pe);ve.length===2?j(R,T,D):R.projectionMatrix.copy(T.projectionMatrix),Q(V,R,pe)};function Q(V,ee,oe){oe===null?V.matrix.copy(ee.matrixWorld):(V.matrix.copy(oe.matrixWorld),V.matrix.invert(),V.matrix.multiply(ee.matrixWorld)),V.matrix.decompose(V.position,V.quaternion,V.scale),V.updateMatrixWorld(!0),V.projectionMatrix.copy(ee.projectionMatrix),V.projectionMatrixInverse.copy(ee.projectionMatrixInverse),V.isPerspectiveCamera&&(V.fov=nZ*2*Math.atan(1/V.projectionMatrix.elements[5]),V.zoom=1)}this.getCamera=function(){return R},this.getFoveation=function(){if(!(d===null&&p===null))return l},this.setFoveation=function(V){l=V,d!==null&&(d.fixedFoveation=V),p!==null&&p.fixedFoveation!==void 0&&(p.fixedFoveation=V)},this.hasDepthSensing=function(){return _.texture!==null},this.getDepthSensingMesh=function(){return _.getMesh(R)},this.getCameraTexture=function(V){return y[V]};let se=null;function te(V,ee){if(h=ee.getViewerPose(c||o),f=ee,h!==null){const oe=h.views;p!==null&&(e.setRenderTargetFramebuffer(w,p.framebuffer),e.setRenderTarget(w));let pe=!1;oe.length!==R.cameras.length&&(R.cameras.length=0,pe=!0);for(let fe=0;fe<oe.length;fe++){const X=oe[fe];let ce=null;if(p!==null)ce=p.getViewport(X);else{const le=u.getViewSubImage(d,X);ce=le.viewport,fe===0&&(e.setRenderTargetTextures(w,le.colorTexture,le.depthStencilTexture),e.setRenderTarget(w))}let _e=M[fe];_e===void 0&&(_e=new xm,_e.layers.enable(fe),_e.viewport=new hl,M[fe]=_e),_e.matrix.fromArray(X.transform.matrix),_e.matrix.decompose(_e.position,_e.quaternion,_e.scale),_e.projectionMatrix.fromArray(X.projectionMatrix),_e.projectionMatrixInverse.copy(_e.projectionMatrix).invert(),_e.viewport.set(ce.x,ce.y,ce.width,ce.height),fe===0&&(R.matrix.copy(_e.matrix),R.matrix.decompose(R.position,R.quaternion,R.scale)),pe===!0&&R.cameras.push(_e)}const ve=r.enabledFeatures;if(ve&&ve.includes("depth-sensing")&&r.depthUsage=="gpu-optimized"&&g){u=n.getBinding();const fe=u.getDepthInformation(oe[0]);fe&&fe.isValid&&fe.texture&&_.init(fe,r.renderState)}if(ve&&ve.includes("camera-access")&&g){e.state.unbindTexture(),u=n.getBinding();for(let fe=0;fe<oe.length;fe++){const X=oe[fe].camera;if(X){let ce=y[X];ce||(ce=new Ive,y[X]=ce);const _e=u.getCameraImage(X);ce.sourceTexture=_e}}}}for(let oe=0;oe<E.length;oe++){const pe=S[oe],ve=E[oe];pe!==null&&ve!==void 0&&ve.update(pe,ee,c||o)}se&&se(V,ee),ee.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:ee}),f=null}const ue=new Rve;ue.setAnimationLoop(te),this.setAnimationLoop=function(V){se=V},this.dispose=function(){}}};const CE=new Ev,ect=new rr;function tct(i,e){function t(_,y){_.matrixAutoUpdate===!0&&_.updateMatrix(),y.value.copy(_.matrix)}function n(_,y){y.color.getRGB(_.fogColor.value,xve(i)),y.isFog?(_.fogNear.value=y.near,_.fogFar.value=y.far):y.isFogExp2&&(_.fogDensity.value=y.density)}function r(_,y,A,x,w){y.isMeshBasicMaterial||y.isMeshLambertMaterial?s(_,y):y.isMeshToonMaterial?(s(_,y),u(_,y)):y.isMeshPhongMaterial?(s(_,y),h(_,y)):y.isMeshStandardMaterial?(s(_,y),d(_,y),y.isMeshPhysicalMaterial&&p(_,y,w)):y.isMeshMatcapMaterial?(s(_,y),f(_,y)):y.isMeshDepthMaterial?s(_,y):y.isMeshDistanceMaterial?(s(_,y),g(_,y)):y.isMeshNormalMaterial?s(_,y):y.isLineBasicMaterial?(o(_,y),y.isLineDashedMaterial&&a(_,y)):y.isPointsMaterial?l(_,y,A,x):y.isSpriteMaterial?c(_,y):y.isShadowMaterial?(_.color.value.copy(y.color),_.opacity.value=y.opacity):y.isShaderMaterial&&(y.uniformsNeedUpdate=!1)}function s(_,y){_.opacity.value=y.opacity,y.color&&_.diffuse.value.copy(y.color),y.emissive&&_.emissive.value.copy(y.emissive).multiplyScalar(y.emissiveIntensity),y.map&&(_.map.value=y.map,t(y.map,_.mapTransform)),y.alphaMap&&(_.alphaMap.value=y.alphaMap,t(y.alphaMap,_.alphaMapTransform)),y.bumpMap&&(_.bumpMap.value=y.bumpMap,t(y.bumpMap,_.bumpMapTransform),_.bumpScale.value=y.bumpScale,y.side===lp&&(_.bumpScale.value*=-1)),y.normalMap&&(_.normalMap.value=y.normalMap,t(y.normalMap,_.normalMapTransform),_.normalScale.value.copy(y.normalScale),y.side===lp&&_.normalScale.value.negate()),y.displacementMap&&(_.displacementMap.value=y.displacementMap,t(y.displacementMap,_.displacementMapTransform),_.displacementScale.value=y.displacementScale,_.displacementBias.value=y.displacementBias),y.emissiveMap&&(_.emissiveMap.value=y.emissiveMap,t(y.emissiveMap,_.emissiveMapTransform)),y.specularMap&&(_.specularMap.value=y.specularMap,t(y.specularMap,_.specularMapTransform)),y.alphaTest>0&&(_.alphaTest.value=y.alphaTest);const A=e.get(y),x=A.envMap,w=A.envMapRotation;x&&(_.envMap.value=x,CE.copy(w),CE.x*=-1,CE.y*=-1,CE.z*=-1,x.isCubeTexture&&x.isRenderTargetTexture===!1&&(CE.y*=-1,CE.z*=-1),_.envMapRotation.value.setFromMatrix4(ect.makeRotationFromEuler(CE)),_.flipEnvMap.value=x.isCubeTexture&&x.isRenderTargetTexture===!1?-1:1,_.reflectivity.value=y.reflectivity,_.ior.value=y.ior,_.refractionRatio.value=y.refractionRatio),y.lightMap&&(_.lightMap.value=y.lightMap,_.lightMapIntensity.value=y.lightMapIntensity,t(y.lightMap,_.lightMapTransform)),y.aoMap&&(_.aoMap.value=y.aoMap,_.aoMapIntensity.value=y.aoMapIntensity,t(y.aoMap,_.aoMapTransform))}function o(_,y){_.diffuse.value.copy(y.color),_.opacity.value=y.opacity,y.map&&(_.map.value=y.map,t(y.map,_.mapTransform))}function a(_,y){_.dashSize.value=y.dashSize,_.totalSize.value=y.dashSize+y.gapSize,_.scale.value=y.scale}function l(_,y,A,x){_.diffuse.value.copy(y.color),_.opacity.value=y.opacity,_.size.value=y.size*A,_.scale.value=x*.5,y.map&&(_.map.value=y.map,t(y.map,_.uvTransform)),y.alphaMap&&(_.alphaMap.value=y.alphaMap,t(y.alphaMap,_.alphaMapTransform)),y.alphaTest>0&&(_.alphaTest.value=y.alphaTest)}function c(_,y){_.diffuse.value.copy(y.color),_.opacity.value=y.opacity,_.rotation.value=y.rotation,y.map&&(_.map.value=y.map,t(y.map,_.mapTransform)),y.alphaMap&&(_.alphaMap.value=y.alphaMap,t(y.alphaMap,_.alphaMapTransform)),y.alphaTest>0&&(_.alphaTest.value=y.alphaTest)}function h(_,y){_.specular.value.copy(y.specular),_.shininess.value=Math.max(y.shininess,1e-4)}function u(_,y){y.gradientMap&&(_.gradientMap.value=y.gradientMap)}function d(_,y){_.metalness.value=y.metalness,y.metalnessMap&&(_.metalnessMap.value=y.metalnessMap,t(y.metalnessMap,_.metalnessMapTransform)),_.roughness.value=y.roughness,y.roughnessMap&&(_.roughnessMap.value=y.roughnessMap,t(y.roughnessMap,_.roughnessMapTransform)),y.envMap&&(_.envMapIntensity.value=y.envMapIntensity)}function p(_,y,A){_.ior.value=y.ior,y.sheen>0&&(_.sheenColor.value.copy(y.sheenColor).multiplyScalar(y.sheen),_.sheenRoughness.value=y.sheenRoughness,y.sheenColorMap&&(_.sheenColorMap.value=y.sheenColorMap,t(y.sheenColorMap,_.sheenColorMapTransform)),y.sheenRoughnessMap&&(_.sheenRoughnessMap.value=y.sheenRoughnessMap,t(y.sheenRoughnessMap,_.sheenRoughnessMapTransform))),y.clearcoat>0&&(_.clearcoat.value=y.clearcoat,_.clearcoatRoughness.value=y.clearcoatRoughness,y.clearcoatMap&&(_.clearcoatMap.value=y.clearcoatMap,t(y.clearcoatMap,_.clearcoatMapTransform)),y.clearcoatRoughnessMap&&(_.clearcoatRoughnessMap.value=y.clearcoatRoughnessMap,t(y.clearcoatRoughnessMap,_.clearcoatRoughnessMapTransform)),y.clearcoatNormalMap&&(_.clearcoatNormalMap.value=y.clearcoatNormalMap,t(y.clearcoatNormalMap,_.clearcoatNormalMapTransform),_.clearcoatNormalScale.value.copy(y.clearcoatNormalScale),y.side===lp&&_.clearcoatNormalScale.value.negate())),y.dispersion>0&&(_.dispersion.value=y.dispersion),y.iridescence>0&&(_.iridescence.value=y.iridescence,_.iridescenceIOR.value=y.iridescenceIOR,_.iridescenceThicknessMinimum.value=y.iridescenceThicknessRange[0],_.iridescenceThicknessMaximum.value=y.iridescenceThicknessRange[1],y.iridescenceMap&&(_.iridescenceMap.value=y.iridescenceMap,t(y.iridescenceMap,_.iridescenceMapTransform)),y.iridescenceThicknessMap&&(_.iridescenceThicknessMap.value=y.iridescenceThicknessMap,t(y.iridescenceThicknessMap,_.iridescenceThicknessMapTransform))),y.transmission>0&&(_.transmission.value=y.transmission,_.transmissionSamplerMap.value=A.texture,_.transmissionSamplerSize.value.set(A.width,A.height),y.transmissionMap&&(_.transmissionMap.value=y.transmissionMap,t(y.transmissionMap,_.transmissionMapTransform)),_.thickness.value=y.thickness,y.thicknessMap&&(_.thicknessMap.value=y.thicknessMap,t(y.thicknessMap,_.thicknessMapTransform)),_.attenuationDistance.value=y.attenuationDistance,_.attenuationColor.value.copy(y.attenuationColor)),y.anisotropy>0&&(_.anisotropyVector.value.set(y.anisotropy*Math.cos(y.anisotropyRotation),y.anisotropy*Math.sin(y.anisotropyRotation)),y.anisotropyMap&&(_.anisotropyMap.value=y.anisotropyMap,t(y.anisotropyMap,_.anisotropyMapTransform))),_.specularIntensity.value=y.specularIntensity,_.specularColor.value.copy(y.specularColor),y.specularColorMap&&(_.specularColorMap.value=y.specularColorMap,t(y.specularColorMap,_.specularColorMapTransform)),y.specularIntensityMap&&(_.specularIntensityMap.value=y.specularIntensityMap,t(y.specularIntensityMap,_.specularIntensityMapTransform))}function f(_,y){y.matcap&&(_.matcap.value=y.matcap)}function g(_,y){const A=e.get(y).light;_.referencePosition.value.setFromMatrixPosition(A.matrixWorld),_.nearDistance.value=A.shadow.camera.near,_.farDistance.value=A.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:r}}function ict(i,e,t,n){let r={},s={},o=[];const a=i.getParameter(i.MAX_UNIFORM_BUFFER_BINDINGS);function l(A,x){const w=x.program;n.uniformBlockBinding(A,w)}function c(A,x){let w=r[A.id];w===void 0&&(f(A),w=h(A),r[A.id]=w,A.addEventListener("dispose",_));const E=x.program;n.updateUBOMapping(A,E);const S=e.render.frame;s[A.id]!==S&&(d(A),s[A.id]=S)}function h(A){const x=u();A.__bindingPointIndex=x;const w=i.createBuffer(),E=A.__size,S=A.usage;return i.bindBuffer(i.UNIFORM_BUFFER,w),i.bufferData(i.UNIFORM_BUFFER,E,S),i.bindBuffer(i.UNIFORM_BUFFER,null),i.bindBufferBase(i.UNIFORM_BUFFER,x,w),w}function u(){for(let A=0;A<a;A++)if(o.indexOf(A)===-1)return o.push(A),A;return Ws("WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function d(A){const x=r[A.id],w=A.uniforms,E=A.__cache;i.bindBuffer(i.UNIFORM_BUFFER,x);for(let S=0,I=w.length;S<I;S++){const C=Array.isArray(w[S])?w[S]:[w[S]];for(let T=0,D=C.length;T<D;T++){const M=C[T];if(p(M,S,T,E)===!0){const R=M.__offset,v=Array.isArray(M.value)?M.value:[M.value];let P=0;for(let O=0;O<v.length;O++){const B=v[O],k=g(B);typeof B=="number"||typeof B=="boolean"?(M.__data[0]=B,i.bufferSubData(i.UNIFORM_BUFFER,R+P,M.__data)):B.isMatrix3?(M.__data[0]=B.elements[0],M.__data[1]=B.elements[1],M.__data[2]=B.elements[2],M.__data[3]=0,M.__data[4]=B.elements[3],M.__data[5]=B.elements[4],M.__data[6]=B.elements[5],M.__data[7]=0,M.__data[8]=B.elements[6],M.__data[9]=B.elements[7],M.__data[10]=B.elements[8],M.__data[11]=0):(B.toArray(M.__data,P),P+=k.storage/Float32Array.BYTES_PER_ELEMENT)}i.bufferSubData(i.UNIFORM_BUFFER,R,M.__data)}}}i.bindBuffer(i.UNIFORM_BUFFER,null)}function p(A,x,w,E){const S=A.value,I=x+"_"+w;if(E[I]===void 0)return typeof S=="number"||typeof S=="boolean"?E[I]=S:E[I]=S.clone(),!0;{const C=E[I];if(typeof S=="number"||typeof S=="boolean"){if(C!==S)return E[I]=S,!0}else if(C.equals(S)===!1)return C.copy(S),!0}return!1}function f(A){const x=A.uniforms;let w=0;const E=16;for(let I=0,C=x.length;I<C;I++){const T=Array.isArray(x[I])?x[I]:[x[I]];for(let D=0,M=T.length;D<M;D++){const R=T[D],v=Array.isArray(R.value)?R.value:[R.value];for(let P=0,O=v.length;P<O;P++){const B=v[P],k=g(B),H=w%E,z=H%k.boundary,j=H+z;w+=z,j!==0&&E-j<k.storage&&(w+=E-j),R.__data=new Float32Array(k.storage/Float32Array.BYTES_PER_ELEMENT),R.__offset=w,w+=k.storage}}}const S=w%E;return S>0&&(w+=E-S),A.__size=w,A.__cache={},this}function g(A){const x={boundary:0,storage:0};return typeof A=="number"||typeof A=="boolean"?(x.boundary=4,x.storage=4):A.isVector2?(x.boundary=8,x.storage=8):A.isVector3||A.isColor?(x.boundary=16,x.storage=12):A.isVector4?(x.boundary=16,x.storage=16):A.isMatrix3?(x.boundary=48,x.storage=48):A.isMatrix4?(x.boundary=64,x.storage=64):A.isTexture?pr("WebGLRenderer: Texture samplers can not be part of an uniforms group."):pr("WebGLRenderer: Unsupported uniform value type.",A),x}function _(A){const x=A.target;x.removeEventListener("dispose",_);const w=o.indexOf(x.__bindingPointIndex);o.splice(w,1),i.deleteBuffer(r[x.id]),delete r[x.id],delete s[x.id]}function y(){for(const A in r)i.deleteBuffer(r[A]);o=[],r={},s={}}return{bind:l,update:c,dispose:y}}const nct=new Uint16Array([12469,15057,12620,14925,13266,14620,13807,14376,14323,13990,14545,13625,14713,13328,14840,12882,14931,12528,14996,12233,15039,11829,15066,11525,15080,11295,15085,10976,15082,10705,15073,10495,13880,14564,13898,14542,13977,14430,14158,14124,14393,13732,14556,13410,14702,12996,14814,12596,14891,12291,14937,11834,14957,11489,14958,11194,14943,10803,14921,10506,14893,10278,14858,9960,14484,14039,14487,14025,14499,13941,14524,13740,14574,13468,14654,13106,14743,12678,14818,12344,14867,11893,14889,11509,14893,11180,14881,10751,14852,10428,14812,10128,14765,9754,14712,9466,14764,13480,14764,13475,14766,13440,14766,13347,14769,13070,14786,12713,14816,12387,14844,11957,14860,11549,14868,11215,14855,10751,14825,10403,14782,10044,14729,9651,14666,9352,14599,9029,14967,12835,14966,12831,14963,12804,14954,12723,14936,12564,14917,12347,14900,11958,14886,11569,14878,11247,14859,10765,14828,10401,14784,10011,14727,9600,14660,9289,14586,8893,14508,8533,15111,12234,15110,12234,15104,12216,15092,12156,15067,12010,15028,11776,14981,11500,14942,11205,14902,10752,14861,10393,14812,9991,14752,9570,14682,9252,14603,8808,14519,8445,14431,8145,15209,11449,15208,11451,15202,11451,15190,11438,15163,11384,15117,11274,15055,10979,14994,10648,14932,10343,14871,9936,14803,9532,14729,9218,14645,8742,14556,8381,14461,8020,14365,7603,15273,10603,15272,10607,15267,10619,15256,10631,15231,10614,15182,10535,15118,10389,15042,10167,14963,9787,14883,9447,14800,9115,14710,8665,14615,8318,14514,7911,14411,7507,14279,7198,15314,9675,15313,9683,15309,9712,15298,9759,15277,9797,15229,9773,15166,9668,15084,9487,14995,9274,14898,8910,14800,8539,14697,8234,14590,7790,14479,7409,14367,7067,14178,6621,15337,8619,15337,8631,15333,8677,15325,8769,15305,8871,15264,8940,15202,8909,15119,8775,15022,8565,14916,8328,14804,8009,14688,7614,14569,7287,14448,6888,14321,6483,14088,6171,15350,7402,15350,7419,15347,7480,15340,7613,15322,7804,15287,7973,15229,8057,15148,8012,15046,7846,14933,7611,14810,7357,14682,7069,14552,6656,14421,6316,14251,5948,14007,5528,15356,5942,15356,5977,15353,6119,15348,6294,15332,6551,15302,6824,15249,7044,15171,7122,15070,7050,14949,6861,14818,6611,14679,6349,14538,6067,14398,5651,14189,5311,13935,4958,15359,4123,15359,4153,15356,4296,15353,4646,15338,5160,15311,5508,15263,5829,15188,6042,15088,6094,14966,6001,14826,5796,14678,5543,14527,5287,14377,4985,14133,4586,13869,4257,15360,1563,15360,1642,15358,2076,15354,2636,15341,3350,15317,4019,15273,4429,15203,4732,15105,4911,14981,4932,14836,4818,14679,4621,14517,4386,14359,4156,14083,3795,13808,3437,15360,122,15360,137,15358,285,15355,636,15344,1274,15322,2177,15281,2765,15215,3223,15120,3451,14995,3569,14846,3567,14681,3466,14511,3305,14344,3121,14037,2800,13753,2467,15360,0,15360,1,15359,21,15355,89,15346,253,15325,479,15287,796,15225,1148,15133,1492,15008,1749,14856,1882,14685,1886,14506,1783,14324,1608,13996,1398,13702,1183]);let A_=null;function rct(){return A_===null&&(A_=new Iv(nct,16,16,AI,g_),A_.name="DFG_LUT",A_.minFilter=fu,A_.magFilter=fu,A_.wrapS=bv,A_.wrapT=bv,A_.generateMipmaps=!1,A_.needsUpdate=!0),A_}let sct=class{constructor(e={}){const{canvas:t=rrt(),context:n=null,depth:r=!0,stencil:s=!1,alpha:o=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:h="default",failIfMajorPerformanceCaveat:u=!1,reversedDepthBuffer:d=!1,outputBufferType:p=af}=e;this.isWebGLRenderer=!0;let f;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");f=n.getContextAttributes().alpha}else f=o;const g=p,_=new Set([xI,xJ,Iz]),y=new Set([af,nd,HL,VL,bJ,AJ]),A=new Uint32Array(4),x=new Int32Array(4);let w=null,E=null;const S=[],I=[];let C=null;this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=m_,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const T=this;let D=!1;this._outputColorSpace=ym;let M=0,R=0,v=null,P=-1,O=null;const B=new hl,k=new hl;let H=null;const z=new $s(0);let j=0,$=t.width,Q=t.height,se=1,te=null,ue=null;const V=new hl(0,0,$,Q),ee=new hl(0,0,$,Q);let oe=!1;const pe=new Mve;let ve=!1,ge=!1;const je=new rr,fe=new pt,X=new hl,ce={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let _e=!1;function le(){return v===null?se:1}let G=n;function xe(ie,Me){return t.getContext(ie,Me)}try{const ie={alpha:!0,depth:r,stencil:s,antialias:a,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:h,failIfMajorPerformanceCaveat:u};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${oJ}`),t.addEventListener("webglcontextlost",gt,!1),t.addEventListener("webglcontextrestored",ei,!1),t.addEventListener("webglcontextcreationerror",Gt,!1),G===null){const Me="webgl2";if(G=xe(Me,ie),G===null)throw xe(Me)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(ie){throw Ws("WebGLRenderer: "+ie.message),ie}let ze,Ke,we,U,N,Y,de,he,ae,Ge,Oe,tt,De,Ae,Ne,ot,rt,Xe,Tt,Z,qe,Ue,it,Fe;function Ee(){ze=new sat(G),ze.init(),Ue=new obe(G,ze),Ke=new Qot(G,ze,e,Ue),we=new Xlt(G,ze),Ke.reversedDepthBuffer&&d&&we.buffers.depth.setReversed(!0),U=new lat(G),N=new Llt,Y=new Ylt(G,ze,we,N,Ke,Ue,U),de=new Jot(T),he=new rat(T),ae=new $rt(G),it=new Xot(G,ae),Ge=new oat(G,ae,U,it),Oe=new hat(G,Ge,ae,U),Tt=new cat(G,Ke,Y),ot=new Kot(N),tt=new Rlt(T,de,he,ze,Ke,it,ot),De=new tct(T,N),Ae=new Nlt,Ne=new Hlt(ze),Xe=new qot(T,de,he,we,Oe,f,l),rt=new $lt(T,Oe,Ke),Fe=new ict(G,U,Ke,we),Z=new Yot(G,ze,U),qe=new aat(G,ze,U),U.programs=tt.programs,T.capabilities=Ke,T.extensions=ze,T.properties=N,T.renderLists=Ae,T.shadowMap=rt,T.state=we,T.info=U}Ee(),g!==af&&(C=new dat(g,t.width,t.height,r,s));const nt=new Zlt(T,G);this.xr=nt,this.getContext=function(){return G},this.getContextAttributes=function(){return G.getContextAttributes()},this.forceContextLoss=function(){const ie=ze.get("WEBGL_lose_context");ie&&ie.loseContext()},this.forceContextRestore=function(){const ie=ze.get("WEBGL_lose_context");ie&&ie.restoreContext()},this.getPixelRatio=function(){return se},this.setPixelRatio=function(ie){ie!==void 0&&(se=ie,this.setSize($,Q,!1))},this.getSize=function(ie){return ie.set($,Q)},this.setSize=function(ie,Me,Pe=!0){if(nt.isPresenting){pr("WebGLRenderer: Can't change size while VR device is presenting.");return}$=ie,Q=Me,t.width=Math.floor(ie*se),t.height=Math.floor(Me*se),Pe===!0&&(t.style.width=ie+"px",t.style.height=Me+"px"),C!==null&&C.setSize(t.width,t.height),this.setViewport(0,0,ie,Me)},this.getDrawingBufferSize=function(ie){return ie.set($*se,Q*se).floor()},this.setDrawingBufferSize=function(ie,Me,Pe){$=ie,Q=Me,se=Pe,t.width=Math.floor(ie*Pe),t.height=Math.floor(Me*Pe),this.setViewport(0,0,ie,Me)},this.setEffects=function(ie){if(g===af){console.error("THREE.WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.");return}if(ie){for(let Me=0;Me<ie.length;Me++)if(ie[Me].isOutputPass===!0){console.warn("THREE.WebGLRenderer: OutputPass is not needed in setEffects(). Tone mapping and color space conversion are applied automatically.");break}}C.setEffects(ie||[])},this.getCurrentViewport=function(ie){return ie.copy(B)},this.getViewport=function(ie){return ie.copy(V)},this.setViewport=function(ie,Me,Pe,Te){ie.isVector4?V.set(ie.x,ie.y,ie.z,ie.w):V.set(ie,Me,Pe,Te),we.viewport(B.copy(V).multiplyScalar(se).round())},this.getScissor=function(ie){return ie.copy(ee)},this.setScissor=function(ie,Me,Pe,Te){ie.isVector4?ee.set(ie.x,ie.y,ie.z,ie.w):ee.set(ie,Me,Pe,Te),we.scissor(k.copy(ee).multiplyScalar(se).round())},this.getScissorTest=function(){return oe},this.setScissorTest=function(ie){we.setScissorTest(oe=ie)},this.setOpaqueSort=function(ie){te=ie},this.setTransparentSort=function(ie){ue=ie},this.getClearColor=function(ie){return ie.copy(Xe.getClearColor())},this.setClearColor=function(){Xe.setClearColor(...arguments)},this.getClearAlpha=function(){return Xe.getClearAlpha()},this.setClearAlpha=function(){Xe.setClearAlpha(...arguments)},this.clear=function(ie=!0,Me=!0,Pe=!0){let Te=0;if(ie){let Ze=!1;if(v!==null){const me=v.texture.format;Ze=_.has(me)}if(Ze){const me=v.texture.type,ke=y.has(me),$e=Xe.getClearColor(),et=Xe.getClearAlpha(),Ye=$e.r,St=$e.g,_t=$e.b;ke?(A[0]=Ye,A[1]=St,A[2]=_t,A[3]=et,G.clearBufferuiv(G.COLOR,0,A)):(x[0]=Ye,x[1]=St,x[2]=_t,x[3]=et,G.clearBufferiv(G.COLOR,0,x))}else Te|=G.COLOR_BUFFER_BIT}Me&&(Te|=G.DEPTH_BUFFER_BIT),Pe&&(Te|=G.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),G.clear(Te)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",gt,!1),t.removeEventListener("webglcontextrestored",ei,!1),t.removeEventListener("webglcontextcreationerror",Gt,!1),Xe.dispose(),Ae.dispose(),Ne.dispose(),N.dispose(),de.dispose(),he.dispose(),Oe.dispose(),it.dispose(),Fe.dispose(),tt.dispose(),nt.dispose(),nt.removeEventListener("sessionstart",cl),nt.removeEventListener("sessionend",Kr),us.stop()};function gt(ie){ie.preventDefault(),eve("WebGLRenderer: Context Lost."),D=!0}function ei(){eve("WebGLRenderer: Context Restored."),D=!1;const ie=U.autoReset,Me=rt.enabled,Pe=rt.autoUpdate,Te=rt.needsUpdate,Ze=rt.type;Ee(),U.autoReset=ie,rt.enabled=Me,rt.autoUpdate=Pe,rt.needsUpdate=Te,rt.type=Ze}function Gt(ie){Ws("WebGLRenderer: A WebGL context could not be created. Reason: ",ie.statusMessage)}function Yi(ie){const Me=ie.target;Me.removeEventListener("dispose",Yi),Li(Me)}function Li(ie){Ds(ie),N.remove(ie)}function Ds(ie){const Me=N.get(ie).programs;Me!==void 0&&(Me.forEach(function(Pe){tt.releaseProgram(Pe)}),ie.isShaderMaterial&&tt.releaseShaderCache(ie))}this.renderBufferDirect=function(ie,Me,Pe,Te,Ze,me){Me===null&&(Me=ce);const ke=Ze.isMesh&&Ze.matrixWorld.determinant()<0,$e=sf(ie,Me,Pe,Te,Ze);we.setMaterial(Te,ke);let et=Pe.index,Ye=1;if(Te.wireframe===!0){if(et=Ge.getWireframeAttribute(Pe),et===void 0)return;Ye=2}const St=Pe.drawRange,_t=Pe.attributes.position;let Rt=St.start*Ye,$t=(St.start+St.count)*Ye;me!==null&&(Rt=Math.max(Rt,me.start*Ye),$t=Math.min($t,(me.start+me.count)*Ye)),et!==null?(Rt=Math.max(Rt,0),$t=Math.min($t,et.count)):_t!=null&&(Rt=Math.max(Rt,0),$t=Math.min($t,_t.count));const Ce=$t-Rt;if(Ce<0||Ce===1/0)return;it.setup(Ze,Te,$e,Pe,et);let be,Ve=Z;if(et!==null&&(be=ae.get(et),Ve=qe,Ve.setIndex(be)),Ze.isMesh)Te.wireframe===!0?(we.setLineWidth(Te.wireframeLinewidth*le()),Ve.setMode(G.LINES)):Ve.setMode(G.TRIANGLES);else if(Ze.isLine){let Re=Te.linewidth;Re===void 0&&(Re=1),we.setLineWidth(Re*le()),Ze.isLineSegments?Ve.setMode(G.LINES):Ze.isLineLoop?Ve.setMode(G.LINE_LOOP):Ve.setMode(G.LINE_STRIP)}else Ze.isPoints?Ve.setMode(G.POINTS):Ze.isSprite&&Ve.setMode(G.TRIANGLES);if(Ze.isBatchedMesh)if(Ze._multiDrawInstances!==null)GL("WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),Ve.renderMultiDrawInstances(Ze._multiDrawStarts,Ze._multiDrawCounts,Ze._multiDrawCount,Ze._multiDrawInstances);else if(ze.get("WEBGL_multi_draw"))Ve.renderMultiDraw(Ze._multiDrawStarts,Ze._multiDrawCounts,Ze._multiDrawCount);else{const Re=Ze._multiDrawStarts,bt=Ze._multiDrawCounts,Ct=Ze._multiDrawCount,Lt=et?ae.get(et).bytesPerElement:1,Ie=N.get(Te).currentProgram.getUniforms();for(let lt=0;lt<Ct;lt++)Ie.setValue(G,"_gl_DrawID",lt),Ve.render(Re[lt]/Lt,bt[lt])}else if(Ze.isInstancedMesh)Ve.renderInstances(Rt,Ce,Ze.count);else if(Pe.isInstancedBufferGeometry){const Re=Pe._maxInstanceCount!==void 0?Pe._maxInstanceCount:1/0,bt=Math.min(Pe.instanceCount,Re);Ve.renderInstances(Rt,Ce,bt)}else Ve.render(Rt,Ce)};function so(ie,Me,Pe){ie.transparent===!0&&ie.side===gm&&ie.forceSinglePass===!1?(ie.side=lp,ie.needsUpdate=!0,ds(ie,Me,Pe),ie.side=f_,ie.needsUpdate=!0,ds(ie,Me,Pe),ie.side=gm):ds(ie,Me,Pe)}this.compile=function(ie,Me,Pe=null){Pe===null&&(Pe=ie),E=Ne.get(Pe),E.init(Me),I.push(E),Pe.traverseVisible(function(Ze){Ze.isLight&&Ze.layers.test(Me.layers)&&(E.pushLight(Ze),Ze.castShadow&&E.pushShadow(Ze))}),ie!==Pe&&ie.traverseVisible(function(Ze){Ze.isLight&&Ze.layers.test(Me.layers)&&(E.pushLight(Ze),Ze.castShadow&&E.pushShadow(Ze))}),E.setupLights();const Te=new Set;return ie.traverse(function(Ze){if(!(Ze.isMesh||Ze.isPoints||Ze.isLine||Ze.isSprite))return;const me=Ze.material;if(me)if(Array.isArray(me))for(let ke=0;ke<me.length;ke++){const $e=me[ke];so($e,Pe,Ze),Te.add($e)}else so(me,Pe,Ze),Te.add(me)}),E=I.pop(),Te},this.compileAsync=function(ie,Me,Pe=null){const Te=this.compile(ie,Me,Pe);return new Promise(Ze=>{function me(){if(Te.forEach(function(ke){N.get(ke).currentProgram.isReady()&&Te.delete(ke)}),Te.size===0){Ze(ie);return}setTimeout(me,10)}ze.get("KHR_parallel_shader_compile")!==null?me():setTimeout(me,10)})};let ha=null;function Co(ie){ha&&ha(ie)}function cl(){us.stop()}function Kr(){us.start()}const us=new Rve;us.setAnimationLoop(Co),typeof self<"u"&&us.setContext(self),this.setAnimationLoop=function(ie){ha=ie,nt.setAnimationLoop(ie),ie===null?us.stop():us.start()},nt.addEventListener("sessionstart",cl),nt.addEventListener("sessionend",Kr),this.render=function(ie,Me){if(Me!==void 0&&Me.isCamera!==!0){Ws("WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(D===!0)return;const Pe=nt.enabled===!0&&nt.isPresenting===!0,Te=C!==null&&(v===null||Pe)&&C.begin(T,v);if(ie.matrixWorldAutoUpdate===!0&&ie.updateMatrixWorld(),Me.parent===null&&Me.matrixWorldAutoUpdate===!0&&Me.updateMatrixWorld(),nt.enabled===!0&&nt.isPresenting===!0&&(C===null||C.isCompositing()===!1)&&(nt.cameraAutoUpdate===!0&&nt.updateCamera(Me),Me=nt.getCamera()),ie.isScene===!0&&ie.onBeforeRender(T,ie,Me,v),E=Ne.get(ie,I.length),E.init(Me),I.push(E),je.multiplyMatrices(Me.projectionMatrix,Me.matrixWorldInverse),pe.setFromProjectionMatrix(je,y_,Me.reversedDepth),ge=this.localClippingEnabled,ve=ot.init(this.clippingPlanes,ge),w=Ae.get(ie,S.length),w.init(),S.push(w),nt.enabled===!0&&nt.isPresenting===!0){const ke=T.xr.getDepthSensingMesh();ke!==null&&nr(ke,Me,-1/0,T.sortObjects)}nr(ie,Me,0,T.sortObjects),w.finish(),T.sortObjects===!0&&w.sort(te,ue),_e=nt.enabled===!1||nt.isPresenting===!1||nt.hasDepthSensing()===!1,_e&&Xe.addToRenderList(w,ie),this.info.render.frame++,ve===!0&&ot.beginShadows();const Ze=E.state.shadowsArray;if(rt.render(Ze,ie,Me),ve===!0&&ot.endShadows(),this.info.autoReset===!0&&this.info.reset(),(Te&&C.hasRenderPass())===!1){const ke=w.opaque,$e=w.transmissive;if(E.setupLights(),Me.isArrayCamera){const et=Me.cameras;if($e.length>0)for(let Ye=0,St=et.length;Ye<St;Ye++){const _t=et[Ye];go(ke,$e,ie,_t)}_e&&Xe.render(ie);for(let Ye=0,St=et.length;Ye<St;Ye++){const _t=et[Ye];Jr(w,ie,_t,_t.viewport)}}else $e.length>0&&go(ke,$e,ie,Me),_e&&Xe.render(ie),Jr(w,ie,Me)}v!==null&&R===0&&(Y.updateMultisampleRenderTarget(v),Y.updateRenderTargetMipmap(v)),Te&&C.end(T),ie.isScene===!0&&ie.onAfterRender(T,ie,Me),it.resetDefaultState(),P=-1,O=null,I.pop(),I.length>0?(E=I[I.length-1],ve===!0&&ot.setGlobalState(T.clippingPlanes,E.state.camera)):E=null,S.pop(),S.length>0?w=S[S.length-1]:w=null};function nr(ie,Me,Pe,Te){if(ie.visible===!1)return;if(ie.layers.test(Me.layers)){if(ie.isGroup)Pe=ie.renderOrder;else if(ie.isLOD)ie.autoUpdate===!0&&ie.update(Me);else if(ie.isLight)E.pushLight(ie),ie.castShadow&&E.pushShadow(ie);else if(ie.isSprite){if(!ie.frustumCulled||pe.intersectsSprite(ie)){Te&&X.setFromMatrixPosition(ie.matrixWorld).applyMatrix4(je);const ke=Oe.update(ie),$e=ie.material;$e.visible&&w.push(ie,ke,$e,Pe,X.z,null)}}else if((ie.isMesh||ie.isLine||ie.isPoints)&&(!ie.frustumCulled||pe.intersectsObject(ie))){const ke=Oe.update(ie),$e=ie.material;if(Te&&(ie.boundingSphere!==void 0?(ie.boundingSphere===null&&ie.computeBoundingSphere(),X.copy(ie.boundingSphere.center)):(ke.boundingSphere===null&&ke.computeBoundingSphere(),X.copy(ke.boundingSphere.center)),X.applyMatrix4(ie.matrixWorld).applyMatrix4(je)),Array.isArray($e)){const et=ke.groups;for(let Ye=0,St=et.length;Ye<St;Ye++){const _t=et[Ye],Rt=$e[_t.materialIndex];Rt&&Rt.visible&&w.push(ie,ke,Rt,Pe,X.z,_t)}}else $e.visible&&w.push(ie,ke,$e,Pe,X.z,null)}}const me=ie.children;for(let ke=0,$e=me.length;ke<$e;ke++)nr(me[ke],Me,Pe,Te)}function Jr(ie,Me,Pe,Te){const{opaque:Ze,transmissive:me,transparent:ke}=ie;E.setupLightsView(Pe),ve===!0&&ot.setGlobalState(T.clippingPlanes,Pe),Te&&we.viewport(B.copy(Te)),Ze.length>0&&Es(Ze,Me,Pe),me.length>0&&Es(me,Me,Pe),ke.length>0&&Es(ke,Me,Pe),we.buffers.depth.setTest(!0),we.buffers.depth.setMask(!0),we.buffers.color.setMask(!0),we.setPolygonOffset(!1)}function go(ie,Me,Pe,Te){if((Pe.isScene===!0?Pe.overrideMaterial:null)!==null)return;if(E.state.transmissionRenderTarget[Te.id]===void 0){const Rt=ze.has("EXT_color_buffer_half_float")||ze.has("EXT_color_buffer_float");E.state.transmissionRenderTarget[Te.id]=new zg(1,1,{generateMipmaps:!0,type:Rt?g_:af,minFilter:yE,samples:Ke.samples,stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:Rs.workingColorSpace})}const me=E.state.transmissionRenderTarget[Te.id],ke=Te.viewport||B;me.setSize(ke.z*T.transmissionResolutionScale,ke.w*T.transmissionResolutionScale);const $e=T.getRenderTarget(),et=T.getActiveCubeFace(),Ye=T.getActiveMipmapLevel();T.setRenderTarget(me),T.getClearColor(z),j=T.getClearAlpha(),j<1&&T.setClearColor(16777215,.5),T.clear(),_e&&Xe.render(Pe);const St=T.toneMapping;T.toneMapping=m_;const _t=Te.viewport;if(Te.viewport!==void 0&&(Te.viewport=void 0),E.setupLightsView(Te),ve===!0&&ot.setGlobalState(T.clippingPlanes,Te),Es(ie,Pe,Te),Y.updateMultisampleRenderTarget(me),Y.updateRenderTargetMipmap(me),ze.has("WEBGL_multisampled_render_to_texture")===!1){let Rt=!1;for(let $t=0,Ce=Me.length;$t<Ce;$t++){const be=Me[$t],{object:Ve,geometry:Re,material:bt,group:Ct}=be;if(bt.side===gm&&Ve.layers.test(Te.layers)){const Lt=bt.side;bt.side=lp,bt.needsUpdate=!0,Rr(Ve,Pe,Te,Re,bt,Ct),bt.side=Lt,bt.needsUpdate=!0,Rt=!0}}Rt===!0&&(Y.updateMultisampleRenderTarget(me),Y.updateRenderTargetMipmap(me))}T.setRenderTarget($e,et,Ye),T.setClearColor(z,j),_t!==void 0&&(Te.viewport=_t),T.toneMapping=St}function Es(ie,Me,Pe){const Te=Me.isScene===!0?Me.overrideMaterial:null;for(let Ze=0,me=ie.length;Ze<me;Ze++){const ke=ie[Ze],{object:$e,geometry:et,group:Ye}=ke;let St=ke.material;St.allowOverride===!0&&Te!==null&&(St=Te),$e.layers.test(Pe.layers)&&Rr($e,Me,Pe,et,St,Ye)}}function Rr(ie,Me,Pe,Te,Ze,me){ie.onBeforeRender(T,Me,Pe,Te,Ze,me),ie.modelViewMatrix.multiplyMatrices(Pe.matrixWorldInverse,ie.matrixWorld),ie.normalMatrix.getNormalMatrix(ie.modelViewMatrix),Ze.onBeforeRender(T,Me,Pe,Te,ie,me),Ze.transparent===!0&&Ze.side===gm&&Ze.forceSinglePass===!1?(Ze.side=lp,Ze.needsUpdate=!0,T.renderBufferDirect(Pe,Me,Te,Ze,ie,me),Ze.side=f_,Ze.needsUpdate=!0,T.renderBufferDirect(Pe,Me,Te,Ze,ie,me),Ze.side=gm):T.renderBufferDirect(Pe,Me,Te,Ze,ie,me),ie.onAfterRender(T,Me,Pe,Te,Ze,me)}function ds(ie,Me,Pe){Me.isScene!==!0&&(Me=ce);const Te=N.get(ie),Ze=E.state.lights,me=E.state.shadowsArray,ke=Ze.state.version,$e=tt.getParameters(ie,Ze.state,me,Me,Pe),et=tt.getProgramCacheKey($e);let Ye=Te.programs;Te.environment=ie.isMeshStandardMaterial?Me.environment:null,Te.fog=Me.fog,Te.envMap=(ie.isMeshStandardMaterial?he:de).get(ie.envMap||Te.environment),Te.envMapRotation=Te.environment!==null&&ie.envMap===null?Me.environmentRotation:ie.envMapRotation,Ye===void 0&&(ie.addEventListener("dispose",Yi),Ye=new Map,Te.programs=Ye);let St=Ye.get(et);if(St!==void 0){if(Te.currentProgram===St&&Te.lightsStateVersion===ke)return sp(ie,$e),St}else $e.uniforms=tt.getUniforms(ie),ie.onBeforeCompile($e,T),St=tt.acquireProgram($e,et),Ye.set(et,St),Te.uniforms=$e.uniforms;const _t=Te.uniforms;return(!ie.isShaderMaterial&&!ie.isRawShaderMaterial||ie.clipping===!0)&&(_t.clippingPlanes=ot.uniform),sp(ie,$e),Te.needsLights=of(ie),Te.lightsStateVersion=ke,Te.needsLights&&(_t.ambientLightColor.value=Ze.state.ambient,_t.lightProbe.value=Ze.state.probe,_t.directionalLights.value=Ze.state.directional,_t.directionalLightShadows.value=Ze.state.directionalShadow,_t.spotLights.value=Ze.state.spot,_t.spotLightShadows.value=Ze.state.spotShadow,_t.rectAreaLights.value=Ze.state.rectArea,_t.ltc_1.value=Ze.state.rectAreaLTC1,_t.ltc_2.value=Ze.state.rectAreaLTC2,_t.pointLights.value=Ze.state.point,_t.pointLightShadows.value=Ze.state.pointShadow,_t.hemisphereLights.value=Ze.state.hemi,_t.directionalShadowMap.value=Ze.state.directionalShadowMap,_t.directionalShadowMatrix.value=Ze.state.directionalShadowMatrix,_t.spotShadowMap.value=Ze.state.spotShadowMap,_t.spotLightMatrix.value=Ze.state.spotLightMatrix,_t.spotLightMap.value=Ze.state.spotLightMap,_t.pointShadowMap.value=Ze.state.pointShadowMap,_t.pointShadowMatrix.value=Ze.state.pointShadowMatrix),Te.currentProgram=St,Te.uniformsList=null,St}function $a(ie){if(ie.uniformsList===null){const Me=ie.currentProgram.getUniforms();ie.uniformsList=l8.seqWithValue(Me.seq,ie.uniforms)}return ie.uniformsList}function sp(ie,Me){const Pe=N.get(ie);Pe.outputColorSpace=Me.outputColorSpace,Pe.batching=Me.batching,Pe.batchingColor=Me.batchingColor,Pe.instancing=Me.instancing,Pe.instancingColor=Me.instancingColor,Pe.instancingMorph=Me.instancingMorph,Pe.skinning=Me.skinning,Pe.morphTargets=Me.morphTargets,Pe.morphNormals=Me.morphNormals,Pe.morphColors=Me.morphColors,Pe.morphTargetsCount=Me.morphTargetsCount,Pe.numClippingPlanes=Me.numClippingPlanes,Pe.numIntersection=Me.numClipIntersection,Pe.vertexAlphas=Me.vertexAlphas,Pe.vertexTangents=Me.vertexTangents,Pe.toneMapping=Me.toneMapping}function sf(ie,Me,Pe,Te,Ze){Me.isScene!==!0&&(Me=ce),Y.resetTextureUnits();const me=Me.fog,ke=Te.isMeshStandardMaterial?Me.environment:null,$e=v===null?T.outputColorSpace:v.isXRRenderTarget===!0?v.texture.colorSpace:wI,et=(Te.isMeshStandardMaterial?he:de).get(Te.envMap||ke),Ye=Te.vertexColors===!0&&!!Pe.attributes.color&&Pe.attributes.color.itemSize===4,St=!!Pe.attributes.tangent&&(!!Te.normalMap||Te.anisotropy>0),_t=!!Pe.morphAttributes.position,Rt=!!Pe.morphAttributes.normal,$t=!!Pe.morphAttributes.color;let Ce=m_;Te.toneMapped&&(v===null||v.isXRRenderTarget===!0)&&(Ce=T.toneMapping);const be=Pe.morphAttributes.position||Pe.morphAttributes.normal||Pe.morphAttributes.color,Ve=be!==void 0?be.length:0,Re=N.get(Te),bt=E.state.lights;if(ve===!0&&(ge===!0||ie!==O)){const si=ie===O&&Te.id===P;ot.setState(Te,ie,si)}let Ct=!1;Te.version===Re.__version?(Re.needsLights&&Re.lightsStateVersion!==bt.state.version||Re.outputColorSpace!==$e||Ze.isBatchedMesh&&Re.batching===!1||!Ze.isBatchedMesh&&Re.batching===!0||Ze.isBatchedMesh&&Re.batchingColor===!0&&Ze.colorTexture===null||Ze.isBatchedMesh&&Re.batchingColor===!1&&Ze.colorTexture!==null||Ze.isInstancedMesh&&Re.instancing===!1||!Ze.isInstancedMesh&&Re.instancing===!0||Ze.isSkinnedMesh&&Re.skinning===!1||!Ze.isSkinnedMesh&&Re.skinning===!0||Ze.isInstancedMesh&&Re.instancingColor===!0&&Ze.instanceColor===null||Ze.isInstancedMesh&&Re.instancingColor===!1&&Ze.instanceColor!==null||Ze.isInstancedMesh&&Re.instancingMorph===!0&&Ze.morphTexture===null||Ze.isInstancedMesh&&Re.instancingMorph===!1&&Ze.morphTexture!==null||Re.envMap!==et||Te.fog===!0&&Re.fog!==me||Re.numClippingPlanes!==void 0&&(Re.numClippingPlanes!==ot.numPlanes||Re.numIntersection!==ot.numIntersection)||Re.vertexAlphas!==Ye||Re.vertexTangents!==St||Re.morphTargets!==_t||Re.morphNormals!==Rt||Re.morphColors!==$t||Re.toneMapping!==Ce||Re.morphTargetsCount!==Ve)&&(Ct=!0):(Ct=!0,Re.__version=Te.version);let Lt=Re.currentProgram;Ct===!0&&(Lt=ds(Te,Me,Ze));let Ie=!1,lt=!1,Pt=!1;const wt=Lt.getUniforms(),ti=Re.uniforms;if(we.useProgram(Lt.program)&&(Ie=!0,lt=!0,Pt=!0),Te.id!==P&&(P=Te.id,lt=!0),Ie||O!==ie){we.buffers.depth.getReversed()&&ie.reversedDepth!==!0&&(ie._reversedDepth=!0,ie.updateProjectionMatrix()),wt.setValue(G,"projectionMatrix",ie.projectionMatrix),wt.setValue(G,"viewMatrix",ie.matrixWorldInverse);const An=wt.map.cameraPosition;An!==void 0&&An.setValue(G,fe.setFromMatrixPosition(ie.matrixWorld)),Ke.logarithmicDepthBuffer&&wt.setValue(G,"logDepthBufFC",2/(Math.log(ie.far+1)/Math.LN2)),(Te.isMeshPhongMaterial||Te.isMeshToonMaterial||Te.isMeshLambertMaterial||Te.isMeshBasicMaterial||Te.isMeshStandardMaterial||Te.isShaderMaterial)&&wt.setValue(G,"isOrthographic",ie.isOrthographicCamera===!0),O!==ie&&(O=ie,lt=!0,Pt=!0)}if(Re.needsLights&&(bt.state.directionalShadowMap.length>0&&wt.setValue(G,"directionalShadowMap",bt.state.directionalShadowMap,Y),bt.state.spotShadowMap.length>0&&wt.setValue(G,"spotShadowMap",bt.state.spotShadowMap,Y),bt.state.pointShadowMap.length>0&&wt.setValue(G,"pointShadowMap",bt.state.pointShadowMap,Y)),Ze.isSkinnedMesh){wt.setOptional(G,Ze,"bindMatrix"),wt.setOptional(G,Ze,"bindMatrixInverse");const si=Ze.skeleton;si&&(si.boneTexture===null&&si.computeBoneTexture(),wt.setValue(G,"boneTexture",si.boneTexture,Y))}Ze.isBatchedMesh&&(wt.setOptional(G,Ze,"batchingTexture"),wt.setValue(G,"batchingTexture",Ze._matricesTexture,Y),wt.setOptional(G,Ze,"batchingIdTexture"),wt.setValue(G,"batchingIdTexture",Ze._indirectTexture,Y),wt.setOptional(G,Ze,"batchingColorTexture"),Ze._colorsTexture!==null&&wt.setValue(G,"batchingColorTexture",Ze._colorsTexture,Y));const Ti=Pe.morphAttributes;if((Ti.position!==void 0||Ti.normal!==void 0||Ti.color!==void 0)&&Tt.update(Ze,Pe,Lt),(lt||Re.receiveShadow!==Ze.receiveShadow)&&(Re.receiveShadow=Ze.receiveShadow,wt.setValue(G,"receiveShadow",Ze.receiveShadow)),Te.isMeshGouraudMaterial&&Te.envMap!==null&&(ti.envMap.value=et,ti.flipEnvMap.value=et.isCubeTexture&&et.isRenderTargetTexture===!1?-1:1),Te.isMeshStandardMaterial&&Te.envMap===null&&Me.environment!==null&&(ti.envMapIntensity.value=Me.environmentIntensity),ti.dfgLUT!==void 0&&(ti.dfgLUT.value=rct()),lt&&(wt.setValue(G,"toneMappingExposure",T.toneMappingExposure),Re.needsLights&&kg(ti,Pt),me&&Te.fog===!0&&De.refreshFogUniforms(ti,me),De.refreshMaterialUniforms(ti,Te,se,Q,E.state.transmissionRenderTarget[ie.id]),l8.upload(G,$a(Re),ti,Y)),Te.isShaderMaterial&&Te.uniformsNeedUpdate===!0&&(l8.upload(G,$a(Re),ti,Y),Te.uniformsNeedUpdate=!1),Te.isSpriteMaterial&&wt.setValue(G,"center",Ze.center),wt.setValue(G,"modelViewMatrix",Ze.modelViewMatrix),wt.setValue(G,"normalMatrix",Ze.normalMatrix),wt.setValue(G,"modelMatrix",Ze.matrixWorld),Te.isShaderMaterial||Te.isRawShaderMaterial){const si=Te.uniformsGroups;for(let An=0,mn=si.length;An<mn;An++){const kn=si[An];Fe.update(kn,Lt),Fe.bind(kn,Lt)}}return Lt}function kg(ie,Me){ie.ambientLightColor.needsUpdate=Me,ie.lightProbe.needsUpdate=Me,ie.directionalLights.needsUpdate=Me,ie.directionalLightShadows.needsUpdate=Me,ie.pointLights.needsUpdate=Me,ie.pointLightShadows.needsUpdate=Me,ie.spotLights.needsUpdate=Me,ie.spotLightShadows.needsUpdate=Me,ie.rectAreaLights.needsUpdate=Me,ie.hemisphereLights.needsUpdate=Me}function of(ie){return ie.isMeshLambertMaterial||ie.isMeshToonMaterial||ie.isMeshPhongMaterial||ie.isMeshStandardMaterial||ie.isShadowMaterial||ie.isShaderMaterial&&ie.lights===!0}this.getActiveCubeFace=function(){return M},this.getActiveMipmapLevel=function(){return R},this.getRenderTarget=function(){return v},this.setRenderTargetTextures=function(ie,Me,Pe){const Te=N.get(ie);Te.__autoAllocateDepthBuffer=ie.resolveDepthBuffer===!1,Te.__autoAllocateDepthBuffer===!1&&(Te.__useRenderToTexture=!1),N.get(ie.texture).__webglTexture=Me,N.get(ie.depthTexture).__webglTexture=Te.__autoAllocateDepthBuffer?void 0:Pe,Te.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(ie,Me){const Pe=N.get(ie);Pe.__webglFramebuffer=Me,Pe.__useDefaultFramebuffer=Me===void 0};const Cc=G.createFramebuffer();this.setRenderTarget=function(ie,Me=0,Pe=0){v=ie,M=Me,R=Pe;let Te=null,Ze=!1,me=!1;if(ie){const $e=N.get(ie);if($e.__useDefaultFramebuffer!==void 0){we.bindFramebuffer(G.FRAMEBUFFER,$e.__webglFramebuffer),B.copy(ie.viewport),k.copy(ie.scissor),H=ie.scissorTest,we.viewport(B),we.scissor(k),we.setScissorTest(H),P=-1;return}else if($e.__webglFramebuffer===void 0)Y.setupRenderTarget(ie);else if($e.__hasExternalTextures)Y.rebindTextures(ie,N.get(ie.texture).__webglTexture,N.get(ie.depthTexture).__webglTexture);else if(ie.depthBuffer){const St=ie.depthTexture;if($e.__boundDepthTexture!==St){if(St!==null&&N.has(St)&&(ie.width!==St.image.width||ie.height!==St.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");Y.setupDepthRenderbuffer(ie)}}const et=ie.texture;(et.isData3DTexture||et.isDataArrayTexture||et.isCompressedArrayTexture)&&(me=!0);const Ye=N.get(ie).__webglFramebuffer;ie.isWebGLCubeRenderTarget?(Array.isArray(Ye[Me])?Te=Ye[Me][Pe]:Te=Ye[Me],Ze=!0):ie.samples>0&&Y.useMultisampledRTT(ie)===!1?Te=N.get(ie).__webglMultisampledFramebuffer:Array.isArray(Ye)?Te=Ye[Pe]:Te=Ye,B.copy(ie.viewport),k.copy(ie.scissor),H=ie.scissorTest}else B.copy(V).multiplyScalar(se).floor(),k.copy(ee).multiplyScalar(se).floor(),H=oe;if(Pe!==0&&(Te=Cc),we.bindFramebuffer(G.FRAMEBUFFER,Te)&&we.drawBuffers(ie,Te),we.viewport(B),we.scissor(k),we.setScissorTest(H),Ze){const $e=N.get(ie.texture);G.framebufferTexture2D(G.FRAMEBUFFER,G.COLOR_ATTACHMENT0,G.TEXTURE_CUBE_MAP_POSITIVE_X+Me,$e.__webglTexture,Pe)}else if(me){const $e=Me;for(let et=0;et<ie.textures.length;et++){const Ye=N.get(ie.textures[et]);G.framebufferTextureLayer(G.FRAMEBUFFER,G.COLOR_ATTACHMENT0+et,Ye.__webglTexture,Pe,$e)}}else if(ie!==null&&Pe!==0){const $e=N.get(ie.texture);G.framebufferTexture2D(G.FRAMEBUFFER,G.COLOR_ATTACHMENT0,G.TEXTURE_2D,$e.__webglTexture,Pe)}P=-1},this.readRenderTargetPixels=function(ie,Me,Pe,Te,Ze,me,ke,$e=0){if(!(ie&&ie.isWebGLRenderTarget)){Ws("WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let et=N.get(ie).__webglFramebuffer;if(ie.isWebGLCubeRenderTarget&&ke!==void 0&&(et=et[ke]),et){we.bindFramebuffer(G.FRAMEBUFFER,et);try{const Ye=ie.textures[$e],St=Ye.format,_t=Ye.type;if(!Ke.textureFormatReadable(St)){Ws("WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!Ke.textureTypeReadable(_t)){Ws("WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}Me>=0&&Me<=ie.width-Te&&Pe>=0&&Pe<=ie.height-Ze&&(ie.textures.length>1&&G.readBuffer(G.COLOR_ATTACHMENT0+$e),G.readPixels(Me,Pe,Te,Ze,Ue.convert(St),Ue.convert(_t),me))}finally{const Ye=v!==null?N.get(v).__webglFramebuffer:null;we.bindFramebuffer(G.FRAMEBUFFER,Ye)}}},this.readRenderTargetPixelsAsync=async function(ie,Me,Pe,Te,Ze,me,ke,$e=0){if(!(ie&&ie.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let et=N.get(ie).__webglFramebuffer;if(ie.isWebGLCubeRenderTarget&&ke!==void 0&&(et=et[ke]),et)if(Me>=0&&Me<=ie.width-Te&&Pe>=0&&Pe<=ie.height-Ze){we.bindFramebuffer(G.FRAMEBUFFER,et);const Ye=ie.textures[$e],St=Ye.format,_t=Ye.type;if(!Ke.textureFormatReadable(St))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!Ke.textureTypeReadable(_t))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const Rt=G.createBuffer();G.bindBuffer(G.PIXEL_PACK_BUFFER,Rt),G.bufferData(G.PIXEL_PACK_BUFFER,me.byteLength,G.STREAM_READ),ie.textures.length>1&&G.readBuffer(G.COLOR_ATTACHMENT0+$e),G.readPixels(Me,Pe,Te,Ze,Ue.convert(St),Ue.convert(_t),0);const $t=v!==null?N.get(v).__webglFramebuffer:null;we.bindFramebuffer(G.FRAMEBUFFER,$t);const Ce=G.fenceSync(G.SYNC_GPU_COMMANDS_COMPLETE,0);return G.flush(),await srt(G,Ce,4),G.bindBuffer(G.PIXEL_PACK_BUFFER,Rt),G.getBufferSubData(G.PIXEL_PACK_BUFFER,0,me),G.deleteBuffer(Rt),G.deleteSync(Ce),me}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(ie,Me=null,Pe=0){const Te=Math.pow(2,-Pe),Ze=Math.floor(ie.image.width*Te),me=Math.floor(ie.image.height*Te),ke=Me!==null?Me.x:0,$e=Me!==null?Me.y:0;Y.setTexture2D(ie,0),G.copyTexSubImage2D(G.TEXTURE_2D,Pe,0,0,ke,$e,Ze,me),we.unbindTexture()};const mm=G.createFramebuffer(),ne=G.createFramebuffer();this.copyTextureToTexture=function(ie,Me,Pe=null,Te=null,Ze=0,me=null){me===null&&(Ze!==0?(GL("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),me=Ze,Ze=0):me=0);let ke,$e,et,Ye,St,_t,Rt,$t,Ce;const be=ie.isCompressedTexture?ie.mipmaps[me]:ie.image;if(Pe!==null)ke=Pe.max.x-Pe.min.x,$e=Pe.max.y-Pe.min.y,et=Pe.isBox3?Pe.max.z-Pe.min.z:1,Ye=Pe.min.x,St=Pe.min.y,_t=Pe.isBox3?Pe.min.z:0;else{const Ti=Math.pow(2,-Ze);ke=Math.floor(be.width*Ti),$e=Math.floor(be.height*Ti),ie.isDataArrayTexture?et=be.depth:ie.isData3DTexture?et=Math.floor(be.depth*Ti):et=1,Ye=0,St=0,_t=0}Te!==null?(Rt=Te.x,$t=Te.y,Ce=Te.z):(Rt=0,$t=0,Ce=0);const Ve=Ue.convert(Me.format),Re=Ue.convert(Me.type);let bt;Me.isData3DTexture?(Y.setTexture3D(Me,0),bt=G.TEXTURE_3D):Me.isDataArrayTexture||Me.isCompressedArrayTexture?(Y.setTexture2DArray(Me,0),bt=G.TEXTURE_2D_ARRAY):(Y.setTexture2D(Me,0),bt=G.TEXTURE_2D),G.pixelStorei(G.UNPACK_FLIP_Y_WEBGL,Me.flipY),G.pixelStorei(G.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Me.premultiplyAlpha),G.pixelStorei(G.UNPACK_ALIGNMENT,Me.unpackAlignment);const Ct=G.getParameter(G.UNPACK_ROW_LENGTH),Lt=G.getParameter(G.UNPACK_IMAGE_HEIGHT),Ie=G.getParameter(G.UNPACK_SKIP_PIXELS),lt=G.getParameter(G.UNPACK_SKIP_ROWS),Pt=G.getParameter(G.UNPACK_SKIP_IMAGES);G.pixelStorei(G.UNPACK_ROW_LENGTH,be.width),G.pixelStorei(G.UNPACK_IMAGE_HEIGHT,be.height),G.pixelStorei(G.UNPACK_SKIP_PIXELS,Ye),G.pixelStorei(G.UNPACK_SKIP_ROWS,St),G.pixelStorei(G.UNPACK_SKIP_IMAGES,_t);const wt=ie.isDataArrayTexture||ie.isData3DTexture,ti=Me.isDataArrayTexture||Me.isData3DTexture;if(ie.isDepthTexture){const Ti=N.get(ie),si=N.get(Me),An=N.get(Ti.__renderTarget),mn=N.get(si.__renderTarget);we.bindFramebuffer(G.READ_FRAMEBUFFER,An.__webglFramebuffer),we.bindFramebuffer(G.DRAW_FRAMEBUFFER,mn.__webglFramebuffer);for(let kn=0;kn<et;kn++)wt&&(G.framebufferTextureLayer(G.READ_FRAMEBUFFER,G.COLOR_ATTACHMENT0,N.get(ie).__webglTexture,Ze,_t+kn),G.framebufferTextureLayer(G.DRAW_FRAMEBUFFER,G.COLOR_ATTACHMENT0,N.get(Me).__webglTexture,me,Ce+kn)),G.blitFramebuffer(Ye,St,ke,$e,Rt,$t,ke,$e,G.DEPTH_BUFFER_BIT,G.NEAREST);we.bindFramebuffer(G.READ_FRAMEBUFFER,null),we.bindFramebuffer(G.DRAW_FRAMEBUFFER,null)}else if(Ze!==0||ie.isRenderTargetTexture||N.has(ie)){const Ti=N.get(ie),si=N.get(Me);we.bindFramebuffer(G.READ_FRAMEBUFFER,mm),we.bindFramebuffer(G.DRAW_FRAMEBUFFER,ne);for(let An=0;An<et;An++)wt?G.framebufferTextureLayer(G.READ_FRAMEBUFFER,G.COLOR_ATTACHMENT0,Ti.__webglTexture,Ze,_t+An):G.framebufferTexture2D(G.READ_FRAMEBUFFER,G.COLOR_ATTACHMENT0,G.TEXTURE_2D,Ti.__webglTexture,Ze),ti?G.framebufferTextureLayer(G.DRAW_FRAMEBUFFER,G.COLOR_ATTACHMENT0,si.__webglTexture,me,Ce+An):G.framebufferTexture2D(G.DRAW_FRAMEBUFFER,G.COLOR_ATTACHMENT0,G.TEXTURE_2D,si.__webglTexture,me),Ze!==0?G.blitFramebuffer(Ye,St,ke,$e,Rt,$t,ke,$e,G.COLOR_BUFFER_BIT,G.NEAREST):ti?G.copyTexSubImage3D(bt,me,Rt,$t,Ce+An,Ye,St,ke,$e):G.copyTexSubImage2D(bt,me,Rt,$t,Ye,St,ke,$e);we.bindFramebuffer(G.READ_FRAMEBUFFER,null),we.bindFramebuffer(G.DRAW_FRAMEBUFFER,null)}else ti?ie.isDataTexture||ie.isData3DTexture?G.texSubImage3D(bt,me,Rt,$t,Ce,ke,$e,et,Ve,Re,be.data):Me.isCompressedArrayTexture?G.compressedTexSubImage3D(bt,me,Rt,$t,Ce,ke,$e,et,Ve,be.data):G.texSubImage3D(bt,me,Rt,$t,Ce,ke,$e,et,Ve,Re,be):ie.isDataTexture?G.texSubImage2D(G.TEXTURE_2D,me,Rt,$t,ke,$e,Ve,Re,be.data):ie.isCompressedTexture?G.compressedTexSubImage2D(G.TEXTURE_2D,me,Rt,$t,be.width,be.height,Ve,be.data):G.texSubImage2D(G.TEXTURE_2D,me,Rt,$t,ke,$e,Ve,Re,be);G.pixelStorei(G.UNPACK_ROW_LENGTH,Ct),G.pixelStorei(G.UNPACK_IMAGE_HEIGHT,Lt),G.pixelStorei(G.UNPACK_SKIP_PIXELS,Ie),G.pixelStorei(G.UNPACK_SKIP_ROWS,lt),G.pixelStorei(G.UNPACK_SKIP_IMAGES,Pt),me===0&&Me.generateMipmaps&&G.generateMipmap(bt),we.unbindTexture()},this.initRenderTarget=function(ie){N.get(ie).__webglFramebuffer===void 0&&Y.setupRenderTarget(ie)},this.initTexture=function(ie){ie.isCubeTexture?Y.setTextureCube(ie,0):ie.isData3DTexture?Y.setTexture3D(ie,0):ie.isDataArrayTexture||ie.isCompressedArrayTexture?Y.setTexture2DArray(ie,0):Y.setTexture2D(ie,0),we.unbindTexture()},this.resetState=function(){M=0,R=0,v=null,we.reset(),it.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return y_}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=Rs._getDrawingBufferColorSpace(e),t.unpackColorSpace=Rs._getUnpackColorSpace()}};const UZ="__BIM_ENGINE_SDK_ASSET_BASE__",oct="https://unpkg.com/iflow-engine-base@3.9.20/dist/";function abe(){return typeof globalThis<"u"?globalThis:null}function h8(i){return i.endsWith("/")?i:`${i}/`}function lbe(i){return/^(?:[a-z][a-z\d+\-.]*:)?\/\//i.test(i)||/^(?:data|blob):/i.test(i)}function act(i){return i.startsWith("./")||i.startsWith("../")}function u8(i,e){try{return e?new URL(i,e).toString():new URL(i).toString()}catch{return null}}function cbe(){return typeof document<"u"&&document.baseURI?document.baseURI:typeof location<"u"&&location.href?location.href:null}function lct(i,e){const t=h8(i);if(lbe(t))return t;const n=d8(e)||cct()||cbe();return u8(t,n||void 0)||t}function d8(i){if(!i)return null;try{const e=cbe(),t=u8(i,e||void 0)||i,n=new URL(".",t),r=n.pathname.replace(/\\/g,"/");return r.endsWith("/chunks/")?new URL("../",n).toString():e&&/\/src\//.test(r)?h8(e):n.toString()}catch{return null}}function cct(){if(typeof document>"u")return null;const i=document.currentScript;if(i?.src)return d8(i.src);const e=document.getElementsByTagName("script");for(let t=e.length-1;t>=0;t-=1){const n=e[t]?.src;if(n&&/(?:bim-engine-sdk|iflow-engine-base|dwg-preview|gaussian)\.(?:es|umd)\.js(?:[?#].*)?$/.test(n))return d8(n)}return null}function hct(i){const e=abe();if(e){if(!i){delete e[UZ];return}e[UZ]=h8(i)}}function hbe(i){const e=abe()?.[UZ];return typeof e=="string"&&e.length>0?lct(e,i):h8(oct)}function es(i,e){if(lbe(i))return i;if(act(i)){const r=u8(i,d8(e)||void 0);if(r)return r}const t=i.replace(/^\/+/,""),n=hbe(e);return u8(t,n)||t}function p8(i){i?.assetBaseUrl&&hct(i.assetBaseUrl)}async function uct(i){p8(i);const{EngineKernelV2:e}=await Promise.resolve().then(()=>Njt).then(t=>t.E);return new e(i)}async function dct(i){p8(i);const{EngineKernel2d:e}=await Promise.resolve().then(()=>tDt).then(t=>t.a);return new e(i)}async function pct(i){p8(i);const{EngineKernel720:e}=await Promise.resolve().then(()=>$jt);return new e(i)}async function fct(i){p8(i);const{EngineKernelGIS:e}=await Promise.resolve().then(()=>DKi);return new e(i)}const iO={endpoint:"https://open.iflowbim.cn/openapi"};class mct{engine=null;registry;container;containerId;options;_isInitialized=!1;_isDestroyed=!1;initPromise=null;unsubscribeTheme=null;currentMeasureType=null;isMeasureActive=!1;currentSectionMode=null;selectedComponent=null;calibration;constructor(e,t){this.registry=t,this.container=e.container,this.container.id?this.containerId=this.container.id:(this.containerId=`engine-container-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,this.container.id=this.containerId),this.calibration={setCalibration:n=>this.setCalibration(n),apply:n=>this.applyCalibration(n),alignBySegments:n=>this.alignCalibrationBySegments(n),getMatrix:n=>this.getCalibrationMatrix(n),clear:n=>this.clearCalibration(n)},this.options={backgroundColor:"linear-gradient(to bottom, rgb(214, 224, 235), rgb(246, 250, 255))",version:e.version??"v2",showStats:e.showStats??!1,showViewCube:e.showViewCube??!0}}async init(){if(this._isInitialized){console.warn("[Engine] Engine already initialized.");return}if(this.initPromise)return this.initPromise;if(this._isDestroyed){console.error("[Engine] Cannot initialize destroyed engine.");return}try{typeof this.options.backgroundColor=="string"&&(this.container.style.background=this.options.backgroundColor);const e={containerId:this.containerId,backgroundColor:this.options.backgroundColor,version:this.options.version,showStats:this.options.showStats,showViewCube:this.options.showViewCube,sdkAuth:iO};if(console.log("引擎配置信息:",e),this.initPromise=(async()=>{const n=await uct(e);if(!n)throw new Error("Failed to create engine instance");if(this._isDestroyed){n.dispose?.();return}this.engine=n,this._isInitialized=!0,this.resize(this.container.clientWidth,this.container.clientHeight)})(),await this.initPromise,this._isDestroyed||!this.engine)return;this.unsubscribeTheme=qi.subscribe(n=>{this.setTheme(n)}),this.setTheme(qi.getTheme()),this.engine?.events?.on?(this.engine.events.on("click",n=>{const r=this.registry;console.log("[Engine] 底层 click 事件触发:",n),n&&Array.isArray(n)&&n.length>0&&n[0].url?(this.selectedComponent={url:n[0].url,id:n[0].ids?.[0]},console.log("[Engine] 触发 component:selected:",this.selectedComponent),r.emit("component:selected",this.selectedComponent)):(this.selectedComponent=null,console.log("[Engine] 触发 component:deselected"),r.emit("component:deselected",{}))}),this.engine.events.on("loading_completed",()=>{console.log("[Engine] 底层 LoadingCompleted 事件触发"),this.registry.emit("engine:model-loading-completed",{})})):console.warn("[Engine] 底层引擎不支持 events.on 方法,无法监听点击事件");const t=this.engine.oneClickEncoding;t?.on&&(t.on("encoding-start",n=>{console.log("[Engine] 底层 encoding-start 事件触发:",n),this.registry.emit("encoding:start",n)}),t.on("encoding-complete",n=>{console.log("[Engine] 底层 encoding-complete 事件触发:",n),this.registry.emit("encoding:complete",n)}),t.on("encoding-error",n=>{console.log("[Engine] 底层 encoding-error 事件触发:",n),this.registry.emit("encoding:error",n)}))}catch(e){throw console.error("[Engine] Failed to initialize engine:",e),this._isInitialized=!1,e}}setTheme(e){}setLocales(){}isInitialized(){return this._isInitialized}loadModel(e,t){if(!this._isInitialized||!this.engine){console.error("[Engine] Engine not initialized. Please call init() first.");return}if(!e||e.length===0){console.error("[Engine] Model URLs are required.");return}this.engine.loaderModule.loadModels(e,t)}async loadModelByViewToken(e){if(!this._isInitialized||!this.engine){console.error("[Engine] Engine not initialized. Please call init() first.");return}await this.engine.loadModelByViewToken(e)}getRawLabel(e){const t=this.engine?.label;return!t||typeof t[e]!="function"?(console.warn(`[Engine] label.${e} not available.`),null):t}pickPoint(){return this.getRawLabel("pickPoint")?.pickPoint?.()??Promise.resolve(null)}startPickPoint(e){return this.getRawLabel("startPickPoint")?.startPickPoint?.(e)??Promise.resolve(null)}createLabel(e){return this.getRawLabel("createLabel")?.createLabel?.(e)}createLabels(e,t){t?.clearExisting&&this.clearLabels();const n=this.getRawLabel("createLabel");return n?.createLabel?e.map(r=>n.createLabel(r)).filter(r=>typeof r=="string"&&r.length>0):[]}updateLabel(e,t){return this.getRawLabel("updateLabel")?.updateLabel?.(e,t)??!1}deleteLabel(e){return this.getRawLabel("deleteLabel")?.deleteLabel?.(e)??!1}removeLabel(e){return this.getRawLabel("removeLabel")?.removeLabel?.(e)??!1}clearLabels(){this.getRawLabel("clearLabels")?.clearLabels?.()}getLabel(e){return this.getRawLabel("getLabel")?.getLabel?.(e)}getLabels(){return this.getRawLabel("getLabels")?.getLabels?.()??[]}onLabelClick(e){return this.getRawLabel("onLabelClick")?.onLabelClick?.(e)??(()=>{})}offLabelClick(e){this.getRawLabel("offLabelClick")?.offLabelClick?.(e)}setCalibration(e){return!this._isInitialized||!this.engine?(console.warn("[Engine] Cannot set calibration: engine not initialized."),!1):typeof this.engine.calibration?.setCalibration=="function"?this.engine.calibration.setCalibration(e):this.applyCalibration(e)}applyCalibration(e){return!this._isInitialized||!this.engine?(console.warn("[Engine] Cannot apply calibration: engine not initialized."),!1):typeof this.engine.applyCalibration=="function"?this.engine.applyCalibration(e):this.engine.calibration?.setCalibration?.(e)??!1}alignCalibrationBySegments(e){return!this._isInitialized||!this.engine?(console.warn("[Engine] Cannot align calibration: engine not initialized."),!1):typeof this.engine.alignCalibrationBySegments=="function"?this.engine.alignCalibrationBySegments(e):this.engine.calibration?.alignBySegments?.(e)??!1}getCalibrationMatrix(e){return!this._isInitialized||!this.engine?(console.warn("[Engine] Cannot get calibration matrix: engine not initialized."),null):this.engine.calibration?.getMatrix?.(e)??null}clearCalibration(e){return!this._isInitialized||!this.engine?(console.warn("[Engine] Cannot clear calibration: engine not initialized."),!1):this.engine.calibration?.clear?.(e)??!1}setModelCalibrationTransform(e){if(!this._isInitialized||!this.engine)return console.warn("[Engine] Cannot set model calibration transform: engine not initialized."),!1;const t=this.findLoadedModel(e.url);if(!t)return console.warn("[Engine] Cannot set model calibration transform: model not found.",e.url),!1;const n=this.normalizeCalibrationTransform(e),r=this.buildCalibrationMatrixRows(n);if(!this.clearCalibration(e.url))return console.warn("[Engine] Cannot set model calibration transform: clear failed.",e.url),!1;const o=this.applyCalibration({url:e.url,matrix:r});return o&&this.emitCalibrationChanged(e.url,"apply",n,r,t),o}getModelCalibrationTransform(e){if(!this._isInitialized||!this.engine)return console.warn("[Engine] Cannot get model calibration transform: engine not initialized."),null;const t=this.findLoadedModel(e);if(!t)return null;const n=this.getCalibrationMatrix(e),r=this.decomposeCalibrationMatrix(n);return{url:e,name:this.getModelDisplayName(t,e),...r,matrix:this.matrixToRows(n??new rr)}}getModelCalibrationItems(){return!this._isInitialized||!this.engine?[]:this.getLoadedModels().map(e=>{const t=this.getModelUrl(e);return t?this.getModelCalibrationTransform(t):null}).filter(e=>e!==null)}resetModelCalibration(e){if(!this._isInitialized||!this.engine)return console.warn("[Engine] Cannot reset model calibration: engine not initialized."),!1;const t=this.findLoadedModel(e);if(!t)return console.warn("[Engine] Cannot reset model calibration: model not found.",e),!1;const n=this.clearCalibration(e);if(n){const r=this.createZeroCalibrationTransform();this.emitCalibrationChanged(e,"reset",r,this.identityMatrixRows(),t)}return n}createZeroCalibrationTransform(){return{offset:{x:0,y:0,z:0},rotation:{x:0,y:0,z:0},rotationOrder:"XYZ"}}normalizeCalibrationTransform(e){return{offset:{x:this.normalizeNumber(e.offset?.x),y:this.normalizeNumber(e.offset?.y),z:this.normalizeNumber(e.offset?.z)},rotation:{x:this.normalizeNumber(e.rotation?.x),y:this.normalizeNumber(e.rotation?.y),z:this.normalizeNumber(e.rotation?.z)},rotationOrder:"XYZ"}}buildCalibrationMatrixRows(e){const t=this.normalizeCalibrationTransform(e),n=new pt(t.offset.x,t.offset.y,t.offset.z),r=new Ev(this.degToRad(t.rotation.x),this.degToRad(t.rotation.y),this.degToRad(t.rotation.z),"XYZ"),s=new ia().setFromEuler(r),o=new rr().compose(n,s,new pt(1,1,1));return this.matrixToRows(o)}decomposeCalibrationMatrix(e){if(!e)return this.createZeroCalibrationTransform();const t=new pt,n=new ia,r=new pt;e.decompose(t,n,r);const s=new Ev().setFromQuaternion(n,"XYZ");return{offset:{x:this.normalizeNumber(t.x),y:this.normalizeNumber(t.y),z:this.normalizeNumber(t.z)},rotation:{x:this.normalizeNumber(this.radToDeg(s.x)),y:this.normalizeNumber(this.radToDeg(s.y)),z:this.normalizeNumber(this.radToDeg(s.z))},rotationOrder:"XYZ"}}matrixToRows(e){const t=e.elements;return[[this.normalizeNumber(t[0]),this.normalizeNumber(t[4]),this.normalizeNumber(t[8]),this.normalizeNumber(t[12])],[this.normalizeNumber(t[1]),this.normalizeNumber(t[5]),this.normalizeNumber(t[9]),this.normalizeNumber(t[13])],[this.normalizeNumber(t[2]),this.normalizeNumber(t[6]),this.normalizeNumber(t[10]),this.normalizeNumber(t[14])],[this.normalizeNumber(t[3]),this.normalizeNumber(t[7]),this.normalizeNumber(t[11]),this.normalizeNumber(t[15])]]}identityMatrixRows(){return this.matrixToRows(new rr)}emitCalibrationChanged(e,t,n,r,s){this.registry.emit("calibration:changed",{url:e,name:this.getModelDisplayName(s,e),action:t,...n,matrix:r,timestamp:Date.now()})}getLoadedModels(){const e=this.engine?.models;return Array.isArray(e)?e:[]}findLoadedModel(e){return this.getLoadedModels().find(t=>this.getModelUrl(t)===e)??null}getModelUrl(e){return typeof e?.url=="string"&&e.url.length>0?e.url:null}getModelDisplayName(e,t){const n=e?.name??e?.id??e?.modelName;if(n!=null&&String(n).trim())return String(n).trim();const s=(t.split(/[?#]/)[0]??t).split("/").filter(Boolean);return s[s.length-1]||t}degToRad(e){return e*Math.PI/180}radToDeg(e){return e*180/Math.PI}normalizeNumber(e){const t=Number(e);if(!Number.isFinite(t))return 0;const n=Math.abs(t)<1e-10?0:Number(t.toFixed(6));return Object.is(n,-0)?0:n}CameraGoHome(e){this.engine.viewCube.CameraGoHome(e)}switchToPerspectiveCamera(){if(!this._isInitialized||!this.engine?.cameraModule){console.warn("[Engine] Cannot switch to perspective camera: engine not initialized.");return}const e=this.getRuntimeCameraType(this.engine.camera);if(e!=="perspective"){if(!e){console.warn("[Engine] Cannot switch to perspective camera: unknown current camera type.");return}this.engine.cameraModule.switchToPerspectiveCamera()}}saveMainView(){if(!this._isInitialized||!this.engine?.viewCube)return console.warn("[Engine] Cannot save main view: engine not initialized."),null;const e=this.engine.viewCube.saveMainViewPort();return this.registry.emit("view:main-view-saved",{viewData:e}),e}restoreMainView(){if(!this._isInitialized||!this.engine?.viewCube){console.warn("[Engine] Cannot reset main view: engine not initialized.");return}this.engine.viewCube.resetMainViewPort(),this.registry.emit("view:main-view-restored",{})}setMainViewPort(e){if(!this._isInitialized||!this.engine?.viewCube){console.warn("[Engine] Cannot set main view: engine not initialized.");return}this.engine.viewCube.setMainViewPort(e)}captureScreenshot(){if(!this._isInitialized||!this.engine?.viewCube){console.warn("[Engine] Cannot capture screenshot: engine not initialized.");return}this.engine.viewCube.screenshot()}captureViewBase64(e="image/png",t){if(!this._isInitialized||!this.engine?.renderer?.domElement)return console.warn("[Engine] Cannot capture view base64: renderer not initialized."),null;try{return this.engine.renderer.domElement.toDataURL(e,t)}catch(n){return console.warn("[Engine] Failed to capture view base64:",n),null}}showHelpPanel(){this.registry.helpPanel?.show()}onRawEvent(e,t){this.engine?.events?.on(e,t)}offRawEvent(e,t){this.engine?.events?.off(e,t)}isContextMenuDisabled(){return!this._isInitialized||!this.engine?!1:this.engine.engineStatus?.isDisableContextMenu===!0}onOneClickEncodingEvent(e,t){this.engine?.oneClickEncoding?.on(e,t)}offOneClickEncodingEvent(e,t){this.engine?.oneClickEncoding?.off(e,t)}startOneClickEncoding(){if(!this._isInitialized||!this.engine?.oneClickEncoding){console.warn("[Engine] oneClickEncoding not available.");return}this.engine.oneClickEncoding.start()}pauseRendering(){if(!this._isInitialized||!this.engine){console.warn("[Engine] Engine not initialized.");return}this.engine.pauseRendering()}resumeRendering(){if(!this._isInitialized||!this.engine){console.warn("[Engine] Engine not initialized.");return}this.engine.resumeRendering()}createDrawingPin(e){if(console.log("[Engine] createDrawingPin called"),!this._isInitialized||!this.engine?.drawingPin){console.warn("[Engine] drawingPin.create not available. initialized:",this._isInitialized,"drawingPin:",!!this.engine?.drawingPin);return}console.log("[Engine] calling this.engine.drawingPin.create"),this.engine.drawingPin.create(t=>{console.log("[Engine] drawingPin.create callback received:",t),e(t)})}async restoreDrawingPin(e,t){if(console.log("[Engine] restoreDrawingPin called:",e),!this._isInitialized||!this.engine?.drawingPin){console.warn("[Engine] drawingPin.restore not available.");return}return this.engine.drawingPin.restore(e,"edit",n=>{console.log("[Engine] drawingPin.restore callback received:",n),t?.(n)})}async restoreViewSnapshot(e){if(console.log("[Engine] restoreViewSnapshot called:",e),!this._isInitialized||!this.engine?.drawingPin){console.warn("[Engine] drawingPin.restore not available.");return}return this.engine.drawingPin.restore(e)}showDrawingPinLabels(e){if(!this._isInitialized||!this.engine?.drawingPin?.showLabels){console.warn("[Engine] drawingPin.showLabels not available.");return}this.engine.drawingPin.showLabels(e)}hideDrawingPinLabels(){if(!this._isInitialized||!this.engine?.drawingPin?.hideLabels){console.warn("[Engine] drawingPin.hideLabels not available.");return}this.engine.drawingPin.hideLabels()}setPinRecords(e){console.log("[Engine] setPinRecords called, records count:",e.length),this.registry.emit("drawingPin:list-updated",{records:e})}setPinList(e){this.setPinRecords(e)}dispose(){if(!this._isInitialized||!this.engine){console.warn("[Engine] Engine not initialized.");return}this.engine.dispose()}resize(e,t){if(!this._isInitialized||!this.engine)return;const n=typeof e=="number"?Math.floor(e):this.container.clientWidth,r=typeof t=="number"?Math.floor(t):this.container.clientHeight;n<=0||r<=0||typeof this.engine.handleWindowResize=="function"&&this.engine.handleWindowResize(n,r)}activateMeasure(e){if(!this._isInitialized||!this.engine?.measure){console.error("[Engine] Cannot activate measure: engine not initialized.");return}if(this.currentMeasureType===e){console.log(`[Engine] Measure ${e} already active, skipping.`);return}this.isMeasureActive||(console.log("[Engine] Activating measure module"),this.engine.measure.active(),this.isMeasureActive=!0),console.log(`[Engine] Activating measure: ${e}`);const t=this.engine.measure;switch(e){case"clearHeight":t.clearHeightMeasure.active();break;case"clearDistance":t.faceDistanceMeasure.active();break;case"distance":t.distanceMeasure.active();break;case"elevation":t.elevationMeasure.active();break;case"point":t.pointMeasure.active();break;case"angle":t.angleMeasure.active();break;case"area":t.areaMeasure.active();break;case"slope":t.slopeMeasure.active();break;default:console.error(`[Engine] Unknown measure type: ${e}`);return}this.currentMeasureType=e}getCurrentMeasureType(){return this.currentMeasureType}deactivateMeasure(){!this._isInitialized||!this.engine?.measure||(console.log("[Engine] Deactivating measure"),this.engine.measure.disActive(),this.engine.measure.clearAll(),this.isMeasureActive=!1,this.currentMeasureType=null)}resetMeasureState(){this.currentMeasureType=null,this.isMeasureActive=!1}clearAllMeasures(){!this._isInitialized||!this.engine?.measure||(console.log("[Engine] Clearing all measures"),this.engine.measure.clearAll())}saveMeasureSetting(e){!this._isInitialized||!this.engine?.measure||this.engine.measure.saveSetting?.(e)}setClearHeightDirection(e){!this._isInitialized||!this.engine?.measure||(console.log(`[Engine] Setting clearHeight direction: ${e}`),this.engine.measure.clearHeightMeasure.setDirection(e))}setClearHeightSelectType(e){!this._isInitialized||!this.engine?.measure||(console.log(`[Engine] Setting clearHeight selectType: ${e}`),this.engine.measure.clearHeightMeasure.setSelectType(e))}activeSection(e){if(!this._isInitialized||!this.engine?.clipping){console.error("[Engine] Cannot activate section: engine not initialized.");return}if(this.currentSectionMode===e){console.log(`[Engine] Section ${e} already active, skipping.`);return}console.log(`[Engine] Activating section: ${e}`),this.engine.clipping.active(e),this.currentSectionMode=e}getCurrentSectionMode(){return this.currentSectionMode}setSectionBoxRange(e){if(!this._isInitialized||!this.engine?.clipping){console.error("[Engine] Cannot set section box range: engine not initialized.");return}this.engine.clipping.updateClippingValue(e)}deactivateSection(){!this._isInitialized||!this.engine?.clipping||(console.log("[Engine] Deactivating all sections"),this.engine.clipping.disActive(),this.currentSectionMode=null)}hideSection(){if(!this._isInitialized||!this.engine?.clipping){console.error("[Engine] Cannot hide section: engine not initialized.");return}console.log("[Engine] Hiding section"),this.engine.clipping.disabled()}recoverSection(){if(!this._isInitialized||!this.engine?.clipping){console.error("[Engine] Cannot recover section: engine not initialized.");return}console.log("[Engine] Recovering section"),this.engine.clipping.recover()}fitSectionBoxToModel(){if(!this._isInitialized||!this.engine){console.error("[Engine] Cannot fit section box: engine not initialized.");return}const e=this.engine.engineStatus?.highlightModels;e&&(console.log("[Engine] Fitting section box to model"),this.engine.clipping?.clippingModel(e))}fitSectionBoxToModels(e){if(!this._isInitialized||!this.engine?.clipping)return console.error("[Engine] Cannot fit section box to models: engine not initialized."),!1;const t=this.sanitizeModelParams(e);if(!t.length)return console.warn("[Engine] Cannot fit section box to models: no valid model ids."),!1;try{return this.engine.clipping.clippingModel(t),this.currentSectionMode="box",!0}catch(n){return console.warn("[Engine] fitSectionBoxToModels failed:",n),!1}}scaleSectionBox(){if(!this._isInitialized||!this.engine?.clipping){console.error("[Engine] Cannot scale section box: engine not initialized.");return}this.engine.clipping.scaleBox()}reverseSection(){if(!this._isInitialized||!this.engine?.clipping){console.error("[Engine] Cannot reverse section: engine not initialized.");return}this.engine.clipping.reverse()}setFillCutFace(e){if(!this._isInitialized||!this.engine?.clipping){console.error("[Engine] Cannot set fill cut face: engine not initialized.");return}console.log("[Engine] Setting fill cut face:",e),this.engine.clipping.setFillCutFace(e)}getFillCutFace(){return!this._isInitialized||!this.engine?.clipping?!1:this.engine.clipping.getFillCutFace?.()??!1}switchCamera(){if(!this._isInitialized||!this.engine?.cameraModule){console.warn("[Engine] Cannot switch camera: engine not initialized.");return}if((this.getRuntimeCameraType(this.engine.camera)??this.getCameraType())==="orthographic"){this.switchToPerspectiveCamera();return}this.switchToOrthographicCamera()}getCameraType(){if(!this._isInitialized||!this.engine?.cameraModule)return"perspective";const e=this.getRuntimeCameraType(this.engine.camera);if(e)return e;const t=this.engine.cameraModule.getCameraType?.();return t===1||t==="orthographic"?"orthographic":"perspective"}getRuntimeCameraType(e){return e?e.isOrthographicCamera||e.type==="OrthographicCamera"?"orthographic":e.isPerspectiveCamera||e.type==="PerspectiveCamera"||typeof e.getEffectiveFOV=="function"?"perspective":null:null}getRenderMode(){return!this._isInitialized||!this.engine?.engineModelModule?"balance":this.engine.engineModelModule.getCurrentMode()}setRenderMode(e){if(!this._isInitialized||!this.engine?.engineModelModule){console.warn("[Engine] Cannot set render mode: engine not initialized.");return}try{this.engine.engineModelModule.setMode(e)}catch(t){console.warn("[Engine] Failed to set render mode:",t)}}normalizePercent(e,t){return Number.isFinite(e)?Math.min(100,Math.max(0,Math.round(e))):t}getSettingApi(){return!this._isInitialized||!this.engine?.setting?null:this.engine.setting}callSettingMethod(e,...t){const n=this.getSettingApi();if(!n)return;const r=n[e];if(typeof r=="function")return r.apply(this.engine.setting,t)}hasSettingMethod(e){const t=this.getSettingApi();return t?typeof t[e]=="function":!1}mergeSettingsWithDefaults(e){const t=e.display?.groundId??"0",n=typeof e.display?.showGround=="boolean"?e.display.showGround:t!=="0"&&t!=="";return{render:{mode:e.render?.mode??"advanced",contrast:this.normalizePercent(e.render?.contrast??50,50),saturation:this.normalizePercent(e.render?.saturation??50,50),shadowIntensity:this.normalizePercent(e.render?.shadowIntensity??50,50),lightIntensity:this.normalizePercent(e.render?.lightIntensity??50,50),gtaoIntensity:this.normalizePercent(e.render?.gtaoIntensity??50,50)},display:{showEdge:!!e.display?.showEdge,edgeOpacity:this.normalizePercent(e.display?.edgeOpacity??30,30),showGrid:!!e.display?.showGrid,showLevel:!!e.display?.showLevel,showGround:n,groundId:t,groundHeight:Number.isFinite(e.display?.groundHeight)?Number(e.display?.groundHeight):0},environment:{type:e.environment?.type??"none",hdrId:e.environment?.hdrId??"0",hdrIntensity:this.normalizePercent(e.environment?.hdrIntensity??20,20),skyPreset:e.environment?.skyPreset??"sunrise_clear",skyParams:e.environment?.skyParams??{},skyIntensity:this.normalizePercent(e.environment?.skyIntensity??20,20)}}}getPresetLists(){const e={ground:[],hdr:[],sky:[]},t=this.getSettingApi();if(!t)return e;const n=t.getPresetLists,r=typeof n=="function"?n.call(this.engine.setting):null,s=this.getGroundList().map(a=>({id:a.id,names:[a.name,a.name,a.name]})),o=this.getHDRBackgroundList().map(a=>({id:a.id,names:[a.name,a.name,a.name]}));return{ground:Array.isArray(r?.ground)&&r.ground.length>0?r.ground:s,hdr:Array.isArray(r?.hdr)&&r.hdr.length>0?r.hdr:o,sky:Array.isArray(r?.sky)?r.sky:[]}}getSettings(){const e=this.callSettingMethod("getSettings");return e&&typeof e=="object"?this.mergeSettingsWithDefaults(e):{render:{mode:this.getRenderMode(),contrast:this.normalizePercent(this.getSceneContrast(),50),saturation:this.normalizePercent(this.getSceneSaturation(),50),shadowIntensity:50,lightIntensity:this.normalizePercent(this.getAmbientLightIntensity(),50),gtaoIntensity:50},display:{showEdge:this.getModelEdgeActive(),edgeOpacity:30,showGrid:!1,showLevel:!1,showGround:this.getGroundId()!=="0"&&this.getGroundId()!=="",groundId:this.getGroundId()||"0",groundHeight:this.getGroundElevation()},environment:{type:this.getHDRBackgroundId()&&this.getHDRBackgroundId()!=="0"?"hdr":"none",hdrId:this.getHDRBackgroundId()||"0",hdrIntensity:20,skyPreset:"sunrise_clear",skyParams:{},skyIntensity:20}}}getLegacyHdrFallbackId(e){if(typeof e=="string"&&e!==""&&e!=="0")return e;const t=this.getHDRBackgroundId();if(t&&t!=="0")return t;const n=this.getPresetLists().hdr.find(s=>s.id&&s.id!=="0");return n?.id?n.id:this.getHDRBackgroundList().find(s=>s.id&&s.id!=="0")?.id??"0"}normalizeSettingsPatch(e){if(!e.environment)return e;const t={...e.environment};if(t.type==="hdr"){const n=this.getLegacyHdrFallbackId(t.hdrId);n!=="0"&&(t.hdrId=n)}return{...e,environment:t}}async applyLegacyEnvironmentSettings(e){if(e.type==="none"){this.setHDRBackgroundId("0"),this.callSettingMethod("setHDRBackgroundVisibility",!1);return}if(e.type==="hdr"){const t=this.getLegacyHdrFallbackId(e.hdrId);if(t==="0"){console.warn("[Engine] Cannot enable HDR background: no HDR preset is available in compatibility mode.");return}this.callSettingMethod("setHDRBackgroundVisibility",!0),this.setHDRBackgroundId(t);return}e.type==="sky"&&(typeof e.skyPreset=="string"?this.callSettingMethod("setSkyPreset",e.skyPreset):void 0)===void 0&&console.warn("[Engine] Sky environment switching is unavailable in compatibility mode.")}async setSettings(e){if(!this._isInitialized||!this.engine?.setting){console.warn("[Engine] Cannot set settings: engine not initialized.");return}const t=this.normalizeSettingsPatch(e);if(this.hasSettingMethod("setSettings"))try{const s=this.callSettingMethod("setSettings",t);await Promise.resolve(s);return}catch(s){console.warn("[Engine] Native setSettings failed, fallback to compatibility mode.",s)}t.render?.mode&&this.setRenderMode(t.render.mode),typeof t.render?.lightIntensity=="number"&&this.setAmbientLightIntensity(t.render.lightIntensity),typeof t.render?.contrast=="number"&&this.setSceneContrast(t.render.contrast),typeof t.render?.saturation=="number"&&this.setSceneSaturation(t.render.saturation),typeof t.display?.showEdge=="boolean"&&(t.display.showEdge?this.activeModelEdge():this.disActiveModelEdge()),typeof t.display?.edgeOpacity=="number"&&this.callSettingMethod("setEdgeOpacity",t.display.edgeOpacity),typeof t.display?.showGrid=="boolean"&&this.callSettingMethod("setShowGrid",t.display.showGrid),typeof t.display?.showLevel=="boolean"&&this.callSettingMethod("setShowLevel",t.display.showLevel),typeof t.display?.groundId=="string"&&this.setGroundId(t.display.groundId),typeof t.display?.groundHeight=="number"&&this.setGroundElevation(t.display.groundHeight);const n=this.hasSettingMethod("setEnvironmentType"),r=this.hasSettingMethod("setHdrId");if(typeof t.environment?.type=="string")if(n){const s=this.callSettingMethod("setEnvironmentType",t.environment.type);s!==void 0&&await Promise.resolve(s)}else await this.applyLegacyEnvironmentSettings(t.environment);if(typeof t.environment?.hdrId=="string")if(r){const s=this.callSettingMethod("setHdrId",t.environment.hdrId);s!==void 0&&await Promise.resolve(s)}else t.environment.type!=="none"&&this.setHDRBackgroundId(t.environment.hdrId);typeof t.environment?.hdrIntensity=="number"&&this.callSettingMethod("setHdrIntensity",t.environment.hdrIntensity),typeof t.environment?.skyPreset=="string"&&this.callSettingMethod("setSkyPreset",t.environment.skyPreset),typeof t.environment?.skyIntensity=="number"&&this.callSettingMethod("setSkyIntensity",t.environment.skyIntensity),t.environment?.skyParams&&typeof t.environment.skyParams=="object"&&this.callSettingMethod("setSkyParams",t.environment.skyParams),typeof t.render?.shadowIntensity=="number"&&this.callSettingMethod("setShadowIntensity",t.render.shadowIntensity),typeof t.render?.gtaoIntensity=="number"&&this.callSettingMethod("setGtaoIntensity",t.render.gtaoIntensity)}async resetToDefault(){const t=this.getSettingApi()?.resetToDefault;if(typeof t=="function"){await Promise.resolve(t.call(this.engine.setting));return}await this.setSettings({render:{mode:"advanced",contrast:50,saturation:50,shadowIntensity:50,lightIntensity:50,gtaoIntensity:50},display:{showEdge:!1,edgeOpacity:30,showGrid:!1,showLevel:!1,showGround:!1,groundId:"0",groundHeight:0},environment:{type:"none",hdrId:"0",hdrIntensity:20,skyPreset:"sunrise_clear",skyParams:{},skyIntensity:20}})}activeModelEdge(){if(!this._isInitialized||!this.engine?.modelEdge){console.warn("[Engine] Cannot active model edge: engine not initialized.");return}this.engine.modelEdge.active()}disActiveModelEdge(){!this._isInitialized||!this.engine?.modelEdge||this.engine.modelEdge.disActive()}getModelEdgeActive(){return!this._isInitialized||!this.engine?.modelEdge?!1:this.engine.modelEdge.getActive?.()??!1}setAmbientLightIntensity(e){if(!this._isInitialized||!this.engine?.setting){console.warn("[Engine] Cannot set ambient light intensity: engine not initialized.");return}this.engine.setting.setAmbientLightIntensity(e)}getAmbientLightIntensity(){return!this._isInitialized||!this.engine?.setting?50:this.engine.setting.getAmbientLightIntensity?.()??50}setSceneContrast(e){if(!this._isInitialized||!this.engine?.setting){console.warn("[Engine] Cannot set scene contrast: engine not initialized.");return}this.engine.setting.setSceneContrast(e)}getSceneContrast(){return!this._isInitialized||!this.engine?.setting?50:this.engine.setting.getSceneContrast?.()??50}setSceneSaturation(e){if(!this._isInitialized||!this.engine?.setting){console.warn("[Engine] Cannot set scene saturation: engine not initialized.");return}this.engine.setting.setSceneSaturation(e)}getSceneSaturation(){return!this._isInitialized||!this.engine?.setting?50:this.engine.setting.getSceneSaturation?.()??50}getHDRBackgroundList(){return!this._isInitialized||!this.engine?.setting?[]:this.engine.setting.getHDRBackground?.()??[]}setHDRBackgroundId(e){if(!this._isInitialized||!this.engine?.setting){console.warn("[Engine] Cannot set HDR background: engine not initialized.");return}this.engine.setting.setHDRBackgroundId(e)}getHDRBackgroundId(){return!this._isInitialized||!this.engine?.setting?"":this.engine.setting.getHDRBackgroundId?.()??""}setHDRBackgroundVisibility(e){if(!this._isInitialized||!this.engine?.setting){console.warn("[Engine] Cannot set HDR background visibility: engine not initialized.");return}this.engine.setting.setHDRBackgroundVisibility(e)}getHDRBackgroundVisibility(){return!this._isInitialized||!this.engine?.setting?!0:this.engine.setting.getHDRBackgroundVisibility?.()??!0}getGroundList(){return!this._isInitialized||!this.engine?.setting?[]:this.engine.setting.getGroundList?.()??[]}setGroundId(e){if(!this._isInitialized||!this.engine?.setting){console.warn("[Engine] Cannot set ground: engine not initialized.");return}this.engine.setting.setGroundId(e)}getGroundId(){return!this._isInitialized||!this.engine?.setting?"":this.engine.setting.getGroundId?.()??""}setGroundElevation(e){if(!this._isInitialized||!this.engine?.setting){console.warn("[Engine] Cannot set ground elevation: engine not initialized.");return}this.engine.setting.setGroundElevation(e)}getGroundElevation(){return!this._isInitialized||!this.engine?.setting?0:this.engine.setting.getGroundElevation?.()??0}switchToOrthographicCamera(){if(!this._isInitialized||!this.engine?.cameraModule){console.warn("[Engine] Cannot switch to orthographic camera: engine not initialized.");return}const e=this.engine.camera,t=this.getRuntimeCameraType(e);if(t!=="orthographic"){if(t!=="perspective"||typeof e?.getEffectiveFOV!="function"){console.warn("[Engine] Cannot switch to orthographic camera: current camera is not perspective.");return}this.engine.cameraModule.switchToOrthographicCamera()}}isWalkModeActive=!1;walkViewMode=null;activateFirstPersonMode(){if(!this._isInitialized||!this.engine){console.error("[Engine] Cannot activate first person mode: engine not initialized.");return}if(!this.engine.controlModule){console.error("[Engine] Control module not available.");return}if(this.walkViewMode==="first-person"){console.log("[Engine] First person mode already active, skipping.");return}console.log("[Engine] Activating first person mode"),this.engine.controlModule.switchFirstPersonMode(),this.isWalkModeActive=!0,this.walkViewMode="first-person"}activateThirdPersonMode(){if(!this._isInitialized||!this.engine){console.error("[Engine] Cannot activate third person mode: engine not initialized.");return}if(!this.engine.controlModule){console.error("[Engine] Control module not available.");return}if(this.walkViewMode==="third-person"){console.log("[Engine] Third person mode already active, skipping.");return}console.log("[Engine] Activating third person mode"),this.engine.controlModule.switchThirdPersonMode(),this.isWalkModeActive=!0,this.walkViewMode="third-person"}deactivateFirstPersonMode(){!this._isInitialized||!this.engine?.controlModule||this.isWalkModeActive&&(this.engine.controlModule.switchDefaultMode(),console.log("[Engine] Deactivating first person mode"),this.isWalkModeActive=!1,this.walkViewMode=null)}getWalkSpeed(){if(!this._isInitialized)return console.error("[Engine] Cannot get walk speed: engine not initialized."),1;const e=this.engine.controlModule.getMoveSpeed();return console.log("[Engine] getWalkSpeed from controlModule:",e),e}setWalkSpeed(e){if(!this._isInitialized||!this.engine?.controlModule){console.error("[Engine] Cannot set walk speed: engine not initialized.");return}this.engine.controlModule.setMoveSpeed(e)}getWalkGravity(){if(!this._isInitialized)return console.error("[Engine] Cannot get walk gravity: engine not initialized."),!1;const e=this.engine.controlModule.getApplyGravity();return console.log("[Engine] getWalkGravity from controlModule:",e),e}setWalkGravity(e){if(!this._isInitialized){console.error("[Engine] Cannot set walk gravity: engine not initialized.");return}this.engine.controlModule.setApplyGravity(e)}getWalkCollision(){if(!this._isInitialized)return console.error("[Engine] Cannot get walk collision: engine not initialized."),!1;const e=this.engine.controlModule.getApplyCollision();return console.log("[Engine] getWalkCollision from controlModule:",e),e}setWalkCollision(e){if(!this._isInitialized||!this.engine?.controlModule){console.error("[Engine] Cannot set walk collision: engine not initialized.");return}this.engine.controlModule.setApplyCollision(e)}toggleMiniMap(){if(!this._isInitialized||!this.engine){console.error("[Engine] Cannot toggle mini map: engine not initialized.");return}this.engine.minMap?.toggle()}getMiniMapState(){return!this._isInitialized||!this.engine?!1:this.engine.minMap?.getstate()??!1}isFirstPersonModeActive(){return this.walkViewMode==="first-person"}getSelectedComponent(){return this.selectedComponent}getComponentProperties(e,t,n){if(!this._isInitialized||!this.engine){console.error("[Engine] Cannot get component properties: engine not initialized.");return}if(!this.engine.modelProperties){console.error("[Engine] modelProperties not available");return}console.log("[Engine] Getting component properties:",{url:e,id:t}),this.engine.modelProperties.getModelProperties(e,t,n)}getModelPosition(e){return!this._isInitialized||!this.engine?(console.error("[Engine] Cannot get model position: engine not initialized."),null):this.engine.issueReport?.getMoldePosition?(console.log("[Engine] Getting model position:",e),this.engine.issueReport.getMoldePosition(e)):(console.error("[Engine] getMoldePosition method not available in issueReport"),null)}jumpToCamera(e){if(!this._isInitialized||!this.engine)return console.error("[Engine] Cannot jump to camera: engine not initialized."),!1;if(!this.engine.issueReport?.jumptoCamera)return console.error("[Engine] jumptoCamera method not available in issueReport"),!1;console.log("[Engine] Jumping to camera:",e);try{return this.engine.issueReport.jumptoCamera(e),!0}catch(t){return console.error("[Engine] Failed to jump to camera:",t),!1}}getTypeTreeData(){return!this._isInitialized||!this.engine?.modelTree?[]:this.engine.modelTree.getTypeTreeData()}getLevelTreeData(){return!this._isInitialized||!this.engine?.modelTree?[]:this.engine.modelTree.getLevelTreeData()}getMajorTreeData(){return!this._isInitialized||!this.engine?.modelTree?[]:this.engine.modelTree.getMajorTreeData()}getAllViewTreeData(){return!this._isInitialized||!this.engine?.viewTree?[]:this.engine.viewTree.getAllViewTreeData()}openView(e,t){if(!this._isInitialized||!this.engine?.viewTree){console.warn("[Engine] Cannot open view: engine not initialized or viewTree not available.");return}try{this.engine.viewTree.openView(e,t)}catch(n){console.warn("[Engine] openView failed:",n)}}activateZoomBox(){if(!this._isInitialized||!this.engine){console.warn("[Engine] Engine not initialized.");return}this.engine.rangeScale?.active()}getEngineInfo(){if(!this._isInitialized||!this.engine)return console.warn("[Engine] Engine not initialized."),null;if(!this.engine.engineInfo||typeof this.engine.engineInfo.getEngineInfo!="function")return console.warn("[Engine] engineInfo module not available."),null;const e=this.engine.engineInfo.getEngineInfo();return console.log("[Engine] getEngineInfo raw:",e),e}pathRoamingAddPoint(){if(!this._isInitialized||!this.engine?.pathRoaming){console.warn("[Engine] pathRoaming not available");return}this.engine.pathRoaming.addPoint(0)}pathRoamingRemovePoint(e){if(!this._isInitialized||!this.engine?.pathRoaming){console.warn("[Engine] pathRoaming not available");return}this.engine.pathRoaming.removePoint(e)}pathRoamingClearPoints(){if(!this._isInitialized||!this.engine?.pathRoaming){console.warn("[Engine] pathRoaming not available");return}this.engine.pathRoaming.clearPoints()}pathRoamingGetPoints(){return!this._isInitialized||!this.engine?.pathRoaming?(console.warn("[Engine] pathRoaming not available"),[]):this.engine.pathRoaming.getPoints()??[]}pathRoamingJumpToPoint(e){if(!this._isInitialized||!this.engine?.pathRoaming){console.warn("[Engine] pathRoaming not available");return}this.engine.pathRoaming.jumpToPoint(e)}pathRoamingPlay(e){if(!this._isInitialized||!this.engine?.pathRoaming){console.warn("[Engine] pathRoaming not available");return}this.engine.pathRoaming.play(e)}pathRoamingStop(){if(!this._isInitialized||!this.engine?.pathRoaming){console.warn("[Engine] pathRoaming not available");return}this.engine.pathRoaming.stop()}getHighlightModels(){return!this._isInitialized||!this.engine?null:this.engine.engineStatus?.highlightModels??null}highlightModel(e){if(!this._isInitialized||!this.engine?.modelToolModule){console.warn("[Engine] Cannot highlight model: engine not initialized.");return}const t=this.sanitizeModelParams(e);if(t.length)try{this.engine.modelToolModule.highlightModel(t)}catch(n){console.warn("[Engine] highlightModel failed:",n)}}unhighlightAllModels(){if(!this._isInitialized||!this.engine?.modelToolModule){console.warn("[Engine] Cannot unhighlight models: engine not initialized.");return}this.engine.modelToolModule.unhighlightAllModels()}viewScaleToModel(e){if(!this._isInitialized||!this.engine?.modelToolModule){console.warn("[Engine] Cannot view scale to model: engine not initialized.");return}const t=this.sanitizeModelParams(e);if(t.length)try{this.engine.modelToolModule.viewScaleToModel(t)}catch(n){console.warn("[Engine] viewScaleToModel failed:",n)}}hideModels(e){if(!this._isInitialized||!this.engine?.modelToolModule){console.warn("[Engine] Cannot hide models: engine not initialized.");return}const t=this.sanitizeModelParams(e);if(t.length)try{this.engine.modelToolModule.hideModel(t)}catch(n){console.warn("[Engine] hideModels failed:",n)}}showModel(e){if(!this._isInitialized||!this.engine?.modelToolModule){console.warn("[Engine] Cannot show model: engine not initialized.");return}const t=this.sanitizeModelParams(e);if(t.length)try{this.engine.modelToolModule.showModel(t)}catch(n){console.warn("[Engine] showModel failed:",n)}}sanitizeModelParams(e){if(!Array.isArray(e))return[];const t=o=>o.replace(/\/+$/,""),n=Array.isArray(this.engine?.models)?this.engine.models:[],r=new Map;for(const o of n)o?.url&&r.set(t(o.url),o);const s=[];for(const o of e){if(!o||typeof o.url!="string"||!o.url||!Array.isArray(o.ids))continue;const a=r.get(t(o.url));if(!a||!(a.nodesMap instanceof Map))continue;const l=new Set;for(const h of o.ids){if(!Number.isFinite(h))continue;const u=Number(h);if(!Number.isInteger(u))continue;const d=a.nodesMap.get(u);!d||!Array.isArray(d.indexes)||d.indexes.length===0||l.add(u)}const c=Array.from(l);c.length&&s.push({url:o.url,ids:c})}return s}translucentModels(e){if(!this._isInitialized||!this.engine?.modelToolModule){console.warn("[Engine] Cannot translucent models: engine not initialized.");return}e&&this.engine.modelToolModule.translucentModel(e)}setSelectedModelColor(e,t=1){if(!this._isInitialized||!this.engine?.modelToolModule){console.warn("[Engine] Cannot set model color: engine not initialized.");return}if(typeof this.engine.modelToolModule.setModelColor!="function"){console.warn("[Engine] Cannot set model color: setModelColor not available.");return}const n=this.getHighlightModels();if(!n){console.warn("[Engine] Cannot set model color: no selected models.");return}const r=Math.max(0,Math.min(16777215,Math.trunc(e))),s=Math.max(0,Math.min(1,t));try{this.engine.modelToolModule.setModelColor(n,r,s)}catch(o){console.warn("[Engine] setSelectedModelColor failed:",o)}}restoreSelectedModelColor(){if(!this._isInitialized||!this.engine?.modelToolModule){console.warn("[Engine] Cannot restore selected model color: engine not initialized.");return}if(typeof this.engine.modelToolModule.restoreModelColor!="function"){console.warn("[Engine] Cannot restore selected model color: restoreModelColor not available.");return}const e=this.getHighlightModels();if(!e){console.warn("[Engine] Cannot restore selected model color: no selected models.");return}try{this.engine.modelToolModule.restoreModelColor(e)}catch(t){console.warn("[Engine] restoreSelectedModelColor failed:",t)}}restoreAllModelColors(){if(!this._isInitialized||!this.engine?.modelToolModule){console.warn("[Engine] Cannot restore all model colors: engine not initialized.");return}if(typeof this.engine.modelToolModule.getCustomColorModels!="function"||typeof this.engine.modelToolModule.restoreModelColor!="function"){console.warn("[Engine] Cannot restore all model colors: color APIs not available.");return}try{const e=this.engine.modelToolModule.getCustomColorModels();if(!e)return;this.engine.modelToolModule.restoreModelColor(e)}catch(e){console.warn("[Engine] restoreAllModelColors failed:",e)}}unTranslucentModel(){if(!this._isInitialized||!this.engine?.modelToolModule){console.warn("[Engine] Cannot cancel translucent: engine not initialized.");return}this.engine.modelToolModule.unTranslucentModel()}isolateModels(e){if(!this._isInitialized||!this.engine?.modelToolModule){console.warn("[Engine] Cannot isolate models: engine not initialized.");return}e&&this.engine.modelToolModule.isolateModel(e)}translucentOtherModels(e){if(!this._isInitialized||!this.engine?.modelToolModule){console.warn("[Engine] Cannot translucent other models: engine not initialized.");return}e&&this.engine.modelToolModule.translucentOtherModel(e)}showAllModels(e={}){if(!this._isInitialized||!this.engine?.modelToolModule){console.warn("[Engine] Cannot show all models: engine not initialized.");return}e.preserveSection||this.deactivateSection(),this.engine.modelToolModule.showAllModels()}activeModelLink3d(){if(!this._isInitialized||!this.engine?.modelLink3d?.active){console.warn("[Engine] Cannot active model link 3d: engine not initialized or modelLink3d not available.");return}this.engine.modelLink3d.active(),console.log("已开启模型联动")}disActiveModelLink3d(){if(!this._isInitialized||!this.engine?.modelLink3d?.disActive){console.warn("[Engine] Cannot disActive model link 3d: engine not initialized or modelLink3d not available.");return}this.engine.modelLink3d.disActive()}batchSelectSameTypeModel(e){if(!this._isInitialized||!this.engine?.modelToolModule){console.warn("[Engine] Cannot batch select: engine not initialized.");return}e&&this.engine.modelToolModule.batchSelectSameTypeModel(e)}batchSelectSameLevelModel(e){if(!this._isInitialized||!this.engine?.modelToolModule){console.warn("[Engine] Cannot batch select: engine not initialized.");return}e&&this.engine.modelToolModule.batchSelectSameLevelModel(e)}batchSelectSameLevelTypeModel(e){if(!this._isInitialized||!this.engine?.modelToolModule){console.warn("[Engine] Cannot batch select: engine not initialized.");return}e&&this.engine.modelToolModule.batchSelectSameLevelTypeModel(e)}readModelCodeFormStoge(){if(!this._isInitialized||!this.engine){console.warn("[Engine] Cannot read model code form stoge: engine not initialized.");return}let e=0;this.engine.models.forEach(t=>{this.engine.oneClickEncoding.readModelCodeFormStoge(t.url),e++}),console.log("readModelCodeFormStoge-success:",e)}hasModelCode(){if(!this._isInitialized||!this.engine)return console.warn("[Engine] Cannot check model code: engine not initialized."),!1;const e=this.engine.models;if(!Array.isArray(e)||e.length===0)return!1;const t=this.engine.oneClickEncoding;return!t||typeof t.exitModelCode!="function"?(console.warn("[Engine] oneClickEncoding.exitModelCode is not available."),!1):e.every(n=>!n||typeof n.url!="string"?!1:t.exitModelCode(n.url)===!0)}destroy(){this._isDestroyed||(this.deactivateMeasure(),this.unsubscribeTheme&&(this.unsubscribeTheme(),this.unsubscribeTheme=null),this.engine&&(this.engine.dispose(),this.engine=null),this.container.innerHTML="",this.initPromise=null,this.currentMeasureType=null,this.isMeasureActive=!1,this._isDestroyed=!0,this._isInitialized=!1)}}const ube=[{label:"Red",value:16726832},{label:"Orange",value:16749824},{label:"Yellow",value:16763904},{label:"Green",value:3458905},{label:"Blue",value:31487},{label:"Cyan",value:3321318},{label:"Purple",value:11490014},{label:"Gray",value:9342611}];function zZ(i){return`#${Math.max(0,Math.min(16777215,Math.trunc(i))).toString(16).padStart(6,"0")}`}function dbe(i){return Number.parseInt(i.replace("#",""),16)}class gct{options;element=null;outsideTimer=null;unsubscribeTheme=null;selectedColor;selectedOpacity;handleOutsidePointerDown=e=>{!this.element||this.element.contains(e.target)||this.destroy()};constructor(e){this.options=e,this.selectedColor=e.initialColor??ube[0].value,this.selectedOpacity=Math.max(0,Math.min(1,e.initialOpacity??1))}show(e,t){this.destroy(),this.element=this.createElement(),document.body.appendChild(this.element),this.unsubscribeTheme=qi.subscribe(n=>this.applyTheme(n)),this.position(e,t),this.outsideTimer=window.setTimeout(()=>{document.addEventListener("pointerdown",this.handleOutsidePointerDown,!0)},0)}destroy(){const e=!!this.element;this.outsideTimer!==null&&(window.clearTimeout(this.outsideTimer),this.outsideTimer=null),document.removeEventListener("pointerdown",this.handleOutsidePointerDown,!0),this.unsubscribeTheme?.(),this.unsubscribeTheme=null,this.element?.remove(),this.element=null,e&&this.options.onClose?.()}createElement(){const e=document.createElement("div");e.className="bim-model-color-picker",e.addEventListener("contextmenu",g=>g.preventDefault()),e.addEventListener("click",g=>g.stopPropagation()),e.addEventListener("pointerdown",g=>g.stopPropagation());const t=document.createElement("div");t.className="bim-model-color-picker__header";const n=document.createElement("div");n.className="bim-model-color-picker__title",n.textContent=At("modelColorPicker.title");const r=document.createElement("button");r.type="button",r.className="bim-model-color-picker__close",r.setAttribute("aria-label",At("modelColorPicker.close")),r.innerHTML="×",r.addEventListener("click",()=>this.destroy()),t.append(n,r),e.appendChild(t);const s=document.createElement("div");s.className="bim-model-color-picker__presets";let o=null;for(const g of this.options.colors??ube){const _=document.createElement("button");_.type="button",_.className="bim-model-color-picker__swatch",_.title=g.label,_.style.backgroundColor=zZ(g.value),_.addEventListener("click",()=>{this.selectedColor=g.value,o&&(o.value=zZ(g.value)),this.emitColorSelection()}),s.appendChild(_)}e.appendChild(s);const a=document.createElement("label");a.className="bim-model-color-picker__opacity";const l=document.createElement("div");l.className="bim-model-color-picker__opacity-top";const c=document.createElement("span");c.textContent=At("modelColorPicker.opacity");const h=document.createElement("span");h.className="bim-model-color-picker__opacity-value",h.textContent=`${Math.round(this.selectedOpacity*100)}%`;const u=document.createElement("input");u.type="range",u.min="0",u.max="100",u.step="1",u.value=String(Math.round(this.selectedOpacity*100)),u.addEventListener("input",()=>{this.selectedOpacity=Number(u.value)/100,h.textContent=`${u.value}%`,this.emitColorSelection()}),l.append(c,h),a.append(l,u),e.appendChild(a);const d=document.createElement("label");d.className="bim-model-color-picker__custom";const p=document.createElement("span");p.textContent=At("modelColorPicker.custom");const f=document.createElement("input");return f.type="color",f.value=zZ(this.selectedColor),o=f,f.addEventListener("input",()=>{this.selectedColor=dbe(f.value),this.emitColorSelection()}),f.addEventListener("change",()=>{this.selectedColor=dbe(f.value),this.emitColorSelection()}),d.append(p,f),e.appendChild(d),e}emitColorSelection(){this.options.onColorSelect(this.selectedColor,this.selectedOpacity)}applyTheme(e){if(!this.element)return;const t=this.element.style,n=e.name==="dark";this.element.classList.toggle("theme-dark",n),this.element.classList.toggle("theme-light",!n),t.setProperty("--bim-model-color-picker-bg",e.bgOverlay),t.setProperty("--bim-model-color-picker-border",e.borderDefault),t.setProperty("--bim-model-color-picker-shadow",e.shadowLg),t.setProperty("--bim-model-color-picker-text",e.textPrimary),t.setProperty("--bim-model-color-picker-muted",e.textSecondary),t.setProperty("--bim-model-color-picker-btn-bg",e.componentBgHover),t.setProperty("--bim-model-color-picker-btn-hover",e.componentBgActive),t.setProperty("--bim-model-color-picker-input-bg",e.bgInset),t.setProperty("--bim-model-color-picker-swatch-border",n?"rgba(248, 250, 252, 0.78)":"rgba(15, 23, 42, 0.18)")}position(e,t){if(!this.element)return;const n=8,r=this.element.getBoundingClientRect(),s=Math.min(Math.max(n,e),window.innerWidth-r.width-n),o=Math.min(Math.max(n,t),window.innerHeight-r.height-n);this.element.style.left=`${s}px`,this.element.style.top=`${o}px`}}class _ct{element;content=null;isVisible=!1;onCloseCallback;options;mouseDownTime=0;mouseDownX=0;mouseDownY=0;CLICK_THRESHOLD=200;MOVE_THRESHOLD=5;constructor(e){this.options=e,this.element=document.createElement("div"),this.element.className=`bim-right-key ${e?.className||""}`,e?.zIndex&&(this.element.style.zIndex=e.zIndex.toString()),document.body.appendChild(this.element)}init(){document.addEventListener("mousedown",this.handleGlobalClick),this.element.addEventListener("contextmenu",e=>{e.preventDefault(),e.stopPropagation()}),this.options?.container&&(this.options.container.addEventListener("mousedown",this.handleContainerMouseDown),this.options.container.addEventListener("mouseup",this.handleContainerMouseUp),this.options.container.addEventListener("contextmenu",this.handleContainerContextMenu))}setTheme(e){}setLocales(){}destroy(){document.removeEventListener("mousedown",this.handleGlobalClick),this.options?.container&&(this.options.container.removeEventListener("mousedown",this.handleContainerMouseDown),this.options.container.removeEventListener("mouseup",this.handleContainerMouseUp),this.options.container.removeEventListener("contextmenu",this.handleContainerContextMenu)),this.unmountContent(),this.element.remove()}handleContainerMouseDown=e=>{e.button===2&&(this.mouseDownTime=Date.now(),this.mouseDownX=e.clientX,this.mouseDownY=e.clientY)};handleContainerMouseUp=e=>{if(e.button!==2||Date.now()-this.mouseDownTime>this.CLICK_THRESHOLD)return;const n=e.clientX-this.mouseDownX,r=e.clientY-this.mouseDownY;n*n+r*r>this.MOVE_THRESHOLD*this.MOVE_THRESHOLD||this.options?.onContext&&this.options.onContext(e)};handleContainerContextMenu=e=>{e.preventDefault()};setOnClose(e){this.onCloseCallback=e}mount(e){this.unmountContent(),this.content=e,this.element.appendChild(e.getElement())}unmountContent(){this.content&&(this.content.destroy(),this.element.innerHTML="",this.content=null)}show(e,t){this.element.classList.add("visible"),this.isVisible=!0,this.element.style.left=`${e}px`,this.element.style.top=`${t}px`;const n=this.element.getBoundingClientRect(),r=window.innerWidth,s=window.innerHeight;let o=e,a=t;e+n.width>r&&(o=e-n.width),t+n.height>s&&(a=t-n.height),this.element.style.left=`${o}px`,this.element.style.top=`${a}px`}hide(){this.element.classList.remove("visible"),this.isVisible=!1,this.unmountContent(),this.onCloseCallback&&this.onCloseCallback()}handleGlobalClick=e=>{this.isVisible&&(this.element.contains(e.target)||this.hide())}}class HZ{element;options;unsubscribeLocale=null;unsubscribeTheme=null;activeSubMenu=null;constructor(e){this.options=e,this.element=document.createElement("ul"),this.element.className="bim-menu"}init(){this.render(),this.unsubscribeLocale=dr.subscribe(()=>{this.setLocales()}),this.unsubscribeTheme=qi.subscribe(e=>{this.setTheme(e)})}setTheme(e){const t=this.element.style;t.setProperty("--bim-bg-elevated",e.bgElevated),t.setProperty("--bim-text-primary",e.textPrimary),t.setProperty("--bim-divider",e.divider),t.setProperty("--bim-component-bg-hover",e.componentBgHover),t.setProperty("--bim-shadow-lg",e.shadowLg)}setLocales(){this.element.innerHTML="",this.render()}destroy(){this.unsubscribeLocale&&(this.unsubscribeLocale(),this.unsubscribeLocale=null),this.unsubscribeTheme&&(this.unsubscribeTheme(),this.unsubscribeTheme=null),this.closeSubMenu(),this.element.remove()}getElement(){return this.element}hasAnyIcon(e){return e.some(t=>t.icon?!0:t.children?this.hasAnyIcon(t.children):!1)}render(){const{items:e,groupOrder:t}=this.options;this.hasAnyIcon(e)?this.element.classList.add("has-icons"):this.element.classList.remove("has-icons");const n=new Map,r="default";e.forEach(o=>{const a=o.group||r;n.has(a)||n.set(a,[]),n.get(a).push(o)});let s=[];if(t){s=t.filter(o=>n.has(o));for(const o of n.keys())s.includes(o)||s.push(o)}else s=Array.from(n.keys());s.forEach((o,a)=>{if(a>0){const c=document.createElement("li");c.className="bim-menu-divider",this.element.appendChild(c)}const l=n.get(o);l.sort((c,h)=>(c.order||0)-(h.order||0)),l.forEach(c=>{if(c.visible!==!1&&(this.element.appendChild(this.createItemElement(c)),c.divider)){const h=document.createElement("li");h.className="bim-menu-divider",this.element.appendChild(h)}})})}createItemElement(e){const t=document.createElement("li"),n=!e.disabled;t.className=`bim-menu-item ${n?"":"disabled"}`;const r=document.createElement("div");r.className="bim-menu-item-icon",e.icon&&(r.innerHTML=e.icon),t.appendChild(r);const s=document.createElement("div");s.className="bim-menu-item-label",s.textContent=At(e.label),t.appendChild(s);const o=e.children,a=o&&o.length>0;if(a){const l=document.createElement("div");l.className="bim-menu-item-arrow",l.innerHTML='<svg viewBox="0 0 24 24"><path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"/></svg>',t.appendChild(l),t.addEventListener("mouseenter",()=>this.openSubMenu(e,t))}else t.addEventListener("mouseenter",()=>this.closeSubMenu());return n&&t.addEventListener("click",l=>{l.stopPropagation(),console.log(`[BimMenu] Clicked item: ${e.id}`),a||(e.onClick?(console.log(`[BimMenu] Executing onClick for ${e.id}`),e.onClick()):console.warn(`[BimMenu] No onClick handler for ${e.id}`))}),t}openSubMenu(e,t){const n=e.children;if(!n||n.length===0)return;this.closeSubMenu();const r=document.createElement("div");r.style.position="fixed",r.style.zIndex="10001";const s=t.getBoundingClientRect();r.style.top=`${s.top}px`,r.style.left=`${s.right}px`,r.addEventListener("mousedown",l=>l.stopPropagation());const o=new HZ({items:n});o.init(),r.appendChild(o.element),document.body.appendChild(r),this.activeSubMenu={menu:o,container:r};const a=r.getBoundingClientRect();a.right>window.innerWidth&&(r.style.left=`${s.left-a.width}px`)}closeSubMenu(){this.activeSubMenu&&(this.activeSubMenu.menu.destroy(),this.activeSubMenu.container.remove(),this.activeSubMenu=null)}}class VZ extends Mc{container;rightKeyPanel;contextHandlers=[];constructor(e,t){super(t),this.container=e,this.rightKeyPanel=new _ct({zIndex:9e3,container:this.container,onContext:this.handleContextMenu}),this.rightKeyPanel.init()}destroy(){this.rightKeyPanel.destroy(),super.destroy()}registerHandler(e){this.contextHandlers.push(e)}unregisterHandler(e){this.contextHandlers=this.contextHandlers.filter(t=>t!==e)}clearHandlers(e=!0){if(!e){this.contextHandlers=[];return}this.contextHandlers.length!==0&&(this.contextHandlers=[this.contextHandlers[0]])}showMenu(e,t,n,r){if(!n||n.length===0)return;const s=new HZ({items:n,groupOrder:r});s.init(),this.rightKeyPanel.mount(s),this.rightKeyPanel.show(e,t)}hide(){this.rightKeyPanel.hide()}isContextMenuDisabled(){return this.registry.engine3d?.getEngineComponent()?.isContextMenuDisabled()===!0}handleContextMenu=e=>{if(this.isContextMenuDisabled()){e.preventDefault(),e.stopPropagation(),this.hide();return}let t=null;for(const n of this.contextHandlers){const r=n(e);r&&r.length>0&&(t||(t=[]),t=t.concat(r))}t&&t.length>0?this.showMenu(e.clientX,e.clientY,t):this.hide()}}function yct(i){return Array.isArray(i)&&i.length>0}function pbe(i){return!!i?.url&&yct(i?.ids)}function vct(i){const e=i?.getHighlightModels();return console.log("[selected-section-fit] current highlight models:",e),Array.isArray(e)?e.some(t=>pbe(t)):e&&typeof e=="object"?pbe(e):!1}function fbe(i){return vct(i)?(i?.fitSectionBoxToModel(),!0):!1}const bct=["level","type","major"];function Act(i){return new Set(i?Array.isArray(i)?i:[i]:bct)}function mbe(i){return String(i).trim().toLowerCase()}function xct(i,e,t){const n=!e||(i.name??"").toLowerCase().includes(e),r=!t||String(i.id??"").toLowerCase()===t;return n&&r}function f8(i,e){const t=i.children?.map(r=>f8(r,e))??null,n={...i,children:t};return e||delete n.ids,n}function gbe(i,e,t,n){if(xct(i,e,t))return f8(i,n);const r=i.children?.map(o=>gbe(o,e,t,n)).filter(o=>o!==null)??[];if(r.length===0)return null;const s={...i,children:r};return n||delete s.ids,s}function GZ(i,e){const t=e?.includeIds??!0,n=e?.name?mbe(e.name):"",r=e?.componentId!==void 0?mbe(e.componentId):"";return!(n||r||e?.includeIds===!1)?i:!n&&!r?i.map(o=>({...o,children:o.children?.map(a=>f8(a,t))??null})):i.map(o=>{const a=!!(n&&(o.name??"").toLowerCase().includes(n)),l=o.children??[];if(a&&!r)return{...o,children:l.map(h=>f8(h,t))};const c=l.map(h=>gbe(h,n,r,t)).filter(h=>h!==null);return c.length===0?null:{...o,children:c}}).filter(o=>o!==null)}class _be extends Mc{container;engineInstance=null;rightKey=null;modelColorPicker=null;calibration;options;defaultRightKeyHandler=e=>{const t=this.engineInstance?.getSelectedComponent(),n=[];return t&&(n.push({id:"componentDetail",label:"menu.componentDetail",group:"component",order:1,divider:!0,onClick:()=>{this.registry.componentDetail?.show(),this.rightKey?.hide()}}),n.push({id:"hideSelected",label:"menu.hideSelected",group:"component",order:2,onClick:()=>{const r=this.engineInstance?.getHighlightModels();r&&this.engineInstance?.hideModels(r),this.rightKey?.hide()}}),n.push({id:"transparentSelected",label:"menu.transparentSelected",group:"component",order:3,onClick:()=>{const r=this.engineInstance?.getHighlightModels();r&&this.engineInstance?.translucentModels(r),this.rightKey?.hide()}}),n.push({id:"cancelTranslucent",label:"menu.cancelTranslucent",group:"component",order:4,onClick:()=>{this.engineInstance?.unTranslucentModel(),this.rightKey?.hide()}}),n.push({id:"componentColor",label:"menu.componentColor",group:"component",order:5,children:[{id:"setSelectedColor",label:"menu.setSelectedColor",onClick:()=>{this.rightKey?.hide(),this.openModelColorPicker(e.clientX,e.clientY)}},{id:"restoreSelectedColor",label:"menu.restoreSelectedColor",onClick:()=>{this.engineInstance?.restoreSelectedModelColor(),this.closeModelColorPicker(),this.rightKey?.hide()}},{id:"restoreAllColors",label:"menu.restoreAllColors",onClick:()=>{this.engineInstance?.restoreAllModelColors(),this.closeModelColorPicker(),this.rightKey?.hide()}}]}),n.push({id:"isolateSelected",label:"menu.isolateSelected",group:"component",order:6,divider:!0,children:[{id:"hideOthers",label:"menu.hideOthers",onClick:()=>{const r=this.engineInstance?.getHighlightModels();r&&this.engineInstance?.isolateModels(r),this.rightKey?.hide()}},{id:"transparentOthers",label:"menu.transparentOthers",onClick:()=>{const r=this.engineInstance?.getHighlightModels();r&&this.engineInstance?.translucentOtherModels(r),this.rightKey?.hide()}}]}),n.push({id:"quickSelect",label:"menu.quickSelect",group:"component",order:7,children:[{id:"selectSameType",label:"menu.selectSameType",onClick:()=>{const r=this.engineInstance?.getHighlightModels();r&&this.engineInstance?.batchSelectSameTypeModel(r),this.rightKey?.hide()}},{id:"selectSameLevel",label:"menu.selectSameLevel",onClick:()=>{const r=this.engineInstance?.getHighlightModels();r&&this.engineInstance?.batchSelectSameLevelModel(r),this.rightKey?.hide()}},{id:"selectSameLevelType",label:"menu.selectSameLevelType",onClick:()=>{const r=this.engineInstance?.getHighlightModels();r&&this.engineInstance?.batchSelectSameLevelTypeModel(r),this.rightKey?.hide()}}]}),n.push({id:"fitSectionBox",label:"menu.fitSectionBox",group:"component",order:8,onClick:()=>{fbe(this.engineInstance),this.rightKey?.hide()}})),this.registry.componentTreeDrawer?.isPinEditable()&&n.push({id:"createPin",label:"componentTreeDrawer.actions.addPin",group:"component",order:9,divider:!0,onClick:()=>{this.registry.componentTreeDrawer?.createPin(),this.rightKey?.hide()}}),n.push({id:"showAll",label:"menu.showAll",group:"component",order:10,onClick:()=>{this.engineInstance?.showAllModels(),this.emit("menu:show-all",{}),this.rightKey?.hide()}}),n};openModelColorPicker(e,t){this.closeModelColorPicker(),this.modelColorPicker=new gct({onColorSelect:(n,r)=>this.engineInstance?.setSelectedModelColor(n,r),onClose:()=>{this.modelColorPicker=null}}),this.modelColorPicker.show(e,t)}closeModelColorPicker(){const e=this.modelColorPicker;this.modelColorPicker=null,e?.destroy()}constructor(e,t,n){super(t),this.container=e,this.calibration={setCalibration:r=>this.setCalibration(r),apply:r=>this.applyCalibration(r),alignBySegments:r=>this.alignCalibrationBySegments(r),getMatrix:r=>this.getCalibrationMatrix(r),clear:r=>this.clearCalibration(r)},this.options={enableRightKeyMenu:n?.enableRightKeyMenu??!0}}getEngineComponent(){return this.engineInstance}async initialize(e){this.engineInstance&&this.engineInstance.isInitialized()&&(console.warn("[EngineManager] 3D Engine already initialized. Destroying old instance..."),this.engineInstance.destroy(),this.engineInstance=null);try{const t=new mct({container:this.container,...e},this.registry);return this.engineInstance=t,await t.init(),this.rightKey&&this.rightKey!==this.registry.rightKey&&this.rightKey.destroy(),this.rightKey=null,this.options.enableRightKeyMenu?(this.rightKey=this.registry.rightKey??new VZ(this.container,this.registry),this.rightKey.unregisterHandler(this.defaultRightKeyHandler),this.rightKey.registerHandler(this.defaultRightKeyHandler),this.engineInstance===t&&t.isInitialized()):this.engineInstance===t&&t.isInitialized()}catch(t){return console.error("[EngineManager] Failed to initialize 3D engine:",t),this.engineInstance=null,!1}}isInitialized(){return this.engineInstance!==null&&this.engineInstance.isInitialized()}loadModel(e,t){if(!this.engineInstance){console.warn("[EngineManager] 3D Engine not initialized.");return}this.engineInstance.loadModel(e,t)}async loadModelByViewToken(e){if(!this.engineInstance){console.warn("[EngineManager] 3D Engine not initialized.");return}await this.engineInstance.loadModelByViewToken(e)}pickPoint(){return this.engineInstance?this.engineInstance.pickPoint():(console.warn("[EngineManager] 3D Engine not initialized."),Promise.resolve(null))}startPickPoint(e){return this.engineInstance?this.engineInstance.startPickPoint(e):(console.warn("[EngineManager] 3D Engine not initialized."),Promise.resolve(null))}createLabel(e){if(!this.engineInstance){console.warn("[EngineManager] 3D Engine not initialized.");return}return this.engineInstance.createLabel(e)}createLabels(e,t){return this.engineInstance?this.engineInstance.createLabels(e,t):(console.warn("[EngineManager] 3D Engine not initialized."),[])}updateLabel(e,t){return this.engineInstance?this.engineInstance.updateLabel(e,t):(console.warn("[EngineManager] 3D Engine not initialized."),!1)}deleteLabel(e){return this.engineInstance?this.engineInstance.deleteLabel(e):(console.warn("[EngineManager] 3D Engine not initialized."),!1)}removeLabel(e){return this.engineInstance?this.engineInstance.removeLabel(e):(console.warn("[EngineManager] 3D Engine not initialized."),!1)}clearLabels(){if(!this.engineInstance){console.warn("[EngineManager] 3D Engine not initialized.");return}this.engineInstance.clearLabels()}getLabel(e){if(!this.engineInstance){console.warn("[EngineManager] 3D Engine not initialized.");return}return this.engineInstance.getLabel(e)}getLabels(){return this.engineInstance?this.engineInstance.getLabels():(console.warn("[EngineManager] 3D Engine not initialized."),[])}onLabelClick(e){return this.engineInstance?this.engineInstance.onLabelClick(e):(console.warn("[EngineManager] 3D Engine not initialized."),()=>{})}offLabelClick(e){if(!this.engineInstance){console.warn("[EngineManager] 3D Engine not initialized.");return}this.engineInstance.offLabelClick(e)}setCalibration(e){return this.engineInstance?this.engineInstance.setCalibration(e):(console.warn("[EngineManager] 3D Engine not initialized."),!1)}applyCalibration(e){return this.engineInstance?this.engineInstance.applyCalibration(e):(console.warn("[EngineManager] 3D Engine not initialized."),!1)}alignCalibrationBySegments(e){return this.engineInstance?this.engineInstance.alignCalibrationBySegments(e):(console.warn("[EngineManager] 3D Engine not initialized."),!1)}getCalibrationMatrix(e){return this.engineInstance?this.engineInstance.getCalibrationMatrix(e):(console.warn("[EngineManager] 3D Engine not initialized."),null)}clearCalibration(e){return this.engineInstance?this.engineInstance.clearCalibration(e):(console.warn("[EngineManager] 3D Engine not initialized."),!1)}setModelCalibrationTransform(e){return this.engineInstance?this.engineInstance.setModelCalibrationTransform(e):(console.warn("[EngineManager] 3D Engine not initialized."),!1)}getModelCalibrationTransform(e){return this.engineInstance?this.engineInstance.getModelCalibrationTransform(e):(console.warn("[EngineManager] 3D Engine not initialized."),null)}getModelCalibrationItems(){return this.engineInstance?this.engineInstance.getModelCalibrationItems():(console.warn("[EngineManager] 3D Engine not initialized."),[])}resetModelCalibration(e){return this.engineInstance?this.engineInstance.resetModelCalibration(e):(console.warn("[EngineManager] 3D Engine not initialized."),!1)}pauseRendering(){if(!this.engineInstance){console.warn("[EngineManager] 3D Engine not initialized.");return}this.engineInstance.pauseRendering()}resumeRendering(){if(!this.engineInstance){console.warn("[EngineManager] 3D Engine not initialized.");return}this.engineInstance.resumeRendering()}captureViewBase64(e="image/png",t){return this.engineInstance?this.engineInstance.captureViewBase64(e,t):(console.warn("[EngineManager] 3D Engine not initialized."),null)}addViewDropdownButton(e){return this.registry.viewDropdown?this.registry.viewDropdown.addButton(e):(console.warn("[EngineManager] View dropdown manager not initialized."),()=>{})}removeViewDropdownButton(e){if(!this.registry.viewDropdown){console.warn("[EngineManager] View dropdown manager not initialized.");return}this.registry.viewDropdown.removeButton(e)}async restoreViewSnapshot(e){if(!this.engineInstance){console.warn("[EngineManager] 3D Engine not initialized.");return}return this.engineInstance.restoreViewSnapshot(e)}getModelPosition(e){return this.engineInstance?this.engineInstance.getModelPosition(e):(console.warn("[EngineManager] 3D Engine not initialized."),null)}jumpToCamera(e){return this.engineInstance?this.engineInstance.jumpToCamera(e):(console.warn("[EngineManager] 3D Engine not initialized."),!1)}setMainViewPort(e){if(!this.engineInstance){console.warn("[EngineManager] 3D Engine not initialized.");return}this.engineInstance.setMainViewPort(e)}getConstructTreeData(e){if(!this.engineInstance)return console.warn("[EngineManager] 3D Engine not initialized."),{level:[],type:[],major:[]};const t=Act(e?.type),n={level:t.has("level")?this.engineInstance.getLevelTreeData():[],type:t.has("type")?this.engineInstance.getTypeTreeData():[],major:t.has("major")?this.engineInstance.getMajorTreeData():[]};return{level:GZ(n.level,e),type:GZ(n.type,e),major:GZ(n.major,e)}}getComponentProperties(e,t,n){if(!this.engineInstance){console.warn("[EngineManager] 3D Engine not initialized.");return}this.engineInstance.getComponentProperties(e,t,n)}highlightModel(e){if(!this.engineInstance){console.warn("[EngineManager] 3D Engine not initialized.");return}this.engineInstance.highlightModel(e)}hideModels(e){if(!this.engineInstance){console.warn("[EngineManager] 3D Engine not initialized.");return}this.engineInstance.hideModels(e)}translucentModels(e){if(!this.engineInstance){console.warn("[EngineManager] 3D Engine not initialized.");return}this.engineInstance.translucentModels(e)}showAllModels(e){if(!this.engineInstance){console.warn("[EngineManager] 3D Engine not initialized.");return}this.engineInstance.showAllModels(e)}activeModelLink3d(){if(!this.engineInstance){console.warn("[EngineManager] 3D Engine not initialized.");return}this.engineInstance.activeModelLink3d()}disActiveModelLink3d(){if(!this.engineInstance){console.warn("[EngineManager] 3D Engine not initialized.");return}this.engineInstance.disActiveModelLink3d()}unTranslucentModel(){if(!this.engineInstance){console.warn("[EngineManager] 3D Engine not initialized.");return}this.engineInstance.unTranslucentModel()}isolateModels(e){if(!this.engineInstance){console.warn("[EngineManager] 3D Engine not initialized.");return}this.engineInstance.isolateModels(e)}translucentOtherModels(e){if(!this.engineInstance){console.warn("[EngineManager] 3D Engine not initialized.");return}this.engineInstance.translucentOtherModels(e)}fitSectionBoxToModels(e){return this.engineInstance?this.engineInstance.fitSectionBoxToModels(e):(console.warn("[EngineManager] 3D Engine not initialized."),!1)}setPinRecords(e){if(console.log("[EngineManager] setPinRecords called, records count:",e.length),!this.engineInstance){console.warn("[EngineManager] 3D Engine not initialized.");return}this.engineInstance.setPinRecords(e)}setPinList(e){this.setPinRecords(e)}registerRightKeyHandler(e){if(!this.rightKey){console.warn("[EngineManager] RightKey manager not initialized.");return}this.rightKey.registerHandler(e)}unregisterRightKeyHandler(e){if(!this.rightKey){console.warn("[EngineManager] RightKey manager not initialized.");return}this.rightKey.unregisterHandler(e)}clearRightKeyHandlers(e=!0){if(!this.rightKey){console.warn("[EngineManager] RightKey manager not initialized.");return}this.rightKey.clearHandlers(e)}showRightKeyMenu(e,t,n,r){if(!this.rightKey){console.warn("[EngineManager] RightKey manager not initialized.");return}this.rightKey.showMenu(e,t,n,r)}hideRightKeyMenu(){if(!this.rightKey){console.warn("[EngineManager] RightKey manager not initialized.");return}this.rightKey.hide()}destroy(){this.closeModelColorPicker(),this.rightKey&&this.rightKey.unregisterHandler(this.defaultRightKeyHandler),this.engineInstance&&(this.engineInstance.destroy(),this.engineInstance=null),this.rightKey&&this.rightKey!==this.registry.rightKey&&this.rightKey.destroy(),this.rightKey=null,super.destroy()}}const ybe={测量:'<svg width="48" height="48" viewBox="0 0 48 48"><path fill="currentColor" d="M0,28.207H3.429v3.526H44.571V28.207H48v7.052H0ZM0,3.526v14.1a3.478,3.478,0,0,0,3.429,3.526H6.857V17.629h3.429v3.526h3.429V17.629h3.429v3.526h3.429V10.578H24V21.155h3.429V17.629h3.429v3.526h3.429V17.629h3.429v3.526h3.429V10.578h3.429V21.155A3.478,3.478,0,0,0,48,17.629V3.526A3.478,3.478,0,0,0,44.571,0H3.429A3.478,3.478,0,0,0,0,3.526Z" transform="translate(0 5.456)"/></svg>',地图:'<svg width="48" height="48" viewBox="0 0 48 48"><path fill="currentColor" d="M32.984,563.2H26.329a66.982,66.982,0,0,1-5.471,7.121l-1.455,1.61-1.455-1.61a66.978,66.978,0,0,1-5.471-7.121H5.821L0,580.662H38.8Z" transform="translate(4.598 -537.259)"/><path fill="currentColor" d="M275.4,9.7a9.7,9.7,0,1,0-19.4,0c0,6.636,9.7,17.462,9.7,17.462S275.4,16.337,275.4,9.7Zm-13.582,0a3.88,3.88,0,1,1,3.88,3.88,3.88,3.88,0,0,1-3.88-3.88Z" transform="translate(-241.701 4.598)"/></svg>',框选放大:'<svg width="48" height="48" viewBox="0 0 48 48"><path fill="currentColor" d="M336.351,336.158l-5.5.037-.037-5.5-3.665.025.037,5.5-5.491.037.025,3.665,5.491-.037.041,5.491,3.661-.025-.037-5.491,5.5-.041Z" transform="translate(-305.467 -314.477)"/><path fill="currentColor" d="M41.88,40.861l-.227-.223-7.167-7.068a14.787,14.787,0,1,0-2.832,2.4l7.4,7.3.227.223.021-.021a1.821,1.821,0,0,0,1.065.33,1.849,1.849,0,0,0,1.837-1.862,1.868,1.868,0,0,0-.343-1.061l.017-.021ZM23.648,34.668A11.1,11.1,0,1,1,34.675,23.487,11.106,11.106,0,0,1,23.648,34.668ZM3,41.492H6.241v3.241H3ZM3,15.564H6.241v3.241H3ZM3,2.6H6.241V5.841H3Zm12.964,0h3.241V5.841H15.964Zm-6.482,0h3.241V5.841H9.482Zm12.964,0h3.241V5.841H22.446Zm6.482,0h3.241V5.841H28.928Zm6.482,0h3.241V5.841H35.41Zm6.482,0h3.241V5.841H41.892Zm0,6.482h3.241v3.241H41.892Zm0,6.482h3.241v3.241H41.892Zm0,6.482h3.241v3.241H41.892ZM9.482,41.492h3.241v3.241H9.482Zm6.482,0h3.241v3.241H15.964Zm6.482,0h3.241v3.241H22.446ZM3,9.082H6.241v3.241H3ZM3,22.046H6.241v3.241H3Zm38.892,6.482h3.241v3.241H41.892ZM3,28.528H6.241v3.241H3ZM3,35.01H6.241v3.241H3Z" transform="translate(-0.067 0.333)"/></svg>',漫游:'<svg width="48" height="48" viewBox="0 0 48 48"><path fill="currentColor" d="M327.239,38.548a6.01,6.01,0,1,0-6.358-6A6.144,6.144,0,0,0,327.239,38.548Zm8.006,5.76a3.082,3.082,0,0,0-3.061-2.64h-1.648c-.471,0-.706.24-1.177.48l-2.119,1.68-2.119-1.92a1.781,1.781,0,0,0-1.177-.48h-1.648a2.914,2.914,0,0,0-3.061,2.64l-1.413,10.8c0,.48,0,.96.471,1.2a1.781,1.781,0,0,0,1.177.48h1.648l1.413,15.36a3.082,3.082,0,0,0,3.061,2.64h3.532a2.914,2.914,0,0,0,3.061-2.64l1.413-15.36h1.648a1.781,1.781,0,0,0,1.177-.48,2.2,2.2,0,0,0,.235-1.2Z" transform="translate(-303.239 -26.548)"/></svg>',目录树:'<svg width="48" height="48" viewBox="0 0 48 48"><path fill="currentColor" d="M116.8,153.474h12a1.2,1.2,0,0,0,1.2-1.185v-7.111a1.2,1.2,0,0,0-1.2-1.184h-12a1.2,1.2,0,0,0-1.2,1.184v1.629H93.553v-7.554H100a1.2,1.2,0,0,0,1.2-1.185v-7.112a1.2,1.2,0,0,0-1.2-1.185H83.2a1.2,1.2,0,0,0-1.2,1.185v7.112a1.2,1.2,0,0,0,1.2,1.185h6.45v28a2.383,2.383,0,0,0,2.4,2.37H115.6v1.63a1.2,1.2,0,0,0,1.2,1.185h12a1.2,1.2,0,0,0,1.2-1.185v-7.112a1.2,1.2,0,0,0-1.2-1.185h-12a1.2,1.2,0,0,0-1.2,1.185v1.63H93.553V150.657H115.6v1.629a1.2,1.2,0,0,0,1.2,1.185Z" transform="translate(-82 -126.874)"/></svg>',剖切:'<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48" fill="currentColor"><g transform="translate(-176.967 -101.068)"><path d="M306.33,364.55h14.737v19.115H306.33Z" transform="translate(-118.068 -248.554)"/><path d="M487.114,140.356a1.6,1.6,0,0,1-1.744-1.393V99.573a1.787,1.787,0,0,1,3.487,0v39.389A1.6,1.6,0,0,1,487.114,140.356Z" transform="translate(-285.677 6.11)"/><path d="M508.34,274.031H487.114a1.743,1.743,0,1,1,0-3.487h17.739V242.767H487.114a1.744,1.744,0,1,1,0-3.487H508.34Z" transform="translate(-285.677 -131.282)"/><path d="M201.437,274.031h-3.278a1.743,1.743,0,1,1,0-3.487h3.278a1.743,1.743,0,1,1,0,3.487Zm-8.858,0H187a1.743,1.743,0,1,1,0-3.487h5.579a1.743,1.743,0,1,1,0,3.487Zm-10.626-.532a1.743,1.743,0,0,1-1.743-1.744v-5.579a1.743,1.743,0,1,1,3.487,0v5.579A1.743,1.743,0,0,1,181.953,273.5Zm0-11.159a1.743,1.743,0,0,1-1.743-1.743v-5.579a1.743,1.743,0,1,1,3.487,0V260.6A1.743,1.743,0,0,1,181.953,262.34Zm0-11.158a1.744,1.744,0,0,1-1.743-1.744v-5.579a1.743,1.743,0,1,1,3.487,0v5.579A1.744,1.744,0,0,1,181.953,251.181Zm19.484-8.414h-5.579a1.744,1.744,0,1,1,0-3.487h5.579a1.744,1.744,0,0,1,0,3.487Zm-11.159,0H184.7a1.744,1.744,0,1,1,0-3.487h5.579a1.744,1.744,0,1,1,0,3.487Z" transform="translate(0 -131.282)"/></g></svg>',剖切盒:'<svg width="48" height="48" viewBox="0 0 48 48" fill="currentColor"><g transform="translate(-56.83 2.793)"><path d="M194.963,19.168a1.69,1.69,0,0,1-.607-.119l-19.027-8.292a1.253,1.253,0,0,1,0-2.35L191.289.112a1.592,1.592,0,0,1,1.24,0l18.663,8.294a1.267,1.267,0,0,1,.791,1.175,1.308,1.308,0,0,1-.791,1.175l-15.6,8.278a1.519,1.519,0,0,1-.633.143Zm-15.7-9.586,15.7,6.832,12.331-6.832L191.9,2.749Z" transform="translate(-109.947 0)"/><path d="M195.008,417.821a1.691,1.691,0,0,1-.607-.119l-19.025-8.294a1.253,1.253,0,0,1,0-2.35l15.958-8.294a1.592,1.592,0,0,1,1.24,0l18.657,8.294a1.267,1.267,0,0,1,.791,1.175,1.308,1.308,0,0,1-.791,1.175l-15.6,8.278c-.211.095-3.483.143-3.694.143Zm-15.6-9.588,15.6,6.832,12.329-6.832L191.948,401.4Z" transform="translate(-109.992 -382.638)"/><path d="M200.046,603.93a1.976,1.976,0,0,1-.634-.119l-18.774-8.3a1.257,1.257,0,0,1-.655-1.754,1.512,1.512,0,0,1,1.931-.595l18.131,8.013,14.971-8.007a1.51,1.51,0,0,1,1.928.6,1.256,1.256,0,0,1-.661,1.75l-15.6,8.282a1.489,1.489,0,0,1-.634.119Z" transform="translate(-115.041 -568.787)"/><path d="M101.029,216.82a1.467,1.467,0,0,1-1-.377,1.237,1.237,0,0,1-.41-.917V198.817a1.413,1.413,0,0,1,2.816,0V215.5a1.241,1.241,0,0,1-.4.931A1.472,1.472,0,0,1,101.029,216.82Zm-34.377.143a1.467,1.467,0,0,1-1-.377,1.237,1.237,0,0,1-.41-.917V198.817a1.413,1.413,0,0,1,2.816,0v16.852a1.237,1.237,0,0,1-.41.917A1.467,1.467,0,0,1,66.652,216.964Zm-5.215,2.8a1.467,1.467,0,0,1-1-.377,1.237,1.237,0,0,1-.41-.917V201.621a1.413,1.413,0,0,1,2.816,0v16.852a1.237,1.237,0,0,1-.41.917A1.467,1.467,0,0,1,61.436,219.768Z" transform="translate(-0.4 -189.683)"/><path d="M60.922,37.617A1.32,1.32,0,0,1,60,37.258a1.2,1.2,0,0,1-.378-.876V20.295a1.3,1.3,0,0,1,2.588,0V36.382a1.276,1.276,0,0,1-1.294,1.235Zm-1.175,8.411a1.341,1.341,0,0,1,1.75-.578l15.126,7.071a1.224,1.224,0,0,1,.6,1.671,1.337,1.337,0,0,1-1.75.572L60.347,47.708a1.228,1.228,0,0,1-.606-1.671Z" transform="translate(0 -18.25)"/><path d="M71.756,44.947a1.337,1.337,0,0,1,1.75-.582l15.126,7.118a1.235,1.235,0,0,1,.6,1.682,1.333,1.333,0,0,1-1.75.576L72.356,46.629a1.239,1.239,0,0,1-.606-1.682ZM59.915,12.652a1.337,1.337,0,0,1,1.75-.582L76.79,19.194a1.235,1.235,0,0,1,.6,1.682,1.333,1.333,0,0,1-1.75.576L60.515,14.334A1.247,1.247,0,0,1,59.915,12.652Z" transform="translate(-0.168 -11.442)"/><path d="M334.418,146.671a1.341,1.341,0,0,1,1.75-.578l15.126,7.073a1.224,1.224,0,0,1,.6,1.671,1.337,1.337,0,0,1-1.75.573l-15.126-7.09a1.25,1.25,0,0,1-.663-.7,1.177,1.177,0,0,1,.058-.945Zm16.3,35.276a1.32,1.32,0,0,1-.917-.36,1.2,1.2,0,0,1-.377-.875v-16.1a1.3,1.3,0,0,1,2.588,0V180.7a1.2,1.2,0,0,1-.38.878,1.321,1.321,0,0,1-.922.357Z" transform="translate(-260.918 -139.687)"/><path d="M576.438,360.4a1.288,1.288,0,0,1-1.294-1.294V342.253a1.294,1.294,0,1,1,2.588,0v16.852A1.3,1.3,0,0,1,576.438,360.4ZM572.8,344.248,573,361.1l-2.613.024-.2-16.857Z" transform="translate(-486.154 -327.316)"/><path d="M508.543,26.833l.192,16.852-2.613.024-.192-16.852Z" transform="translate(-425.253 -25.689)"/></g></svg>',全屏:'<svg width="48" height="48" viewBox="0 0 48 48"><path fill="currentColor" d="M6.241,3.671H12.85a1.734,1.734,0,0,0,1.836-1.836A1.734,1.734,0,0,0,12.85,0H1.469C1.1,0,.734.367.367.734A1.349,1.349,0,0,0,0,1.836V12.85a1.734,1.734,0,0,0,1.836,1.836A1.734,1.734,0,0,0,3.671,12.85V6.241l9.913,9.913a1.817,1.817,0,1,0,2.57-2.57ZM13.584,27.9,6.975,34.51l-3.3,3.3V31.206a1.734,1.734,0,0,0-1.836-1.836A1.734,1.734,0,0,0,0,31.206V42.22a1.734,1.734,0,0,0,1.836,1.836H12.85a1.836,1.836,0,0,0,0-3.671H6.241l3.3-3.3,6.608-6.608a1.817,1.817,0,1,0-2.57-2.57ZM42.22,29.371a1.734,1.734,0,0,0-1.836,1.836v6.608l-3.3-3.3L30.472,27.9a1.817,1.817,0,1,0-2.57,2.57L34.51,37.08l3.3,3.3H31.206a1.836,1.836,0,1,0,0,3.671H42.22a1.734,1.734,0,0,0,1.836-1.836V31.206a1.734,1.734,0,0,0-1.836-1.836ZM42.22,0H31.206a1.734,1.734,0,0,0-1.836,1.836,1.734,1.734,0,0,0,1.836,1.836h6.608l-3.3,3.3L27.9,13.584a1.817,1.817,0,1,0,2.57,2.57L37.08,9.545l3.3-3.3V12.85a1.836,1.836,0,0,0,3.671,0V1.836A1.734,1.734,0,0,0,42.22,0Z" transform="translate(1.972 1.972)"/></svg>',设置:'<svg width="48" height="48" viewBox="0 0 48 48"><path fill="currentColor" d="M112.388,106.443l-2.668-.373a1.687,1.687,0,0,1-1.306-1.031,16.337,16.337,0,0,0-2-3.475,1.681,1.681,0,0,1-.243-1.646l1.012-2.5a1.652,1.652,0,0,0-.709-2.057l-5.769-3.335a1.654,1.654,0,0,0-2.136.415L96.919,94.56a1.693,1.693,0,0,1-1.562.62,15.32,15.32,0,0,0-3.992,0,1.693,1.693,0,0,1-1.562-.62l-1.651-2.113a1.654,1.654,0,0,0-2.136-.415l-5.769,3.33a1.659,1.659,0,0,0-.709,2.057l1.012,2.5a1.679,1.679,0,0,1-.243,1.646,16.141,16.141,0,0,0-2,3.475A1.669,1.669,0,0,1,77,106.066l-2.668.373a1.663,1.663,0,0,0-1.432,1.646v6.665a1.662,1.662,0,0,0,1.427,1.642l2.668.373a1.687,1.687,0,0,1,1.306,1.031,16.338,16.338,0,0,0,2,3.475,1.681,1.681,0,0,1,.243,1.646l-1.012,2.5a1.652,1.652,0,0,0,.709,2.057l5.769,3.33a1.654,1.654,0,0,0,2.136-.415L89.8,128.27a1.693,1.693,0,0,1,1.562-.62,15.321,15.321,0,0,0,3.992,0,1.693,1.693,0,0,1,1.562.62l1.651,2.113a1.654,1.654,0,0,0,2.136.415l5.769-3.33a1.659,1.659,0,0,0,.709-2.057l-1.012-2.5a1.681,1.681,0,0,1,.243-1.646,16.141,16.141,0,0,0,2-3.475,1.669,1.669,0,0,1,1.306-1.031l2.668-.373a1.658,1.658,0,0,0,1.427-1.642v-6.665A1.639,1.639,0,0,0,112.388,106.443ZM93.36,117.893a6.478,6.478,0,1,1,6.478-6.478A6.479,6.479,0,0,1,93.36,117.893Z" transform="translate(-69.355 -87.415)"/></svg>',眼睛:'<svg width="48" height="48" viewBox="0 0 48 48" fill="currentColor"><path d="M24 10C13.2 10 5.2 18.2 2.4 23.1a1.8 1.8 0 0 0 0 1.8C5.2 29.8 13.2 38 24 38s18.8-8.2 21.6-13.1a1.8 1.8 0 0 0 0-1.8C42.8 18.2 34.8 10 24 10Zm0 24c-8.4 0-14.9-6-17.4-10C9.1 20 15.6 14 24 14s14.9 6 17.4 10C38.9 28 32.4 34 24 34Z"/><path d="M24 17a7 7 0 1 0 0 14a7 7 0 0 0 0-14Zm0 10a3 3 0 1 1 0-6a3 3 0 0 1 0 6Z"/></svg>',联动模型:'<svg width="48" height="48" viewBox="0 0 48 48" fill="currentColor"><path d="M18.2 31.7a9.2 9.2 0 0 1 0-13l4.3-4.3a9.2 9.2 0 0 1 13 13l-3.4 3.4a2 2 0 0 1-2.8-2.8l3.4-3.4a5.2 5.2 0 0 0-7.4-7.4L21 21.5a5.2 5.2 0 0 0 0 7.4a2 2 0 1 1-2.8 2.8Z"/><path d="M12.5 20.6l3.4-3.4a2 2 0 0 1 2.8 2.8l-3.4 3.4a5.2 5.2 0 0 0 7.4 7.4l4.3-4.3a5.2 5.2 0 0 0 0-7.4a2 2 0 0 1 2.8-2.8a9.2 9.2 0 0 1 0 13l-4.3 4.3a9.2 9.2 0 0 1-13-13Z"/></svg>',拾曲面剖切:'<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48" fill="currentColor"><g transform="translate(-59.63 -21.333)"><path d="M302.465,495.393l2.363-4.363a.842.842,0,0,1,1.091-.273.914.914,0,0,1,.454,1l-1.636,3,11.453-3.454c.091,0,.091,0,.182-.091a.785.785,0,1,1,.273,1.545l-11.453,3.454,3,1.545h.091a.645.645,0,0,1,.182,1,.842.842,0,0,1-1.091.273l-4.545-2.363c-.091,0-.182-.091-.273-.182A.742.742,0,0,1,302.465,495.393Z" transform="translate(205.84 -520.136) rotate(43)"/><path d="M88.23,54.014v2.86l-21.123,8.17V34l21.123-8.17V47.069h2.9l-.207-25.736L64,31.75V69.333L91.129,58.916v-4.9Z"/><path d="M199,255.9l-15.532,6.268v-21.23L199,234.667Z" transform="translate(-113.668 -202.979)"/></g></svg>',轴向剖切:'<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48" fill="currentColor"><g transform="translate(-59.63 -21.333)"><path d="M.194,3.727,2.558,8.089a.842.842,0,0,0,1.091.273.914.914,0,0,0,.454-1l-1.636-3L13.919,7.817c.091,0,.091,0,.182.091a.785.785,0,1,0,.273-1.545L2.921,2.909l3-1.545h.091a.645.645,0,0,0,.182-1A.842.842,0,0,0,5.1.091L.558,2.454c-.091,0-.182.091-.273.182A.742.742,0,0,0,.194,3.727Z" transform="translate(102.244 57.563) rotate(-178)"/><path d="M88.23,54.014v2.86l-21.123,8.17V34l21.123-8.17V47.069h2.9l-.207-25.736L64,31.75V69.333L91.129,58.916v-4.9Z"/><path d="M199,255.9l-15.532,6.268v-21.23L199,234.667Z" transform="translate(-113.668 -202.979)"/></g></svg>',主视角:'<svg width="48" height="48" viewBox="0 0 48 48"><path fill="currentColor" d="M122.32,181.835v-13.16h-9.87V163.74h19.74v18.095Zm-19.74,0V163.74h9.87v18.095ZM96,163.74,117.385,144l21.385,19.74Z" transform="translate(-93.385 -138.917)"/></svg>',文档:'<svg width="48" height="48" viewBox="0 0 48 48"><path fill="currentColor" d="M64,128h1.714v41.143H64Zm46.286,0H112v41.143h-1.714Zm-44.571,0h44.571v3.429H65.714Zm0,6.857h44.571v3.429H65.714Zm0-3.429h3.429v3.429H65.714Zm8.571,0h3.429v3.429H74.286Zm8.571,0h27.429v3.429H82.857Zm-17.143,36h44.571v1.714H65.714Zm5.143-24H76v1.714H70.857Zm10.286,0h24v1.714h-24Zm-10.286,6.857H76V152H70.857Zm10.286,0h24V152h-24Zm-10.286,6.857H76v1.714H70.857Zm10.286,0h24v1.714h-24Z" transform="translate(-64 -124.571)"/></svg>',第一人称漫游:'<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48" fill="currentColor"><path d="M178.325,132.27a6.411,6.411,0,0,0,0-9.429,7.359,7.359,0,0,0-9.984,0,6.411,6.411,0,0,0,0,9.429,7.359,7.359,0,0,0,9.984,0Zm-2-7.543a3.845,3.845,0,0,1,0,5.657,4.414,4.414,0,0,1-5.99,0,3.847,3.847,0,0,1,0-5.657,4.414,4.414,0,0,1,5.99,0Zm6.618,31.639q4.975,1.006,4.975,3.189t-4.975,3.189a57.4,57.4,0,0,1-19.226,0q-4.973-1.006-4.973-3.189t4.975-3.189q.777-.156,1.613-.284v-2.521a4.488,4.488,0,0,1-1.412.217,4.761,4.761,0,0,1-.587-.036l-.038,0a29.007,29.007,0,0,0-7.657,2.332q-3.482,1.712-3.482,3.484a2.944,2.944,0,0,0,1.3,2.116,14.359,14.359,0,0,0,4.4,2.293,46.614,46.614,0,0,0,15.477,2.258,46.614,46.614,0,0,0,15.477-2.258,14.362,14.362,0,0,0,4.4-2.293,2.943,2.943,0,0,0,1.3-2.116q0-1.772-3.482-3.484a29.007,29.007,0,0,0-7.657-2.332,4.908,4.908,0,0,1-.625.039,4.488,4.488,0,0,1-1.412-.217v2.521q.836.128,1.613.284Zm-14.788-6.588v5.979q2.391-.2,5.176-.2t5.176.2v-12.2h2.824v6.222a1.25,1.25,0,0,0,.414.942v0l.081.071q.744.1,1.457.22a1.41,1.41,0,0,0,.457-.293,1.25,1.25,0,0,0,.414-.942v-8a3.75,3.75,0,0,0-1.24-2.828,4.2,4.2,0,0,0-2.995-1.172H166.745a4.2,4.2,0,0,0-2.995,1.172,3.75,3.75,0,0,0-1.24,2.828v8a1.268,1.268,0,0,0,.414.942,1.415,1.415,0,0,0,.456.293q.715-.119,1.459-.222.041-.034.081-.071a1.25,1.25,0,0,0,.414-.942v-6.222h2.824Zm-8.471-6.222v-1.778a6.253,6.253,0,0,1,2.067-4.715,7.013,7.013,0,0,1,4.992-1.952h13.176a7.013,7.013,0,0,1,4.992,1.952,6.253,6.253,0,0,1,2.067,4.715v8a3.722,3.722,0,0,1-.484,1.881l0,.005a28.526,28.526,0,0,1,5.841,2.041q5,2.462,5,5.851,0,4.238-7.531,6.9a49.5,49.5,0,0,1-16.469,2.428,49.5,49.5,0,0,1-16.469-2.428q-7.531-2.667-7.531-6.9,0-3.388,5-5.849a28.381,28.381,0,0,1,5.841-2.044,3.707,3.707,0,0,1-.488-1.884Zm24.8,16a13.145,13.145,0,0,0-2.129-.581,54.5,54.5,0,0,0-18.044,0,13.079,13.079,0,0,0-2.127.581,13.078,13.078,0,0,0,2.127.581,54.5,54.5,0,0,0,18.044,0,13.078,13.078,0,0,0,2.127-.581Z" transform="translate(-149.333 -120.889)"/></svg>',反向:'<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48" fill="currentColor"><g transform="translate(0.364 4.658)"><path d="M0,287.1m0-.817v-2.042a.722.722,0,0,1,.817-.817H44.509a.722.722,0,0,1,.817.817v2.042a.722.722,0,0,1-.817.817H.817A.722.722,0,0,1,0,286.28Z" transform="translate(-0.001 -272.164)"/><path d="M829.7,13.238l-1.443,1.444a.817.817,0,0,1-1.155,0L815.263,2.844a.817.817,0,0,1,0-1.156L816.706.244a.817.817,0,0,1,1.155,0L829.7,12.083a.817.817,0,0,1,0,1.155Z" transform="translate(-782.667)"/><path d="M94.367,648m0,.817v2.042a.722.722,0,0,1-.817.817H49.858a.722.722,0,0,1-.817-.817v-2.042a.722.722,0,0,1,.817-.817H93.55A.722.722,0,0,1,94.367,648.816Z" transform="translate(-47.095 -622.268)"/><path d="M.239,649.97l1.443-1.444a.817.817,0,0,1,1.155,0l11.838,11.838a.817.817,0,0,1,0,1.156l-1.443,1.443a.817.817,0,0,1-1.155,0L.239,651.124a.817.817,0,0,1,0-1.155Z" transform="translate(0 -622.544)"/></g></svg>',路径漫游:'<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48" fill="currentColor"><g transform="translate(0 -4.9)"><path d="M43.755,35.8a23.352,23.352,0,0,1-8.074-3.095c-1.131-.912-2.263-1.819-2.263-3.458,0-.364-.164-.548-.486-.548-1.776-.364-2.263,0-1.935,2.183a5,5,0,0,0,1.776,3.095,14.337,14.337,0,0,0,4.521,2.551c2.1.912,4.521,1.276,6.461,2.551,1.935,1.091,2.1,2.551.809,4.37A12.572,12.572,0,0,1,37.3,48.187a30.594,30.594,0,0,1-17.115-1.455c-2.585-.912-4.2-.364-5.488,2,0,.184-.164.184-.323.548,2.1.728,3.876,1.455,5.811,2,5.811,1.639,11.786,2.367,17.76.548A14.453,14.453,0,0,0,46.663,45.1c2.422-4.2,1.613-8.381-2.908-9.293Zm-19.7-7.97a11.943,11.943,0,0,0-7.382-10.952A12.17,12.17,0,0,0,3.457,19.546a10.951,10.951,0,0,0-2.3,12.879c2.459,5.329,6.456,9.77,10.453,14.06.463.444.617.444,1.075,0,3.689-4.143,7.382-8.287,10-13.172A11.6,11.6,0,0,0,24.059,27.833Zm-4.151,3.255c-1.692,3.851-4.614,6.955-7.382,10.215-.463.444-.617.3-.921,0A44.891,44.891,0,0,1,4.228,31.088a7.684,7.684,0,0,1-.767-3.109A8.664,8.664,0,0,1,18.22,21.909a8.155,8.155,0,0,1,1.688,9.18ZM33.007,4.9c-5.685,0-9.785,6.416-7.274,11.76,1.454,3.34,4.1,5.745,6.746,8.15a.492.492,0,0,0,.795,0c2.908-2.537,5.554-5.211,7.008-8.821A8.117,8.117,0,0,0,33.007,4.9Zm4.366,10.422A16.825,16.825,0,0,1,33.4,20c-.4.269-.659.269-.926,0a16.342,16.342,0,0,1-3.969-4.545,5.033,5.033,0,1,1,8.864-.132Z"/><path d="M183.031,141.935a2.136,2.136,0,0,0,2.053-2.18,2.084,2.084,0,0,0-2.18-2.18,2.171,2.171,0,0,0-2.053,2.307A2.058,2.058,0,0,0,183.031,141.935Zm-20.094,7.854a4.7,4.7,0,0,0-4.6,4.881,4.913,4.913,0,0,0,4.74,4.881,4.882,4.882,0,0,0-.14-9.762Zm0,6.417a1.77,1.77,0,0,1-1.532-1.532A1.79,1.79,0,0,1,162.937,153a1.611,1.611,0,0,1,1.672,1.672A1.578,1.578,0,0,1,162.937,156.206Z" transform="translate(-150.629 -126.653)"/></g></svg>',适应到模型:'<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48" fill="currentColor"><g transform="translate(-84.667 -84.667)"><path d="M87.667,97V87.667H97V85.333H86.733a1.4,1.4,0,0,0-1.4,1.4V97Zm0,23.333H85.333V130.6a1.4,1.4,0,0,0,1.4,1.4H97v-2.333H87.667v-9.333Zm32.667,9.333V132H130.6a1.4,1.4,0,0,0,1.4-1.4V120.333h-2.333v9.333h-9.333ZM129.667,97H132V86.733a1.4,1.4,0,0,0-1.4-1.4H120.333v2.333h9.333Z"/><path d="M270.857,243.5l11.3-6.652V223.387l-11.3,6.361V243.5Zm-1.8,0v-13.75l-11.3-6.361v13.456l11.3,6.652Zm-10.278-21.621,11.177,6.284,11.177-6.284L269.958,215.3l-11.177,6.573Zm11.622-8.426,13.1,7.709a.919.919,0,0,1,.448.793v15.419a.926.926,0,0,1-.448.793l-13.1,7.709a.887.887,0,0,1-.9,0l-13.1-7.709a.905.905,0,0,1-.448-.793V221.954a.919.919,0,0,1,.448-.793l13.1-7.709A.887.887,0,0,1,270.4,213.452Z" transform="translate(-161.292 -120.997)"/></g></svg>',隐藏:'<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48" fill="currentColor"><path d="M61.274,76.178l0-.007-.007,0a32.458,32.458,0,0,0-7.014-9.981L51.53,68.91a28.382,28.382,0,0,1,6.124,8.635c-4.472,9.25-10.809,13.636-19.472,13.636A20.615,20.615,0,0,1,30.6,89.838l-2.937,2.933a23.916,23.916,0,0,0,10.514,2.277q15.472,0,23.088-16.116a3.229,3.229,0,0,0,0-2.755ZM57.839,58.351l-2.274-2.277a.429.429,0,0,0-.608,0l-6.265,6.262a23.775,23.775,0,0,0-10.51-2.281q-15.472,0-23.088,16.116v.007a3.236,3.236,0,0,0,0,2.765,32.617,32.617,0,0,0,7.014,9.985L16.7,94.32a.429.429,0,0,0,0,.608l2.274,2.277a.429.429,0,0,0,.608,0L57.839,58.949a.426.426,0,0,0,0-.6ZM32.113,78.915a6.011,6.011,0,0,1,7.22-7.22l-7.223,7.22Zm9.9-9.9A9.452,9.452,0,0,0,29.43,81.6l-4.6,4.6a28.424,28.424,0,0,1-6.124-8.635c4.475-9.25,10.816-13.636,19.472-13.636a20.615,20.615,0,0,1,7.577,1.343Zm-4.046,14.55a5.752,5.752,0,0,1-1.01-.086l-2.744,2.741A9.446,9.446,0,0,0,46.638,73.794L43.9,76.538a6.018,6.018,0,0,1-5.932,7.024Z" transform="translate(-14.182 -52.64)"/></svg>',重置:'<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48" fill="currentColor"><path d="M32.936,32.658a15.914,15.914,0,0,1-9.6,3.064c-.451-.006-.9-.042-1.342-.077-.182-.018-.357-.047-.539-.077-.352-.047-.7-.089-1.037-.164-.211-.036-.422-.1-.621-.148-.334-.077-.668-.154-.99-.254-.153-.059-.3-.11-.457-.177-.381-.124-.755-.26-1.113-.414-.082-.036-.162-.071-.24-.1-.422-.2-.844-.408-1.248-.627-.017-.012-.035-.018-.054-.03a16.485,16.485,0,0,1-3.732-2.9c-.017-.018-.035-.042-.054-.059-.34-.355-.668-.721-.979-1.118-.065-.083-.123-.16-.194-.254A17.286,17.286,0,0,1,7.149,18.751h3.98L6.318,9.076,0,18.874H3.942a20.809,20.809,0,0,0,3.5,11.57.871.871,0,0,0,.075.14c.225.34.486.648.724.961.1.113.177.232.274.362.354.443.746.869,1.133,1.285.043.043.075.076.108.113a19.778,19.778,0,0,0,4.436,3.446c.043.027.08.043.128.076.467.259.949.5,1.432.719.124.055.242.113.359.164.419.184.847.335,1.277.493.2.076.4.14.611.21.378.113.762.21,1.153.3.257.065.509.129.772.184a2.252,2.252,0,0,0,.316.076c.37.07.735.1,1.1.151.134.027.27.049.4.065.66.065,1.314.11,1.974.11,4.006,0,8.852-1.3,11.85-4.177a1.908,1.908,0,0,0,.333-2.484,2.228,2.228,0,0,0-2.952.023ZM44.053,20.424a20.728,20.728,0,0,0-3.47-11.537c-.032-.055-.054-.113-.08-.164-.284-.405-.574-.778-.869-1.161a1.289,1.289,0,0,1-.1-.14A19.86,19.86,0,0,0,32.168,1.7c-.086-.032-.155-.076-.242-.11-.456-.195-.922-.362-1.394-.53C30.37,1,30.2.937,30.033.883,29.62.754,29.212.651,28.792.548c-.231-.055-.467-.113-.7-.164-.113-.022-.22-.055-.338-.081-.311-.055-.617-.081-.933-.124C26.6.151,26.392.119,26.18.1,25.655.042,25.135.021,24.616.016c-.1,0-.188-.016-.284-.016-.016,0-.032.005-.049.005A19.124,19.124,0,0,0,13.02,3.695a1.682,1.682,0,0,0-.466,2.515,1.777,1.777,0,0,0,2.309.3A15.251,15.251,0,0,1,24.374,3.45c.486.006.971.03,1.441.077.147.012.287.036.432.059a11.3,11.3,0,0,1,1.16.189c.162.03.334.077.493.11.381.089.744.178,1.107.3a2.577,2.577,0,0,1,.34.124c.422.142.832.29,1.23.467.047.012.082.047.123.059a16.492,16.492,0,0,1,6.182,4.8.367.367,0,0,0,.024.036A17.308,17.308,0,0,1,40.629,20.43H36.645l5.048,9.787L48,20.424Zm0,0" transform="translate(0 4.349)"/></svg>',填充:'<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48" fill="currentColor"><path d="M24 6L10 22h10v18h8V22h10L24 6z" opacity="0.35"/><path d="M8 24h32v4H8z"/></svg>',标高:'<svg width="32" height="32" viewBox="0 0 32 32"><path fill="currentColor" d="M84.131,193.119a1.056,1.056,0,0,1,1.116.982v7.857a1.056,1.056,0,0,1-1.116.982H54.367a1.056,1.056,0,0,1-1.116-.982V194.1a1.056,1.056,0,0,1,1.116-.982Zm-1.116,1.964H55.483v5.893H83.015Zm1.116-13.749a1.064,1.064,0,0,1,1.114.935,1.032,1.032,0,0,1-1.007,1.025l-.107,0H71.2l-7.858,6.914a1.227,1.227,0,0,1-1.578,0l-8.185-7.2-.018-.016-.032-.031.049.047a1.107,1.107,0,0,1-.092-.092l-.011-.014a.869.869,0,0,1-.182-.857l0-.008L53.31,182l.012-.029.02-.045.019-.035a1.1,1.1,0,0,1,.891-.552h.007q.053,0,.107,0ZM68.043,183.3H57.06l5.492,4.831Z" transform="translate(-53.247 -176.136)"/></svg>',距离:'<svg width="32" height="32" viewBox="0 0 32 32"><path fill="currentColor" d="M29.692,3.03,27.55.919a.529.529,0,0,1-.014-.756A.549.549,0,0,1,28.3.15l.014.013,3.067,3.023a.529.529,0,0,1,0,.756L28.317,6.966a.549.549,0,0,1-.767.013.529.529,0,0,1-.014-.756l.014-.013L29.692,4.1H2.31L4.452,6.21a.528.528,0,0,1,.013.756.547.547,0,0,1-.766.013l-.014-.013L.616,3.942a.531.531,0,0,1,0-.756L3.685.163a.548.548,0,0,1,.767.014.528.528,0,0,1,0,.742L2.31,3.03ZM24.136,15.055H23.051V18H21.966v-2.94H20.882V18H19.8v-2.94H18.712V18H17.627v-2.94H16.543v5.078H15.458V15.055H14.373V18H13.288v-2.94H12.2V18H11.119v-2.94H10.034V18H8.949v-2.94H7.865V18H6.78v-2.94H5.7v5.078H4.61V15.055H1.9a.27.27,0,0,0-.272.268v6.413A.269.269,0,0,0,1.9,22H30.1a.268.268,0,0,0,.271-.267V15.323a.269.269,0,0,0-.271-.268H27.39v5.078H26.305V15.055H25.221V18H24.136Zm5.966-1.6A1.884,1.884,0,0,1,32,15.323v6.413a1.885,1.885,0,0,1-1.9,1.871H1.9A1.885,1.885,0,0,1,0,21.736V15.323a1.885,1.885,0,0,1,1.9-1.871Z" transform="translate(0 4.197)"/></svg>',最小距离:'<svg width="32" height="32" viewBox="0 0 32 32"><path fill="currentColor" d="M-5.839,24.8H-34.16A1.875,1.875,0,0,1-36,22.933V16.52a1.887,1.887,0,0,1,1.9-1.871H-5.9A1.887,1.887,0,0,1-4,16.52v6.412A1.875,1.875,0,0,1-5.839,24.8ZM-34.1,16.252a.27.27,0,0,0-.272.268v6.412a.27.27,0,0,0,.272.267H-5.9a.269.269,0,0,0,.271-.267V16.52a.27.27,0,0,0-.271-.268H-8.61V21.33H-9.695V16.252h-1.085v2.939h-1.085V16.252h-1.085v2.939h-1.085V16.252h-1.084v2.939H-16.2V16.252h-1.085v2.939h-1.085V16.252h-1.084V21.33h-1.084V16.252h-1.085v2.939h-1.085V16.252H-23.8v2.939h-1.085V16.252h-1.085v2.939h-1.085V16.252h-1.084v2.939H-29.22V16.252H-30.3V21.33H-31.39V16.252Z" transform="translate(36 2)"/><path fill="currentColor" d="M23.716,7.947V4.875c0-.8-.232-1.085-.765-1.085a1.573,1.573,0,0,0-1.133.585V7.947H20.4V2.75h1.163l.1.687H21.7a2.547,2.547,0,0,1,1.763-.817c1.172,0,1.676.78,1.676,2.089V7.947Zm-7.26,0V2.62h1.58V7.947Zm-3.8,0V4.875c0-.8-.243-1.085-.76-1.085a1.606,1.606,0,0,0-1.049.585V7.947H9.421V4.875c0-.8-.243-1.085-.758-1.085a1.608,1.608,0,0,0-1.05.585V7.947H6.194V2.75H7.36l.1.7H7.5A2.326,2.326,0,0,1,9.169,2.62a1.486,1.486,0,0,1,1.5.91A2.445,2.445,0,0,1,12.4,2.62c1.156,0,1.691.78,1.691,2.089V7.947Zm3.8-6.849a.79.79,0,0,1,1.58,0,.79.79,0,0,1-1.58,0Z" transform="translate(0.333 3.053)"/></svg>',激光边距:'<svg width="32" height="32" viewBox="0 0 32 32"><path fill="currentColor" d="M0,1.293v31.96H32V1.293ZM30.97,32.182H1.03V2.323H30.97Z"/><path fill="currentColor" d="M160.026,291.9l1.6,1.6,7.305-7.305-7.305-7.305-1.6,1.6,4.794,4.566h-6.392v2.283h6.392Zm-5.251,0-4.566-4.566h6.164v-2.283H150.21l4.566-4.566-1.37-1.6L146.1,286.19l7.305,7.305Z" transform="translate(-141.535 -268.917)"/></svg>',角度:'<svg width="32" height="32" viewBox="0 0 32 32"><path fill="currentColor" d="M39.587,50.766h13.7a1,1,0,0,1,0,2H23.171a1,1,0,0,1,0-2h1.418l6.582-7.006v-.006a.517.517,0,0,1,.14-.357.456.456,0,0,1,.337-.144l12.1-12.876a.451.451,0,0,1,.665,0,.524.524,0,0,1,0,.708L32.883,43.355a8.3,8.3,0,0,1,6.7,7.411Zm-.949,0a7.254,7.254,0,0,0-6.611-6.5l-6.108,6.5Z" transform="translate(-22.229 -26.489)"/></svg>',坡度:'<svg width="32" height="32" viewBox="0 0 32 32"><path fill="currentColor" d="M202.1,188.337l2.629-2.191-8.447-3.106,1.533,8.871,2.629-2.194,9.341,11.209,1.656-1.379Zm-13.726-.435a1.075,1.075,0,0,0-1.07-.341,1.057,1.057,0,0,0-.5.277l-5.11,4.08a1.08,1.08,0,0,0-.406.84l-.007,17.386a1.079,1.079,0,0,0,1.077,1.077L205.7,211.2a1.078,1.078,0,0,0,.822-1.774Zm-4.934,21.164.007-15.788,3.968-3.171,15.974,18.941Z" transform="translate(-180.36 -181.131)"/></svg>',体积:'<svg width="32" height="32" viewBox="0 0 32 32"><path fill="currentColor" d="M94.74,86.658V71.189a.371.371,0,0,1,.2-.329l13.869-7.22a.371.371,0,0,1,.344,0l13.053,6.891h0l.819.431a.371.371,0,0,1,.2.328v15.3a.371.371,0,0,1-.2.328l-13.872,7.255a.371.371,0,0,1-.342,0L94.94,86.987a.371.371,0,0,1-.2-.329Zm2.119-.837,11.2,5.8a.024.024,0,0,0,.035-.022V79.483a.371.371,0,0,0-.2-.328l-11.2-5.909a.024.024,0,0,0-.035.021V85.492A.371.371,0,0,0,96.859,85.821Zm13.151-6.459v12a.12.12,0,0,0,.176.106L114,89.474l3.334-1.745,3.771-1.978a.371.371,0,0,0,.2-.328V73.5a.193.193,0,0,0-.284-.171l-10.812,5.708A.371.371,0,0,0,110.01,79.362ZM97.925,71.725l10.839,5.72a.371.371,0,0,0,.346,0L119.8,71.808a.214.214,0,0,0,0-.378l-10.649-5.621a.371.371,0,0,0-.344,0L97.925,71.47A.144.144,0,0,0,97.925,71.725Z" transform="translate(-92.982 -62.907)"/></svg>',空间体积:'<svg width="32" height="32" viewBox="0 0 32 32"><path fill="currentColor" d="M125.977,128.829l13.076-7.363v-13.6l-13.076,6.8Zm-3.126-15.655a.565.565,0,0,1-.258-.064L109.3,106.323a.567.567,0,0,1-.011-1L122.578,98a.567.567,0,0,1,.55,0l13.288,7.325a.567.567,0,0,1-.011,1l-13.292,6.79A.63.63,0,0,1,122.851,113.174ZM110.773,105.8l12.078,6.172,12.078-6.172-12.078-6.657Z" transform="translate(-1.922)"/><path fill="currentColor" d="M120.649,322.52a.58.58,0,0,1-.262-.064l-13.08-6.8a.573.573,0,0,1-.307-.5V301a.566.566,0,0,1,.273-.486.573.573,0,0,1,.558-.019l13.076,6.8a.573.573,0,0,1,.307.5v14.161a.57.57,0,0,1-.565.569Zm-12.511-7.708,11.942,6.206V308.136l-11.942-6.206Zm15.917,9.408a.585.585,0,0,1-.288-.076.567.567,0,0,1-.281-.489V309.49a.562.562,0,0,1,.307-.5l13.076-6.8a.573.573,0,0,1,.558.019.562.562,0,0,1,.273.486v13.6a.568.568,0,0,1-.288.493l-13.076,7.359A.557.557,0,0,1,124.055,324.22Zm.569-14.385V322.68l11.942-6.722V303.629Z" transform="translate(0 -194.822)"/></svg>',close:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12z"/></svg>',check:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M9 16.17L4.83 12l-1.42 1.41L9 19L21 7l-1.41-1.41z"/></svg>',warning:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M1 21h22L12 2L1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"/></svg>',error:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10s10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"/></svg>',success:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10s10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5l1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>',plus:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/></svg>',minus:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M19 13H5v-2h14v2z"/></svg>',arrowUp:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6l-6 6z"/></svg>',arrowUpBold:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8l-8 8z"/></svg>',arrowDown:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6l-6-6z"/></svg>',arrowLeft:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M15.41 7.41L14 6l-6 6l6 6l1.41-1.41L10.83 12z"/></svg>',arrowRight:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M10 6L8.59 7.41L13.17 12l-4.58 4.59L10 18l6-6z"/></svg>',search:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5A6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5S14 7.01 14 9.5S11.99 14 9.5 14z"/></svg>',refresh:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M17.65 6.35A7.958 7.958 0 0 0 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08A5.99 5.99 0 0 1 12 18c-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"/></svg>',delete:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"/></svg>',edit:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04a.996.996 0 0 0 0-1.41l-2.34-2.34a.996.996 0 0 0-1.41 0l-1.83 1.83l3.75 3.75l1.83-1.83z"/></svg>',save:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M17 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V7l-4-4zm-5 16c-1.66 0-3-1.34-3-3s1.34-3 3-3s3 1.34 3 3s-1.34 3-3 3zm3-10H5V5h10v4z"/></svg>',expand:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M16.59 8.59L12 13.17L7.41 8.59L6 10l6 6l6-6z"/></svg>',collapse:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M12 8l-6 6l1.41 1.41L12 10.83l4.59 4.58L18 14z"/></svg>',bot:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M12 2a2 2 0 0 1 2 2c0 .74-.4 1.39-1 1.73V7h1a7 7 0 0 1 7 7h1a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1h-1v1a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-1H2a1 1 0 0 1-1-1v-3a1 1 0 0 1 1-1h1a7 7 0 0 1 7-7h1V5.73c-.6-.34-1-.99-1-1.73a2 2 0 0 1 2-2M7.5 13A2.5 2.5 0 0 0 5 15.5A2.5 2.5 0 0 0 7.5 18a2.5 2.5 0 0 0 2.5-2.5A2.5 2.5 0 0 0 7.5 13m9 0a2.5 2.5 0 0 0-2.5 2.5a2.5 2.5 0 0 0 2.5 2.5a2.5 2.5 0 0 0 2.5-2.5a2.5 2.5 0 0 0-2.5-2.5Z"/></svg>',history:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M13 3a9 9 0 0 0-9 9H1l3.89 3.89l.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7s-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42A8.954 8.954 0 0 0 13 21a9 9 0 0 0 0-18zm-1 5v5l4.28 2.54l.72-1.21l-3.5-2.08V8H12z"/></svg>',settings:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M12 15.5A3.5 3.5 0 0 1 8.5 12A3.5 3.5 0 0 1 12 8.5a3.5 3.5 0 0 1 3.5 3.5a3.5 3.5 0 0 1-3.5 3.5m7.43-2.53c.04-.32.07-.64.07-.97c0-.33-.03-.66-.07-1l2.11-1.63c.19-.15.24-.42.12-.64l-2-3.46c-.12-.22-.39-.31-.61-.22l-2.49 1c-.52-.39-1.06-.73-1.69-.98l-.37-2.65A.506.506 0 0 0 14 2h-4c-.25 0-.46.18-.5.42l-.37 2.65c-.63.25-1.17.59-1.69.98l-2.49-1c-.22-.09-.49 0-.61.22l-2 3.46c-.13.22-.07.49.12.64L4.57 11c-.04.34-.07.67-.07 1c0 .33.03.65.07.97l-2.11 1.66c-.19.15-.25.42-.12.64l2 3.46c.12.22.39.3.61.22l2.49-1.01c.52.4 1.06.74 1.69.99l.37 2.65c.04.24.25.42.5.42h4c.25 0 .46-.18.5-.42l.37-2.65c.63-.26 1.17-.59 1.69-.99l2.49 1.01c.22.08.49 0 .61-.22l2-3.46c.12-.22.07-.49-.12-.64l-2.11-1.66Z"/></svg>',loader:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M12 4V2A10 10 0 0 0 2 12h2a8 8 0 0 1 8-8Z"><animateTransform attributeName="transform" dur="0.75s" repeatCount="indefinite" type="rotate" values="0 12 12;360 12 12"/></path></svg>',send:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M2 21l21-9L2 3v7l15 2l-15 2v7z"/></svg>',透视相机:'<svg width="48" height="48" viewBox="0 0 48 48"><path fill="currentColor" d="M24 4L4 14v20l20 10l20-10V14L24 4zm0 4.5l14 7v14l-14 7l-14-7v-14l14-7zM24 18a6 6 0 100 12a6 6 0 000-12z"/></svg>',正交相机:'<svg width="48" height="48" viewBox="0 0 48 48"><path fill="currentColor" d="M6 6h36v36H6V6zm4 4v28h28V10H10zm4 4h20v20H14V14z"/></svg>',doubleArrowDown:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"/><path fill="currentColor" d="M7.41 14.59L12 19.17l4.59-4.58L18 16l-6 6-6-6 1.41-1.41z"/></svg>',pin:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="m3 21l4.63-4.631m.005-.005l-2.78-2.78c-.954-.953.006-2.996 1.31-3.078c1.178-.075 3.905.352 4.812-.555l2.49-2.49c.617-.618.225-2 .185-2.762c-.058-1.016 1.558-2.271 2.415-1.414l4.647 4.648c.86.858-.4 2.469-1.413 2.415c-.762-.04-2.145-.432-2.763.185l-2.49 2.49c-.906.907-.48 3.633-.554 4.811c-.082 1.305-2.125 2.265-3.08 1.31z"/></svg>',folder:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M10 4l2 2h8a2 2 0 0 1 2 2v8.5A3.5 3.5 0 0 1 18.5 20h-13A3.5 3.5 0 0 1 2 16.5v-9A3.5 3.5 0 0 1 5.5 4z" opacity="0.2"/><path fill="currentColor" d="M5.5 4A3.5 3.5 0 0 0 2 7.5v9A3.5 3.5 0 0 0 5.5 20h13a3.5 3.5 0 0 0 3.5-3.5V8A2 2 0 0 0 20 6h-8l-2-2zm0 1.5h3.879l2 2H20a.5.5 0 0 1 .5.5v1H3.5v-1.5a2 2 0 0 1 2-2m-2 5h17v6a2 2 0 0 1-2 2h-13a2 2 0 0 1-2-2z"/></svg>',folderPlus:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M10 4l2 2h8a2 2 0 0 1 2 2v1.5h-1.5V8a.5.5 0 0 0-.5-.5h-8.621l-2-2H5.5a2 2 0 0 0-2 2V9H2V7.5A3.5 3.5 0 0 1 5.5 4z"/><path fill="currentColor" d="M5.5 10A3.5 3.5 0 0 0 2 13.5v3A3.5 3.5 0 0 0 5.5 20H12v-1.5H5.5a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2H12V10z" opacity="0.4"/><path fill="currentColor" d="M17.25 12v3.25H14v1.5h3.25V20h1.5v-3.25H22v-1.5h-3.25V12z"/></svg>',default:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10s10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8s8 3.59 8 8s-3.59 8-8 8zm-1-13h2v6h-2zm0 8h2v2h-2z"/></svg>'};function vn(i){const e=ybe[i];return e||(console.warn(`[IconManager] Icon "${i}" not found, using default icon`),ybe.default)}class wct{container;wrapper;mainButton;items=[];itemElements=[];itemButtonMap=new Map;toggleStateMap=new Map;isActive=!1;unsubscribeTheme=null;unsubscribeLocale=null;mainButtonLabel;onMainButtonClick;MAIN_BUTTON_SIZE=60;SUB_BUTTON_SIZE=46;BASE_RADIUS=80;RING_GAP=60;FAN_START_DEG=170;FAN_END_DEG=280;CANVAS_PADDING=28;FIXED_RING_CAPACITIES=[4,6,8];constructor(e){this.container=e.container,this.items=e.items===void 0?this.createDefaultItems():[...e.items],this.mainButtonLabel=e.mainButtonLabel??"toolbar.home",this.onMainButtonClick=e.onMainButtonClick,this.wrapper=this.createWrapper(),this.mainButton=this.createMainButton(e.mainButtonIcon),this.wrapper.appendChild(this.mainButton),this.container.appendChild(this.wrapper),this.renderItems(),this.updateLayoutMetrics(),this.bindEvents(),this.setTheme(qi.getTheme()),this.updateLocales(),this.unsubscribeTheme=qi.subscribe(t=>{this.setTheme(t)}),this.unsubscribeLocale=dr.subscribe(()=>{this.updateLocales()})}createDefaultItems(){return[{id:"zoom",label:"toolbar.zoomBox",icon:vn("框选放大")},{id:"measure",label:"toolbar.measure",icon:vn("测量")},{id:"section",label:"toolbar.section",icon:vn("剖切")},{id:"walk",label:"toolbar.walk",icon:vn("漫游")},{id:"setting",label:"toolbar.setting",icon:vn("设置")}]}createWrapper(){const e=document.createElement("div");return e.className="radial-toolbar-wrapper",e}createMainButton(e){const t=document.createElement("button");return t.className="radial-main-btn",t.type="button",t.innerHTML=e??vn("主视角"),t}bindEvents(){this.mainButton.addEventListener("click",this.handleMainButtonClick),this.mainButton.addEventListener("dblclick",this.handleMainButtonDoubleClick)}handleMainButtonClick=e=>{e.stopPropagation(),this.isActive?this.collapse():this.expand()};handleMainButtonDoubleClick=e=>{e.stopPropagation(),this.onMainButtonClick&&this.onMainButtonClick()};renderItems(){this.itemElements.forEach(e=>e.remove()),this.itemElements=[],this.itemButtonMap.clear(),this.toggleStateMap.clear(),this.items.forEach((e,t)=>{this.toggleStateMap.set(e.id,!!e.isActive);const n=this.createSubButton(e,t);this.wrapper.insertBefore(n,this.mainButton),this.itemElements.push(n),this.itemButtonMap.set(e.id,n)}),this.updateItemPositions()}createSubButton(e,t){const n=document.createElement("button");n.className="radial-sub-btn",n.type="button",n.dataset.index=String(t),this.applyItemActiveClass(n,e);const r=document.createElement("span");return r.className="radial-sub-btn-icon",e.icon?r.innerHTML=e.icon:r.textContent=this.getFallbackLabel(e.label),n.appendChild(r),n.addEventListener("click",s=>{if(s.stopPropagation(),e.isToggle){const a=!(this.toggleStateMap.get(e.id)??!1);this.toggleStateMap.set(e.id,a),e.isActive=a,this.applyItemActiveClass(n,e),e.onToggle?.(a,e);return}e.onClick?.(e)}),n}getRingCapacities(e){const t=[];let n=e;for(const r of this.FIXED_RING_CAPACITIES){if(n<=0)break;const s=Math.min(r,n);t.push(s),n-=s}return n>0&&t.push(n),t}updateItemPositions(){const e=this.itemElements.length;if(e===0)return;const t=this.FAN_END_DEG-this.FAN_START_DEG,n=this.getRingCapacities(e);let r=0;n.forEach((s,o)=>{const a=this.BASE_RADIUS+o*this.RING_GAP;for(let l=0;l<s;l++){const c=this.itemElements[r],h=s<=1?0:l/(s-1),d=(this.FAN_START_DEG+t*h)*Math.PI/180,p=Math.cos(d)*a,f=Math.sin(d)*a,g=(l+o*.5)*.045,_=(s-1-l+o*.4)*.032;c.style.setProperty("--rt-x",`${p.toFixed(2)}px`),c.style.setProperty("--rt-y",`${f.toFixed(2)}px`),c.style.setProperty("--rt-open-delay",`${g.toFixed(3)}s`),c.style.setProperty("--rt-close-delay",`${_.toFixed(3)}s`),r++}})}updateLayoutMetrics(){const e=this.items.length,n=this.getRingCapacities(e).length,r=this.BASE_RADIUS+(n-1)*this.RING_GAP,s=Math.ceil(r+this.MAIN_BUTTON_SIZE+this.SUB_BUTTON_SIZE+this.CANVAS_PADDING*2);this.wrapper.style.width=`${s}px`,this.wrapper.style.height=`${s}px`,this.wrapper.style.setProperty("--rt-main-size",`${this.MAIN_BUTTON_SIZE}px`),this.wrapper.style.setProperty("--rt-sub-size",`${this.SUB_BUTTON_SIZE}px`),this.wrapper.style.setProperty("--rt-main-offset",`${(this.MAIN_BUTTON_SIZE-this.SUB_BUTTON_SIZE)/2}px`)}expand(){this.isActive||this.items.length===0||(this.isActive=!0,this.wrapper.classList.add("is-active"))}collapse(){this.isActive&&(this.isActive=!1,this.wrapper.classList.remove("is-active"))}updateLocales(){const e=At(this.mainButtonLabel);this.mainButton.title=e,this.mainButton.setAttribute("aria-label",e),this.itemElements.forEach((t,n)=>{const r=this.items[n];if(!r)return;const s=r.title??At(r.label);if(t.title=s,t.setAttribute("aria-label",s),this.applyItemActiveClass(t,r),!r.icon){const o=t.querySelector(".radial-sub-btn-icon");o&&(o.textContent=this.getFallbackLabel(r.title??r.label))}})}applyItemActiveClass(e,t){if(!t.isToggle){e.classList.remove("is-active"),e.dataset.active="false";return}const n=this.toggleStateMap.get(t.id)??!!t.isActive;e.classList.toggle("is-active",n),e.dataset.active=n?"true":"false"}getFallbackLabel(e){const t=At(e).trim();return t?t.charAt(0).toUpperCase():"?"}setTheme(e){this.wrapper.classList.remove("theme-light","theme-dark"),this.wrapper.classList.add(`theme-${e.name}`);const t=this.wrapper.style;t.setProperty("--bim-primary",e.primary),t.setProperty("--bim-primary-hover",e.primaryHover),t.setProperty("--bim-primary-active",e.primaryActive),t.setProperty("--bim-text-inverse",e.textInverse),t.setProperty("--bim-icon-inverse",e.iconInverse),t.setProperty("--bim-shadow-glow",e.shadowGlow),t.setProperty("--rt-main-bg",e.bgBase),t.setProperty("--rt-main-bg-hover",e.bgBase),t.setProperty("--rt-main-border",e.floatingBtnBorder),t.setProperty("--rt-main-shadow",e.floatingBtnShadow),t.setProperty("--rt-main-shadow-hover",e.floatingBtnShadowHover),t.setProperty("--rt-main-icon",e.floatingIconColor),t.setProperty("--rt-main-icon-hover",e.floatingIconColorHover),t.setProperty("--rt-sub-bg",e.bgBase),t.setProperty("--rt-sub-bg-hover",e.primaryHover),t.setProperty("--rt-sub-border",e.floatingBtnBorder),t.setProperty("--rt-sub-shadow",e.floatingBtnShadow),t.setProperty("--rt-sub-shadow-hover",e.floatingBtnShadowHover),t.setProperty("--rt-sub-icon",e.floatingIconColor),t.setProperty("--rt-sub-icon-hover",e.iconHover)}setItemActive(e,t){const n=this.items.find(s=>s.id===e);if(!n||!n.isToggle)return;n.isActive=t,this.toggleStateMap.set(e,t);const r=this.itemButtonMap.get(e);r&&this.applyItemActiveClass(r,n)}addItem(e){this.items.push(e),this.renderItems(),this.updateLayoutMetrics()}init(){}setLocales(){this.updateLocales()}destroy(){this.unsubscribeTheme&&(this.unsubscribeTheme(),this.unsubscribeTheme=null),this.unsubscribeLocale&&(this.unsubscribeLocale(),this.unsubscribeLocale=null),this.mainButton.removeEventListener("click",this.handleMainButtonClick),this.mainButton.removeEventListener("dblclick",this.handleMainButtonDoubleClick),this.wrapper.parentNode&&this.wrapper.parentNode.removeChild(this.wrapper)}}const Ect=i=>({id:"measure",label:"toolbar.measure",icon:vn("测量"),isToggle:!0,isActive:i.bottomDock?.isOpen("measure")??!1,onToggle:e=>{const t=i.bottomDock;if(!t){console.warn("[RadialToolbar] bottom dock not initialized: measure");return}e?t.open("measure"):t.close("measure"),console.log(`[RadialToolbar] 测量${e?"已打开":"已关闭"}`)}}),Sct=i=>({id:"section",label:"toolbar.section",icon:vn("剖切"),isToggle:!0,isActive:i.bottomDock?.isOpen("section")??!1,onToggle:e=>{const t=i.bottomDock;if(!t){console.warn("[RadialToolbar] bottom dock not initialized: section");return}e?t.open("section"):t.close("section"),console.log(`[RadialToolbar] 剖切${e?"已打开":"已关闭"}`)}}),Tct=i=>({id:"setting",label:"toolbar.setting",icon:vn("设置"),onClick:()=>{i.setting?.toggle(),console.log(`[RadialToolbar] 设置${i.setting?.isOpen()?"已打开":"已关闭"}`)}}),Cct=i=>({id:"walk",label:"toolbar.walk",icon:vn("漫游"),isToggle:!0,isActive:i.bottomDock?.isOpen("walk")??!1,onToggle:e=>{const t=i.bottomDock;if(!t){console.warn("[RadialToolbar] bottom dock not initialized: walk");return}e?t.open("walk"):t.close("walk"),console.log(`[RadialToolbar] 漫游${e?"已打开":"已关闭"}`)}});class vbe extends Mc{toolbar=null;unsubscribeDockState=null;constructor(e,t,n){super(t),this.toolbar=new wct({container:e,items:n?.items??this.createDefaultItems(),mainButtonIcon:vn("主视角"),mainButtonLabel:"toolbar.home",onMainButtonClick:()=>{console.log("[RadialToolbar] main: home"),this.registry.engine3d?.getEngineComponent()?.CameraGoHome()}}),this.toolbar.setTheme(qi.getTheme()),this.unsubscribeDockState=this.registry.bottomDock?.onStateChange(({id:r,open:s})=>{this.toolbar?.setItemActive(r,s)})??null,this.syncInitialToggleStates()}createDefaultItems(){return[Tct(this.registry),Ect(this.registry),Sct(this.registry),Cct(this.registry),this.createModelLink3dRadialButton()]}createModelLink3dRadialButton(){return{id:"modelLink3d",label:"toolbar.modelLink3d",icon:vn("联动模型"),isToggle:!0,isActive:!1,onToggle:e=>{const t=this.registry.engine3d;if(!t?.isInitialized()){console.warn("[RadialToolbar] 3D engine not initialized: modelLink3d"),this.toolbar?.setItemActive("modelLink3d",!1);return}e?t.activeModelLink3d():t.disActiveModelLink3d(),console.log(`[RadialToolbar] 模型联动${e?"已开启":"已关闭"}`)}}}syncInitialToggleStates(){const e=this.registry.bottomDock;!e||!this.toolbar||(this.toolbar.setItemActive("measure",e.isOpen("measure")),this.toolbar.setItemActive("section",e.isOpen("section")),this.toolbar.setItemActive("walk",e.isOpen("walk")))}addItem(e){this.toolbar?.addItem(e)}setItemActive(e,t){this.toolbar?.setItemActive(e,t)}show(){this.toolbar?.expand()}hide(){this.toolbar?.collapse()}destroy(){this.unsubscribeDockState&&(this.unsubscribeDockState(),this.unsubscribeDockState=null),this.toolbar?.destroy(),this.toolbar=null,super.destroy()}}class Mct{container;root;panelGap=10;panelMap=new Map;panelOrder=[];resizeObserver;handleWindowResize=()=>{this.reflow()};constructor(e){this.container=e,this.root=document.createElement("div"),this.root.className="bottom-dock-stack",this.container.appendChild(this.root),this.resizeObserver=typeof ResizeObserver<"u"?new ResizeObserver(()=>{this.reflow()}):null,this.resizeObserver||window.addEventListener("resize",this.handleWindowResize)}setTheme(e){const t=this.root.style;t.setProperty("--bd-bg",e.floatingBtnBg),t.setProperty("--bd-border",e.floatingBtnBorder),t.setProperty("--bd-shadow",e.floatingBtnShadow),t.setProperty("--bd-close-color",e.floatingIconColor),t.setProperty("--bd-close-color-hover",e.floatingIconColorHover),t.setProperty("--bd-close-bg-hover",e.floatingBtnBgHover),t.setProperty("--bd-close-border-hover",e.floatingBtnBorder),t.setProperty("--bd-body-bg",e.floatingBtnBg),t.setProperty("--bd-placeholder-border",e.borderSubtle),t.setProperty("--bd-placeholder-text",e.textSecondary)}hasPanel(e){return this.panelMap.has(e)}addPanel(e){const t=this.panelMap.get(e.id);if(t&&t.leaving){t.leaving=!1,t.element.classList.remove("is-leaving"),t.removeTimer&&(clearTimeout(t.removeTimer),t.removeTimer=null),t.bodyElement.replaceChildren(e.content),this.panelOrder.includes(e.id)||this.panelOrder.push(e.id),this.reflow();return}if(t)return;const n=document.createElement("section");n.className="bottom-dock-panel is-entering",n.dataset.panelId=e.id;let r=null;e.closable!==!1&&(r=document.createElement("button"),r.className="bottom-dock-panel-close",r.type="button",r.setAttribute("aria-label","close-panel"),r.textContent="×",r.addEventListener("click",o=>{o.stopPropagation(),e.onClose(e.id)}),n.appendChild(r));const s=document.createElement("div");s.className="bottom-dock-panel-body",s.appendChild(e.content),n.appendChild(s),this.root.appendChild(n),this.panelOrder.push(e.id),this.panelMap.set(e.id,{id:e.id,element:n,bodyElement:s,closeButton:r,leaving:!1,removeTimer:null}),this.resizeObserver?.observe(n),this.reflow(),requestAnimationFrame(()=>{n.classList.remove("is-entering")})}removePanel(e){const t=this.panelMap.get(e);if(!t||t.leaving)return;t.leaving=!0,t.element.classList.add("is-leaving");const n=this.panelOrder.indexOf(e);n>=0&&this.panelOrder.splice(n,1),this.reflow(),t.removeTimer=window.setTimeout(()=>{this.resizeObserver?.unobserve(t.element),t.element.remove(),this.panelMap.delete(e),t.removeTimer=null},220)}createPlaceholderContent(e){const t=document.createElement("div");return t.className="bottom-dock-placeholder",t.textContent=e,t}destroy(){this.resizeObserver?.disconnect(),window.removeEventListener("resize",this.handleWindowResize),this.panelMap.clear(),this.panelOrder.length=0,this.root.remove()}reflow(){let e=0,t=0;this.panelOrder.forEach(s=>{const o=this.panelMap.get(s);o&&(o.element.style.transform=`translateX(-50%) translateY(-${e}px)`,e+=o.element.offsetHeight+this.panelGap,t=Math.max(t,o.element.offsetWidth))});const n=this.panelOrder.length,r=n>0?e-this.panelGap:0;this.root.style.height=`${r}px`,this.root.style.width=n>0?`${t}px`:"0px"}}class jZ extends Mc{stack;definitions=new Map;openStates=new Map;listeners=new Set;unsubscribeTheme=null;constructor(e,t,n={}){super(t),this.stack=new Mct(e),this.stack.setTheme(qi.getTheme()),this.unsubscribeTheme=qi.subscribe(r=>{this.stack.setTheme(r)}),n.registerDefaults!==!1&&this.registerDefaultPanels()}register(e){this.definitions.set(e.id,e),this.openStates.has(e.id)||this.openStates.set(e.id,!1)}unregister(e){this.isOpen(e)&&this.close(e),this.definitions.delete(e),this.openStates.delete(e)}toggle(e){if(this.isOpen(e)){this.close(e);return}this.open(e)}open(e){const t=this.definitions.get(e);if(!t){console.warn(`[BottomDock] Unknown panel id: ${e}`);return}if(this.isOpen(e))return;const n=t.createContent?t.createContent():this.stack.createPlaceholderContent(`${t.title} 面板内容占位`);this.stack.addPanel({id:e,content:n,closable:t.closable!==!1,onClose:()=>{this.close(e)}}),this.openStates.set(e,!0),this.emitState({id:e,open:!0})}close(e){this.isOpen(e)&&(this.stack.removePanel(e),this.openStates.set(e,!1),this.emitState({id:e,open:!1}))}isOpen(e){return this.openStates.get(e)??!1}createPlaceholderContent(e){return this.stack.createPlaceholderContent(e)}onStateChange(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}destroy(){this.unsubscribeTheme&&(this.unsubscribeTheme(),this.unsubscribeTheme=null),this.listeners.clear(),this.definitions.clear(),this.openStates.clear(),this.stack.destroy(),super.destroy()}emitState(e){this.listeners.forEach(t=>{t(e)})}registerDefaultPanels(){this.register({id:"measure",title:"测量",createContent:()=>{const e=this.registry.measureDock?.getPanelElement();return e||this.stack.createPlaceholderContent("测量面板占位")}}),this.register({id:"section",title:"剖切",createContent:()=>{const e=this.registry.sectionDock?.getPanelElement();return e||this.stack.createPlaceholderContent("剖切面板占位")}}),this.register({id:"walk",title:"漫游",createContent:()=>{const e=this.registry.walkDock?.getPanelElement();return e||this.stack.createPlaceholderContent("漫游面板占位")}}),this.register({id:"modelCalibration",title:"模型校准",createContent:()=>{const e=this.registry.modelCalibrationDock?.getPanelElement();return e||this.stack.createPlaceholderContent("模型校准面板占位")}})}}const QA={clearHeight:'<svg aria-hidden="true" viewBox="0 0 48 48"><path d="M19.0032 32.1184C18.712 32.1184 18.4032 32.1184 18.112 32.4096C17.512 32.6992 17.8224 33.5904 18.112 33.8816L23.1472 38.6256C23.7472 38.9152 24.6192 38.9152 24.928 38.6256L29.9632 33.8816C30.2528 33.5904 30.2528 33.2816 30.2528 32.9904C30.2528 32.3904 29.6528 32.1008 29.072 32.1008L25.7856 32.1008L25.7856 16.2192L29.0256 16.2192C29.3152 16.2192 29.6256 16.2192 29.9152 15.928C30.5152 15.6368 30.2064 14.7472 29.9152 14.456L24.8816 9.7072C24.2816 9.4176 23.4096 9.4176 23.0992 9.7072L18.0656 14.4512C17.7744 14.7424 17.7744 15.0512 17.7744 15.3424C17.7744 15.9424 18.3744 16.232 18.9568 16.232L22.24 16.232L22.24 32.1328L19.0016 32.1328L19.0016 32.1184L19.0032 32.1184ZM4.75842 6.80639L43.2384 6.80639C44.128 6.80639 44.7104 6.20639 44.7104 5.33442C44.7104 4.1536 44.1088 3.2624 43.2384 3.2624L4.75678 3.2624C4.1568 3.2624 3.5744 3.8624 3.2848 4.73442C3.2848 5.62561 3.8848 6.5152 4.75678 6.80639L4.75842 6.80639ZM43.256 41.1936L4.75842 41.1936C4.1584 41.1936 3.576 41.7936 3.2864 42.6656C3.2864 43.5568 3.8864 44.4464 4.75842 44.7376L43.2384 44.7376C44.128 44.7376 44.7104 44.1376 44.7104 43.2656C44.728 42.08 44.1328 41.1936 43.256 41.1936Z" fill="currentColor"/></svg>',clearDistance:'<svg aria-hidden="true" viewBox="0 0 48 48"><path d="M15.2619 20.2135C15.2619 20.8776 14.5628 21.2125 14.0415 21.0436L4.13531 16.0541C4.10363 16.0394 4.07281 16.023 4.04285 16.005C4.0129 15.987 3.98397 15.9675 3.95607 15.9464C3.92817 15.9254 3.90144 15.9029 3.87591 15.879C3.85037 15.8552 3.82615 15.83 3.80326 15.8036L3.80909 35.8838C3.80909 36.8159 3.18577 37.4393 2.2537 37.4393C1.32163 37.4393 0.701223 36.8159 0.701223 35.8838L0.701223 9.16557C0.698312 8.2335 1.31872 7.61016 2.25079 7.61016C3.18286 7.61016 3.80618 8.2335 3.80618 9.16557L3.80035 14.8075C3.82324 14.7811 3.84746 14.7559 3.873 14.7321C3.89853 14.7082 3.92525 14.6858 3.95315 14.6647C3.98106 14.6437 4.00999 14.6242 4.03994 14.6062C4.0699 14.5881 4.10072 14.5718 4.1324 14.557L14.0444 9.56752C14.5687 9.23546 15.2619 9.56752 15.2619 10.2316L15.2619 13.9074L32.9566 13.9074C33.3644 13.9074 33.6557 13.6628 33.7314 13.2725L33.7488 13.0686L33.7488 10.2142C33.7488 9.71316 34.3838 9.20925 34.8557 9.54422L43.8938 14.5803C44.0132 14.6415 44.1181 14.7259 44.2026 14.8337L44.1968 8.07624C44.1968 7.14413 44.8201 6.52374 45.7521 6.52374C46.6842 6.52374 47.3044 7.14413 47.3044 8.07624L47.3044 36.0383C47.3044 36.0637 47.3038 36.0891 47.3025 36.1145C47.3016 36.1399 47.2998 36.1652 47.2974 36.1905C47.2948 36.2158 47.2917 36.241 47.288 36.2662C47.2842 36.2914 47.2798 36.3164 47.2749 36.3413C47.2698 36.3663 47.2642 36.3911 47.258 36.4157C47.252 36.4404 47.2453 36.4649 47.2378 36.4892C47.2303 36.5136 47.2224 36.5377 47.2139 36.5617C47.2055 36.5856 47.1964 36.6093 47.1867 36.6328C47.1767 36.6563 47.1664 36.6795 47.1558 36.7025C47.1448 36.7255 47.1334 36.7482 47.1216 36.7707C47.1094 36.7931 47.0969 36.8152 47.0841 36.837C47.0709 36.8588 47.0574 36.8803 47.0433 36.9015C47.0289 36.9226 47.0142 36.9434 46.9992 36.9638C46.9842 36.9843 46.9686 37.0043 46.9524 37.024C46.9361 37.0436 46.9195 37.0629 46.9027 37.0818C46.8855 37.1006 46.8679 37.119 46.8501 37.137C46.8321 37.155 46.8137 37.1726 46.7949 37.1897C46.7761 37.2068 46.7569 37.2234 46.7372 37.2395C46.7176 37.2557 46.6975 37.2713 46.6772 37.2865C46.6568 37.3017 46.636 37.3163 46.6149 37.3305C46.5937 37.3447 46.5723 37.3583 46.5505 37.3714C46.5287 37.3845 46.5066 37.397 46.4842 37.409C46.4618 37.4211 46.4391 37.4325 46.4161 37.4434C46.3932 37.4543 46.3699 37.4646 46.3464 37.4744C46.323 37.4842 46.2993 37.4933 46.2754 37.5019C46.2514 37.5105 46.2273 37.5186 46.203 37.526C46.1786 37.5334 46.1542 37.5402 46.1296 37.5464C46.1049 37.5526 46.0801 37.5582 46.0552 37.5632C46.0302 37.5683 46.0052 37.5726 45.9801 37.5764C45.9549 37.5802 45.9297 37.5833 45.9044 37.5859C45.8791 37.5884 45.8537 37.5903 45.8284 37.5916C45.803 37.5929 45.7775 37.5936 45.7521 37.5936C44.8201 37.5936 44.1968 36.9732 44.1968 36.0412L44.1997 15.8357C44.1783 15.8546 44.1554 15.8715 44.1309 15.8861C44.1064 15.9008 44.0807 15.9131 44.054 15.9231L35.0188 20.9562C34.544 21.2912 33.9091 20.9562 33.9091 20.2863L33.9091 17.4318C33.9091 16.9279 33.5887 16.593 33.1168 16.593L15.2619 16.59L15.2619 20.2135L15.2619 20.2135ZM41.0889 24.2796L41.0889 36.0412C41.0889 36.8975 40.3899 37.5936 39.5335 37.5936C38.6014 37.5936 37.981 36.9732 37.981 36.0412L37.981 24.2796C37.981 23.3475 38.6014 22.7243 39.5335 22.7243C40.4656 22.7243 41.0889 23.3475 41.0889 24.2796ZM28.6604 24.2796L28.6604 36.0412C28.6603 36.0665 28.6596 36.0919 28.6584 36.1173C28.657 36.1426 28.6551 36.168 28.6526 36.1932C28.6501 36.2185 28.6469 36.2437 28.6432 36.2688C28.6394 36.2939 28.6351 36.3189 28.63 36.3438C28.625 36.3687 28.6194 36.3935 28.6133 36.4181C28.607 36.4427 28.6002 36.4672 28.5929 36.4915C28.5855 36.5158 28.5774 36.5399 28.5689 36.5638C28.5603 36.5877 28.5512 36.6113 28.5414 36.6348C28.5317 36.6583 28.5213 36.6815 28.5105 36.7044C28.4996 36.7274 28.4881 36.75 28.4762 36.7724C28.4642 36.7948 28.4517 36.8168 28.4386 36.8386C28.4255 36.8604 28.4119 36.8819 28.3978 36.903C28.3837 36.9241 28.369 36.9448 28.3539 36.9652C28.3388 36.9856 28.3232 37.0056 28.3071 37.0253C28.2909 37.0449 28.2744 37.0641 28.2573 37.0829C28.2402 37.1017 28.2227 37.1201 28.2048 37.1381C28.1868 37.156 28.1684 37.1735 28.1496 37.1906C28.1308 37.2076 28.1116 37.2242 28.092 37.2404C28.0723 37.2564 28.0523 37.2721 28.032 37.2872C28.0115 37.3024 27.9908 37.317 27.9697 37.3311C27.9486 37.3452 27.9272 37.3588 27.9054 37.3719C27.8836 37.385 27.8615 37.3975 27.8391 37.4094C27.8167 37.4214 27.7941 37.4329 27.7712 37.4438C27.7482 37.4546 27.725 37.4649 27.7015 37.4747C27.6781 37.4844 27.6544 37.4936 27.6305 37.5022C27.6066 37.5107 27.5825 37.5187 27.5582 37.5261C27.5339 37.5335 27.5094 37.5403 27.4848 37.5465C27.4602 37.5527 27.4354 37.5583 27.4105 37.5633C27.3857 37.5683 27.3606 37.5727 27.3355 37.5765C27.3104 37.5802 27.2852 37.5833 27.2599 37.5859C27.2347 37.5884 27.2094 37.5903 27.184 37.5916C27.1586 37.5929 27.1333 37.5936 27.1079 37.5936C26.1758 37.5936 25.5525 36.9732 25.5525 36.0412L25.5525 24.2796C25.5525 23.3475 26.1758 22.7243 27.1079 22.7243C28.0399 22.7243 28.6604 23.3475 28.6604 24.2796ZM10.019 24.2796L10.019 36.0412C10.0189 36.0666 10.0183 36.092 10.017 36.1174C10.0156 36.1428 10.0138 36.1681 10.0112 36.1934C10.0087 36.2187 10.0055 36.2439 10.0018 36.2691C9.99798 36.2942 9.99357 36.3193 9.9886 36.3442C9.98359 36.3691 9.97796 36.3939 9.97178 36.4185C9.96554 36.4432 9.95874 36.4677 9.95134 36.492C9.94393 36.5163 9.93592 36.5404 9.92729 36.5644C9.91867 36.5883 9.90952 36.612 9.89978 36.6355C9.88998 36.659 9.87967 36.6822 9.86879 36.7051C9.85787 36.7281 9.84638 36.7508 9.83438 36.7732C9.82238 36.7956 9.80982 36.8177 9.79674 36.8395C9.78362 36.8613 9.77003 36.8828 9.75587 36.9039C9.74171 36.925 9.72704 36.9458 9.7119 36.9662C9.69671 36.9866 9.68101 37.0066 9.66488 37.0262C9.64876 37.0459 9.63212 37.0651 9.61506 37.0839C9.59795 37.1027 9.58042 37.1212 9.56242 37.1391C9.54442 37.1571 9.52599 37.1745 9.50715 37.1916C9.48826 37.2087 9.46899 37.2253 9.44935 37.2414C9.42967 37.2575 9.40965 37.2731 9.38921 37.2883C9.36878 37.3034 9.34796 37.318 9.32682 37.3321C9.30563 37.3462 9.28417 37.3598 9.26237 37.3729C9.24053 37.3859 9.2184 37.3984 9.19599 37.4104C9.17359 37.4224 9.15085 37.4338 9.12788 37.4446C9.10487 37.4555 9.08162 37.4658 9.05818 37.4755C9.03465 37.4852 9.01093 37.4944 8.98703 37.5029C8.96303 37.5115 8.93888 37.5195 8.9146 37.5268C8.89023 37.5342 8.86576 37.541 8.8411 37.5471C8.81645 37.5533 8.79165 37.5589 8.76671 37.5638C8.74178 37.5688 8.7167 37.5731 8.69157 37.5768C8.6664 37.5805 8.64118 37.5837 8.61587 37.5862C8.59056 37.5886 8.56524 37.5905 8.53984 37.5917C8.51443 37.593 8.48903 37.5936 8.46362 37.5936C7.53156 37.5936 6.90821 36.9732 6.90821 36.0412L6.90821 24.2796C6.90821 23.3475 7.53156 22.7243 8.46362 22.7243C9.39568 22.7243 10.0161 23.3475 10.0161 24.2796L10.019 24.2796ZM33.3207 29.7147C34.2527 29.7147 34.8732 30.3381 34.8732 31.2701L34.8732 36.0412C34.8731 36.0665 34.8724 36.0919 34.8712 36.1173C34.8699 36.1426 34.8679 36.168 34.8654 36.1932C34.8629 36.2185 34.8597 36.2437 34.856 36.2688C34.8522 36.2939 34.8478 36.3189 34.8429 36.3438C34.8378 36.3687 34.8323 36.3935 34.8261 36.4181C34.8198 36.4427 34.813 36.4672 34.8057 36.4915C34.7983 36.5158 34.7903 36.5399 34.7817 36.5638C34.7731 36.5877 34.7639 36.6113 34.7542 36.6348C34.7445 36.6583 34.7341 36.6815 34.7233 36.7044C34.7124 36.7274 34.701 36.75 34.689 36.7724C34.677 36.7948 34.6644 36.8168 34.6514 36.8386C34.6383 36.8604 34.6247 36.8819 34.6106 36.903C34.5965 36.9241 34.5819 36.9448 34.5668 36.9652C34.5516 36.9856 34.536 37.0056 34.5199 37.0253C34.5038 37.0449 34.4872 37.0641 34.4701 37.0829C34.453 37.1017 34.4356 37.1201 34.4176 37.1381C34.3996 37.156 34.3812 37.1735 34.3624 37.1906C34.3436 37.2076 34.3244 37.2242 34.3048 37.2404C34.2851 37.2564 34.2652 37.2721 34.2448 37.2872C34.2244 37.3024 34.2036 37.317 34.1825 37.3311C34.1614 37.3452 34.1399 37.3588 34.1182 37.3719C34.0964 37.385 34.0743 37.3975 34.0519 37.4094C34.0296 37.4214 34.0069 37.4329 33.9839 37.4438C33.961 37.4546 33.9378 37.4649 33.9144 37.4747C33.8909 37.4844 33.8672 37.4936 33.8433 37.5022C33.8194 37.5107 33.7953 37.5187 33.771 37.5261C33.7467 37.5335 33.7223 37.5403 33.6977 37.5465C33.673 37.5527 33.6482 37.5583 33.6234 37.5633C33.5984 37.5683 33.5734 37.5727 33.5484 37.5765C33.5232 37.5802 33.498 37.5833 33.4727 37.5859C33.4475 37.5884 33.4222 37.5903 33.3968 37.5916C33.3714 37.5929 33.3461 37.5936 33.3207 37.5936C32.3886 37.5936 31.7682 36.9732 31.7682 36.0412L31.7682 31.2701C31.7682 30.3381 32.3886 29.7147 33.3207 29.7147ZM22.4446 31.2701L22.4446 36.0412C22.4446 36.8975 21.7485 37.5936 20.8892 37.5936C19.9572 37.5936 19.3367 36.9732 19.3367 36.0412L19.3367 31.2701C19.3367 30.3381 19.9572 29.7147 20.8892 29.7147C21.8213 29.7147 22.4446 30.3381 22.4446 31.2701ZM16.2289 31.2701L16.2289 36.0412C16.2288 36.0665 16.2282 36.0919 16.2269 36.1173C16.2256 36.1426 16.2237 36.168 16.2211 36.1932C16.2186 36.2185 16.2155 36.2437 16.2117 36.2688C16.2079 36.2939 16.2036 36.3189 16.1986 36.3438C16.1936 36.3687 16.188 36.3935 16.1818 36.4181C16.1756 36.4427 16.1688 36.4672 16.1614 36.4915C16.154 36.5158 16.146 36.5399 16.1374 36.5638C16.1288 36.5877 16.1197 36.6113 16.11 36.6348C16.1002 36.6583 16.0899 36.6815 16.079 36.7044C16.0681 36.7274 16.0567 36.75 16.0447 36.7724C16.0328 36.7948 16.0202 36.8168 16.0072 36.8386C15.994 36.8604 15.9804 36.8819 15.9664 36.903C15.9522 36.9241 15.9376 36.9448 15.9225 36.9652C15.9073 36.9856 15.8917 37.0056 15.8756 37.0253C15.8595 37.0449 15.8429 37.0641 15.8259 37.0829C15.8088 37.1017 15.7913 37.1201 15.7734 37.1381C15.7554 37.156 15.737 37.1735 15.7182 37.1906C15.6994 37.2076 15.6801 37.2242 15.6605 37.2404C15.6409 37.2564 15.6209 37.2721 15.6005 37.2872C15.5801 37.3024 15.5594 37.317 15.5382 37.3311C15.5171 37.3452 15.4957 37.3588 15.4739 37.3719C15.4521 37.385 15.43 37.3975 15.4077 37.4094C15.3853 37.4214 15.3626 37.4329 15.3397 37.4438C15.3167 37.4546 15.2935 37.4649 15.2701 37.4747C15.2466 37.4844 15.2229 37.4936 15.199 37.5022C15.1751 37.5107 15.151 37.5187 15.1268 37.5261C15.1025 37.5335 15.078 37.5403 15.0534 37.5465C15.0287 37.5527 15.0039 37.5583 14.9791 37.5633C14.9542 37.5683 14.9292 37.5727 14.9041 37.5765C14.8789 37.5802 14.8538 37.5833 14.8285 37.5859C14.8032 37.5884 14.7779 37.5903 14.7526 37.5916C14.7271 37.5929 14.7018 37.5936 14.6764 37.5936C13.7444 37.5936 13.1239 36.9732 13.1239 36.0412L13.1239 31.2701C13.1239 30.3381 13.7444 29.7147 14.6764 29.7147C15.6085 29.7147 16.2289 30.3381 16.2289 31.2701Z" fill="currentColor"/></svg>',distance:'<svg viewBox="0 0 32 32" aria-hidden="true"><g transform="translate(0 4.197)"><path fill="currentColor" d="M29.692,3.03,27.55.919a.529.529,0,0,1-.014-.756A.549.549,0,0,1,28.3.15l.014.013,3.067,3.023a.529.529,0,0,1,0,.756L28.317,6.966a.549.549,0,0,1-.767.013.529.529,0,0,1-.014-.756l.014-.013L29.692,4.1H2.31L4.452,6.21a.528.528,0,0,1,.013.756.547.547,0,0,1-.766.013l-.014-.013L.616,3.942a.531.531,0,0,1,0-.756L3.685.163a.548.548,0,0,1,.767.014.528.528,0,0,1,0,.742L2.31,3.03ZM24.136,15.055H23.051V18H21.966v-2.94H20.882V18H19.8v-2.94H18.712V18H17.627v-2.94H16.543v5.078H15.458V15.055H14.373V18H13.288v-2.94H12.2V18H11.119v-2.94H10.034V18H8.949v-2.94H7.865V18H6.78v-2.94H5.7v5.078H4.61V15.055H1.9a.27.27,0,0,0-.272.268v6.413A.269.269,0,0,0,1.9,22H30.1a.268.268,0,0,0,.271-.267V15.323a.269.269,0,0,0-.271-.268H27.39v5.078H26.305V15.055H25.221V18H24.136Zm5.966-1.6A1.884,1.884,0,0,1,32,15.323v6.413a1.885,1.885,0,0,1-1.9,1.871H1.9A1.885,1.885,0,0,1,0,21.736V15.323a1.885,1.885,0,0,1,1.9-1.871Z"/></g></svg>',elevation:'<svg viewBox="0 0 32 32" aria-hidden="true"><path fill="currentColor" d="M84.131,193.119a1.056,1.056,0,0,1,1.116.982v7.857a1.056,1.056,0,0,1-1.116.982H54.367a1.056,1.056,0,0,1-1.116-.982V194.1a1.056,1.056,0,0,1,1.116-.982Zm-1.116,1.964H55.483v5.893H83.015Zm1.116-13.749a1.064,1.064,0,0,1,1.114.935,1.032,1.032,0,0,1-1.007,1.025l-.107,0H71.2l-7.858,6.914a1.227,1.227,0,0,1-1.578,0l-8.185-7.2-.018-.016-.032-.031.049.047a1.107,1.107,0,0,1-.092-.092l-.011-.014a.869.869,0,0,1-.182-.857l0-.008L53.31,182l.012-.029.02-.045.019-.035a1.1,1.1,0,0,1,.891-.552h.007q.053,0,.107,0ZM68.043,183.3H57.06l5.492,4.831Z" transform="translate(-53.247 -176.136)"/></svg>',point:'<svg aria-hidden="true" viewBox="0 0 48 48"><path d="M40.1698 18.0929C40.1428 20.5301 39.3645 22.7586 38.3131 24.9092C36.7378 28.1319 34.6461 31.0118 32.3727 33.7664C30.2564 36.3308 27.9853 38.7519 25.5613 41.0284C24.7143 41.8237 23.9413 41.8481 23.073 41.0687C18.5767 37.0334 14.5359 32.6092 11.4515 27.3755C10.9495 26.5238 10.4945 25.6458 10.1025 24.7372C9.73107 23.8761 10.0514 22.9753 10.8534 22.6034C11.6577 22.2304 12.582 22.5576 12.9732 23.4086C14.8167 27.4176 17.5132 30.8241 20.4598 34.0548C21.596 35.3006 22.7863 36.4939 24.0184 37.6454C24.1708 37.7877 24.2667 37.9033 24.4831 37.6853C28.5664 33.5709 32.3892 29.2509 35.1723 24.1156C35.9836 22.6186 36.66 21.0543 36.8866 19.3498C37.2281 16.7802 36.712 14.3356 35.493 12.0807C33.1715 7.78618 29.5679 5.33714 24.6496 5.16445C19.0467 4.96786 14.0685 8.58606 12.3051 13.9294C11.8621 15.2717 11.6275 16.6474 11.6092 18.061C11.5962 19.0717 10.9335 19.7853 10.0201 19.783C9.10383 19.7808 8.43479 19.0505 8.43746 18.056C8.45818 10.5393 13.6357 4.02759 20.9324 2.34148C26.9693 0.946299 33.4364 3.45514 37.0904 8.60424C39.1088 11.4483 40.1115 14.6187 40.1698 18.0929ZM6.42075 43.1971C18.363 43.1971 30.2366 43.1971 42.1204 43.1971C42.1186 42.9919 41.9834 42.8579 41.8977 42.7076C40.3484 39.9866 38.7956 37.2673 37.2401 34.5498C36.9062 33.9668 36.8856 33.3861 37.257 32.8222C37.5915 32.314 38.0819 32.0681 38.6918 32.1099C39.2399 32.1477 39.6712 32.4169 39.9425 32.8899C42.0656 36.5932 44.1915 40.2948 46.2926 44.0105C46.9411 45.1576 46.1392 46.3818 44.7752 46.3821C37.6695 46.3845 30.564 46.3832 23.4585 46.3832C16.9643 46.3832 10.4699 46.3507 3.97625 46.4082C2.51885 46.4212 1.62531 45.0904 2.42647 43.7424C4.52293 40.2152 6.51577 36.6264 8.55216 33.0634C8.99072 32.2962 9.67627 31.9592 10.3942 32.1457C11.456 32.4219 11.9181 33.5491 11.3553 34.5444C10.2685 36.467 9.16594 38.3807 8.07099 40.2987C7.53258 41.2418 6.99643 42.1859 6.42075 43.1971ZM30.6461 17.8271C30.6465 21.3322 27.7864 24.1813 24.2754 24.1734C20.7946 24.1656 17.9554 21.3147 17.9555 17.8276C17.9557 14.3185 20.8087 11.4763 24.3244 11.4829C27.8051 11.4893 30.6458 14.3402 30.6461 17.8271ZM24.3201 14.6556C22.5583 14.656 21.1314 16.0714 21.1285 17.8213C21.1256 19.591 22.5741 21.0173 24.3575 21.0005C26.0699 20.9844 27.4807 19.5391 27.4733 17.8085C27.4659 16.0808 26.0403 14.6552 24.3201 14.6556Z" fill="currentColor"/></svg>',angle:'<svg viewBox="0 0 32 32" aria-hidden="true"><path fill="currentColor" d="M39.587,50.766h13.7a1,1,0,0,1,0,2H23.171a1,1,0,0,1,0-2h1.418l6.582-7.006v-.006a.517.517,0,0,1,.14-.357.456.456,0,0,1,.337-.144l12.1-12.876a.451.451,0,0,1,.665,0,.524.524,0,0,1,0,.708L32.883,43.355a8.3,8.3,0,0,1,6.7,7.411Zm-.949,0a7.254,7.254,0,0,0-6.611-6.5l-6.108,6.5Z" transform="translate(-22.229 -26.489)"/></svg>',area:'<svg aria-hidden="true" viewBox="0 0 48 48"><path d="M28.7725 16.8582L16.6882 28.9801C16.0335 29.6368 16.0335 30.7313 16.6882 31.3881C17.0156 31.7164 17.452 31.8806 17.8885 31.8806C18.3249 31.8806 18.7614 31.7164 19.0887 31.3881L31.173 19.2662C31.8277 18.6094 31.8277 17.5149 31.173 16.8582C30.5183 16.2015 29.4272 16.2015 28.7725 16.8582Z" fill="currentColor"/><path d="M44.5667 11.9055C45.385 11.9055 46.0397 11.2488 46.0397 10.4552L46.0397 3.47761C46.0397 2.65672 45.385 2 44.5667 2L37.6107 2C36.7924 2 36.1377 2.65672 36.1377 3.47761L36.1377 5.06468L11.9418 5.06468L11.9418 3.47761C11.9418 2.65672 11.2871 2 10.4688 2L3.51277 2C2.69442 2 2.03974 2.65672 2.03974 3.47761L2.03974 10.4279C2.03974 11.2488 2.69442 11.9055 3.51277 11.9055L5.20403 11.9055L5.20403 36.0671L3.51277 36.0671C2.69442 36.0671 2.03974 36.7239 2.03974 37.5448L2.03974 44.5224C2.03974 45.3433 2.69442 46 3.51277 46L10.4688 46C11.2598 46 11.9145 45.3433 11.9418 44.5224L11.9418 42.7438L36.1377 42.7438L36.1377 44.5224C36.1377 45.3433 36.7924 46 37.6107 46L44.5667 46C45.385 46 46.0397 45.3433 46.0397 44.5224L46.0397 37.5448C46.0397 36.7239 45.385 36.0671 44.5667 36.0671L42.7936 36.0671L42.7936 11.9055L44.5667 11.9055ZM39.0837 4.92786L43.0937 4.92786L43.0937 8.95024L39.0837 8.95024L39.0837 4.92786ZM4.9858 4.92786L8.99572 4.92786L8.99572 8.95024L4.9858 8.95024L4.9858 4.92786ZM8.99572 43.0448L4.9858 43.0448L4.9858 39.0224L8.99572 39.0224L8.99572 43.0448ZM43.0937 43.0448L39.0837 43.0448L39.0837 39.0224L43.0937 39.0224L43.0937 43.0448ZM39.3838 36.0671L37.6107 36.0671C36.7924 36.0671 36.1377 36.7239 36.1377 37.5448L36.1377 39.3234L11.9418 39.3234L11.9418 37.5448C11.9418 36.7239 11.2871 36.0671 10.4688 36.0671L8.61382 36.0671L8.61382 11.9055L10.4688 11.9055C11.2598 11.9055 11.9145 11.2488 11.9418 10.4552L11.9418 8.48507L36.1377 8.48507L36.1377 10.4279C36.1377 11.2488 36.7924 11.9055 37.6107 11.9055L39.3838 11.9055L39.3838 36.0671Z" fill="currentColor"/></svg>',slope:'<svg viewBox="0 0 32 32" aria-hidden="true"><path fill="currentColor" d="M202.1,188.337l2.629-2.191-8.447-3.106,1.533,8.871,2.629-2.194,9.341,11.209,1.656-1.379Zm-13.726-.435a1.075,1.075,0,0,0-1.07-.341,1.057,1.057,0,0,0-.5.277l-5.11,4.08a1.08,1.08,0,0,0-.406.84l-.007,17.386a1.079,1.079,0,0,0,1.077,1.077L205.7,211.2a1.078,1.078,0,0,0,.822-1.774Zm-4.934,21.164.007-15.788,3.968-3.171,15.974,18.941Z" transform="translate(-180.36 -181.131)"/></svg>'},VI={distance:{key:"distance",callBackType:"distance",icon:QA.distance,order:0},clearHeight:{key:"clearHeight",callBackType:"clear-height",icon:QA.clearHeight,order:1},clearDistance:{key:"clearDistance",callBackType:"clear-distance",icon:QA.clearDistance,order:2},elevation:{key:"elevation",callBackType:"elevation",icon:QA.elevation,order:3},point:{key:"point",callBackType:"point",icon:QA.point,order:4},angle:{key:"angle",callBackType:"angle",icon:QA.angle,order:5},area:{key:"area",callBackType:"area",icon:QA.area,order:6},slope:{key:"slope",callBackType:"slope",icon:QA.slope,order:7}},bbe=Object.values(VI).sort((i,e)=>i.order-e.order).map(i=>i.key);function Abe(i){switch(i){case"clearHeight":case"clearDistance":case"distance":case"elevation":return"length";case"area":return"area";case"angle":return"angle";case"slope":return"percent";default:return"point"}}function xbe(i){return Object.values(VI).find(e=>e.callBackType===i)?.key}const Ict=["distance","clearHeight","clearDistance","elevation"],Pct=["point","angle","area","slope"],wbe="bim-engine:measure:config",Dct={unit:"mm",precision:2};class Rct{element;options;modeButtons=new Map;clearBtn;expandBtn;settingsBtn;secondaryRow;clearHeightOptions;clearHeightDirectionLabel;clearHeightSelectTypeLabel;directionButtons=new Map;selectTypeButtons=new Map;mainView;settingsView;settingsUnitLabel;settingsPrecisionLabel;settingsUnitSelect;settingsPrecisionSelect;settingsSaveBtn;settingsBackBtn;activeMode;isExpanded;clearHeightDirection;clearHeightSelectType;view="main";config;lockedWidthPx=null;constructor(e={}){this.options=e,this.activeMode=e.defaultMode??"distance",this.isExpanded=e.defaultExpanded??!1,this.clearHeightDirection=e.defaultClearHeightDirection??1,this.clearHeightSelectType=e.defaultClearHeightSelectType??"point",this.config=this.loadConfigFromCache()??{...Dct};const{root:t,clearBtn:n,expandBtn:r,settingsBtn:s,secondaryRow:o,clearHeightOptions:a,clearHeightDirectionLabel:l,clearHeightSelectTypeLabel:c,mainView:h,settingsView:u,settingsUnitLabel:d,settingsPrecisionLabel:p,settingsUnitSelect:f,settingsPrecisionSelect:g,settingsSaveBtn:_,settingsBackBtn:y}=this.createDom();this.element=t,this.clearBtn=n,this.expandBtn=r,this.settingsBtn=s,this.secondaryRow=o,this.clearHeightOptions=a,this.clearHeightDirectionLabel=l,this.clearHeightSelectTypeLabel=c,this.mainView=h,this.settingsView=u,this.settingsUnitLabel=d,this.settingsPrecisionLabel=p,this.settingsUnitSelect=f,this.settingsPrecisionSelect=g,this.settingsSaveBtn=_,this.settingsBackBtn=y}init(){this.setLocales(),this.syncSettingsFormFromConfig(),this.applyExpandedState(),this.applyClearHeightOptionsState(),this.applyViewState(),this.syncActiveMode(this.activeMode??"distance")}setTheme(e){const t=this.element.style;t.setProperty("--bim-text-primary",e.textPrimary),t.setProperty("--bim-text-secondary",e.textSecondary),t.setProperty("--bim-text-tertiary",e.textTertiary),t.setProperty("--bim-border-default",e.borderDefault),t.setProperty("--bim-border-strong",e.borderStrong),t.setProperty("--bim-bg-inset",e.bgInset),t.setProperty("--bim-bg-elevated",e.bgElevated),t.setProperty("--bim-primary",e.primary),t.setProperty("--bim-primary-subtle",e.primarySubtle),t.setProperty("--bim-danger",e.danger),t.setProperty("--bim-component-bg-hover",e.componentBgHover)}setLocales(){for(const[r,s]of this.modeButtons.entries()){const o=At(`measure.modes.${r}`);s.dataset.tooltip=o,s.setAttribute("aria-label",o)}const e=At("measure.actions.clearAll");this.clearBtn.dataset.tooltip=e,this.clearBtn.setAttribute("aria-label",e);const t=this.isExpanded?At("measure.actions.collapse"):At("measure.actions.expand");delete this.expandBtn.dataset.tooltip,this.expandBtn.setAttribute("aria-label",t);const n=At("measure.actions.settings");this.settingsBtn.dataset.tooltip=n,this.settingsBtn.setAttribute("aria-label",n),this.clearHeightDirectionLabel.textContent=At("measure.clearHeight.direction"),this.clearHeightSelectTypeLabel.textContent=At("measure.clearHeight.selectType"),this.directionButtons.get(0).textContent=At("measure.clearHeight.directionDown"),this.directionButtons.get(1).textContent=At("measure.clearHeight.directionUp"),this.selectTypeButtons.get("point").textContent=At("measure.clearHeight.selectPoint"),this.selectTypeButtons.get("element").textContent=At("measure.clearHeight.selectElement"),this.settingsUnitLabel.textContent=At("measure.settings.unit"),this.settingsPrecisionLabel.textContent=At("measure.settings.precision"),this.settingsSaveBtn.textContent=At("measure.settings.save"),this.settingsBackBtn.textContent=At("measure.settings.cancel")}switchMode(e,t=!0){this.activeMode!==e&&(this.activeMode=e,this.syncActiveMode(e),this.applyClearHeightOptionsState(),this.closeSettingsView(),t&&this.options.onModeChange?.(e),e==="clearHeight"&&(this.options.onClearHeightDirectionChange?.(this.clearHeightDirection),this.options.onClearHeightSelectTypeChange?.(this.clearHeightSelectType)))}destroy(){this.element.remove()}getConfig(){return{...this.config}}createDom(){const e=document.createElement("div");e.className="measure-dock-panel";const t=document.createElement("div");t.className="measure-dock-panel-main";const n=document.createElement("div");n.className="measure-dock-clearheight-options";const r=document.createElement("div");r.className="measure-dock-clearheight-group";const s=document.createElement("span");s.className="measure-dock-clearheight-label";const o=document.createElement("div");o.className="measure-dock-clearheight-buttons";const a=this.createClearHeightOptionButton(()=>{this.setClearHeightDirection(0)}),l=this.createClearHeightOptionButton(()=>{this.setClearHeightDirection(1)});this.directionButtons.set(0,a),this.directionButtons.set(1,l),o.appendChild(a),o.appendChild(l),r.appendChild(s),r.appendChild(o);const c=document.createElement("div");c.className="measure-dock-clearheight-group";const h=document.createElement("span");h.className="measure-dock-clearheight-label";const u=document.createElement("div");u.className="measure-dock-clearheight-buttons";const d=this.createClearHeightOptionButton(()=>{this.setClearHeightSelectType("point")}),p=this.createClearHeightOptionButton(()=>{this.setClearHeightSelectType("element")});this.selectTypeButtons.set("point",d),this.selectTypeButtons.set("element",p),u.appendChild(d),u.appendChild(p),c.appendChild(h),c.appendChild(u),n.appendChild(r),n.appendChild(c);const f=document.createElement("div");f.className="measure-dock-panel-top";const g=document.createElement("div");g.className="measure-dock-panel-mode-zone";const _=document.createElement("div");_.className="measure-dock-panel-mode-row",Ict.forEach(v=>{_.appendChild(this.createModeButton(v))});const y=document.createElement("div");y.className="measure-dock-panel-mode-row measure-dock-panel-mode-row-secondary",Pct.forEach(v=>{y.appendChild(this.createModeButton(v))});const A=this.createIconButton("measure-dock-panel-action-clear",vn("delete"));A.addEventListener("click",()=>{this.options.onClearAll?.()});const x=this.createIconButton("measure-dock-panel-action-settings",vn("settings"));x.addEventListener("click",()=>{this.openSettingsView(),this.options.onSettings?.()}),_.appendChild(A),y.appendChild(x),g.appendChild(_),g.appendChild(y);const w=document.createElement("div");w.className="measure-dock-panel-actions";const E=this.createIconButton("measure-dock-panel-action-expand",vn("expand"));E.addEventListener("click",()=>{this.isExpanded=!this.isExpanded,this.applyExpandedState(),this.setLocales()}),w.appendChild(E),f.appendChild(g),f.appendChild(w),t.appendChild(n),t.appendChild(f);const{settingsView:S,settingsUnitLabel:I,settingsPrecisionLabel:C,settingsUnitSelect:T,settingsPrecisionSelect:D,settingsSaveBtn:M,settingsBackBtn:R}=this.createSettingsView();return e.appendChild(t),e.appendChild(S),{root:e,clearBtn:A,expandBtn:E,settingsBtn:x,secondaryRow:y,clearHeightOptions:n,clearHeightDirectionLabel:s,clearHeightSelectTypeLabel:h,mainView:t,settingsView:S,settingsUnitLabel:I,settingsPrecisionLabel:C,settingsUnitSelect:T,settingsPrecisionSelect:D,settingsSaveBtn:M,settingsBackBtn:R}}createSettingsView(){const e=document.createElement("div");e.className="measure-dock-panel-settings";const t=document.createElement("div");t.className="measure-dock-settings-row";const n=document.createElement("span");n.className="measure-dock-settings-label";const r=document.createElement("select");r.className="measure-dock-settings-select",["m","cm","mm","km"].forEach(u=>{const d=document.createElement("option");d.value=u,d.textContent=u,r.appendChild(d)}),t.appendChild(n),t.appendChild(r);const s=document.createElement("div");s.className="measure-dock-settings-row";const o=document.createElement("span");o.className="measure-dock-settings-label";const a=document.createElement("select");a.className="measure-dock-settings-select",[0,1,2,3].forEach(u=>{const d=document.createElement("option");d.value=String(u),d.textContent=u===0?"0":`0.${"0".repeat(u)}`,a.appendChild(d)}),s.appendChild(o),s.appendChild(a);const l=document.createElement("div");l.className="measure-dock-settings-actions";const c=document.createElement("button");c.type="button",c.className="measure-dock-settings-btn is-save",c.addEventListener("click",()=>{this.saveSettings()});const h=document.createElement("button");return h.type="button",h.className="measure-dock-settings-btn is-back",h.addEventListener("click",()=>{this.closeSettingsView()}),l.appendChild(c),l.appendChild(h),e.appendChild(t),e.appendChild(s),e.appendChild(l),{settingsView:e,settingsUnitLabel:n,settingsPrecisionLabel:o,settingsUnitSelect:r,settingsPrecisionSelect:a,settingsSaveBtn:c,settingsBackBtn:h}}createClearHeightOptionButton(e){const t=document.createElement("button");return t.type="button",t.className="measure-dock-clearheight-btn",t.addEventListener("click",e),t}createModeButton(e){const t=document.createElement("button");return t.type="button",t.className="measure-dock-panel-mode-btn",t.dataset.mode=e,t.innerHTML=`<span class="measure-dock-panel-mode-icon">${VI[e].icon}</span>`,t.addEventListener("click",()=>{this.switchMode(e)}),this.modeButtons.set(e,t),t}createIconButton(e,t){const n=document.createElement("button");return n.type="button",n.className=`measure-dock-panel-action-btn ${e}`,n.innerHTML=t,n}applyExpandedState(){this.secondaryRow.style.display=this.isExpanded?"grid":"none",this.expandBtn.classList.toggle("is-expanded",this.isExpanded),this.expandBtn.classList.toggle("is-collapsed",!this.isExpanded)}openSettingsView(){this.lockPanelWidth(),this.view="settings",this.syncSettingsFormFromConfig(),this.applyViewState()}closeSettingsView(){this.view==="settings"&&(this.view="main",this.unlockPanelWidth(),this.applyViewState())}saveSettings(){const e=this.settingsUnitSelect.value,t=Number(this.settingsPrecisionSelect.value);!this.isValidUnit(e)||!this.isValidPrecision(t)||(this.config={unit:e,precision:t},this.saveConfigToCache(this.config),this.options.onConfigSave?.(this.getConfig()),this.view="main",this.unlockPanelWidth(),this.applyViewState())}lockPanelWidth(){const e=this.element.getBoundingClientRect().width;e<=0||(this.lockedWidthPx=Math.ceil(e),this.element.style.width=`${this.lockedWidthPx}px`)}unlockPanelWidth(){this.lockedWidthPx=null,this.element.style.removeProperty("width")}syncSettingsFormFromConfig(){this.settingsUnitSelect.value=this.config.unit,this.settingsPrecisionSelect.value=String(this.config.precision)}applyViewState(){const e=this.view==="main";this.mainView.style.display=e?"block":"none",this.settingsView.style.display=e?"none":"flex"}applyClearHeightOptionsState(){this.clearHeightOptions.classList.remove("is-visible");for(const[e,t]of this.directionButtons.entries())t.classList.toggle("is-active",e===this.clearHeightDirection);for(const[e,t]of this.selectTypeButtons.entries())t.classList.toggle("is-active",e===this.clearHeightSelectType)}setClearHeightDirection(e){this.clearHeightDirection!==e&&(this.clearHeightDirection=e,this.applyClearHeightOptionsState(),this.options.onClearHeightDirectionChange?.(e))}setClearHeightSelectType(e){this.clearHeightSelectType!==e&&(this.clearHeightSelectType=e,this.applyClearHeightOptionsState(),this.options.onClearHeightSelectTypeChange?.(e))}loadConfigFromCache(){try{const e=localStorage.getItem(wbe);if(!e)return null;const t=JSON.parse(e);return!t||typeof t!="object"||!this.isValidUnit(t.unit)||!this.isValidPrecision(t.precision)?null:{unit:t.unit,precision:t.precision}}catch{return null}}saveConfigToCache(e){try{localStorage.setItem(wbe,JSON.stringify(e))}catch{return}}isValidUnit(e){return e==="m"||e==="cm"||e==="mm"||e==="km"}isValidPrecision(e){return e===0||e===1||e===2||e===3}syncActiveMode(e){for(const[t,n]of this.modeButtons.entries())n.classList.toggle("is-active",t===e)}clearActiveMode(){for(const e of this.modeButtons.values())e.classList.remove("is-active");this.activeMode=null}}class Ebe extends Mc{panel=null;unsubscribeTheme=null;unsubscribeLocale=null;unsubscribeDockState=null;unsubscribeMeasureEvents=null;constructor(e){super(e)}init(){this.unsubscribeTheme||(this.unsubscribeTheme=qi.subscribe(()=>{this.applyPresentation()})),this.unsubscribeLocale||(this.unsubscribeLocale=dr.subscribe(()=>{this.applyPresentation()})),this.unsubscribeDockState||(this.unsubscribeDockState=this.registry.bottomDock?.onStateChange(e=>{if(e.id!=="measure"||e.open){e.id==="measure"&&e.open&&this.ensureMeasureEventSubscription();return}this.engineComponent?.deactivateMeasure()})??null),this.ensureMeasureEventSubscription()}destroy(){this.unsubscribeTheme&&(this.unsubscribeTheme(),this.unsubscribeTheme=null),this.unsubscribeLocale&&(this.unsubscribeLocale(),this.unsubscribeLocale=null),this.unsubscribeDockState&&(this.unsubscribeDockState(),this.unsubscribeDockState=null),this.unsubscribeMeasureEvents&&(this.unsubscribeMeasureEvents(),this.unsubscribeMeasureEvents=null),this.panel?.destroy(),this.panel=null,super.destroy()}getPanelElement(){if(this.ensureMeasureEventSubscription(),this.panel)this.panel.switchMode("distance"),this.engineComponent?.activateMeasure("distance");else{this.panel=new Rct({defaultMode:"distance",defaultExpanded:!1,defaultClearHeightDirection:1,defaultClearHeightSelectType:"point",onModeChange:t=>{this.engineComponent?.activateMeasure(t)},onClearAll:()=>{this.engineComponent?.clearAllMeasures()},onConfigSave:t=>{this.engineComponent?.saveMeasureSetting({unit:t.unit,precision:t.precision})},onClearHeightDirectionChange:t=>{this.engineComponent?.setClearHeightDirection(t)},onClearHeightSelectTypeChange:t=>{this.engineComponent?.setClearHeightSelectType(t)}}),this.panel.init(),this.panel.switchMode("distance"),this.engineComponent?.activateMeasure("distance"),this.engineComponent?.setClearHeightDirection(1),this.engineComponent?.setClearHeightSelectType("point");const e=this.panel.getConfig();this.engineComponent?.saveMeasureSetting({unit:e.unit,precision:e.precision})}return this.applyPresentation(),this.panel.element}ensureMeasureEventSubscription(){if(this.unsubscribeMeasureEvents)return;const e=this.engineComponent;if(!e){console.warn("[MeasureDockManager] skip callback binding: engine component not ready yet");return}const t=s=>{this.handleMeasureCallback("measure-changed",s)},n=s=>{this.handleMeasureCallback("measure-click",s)},r=()=>{console.log("[MeasureDockManager] quit_measure_draw received"),this.panel?.clearActiveMode(),this.engineComponent?.resetMeasureState()};e.onRawEvent("measure-changed",t),e.onRawEvent("measure-click",n),e.onRawEvent("quit_measure_draw",r),this.unsubscribeMeasureEvents=()=>{e.offRawEvent("measure-changed",t),e.offRawEvent("measure-click",n),e.offRawEvent("quit_measure_draw",r)},console.log("[MeasureDockManager] raw event callbacks bound")}applyPresentation(){this.panel&&(this.panel.setTheme(qi.getTheme()),this.panel.setLocales())}handleMeasureCallback(e,t){const n=this.registry.bottomDock?.isOpen("measure")??!1,r=xbe(t.type);if(console.log("[MeasureDockManager] callback received",{event:e,type:t.type,mode:r,dockOpen:n,hasPanel:!!this.panel}),!n){console.log("[MeasureDockManager] skip mode switch: measure dock is closed");return}if(!r||!this.panel){console.log("[MeasureDockManager] skip mode switch: invalid mode or panel not ready");return}this.panel.switchMode(r,!1),this.engineComponent?.activateMeasure(r),console.log("[MeasureDockManager] switched mode by callback",{event:e,mode:r})}}class Lct{element;options;typeButtons=new Map;axisButtons=new Map;toolContainer;axisPanel;divider;toast;activeType;activeAxis;isHidden;isFilled;toastTimer=null;constructor(e={}){this.options=e,this.activeType=e.defaultType??null,this.activeAxis=e.defaultAxis??"x",this.isHidden=e.defaultHidden??!1,this.isFilled=e.defaultFill??!1;const{root:t,toolContainer:n,axisPanel:r,divider:s,toast:o}=this.createDom();this.element=t,this.toolContainer=n,this.axisPanel=r,this.divider=s,this.toast=o}init(){this.applyTypeState(),this.applyAxisState(),this.renderTools(),this.setLocales()}setTheme(e){const t=this.element.style;t.setProperty("--bim-text-primary",e.textPrimary),t.setProperty("--bim-text-secondary",e.textSecondary),t.setProperty("--bim-border-default",e.borderDefault),t.setProperty("--bim-border-strong",e.borderStrong),t.setProperty("--bim-bg-inset",e.bgInset),t.setProperty("--bim-bg-elevated",e.bgElevated),t.setProperty("--bim-primary",e.primary),t.setProperty("--bim-primary-subtle",e.primarySubtle),t.setProperty("--bim-component-bg-hover",e.componentBgHover)}setLocales(){this.typeButtons.get("face").dataset.tooltip=At("toolbar.sectionPlane"),this.typeButtons.get("axis").dataset.tooltip=At("toolbar.sectionAxis"),this.typeButtons.get("box").dataset.tooltip=At("toolbar.sectionBox"),this.axisButtons.get("x").dataset.label="X",this.axisButtons.get("y").dataset.label="Y",this.axisButtons.get("z").dataset.label="Z",this.typeButtons.get("selected").dataset.tooltip=At("toolbar.sectionSelected"),this.typeButtons.forEach(e=>{e.setAttribute("aria-label",e.dataset.tooltip??"")}),this.axisButtons.forEach(e=>{e.setAttribute("aria-label",e.dataset.label??"")}),this.renderTools()}destroy(){this.toastTimer&&(clearTimeout(this.toastTimer),this.toastTimer=null),this.element.remove()}resetForOpen(){this.activeType=null,this.isHidden=!1,this.applyTypeState(),this.renderTools()}getActiveType(){return this.activeType}getActiveAxis(){return this.activeAxis}setFillState(e){this.isFilled=e,this.renderTools()}getFillState(){return this.isFilled}createDom(){const e=document.createElement("div");e.className="section-dock-panel";const t=document.createElement("div");t.className="section-dock-axis-panel",["x","y","z"].forEach(d=>{const p=document.createElement("button");p.type="button",p.className="section-dock-axis-btn",p.textContent=d.toUpperCase(),p.addEventListener("click",()=>{this.handleAxisChange(d)}),this.axisButtons.set(d,p),t.appendChild(p)});const n=document.createElement("div");n.className="section-dock-main";const r=document.createElement("div");r.className="section-dock-types";const s=this.createTypeButton("face",vn("拾曲面剖切")),o=this.createTypeButton("axis",vn("轴向剖切")),a=this.createTypeButton("box",vn("剖切盒")),l=this.createTypeButton("selected",vn("适应到模型"));r.appendChild(s),r.appendChild(o),r.appendChild(a),r.appendChild(l);const c=document.createElement("div");c.className="section-dock-divider";const h=document.createElement("div");h.className="section-dock-tools",n.appendChild(r),n.appendChild(c),n.appendChild(h),e.appendChild(t),e.appendChild(n);const u=document.createElement("div");return u.className="section-dock-toast",u.setAttribute("role","status"),u.setAttribute("aria-live","polite"),e.appendChild(u),{root:e,toolContainer:h,axisPanel:t,divider:c,toast:u}}createTypeButton(e,t){const n=document.createElement("button");n.type="button",n.className="section-dock-type-btn";const r=document.createElement("span");return r.className="section-dock-type-icon",r.innerHTML=t,n.appendChild(r),n.addEventListener("click",()=>{this.handleTypeChange(e)}),this.typeButtons.set(e,n),n}handleTypeChange(e){if(this.activeType===e){this.activeType=null,this.isHidden=!1,this.applyTypeState(),this.renderTools(),this.options.onHideToggle?.(!1),this.options.onTypeChange?.(null,this.activeAxis);return}if(this.options.onTypeChange?.(e,this.activeAxis)===!1){this.showNoSelectionToast();return}this.activeType=e,this.applyTypeState(),this.renderTools(),this.isHidden&&(this.isHidden=!1,this.options.onHideToggle?.(!1))}handleAxisChange(e){this.activeAxis!==e&&(this.activeAxis=e,this.applyAxisState(),this.activeType==="axis"&&this.options.onAxisChange?.(e))}applyTypeState(){this.typeButtons.forEach((t,n)=>{t.classList.toggle("is-active",n===this.activeType)});const e=this.activeType==="axis";this.axisPanel.classList.toggle("is-visible",e)}applyAxisState(){this.axisButtons.forEach((e,t)=>{e.classList.toggle("is-active",t===this.activeAxis)})}renderTools(){if(this.toolContainer.innerHTML="",!this.activeType){this.divider.classList.add("is-hidden");return}this.divider.classList.remove("is-hidden"),this.getToolsForType(this.activeType).forEach(e=>{const t=document.createElement("button");t.type="button",t.className="section-dock-tool-btn",e.isActive&&t.classList.add("is-active");const n=document.createElement("span");n.className="section-dock-tool-icon",n.innerHTML=vn(e.iconName),t.appendChild(n);const r=At(e.textKey);t.dataset.tooltip=r,t.setAttribute("aria-label",r),t.addEventListener("click",e.onClick),this.toolContainer.appendChild(t)})}getToolsForType(e){const t={key:"fill",iconName:"填充",textKey:e==="box"||e==="selected"?"sectionBox.actions.fill":e==="axis"?"sectionAxis.actions.fill":"sectionPlane.actions.fill",isActive:this.isFilled,onClick:()=>{this.isFilled=!this.isFilled,this.options.onFillToggle?.(this.isFilled),this.renderTools()}},n={key:"hide",iconName:"隐藏",textKey:e==="box"||e==="selected"?"sectionBox.actions.hide":e==="axis"?"sectionAxis.actions.hide":"sectionPlane.actions.hide",isActive:this.isHidden,onClick:()=>{this.isHidden=!this.isHidden,this.options.onHideToggle?.(this.isHidden),this.renderTools()}},r={key:"reverse",iconName:"反向",textKey:e==="axis"?"sectionAxis.actions.reverse":e==="box"?"sectionBox.actions.reverse":"sectionPlane.actions.reverse",onClick:()=>{this.options.onReverse?.()}};return e==="axis"?[t,n,r,{key:"reset",iconName:"重置",textKey:"sectionAxis.actions.reset",onClick:()=>{this.isHidden=!1,this.options.onReset?.(e,this.activeAxis),this.renderTools()}}]:e==="box"||e==="selected"?[t,n,{key:"reset",iconName:"重置",textKey:"sectionBox.actions.reset",onClick:()=>{if(this.options.onReset?.(e,this.activeAxis)===!1){this.showNoSelectionToast();return}this.isHidden=!1,this.renderTools()}}]:[t,n,r,{key:"reset",iconName:"重置",textKey:"sectionPlane.actions.reset",onClick:()=>{this.isHidden=!1,this.options.onReset?.(e,this.activeAxis),this.renderTools()}}]}showNoSelectionToast(){this.showToast(At("panel.componentDetail.noSelection"))}showToast(e){this.toastTimer&&clearTimeout(this.toastTimer),this.toast.textContent=e,this.toast.classList.add("is-visible"),this.toastTimer=setTimeout(()=>{this.toast.classList.remove("is-visible"),this.toastTimer=null},1800)}}class Sbe extends Mc{panel=null;unsubscribeTheme=null;unsubscribeLocale=null;unsubscribeDockState=null;constructor(e){super(e)}init(){this.unsubscribeTheme||(this.unsubscribeTheme=qi.subscribe(()=>{this.applyPresentation()})),this.unsubscribeLocale||(this.unsubscribeLocale=dr.subscribe(()=>{this.applyPresentation()})),this.unsubscribeDockState||(this.unsubscribeDockState=this.registry.bottomDock?.onStateChange(e=>{if(e.id==="section"){if(!e.open){console.log("deactivateSection"),this.engineComponent?.deactivateSection();return}this.panel?.resetForOpen()}})??null)}destroy(){this.unsubscribeTheme&&(this.unsubscribeTheme(),this.unsubscribeTheme=null),this.unsubscribeLocale&&(this.unsubscribeLocale(),this.unsubscribeLocale=null),this.unsubscribeDockState&&(this.unsubscribeDockState(),this.unsubscribeDockState=null),this.panel?.destroy(),this.panel=null,super.destroy()}getPanelElement(){return this.panel||(this.panel=new Lct({defaultType:null,defaultAxis:"x",defaultHidden:!1,onTypeChange:(e,t)=>this.activateByType(e,t),onAxisChange:e=>{this.panel?.getActiveType()==="axis"&&this.engineComponent?.activeSection(e)},onHideToggle:e=>{if(e){this.engineComponent?.hideSection();return}this.engineComponent?.recoverSection()},onReverse:()=>{this.engineComponent?.reverseSection()},onReset:(e,t)=>(this.engineComponent?.deactivateSection(),this.activateByType(e,t)),onFitToModel:()=>{this.engineComponent?.scaleSectionBox()},defaultFill:this.engineComponent?.getFillCutFace()??!1,onFillToggle:e=>{this.engineComponent?.setFillCutFace(e)}}),this.panel.init()),this.panel.resetForOpen(),this.applyPresentation(),this.panel.element}activateByType(e,t){return e?e==="face"?(this.engineComponent?.activeSection("face"),!0):e==="box"?(this.engineComponent?.activeSection("box"),!0):e==="selected"?fbe(this.engineComponent):(this.engineComponent?.activeSection(t),!0):(this.engineComponent?.deactivateSection(),!0)}applyPresentation(){this.panel&&(this.panel.setTheme(qi.getTheme()),this.panel.setLocales())}}class Oct{element;options;state={mode:"none",isPlanViewActive:!1,speed:1,gravity:!1,collision:!1,viewMode:"first-person",characterModel:"construction-worker",walkMode:"walk"};planViewBtn;firstPersonBtn;thirdPersonBtn;pathModeBtn;settingsContainer;speedControl;speedDecreaseBtn;speedIncreaseBtn;speedDisplay;gravityCheckbox;gravityLabel;collisionCheckbox;collisionLabel;characterModelSelect;characterModelLabel;walkModeSelect;walkModeLabel;exitBtn;unsubscribeLocale=null;unsubscribeTheme=null;constructor(e={}){this.options=e}init(){this.element=this.createPanel(),this.updateSettingsView(),this.unsubscribeLocale=dr.subscribe(()=>this.setLocales()),this.unsubscribeTheme=qi.subscribe(e=>this.setTheme(e)),this.setLocales(),this.setTheme(qi.getTheme())}setPlanViewActive(e){this.state.isPlanViewActive=e,this.updateButtonStates()}setPathModeActive(e){if(!e&&this.state.mode!=="path")return;const t=e?"path":"none";this.setMode(t)}setViewMode(e){this.state.viewMode=e,this.updateButtonStates()}getState(){return{...this.state}}setSpeed(e){this.state.speed=Math.max(1,Math.min(10,e)),this.updateSpeedDisplay()}setGravity(e){this.state.gravity=e,this.gravityCheckbox&&(this.gravityCheckbox.checked=e)}setCollision(e){this.state.collision=e,this.collisionCheckbox&&(this.collisionCheckbox.checked=e)}createPanel(){const e=document.createElement("div");e.className="walk-dock-panel";const t=this.createLeftButtons(),n=document.createElement("div");n.className="walk-divider",this.settingsContainer=this.createSettingsContainer();const r=document.createElement("div");r.className="walk-divider";const s=this.createExitButton();return e.appendChild(t),e.appendChild(n),e.appendChild(this.settingsContainer),e.appendChild(r),e.appendChild(s),e}createLeftButtons(){const e=document.createElement("div");return e.className="walk-dock-left",this.planViewBtn=this.createIconButton("plan-view",()=>{this.state.isPlanViewActive=!this.state.isPlanViewActive,this.updateButtonStates(),this.options.onPlanViewToggle?.(this.state.isPlanViewActive)}),this.pathModeBtn=this.createIconButton("path",()=>{const t=this.state.mode==="path"?"none":"path";this.setMode(t),this.options.onPathModeToggle?.(t==="path")}),this.firstPersonBtn=this.createIconButton("first-person",()=>{this.setViewMode("first-person"),this.options.onViewModeChange?.("first-person")}),this.thirdPersonBtn=this.createIconButton("third-person",()=>{this.setViewMode("third-person"),this.options.onViewModeChange?.("third-person")}),e.appendChild(this.planViewBtn),e.appendChild(this.firstPersonBtn),e.appendChild(this.thirdPersonBtn),e}createSettingsContainer(){const e=document.createElement("div");e.className="walk-dock-settings",this.speedControl=this.createSpeedControl();const t=document.createElement("label");t.className="walk-checkbox-wrapper walk-checkbox-gravity",this.gravityCheckbox=document.createElement("input"),this.gravityCheckbox.type="checkbox",this.gravityCheckbox.className="walk-checkbox",this.gravityCheckbox.checked=this.state.gravity,this.gravityCheckbox.addEventListener("change",()=>{this.state.gravity=this.gravityCheckbox.checked,this.options.onGravityToggle?.(this.state.gravity)}),this.gravityLabel=document.createElement("span"),this.gravityLabel.className="walk-checkbox-label",t.appendChild(this.gravityCheckbox),t.appendChild(this.gravityLabel);const n=document.createElement("label");n.className="walk-checkbox-wrapper walk-checkbox-collision",this.collisionCheckbox=document.createElement("input"),this.collisionCheckbox.type="checkbox",this.collisionCheckbox.className="walk-checkbox",this.collisionCheckbox.checked=this.state.collision,this.collisionCheckbox.addEventListener("change",()=>{this.state.collision=this.collisionCheckbox.checked,this.options.onCollisionToggle?.(this.state.collision)}),this.collisionLabel=document.createElement("span"),this.collisionLabel.className="walk-checkbox-label",n.appendChild(this.collisionCheckbox),n.appendChild(this.collisionLabel);const r=document.createElement("div");r.className="walk-select-wrapper walk-select-wrapper-character-model",this.characterModelLabel=document.createElement("label"),this.characterModelLabel.className="walk-select-label",this.characterModelSelect=document.createElement("select"),this.characterModelSelect.className="walk-select walk-select-character-model",this.characterModelSelect.addEventListener("change",()=>{this.state.characterModel=this.characterModelSelect.value,this.options.onCharacterModelChange?.(this.state.characterModel)}),r.appendChild(this.characterModelLabel),r.appendChild(this.characterModelSelect);const s=document.createElement("div");return s.className="walk-select-wrapper walk-select-wrapper-walk-mode",this.walkModeLabel=document.createElement("label"),this.walkModeLabel.className="walk-select-label",this.walkModeSelect=document.createElement("select"),this.walkModeSelect.className="walk-select walk-select-walk-mode",this.walkModeSelect.addEventListener("change",()=>{this.state.walkMode=this.walkModeSelect.value,this.options.onWalkModeChange?.(this.state.walkMode)}),s.appendChild(this.walkModeLabel),s.appendChild(this.walkModeSelect),e.appendChild(this.speedControl),e.appendChild(r),e.appendChild(s),e.appendChild(t),e.appendChild(n),e}createSpeedControl(){const e=document.createElement("div");e.className="walk-speed-control";const t=document.createElement("label");t.className="walk-speed-label",t.textContent=At("walkControl.speed");const n=document.createElement("div");return n.className="walk-speed-group",this.speedDecreaseBtn=document.createElement("button"),this.speedDecreaseBtn.className="walk-speed-btn",this.speedDecreaseBtn.textContent="-",this.speedDecreaseBtn.addEventListener("click",()=>{this.state.speed>1&&(this.state.speed--,this.updateSpeedDisplay(),this.options.onSpeedChange?.(this.state.speed))}),this.speedDisplay=document.createElement("div"),this.speedDisplay.className="walk-speed-display",this.speedDisplay.textContent=`${this.state.speed}X`,this.speedIncreaseBtn=document.createElement("button"),this.speedIncreaseBtn.className="walk-speed-btn",this.speedIncreaseBtn.textContent="+",this.speedIncreaseBtn.addEventListener("click",()=>{this.state.speed<10&&(this.state.speed++,this.updateSpeedDisplay(),this.options.onSpeedChange?.(this.state.speed))}),n.appendChild(this.speedDecreaseBtn),n.appendChild(this.speedDisplay),n.appendChild(this.speedIncreaseBtn),e.appendChild(t),e.appendChild(n),e}createIconButton(e,t){const n=document.createElement("button");return n.className=`walk-icon-btn walk-icon-btn-${e}`,n.innerHTML=this.getIconSVG(e),n.addEventListener("click",t),n}createExitButton(){const e=document.createElement("button");return e.className="walk-exit-btn",e.addEventListener("click",()=>{this.options.onExit?.()}),this.exitBtn=e,e}setMode(e){const t=this.state.mode;t==="walk"&&e!=="walk"&&this.options.onWalkModeToggle?.(!1),t==="path"&&e!=="path"&&this.options.onPathModeToggle?.(!1),this.state.mode=e,e==="path"?(this.state.gravity=!1,this.state.collision=!1,this.gravityCheckbox.checked=!1,this.gravityCheckbox.disabled=!0,this.collisionCheckbox.checked=!1,this.collisionCheckbox.disabled=!0):(this.gravityCheckbox.disabled=!1,this.collisionCheckbox.disabled=!1),this.updateButtonStates(),this.updateSettingsView(),this.updateSpeedButtonStates()}updateButtonStates(){this.planViewBtn.classList.toggle("active",this.state.isPlanViewActive),this.firstPersonBtn.classList.toggle("active",this.state.viewMode==="first-person"),this.thirdPersonBtn.classList.toggle("active",this.state.viewMode==="third-person"),this.pathModeBtn.classList.toggle("active",this.state.mode==="path")}updateSettingsView(){const e=this.speedControl,t=this.gravityCheckbox.parentElement,n=this.collisionCheckbox.parentElement,r=this.characterModelSelect.parentElement,s=this.walkModeSelect.parentElement;this.state.mode==="walk"?(e.style.display="none",t.style.display="flex",n.style.display="flex",r.style.display="flex",s.style.display="flex"):(e.style.display="flex",t.style.display="flex",n.style.display="flex",r.style.display="none",s.style.display="none")}updateSpeedDisplay(){this.speedDisplay.textContent=`${this.state.speed}X`,this.updateSpeedButtonStates()}updateSpeedButtonStates(){this.speedDecreaseBtn.disabled=this.state.speed<=1,this.speedIncreaseBtn.disabled=this.state.speed>=10}getIconSVG(e){return{"plan-view":vn("地图"),"first-person":vn("眼睛"),"third-person":vn("第一人称漫游"),path:vn("路径漫游"),walk:vn("第一人称漫游")}[e]||""}setLocales(){this.setButtonTooltip(this.planViewBtn,At("walkControl.planView")),this.setButtonTooltip(this.firstPersonBtn,At("walkControl.viewMode.firstPerson")),this.setButtonTooltip(this.thirdPersonBtn,At("walkControl.viewMode.thirdPerson"));const e=this.speedControl.querySelector(".walk-speed-label");e&&(e.textContent=At("walkControl.speed")),this.gravityLabel.textContent=At("walkControl.gravity"),this.collisionLabel.textContent=At("walkControl.collision"),this.characterModelLabel.textContent=At("walkControl.characterModel.label"),this.characterModelSelect.innerHTML="";const t=document.createElement("option");t.value="construction-worker",t.textContent=At("walkControl.characterModel.constructionWorker"),t.selected=this.state.characterModel==="construction-worker",this.characterModelSelect.appendChild(t);const n=document.createElement("option");n.value="office-male",n.textContent=At("walkControl.characterModel.officeMale"),n.selected=this.state.characterModel==="office-male",this.characterModelSelect.appendChild(n),this.walkModeLabel.textContent=At("walkControl.walkMode.label"),this.walkModeSelect.innerHTML="";const r=document.createElement("option");r.value="walk",r.textContent=At("walkControl.walkMode.walk"),r.selected=this.state.walkMode==="walk",this.walkModeSelect.appendChild(r);const s=document.createElement("option");s.value="run",s.textContent=At("walkControl.walkMode.run"),s.selected=this.state.walkMode==="run",this.walkModeSelect.appendChild(s),this.exitBtn.textContent=At("walkControl.exit")}setButtonTooltip(e,t){e.title=t,e.setAttribute("aria-label",t),e.dataset.tooltip=t}setTheme(e){if(!this.element)return;const t=this.element.style;t.setProperty("--bim-bg-base",e.bgBase??"#152232"),t.setProperty("--bim-bg-elevated",e.bgElevated??"#1f2d3e"),t.setProperty("--bim-bg-inset",e.bgInset??"#152232"),t.setProperty("--bim-border-default",e.borderDefault??"#334155"),t.setProperty("--bim-border-strong",e.borderStrong??"#475569"),t.setProperty("--bim-border-subtle",e.borderSubtle??"#1e293b"),t.setProperty("--bim-divider",e.divider??"#334155"),t.setProperty("--bim-shadow-xl",e.shadowXl??"0 20px 40px rgba(0, 0, 0, 0.3)"),t.setProperty("--bim-primary",e.primary??"#3b82f6"),t.setProperty("--bim-primary-hover",e.primaryHover??"#60a5fa"),t.setProperty("--bim-primary-subtle",e.primarySubtle??"rgba(59, 130, 246, 0.15)"),t.setProperty("--bim-text-primary",e.textPrimary??"#ffffff"),t.setProperty("--bim-text-inverse",e.textInverse??"#152232"),t.setProperty("--bim-icon-default",e.iconDefault??"#ffffff"),t.setProperty("--bim-component-bg-hover",e.componentBgHover??"rgba(248, 250, 252, 0.06)"),t.setProperty("--bim-component-bg-active",e.componentBgActive??"rgba(248, 250, 252, 0.1)")}destroy(){this.unsubscribeLocale?.(),this.unsubscribeTheme?.(),this.element&&this.element.parentElement&&this.element.parentElement.removeChild(this.element)}}class ME extends Mc{dialog=null;isVisible=!1;constructor(e){super(e)}get dialogWidth(){return 300}get dialogHeight(){return"auto"}get dialogOptions(){return{draggable:!0,resizable:!1}}get dialogHeader(){}get dialogHideCloseButton(){return!1}onDialogClose(){}onDialogCreated(){}onBeforeDestroy(){}getDialogPosition(){const e=this.registry.container;if(!e)return{x:100,y:100};const t=e.clientWidth,n=e.clientHeight,r=this.dialogWidth,s=typeof this.dialogHeight=="number"?this.dialogHeight:300;return{x:t-r-20,y:(n-s)/2}}show(){if(!this.registry.dialog||!this.registry.container){console.warn(`[${this.dialogId}] Dialog manager or container is not initialized`);return}this.dialog&&this.destroyDialog();const e=this.getDialogPosition(),t=this.createContent(),n=this.dialogOptions;this.dialog=this.registry.dialog.create({id:this.dialogId,title:this.dialogTitle,content:t,width:this.dialogWidth,height:this.dialogHeight,position:e,draggable:n.draggable,resizable:n.resizable,header:this.dialogHeader,hideCloseButton:this.dialogHideCloseButton,onClose:()=>{this.onDialogClose(),this.destroyDialog()}}),this.dialog.init(),this.isVisible=!0,this.onDialogCreated()}hide(){this.destroyDialog()}toggle(){this.isVisible?this.hide():this.show()}isOpen(){return this.isVisible}destroyDialog(){this.onBeforeDestroy(),this.dialog&&(this.dialog.destroy(),this.dialog=null),this.isVisible=!1}destroy(){this.destroyDialog(),super.destroy()}}class Nct{element;registry;unsubscribeLocale=null;unsubscribeTheme=null;constructor(e){this.registry=e}points=[];duration=1e4;loop=!1;playingPointIndex=-1;isPlaying=!1;init(){this.element=document.createElement("div"),this.element.className="walk-path-panel",this.unsubscribeLocale=dr.subscribe(()=>this.render()),this.unsubscribeTheme=qi.subscribe(e=>this.setTheme(e)),this.loadPointsFromEngine(),this.render(),this.setTheme(qi.getTheme())}loadPointsFromEngine(){const e=this.registry.engine3d?.getEngineComponent()?.pathRoamingGetPoints()??[];this.points=e.map((t,n)=>({index:n}))}render(){this.element.innerHTML="";const e=this.createSettingsSection();this.element.appendChild(e);const t=this.createPointsSection();this.element.appendChild(t);const n=this.createPlayButton();this.element.appendChild(n)}createSettingsSection(){const e=document.createElement("div");e.className="walk-path-settings";const t=document.createElement("div");t.className="walk-path-form-group";const n=document.createElement("label");n.textContent=At("walkControl.path.duration");const r=document.createElement("div");r.className="walk-path-input-wrapper";const s=document.createElement("input");s.type="number",s.className="walk-path-input",s.value=String(this.duration/1e3),s.min="1",s.oninput=h=>{const u=parseInt(h.target.value)||1;this.duration=u*1e3};const o=document.createElement("span");o.className="walk-path-unit",o.textContent=At("walkControl.path.durationUnit"),r.appendChild(s),r.appendChild(o),t.appendChild(n),t.appendChild(r);const a=document.createElement("div");a.className="walk-path-form-group walk-path-form-group-inline";const l=document.createElement("input");l.type="checkbox",l.id="walk-path-loop-checkbox",l.className="walk-path-checkbox",l.checked=this.loop,l.onchange=h=>{this.loop=h.target.checked};const c=document.createElement("label");return c.htmlFor="walk-path-loop-checkbox",c.textContent=At("walkControl.path.loop"),a.appendChild(l),a.appendChild(c),e.appendChild(t),e.appendChild(a),e}createPointsSection(){const e=document.createElement("div");e.className="walk-path-points-section";const t=document.createElement("div");t.className="walk-path-points-toolbar";const n=document.createElement("button");n.className="walk-path-btn walk-path-btn-small",n.textContent=`+ ${At("walkControl.path.addPoint")}`,n.onclick=()=>this.addPoint();const r=document.createElement("button");r.className="walk-path-btn walk-path-btn-small walk-path-btn-danger",r.textContent=At("walkControl.path.deleteAll"),r.onclick=()=>this.deleteAllPoints(),t.appendChild(n),t.appendChild(r),e.appendChild(t);const s=document.createElement("div");if(s.className="walk-path-points-list",this.points.length===0){const o=document.createElement("div");o.className="walk-path-empty",o.textContent=At("walkControl.path.noPoints"),s.appendChild(o)}else this.points.forEach((o,a)=>{const l=this.createPointItem(a);s.appendChild(l)});return e.appendChild(s),e}createPointItem(e){const t=document.createElement("div");t.className="walk-path-point-item",this.playingPointIndex===e&&t.classList.add("walk-path-point-item-active");const n=document.createElement("span");n.className="walk-path-point-name",n.textContent=`${At("walkControl.path.point")}${e}`;const r=document.createElement("div");r.className="walk-path-point-actions";const s=document.createElement("button");s.className="walk-path-btn-icon",s.innerHTML="▶",s.title=At("walkControl.path.play"),s.onclick=a=>{a.stopPropagation(),this.jumpToPoint(e)};const o=document.createElement("button");return o.className="walk-path-btn-icon walk-path-btn-icon-danger",o.innerHTML="×",o.onclick=a=>{a.stopPropagation(),this.deletePoint(e)},r.appendChild(s),r.appendChild(o),t.appendChild(n),t.appendChild(r),t}createPlayButton(){const e=document.createElement("div");e.className="walk-path-btn-group";const t=document.createElement("button");t.className="walk-path-btn walk-path-btn-play",t.textContent=`▶ ${At("walkControl.path.play")}`,t.disabled=this.points.length===0||this.isPlaying,t.onclick=()=>this.playPath();const n=document.createElement("button");return n.className="walk-path-btn walk-path-btn-stop",n.textContent=`■ ${At("walkControl.path.stop")}`,n.disabled=!this.isPlaying,n.onclick=()=>this.stopPath(),e.appendChild(t),e.appendChild(n),e}addPoint(){this.registry.engine3d?.getEngineComponent()?.pathRoamingAddPoint();const e=this.points.length;this.points.push({index:e}),this.render()}deletePoint(e){this.registry.engine3d?.getEngineComponent()?.pathRoamingRemovePoint(e),this.points.splice(e,1),this.points.forEach((t,n)=>t.index=n),this.render()}deleteAllPoints(){this.registry.engine3d?.getEngineComponent()?.pathRoamingClearPoints(),this.points=[],this.render()}jumpToPoint(e){this.registry.engine3d?.getEngineComponent()?.pathRoamingJumpToPoint(e)}playPath(){this.points.length!==0&&(this.isPlaying=!0,this.render(),console.log("[WalkPathPanel] 开始播放漫游",{duration:this.duration,loop:this.loop,pointsCount:this.points.length}),this.registry.engine3d?.getEngineComponent()?.pathRoamingPlay({duration:this.duration,loop:this.loop,onPointComplete:e=>{console.log("[WalkPathPanel] onPointComplete",{pointIndex:e}),this.playingPointIndex=e,this.render()},onComplete:()=>{console.log("[WalkPathPanel] onComplete 播放完成"),this.isPlaying=!1,this.playingPointIndex=-1,this.render()}}))}stopPath(){console.log("[WalkPathPanel] 停止漫游"),this.registry.engine3d?.getEngineComponent()?.pathRoamingStop(),this.isPlaying=!1,this.playingPointIndex=-1,this.render()}setLocales(){this.render()}setTheme(e){this.element&&(this.element.style.setProperty("--bim-text-primary",e.textPrimary??"#fff"),this.element.style.setProperty("--bim-text-secondary",e.textPrimary??"#fff"),this.element.style.setProperty("--bim-bg-elevated",e.bgElevated??"#1f2d3e"),this.element.style.setProperty("--bim-border-default",e.borderDefault??"#334155"),this.element.style.setProperty("--bim-primary",e.primary??"#3b82f6"))}destroy(){this.isPlaying&&this.stopPath(),this.unsubscribeLocale?.(),this.unsubscribeTheme?.(),this.element?.parentElement&&this.element.parentElement.removeChild(this.element)}}class Bct extends ME{panel=null;constructor(e){super(e)}get dialogId(){return"walk-path-dialog"}get dialogTitle(){return"walkControl.path.dialogTitle"}get dialogWidth(){return 300}get dialogHeight(){return 450}init(){}getDialogPosition(){const e=this.registry.container;return e?{x:e.clientWidth-this.dialogWidth-20,y:20}:{x:100,y:100}}createContent(){return this.panel=new Nct(this.registry),this.panel.init(),this.panel.element}onDialogClose(){this.registry.walkDock?.setPathModeActive(!1)}onBeforeDestroy(){this.panel&&(this.panel.destroy(),this.panel=null)}}class Tbe extends Mc{panel=null;pathManager=null;unsubscribeDockState=null;constructor(e){super(e)}init(){this.pathManager=new Bct(this.registry),this.pathManager.init(),this.unsubscribeDockState||(this.unsubscribeDockState=this.registry.bottomDock?.onStateChange(e=>{if(e.id==="walk"){if(e.open){this.onOpen();return}this.onClose()}})??null)}destroy(){this.unsubscribeDockState&&(this.unsubscribeDockState(),this.unsubscribeDockState=null),this.onClose(),this.pathManager?.destroy(),this.pathManager=null,super.destroy()}getPanelElement(){return this.panel||(this.panel=new Oct({onPlanViewToggle:e=>{this.engineComponent?.toggleMiniMap(),this.registry.toolbar?.setBtnActive("map",e),this.emit("walk:plan-view-toggle",{isActive:e})},onPathModeToggle:e=>{e?this.pathManager?.show():this.pathManager?.hide(),this.emit("walk:path-mode-toggle",{isActive:e})},onWalkModeToggle:e=>{e&&this.pathManager?.hide(),this.emit("walk:walk-mode-toggle",{isActive:e})},onSpeedChange:e=>{this.engineComponent?.setWalkSpeed(e),this.emit("walk:speed-change",{speed:e})},onGravityToggle:e=>{this.engineComponent?.setWalkGravity(e),this.emit("walk:gravity-toggle",{enabled:e})},onCollisionToggle:e=>{this.engineComponent?.setWalkCollision(e),this.emit("walk:collision-toggle",{enabled:e})},onViewModeChange:e=>{e==="first-person"?this.engineComponent?.activateFirstPersonMode():this.engineComponent?.activateThirdPersonMode(),this.emit("walk:view-mode-change",{mode:e})},onCharacterModelChange:e=>{},onWalkModeChange:e=>{},onExit:()=>{this.registry.bottomDock?.close("walk")}}),this.panel.init()),this.syncMapState(),this.panel.element}setPlanViewActive(e){this.panel?.setPlanViewActive(e)}setPathModeActive(e){this.panel?.setPathModeActive(e)}onOpen(){this.engineComponent?.activateFirstPersonMode(),this.panel?.setViewMode("first-person"),this.engineComponent?.getMiniMapState()||(this.engineComponent?.toggleMiniMap(),this.registry.toolbar?.setBtnActive("map",!0)),this.syncMapState(),this.engineComponent?.setWalkSpeed(2),this.engineComponent?.setWalkCollision(!1);const e=this.engineComponent?.getWalkSpeed()??2,t=this.engineComponent?.getWalkGravity()??!1,n=this.engineComponent?.getWalkCollision()??!1;console.log("[WalkDock] 初始状态 - speed:",e,"gravity:",t,"collision:",n),this.panel?.setSpeed(e),this.panel?.setGravity(t),this.panel?.setCollision(n)}onClose(){this.pathManager?.hide(),this.engineComponent?.getMiniMapState()&&this.engineComponent.toggleMiniMap(),this.engineComponent?.deactivateFirstPersonMode(),this.panel&&(this.panel.destroy(),this.panel=null),this.registry.toolbar?.setBtnActive("map",!1)}syncMapState(){const e=this.engineComponent?.getMiniMapState()??!1;this.panel?.setPlanViewActive(e)}}class Fct{element;options;items=[];bodyEl;emptyEl;rowRefs=[];unsubscribeLocale=null;unsubscribeTheme=null;constructor(e={}){this.options=e}init(){this.element=this.createPanel(),this.unsubscribeLocale=dr.subscribe(()=>this.setLocales()),this.unsubscribeTheme=qi.subscribe(e=>this.setTheme(e)),this.setLocales(),this.setTheme(qi.getTheme())}setItems(e){this.items=e,this.renderRows()}setTheme(e){if(!this.element)return;const t=this.element.style;t.setProperty("--mcal-text-primary",e.textPrimary),t.setProperty("--mcal-text-secondary",e.textSecondary),t.setProperty("--mcal-border",e.borderSubtle),t.setProperty("--mcal-bg-inset",e.bgInset),t.setProperty("--mcal-bg-elevated",e.bgElevated),t.setProperty("--mcal-primary",e.primary),t.setProperty("--mcal-primary-subtle",e.primarySubtle)}setLocales(){this.element&&(this.element.querySelectorAll("[data-i18n]").forEach(e=>{const t=e.dataset.i18n;t&&(e.textContent=At(t))}),this.renderRows())}destroy(){this.unsubscribeLocale?.(),this.unsubscribeLocale=null,this.unsubscribeTheme?.(),this.unsubscribeTheme=null,this.rowRefs=[],this.element?.remove()}createPanel(){const e=document.createElement("div");e.className="model-calibration-dock-panel";const t=document.createElement("div");t.className="model-calibration-table-wrap";const n=document.createElement("table");return n.className="model-calibration-table",n.appendChild(this.createHead()),this.bodyEl=document.createElement("tbody"),n.appendChild(this.bodyEl),t.appendChild(n),this.emptyEl=document.createElement("div"),this.emptyEl.className="model-calibration-empty",this.emptyEl.textContent=At("modelCalibration.empty"),t.appendChild(this.emptyEl),e.append(t),e}createHead(){const e=document.createElement("thead"),t=document.createElement("tr");return["modelCalibration.model","modelCalibration.offsetX","modelCalibration.offsetY","modelCalibration.offsetZ","modelCalibration.rotationX","modelCalibration.rotationY","modelCalibration.rotationZ","modelCalibration.actions"].forEach(r=>{const s=document.createElement("th");s.dataset.i18n=r,s.textContent=At(r),t.appendChild(s)}),e.appendChild(t),e}renderRows(){this.bodyEl&&(this.bodyEl.innerHTML="",this.rowRefs=[],this.emptyEl.textContent=At("modelCalibration.empty"),this.emptyEl.classList.toggle("is-visible",this.items.length===0),this.items.forEach(e=>{const t=document.createElement("tr"),n={item:e,offsetInputs:this.createInputMap(e.offset),rotationInputs:this.createInputMap(e.rotation)};t.appendChild(this.createModelCell(e)),t.appendChild(this.createInputCell(n.offsetInputs.x)),t.appendChild(this.createInputCell(n.offsetInputs.y)),t.appendChild(this.createInputCell(n.offsetInputs.z)),t.appendChild(this.createInputCell(n.rotationInputs.x)),t.appendChild(this.createInputCell(n.rotationInputs.y)),t.appendChild(this.createInputCell(n.rotationInputs.z)),t.appendChild(this.createActionCell(n)),this.rowRefs.push(n),this.bodyEl.appendChild(t)}))}createModelCell(e){const t=document.createElement("td");t.className="model-calibration-model-cell";const n=document.createElement("div");return n.className="model-calibration-model-name",n.textContent=e.name,n.title=`${e.name}
|
|
4014
|
+
}`;let Jlt=class{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t){if(this.texture===null){const n=new Ive(e.texture);(e.depthNear!==t.depthNear||e.depthFar!==t.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=n}}getMesh(e){if(this.texture!==null&&this.mesh===null){const t=e.cameras[0].viewport,n=new ld({vertexShader:Qlt,fragmentShader:Klt,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new ul(new n8(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}},Zlt=class extends bE{constructor(e,t){super();const n=this;let r=null,s=1,o=null,a="local-floor",l=1,c=null,h=null,u=null,d=null,p=null,f=null;const g=typeof XRWebGLBinding<"u",_=new Jlt,y={},A=t.getContextAttributes();let x=null,w=null;const E=[],S=[],I=new gn;let C=null;const T=new xm;T.viewport=new hl;const D=new xm;D.viewport=new hl;const M=[T,D],R=new jrt;let v=null,P=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(V){let ee=E[V];return ee===void 0&&(ee=new CZ,E[V]=ee),ee.getTargetRaySpace()},this.getControllerGrip=function(V){let ee=E[V];return ee===void 0&&(ee=new CZ,E[V]=ee),ee.getGripSpace()},this.getHand=function(V){let ee=E[V];return ee===void 0&&(ee=new CZ,E[V]=ee),ee.getHandSpace()};function O(V){const ee=S.indexOf(V.inputSource);if(ee===-1)return;const oe=E[ee];oe!==void 0&&(oe.update(V.inputSource,V.frame,c||o),oe.dispatchEvent({type:V.type,data:V.inputSource}))}function B(){r.removeEventListener("select",O),r.removeEventListener("selectstart",O),r.removeEventListener("selectend",O),r.removeEventListener("squeeze",O),r.removeEventListener("squeezestart",O),r.removeEventListener("squeezeend",O),r.removeEventListener("end",B),r.removeEventListener("inputsourceschange",k);for(let V=0;V<E.length;V++){const ee=S[V];ee!==null&&(S[V]=null,E[V].disconnect(ee))}v=null,P=null,_.reset();for(const V in y)delete y[V];e.setRenderTarget(x),p=null,d=null,u=null,r=null,w=null,ue.stop(),n.isPresenting=!1,e.setPixelRatio(C),e.setSize(I.width,I.height,!1),n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(V){s=V,n.isPresenting===!0&&pr("WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(V){a=V,n.isPresenting===!0&&pr("WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return c||o},this.setReferenceSpace=function(V){c=V},this.getBaseLayer=function(){return d!==null?d:p},this.getBinding=function(){return u===null&&g&&(u=new XRWebGLBinding(r,t)),u},this.getFrame=function(){return f},this.getSession=function(){return r},this.setSession=async function(V){if(r=V,r!==null){if(x=e.getRenderTarget(),r.addEventListener("select",O),r.addEventListener("selectstart",O),r.addEventListener("selectend",O),r.addEventListener("squeeze",O),r.addEventListener("squeezestart",O),r.addEventListener("squeezeend",O),r.addEventListener("end",B),r.addEventListener("inputsourceschange",k),A.xrCompatible!==!0&&await t.makeXRCompatible(),C=e.getPixelRatio(),e.getSize(I),g&&"createProjectionLayer"in XRWebGLBinding.prototype){let oe=null,pe=null,ve=null;A.depth&&(ve=A.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,oe=A.stencil?vE:__,pe=A.stencil?VL:nd);const ge={colorFormat:t.RGBA8,depthFormat:ve,scaleFactor:s};u=this.getBinding(),d=u.createProjectionLayer(ge),r.updateRenderState({layers:[d]}),e.setPixelRatio(1),e.setSize(d.textureWidth,d.textureHeight,!1),w=new zg(d.textureWidth,d.textureHeight,{format:rd,type:af,depthTexture:new UI(d.textureWidth,d.textureHeight,pe,void 0,void 0,void 0,void 0,void 0,void 0,oe),stencilBuffer:A.stencil,colorSpace:e.outputColorSpace,samples:A.antialias?4:0,resolveDepthBuffer:d.ignoreDepthValues===!1,resolveStencilBuffer:d.ignoreDepthValues===!1})}else{const oe={antialias:A.antialias,alpha:!0,depth:A.depth,stencil:A.stencil,framebufferScaleFactor:s};p=new XRWebGLLayer(r,t,oe),r.updateRenderState({baseLayer:p}),e.setPixelRatio(1),e.setSize(p.framebufferWidth,p.framebufferHeight,!1),w=new zg(p.framebufferWidth,p.framebufferHeight,{format:rd,type:af,colorSpace:e.outputColorSpace,stencilBuffer:A.stencil,resolveDepthBuffer:p.ignoreDepthValues===!1,resolveStencilBuffer:p.ignoreDepthValues===!1})}w.isXRRenderTarget=!0,this.setFoveation(l),c=null,o=await r.requestReferenceSpace(a),ue.setContext(r),ue.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(r!==null)return r.environmentBlendMode},this.getDepthTexture=function(){return _.getDepthTexture()};function k(V){for(let ee=0;ee<V.removed.length;ee++){const oe=V.removed[ee],pe=S.indexOf(oe);pe>=0&&(S[pe]=null,E[pe].disconnect(oe))}for(let ee=0;ee<V.added.length;ee++){const oe=V.added[ee];let pe=S.indexOf(oe);if(pe===-1){for(let ge=0;ge<E.length;ge++)if(ge>=S.length){S.push(oe),pe=ge;break}else if(S[ge]===null){S[ge]=oe,pe=ge;break}if(pe===-1)break}const ve=E[pe];ve&&ve.connect(oe)}}const H=new pt,z=new pt;function j(V,ee,oe){H.setFromMatrixPosition(ee.matrixWorld),z.setFromMatrixPosition(oe.matrixWorld);const pe=H.distanceTo(z),ve=ee.projectionMatrix.elements,ge=oe.projectionMatrix.elements,je=ve[14]/(ve[10]-1),fe=ve[14]/(ve[10]+1),X=(ve[9]+1)/ve[5],ce=(ve[9]-1)/ve[5],_e=(ve[8]-1)/ve[0],le=(ge[8]+1)/ge[0],G=je*_e,xe=je*le,ze=pe/(-_e+le),Ke=ze*-_e;if(ee.matrixWorld.decompose(V.position,V.quaternion,V.scale),V.translateX(Ke),V.translateZ(ze),V.matrixWorld.compose(V.position,V.quaternion,V.scale),V.matrixWorldInverse.copy(V.matrixWorld).invert(),ve[10]===-1)V.projectionMatrix.copy(ee.projectionMatrix),V.projectionMatrixInverse.copy(ee.projectionMatrixInverse);else{const we=je+ze,U=fe+ze,N=G-Ke,Y=xe+(pe-Ke),de=X*fe/U*we,he=ce*fe/U*we;V.projectionMatrix.makePerspective(N,Y,de,he,we,U),V.projectionMatrixInverse.copy(V.projectionMatrix).invert()}}function $(V,ee){ee===null?V.matrixWorld.copy(V.matrix):V.matrixWorld.multiplyMatrices(ee.matrixWorld,V.matrix),V.matrixWorldInverse.copy(V.matrixWorld).invert()}this.updateCamera=function(V){if(r===null)return;let ee=V.near,oe=V.far;_.texture!==null&&(_.depthNear>0&&(ee=_.depthNear),_.depthFar>0&&(oe=_.depthFar)),R.near=D.near=T.near=ee,R.far=D.far=T.far=oe,(v!==R.near||P!==R.far)&&(r.updateRenderState({depthNear:R.near,depthFar:R.far}),v=R.near,P=R.far),R.layers.mask=V.layers.mask|6,T.layers.mask=R.layers.mask&3,D.layers.mask=R.layers.mask&5;const pe=V.parent,ve=R.cameras;$(R,pe);for(let ge=0;ge<ve.length;ge++)$(ve[ge],pe);ve.length===2?j(R,T,D):R.projectionMatrix.copy(T.projectionMatrix),Q(V,R,pe)};function Q(V,ee,oe){oe===null?V.matrix.copy(ee.matrixWorld):(V.matrix.copy(oe.matrixWorld),V.matrix.invert(),V.matrix.multiply(ee.matrixWorld)),V.matrix.decompose(V.position,V.quaternion,V.scale),V.updateMatrixWorld(!0),V.projectionMatrix.copy(ee.projectionMatrix),V.projectionMatrixInverse.copy(ee.projectionMatrixInverse),V.isPerspectiveCamera&&(V.fov=nZ*2*Math.atan(1/V.projectionMatrix.elements[5]),V.zoom=1)}this.getCamera=function(){return R},this.getFoveation=function(){if(!(d===null&&p===null))return l},this.setFoveation=function(V){l=V,d!==null&&(d.fixedFoveation=V),p!==null&&p.fixedFoveation!==void 0&&(p.fixedFoveation=V)},this.hasDepthSensing=function(){return _.texture!==null},this.getDepthSensingMesh=function(){return _.getMesh(R)},this.getCameraTexture=function(V){return y[V]};let se=null;function te(V,ee){if(h=ee.getViewerPose(c||o),f=ee,h!==null){const oe=h.views;p!==null&&(e.setRenderTargetFramebuffer(w,p.framebuffer),e.setRenderTarget(w));let pe=!1;oe.length!==R.cameras.length&&(R.cameras.length=0,pe=!0);for(let fe=0;fe<oe.length;fe++){const X=oe[fe];let ce=null;if(p!==null)ce=p.getViewport(X);else{const le=u.getViewSubImage(d,X);ce=le.viewport,fe===0&&(e.setRenderTargetTextures(w,le.colorTexture,le.depthStencilTexture),e.setRenderTarget(w))}let _e=M[fe];_e===void 0&&(_e=new xm,_e.layers.enable(fe),_e.viewport=new hl,M[fe]=_e),_e.matrix.fromArray(X.transform.matrix),_e.matrix.decompose(_e.position,_e.quaternion,_e.scale),_e.projectionMatrix.fromArray(X.projectionMatrix),_e.projectionMatrixInverse.copy(_e.projectionMatrix).invert(),_e.viewport.set(ce.x,ce.y,ce.width,ce.height),fe===0&&(R.matrix.copy(_e.matrix),R.matrix.decompose(R.position,R.quaternion,R.scale)),pe===!0&&R.cameras.push(_e)}const ve=r.enabledFeatures;if(ve&&ve.includes("depth-sensing")&&r.depthUsage=="gpu-optimized"&&g){u=n.getBinding();const fe=u.getDepthInformation(oe[0]);fe&&fe.isValid&&fe.texture&&_.init(fe,r.renderState)}if(ve&&ve.includes("camera-access")&&g){e.state.unbindTexture(),u=n.getBinding();for(let fe=0;fe<oe.length;fe++){const X=oe[fe].camera;if(X){let ce=y[X];ce||(ce=new Ive,y[X]=ce);const _e=u.getCameraImage(X);ce.sourceTexture=_e}}}}for(let oe=0;oe<E.length;oe++){const pe=S[oe],ve=E[oe];pe!==null&&ve!==void 0&&ve.update(pe,ee,c||o)}se&&se(V,ee),ee.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:ee}),f=null}const ue=new Rve;ue.setAnimationLoop(te),this.setAnimationLoop=function(V){se=V},this.dispose=function(){}}};const CE=new Ev,ect=new rr;function tct(i,e){function t(_,y){_.matrixAutoUpdate===!0&&_.updateMatrix(),y.value.copy(_.matrix)}function n(_,y){y.color.getRGB(_.fogColor.value,xve(i)),y.isFog?(_.fogNear.value=y.near,_.fogFar.value=y.far):y.isFogExp2&&(_.fogDensity.value=y.density)}function r(_,y,A,x,w){y.isMeshBasicMaterial||y.isMeshLambertMaterial?s(_,y):y.isMeshToonMaterial?(s(_,y),u(_,y)):y.isMeshPhongMaterial?(s(_,y),h(_,y)):y.isMeshStandardMaterial?(s(_,y),d(_,y),y.isMeshPhysicalMaterial&&p(_,y,w)):y.isMeshMatcapMaterial?(s(_,y),f(_,y)):y.isMeshDepthMaterial?s(_,y):y.isMeshDistanceMaterial?(s(_,y),g(_,y)):y.isMeshNormalMaterial?s(_,y):y.isLineBasicMaterial?(o(_,y),y.isLineDashedMaterial&&a(_,y)):y.isPointsMaterial?l(_,y,A,x):y.isSpriteMaterial?c(_,y):y.isShadowMaterial?(_.color.value.copy(y.color),_.opacity.value=y.opacity):y.isShaderMaterial&&(y.uniformsNeedUpdate=!1)}function s(_,y){_.opacity.value=y.opacity,y.color&&_.diffuse.value.copy(y.color),y.emissive&&_.emissive.value.copy(y.emissive).multiplyScalar(y.emissiveIntensity),y.map&&(_.map.value=y.map,t(y.map,_.mapTransform)),y.alphaMap&&(_.alphaMap.value=y.alphaMap,t(y.alphaMap,_.alphaMapTransform)),y.bumpMap&&(_.bumpMap.value=y.bumpMap,t(y.bumpMap,_.bumpMapTransform),_.bumpScale.value=y.bumpScale,y.side===lp&&(_.bumpScale.value*=-1)),y.normalMap&&(_.normalMap.value=y.normalMap,t(y.normalMap,_.normalMapTransform),_.normalScale.value.copy(y.normalScale),y.side===lp&&_.normalScale.value.negate()),y.displacementMap&&(_.displacementMap.value=y.displacementMap,t(y.displacementMap,_.displacementMapTransform),_.displacementScale.value=y.displacementScale,_.displacementBias.value=y.displacementBias),y.emissiveMap&&(_.emissiveMap.value=y.emissiveMap,t(y.emissiveMap,_.emissiveMapTransform)),y.specularMap&&(_.specularMap.value=y.specularMap,t(y.specularMap,_.specularMapTransform)),y.alphaTest>0&&(_.alphaTest.value=y.alphaTest);const A=e.get(y),x=A.envMap,w=A.envMapRotation;x&&(_.envMap.value=x,CE.copy(w),CE.x*=-1,CE.y*=-1,CE.z*=-1,x.isCubeTexture&&x.isRenderTargetTexture===!1&&(CE.y*=-1,CE.z*=-1),_.envMapRotation.value.setFromMatrix4(ect.makeRotationFromEuler(CE)),_.flipEnvMap.value=x.isCubeTexture&&x.isRenderTargetTexture===!1?-1:1,_.reflectivity.value=y.reflectivity,_.ior.value=y.ior,_.refractionRatio.value=y.refractionRatio),y.lightMap&&(_.lightMap.value=y.lightMap,_.lightMapIntensity.value=y.lightMapIntensity,t(y.lightMap,_.lightMapTransform)),y.aoMap&&(_.aoMap.value=y.aoMap,_.aoMapIntensity.value=y.aoMapIntensity,t(y.aoMap,_.aoMapTransform))}function o(_,y){_.diffuse.value.copy(y.color),_.opacity.value=y.opacity,y.map&&(_.map.value=y.map,t(y.map,_.mapTransform))}function a(_,y){_.dashSize.value=y.dashSize,_.totalSize.value=y.dashSize+y.gapSize,_.scale.value=y.scale}function l(_,y,A,x){_.diffuse.value.copy(y.color),_.opacity.value=y.opacity,_.size.value=y.size*A,_.scale.value=x*.5,y.map&&(_.map.value=y.map,t(y.map,_.uvTransform)),y.alphaMap&&(_.alphaMap.value=y.alphaMap,t(y.alphaMap,_.alphaMapTransform)),y.alphaTest>0&&(_.alphaTest.value=y.alphaTest)}function c(_,y){_.diffuse.value.copy(y.color),_.opacity.value=y.opacity,_.rotation.value=y.rotation,y.map&&(_.map.value=y.map,t(y.map,_.mapTransform)),y.alphaMap&&(_.alphaMap.value=y.alphaMap,t(y.alphaMap,_.alphaMapTransform)),y.alphaTest>0&&(_.alphaTest.value=y.alphaTest)}function h(_,y){_.specular.value.copy(y.specular),_.shininess.value=Math.max(y.shininess,1e-4)}function u(_,y){y.gradientMap&&(_.gradientMap.value=y.gradientMap)}function d(_,y){_.metalness.value=y.metalness,y.metalnessMap&&(_.metalnessMap.value=y.metalnessMap,t(y.metalnessMap,_.metalnessMapTransform)),_.roughness.value=y.roughness,y.roughnessMap&&(_.roughnessMap.value=y.roughnessMap,t(y.roughnessMap,_.roughnessMapTransform)),y.envMap&&(_.envMapIntensity.value=y.envMapIntensity)}function p(_,y,A){_.ior.value=y.ior,y.sheen>0&&(_.sheenColor.value.copy(y.sheenColor).multiplyScalar(y.sheen),_.sheenRoughness.value=y.sheenRoughness,y.sheenColorMap&&(_.sheenColorMap.value=y.sheenColorMap,t(y.sheenColorMap,_.sheenColorMapTransform)),y.sheenRoughnessMap&&(_.sheenRoughnessMap.value=y.sheenRoughnessMap,t(y.sheenRoughnessMap,_.sheenRoughnessMapTransform))),y.clearcoat>0&&(_.clearcoat.value=y.clearcoat,_.clearcoatRoughness.value=y.clearcoatRoughness,y.clearcoatMap&&(_.clearcoatMap.value=y.clearcoatMap,t(y.clearcoatMap,_.clearcoatMapTransform)),y.clearcoatRoughnessMap&&(_.clearcoatRoughnessMap.value=y.clearcoatRoughnessMap,t(y.clearcoatRoughnessMap,_.clearcoatRoughnessMapTransform)),y.clearcoatNormalMap&&(_.clearcoatNormalMap.value=y.clearcoatNormalMap,t(y.clearcoatNormalMap,_.clearcoatNormalMapTransform),_.clearcoatNormalScale.value.copy(y.clearcoatNormalScale),y.side===lp&&_.clearcoatNormalScale.value.negate())),y.dispersion>0&&(_.dispersion.value=y.dispersion),y.iridescence>0&&(_.iridescence.value=y.iridescence,_.iridescenceIOR.value=y.iridescenceIOR,_.iridescenceThicknessMinimum.value=y.iridescenceThicknessRange[0],_.iridescenceThicknessMaximum.value=y.iridescenceThicknessRange[1],y.iridescenceMap&&(_.iridescenceMap.value=y.iridescenceMap,t(y.iridescenceMap,_.iridescenceMapTransform)),y.iridescenceThicknessMap&&(_.iridescenceThicknessMap.value=y.iridescenceThicknessMap,t(y.iridescenceThicknessMap,_.iridescenceThicknessMapTransform))),y.transmission>0&&(_.transmission.value=y.transmission,_.transmissionSamplerMap.value=A.texture,_.transmissionSamplerSize.value.set(A.width,A.height),y.transmissionMap&&(_.transmissionMap.value=y.transmissionMap,t(y.transmissionMap,_.transmissionMapTransform)),_.thickness.value=y.thickness,y.thicknessMap&&(_.thicknessMap.value=y.thicknessMap,t(y.thicknessMap,_.thicknessMapTransform)),_.attenuationDistance.value=y.attenuationDistance,_.attenuationColor.value.copy(y.attenuationColor)),y.anisotropy>0&&(_.anisotropyVector.value.set(y.anisotropy*Math.cos(y.anisotropyRotation),y.anisotropy*Math.sin(y.anisotropyRotation)),y.anisotropyMap&&(_.anisotropyMap.value=y.anisotropyMap,t(y.anisotropyMap,_.anisotropyMapTransform))),_.specularIntensity.value=y.specularIntensity,_.specularColor.value.copy(y.specularColor),y.specularColorMap&&(_.specularColorMap.value=y.specularColorMap,t(y.specularColorMap,_.specularColorMapTransform)),y.specularIntensityMap&&(_.specularIntensityMap.value=y.specularIntensityMap,t(y.specularIntensityMap,_.specularIntensityMapTransform))}function f(_,y){y.matcap&&(_.matcap.value=y.matcap)}function g(_,y){const A=e.get(y).light;_.referencePosition.value.setFromMatrixPosition(A.matrixWorld),_.nearDistance.value=A.shadow.camera.near,_.farDistance.value=A.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:r}}function ict(i,e,t,n){let r={},s={},o=[];const a=i.getParameter(i.MAX_UNIFORM_BUFFER_BINDINGS);function l(A,x){const w=x.program;n.uniformBlockBinding(A,w)}function c(A,x){let w=r[A.id];w===void 0&&(f(A),w=h(A),r[A.id]=w,A.addEventListener("dispose",_));const E=x.program;n.updateUBOMapping(A,E);const S=e.render.frame;s[A.id]!==S&&(d(A),s[A.id]=S)}function h(A){const x=u();A.__bindingPointIndex=x;const w=i.createBuffer(),E=A.__size,S=A.usage;return i.bindBuffer(i.UNIFORM_BUFFER,w),i.bufferData(i.UNIFORM_BUFFER,E,S),i.bindBuffer(i.UNIFORM_BUFFER,null),i.bindBufferBase(i.UNIFORM_BUFFER,x,w),w}function u(){for(let A=0;A<a;A++)if(o.indexOf(A)===-1)return o.push(A),A;return Ws("WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function d(A){const x=r[A.id],w=A.uniforms,E=A.__cache;i.bindBuffer(i.UNIFORM_BUFFER,x);for(let S=0,I=w.length;S<I;S++){const C=Array.isArray(w[S])?w[S]:[w[S]];for(let T=0,D=C.length;T<D;T++){const M=C[T];if(p(M,S,T,E)===!0){const R=M.__offset,v=Array.isArray(M.value)?M.value:[M.value];let P=0;for(let O=0;O<v.length;O++){const B=v[O],k=g(B);typeof B=="number"||typeof B=="boolean"?(M.__data[0]=B,i.bufferSubData(i.UNIFORM_BUFFER,R+P,M.__data)):B.isMatrix3?(M.__data[0]=B.elements[0],M.__data[1]=B.elements[1],M.__data[2]=B.elements[2],M.__data[3]=0,M.__data[4]=B.elements[3],M.__data[5]=B.elements[4],M.__data[6]=B.elements[5],M.__data[7]=0,M.__data[8]=B.elements[6],M.__data[9]=B.elements[7],M.__data[10]=B.elements[8],M.__data[11]=0):(B.toArray(M.__data,P),P+=k.storage/Float32Array.BYTES_PER_ELEMENT)}i.bufferSubData(i.UNIFORM_BUFFER,R,M.__data)}}}i.bindBuffer(i.UNIFORM_BUFFER,null)}function p(A,x,w,E){const S=A.value,I=x+"_"+w;if(E[I]===void 0)return typeof S=="number"||typeof S=="boolean"?E[I]=S:E[I]=S.clone(),!0;{const C=E[I];if(typeof S=="number"||typeof S=="boolean"){if(C!==S)return E[I]=S,!0}else if(C.equals(S)===!1)return C.copy(S),!0}return!1}function f(A){const x=A.uniforms;let w=0;const E=16;for(let I=0,C=x.length;I<C;I++){const T=Array.isArray(x[I])?x[I]:[x[I]];for(let D=0,M=T.length;D<M;D++){const R=T[D],v=Array.isArray(R.value)?R.value:[R.value];for(let P=0,O=v.length;P<O;P++){const B=v[P],k=g(B),H=w%E,z=H%k.boundary,j=H+z;w+=z,j!==0&&E-j<k.storage&&(w+=E-j),R.__data=new Float32Array(k.storage/Float32Array.BYTES_PER_ELEMENT),R.__offset=w,w+=k.storage}}}const S=w%E;return S>0&&(w+=E-S),A.__size=w,A.__cache={},this}function g(A){const x={boundary:0,storage:0};return typeof A=="number"||typeof A=="boolean"?(x.boundary=4,x.storage=4):A.isVector2?(x.boundary=8,x.storage=8):A.isVector3||A.isColor?(x.boundary=16,x.storage=12):A.isVector4?(x.boundary=16,x.storage=16):A.isMatrix3?(x.boundary=48,x.storage=48):A.isMatrix4?(x.boundary=64,x.storage=64):A.isTexture?pr("WebGLRenderer: Texture samplers can not be part of an uniforms group."):pr("WebGLRenderer: Unsupported uniform value type.",A),x}function _(A){const x=A.target;x.removeEventListener("dispose",_);const w=o.indexOf(x.__bindingPointIndex);o.splice(w,1),i.deleteBuffer(r[x.id]),delete r[x.id],delete s[x.id]}function y(){for(const A in r)i.deleteBuffer(r[A]);o=[],r={},s={}}return{bind:l,update:c,dispose:y}}const nct=new Uint16Array([12469,15057,12620,14925,13266,14620,13807,14376,14323,13990,14545,13625,14713,13328,14840,12882,14931,12528,14996,12233,15039,11829,15066,11525,15080,11295,15085,10976,15082,10705,15073,10495,13880,14564,13898,14542,13977,14430,14158,14124,14393,13732,14556,13410,14702,12996,14814,12596,14891,12291,14937,11834,14957,11489,14958,11194,14943,10803,14921,10506,14893,10278,14858,9960,14484,14039,14487,14025,14499,13941,14524,13740,14574,13468,14654,13106,14743,12678,14818,12344,14867,11893,14889,11509,14893,11180,14881,10751,14852,10428,14812,10128,14765,9754,14712,9466,14764,13480,14764,13475,14766,13440,14766,13347,14769,13070,14786,12713,14816,12387,14844,11957,14860,11549,14868,11215,14855,10751,14825,10403,14782,10044,14729,9651,14666,9352,14599,9029,14967,12835,14966,12831,14963,12804,14954,12723,14936,12564,14917,12347,14900,11958,14886,11569,14878,11247,14859,10765,14828,10401,14784,10011,14727,9600,14660,9289,14586,8893,14508,8533,15111,12234,15110,12234,15104,12216,15092,12156,15067,12010,15028,11776,14981,11500,14942,11205,14902,10752,14861,10393,14812,9991,14752,9570,14682,9252,14603,8808,14519,8445,14431,8145,15209,11449,15208,11451,15202,11451,15190,11438,15163,11384,15117,11274,15055,10979,14994,10648,14932,10343,14871,9936,14803,9532,14729,9218,14645,8742,14556,8381,14461,8020,14365,7603,15273,10603,15272,10607,15267,10619,15256,10631,15231,10614,15182,10535,15118,10389,15042,10167,14963,9787,14883,9447,14800,9115,14710,8665,14615,8318,14514,7911,14411,7507,14279,7198,15314,9675,15313,9683,15309,9712,15298,9759,15277,9797,15229,9773,15166,9668,15084,9487,14995,9274,14898,8910,14800,8539,14697,8234,14590,7790,14479,7409,14367,7067,14178,6621,15337,8619,15337,8631,15333,8677,15325,8769,15305,8871,15264,8940,15202,8909,15119,8775,15022,8565,14916,8328,14804,8009,14688,7614,14569,7287,14448,6888,14321,6483,14088,6171,15350,7402,15350,7419,15347,7480,15340,7613,15322,7804,15287,7973,15229,8057,15148,8012,15046,7846,14933,7611,14810,7357,14682,7069,14552,6656,14421,6316,14251,5948,14007,5528,15356,5942,15356,5977,15353,6119,15348,6294,15332,6551,15302,6824,15249,7044,15171,7122,15070,7050,14949,6861,14818,6611,14679,6349,14538,6067,14398,5651,14189,5311,13935,4958,15359,4123,15359,4153,15356,4296,15353,4646,15338,5160,15311,5508,15263,5829,15188,6042,15088,6094,14966,6001,14826,5796,14678,5543,14527,5287,14377,4985,14133,4586,13869,4257,15360,1563,15360,1642,15358,2076,15354,2636,15341,3350,15317,4019,15273,4429,15203,4732,15105,4911,14981,4932,14836,4818,14679,4621,14517,4386,14359,4156,14083,3795,13808,3437,15360,122,15360,137,15358,285,15355,636,15344,1274,15322,2177,15281,2765,15215,3223,15120,3451,14995,3569,14846,3567,14681,3466,14511,3305,14344,3121,14037,2800,13753,2467,15360,0,15360,1,15359,21,15355,89,15346,253,15325,479,15287,796,15225,1148,15133,1492,15008,1749,14856,1882,14685,1886,14506,1783,14324,1608,13996,1398,13702,1183]);let A_=null;function rct(){return A_===null&&(A_=new Iv(nct,16,16,AI,g_),A_.name="DFG_LUT",A_.minFilter=fu,A_.magFilter=fu,A_.wrapS=bv,A_.wrapT=bv,A_.generateMipmaps=!1,A_.needsUpdate=!0),A_}let sct=class{constructor(e={}){const{canvas:t=rrt(),context:n=null,depth:r=!0,stencil:s=!1,alpha:o=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:h="default",failIfMajorPerformanceCaveat:u=!1,reversedDepthBuffer:d=!1,outputBufferType:p=af}=e;this.isWebGLRenderer=!0;let f;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");f=n.getContextAttributes().alpha}else f=o;const g=p,_=new Set([xI,xJ,Iz]),y=new Set([af,nd,HL,VL,bJ,AJ]),A=new Uint32Array(4),x=new Int32Array(4);let w=null,E=null;const S=[],I=[];let C=null;this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=m_,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const T=this;let D=!1;this._outputColorSpace=ym;let M=0,R=0,v=null,P=-1,O=null;const B=new hl,k=new hl;let H=null;const z=new $s(0);let j=0,$=t.width,Q=t.height,se=1,te=null,ue=null;const V=new hl(0,0,$,Q),ee=new hl(0,0,$,Q);let oe=!1;const pe=new Mve;let ve=!1,ge=!1;const je=new rr,fe=new pt,X=new hl,ce={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let _e=!1;function le(){return v===null?se:1}let G=n;function xe(ie,Me){return t.getContext(ie,Me)}try{const ie={alpha:!0,depth:r,stencil:s,antialias:a,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:h,failIfMajorPerformanceCaveat:u};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${oJ}`),t.addEventListener("webglcontextlost",gt,!1),t.addEventListener("webglcontextrestored",ei,!1),t.addEventListener("webglcontextcreationerror",Gt,!1),G===null){const Me="webgl2";if(G=xe(Me,ie),G===null)throw xe(Me)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(ie){throw Ws("WebGLRenderer: "+ie.message),ie}let ze,Ke,we,U,N,Y,de,he,ae,Ge,Oe,tt,De,Ae,Ne,ot,rt,Xe,Tt,Z,qe,Ue,it,Fe;function Ee(){ze=new sat(G),ze.init(),Ue=new obe(G,ze),Ke=new Qot(G,ze,e,Ue),we=new Xlt(G,ze),Ke.reversedDepthBuffer&&d&&we.buffers.depth.setReversed(!0),U=new lat(G),N=new Llt,Y=new Ylt(G,ze,we,N,Ke,Ue,U),de=new Jot(T),he=new rat(T),ae=new $rt(G),it=new Xot(G,ae),Ge=new oat(G,ae,U,it),Oe=new hat(G,Ge,ae,U),Tt=new cat(G,Ke,Y),ot=new Kot(N),tt=new Rlt(T,de,he,ze,Ke,it,ot),De=new tct(T,N),Ae=new Nlt,Ne=new Hlt(ze),Xe=new qot(T,de,he,we,Oe,f,l),rt=new $lt(T,Oe,Ke),Fe=new ict(G,U,Ke,we),Z=new Yot(G,ze,U),qe=new aat(G,ze,U),U.programs=tt.programs,T.capabilities=Ke,T.extensions=ze,T.properties=N,T.renderLists=Ae,T.shadowMap=rt,T.state=we,T.info=U}Ee(),g!==af&&(C=new dat(g,t.width,t.height,r,s));const nt=new Zlt(T,G);this.xr=nt,this.getContext=function(){return G},this.getContextAttributes=function(){return G.getContextAttributes()},this.forceContextLoss=function(){const ie=ze.get("WEBGL_lose_context");ie&&ie.loseContext()},this.forceContextRestore=function(){const ie=ze.get("WEBGL_lose_context");ie&&ie.restoreContext()},this.getPixelRatio=function(){return se},this.setPixelRatio=function(ie){ie!==void 0&&(se=ie,this.setSize($,Q,!1))},this.getSize=function(ie){return ie.set($,Q)},this.setSize=function(ie,Me,Pe=!0){if(nt.isPresenting){pr("WebGLRenderer: Can't change size while VR device is presenting.");return}$=ie,Q=Me,t.width=Math.floor(ie*se),t.height=Math.floor(Me*se),Pe===!0&&(t.style.width=ie+"px",t.style.height=Me+"px"),C!==null&&C.setSize(t.width,t.height),this.setViewport(0,0,ie,Me)},this.getDrawingBufferSize=function(ie){return ie.set($*se,Q*se).floor()},this.setDrawingBufferSize=function(ie,Me,Pe){$=ie,Q=Me,se=Pe,t.width=Math.floor(ie*Pe),t.height=Math.floor(Me*Pe),this.setViewport(0,0,ie,Me)},this.setEffects=function(ie){if(g===af){console.error("THREE.WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.");return}if(ie){for(let Me=0;Me<ie.length;Me++)if(ie[Me].isOutputPass===!0){console.warn("THREE.WebGLRenderer: OutputPass is not needed in setEffects(). Tone mapping and color space conversion are applied automatically.");break}}C.setEffects(ie||[])},this.getCurrentViewport=function(ie){return ie.copy(B)},this.getViewport=function(ie){return ie.copy(V)},this.setViewport=function(ie,Me,Pe,Te){ie.isVector4?V.set(ie.x,ie.y,ie.z,ie.w):V.set(ie,Me,Pe,Te),we.viewport(B.copy(V).multiplyScalar(se).round())},this.getScissor=function(ie){return ie.copy(ee)},this.setScissor=function(ie,Me,Pe,Te){ie.isVector4?ee.set(ie.x,ie.y,ie.z,ie.w):ee.set(ie,Me,Pe,Te),we.scissor(k.copy(ee).multiplyScalar(se).round())},this.getScissorTest=function(){return oe},this.setScissorTest=function(ie){we.setScissorTest(oe=ie)},this.setOpaqueSort=function(ie){te=ie},this.setTransparentSort=function(ie){ue=ie},this.getClearColor=function(ie){return ie.copy(Xe.getClearColor())},this.setClearColor=function(){Xe.setClearColor(...arguments)},this.getClearAlpha=function(){return Xe.getClearAlpha()},this.setClearAlpha=function(){Xe.setClearAlpha(...arguments)},this.clear=function(ie=!0,Me=!0,Pe=!0){let Te=0;if(ie){let Ze=!1;if(v!==null){const me=v.texture.format;Ze=_.has(me)}if(Ze){const me=v.texture.type,ke=y.has(me),$e=Xe.getClearColor(),et=Xe.getClearAlpha(),Ye=$e.r,St=$e.g,_t=$e.b;ke?(A[0]=Ye,A[1]=St,A[2]=_t,A[3]=et,G.clearBufferuiv(G.COLOR,0,A)):(x[0]=Ye,x[1]=St,x[2]=_t,x[3]=et,G.clearBufferiv(G.COLOR,0,x))}else Te|=G.COLOR_BUFFER_BIT}Me&&(Te|=G.DEPTH_BUFFER_BIT),Pe&&(Te|=G.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),G.clear(Te)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",gt,!1),t.removeEventListener("webglcontextrestored",ei,!1),t.removeEventListener("webglcontextcreationerror",Gt,!1),Xe.dispose(),Ae.dispose(),Ne.dispose(),N.dispose(),de.dispose(),he.dispose(),Oe.dispose(),it.dispose(),Fe.dispose(),tt.dispose(),nt.dispose(),nt.removeEventListener("sessionstart",cl),nt.removeEventListener("sessionend",Kr),us.stop()};function gt(ie){ie.preventDefault(),eve("WebGLRenderer: Context Lost."),D=!0}function ei(){eve("WebGLRenderer: Context Restored."),D=!1;const ie=U.autoReset,Me=rt.enabled,Pe=rt.autoUpdate,Te=rt.needsUpdate,Ze=rt.type;Ee(),U.autoReset=ie,rt.enabled=Me,rt.autoUpdate=Pe,rt.needsUpdate=Te,rt.type=Ze}function Gt(ie){Ws("WebGLRenderer: A WebGL context could not be created. Reason: ",ie.statusMessage)}function Yi(ie){const Me=ie.target;Me.removeEventListener("dispose",Yi),Li(Me)}function Li(ie){Ds(ie),N.remove(ie)}function Ds(ie){const Me=N.get(ie).programs;Me!==void 0&&(Me.forEach(function(Pe){tt.releaseProgram(Pe)}),ie.isShaderMaterial&&tt.releaseShaderCache(ie))}this.renderBufferDirect=function(ie,Me,Pe,Te,Ze,me){Me===null&&(Me=ce);const ke=Ze.isMesh&&Ze.matrixWorld.determinant()<0,$e=sf(ie,Me,Pe,Te,Ze);we.setMaterial(Te,ke);let et=Pe.index,Ye=1;if(Te.wireframe===!0){if(et=Ge.getWireframeAttribute(Pe),et===void 0)return;Ye=2}const St=Pe.drawRange,_t=Pe.attributes.position;let Rt=St.start*Ye,$t=(St.start+St.count)*Ye;me!==null&&(Rt=Math.max(Rt,me.start*Ye),$t=Math.min($t,(me.start+me.count)*Ye)),et!==null?(Rt=Math.max(Rt,0),$t=Math.min($t,et.count)):_t!=null&&(Rt=Math.max(Rt,0),$t=Math.min($t,_t.count));const Ce=$t-Rt;if(Ce<0||Ce===1/0)return;it.setup(Ze,Te,$e,Pe,et);let be,Ve=Z;if(et!==null&&(be=ae.get(et),Ve=qe,Ve.setIndex(be)),Ze.isMesh)Te.wireframe===!0?(we.setLineWidth(Te.wireframeLinewidth*le()),Ve.setMode(G.LINES)):Ve.setMode(G.TRIANGLES);else if(Ze.isLine){let Re=Te.linewidth;Re===void 0&&(Re=1),we.setLineWidth(Re*le()),Ze.isLineSegments?Ve.setMode(G.LINES):Ze.isLineLoop?Ve.setMode(G.LINE_LOOP):Ve.setMode(G.LINE_STRIP)}else Ze.isPoints?Ve.setMode(G.POINTS):Ze.isSprite&&Ve.setMode(G.TRIANGLES);if(Ze.isBatchedMesh)if(Ze._multiDrawInstances!==null)GL("WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),Ve.renderMultiDrawInstances(Ze._multiDrawStarts,Ze._multiDrawCounts,Ze._multiDrawCount,Ze._multiDrawInstances);else if(ze.get("WEBGL_multi_draw"))Ve.renderMultiDraw(Ze._multiDrawStarts,Ze._multiDrawCounts,Ze._multiDrawCount);else{const Re=Ze._multiDrawStarts,bt=Ze._multiDrawCounts,Ct=Ze._multiDrawCount,Lt=et?ae.get(et).bytesPerElement:1,Ie=N.get(Te).currentProgram.getUniforms();for(let lt=0;lt<Ct;lt++)Ie.setValue(G,"_gl_DrawID",lt),Ve.render(Re[lt]/Lt,bt[lt])}else if(Ze.isInstancedMesh)Ve.renderInstances(Rt,Ce,Ze.count);else if(Pe.isInstancedBufferGeometry){const Re=Pe._maxInstanceCount!==void 0?Pe._maxInstanceCount:1/0,bt=Math.min(Pe.instanceCount,Re);Ve.renderInstances(Rt,Ce,bt)}else Ve.render(Rt,Ce)};function so(ie,Me,Pe){ie.transparent===!0&&ie.side===gm&&ie.forceSinglePass===!1?(ie.side=lp,ie.needsUpdate=!0,ds(ie,Me,Pe),ie.side=f_,ie.needsUpdate=!0,ds(ie,Me,Pe),ie.side=gm):ds(ie,Me,Pe)}this.compile=function(ie,Me,Pe=null){Pe===null&&(Pe=ie),E=Ne.get(Pe),E.init(Me),I.push(E),Pe.traverseVisible(function(Ze){Ze.isLight&&Ze.layers.test(Me.layers)&&(E.pushLight(Ze),Ze.castShadow&&E.pushShadow(Ze))}),ie!==Pe&&ie.traverseVisible(function(Ze){Ze.isLight&&Ze.layers.test(Me.layers)&&(E.pushLight(Ze),Ze.castShadow&&E.pushShadow(Ze))}),E.setupLights();const Te=new Set;return ie.traverse(function(Ze){if(!(Ze.isMesh||Ze.isPoints||Ze.isLine||Ze.isSprite))return;const me=Ze.material;if(me)if(Array.isArray(me))for(let ke=0;ke<me.length;ke++){const $e=me[ke];so($e,Pe,Ze),Te.add($e)}else so(me,Pe,Ze),Te.add(me)}),E=I.pop(),Te},this.compileAsync=function(ie,Me,Pe=null){const Te=this.compile(ie,Me,Pe);return new Promise(Ze=>{function me(){if(Te.forEach(function(ke){N.get(ke).currentProgram.isReady()&&Te.delete(ke)}),Te.size===0){Ze(ie);return}setTimeout(me,10)}ze.get("KHR_parallel_shader_compile")!==null?me():setTimeout(me,10)})};let ha=null;function Co(ie){ha&&ha(ie)}function cl(){us.stop()}function Kr(){us.start()}const us=new Rve;us.setAnimationLoop(Co),typeof self<"u"&&us.setContext(self),this.setAnimationLoop=function(ie){ha=ie,nt.setAnimationLoop(ie),ie===null?us.stop():us.start()},nt.addEventListener("sessionstart",cl),nt.addEventListener("sessionend",Kr),this.render=function(ie,Me){if(Me!==void 0&&Me.isCamera!==!0){Ws("WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(D===!0)return;const Pe=nt.enabled===!0&&nt.isPresenting===!0,Te=C!==null&&(v===null||Pe)&&C.begin(T,v);if(ie.matrixWorldAutoUpdate===!0&&ie.updateMatrixWorld(),Me.parent===null&&Me.matrixWorldAutoUpdate===!0&&Me.updateMatrixWorld(),nt.enabled===!0&&nt.isPresenting===!0&&(C===null||C.isCompositing()===!1)&&(nt.cameraAutoUpdate===!0&&nt.updateCamera(Me),Me=nt.getCamera()),ie.isScene===!0&&ie.onBeforeRender(T,ie,Me,v),E=Ne.get(ie,I.length),E.init(Me),I.push(E),je.multiplyMatrices(Me.projectionMatrix,Me.matrixWorldInverse),pe.setFromProjectionMatrix(je,y_,Me.reversedDepth),ge=this.localClippingEnabled,ve=ot.init(this.clippingPlanes,ge),w=Ae.get(ie,S.length),w.init(),S.push(w),nt.enabled===!0&&nt.isPresenting===!0){const ke=T.xr.getDepthSensingMesh();ke!==null&&nr(ke,Me,-1/0,T.sortObjects)}nr(ie,Me,0,T.sortObjects),w.finish(),T.sortObjects===!0&&w.sort(te,ue),_e=nt.enabled===!1||nt.isPresenting===!1||nt.hasDepthSensing()===!1,_e&&Xe.addToRenderList(w,ie),this.info.render.frame++,ve===!0&&ot.beginShadows();const Ze=E.state.shadowsArray;if(rt.render(Ze,ie,Me),ve===!0&&ot.endShadows(),this.info.autoReset===!0&&this.info.reset(),(Te&&C.hasRenderPass())===!1){const ke=w.opaque,$e=w.transmissive;if(E.setupLights(),Me.isArrayCamera){const et=Me.cameras;if($e.length>0)for(let Ye=0,St=et.length;Ye<St;Ye++){const _t=et[Ye];go(ke,$e,ie,_t)}_e&&Xe.render(ie);for(let Ye=0,St=et.length;Ye<St;Ye++){const _t=et[Ye];Jr(w,ie,_t,_t.viewport)}}else $e.length>0&&go(ke,$e,ie,Me),_e&&Xe.render(ie),Jr(w,ie,Me)}v!==null&&R===0&&(Y.updateMultisampleRenderTarget(v),Y.updateRenderTargetMipmap(v)),Te&&C.end(T),ie.isScene===!0&&ie.onAfterRender(T,ie,Me),it.resetDefaultState(),P=-1,O=null,I.pop(),I.length>0?(E=I[I.length-1],ve===!0&&ot.setGlobalState(T.clippingPlanes,E.state.camera)):E=null,S.pop(),S.length>0?w=S[S.length-1]:w=null};function nr(ie,Me,Pe,Te){if(ie.visible===!1)return;if(ie.layers.test(Me.layers)){if(ie.isGroup)Pe=ie.renderOrder;else if(ie.isLOD)ie.autoUpdate===!0&&ie.update(Me);else if(ie.isLight)E.pushLight(ie),ie.castShadow&&E.pushShadow(ie);else if(ie.isSprite){if(!ie.frustumCulled||pe.intersectsSprite(ie)){Te&&X.setFromMatrixPosition(ie.matrixWorld).applyMatrix4(je);const ke=Oe.update(ie),$e=ie.material;$e.visible&&w.push(ie,ke,$e,Pe,X.z,null)}}else if((ie.isMesh||ie.isLine||ie.isPoints)&&(!ie.frustumCulled||pe.intersectsObject(ie))){const ke=Oe.update(ie),$e=ie.material;if(Te&&(ie.boundingSphere!==void 0?(ie.boundingSphere===null&&ie.computeBoundingSphere(),X.copy(ie.boundingSphere.center)):(ke.boundingSphere===null&&ke.computeBoundingSphere(),X.copy(ke.boundingSphere.center)),X.applyMatrix4(ie.matrixWorld).applyMatrix4(je)),Array.isArray($e)){const et=ke.groups;for(let Ye=0,St=et.length;Ye<St;Ye++){const _t=et[Ye],Rt=$e[_t.materialIndex];Rt&&Rt.visible&&w.push(ie,ke,Rt,Pe,X.z,_t)}}else $e.visible&&w.push(ie,ke,$e,Pe,X.z,null)}}const me=ie.children;for(let ke=0,$e=me.length;ke<$e;ke++)nr(me[ke],Me,Pe,Te)}function Jr(ie,Me,Pe,Te){const{opaque:Ze,transmissive:me,transparent:ke}=ie;E.setupLightsView(Pe),ve===!0&&ot.setGlobalState(T.clippingPlanes,Pe),Te&&we.viewport(B.copy(Te)),Ze.length>0&&Es(Ze,Me,Pe),me.length>0&&Es(me,Me,Pe),ke.length>0&&Es(ke,Me,Pe),we.buffers.depth.setTest(!0),we.buffers.depth.setMask(!0),we.buffers.color.setMask(!0),we.setPolygonOffset(!1)}function go(ie,Me,Pe,Te){if((Pe.isScene===!0?Pe.overrideMaterial:null)!==null)return;if(E.state.transmissionRenderTarget[Te.id]===void 0){const Rt=ze.has("EXT_color_buffer_half_float")||ze.has("EXT_color_buffer_float");E.state.transmissionRenderTarget[Te.id]=new zg(1,1,{generateMipmaps:!0,type:Rt?g_:af,minFilter:yE,samples:Ke.samples,stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:Rs.workingColorSpace})}const me=E.state.transmissionRenderTarget[Te.id],ke=Te.viewport||B;me.setSize(ke.z*T.transmissionResolutionScale,ke.w*T.transmissionResolutionScale);const $e=T.getRenderTarget(),et=T.getActiveCubeFace(),Ye=T.getActiveMipmapLevel();T.setRenderTarget(me),T.getClearColor(z),j=T.getClearAlpha(),j<1&&T.setClearColor(16777215,.5),T.clear(),_e&&Xe.render(Pe);const St=T.toneMapping;T.toneMapping=m_;const _t=Te.viewport;if(Te.viewport!==void 0&&(Te.viewport=void 0),E.setupLightsView(Te),ve===!0&&ot.setGlobalState(T.clippingPlanes,Te),Es(ie,Pe,Te),Y.updateMultisampleRenderTarget(me),Y.updateRenderTargetMipmap(me),ze.has("WEBGL_multisampled_render_to_texture")===!1){let Rt=!1;for(let $t=0,Ce=Me.length;$t<Ce;$t++){const be=Me[$t],{object:Ve,geometry:Re,material:bt,group:Ct}=be;if(bt.side===gm&&Ve.layers.test(Te.layers)){const Lt=bt.side;bt.side=lp,bt.needsUpdate=!0,Rr(Ve,Pe,Te,Re,bt,Ct),bt.side=Lt,bt.needsUpdate=!0,Rt=!0}}Rt===!0&&(Y.updateMultisampleRenderTarget(me),Y.updateRenderTargetMipmap(me))}T.setRenderTarget($e,et,Ye),T.setClearColor(z,j),_t!==void 0&&(Te.viewport=_t),T.toneMapping=St}function Es(ie,Me,Pe){const Te=Me.isScene===!0?Me.overrideMaterial:null;for(let Ze=0,me=ie.length;Ze<me;Ze++){const ke=ie[Ze],{object:$e,geometry:et,group:Ye}=ke;let St=ke.material;St.allowOverride===!0&&Te!==null&&(St=Te),$e.layers.test(Pe.layers)&&Rr($e,Me,Pe,et,St,Ye)}}function Rr(ie,Me,Pe,Te,Ze,me){ie.onBeforeRender(T,Me,Pe,Te,Ze,me),ie.modelViewMatrix.multiplyMatrices(Pe.matrixWorldInverse,ie.matrixWorld),ie.normalMatrix.getNormalMatrix(ie.modelViewMatrix),Ze.onBeforeRender(T,Me,Pe,Te,ie,me),Ze.transparent===!0&&Ze.side===gm&&Ze.forceSinglePass===!1?(Ze.side=lp,Ze.needsUpdate=!0,T.renderBufferDirect(Pe,Me,Te,Ze,ie,me),Ze.side=f_,Ze.needsUpdate=!0,T.renderBufferDirect(Pe,Me,Te,Ze,ie,me),Ze.side=gm):T.renderBufferDirect(Pe,Me,Te,Ze,ie,me),ie.onAfterRender(T,Me,Pe,Te,Ze,me)}function ds(ie,Me,Pe){Me.isScene!==!0&&(Me=ce);const Te=N.get(ie),Ze=E.state.lights,me=E.state.shadowsArray,ke=Ze.state.version,$e=tt.getParameters(ie,Ze.state,me,Me,Pe),et=tt.getProgramCacheKey($e);let Ye=Te.programs;Te.environment=ie.isMeshStandardMaterial?Me.environment:null,Te.fog=Me.fog,Te.envMap=(ie.isMeshStandardMaterial?he:de).get(ie.envMap||Te.environment),Te.envMapRotation=Te.environment!==null&&ie.envMap===null?Me.environmentRotation:ie.envMapRotation,Ye===void 0&&(ie.addEventListener("dispose",Yi),Ye=new Map,Te.programs=Ye);let St=Ye.get(et);if(St!==void 0){if(Te.currentProgram===St&&Te.lightsStateVersion===ke)return sp(ie,$e),St}else $e.uniforms=tt.getUniforms(ie),ie.onBeforeCompile($e,T),St=tt.acquireProgram($e,et),Ye.set(et,St),Te.uniforms=$e.uniforms;const _t=Te.uniforms;return(!ie.isShaderMaterial&&!ie.isRawShaderMaterial||ie.clipping===!0)&&(_t.clippingPlanes=ot.uniform),sp(ie,$e),Te.needsLights=of(ie),Te.lightsStateVersion=ke,Te.needsLights&&(_t.ambientLightColor.value=Ze.state.ambient,_t.lightProbe.value=Ze.state.probe,_t.directionalLights.value=Ze.state.directional,_t.directionalLightShadows.value=Ze.state.directionalShadow,_t.spotLights.value=Ze.state.spot,_t.spotLightShadows.value=Ze.state.spotShadow,_t.rectAreaLights.value=Ze.state.rectArea,_t.ltc_1.value=Ze.state.rectAreaLTC1,_t.ltc_2.value=Ze.state.rectAreaLTC2,_t.pointLights.value=Ze.state.point,_t.pointLightShadows.value=Ze.state.pointShadow,_t.hemisphereLights.value=Ze.state.hemi,_t.directionalShadowMap.value=Ze.state.directionalShadowMap,_t.directionalShadowMatrix.value=Ze.state.directionalShadowMatrix,_t.spotShadowMap.value=Ze.state.spotShadowMap,_t.spotLightMatrix.value=Ze.state.spotLightMatrix,_t.spotLightMap.value=Ze.state.spotLightMap,_t.pointShadowMap.value=Ze.state.pointShadowMap,_t.pointShadowMatrix.value=Ze.state.pointShadowMatrix),Te.currentProgram=St,Te.uniformsList=null,St}function $a(ie){if(ie.uniformsList===null){const Me=ie.currentProgram.getUniforms();ie.uniformsList=l8.seqWithValue(Me.seq,ie.uniforms)}return ie.uniformsList}function sp(ie,Me){const Pe=N.get(ie);Pe.outputColorSpace=Me.outputColorSpace,Pe.batching=Me.batching,Pe.batchingColor=Me.batchingColor,Pe.instancing=Me.instancing,Pe.instancingColor=Me.instancingColor,Pe.instancingMorph=Me.instancingMorph,Pe.skinning=Me.skinning,Pe.morphTargets=Me.morphTargets,Pe.morphNormals=Me.morphNormals,Pe.morphColors=Me.morphColors,Pe.morphTargetsCount=Me.morphTargetsCount,Pe.numClippingPlanes=Me.numClippingPlanes,Pe.numIntersection=Me.numClipIntersection,Pe.vertexAlphas=Me.vertexAlphas,Pe.vertexTangents=Me.vertexTangents,Pe.toneMapping=Me.toneMapping}function sf(ie,Me,Pe,Te,Ze){Me.isScene!==!0&&(Me=ce),Y.resetTextureUnits();const me=Me.fog,ke=Te.isMeshStandardMaterial?Me.environment:null,$e=v===null?T.outputColorSpace:v.isXRRenderTarget===!0?v.texture.colorSpace:wI,et=(Te.isMeshStandardMaterial?he:de).get(Te.envMap||ke),Ye=Te.vertexColors===!0&&!!Pe.attributes.color&&Pe.attributes.color.itemSize===4,St=!!Pe.attributes.tangent&&(!!Te.normalMap||Te.anisotropy>0),_t=!!Pe.morphAttributes.position,Rt=!!Pe.morphAttributes.normal,$t=!!Pe.morphAttributes.color;let Ce=m_;Te.toneMapped&&(v===null||v.isXRRenderTarget===!0)&&(Ce=T.toneMapping);const be=Pe.morphAttributes.position||Pe.morphAttributes.normal||Pe.morphAttributes.color,Ve=be!==void 0?be.length:0,Re=N.get(Te),bt=E.state.lights;if(ve===!0&&(ge===!0||ie!==O)){const si=ie===O&&Te.id===P;ot.setState(Te,ie,si)}let Ct=!1;Te.version===Re.__version?(Re.needsLights&&Re.lightsStateVersion!==bt.state.version||Re.outputColorSpace!==$e||Ze.isBatchedMesh&&Re.batching===!1||!Ze.isBatchedMesh&&Re.batching===!0||Ze.isBatchedMesh&&Re.batchingColor===!0&&Ze.colorTexture===null||Ze.isBatchedMesh&&Re.batchingColor===!1&&Ze.colorTexture!==null||Ze.isInstancedMesh&&Re.instancing===!1||!Ze.isInstancedMesh&&Re.instancing===!0||Ze.isSkinnedMesh&&Re.skinning===!1||!Ze.isSkinnedMesh&&Re.skinning===!0||Ze.isInstancedMesh&&Re.instancingColor===!0&&Ze.instanceColor===null||Ze.isInstancedMesh&&Re.instancingColor===!1&&Ze.instanceColor!==null||Ze.isInstancedMesh&&Re.instancingMorph===!0&&Ze.morphTexture===null||Ze.isInstancedMesh&&Re.instancingMorph===!1&&Ze.morphTexture!==null||Re.envMap!==et||Te.fog===!0&&Re.fog!==me||Re.numClippingPlanes!==void 0&&(Re.numClippingPlanes!==ot.numPlanes||Re.numIntersection!==ot.numIntersection)||Re.vertexAlphas!==Ye||Re.vertexTangents!==St||Re.morphTargets!==_t||Re.morphNormals!==Rt||Re.morphColors!==$t||Re.toneMapping!==Ce||Re.morphTargetsCount!==Ve)&&(Ct=!0):(Ct=!0,Re.__version=Te.version);let Lt=Re.currentProgram;Ct===!0&&(Lt=ds(Te,Me,Ze));let Ie=!1,lt=!1,Pt=!1;const wt=Lt.getUniforms(),ti=Re.uniforms;if(we.useProgram(Lt.program)&&(Ie=!0,lt=!0,Pt=!0),Te.id!==P&&(P=Te.id,lt=!0),Ie||O!==ie){we.buffers.depth.getReversed()&&ie.reversedDepth!==!0&&(ie._reversedDepth=!0,ie.updateProjectionMatrix()),wt.setValue(G,"projectionMatrix",ie.projectionMatrix),wt.setValue(G,"viewMatrix",ie.matrixWorldInverse);const An=wt.map.cameraPosition;An!==void 0&&An.setValue(G,fe.setFromMatrixPosition(ie.matrixWorld)),Ke.logarithmicDepthBuffer&&wt.setValue(G,"logDepthBufFC",2/(Math.log(ie.far+1)/Math.LN2)),(Te.isMeshPhongMaterial||Te.isMeshToonMaterial||Te.isMeshLambertMaterial||Te.isMeshBasicMaterial||Te.isMeshStandardMaterial||Te.isShaderMaterial)&&wt.setValue(G,"isOrthographic",ie.isOrthographicCamera===!0),O!==ie&&(O=ie,lt=!0,Pt=!0)}if(Re.needsLights&&(bt.state.directionalShadowMap.length>0&&wt.setValue(G,"directionalShadowMap",bt.state.directionalShadowMap,Y),bt.state.spotShadowMap.length>0&&wt.setValue(G,"spotShadowMap",bt.state.spotShadowMap,Y),bt.state.pointShadowMap.length>0&&wt.setValue(G,"pointShadowMap",bt.state.pointShadowMap,Y)),Ze.isSkinnedMesh){wt.setOptional(G,Ze,"bindMatrix"),wt.setOptional(G,Ze,"bindMatrixInverse");const si=Ze.skeleton;si&&(si.boneTexture===null&&si.computeBoneTexture(),wt.setValue(G,"boneTexture",si.boneTexture,Y))}Ze.isBatchedMesh&&(wt.setOptional(G,Ze,"batchingTexture"),wt.setValue(G,"batchingTexture",Ze._matricesTexture,Y),wt.setOptional(G,Ze,"batchingIdTexture"),wt.setValue(G,"batchingIdTexture",Ze._indirectTexture,Y),wt.setOptional(G,Ze,"batchingColorTexture"),Ze._colorsTexture!==null&&wt.setValue(G,"batchingColorTexture",Ze._colorsTexture,Y));const Ti=Pe.morphAttributes;if((Ti.position!==void 0||Ti.normal!==void 0||Ti.color!==void 0)&&Tt.update(Ze,Pe,Lt),(lt||Re.receiveShadow!==Ze.receiveShadow)&&(Re.receiveShadow=Ze.receiveShadow,wt.setValue(G,"receiveShadow",Ze.receiveShadow)),Te.isMeshGouraudMaterial&&Te.envMap!==null&&(ti.envMap.value=et,ti.flipEnvMap.value=et.isCubeTexture&&et.isRenderTargetTexture===!1?-1:1),Te.isMeshStandardMaterial&&Te.envMap===null&&Me.environment!==null&&(ti.envMapIntensity.value=Me.environmentIntensity),ti.dfgLUT!==void 0&&(ti.dfgLUT.value=rct()),lt&&(wt.setValue(G,"toneMappingExposure",T.toneMappingExposure),Re.needsLights&&kg(ti,Pt),me&&Te.fog===!0&&De.refreshFogUniforms(ti,me),De.refreshMaterialUniforms(ti,Te,se,Q,E.state.transmissionRenderTarget[ie.id]),l8.upload(G,$a(Re),ti,Y)),Te.isShaderMaterial&&Te.uniformsNeedUpdate===!0&&(l8.upload(G,$a(Re),ti,Y),Te.uniformsNeedUpdate=!1),Te.isSpriteMaterial&&wt.setValue(G,"center",Ze.center),wt.setValue(G,"modelViewMatrix",Ze.modelViewMatrix),wt.setValue(G,"normalMatrix",Ze.normalMatrix),wt.setValue(G,"modelMatrix",Ze.matrixWorld),Te.isShaderMaterial||Te.isRawShaderMaterial){const si=Te.uniformsGroups;for(let An=0,mn=si.length;An<mn;An++){const kn=si[An];Fe.update(kn,Lt),Fe.bind(kn,Lt)}}return Lt}function kg(ie,Me){ie.ambientLightColor.needsUpdate=Me,ie.lightProbe.needsUpdate=Me,ie.directionalLights.needsUpdate=Me,ie.directionalLightShadows.needsUpdate=Me,ie.pointLights.needsUpdate=Me,ie.pointLightShadows.needsUpdate=Me,ie.spotLights.needsUpdate=Me,ie.spotLightShadows.needsUpdate=Me,ie.rectAreaLights.needsUpdate=Me,ie.hemisphereLights.needsUpdate=Me}function of(ie){return ie.isMeshLambertMaterial||ie.isMeshToonMaterial||ie.isMeshPhongMaterial||ie.isMeshStandardMaterial||ie.isShadowMaterial||ie.isShaderMaterial&&ie.lights===!0}this.getActiveCubeFace=function(){return M},this.getActiveMipmapLevel=function(){return R},this.getRenderTarget=function(){return v},this.setRenderTargetTextures=function(ie,Me,Pe){const Te=N.get(ie);Te.__autoAllocateDepthBuffer=ie.resolveDepthBuffer===!1,Te.__autoAllocateDepthBuffer===!1&&(Te.__useRenderToTexture=!1),N.get(ie.texture).__webglTexture=Me,N.get(ie.depthTexture).__webglTexture=Te.__autoAllocateDepthBuffer?void 0:Pe,Te.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(ie,Me){const Pe=N.get(ie);Pe.__webglFramebuffer=Me,Pe.__useDefaultFramebuffer=Me===void 0};const Cc=G.createFramebuffer();this.setRenderTarget=function(ie,Me=0,Pe=0){v=ie,M=Me,R=Pe;let Te=null,Ze=!1,me=!1;if(ie){const $e=N.get(ie);if($e.__useDefaultFramebuffer!==void 0){we.bindFramebuffer(G.FRAMEBUFFER,$e.__webglFramebuffer),B.copy(ie.viewport),k.copy(ie.scissor),H=ie.scissorTest,we.viewport(B),we.scissor(k),we.setScissorTest(H),P=-1;return}else if($e.__webglFramebuffer===void 0)Y.setupRenderTarget(ie);else if($e.__hasExternalTextures)Y.rebindTextures(ie,N.get(ie.texture).__webglTexture,N.get(ie.depthTexture).__webglTexture);else if(ie.depthBuffer){const St=ie.depthTexture;if($e.__boundDepthTexture!==St){if(St!==null&&N.has(St)&&(ie.width!==St.image.width||ie.height!==St.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");Y.setupDepthRenderbuffer(ie)}}const et=ie.texture;(et.isData3DTexture||et.isDataArrayTexture||et.isCompressedArrayTexture)&&(me=!0);const Ye=N.get(ie).__webglFramebuffer;ie.isWebGLCubeRenderTarget?(Array.isArray(Ye[Me])?Te=Ye[Me][Pe]:Te=Ye[Me],Ze=!0):ie.samples>0&&Y.useMultisampledRTT(ie)===!1?Te=N.get(ie).__webglMultisampledFramebuffer:Array.isArray(Ye)?Te=Ye[Pe]:Te=Ye,B.copy(ie.viewport),k.copy(ie.scissor),H=ie.scissorTest}else B.copy(V).multiplyScalar(se).floor(),k.copy(ee).multiplyScalar(se).floor(),H=oe;if(Pe!==0&&(Te=Cc),we.bindFramebuffer(G.FRAMEBUFFER,Te)&&we.drawBuffers(ie,Te),we.viewport(B),we.scissor(k),we.setScissorTest(H),Ze){const $e=N.get(ie.texture);G.framebufferTexture2D(G.FRAMEBUFFER,G.COLOR_ATTACHMENT0,G.TEXTURE_CUBE_MAP_POSITIVE_X+Me,$e.__webglTexture,Pe)}else if(me){const $e=Me;for(let et=0;et<ie.textures.length;et++){const Ye=N.get(ie.textures[et]);G.framebufferTextureLayer(G.FRAMEBUFFER,G.COLOR_ATTACHMENT0+et,Ye.__webglTexture,Pe,$e)}}else if(ie!==null&&Pe!==0){const $e=N.get(ie.texture);G.framebufferTexture2D(G.FRAMEBUFFER,G.COLOR_ATTACHMENT0,G.TEXTURE_2D,$e.__webglTexture,Pe)}P=-1},this.readRenderTargetPixels=function(ie,Me,Pe,Te,Ze,me,ke,$e=0){if(!(ie&&ie.isWebGLRenderTarget)){Ws("WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let et=N.get(ie).__webglFramebuffer;if(ie.isWebGLCubeRenderTarget&&ke!==void 0&&(et=et[ke]),et){we.bindFramebuffer(G.FRAMEBUFFER,et);try{const Ye=ie.textures[$e],St=Ye.format,_t=Ye.type;if(!Ke.textureFormatReadable(St)){Ws("WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!Ke.textureTypeReadable(_t)){Ws("WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}Me>=0&&Me<=ie.width-Te&&Pe>=0&&Pe<=ie.height-Ze&&(ie.textures.length>1&&G.readBuffer(G.COLOR_ATTACHMENT0+$e),G.readPixels(Me,Pe,Te,Ze,Ue.convert(St),Ue.convert(_t),me))}finally{const Ye=v!==null?N.get(v).__webglFramebuffer:null;we.bindFramebuffer(G.FRAMEBUFFER,Ye)}}},this.readRenderTargetPixelsAsync=async function(ie,Me,Pe,Te,Ze,me,ke,$e=0){if(!(ie&&ie.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let et=N.get(ie).__webglFramebuffer;if(ie.isWebGLCubeRenderTarget&&ke!==void 0&&(et=et[ke]),et)if(Me>=0&&Me<=ie.width-Te&&Pe>=0&&Pe<=ie.height-Ze){we.bindFramebuffer(G.FRAMEBUFFER,et);const Ye=ie.textures[$e],St=Ye.format,_t=Ye.type;if(!Ke.textureFormatReadable(St))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!Ke.textureTypeReadable(_t))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const Rt=G.createBuffer();G.bindBuffer(G.PIXEL_PACK_BUFFER,Rt),G.bufferData(G.PIXEL_PACK_BUFFER,me.byteLength,G.STREAM_READ),ie.textures.length>1&&G.readBuffer(G.COLOR_ATTACHMENT0+$e),G.readPixels(Me,Pe,Te,Ze,Ue.convert(St),Ue.convert(_t),0);const $t=v!==null?N.get(v).__webglFramebuffer:null;we.bindFramebuffer(G.FRAMEBUFFER,$t);const Ce=G.fenceSync(G.SYNC_GPU_COMMANDS_COMPLETE,0);return G.flush(),await srt(G,Ce,4),G.bindBuffer(G.PIXEL_PACK_BUFFER,Rt),G.getBufferSubData(G.PIXEL_PACK_BUFFER,0,me),G.deleteBuffer(Rt),G.deleteSync(Ce),me}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(ie,Me=null,Pe=0){const Te=Math.pow(2,-Pe),Ze=Math.floor(ie.image.width*Te),me=Math.floor(ie.image.height*Te),ke=Me!==null?Me.x:0,$e=Me!==null?Me.y:0;Y.setTexture2D(ie,0),G.copyTexSubImage2D(G.TEXTURE_2D,Pe,0,0,ke,$e,Ze,me),we.unbindTexture()};const mm=G.createFramebuffer(),ne=G.createFramebuffer();this.copyTextureToTexture=function(ie,Me,Pe=null,Te=null,Ze=0,me=null){me===null&&(Ze!==0?(GL("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),me=Ze,Ze=0):me=0);let ke,$e,et,Ye,St,_t,Rt,$t,Ce;const be=ie.isCompressedTexture?ie.mipmaps[me]:ie.image;if(Pe!==null)ke=Pe.max.x-Pe.min.x,$e=Pe.max.y-Pe.min.y,et=Pe.isBox3?Pe.max.z-Pe.min.z:1,Ye=Pe.min.x,St=Pe.min.y,_t=Pe.isBox3?Pe.min.z:0;else{const Ti=Math.pow(2,-Ze);ke=Math.floor(be.width*Ti),$e=Math.floor(be.height*Ti),ie.isDataArrayTexture?et=be.depth:ie.isData3DTexture?et=Math.floor(be.depth*Ti):et=1,Ye=0,St=0,_t=0}Te!==null?(Rt=Te.x,$t=Te.y,Ce=Te.z):(Rt=0,$t=0,Ce=0);const Ve=Ue.convert(Me.format),Re=Ue.convert(Me.type);let bt;Me.isData3DTexture?(Y.setTexture3D(Me,0),bt=G.TEXTURE_3D):Me.isDataArrayTexture||Me.isCompressedArrayTexture?(Y.setTexture2DArray(Me,0),bt=G.TEXTURE_2D_ARRAY):(Y.setTexture2D(Me,0),bt=G.TEXTURE_2D),G.pixelStorei(G.UNPACK_FLIP_Y_WEBGL,Me.flipY),G.pixelStorei(G.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Me.premultiplyAlpha),G.pixelStorei(G.UNPACK_ALIGNMENT,Me.unpackAlignment);const Ct=G.getParameter(G.UNPACK_ROW_LENGTH),Lt=G.getParameter(G.UNPACK_IMAGE_HEIGHT),Ie=G.getParameter(G.UNPACK_SKIP_PIXELS),lt=G.getParameter(G.UNPACK_SKIP_ROWS),Pt=G.getParameter(G.UNPACK_SKIP_IMAGES);G.pixelStorei(G.UNPACK_ROW_LENGTH,be.width),G.pixelStorei(G.UNPACK_IMAGE_HEIGHT,be.height),G.pixelStorei(G.UNPACK_SKIP_PIXELS,Ye),G.pixelStorei(G.UNPACK_SKIP_ROWS,St),G.pixelStorei(G.UNPACK_SKIP_IMAGES,_t);const wt=ie.isDataArrayTexture||ie.isData3DTexture,ti=Me.isDataArrayTexture||Me.isData3DTexture;if(ie.isDepthTexture){const Ti=N.get(ie),si=N.get(Me),An=N.get(Ti.__renderTarget),mn=N.get(si.__renderTarget);we.bindFramebuffer(G.READ_FRAMEBUFFER,An.__webglFramebuffer),we.bindFramebuffer(G.DRAW_FRAMEBUFFER,mn.__webglFramebuffer);for(let kn=0;kn<et;kn++)wt&&(G.framebufferTextureLayer(G.READ_FRAMEBUFFER,G.COLOR_ATTACHMENT0,N.get(ie).__webglTexture,Ze,_t+kn),G.framebufferTextureLayer(G.DRAW_FRAMEBUFFER,G.COLOR_ATTACHMENT0,N.get(Me).__webglTexture,me,Ce+kn)),G.blitFramebuffer(Ye,St,ke,$e,Rt,$t,ke,$e,G.DEPTH_BUFFER_BIT,G.NEAREST);we.bindFramebuffer(G.READ_FRAMEBUFFER,null),we.bindFramebuffer(G.DRAW_FRAMEBUFFER,null)}else if(Ze!==0||ie.isRenderTargetTexture||N.has(ie)){const Ti=N.get(ie),si=N.get(Me);we.bindFramebuffer(G.READ_FRAMEBUFFER,mm),we.bindFramebuffer(G.DRAW_FRAMEBUFFER,ne);for(let An=0;An<et;An++)wt?G.framebufferTextureLayer(G.READ_FRAMEBUFFER,G.COLOR_ATTACHMENT0,Ti.__webglTexture,Ze,_t+An):G.framebufferTexture2D(G.READ_FRAMEBUFFER,G.COLOR_ATTACHMENT0,G.TEXTURE_2D,Ti.__webglTexture,Ze),ti?G.framebufferTextureLayer(G.DRAW_FRAMEBUFFER,G.COLOR_ATTACHMENT0,si.__webglTexture,me,Ce+An):G.framebufferTexture2D(G.DRAW_FRAMEBUFFER,G.COLOR_ATTACHMENT0,G.TEXTURE_2D,si.__webglTexture,me),Ze!==0?G.blitFramebuffer(Ye,St,ke,$e,Rt,$t,ke,$e,G.COLOR_BUFFER_BIT,G.NEAREST):ti?G.copyTexSubImage3D(bt,me,Rt,$t,Ce+An,Ye,St,ke,$e):G.copyTexSubImage2D(bt,me,Rt,$t,Ye,St,ke,$e);we.bindFramebuffer(G.READ_FRAMEBUFFER,null),we.bindFramebuffer(G.DRAW_FRAMEBUFFER,null)}else ti?ie.isDataTexture||ie.isData3DTexture?G.texSubImage3D(bt,me,Rt,$t,Ce,ke,$e,et,Ve,Re,be.data):Me.isCompressedArrayTexture?G.compressedTexSubImage3D(bt,me,Rt,$t,Ce,ke,$e,et,Ve,be.data):G.texSubImage3D(bt,me,Rt,$t,Ce,ke,$e,et,Ve,Re,be):ie.isDataTexture?G.texSubImage2D(G.TEXTURE_2D,me,Rt,$t,ke,$e,Ve,Re,be.data):ie.isCompressedTexture?G.compressedTexSubImage2D(G.TEXTURE_2D,me,Rt,$t,be.width,be.height,Ve,be.data):G.texSubImage2D(G.TEXTURE_2D,me,Rt,$t,ke,$e,Ve,Re,be);G.pixelStorei(G.UNPACK_ROW_LENGTH,Ct),G.pixelStorei(G.UNPACK_IMAGE_HEIGHT,Lt),G.pixelStorei(G.UNPACK_SKIP_PIXELS,Ie),G.pixelStorei(G.UNPACK_SKIP_ROWS,lt),G.pixelStorei(G.UNPACK_SKIP_IMAGES,Pt),me===0&&Me.generateMipmaps&&G.generateMipmap(bt),we.unbindTexture()},this.initRenderTarget=function(ie){N.get(ie).__webglFramebuffer===void 0&&Y.setupRenderTarget(ie)},this.initTexture=function(ie){ie.isCubeTexture?Y.setTextureCube(ie,0):ie.isData3DTexture?Y.setTexture3D(ie,0):ie.isDataArrayTexture||ie.isCompressedArrayTexture?Y.setTexture2DArray(ie,0):Y.setTexture2D(ie,0),we.unbindTexture()},this.resetState=function(){M=0,R=0,v=null,we.reset(),it.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return y_}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=Rs._getDrawingBufferColorSpace(e),t.unpackColorSpace=Rs._getUnpackColorSpace()}};const UZ="__BIM_ENGINE_SDK_ASSET_BASE__",oct="https://unpkg.com/iflow-engine-base@3.9.20/dist/";function abe(){return typeof globalThis<"u"?globalThis:null}function h8(i){return i.endsWith("/")?i:`${i}/`}function lbe(i){return/^(?:[a-z][a-z\d+\-.]*:)?\/\//i.test(i)||/^(?:data|blob):/i.test(i)}function act(i){return i.startsWith("./")||i.startsWith("../")}function u8(i,e){try{return e?new URL(i,e).toString():new URL(i).toString()}catch{return null}}function cbe(){return typeof document<"u"&&document.baseURI?document.baseURI:typeof location<"u"&&location.href?location.href:null}function lct(i,e){const t=h8(i);if(lbe(t))return t;const n=d8(e)||cct()||cbe();return u8(t,n||void 0)||t}function d8(i){if(!i)return null;try{const e=cbe(),t=u8(i,e||void 0)||i,n=new URL(".",t),r=n.pathname.replace(/\\/g,"/");return r.endsWith("/chunks/")?new URL("../",n).toString():e&&/\/src\//.test(r)?h8(e):n.toString()}catch{return null}}function cct(){if(typeof document>"u")return null;const i=document.currentScript;if(i?.src)return d8(i.src);const e=document.getElementsByTagName("script");for(let t=e.length-1;t>=0;t-=1){const n=e[t]?.src;if(n&&/(?:bim-engine-sdk|iflow-engine-base|dwg-preview|gaussian)\.(?:es|umd)\.js(?:[?#].*)?$/.test(n))return d8(n)}return null}function hct(i){const e=abe();if(e){if(!i){delete e[UZ];return}e[UZ]=h8(i)}}function hbe(i){const e=abe()?.[UZ];return typeof e=="string"&&e.length>0?lct(e,i):h8(oct)}function es(i,e){if(lbe(i))return i;if(act(i)){const r=u8(i,d8(e)||void 0);if(r)return r}const t=i.replace(/^\/+/,""),n=hbe(e);return u8(t,n)||t}function p8(i){i?.assetBaseUrl&&hct(i.assetBaseUrl)}async function uct(i){p8(i);const{EngineKernelV2:e}=await Promise.resolve().then(()=>Njt).then(t=>t.E);return new e(i)}async function dct(i){p8(i);const{EngineKernel2d:e}=await Promise.resolve().then(()=>tDt).then(t=>t.a);return new e(i)}async function pct(i){p8(i);const{EngineKernel720:e}=await Promise.resolve().then(()=>$jt);return new e(i)}async function fct(i){p8(i);const{EngineKernelGIS:e}=await Promise.resolve().then(()=>DKi);return new e(i)}const iO={endpoint:"https://open.iflowbim.cn/openapi"};class mct{engine=null;registry;container;containerId;options;_isInitialized=!1;_isDestroyed=!1;initPromise=null;unsubscribeTheme=null;currentMeasureType=null;isMeasureActive=!1;currentSectionMode=null;selectedComponent=null;calibration;constructor(e,t){this.registry=t,this.container=e.container,this.container.id?this.containerId=this.container.id:(this.containerId=`engine-container-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,this.container.id=this.containerId),this.calibration={setCalibration:n=>this.setCalibration(n),apply:n=>this.applyCalibration(n),alignBySegments:n=>this.alignCalibrationBySegments(n),getMatrix:n=>this.getCalibrationMatrix(n),clear:n=>this.clearCalibration(n)},this.options={backgroundColor:"linear-gradient(to bottom, rgb(214, 224, 235), rgb(246, 250, 255))",version:e.version??"v2",showStats:e.showStats??!1,showViewCube:e.showViewCube??!0}}async init(){if(this._isInitialized){console.warn("[Engine] Engine already initialized.");return}if(this.initPromise)return this.initPromise;if(this._isDestroyed){console.error("[Engine] Cannot initialize destroyed engine.");return}try{typeof this.options.backgroundColor=="string"&&(this.container.style.background=this.options.backgroundColor);const e={containerId:this.containerId,backgroundColor:this.options.backgroundColor,version:this.options.version,showStats:this.options.showStats,showViewCube:this.options.showViewCube,sdkAuth:iO};if(console.log("引擎配置信息:",e),this.initPromise=(async()=>{const n=await uct(e);if(!n)throw new Error("Failed to create engine instance");if(this._isDestroyed){n.dispose?.();return}this.engine=n,this._isInitialized=!0,this.resize(this.container.clientWidth,this.container.clientHeight)})(),await this.initPromise,this._isDestroyed||!this.engine)return;this.unsubscribeTheme=qi.subscribe(n=>{this.setTheme(n)}),this.setTheme(qi.getTheme()),this.engine?.events?.on?(this.engine.events.on("click",n=>{const r=this.registry;console.log("[Engine] 底层 click 事件触发:",n),n&&Array.isArray(n)&&n.length>0&&n[0].url?(this.selectedComponent={url:n[0].url,id:n[0].ids?.[0]},console.log("[Engine] 触发 component:selected:",this.selectedComponent),r.emit("component:selected",this.selectedComponent)):(this.selectedComponent=null,console.log("[Engine] 触发 component:deselected"),r.emit("component:deselected",{}))}),this.engine.events.on("loading_completed",()=>{console.log("[Engine] 底层 LoadingCompleted 事件触发"),this.registry.emit("engine:model-loading-completed",{})})):console.warn("[Engine] 底层引擎不支持 events.on 方法,无法监听点击事件");const t=this.engine.oneClickEncoding;t?.on&&(t.on("encoding-start",n=>{console.log("[Engine] 底层 encoding-start 事件触发:",n),this.registry.emit("encoding:start",n)}),t.on("encoding-complete",n=>{console.log("[Engine] 底层 encoding-complete 事件触发:",n),this.registry.emit("encoding:complete",n)}),t.on("encoding-error",n=>{console.log("[Engine] 底层 encoding-error 事件触发:",n),this.registry.emit("encoding:error",n)}))}catch(e){throw console.error("[Engine] Failed to initialize engine:",e),this._isInitialized=!1,e}}setTheme(e){}setLocales(){}isInitialized(){return this._isInitialized}loadModel(e,t){if(!this._isInitialized||!this.engine){console.error("[Engine] Engine not initialized. Please call init() first.");return}if(!e||e.length===0){console.error("[Engine] Model URLs are required.");return}this.engine.loaderModule.loadModels(e,t)}async loadModelByViewToken(e){if(!this._isInitialized||!this.engine){console.error("[Engine] Engine not initialized. Please call init() first.");return}await this.engine.loadModelByViewToken(e)}getRawLabel(e){const t=this.engine?.label;return!t||typeof t[e]!="function"?(console.warn(`[Engine] label.${e} not available.`),null):t}pickPoint(){return this.getRawLabel("pickPoint")?.pickPoint?.()??Promise.resolve(null)}startPickPoint(e){return this.getRawLabel("startPickPoint")?.startPickPoint?.(e)??Promise.resolve(null)}createLabel(e){return this.getRawLabel("createLabel")?.createLabel?.(e)}createLabels(e,t){t?.clearExisting&&this.clearLabels();const n=this.getRawLabel("createLabel");return n?.createLabel?e.map(r=>n.createLabel(r)).filter(r=>typeof r=="string"&&r.length>0):[]}updateLabel(e,t){return this.getRawLabel("updateLabel")?.updateLabel?.(e,t)??!1}deleteLabel(e){return this.getRawLabel("deleteLabel")?.deleteLabel?.(e)??!1}removeLabel(e){return this.getRawLabel("removeLabel")?.removeLabel?.(e)??!1}clearLabels(){this.getRawLabel("clearLabels")?.clearLabels?.()}getLabel(e){return this.getRawLabel("getLabel")?.getLabel?.(e)}getLabels(){return this.getRawLabel("getLabels")?.getLabels?.()??[]}onLabelClick(e){return this.getRawLabel("onLabelClick")?.onLabelClick?.(e)??(()=>{})}offLabelClick(e){this.getRawLabel("offLabelClick")?.offLabelClick?.(e)}setCalibration(e){return!this._isInitialized||!this.engine?(console.warn("[Engine] Cannot set calibration: engine not initialized."),!1):typeof this.engine.calibration?.setCalibration=="function"?this.engine.calibration.setCalibration(e):this.applyCalibration(e)}applyCalibration(e){return!this._isInitialized||!this.engine?(console.warn("[Engine] Cannot apply calibration: engine not initialized."),!1):typeof this.engine.applyCalibration=="function"?this.engine.applyCalibration(e):this.engine.calibration?.setCalibration?.(e)??!1}alignCalibrationBySegments(e){return!this._isInitialized||!this.engine?(console.warn("[Engine] Cannot align calibration: engine not initialized."),!1):typeof this.engine.alignCalibrationBySegments=="function"?this.engine.alignCalibrationBySegments(e):this.engine.calibration?.alignBySegments?.(e)??!1}getCalibrationMatrix(e){return!this._isInitialized||!this.engine?(console.warn("[Engine] Cannot get calibration matrix: engine not initialized."),null):this.engine.calibration?.getMatrix?.(e)??null}clearCalibration(e){return!this._isInitialized||!this.engine?(console.warn("[Engine] Cannot clear calibration: engine not initialized."),!1):this.engine.calibration?.clear?.(e)??!1}setModelCalibrationTransform(e){if(!this._isInitialized||!this.engine)return console.warn("[Engine] Cannot set model calibration transform: engine not initialized."),!1;const t=this.findLoadedModel(e.url);if(!t)return console.warn("[Engine] Cannot set model calibration transform: model not found.",e.url),!1;const n=this.normalizeCalibrationTransform(e),r=this.buildCalibrationMatrixRows(n);if(!this.clearCalibration(e.url))return console.warn("[Engine] Cannot set model calibration transform: clear failed.",e.url),!1;const o=this.applyCalibration({url:e.url,matrix:r});return o&&this.emitCalibrationChanged(e.url,"apply",n,r,t),o}getModelCalibrationTransform(e){if(!this._isInitialized||!this.engine)return console.warn("[Engine] Cannot get model calibration transform: engine not initialized."),null;const t=this.findLoadedModel(e);if(!t)return null;const n=this.getCalibrationMatrix(e),r=this.decomposeCalibrationMatrix(n);return{url:e,name:this.getModelDisplayName(t,e),...r,matrix:this.matrixToRows(n??new rr)}}getModelCalibrationItems(){return!this._isInitialized||!this.engine?[]:this.getLoadedModels().map(e=>{const t=this.getModelUrl(e);return t?this.getModelCalibrationTransform(t):null}).filter(e=>e!==null)}resetModelCalibration(e){if(!this._isInitialized||!this.engine)return console.warn("[Engine] Cannot reset model calibration: engine not initialized."),!1;const t=this.findLoadedModel(e);if(!t)return console.warn("[Engine] Cannot reset model calibration: model not found.",e),!1;const n=this.clearCalibration(e);if(n){const r=this.createZeroCalibrationTransform();this.emitCalibrationChanged(e,"reset",r,this.identityMatrixRows(),t)}return n}createZeroCalibrationTransform(){return{offset:{x:0,y:0,z:0},rotation:{x:0,y:0,z:0},rotationOrder:"XYZ"}}normalizeCalibrationTransform(e){return{offset:{x:this.normalizeNumber(e.offset?.x),y:this.normalizeNumber(e.offset?.y),z:this.normalizeNumber(e.offset?.z)},rotation:{x:this.normalizeNumber(e.rotation?.x),y:this.normalizeNumber(e.rotation?.y),z:this.normalizeNumber(e.rotation?.z)},rotationOrder:"XYZ"}}buildCalibrationMatrixRows(e){const t=this.normalizeCalibrationTransform(e),n=new pt(t.offset.x,t.offset.y,t.offset.z),r=new Ev(this.degToRad(t.rotation.x),this.degToRad(t.rotation.y),this.degToRad(t.rotation.z),"XYZ"),s=new ia().setFromEuler(r),o=new rr().compose(n,s,new pt(1,1,1));return this.matrixToRows(o)}decomposeCalibrationMatrix(e){if(!e)return this.createZeroCalibrationTransform();const t=new pt,n=new ia,r=new pt;e.decompose(t,n,r);const s=new Ev().setFromQuaternion(n,"XYZ");return{offset:{x:this.normalizeNumber(t.x),y:this.normalizeNumber(t.y),z:this.normalizeNumber(t.z)},rotation:{x:this.normalizeNumber(this.radToDeg(s.x)),y:this.normalizeNumber(this.radToDeg(s.y)),z:this.normalizeNumber(this.radToDeg(s.z))},rotationOrder:"XYZ"}}matrixToRows(e){const t=e.elements;return[[this.normalizeNumber(t[0]),this.normalizeNumber(t[4]),this.normalizeNumber(t[8]),this.normalizeNumber(t[12])],[this.normalizeNumber(t[1]),this.normalizeNumber(t[5]),this.normalizeNumber(t[9]),this.normalizeNumber(t[13])],[this.normalizeNumber(t[2]),this.normalizeNumber(t[6]),this.normalizeNumber(t[10]),this.normalizeNumber(t[14])],[this.normalizeNumber(t[3]),this.normalizeNumber(t[7]),this.normalizeNumber(t[11]),this.normalizeNumber(t[15])]]}identityMatrixRows(){return this.matrixToRows(new rr)}emitCalibrationChanged(e,t,n,r,s){this.registry.emit("calibration:changed",{url:e,name:this.getModelDisplayName(s,e),action:t,...n,matrix:r,timestamp:Date.now()})}getLoadedModels(){const e=this.engine?.models;return Array.isArray(e)?e:[]}findLoadedModel(e){return this.getLoadedModels().find(t=>this.getModelUrl(t)===e)??null}getModelUrl(e){return typeof e?.url=="string"&&e.url.length>0?e.url:null}getModelDisplayName(e,t){const n=e?.name??e?.id??e?.modelName;if(n!=null&&String(n).trim())return String(n).trim();const s=(t.split(/[?#]/)[0]??t).split("/").filter(Boolean);return s[s.length-1]||t}degToRad(e){return e*Math.PI/180}radToDeg(e){return e*180/Math.PI}normalizeNumber(e){const t=Number(e);if(!Number.isFinite(t))return 0;const n=Math.abs(t)<1e-10?0:Number(t.toFixed(6));return Object.is(n,-0)?0:n}CameraGoHome(e){this.engine.viewCube.CameraGoHome(e)}switchToPerspectiveCamera(){if(!this._isInitialized||!this.engine?.cameraModule){console.warn("[Engine] Cannot switch to perspective camera: engine not initialized.");return}const e=this.getRuntimeCameraType(this.engine.camera);if(e!=="perspective"){if(!e){console.warn("[Engine] Cannot switch to perspective camera: unknown current camera type.");return}this.engine.cameraModule.switchToPerspectiveCamera()}}saveMainView(){if(!this._isInitialized||!this.engine?.viewCube)return console.warn("[Engine] Cannot save main view: engine not initialized."),null;const e=this.engine.viewCube.saveMainViewPort();return this.registry.emit("view:main-view-saved",{viewData:e}),e}restoreMainView(){if(!this._isInitialized||!this.engine?.viewCube){console.warn("[Engine] Cannot reset main view: engine not initialized.");return}this.engine.viewCube.resetMainViewPort(),this.registry.emit("view:main-view-restored",{})}setMainViewPort(e){if(!this._isInitialized||!this.engine?.viewCube){console.warn("[Engine] Cannot set main view: engine not initialized.");return}this.engine.viewCube.setMainViewPort(e)}captureScreenshot(){if(!this._isInitialized||!this.engine?.viewCube){console.warn("[Engine] Cannot capture screenshot: engine not initialized.");return}this.engine.viewCube.screenshot()}captureViewBase64(e="image/png",t){if(!this._isInitialized||!this.engine?.renderer?.domElement)return console.warn("[Engine] Cannot capture view base64: renderer not initialized."),null;try{return this.engine.renderer.domElement.toDataURL(e,t)}catch(n){return console.warn("[Engine] Failed to capture view base64:",n),null}}showHelpPanel(){this.registry.helpPanel?.show()}onRawEvent(e,t){this.engine?.events?.on(e,t)}offRawEvent(e,t){this.engine?.events?.off(e,t)}isContextMenuDisabled(){return!this._isInitialized||!this.engine?!1:this.engine.engineStatus?.isDisableContextMenu===!0}onOneClickEncodingEvent(e,t){this.engine?.oneClickEncoding?.on(e,t)}offOneClickEncodingEvent(e,t){this.engine?.oneClickEncoding?.off(e,t)}startOneClickEncoding(){if(!this._isInitialized||!this.engine?.oneClickEncoding){console.warn("[Engine] oneClickEncoding not available.");return}this.engine.oneClickEncoding.start()}pauseRendering(){if(!this._isInitialized||!this.engine){console.warn("[Engine] Engine not initialized.");return}this.engine.pauseRendering()}resumeRendering(){if(!this._isInitialized||!this.engine){console.warn("[Engine] Engine not initialized.");return}this.engine.resumeRendering()}createDrawingPin(e){if(console.log("[Engine] createDrawingPin called"),!this._isInitialized||!this.engine?.drawingPin){console.warn("[Engine] drawingPin.create not available. initialized:",this._isInitialized,"drawingPin:",!!this.engine?.drawingPin);return}console.log("[Engine] calling this.engine.drawingPin.create"),this.engine.drawingPin.create(t=>{console.log("[Engine] drawingPin.create callback received:",t),e(t)})}async restoreDrawingPin(e,t){if(console.log("[Engine] restoreDrawingPin called:",e),!this._isInitialized||!this.engine?.drawingPin){console.warn("[Engine] drawingPin.restore not available.");return}return this.engine.drawingPin.restore(e,"edit",n=>{console.log("[Engine] drawingPin.restore callback received:",n),t?.(n)})}async restoreViewSnapshot(e){if(console.log("[Engine] restoreViewSnapshot called:",e),!this._isInitialized||!this.engine?.drawingPin){console.warn("[Engine] drawingPin.restore not available.");return}return this.engine.drawingPin.restore(e)}showDrawingPinLabels(e){if(!this._isInitialized||!this.engine?.drawingPin?.showLabels){console.warn("[Engine] drawingPin.showLabels not available.");return}this.engine.drawingPin.showLabels(e)}hideDrawingPinLabels(){if(!this._isInitialized||!this.engine?.drawingPin?.hideLabels){console.warn("[Engine] drawingPin.hideLabels not available.");return}this.engine.drawingPin.hideLabels()}setPinRecords(e){console.log("[Engine] setPinRecords called, records count:",e.length),this.registry.emit("drawingPin:list-updated",{records:e})}setPinList(e){this.setPinRecords(e)}dispose(){if(!this._isInitialized||!this.engine){console.warn("[Engine] Engine not initialized.");return}this.engine.dispose()}resize(e,t){if(!this._isInitialized||!this.engine)return;const n=typeof e=="number"?Math.floor(e):this.container.clientWidth,r=typeof t=="number"?Math.floor(t):this.container.clientHeight;n<=0||r<=0||typeof this.engine.handleWindowResize=="function"&&this.engine.handleWindowResize(n,r)}activateMeasure(e){if(!this._isInitialized||!this.engine?.measure){console.error("[Engine] Cannot activate measure: engine not initialized.");return}if(this.currentMeasureType===e){console.log(`[Engine] Measure ${e} already active, skipping.`);return}this.isMeasureActive||(console.log("[Engine] Activating measure module"),this.engine.measure.active(),this.isMeasureActive=!0),console.log(`[Engine] Activating measure: ${e}`);const t=this.engine.measure;switch(e){case"clearHeight":t.clearHeightMeasure.active();break;case"clearDistance":t.faceDistanceMeasure.active();break;case"distance":t.distanceMeasure.active();break;case"elevation":t.elevationMeasure.active();break;case"point":t.pointMeasure.active();break;case"angle":t.angleMeasure.active();break;case"area":t.areaMeasure.active();break;case"slope":t.slopeMeasure.active();break;default:console.error(`[Engine] Unknown measure type: ${e}`);return}this.currentMeasureType=e}getCurrentMeasureType(){return this.currentMeasureType}deactivateMeasure(){!this._isInitialized||!this.engine?.measure||(console.log("[Engine] Deactivating measure"),this.engine.measure.disActive(),this.engine.measure.clearAll(),this.isMeasureActive=!1,this.currentMeasureType=null)}resetMeasureState(){this.currentMeasureType=null,this.isMeasureActive=!1}clearAllMeasures(){!this._isInitialized||!this.engine?.measure||(console.log("[Engine] Clearing all measures"),this.engine.measure.clearAll())}saveMeasureSetting(e){!this._isInitialized||!this.engine?.measure||this.engine.measure.saveSetting?.(e)}setClearHeightDirection(e){!this._isInitialized||!this.engine?.measure||(console.log(`[Engine] Setting clearHeight direction: ${e}`),this.engine.measure.clearHeightMeasure.setDirection(e))}setClearHeightSelectType(e){!this._isInitialized||!this.engine?.measure||(console.log(`[Engine] Setting clearHeight selectType: ${e}`),this.engine.measure.clearHeightMeasure.setSelectType(e))}activeSection(e){if(!this._isInitialized||!this.engine?.clipping){console.error("[Engine] Cannot activate section: engine not initialized.");return}if(this.currentSectionMode===e){console.log(`[Engine] Section ${e} already active, skipping.`);return}console.log(`[Engine] Activating section: ${e}`),this.engine.clipping.active(e),this.currentSectionMode=e}getCurrentSectionMode(){return this.currentSectionMode}setSectionBoxRange(e){if(!this._isInitialized||!this.engine?.clipping){console.error("[Engine] Cannot set section box range: engine not initialized.");return}this.engine.clipping.updateClippingValue(e)}deactivateSection(){!this._isInitialized||!this.engine?.clipping||(console.log("[Engine] Deactivating all sections"),this.engine.clipping.disActive(),this.currentSectionMode=null)}hideSection(){if(!this._isInitialized||!this.engine?.clipping){console.error("[Engine] Cannot hide section: engine not initialized.");return}console.log("[Engine] Hiding section"),this.engine.clipping.disabled()}recoverSection(){if(!this._isInitialized||!this.engine?.clipping){console.error("[Engine] Cannot recover section: engine not initialized.");return}console.log("[Engine] Recovering section"),this.engine.clipping.recover()}fitSectionBoxToModel(){if(!this._isInitialized||!this.engine){console.error("[Engine] Cannot fit section box: engine not initialized.");return}const e=this.engine.engineStatus?.highlightModels;e&&(console.log("[Engine] Fitting section box to model"),this.engine.clipping?.clippingModel(e))}fitSectionBoxToModels(e){if(!this._isInitialized||!this.engine?.clipping)return console.error("[Engine] Cannot fit section box to models: engine not initialized."),!1;const t=this.sanitizeModelParams(e);if(!t.length)return console.warn("[Engine] Cannot fit section box to models: no valid model ids."),!1;try{return this.engine.clipping.clippingModel(t),this.currentSectionMode="box",!0}catch(n){return console.warn("[Engine] fitSectionBoxToModels failed:",n),!1}}scaleSectionBox(){if(!this._isInitialized||!this.engine?.clipping){console.error("[Engine] Cannot scale section box: engine not initialized.");return}this.engine.clipping.scaleBox()}reverseSection(){if(!this._isInitialized||!this.engine?.clipping){console.error("[Engine] Cannot reverse section: engine not initialized.");return}this.engine.clipping.reverse()}setFillCutFace(e){if(!this._isInitialized||!this.engine?.clipping){console.error("[Engine] Cannot set fill cut face: engine not initialized.");return}console.log("[Engine] Setting fill cut face:",e),this.engine.clipping.setFillCutFace(e)}getFillCutFace(){return!this._isInitialized||!this.engine?.clipping?!1:this.engine.clipping.getFillCutFace?.()??!1}switchCamera(){if(!this._isInitialized||!this.engine?.cameraModule){console.warn("[Engine] Cannot switch camera: engine not initialized.");return}if((this.getRuntimeCameraType(this.engine.camera)??this.getCameraType())==="orthographic"){this.switchToPerspectiveCamera();return}this.switchToOrthographicCamera()}getCameraType(){if(!this._isInitialized||!this.engine?.cameraModule)return"perspective";const e=this.getRuntimeCameraType(this.engine.camera);if(e)return e;const t=this.engine.cameraModule.getCameraType?.();return t===1||t==="orthographic"?"orthographic":"perspective"}getRuntimeCameraType(e){return e?e.isOrthographicCamera||e.type==="OrthographicCamera"?"orthographic":e.isPerspectiveCamera||e.type==="PerspectiveCamera"||typeof e.getEffectiveFOV=="function"?"perspective":null:null}getRenderMode(){return!this._isInitialized||!this.engine?.engineModelModule?"balance":this.engine.engineModelModule.getCurrentMode()}setRenderMode(e){if(!this._isInitialized||!this.engine?.engineModelModule){console.warn("[Engine] Cannot set render mode: engine not initialized.");return}try{this.engine.engineModelModule.setMode(e)}catch(t){console.warn("[Engine] Failed to set render mode:",t)}}normalizePercent(e,t){return Number.isFinite(e)?Math.min(100,Math.max(0,Math.round(e))):t}getSettingApi(){return!this._isInitialized||!this.engine?.setting?null:this.engine.setting}callSettingMethod(e,...t){const n=this.getSettingApi();if(!n)return;const r=n[e];if(typeof r=="function")return r.apply(this.engine.setting,t)}hasSettingMethod(e){const t=this.getSettingApi();return t?typeof t[e]=="function":!1}mergeSettingsWithDefaults(e){const t=e.display?.groundId??"0",n=typeof e.display?.showGround=="boolean"?e.display.showGround:t!=="0"&&t!=="";return{render:{mode:e.render?.mode??"advanced",contrast:this.normalizePercent(e.render?.contrast??50,50),saturation:this.normalizePercent(e.render?.saturation??50,50),shadowIntensity:this.normalizePercent(e.render?.shadowIntensity??50,50),lightIntensity:this.normalizePercent(e.render?.lightIntensity??50,50),gtaoIntensity:this.normalizePercent(e.render?.gtaoIntensity??50,50)},display:{showEdge:!!e.display?.showEdge,edgeOpacity:this.normalizePercent(e.display?.edgeOpacity??30,30),showGrid:!!e.display?.showGrid,showLevel:!!e.display?.showLevel,showGround:n,groundId:t,groundHeight:Number.isFinite(e.display?.groundHeight)?Number(e.display?.groundHeight):0},environment:{type:e.environment?.type??"none",hdrId:e.environment?.hdrId??"0",hdrIntensity:this.normalizePercent(e.environment?.hdrIntensity??20,20),skyPreset:e.environment?.skyPreset??"sunrise_clear",skyParams:e.environment?.skyParams??{},skyIntensity:this.normalizePercent(e.environment?.skyIntensity??20,20)}}}getPresetLists(){const e={ground:[],hdr:[],sky:[]},t=this.getSettingApi();if(!t)return e;const n=t.getPresetLists,r=typeof n=="function"?n.call(this.engine.setting):null,s=this.getGroundList().map(a=>({id:a.id,names:[a.name,a.name,a.name]})),o=this.getHDRBackgroundList().map(a=>({id:a.id,names:[a.name,a.name,a.name]}));return{ground:Array.isArray(r?.ground)&&r.ground.length>0?r.ground:s,hdr:Array.isArray(r?.hdr)&&r.hdr.length>0?r.hdr:o,sky:Array.isArray(r?.sky)?r.sky:[]}}getSettings(){const e=this.callSettingMethod("getSettings");return e&&typeof e=="object"?this.mergeSettingsWithDefaults(e):{render:{mode:this.getRenderMode(),contrast:this.normalizePercent(this.getSceneContrast(),50),saturation:this.normalizePercent(this.getSceneSaturation(),50),shadowIntensity:50,lightIntensity:this.normalizePercent(this.getAmbientLightIntensity(),50),gtaoIntensity:50},display:{showEdge:this.getModelEdgeActive(),edgeOpacity:30,showGrid:!1,showLevel:!1,showGround:this.getGroundId()!=="0"&&this.getGroundId()!=="",groundId:this.getGroundId()||"0",groundHeight:this.getGroundElevation()},environment:{type:this.getHDRBackgroundId()&&this.getHDRBackgroundId()!=="0"?"hdr":"none",hdrId:this.getHDRBackgroundId()||"0",hdrIntensity:20,skyPreset:"sunrise_clear",skyParams:{},skyIntensity:20}}}getLegacyHdrFallbackId(e){if(typeof e=="string"&&e!==""&&e!=="0")return e;const t=this.getHDRBackgroundId();if(t&&t!=="0")return t;const n=this.getPresetLists().hdr.find(s=>s.id&&s.id!=="0");return n?.id?n.id:this.getHDRBackgroundList().find(s=>s.id&&s.id!=="0")?.id??"0"}normalizeSettingsPatch(e){if(!e.environment)return e;const t={...e.environment};if(t.type==="hdr"){const n=this.getLegacyHdrFallbackId(t.hdrId);n!=="0"&&(t.hdrId=n)}return{...e,environment:t}}async applyLegacyEnvironmentSettings(e){if(e.type==="none"){this.setHDRBackgroundId("0"),this.callSettingMethod("setHDRBackgroundVisibility",!1);return}if(e.type==="hdr"){const t=this.getLegacyHdrFallbackId(e.hdrId);if(t==="0"){console.warn("[Engine] Cannot enable HDR background: no HDR preset is available in compatibility mode.");return}this.callSettingMethod("setHDRBackgroundVisibility",!0),this.setHDRBackgroundId(t);return}e.type==="sky"&&(typeof e.skyPreset=="string"?this.callSettingMethod("setSkyPreset",e.skyPreset):void 0)===void 0&&console.warn("[Engine] Sky environment switching is unavailable in compatibility mode.")}async setSettings(e){if(!this._isInitialized||!this.engine?.setting){console.warn("[Engine] Cannot set settings: engine not initialized.");return}const t=this.normalizeSettingsPatch(e);if(this.hasSettingMethod("setSettings"))try{const s=this.callSettingMethod("setSettings",t);await Promise.resolve(s);return}catch(s){console.warn("[Engine] Native setSettings failed, fallback to compatibility mode.",s)}t.render?.mode&&this.setRenderMode(t.render.mode),typeof t.render?.lightIntensity=="number"&&this.setAmbientLightIntensity(t.render.lightIntensity),typeof t.render?.contrast=="number"&&this.setSceneContrast(t.render.contrast),typeof t.render?.saturation=="number"&&this.setSceneSaturation(t.render.saturation),typeof t.display?.showEdge=="boolean"&&(t.display.showEdge?this.activeModelEdge():this.disActiveModelEdge()),typeof t.display?.edgeOpacity=="number"&&this.callSettingMethod("setEdgeOpacity",t.display.edgeOpacity),typeof t.display?.showGrid=="boolean"&&this.callSettingMethod("setShowGrid",t.display.showGrid),typeof t.display?.showLevel=="boolean"&&this.callSettingMethod("setShowLevel",t.display.showLevel),typeof t.display?.groundId=="string"&&this.setGroundId(t.display.groundId),typeof t.display?.groundHeight=="number"&&this.setGroundElevation(t.display.groundHeight);const n=this.hasSettingMethod("setEnvironmentType"),r=this.hasSettingMethod("setHdrId");if(typeof t.environment?.type=="string")if(n){const s=this.callSettingMethod("setEnvironmentType",t.environment.type);s!==void 0&&await Promise.resolve(s)}else await this.applyLegacyEnvironmentSettings(t.environment);if(typeof t.environment?.hdrId=="string")if(r){const s=this.callSettingMethod("setHdrId",t.environment.hdrId);s!==void 0&&await Promise.resolve(s)}else t.environment.type!=="none"&&this.setHDRBackgroundId(t.environment.hdrId);typeof t.environment?.hdrIntensity=="number"&&this.callSettingMethod("setHdrIntensity",t.environment.hdrIntensity),typeof t.environment?.skyPreset=="string"&&this.callSettingMethod("setSkyPreset",t.environment.skyPreset),typeof t.environment?.skyIntensity=="number"&&this.callSettingMethod("setSkyIntensity",t.environment.skyIntensity),t.environment?.skyParams&&typeof t.environment.skyParams=="object"&&this.callSettingMethod("setSkyParams",t.environment.skyParams),typeof t.render?.shadowIntensity=="number"&&this.callSettingMethod("setShadowIntensity",t.render.shadowIntensity),typeof t.render?.gtaoIntensity=="number"&&this.callSettingMethod("setGtaoIntensity",t.render.gtaoIntensity)}async resetToDefault(){const t=this.getSettingApi()?.resetToDefault;if(typeof t=="function"){await Promise.resolve(t.call(this.engine.setting));return}await this.setSettings({render:{mode:"advanced",contrast:50,saturation:50,shadowIntensity:50,lightIntensity:50,gtaoIntensity:50},display:{showEdge:!1,edgeOpacity:30,showGrid:!1,showLevel:!1,showGround:!1,groundId:"0",groundHeight:0},environment:{type:"none",hdrId:"0",hdrIntensity:20,skyPreset:"sunrise_clear",skyParams:{},skyIntensity:20}})}activeModelEdge(){if(!this._isInitialized||!this.engine?.modelEdge){console.warn("[Engine] Cannot active model edge: engine not initialized.");return}this.engine.modelEdge.active()}disActiveModelEdge(){!this._isInitialized||!this.engine?.modelEdge||this.engine.modelEdge.disActive()}getModelEdgeActive(){return!this._isInitialized||!this.engine?.modelEdge?!1:this.engine.modelEdge.getActive?.()??!1}setAmbientLightIntensity(e){if(!this._isInitialized||!this.engine?.setting){console.warn("[Engine] Cannot set ambient light intensity: engine not initialized.");return}this.engine.setting.setAmbientLightIntensity(e)}getAmbientLightIntensity(){return!this._isInitialized||!this.engine?.setting?50:this.engine.setting.getAmbientLightIntensity?.()??50}setSceneContrast(e){if(!this._isInitialized||!this.engine?.setting){console.warn("[Engine] Cannot set scene contrast: engine not initialized.");return}this.engine.setting.setSceneContrast(e)}getSceneContrast(){return!this._isInitialized||!this.engine?.setting?50:this.engine.setting.getSceneContrast?.()??50}setSceneSaturation(e){if(!this._isInitialized||!this.engine?.setting){console.warn("[Engine] Cannot set scene saturation: engine not initialized.");return}this.engine.setting.setSceneSaturation(e)}getSceneSaturation(){return!this._isInitialized||!this.engine?.setting?50:this.engine.setting.getSceneSaturation?.()??50}getHDRBackgroundList(){return!this._isInitialized||!this.engine?.setting?[]:this.engine.setting.getHDRBackground?.()??[]}setHDRBackgroundId(e){if(!this._isInitialized||!this.engine?.setting){console.warn("[Engine] Cannot set HDR background: engine not initialized.");return}this.engine.setting.setHDRBackgroundId(e)}getHDRBackgroundId(){return!this._isInitialized||!this.engine?.setting?"":this.engine.setting.getHDRBackgroundId?.()??""}setHDRBackgroundVisibility(e){if(!this._isInitialized||!this.engine?.setting){console.warn("[Engine] Cannot set HDR background visibility: engine not initialized.");return}this.engine.setting.setHDRBackgroundVisibility(e)}getHDRBackgroundVisibility(){return!this._isInitialized||!this.engine?.setting?!0:this.engine.setting.getHDRBackgroundVisibility?.()??!0}getGroundList(){return!this._isInitialized||!this.engine?.setting?[]:this.engine.setting.getGroundList?.()??[]}setGroundId(e){if(!this._isInitialized||!this.engine?.setting){console.warn("[Engine] Cannot set ground: engine not initialized.");return}this.engine.setting.setGroundId(e)}getGroundId(){return!this._isInitialized||!this.engine?.setting?"":this.engine.setting.getGroundId?.()??""}setGroundElevation(e){if(!this._isInitialized||!this.engine?.setting){console.warn("[Engine] Cannot set ground elevation: engine not initialized.");return}this.engine.setting.setGroundElevation(e)}getGroundElevation(){return!this._isInitialized||!this.engine?.setting?0:this.engine.setting.getGroundElevation?.()??0}switchToOrthographicCamera(){if(!this._isInitialized||!this.engine?.cameraModule){console.warn("[Engine] Cannot switch to orthographic camera: engine not initialized.");return}const e=this.engine.camera,t=this.getRuntimeCameraType(e);if(t!=="orthographic"){if(t!=="perspective"||typeof e?.getEffectiveFOV!="function"){console.warn("[Engine] Cannot switch to orthographic camera: current camera is not perspective.");return}this.engine.cameraModule.switchToOrthographicCamera()}}isWalkModeActive=!1;walkViewMode=null;activateFirstPersonMode(){if(!this._isInitialized||!this.engine){console.error("[Engine] Cannot activate first person mode: engine not initialized.");return}if(!this.engine.controlModule){console.error("[Engine] Control module not available.");return}if(this.walkViewMode==="first-person"){console.log("[Engine] First person mode already active, skipping.");return}console.log("[Engine] Activating first person mode"),this.engine.controlModule.switchFirstPersonMode(),this.isWalkModeActive=!0,this.walkViewMode="first-person"}activateThirdPersonMode(){if(!this._isInitialized||!this.engine){console.error("[Engine] Cannot activate third person mode: engine not initialized.");return}if(!this.engine.controlModule){console.error("[Engine] Control module not available.");return}if(this.walkViewMode==="third-person"){console.log("[Engine] Third person mode already active, skipping.");return}console.log("[Engine] Activating third person mode"),this.engine.controlModule.switchThirdPersonMode(),this.isWalkModeActive=!0,this.walkViewMode="third-person"}deactivateFirstPersonMode(){!this._isInitialized||!this.engine?.controlModule||this.isWalkModeActive&&(this.engine.controlModule.switchDefaultMode(),console.log("[Engine] Deactivating first person mode"),this.isWalkModeActive=!1,this.walkViewMode=null)}getWalkSpeed(){if(!this._isInitialized)return console.error("[Engine] Cannot get walk speed: engine not initialized."),1;const e=this.engine.controlModule.getMoveSpeed();return console.log("[Engine] getWalkSpeed from controlModule:",e),e}setWalkSpeed(e){if(!this._isInitialized||!this.engine?.controlModule){console.error("[Engine] Cannot set walk speed: engine not initialized.");return}this.engine.controlModule.setMoveSpeed(e)}getWalkGravity(){if(!this._isInitialized)return console.error("[Engine] Cannot get walk gravity: engine not initialized."),!1;const e=this.engine.controlModule.getApplyGravity();return console.log("[Engine] getWalkGravity from controlModule:",e),e}setWalkGravity(e){if(!this._isInitialized){console.error("[Engine] Cannot set walk gravity: engine not initialized.");return}this.engine.controlModule.setApplyGravity(e)}getWalkCollision(){if(!this._isInitialized)return console.error("[Engine] Cannot get walk collision: engine not initialized."),!1;const e=this.engine.controlModule.getApplyCollision();return console.log("[Engine] getWalkCollision from controlModule:",e),e}setWalkCollision(e){if(!this._isInitialized||!this.engine?.controlModule){console.error("[Engine] Cannot set walk collision: engine not initialized.");return}this.engine.controlModule.setApplyCollision(e)}toggleMiniMap(){if(!this._isInitialized||!this.engine){console.error("[Engine] Cannot toggle mini map: engine not initialized.");return}this.engine.minMap?.toggle()}getMiniMapState(){return!this._isInitialized||!this.engine?!1:this.engine.minMap?.getstate()??!1}isFirstPersonModeActive(){return this.walkViewMode==="first-person"}getSelectedComponent(){return this.selectedComponent}getComponentProperties(e,t,n){if(!this._isInitialized||!this.engine){console.error("[Engine] Cannot get component properties: engine not initialized.");return}if(!this.engine.modelProperties){console.error("[Engine] modelProperties not available");return}console.log("[Engine] Getting component properties:",{url:e,id:t}),this.engine.modelProperties.getModelProperties(e,t,n)}getModelPosition(e){return!this._isInitialized||!this.engine?(console.error("[Engine] Cannot get model position: engine not initialized."),null):this.engine.issueReport?.getMoldePosition?(console.log("[Engine] Getting model position:",e),this.engine.issueReport.getMoldePosition(e)):(console.error("[Engine] getMoldePosition method not available in issueReport"),null)}jumpToCamera(e){if(!this._isInitialized||!this.engine)return console.error("[Engine] Cannot jump to camera: engine not initialized."),!1;if(!this.engine.issueReport?.jumptoCamera)return console.error("[Engine] jumptoCamera method not available in issueReport"),!1;console.log("[Engine] Jumping to camera:",e);try{return this.engine.issueReport.jumptoCamera(e),!0}catch(t){return console.error("[Engine] Failed to jump to camera:",t),!1}}getTypeTreeData(){return!this._isInitialized||!this.engine?.modelTree?[]:this.engine.modelTree.getTypeTreeData()}getLevelTreeData(){return!this._isInitialized||!this.engine?.modelTree?[]:this.engine.modelTree.getLevelTreeData()}getMajorTreeData(){return!this._isInitialized||!this.engine?.modelTree?[]:this.engine.modelTree.getMajorTreeData()}getAllViewTreeData(){return!this._isInitialized||!this.engine?.viewTree?[]:this.engine.viewTree.getAllViewTreeData()}openView(e,t){if(!this._isInitialized||!this.engine?.viewTree){console.warn("[Engine] Cannot open view: engine not initialized or viewTree not available.");return}try{this.engine.viewTree.openView(e,t)}catch(n){console.warn("[Engine] openView failed:",n)}}activateZoomBox(){if(!this._isInitialized||!this.engine){console.warn("[Engine] Engine not initialized.");return}this.engine.rangeScale?.active()}getEngineInfo(){if(!this._isInitialized||!this.engine)return console.warn("[Engine] Engine not initialized."),null;if(!this.engine.engineInfo||typeof this.engine.engineInfo.getEngineInfo!="function")return console.warn("[Engine] engineInfo module not available."),null;const e=this.engine.engineInfo.getEngineInfo();return console.log("[Engine] getEngineInfo raw:",e),e}pathRoamingAddPoint(){if(!this._isInitialized||!this.engine?.pathRoaming){console.warn("[Engine] pathRoaming not available");return}this.engine.pathRoaming.addPoint(0)}pathRoamingRemovePoint(e){if(!this._isInitialized||!this.engine?.pathRoaming){console.warn("[Engine] pathRoaming not available");return}this.engine.pathRoaming.removePoint(e)}pathRoamingClearPoints(){if(!this._isInitialized||!this.engine?.pathRoaming){console.warn("[Engine] pathRoaming not available");return}this.engine.pathRoaming.clearPoints()}pathRoamingGetPoints(){return!this._isInitialized||!this.engine?.pathRoaming?(console.warn("[Engine] pathRoaming not available"),[]):this.engine.pathRoaming.getPoints()??[]}pathRoamingJumpToPoint(e){if(!this._isInitialized||!this.engine?.pathRoaming){console.warn("[Engine] pathRoaming not available");return}this.engine.pathRoaming.jumpToPoint(e)}pathRoamingPlay(e){if(!this._isInitialized||!this.engine?.pathRoaming){console.warn("[Engine] pathRoaming not available");return}this.engine.pathRoaming.play(e)}pathRoamingStop(){if(!this._isInitialized||!this.engine?.pathRoaming){console.warn("[Engine] pathRoaming not available");return}this.engine.pathRoaming.stop()}getHighlightModels(){return!this._isInitialized||!this.engine?null:this.engine.engineStatus?.highlightModels??null}highlightModel(e){if(!this._isInitialized||!this.engine?.modelToolModule){console.warn("[Engine] Cannot highlight model: engine not initialized.");return}const t=this.sanitizeModelParams(e);if(t.length)try{this.engine.modelToolModule.highlightModel(t)}catch(n){console.warn("[Engine] highlightModel failed:",n)}}unhighlightAllModels(){if(!this._isInitialized||!this.engine?.modelToolModule){console.warn("[Engine] Cannot unhighlight models: engine not initialized.");return}this.engine.modelToolModule.unhighlightAllModels()}viewScaleToModel(e){if(!this._isInitialized||!this.engine?.modelToolModule){console.warn("[Engine] Cannot view scale to model: engine not initialized.");return}const t=this.sanitizeModelParams(e);if(t.length)try{this.engine.modelToolModule.viewScaleToModel(t)}catch(n){console.warn("[Engine] viewScaleToModel failed:",n)}}hideModels(e){if(!this._isInitialized||!this.engine?.modelToolModule){console.warn("[Engine] Cannot hide models: engine not initialized.");return}const t=this.sanitizeModelParams(e);if(t.length)try{this.engine.modelToolModule.hideModel(t)}catch(n){console.warn("[Engine] hideModels failed:",n)}}showModel(e){if(!this._isInitialized||!this.engine?.modelToolModule){console.warn("[Engine] Cannot show model: engine not initialized.");return}const t=this.sanitizeModelParams(e);if(t.length)try{this.engine.modelToolModule.showModel(t)}catch(n){console.warn("[Engine] showModel failed:",n)}}sanitizeModelParams(e){if(!Array.isArray(e))return[];const t=o=>o.replace(/\/+$/,""),n=Array.isArray(this.engine?.models)?this.engine.models:[],r=new Map;for(const o of n)o?.url&&r.set(t(o.url),o);const s=[];for(const o of e){if(!o||typeof o.url!="string"||!o.url||!Array.isArray(o.ids))continue;const a=r.get(t(o.url));if(!a||!(a.nodesMap instanceof Map))continue;const l=new Set;for(const h of o.ids){if(!Number.isFinite(h))continue;const u=Number(h);if(!Number.isInteger(u))continue;const d=a.nodesMap.get(u);!d||!Array.isArray(d.indexes)||d.indexes.length===0||l.add(u)}const c=Array.from(l);c.length&&s.push({url:o.url,ids:c})}return s}translucentModels(e){if(!this._isInitialized||!this.engine?.modelToolModule){console.warn("[Engine] Cannot translucent models: engine not initialized.");return}e&&this.engine.modelToolModule.translucentModel(e)}setSelectedModelColor(e,t=1){if(!this._isInitialized||!this.engine?.modelToolModule){console.warn("[Engine] Cannot set model color: engine not initialized.");return}if(typeof this.engine.modelToolModule.setModelColor!="function"){console.warn("[Engine] Cannot set model color: setModelColor not available.");return}const n=this.getHighlightModels();if(!n){console.warn("[Engine] Cannot set model color: no selected models.");return}const r=Math.max(0,Math.min(16777215,Math.trunc(e))),s=Math.max(0,Math.min(1,t));try{this.engine.modelToolModule.setModelColor(n,r,s)}catch(o){console.warn("[Engine] setSelectedModelColor failed:",o)}}restoreSelectedModelColor(){if(!this._isInitialized||!this.engine?.modelToolModule){console.warn("[Engine] Cannot restore selected model color: engine not initialized.");return}if(typeof this.engine.modelToolModule.restoreModelColor!="function"){console.warn("[Engine] Cannot restore selected model color: restoreModelColor not available.");return}const e=this.getHighlightModels();if(!e){console.warn("[Engine] Cannot restore selected model color: no selected models.");return}try{this.engine.modelToolModule.restoreModelColor(e)}catch(t){console.warn("[Engine] restoreSelectedModelColor failed:",t)}}restoreAllModelColors(){if(!this._isInitialized||!this.engine?.modelToolModule){console.warn("[Engine] Cannot restore all model colors: engine not initialized.");return}if(typeof this.engine.modelToolModule.getCustomColorModels!="function"||typeof this.engine.modelToolModule.restoreModelColor!="function"){console.warn("[Engine] Cannot restore all model colors: color APIs not available.");return}try{const e=this.engine.modelToolModule.getCustomColorModels();if(!e)return;this.engine.modelToolModule.restoreModelColor(e)}catch(e){console.warn("[Engine] restoreAllModelColors failed:",e)}}unTranslucentModel(){if(!this._isInitialized||!this.engine?.modelToolModule){console.warn("[Engine] Cannot cancel translucent: engine not initialized.");return}this.engine.modelToolModule.unTranslucentModel()}isolateModels(e){if(!this._isInitialized||!this.engine?.modelToolModule){console.warn("[Engine] Cannot isolate models: engine not initialized.");return}e&&this.engine.modelToolModule.isolateModel(e)}translucentOtherModels(e){if(!this._isInitialized||!this.engine?.modelToolModule){console.warn("[Engine] Cannot translucent other models: engine not initialized.");return}e&&this.engine.modelToolModule.translucentOtherModel(e)}showAllModels(e={}){if(!this._isInitialized||!this.engine?.modelToolModule){console.warn("[Engine] Cannot show all models: engine not initialized.");return}e.preserveSection||this.deactivateSection(),this.engine.modelToolModule.showAllModels()}activeModelLink3d(){if(!this._isInitialized||!this.engine?.modelLink3d?.active){console.warn("[Engine] Cannot active model link 3d: engine not initialized or modelLink3d not available.");return}this.engine.modelLink3d.active(),console.log("已开启模型联动")}disActiveModelLink3d(){if(!this._isInitialized||!this.engine?.modelLink3d?.disActive){console.warn("[Engine] Cannot disActive model link 3d: engine not initialized or modelLink3d not available.");return}this.engine.modelLink3d.disActive()}batchSelectSameTypeModel(e){if(!this._isInitialized||!this.engine?.modelToolModule){console.warn("[Engine] Cannot batch select: engine not initialized.");return}e&&this.engine.modelToolModule.batchSelectSameTypeModel(e)}batchSelectSameLevelModel(e){if(!this._isInitialized||!this.engine?.modelToolModule){console.warn("[Engine] Cannot batch select: engine not initialized.");return}e&&this.engine.modelToolModule.batchSelectSameLevelModel(e)}batchSelectSameLevelTypeModel(e){if(!this._isInitialized||!this.engine?.modelToolModule){console.warn("[Engine] Cannot batch select: engine not initialized.");return}e&&this.engine.modelToolModule.batchSelectSameLevelTypeModel(e)}readModelCodeFormStoge(){if(!this._isInitialized||!this.engine){console.warn("[Engine] Cannot read model code form stoge: engine not initialized.");return}let e=0;this.engine.models.forEach(t=>{this.engine.oneClickEncoding.readModelCodeFormStoge(t.url),e++}),console.log("readModelCodeFormStoge-success:",e)}hasModelCode(){if(!this._isInitialized||!this.engine)return console.warn("[Engine] Cannot check model code: engine not initialized."),!1;const e=this.engine.models;if(!Array.isArray(e)||e.length===0)return!1;const t=this.engine.oneClickEncoding;return!t||typeof t.exitModelCode!="function"?(console.warn("[Engine] oneClickEncoding.exitModelCode is not available."),!1):e.every(n=>!n||typeof n.url!="string"?!1:t.exitModelCode(n.url)===!0)}destroy(){this._isDestroyed||(this.deactivateMeasure(),this.unsubscribeTheme&&(this.unsubscribeTheme(),this.unsubscribeTheme=null),this.engine&&(this.engine.dispose(),this.engine=null),this.container.innerHTML="",this.initPromise=null,this.currentMeasureType=null,this.isMeasureActive=!1,this._isDestroyed=!0,this._isInitialized=!1)}}const ube=[{label:"Red",value:16726832},{label:"Orange",value:16749824},{label:"Yellow",value:16763904},{label:"Green",value:3458905},{label:"Blue",value:31487},{label:"Cyan",value:3321318},{label:"Purple",value:11490014},{label:"Gray",value:9342611}];function zZ(i){return`#${Math.max(0,Math.min(16777215,Math.trunc(i))).toString(16).padStart(6,"0")}`}function dbe(i){return Number.parseInt(i.replace("#",""),16)}class gct{options;element=null;outsideTimer=null;unsubscribeTheme=null;selectedColor;selectedOpacity;handleOutsidePointerDown=e=>{!this.element||this.element.contains(e.target)||this.destroy()};constructor(e){this.options=e,this.selectedColor=e.initialColor??ube[0].value,this.selectedOpacity=Math.max(0,Math.min(1,e.initialOpacity??1))}show(e,t){this.destroy(),this.element=this.createElement(),document.body.appendChild(this.element),this.unsubscribeTheme=qi.subscribe(n=>this.applyTheme(n)),this.position(e,t),this.outsideTimer=window.setTimeout(()=>{document.addEventListener("pointerdown",this.handleOutsidePointerDown,!0)},0)}destroy(){const e=!!this.element;this.outsideTimer!==null&&(window.clearTimeout(this.outsideTimer),this.outsideTimer=null),document.removeEventListener("pointerdown",this.handleOutsidePointerDown,!0),this.unsubscribeTheme?.(),this.unsubscribeTheme=null,this.element?.remove(),this.element=null,e&&this.options.onClose?.()}createElement(){const e=document.createElement("div");e.className="bim-model-color-picker",e.addEventListener("contextmenu",g=>g.preventDefault()),e.addEventListener("click",g=>g.stopPropagation()),e.addEventListener("pointerdown",g=>g.stopPropagation());const t=document.createElement("div");t.className="bim-model-color-picker__header";const n=document.createElement("div");n.className="bim-model-color-picker__title",n.textContent=At("modelColorPicker.title");const r=document.createElement("button");r.type="button",r.className="bim-model-color-picker__close",r.setAttribute("aria-label",At("modelColorPicker.close")),r.innerHTML="×",r.addEventListener("click",()=>this.destroy()),t.append(n,r),e.appendChild(t);const s=document.createElement("div");s.className="bim-model-color-picker__presets";let o=null;for(const g of this.options.colors??ube){const _=document.createElement("button");_.type="button",_.className="bim-model-color-picker__swatch",_.title=g.label,_.style.backgroundColor=zZ(g.value),_.addEventListener("click",()=>{this.selectedColor=g.value,o&&(o.value=zZ(g.value)),this.emitColorSelection()}),s.appendChild(_)}e.appendChild(s);const a=document.createElement("label");a.className="bim-model-color-picker__opacity";const l=document.createElement("div");l.className="bim-model-color-picker__opacity-top";const c=document.createElement("span");c.textContent=At("modelColorPicker.opacity");const h=document.createElement("span");h.className="bim-model-color-picker__opacity-value",h.textContent=`${Math.round(this.selectedOpacity*100)}%`;const u=document.createElement("input");u.type="range",u.min="0",u.max="100",u.step="1",u.value=String(Math.round(this.selectedOpacity*100)),u.addEventListener("input",()=>{this.selectedOpacity=Number(u.value)/100,h.textContent=`${u.value}%`,this.emitColorSelection()}),l.append(c,h),a.append(l,u),e.appendChild(a);const d=document.createElement("label");d.className="bim-model-color-picker__custom";const p=document.createElement("span");p.textContent=At("modelColorPicker.custom");const f=document.createElement("input");return f.type="color",f.value=zZ(this.selectedColor),o=f,f.addEventListener("input",()=>{this.selectedColor=dbe(f.value),this.emitColorSelection()}),f.addEventListener("change",()=>{this.selectedColor=dbe(f.value),this.emitColorSelection()}),d.append(p,f),e.appendChild(d),e}emitColorSelection(){this.options.onColorSelect(this.selectedColor,this.selectedOpacity)}applyTheme(e){if(!this.element)return;const t=this.element.style,n=e.name==="dark";this.element.classList.toggle("theme-dark",n),this.element.classList.toggle("theme-light",!n),t.setProperty("--bim-model-color-picker-bg",e.bgOverlay),t.setProperty("--bim-model-color-picker-border",e.borderDefault),t.setProperty("--bim-model-color-picker-shadow",e.shadowLg),t.setProperty("--bim-model-color-picker-text",e.textPrimary),t.setProperty("--bim-model-color-picker-muted",e.textSecondary),t.setProperty("--bim-model-color-picker-btn-bg",e.componentBgHover),t.setProperty("--bim-model-color-picker-btn-hover",e.componentBgActive),t.setProperty("--bim-model-color-picker-input-bg",e.bgInset),t.setProperty("--bim-model-color-picker-swatch-border",n?"rgba(248, 250, 252, 0.78)":"rgba(15, 23, 42, 0.18)")}position(e,t){if(!this.element)return;const n=8,r=this.element.getBoundingClientRect(),s=Math.min(Math.max(n,e),window.innerWidth-r.width-n),o=Math.min(Math.max(n,t),window.innerHeight-r.height-n);this.element.style.left=`${s}px`,this.element.style.top=`${o}px`}}class _ct{element;content=null;isVisible=!1;onCloseCallback;options;mouseDownTime=0;mouseDownX=0;mouseDownY=0;CLICK_THRESHOLD=200;MOVE_THRESHOLD=5;constructor(e){this.options=e,this.element=document.createElement("div"),this.element.className=`bim-right-key ${e?.className||""}`,e?.zIndex&&(this.element.style.zIndex=e.zIndex.toString()),document.body.appendChild(this.element)}init(){document.addEventListener("mousedown",this.handleGlobalClick),this.element.addEventListener("contextmenu",e=>{e.preventDefault(),e.stopPropagation()}),this.options?.container&&(this.options.container.addEventListener("mousedown",this.handleContainerMouseDown),this.options.container.addEventListener("mouseup",this.handleContainerMouseUp),this.options.container.addEventListener("contextmenu",this.handleContainerContextMenu))}setTheme(e){}setLocales(){}destroy(){document.removeEventListener("mousedown",this.handleGlobalClick),this.options?.container&&(this.options.container.removeEventListener("mousedown",this.handleContainerMouseDown),this.options.container.removeEventListener("mouseup",this.handleContainerMouseUp),this.options.container.removeEventListener("contextmenu",this.handleContainerContextMenu)),this.unmountContent(),this.element.remove()}handleContainerMouseDown=e=>{e.button===2&&(this.mouseDownTime=Date.now(),this.mouseDownX=e.clientX,this.mouseDownY=e.clientY)};handleContainerMouseUp=e=>{if(e.button!==2||Date.now()-this.mouseDownTime>this.CLICK_THRESHOLD)return;const n=e.clientX-this.mouseDownX,r=e.clientY-this.mouseDownY;n*n+r*r>this.MOVE_THRESHOLD*this.MOVE_THRESHOLD||this.options?.onContext&&this.options.onContext(e)};handleContainerContextMenu=e=>{e.preventDefault()};setOnClose(e){this.onCloseCallback=e}mount(e){this.unmountContent(),this.content=e,this.element.appendChild(e.getElement())}unmountContent(){this.content&&(this.content.destroy(),this.element.innerHTML="",this.content=null)}show(e,t){this.element.classList.add("visible"),this.isVisible=!0,this.element.style.left=`${e}px`,this.element.style.top=`${t}px`;const n=this.element.getBoundingClientRect(),r=window.innerWidth,s=window.innerHeight;let o=e,a=t;e+n.width>r&&(o=e-n.width),t+n.height>s&&(a=t-n.height),this.element.style.left=`${o}px`,this.element.style.top=`${a}px`}hide(){this.element.classList.remove("visible"),this.isVisible=!1,this.unmountContent(),this.onCloseCallback&&this.onCloseCallback()}handleGlobalClick=e=>{this.isVisible&&(this.element.contains(e.target)||this.hide())}}class HZ{element;options;unsubscribeLocale=null;unsubscribeTheme=null;activeSubMenu=null;constructor(e){this.options=e,this.element=document.createElement("ul"),this.element.className="bim-menu"}init(){this.render(),this.unsubscribeLocale=dr.subscribe(()=>{this.setLocales()}),this.unsubscribeTheme=qi.subscribe(e=>{this.setTheme(e)})}setTheme(e){const t=this.element.style;t.setProperty("--bim-bg-elevated",e.bgElevated),t.setProperty("--bim-text-primary",e.textPrimary),t.setProperty("--bim-divider",e.divider),t.setProperty("--bim-component-bg-hover",e.componentBgHover),t.setProperty("--bim-shadow-lg",e.shadowLg)}setLocales(){this.element.innerHTML="",this.render()}destroy(){this.unsubscribeLocale&&(this.unsubscribeLocale(),this.unsubscribeLocale=null),this.unsubscribeTheme&&(this.unsubscribeTheme(),this.unsubscribeTheme=null),this.closeSubMenu(),this.element.remove()}getElement(){return this.element}hasAnyIcon(e){return e.some(t=>t.icon?!0:t.children?this.hasAnyIcon(t.children):!1)}render(){const{items:e,groupOrder:t}=this.options;this.hasAnyIcon(e)?this.element.classList.add("has-icons"):this.element.classList.remove("has-icons");const n=new Map,r="default";e.forEach(o=>{const a=o.group||r;n.has(a)||n.set(a,[]),n.get(a).push(o)});let s=[];if(t){s=t.filter(o=>n.has(o));for(const o of n.keys())s.includes(o)||s.push(o)}else s=Array.from(n.keys());s.forEach((o,a)=>{if(a>0){const c=document.createElement("li");c.className="bim-menu-divider",this.element.appendChild(c)}const l=n.get(o);l.sort((c,h)=>(c.order||0)-(h.order||0)),l.forEach(c=>{if(c.visible!==!1&&(this.element.appendChild(this.createItemElement(c)),c.divider)){const h=document.createElement("li");h.className="bim-menu-divider",this.element.appendChild(h)}})})}createItemElement(e){const t=document.createElement("li"),n=!e.disabled;t.className=`bim-menu-item ${n?"":"disabled"}`;const r=document.createElement("div");r.className="bim-menu-item-icon",e.icon&&(r.innerHTML=e.icon),t.appendChild(r);const s=document.createElement("div");s.className="bim-menu-item-label",s.textContent=At(e.label),t.appendChild(s);const o=e.children,a=o&&o.length>0;if(a){const l=document.createElement("div");l.className="bim-menu-item-arrow",l.innerHTML='<svg viewBox="0 0 24 24"><path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"/></svg>',t.appendChild(l),t.addEventListener("mouseenter",()=>this.openSubMenu(e,t))}else t.addEventListener("mouseenter",()=>this.closeSubMenu());return n&&t.addEventListener("click",l=>{l.stopPropagation(),console.log(`[BimMenu] Clicked item: ${e.id}`),a||(e.onClick?(console.log(`[BimMenu] Executing onClick for ${e.id}`),e.onClick()):console.warn(`[BimMenu] No onClick handler for ${e.id}`))}),t}openSubMenu(e,t){const n=e.children;if(!n||n.length===0)return;this.closeSubMenu();const r=document.createElement("div");r.style.position="fixed",r.style.zIndex="10001";const s=t.getBoundingClientRect();r.style.top=`${s.top}px`,r.style.left=`${s.right}px`,r.addEventListener("mousedown",l=>l.stopPropagation());const o=new HZ({items:n});o.init(),r.appendChild(o.element),document.body.appendChild(r),this.activeSubMenu={menu:o,container:r};const a=r.getBoundingClientRect();a.right>window.innerWidth&&(r.style.left=`${s.left-a.width}px`)}closeSubMenu(){this.activeSubMenu&&(this.activeSubMenu.menu.destroy(),this.activeSubMenu.container.remove(),this.activeSubMenu=null)}}class VZ extends Mc{container;rightKeyPanel;contextHandlers=[];constructor(e,t){super(t),this.container=e,this.rightKeyPanel=new _ct({zIndex:9e3,container:this.container,onContext:this.handleContextMenu}),this.rightKeyPanel.init()}destroy(){this.rightKeyPanel.destroy(),super.destroy()}registerHandler(e){this.contextHandlers.push(e)}unregisterHandler(e){this.contextHandlers=this.contextHandlers.filter(t=>t!==e)}clearHandlers(e=!0){if(!e){this.contextHandlers=[];return}this.contextHandlers.length!==0&&(this.contextHandlers=[this.contextHandlers[0]])}showMenu(e,t,n,r){if(!n||n.length===0)return;const s=new HZ({items:n,groupOrder:r});s.init(),this.rightKeyPanel.mount(s),this.rightKeyPanel.show(e,t)}hide(){this.rightKeyPanel.hide()}isContextMenuDisabled(){return this.registry.engine3d?.getEngineComponent()?.isContextMenuDisabled()===!0}handleContextMenu=e=>{if(this.isContextMenuDisabled()){e.preventDefault(),e.stopPropagation(),this.hide();return}let t=null;for(const n of this.contextHandlers){const r=n(e);r&&r.length>0&&(t||(t=[]),t=t.concat(r))}t&&t.length>0?this.showMenu(e.clientX,e.clientY,t):this.hide()}}function yct(i){return Array.isArray(i)&&i.length>0}function pbe(i){return!!i?.url&&yct(i?.ids)}function vct(i){const e=i?.getHighlightModels();return console.log("[selected-section-fit] current highlight models:",e),Array.isArray(e)?e.some(t=>pbe(t)):e&&typeof e=="object"?pbe(e):!1}function fbe(i){return vct(i)?(i?.fitSectionBoxToModel(),!0):!1}const bct=["level","type","major"];function Act(i){return new Set(i?Array.isArray(i)?i:[i]:bct)}function mbe(i){return String(i).trim().toLowerCase()}function xct(i,e,t){const n=!e||(i.name??"").toLowerCase().includes(e),r=!t||String(i.id??"").toLowerCase()===t;return n&&r}function f8(i,e){const t=i.children?.map(r=>f8(r,e))??null,n={...i,children:t};return e||delete n.ids,n}function gbe(i,e,t,n){if(xct(i,e,t))return f8(i,n);const r=i.children?.map(o=>gbe(o,e,t,n)).filter(o=>o!==null)??[];if(r.length===0)return null;const s={...i,children:r};return n||delete s.ids,s}function GZ(i,e){const t=e?.includeIds??!0,n=e?.name?mbe(e.name):"",r=e?.componentId!==void 0?mbe(e.componentId):"";return!(n||r||e?.includeIds===!1)?i:!n&&!r?i.map(o=>({...o,children:o.children?.map(a=>f8(a,t))??null})):i.map(o=>{const a=!!(n&&(o.name??"").toLowerCase().includes(n)),l=o.children??[];if(a&&!r)return{...o,children:l.map(h=>f8(h,t))};const c=l.map(h=>gbe(h,n,r,t)).filter(h=>h!==null);return c.length===0?null:{...o,children:c}}).filter(o=>o!==null)}class _be extends Mc{container;engineInstance=null;rightKey=null;modelColorPicker=null;calibration;options;defaultRightKeyHandler=e=>{const t=this.engineInstance?.getSelectedComponent(),n=[];return t&&(n.push({id:"componentDetail",label:"menu.componentDetail",group:"component",order:1,divider:!0,onClick:()=>{this.registry.componentDetail?.show(),this.rightKey?.hide()}}),n.push({id:"hideSelected",label:"menu.hideSelected",group:"component",order:2,onClick:()=>{const r=this.engineInstance?.getHighlightModels();r&&this.engineInstance?.hideModels(r),this.rightKey?.hide()}}),n.push({id:"transparentSelected",label:"menu.transparentSelected",group:"component",order:3,onClick:()=>{const r=this.engineInstance?.getHighlightModels();r&&this.engineInstance?.translucentModels(r),this.rightKey?.hide()}}),n.push({id:"cancelTranslucent",label:"menu.cancelTranslucent",group:"component",order:4,onClick:()=>{this.engineInstance?.unTranslucentModel(),this.rightKey?.hide()}}),n.push({id:"componentColor",label:"menu.componentColor",group:"component",order:5,children:[{id:"setSelectedColor",label:"menu.setSelectedColor",onClick:()=>{this.rightKey?.hide(),this.openModelColorPicker(e.clientX,e.clientY)}},{id:"restoreSelectedColor",label:"menu.restoreSelectedColor",onClick:()=>{this.engineInstance?.restoreSelectedModelColor(),this.closeModelColorPicker(),this.rightKey?.hide()}},{id:"restoreAllColors",label:"menu.restoreAllColors",onClick:()=>{this.engineInstance?.restoreAllModelColors(),this.closeModelColorPicker(),this.rightKey?.hide()}}]}),n.push({id:"isolateSelected",label:"menu.isolateSelected",group:"component",order:6,divider:!0,children:[{id:"hideOthers",label:"menu.hideOthers",onClick:()=>{const r=this.engineInstance?.getHighlightModels();r&&this.engineInstance?.isolateModels(r),this.rightKey?.hide()}},{id:"transparentOthers",label:"menu.transparentOthers",onClick:()=>{const r=this.engineInstance?.getHighlightModels();r&&this.engineInstance?.translucentOtherModels(r),this.rightKey?.hide()}}]}),n.push({id:"quickSelect",label:"menu.quickSelect",group:"component",order:7,children:[{id:"selectSameType",label:"menu.selectSameType",onClick:()=>{const r=this.engineInstance?.getHighlightModels();r&&this.engineInstance?.batchSelectSameTypeModel(r),this.rightKey?.hide()}},{id:"selectSameLevel",label:"menu.selectSameLevel",onClick:()=>{const r=this.engineInstance?.getHighlightModels();r&&this.engineInstance?.batchSelectSameLevelModel(r),this.rightKey?.hide()}},{id:"selectSameLevelType",label:"menu.selectSameLevelType",onClick:()=>{const r=this.engineInstance?.getHighlightModels();r&&this.engineInstance?.batchSelectSameLevelTypeModel(r),this.rightKey?.hide()}}]}),n.push({id:"fitSectionBox",label:"menu.fitSectionBox",group:"component",order:8,onClick:()=>{fbe(this.engineInstance),this.rightKey?.hide()}})),this.registry.componentTreeDrawer?.isPinEditable()&&n.push({id:"createPin",label:"componentTreeDrawer.actions.addPin",group:"component",order:9,divider:!0,onClick:()=>{this.registry.componentTreeDrawer?.createPin(),this.rightKey?.hide()}}),n.push({id:"showAll",label:"menu.showAll",group:"component",order:10,onClick:()=>{this.engineInstance?.showAllModels(),this.emit("menu:show-all",{}),this.rightKey?.hide()}}),n};openModelColorPicker(e,t){this.closeModelColorPicker(),this.modelColorPicker=new gct({onColorSelect:(n,r)=>this.engineInstance?.setSelectedModelColor(n,r),onClose:()=>{this.modelColorPicker=null}}),this.modelColorPicker.show(e,t)}closeModelColorPicker(){const e=this.modelColorPicker;this.modelColorPicker=null,e?.destroy()}constructor(e,t,n){super(t),this.container=e,this.calibration={setCalibration:r=>this.setCalibration(r),apply:r=>this.applyCalibration(r),alignBySegments:r=>this.alignCalibrationBySegments(r),getMatrix:r=>this.getCalibrationMatrix(r),clear:r=>this.clearCalibration(r)},this.options={enableRightKeyMenu:n?.enableRightKeyMenu??!0}}getEngineComponent(){return this.engineInstance}async initialize(e){this.engineInstance&&this.engineInstance.isInitialized()&&(console.warn("[EngineManager] 3D Engine already initialized. Destroying old instance..."),this.engineInstance.destroy(),this.engineInstance=null);try{const t=new mct({container:this.container,...e},this.registry);return this.engineInstance=t,await t.init(),this.registry.viewDropdown?.init(),this.registry.helpPanel?.init(),this.rightKey&&this.rightKey!==this.registry.rightKey&&this.rightKey.destroy(),this.rightKey=null,this.options.enableRightKeyMenu?(this.rightKey=this.registry.rightKey??new VZ(this.container,this.registry),this.rightKey.unregisterHandler(this.defaultRightKeyHandler),this.rightKey.registerHandler(this.defaultRightKeyHandler),this.isCurrentInitializedEngine(t)):this.isCurrentInitializedEngine(t)}catch(t){return console.error("[EngineManager] Failed to initialize 3D engine:",t),this.engineInstance=null,!1}}isCurrentInitializedEngine(e){return this.engineInstance===e&&e.isInitialized()}isInitialized(){return this.engineInstance!==null&&this.engineInstance.isInitialized()}loadModel(e,t){if(!this.engineInstance){console.warn("[EngineManager] 3D Engine not initialized.");return}this.engineInstance.loadModel(e,t)}async loadModelByViewToken(e){if(!this.engineInstance){console.warn("[EngineManager] 3D Engine not initialized.");return}await this.engineInstance.loadModelByViewToken(e)}pickPoint(){return this.engineInstance?this.engineInstance.pickPoint():(console.warn("[EngineManager] 3D Engine not initialized."),Promise.resolve(null))}startPickPoint(e){return this.engineInstance?this.engineInstance.startPickPoint(e):(console.warn("[EngineManager] 3D Engine not initialized."),Promise.resolve(null))}createLabel(e){if(!this.engineInstance){console.warn("[EngineManager] 3D Engine not initialized.");return}return this.engineInstance.createLabel(e)}createLabels(e,t){return this.engineInstance?this.engineInstance.createLabels(e,t):(console.warn("[EngineManager] 3D Engine not initialized."),[])}updateLabel(e,t){return this.engineInstance?this.engineInstance.updateLabel(e,t):(console.warn("[EngineManager] 3D Engine not initialized."),!1)}deleteLabel(e){return this.engineInstance?this.engineInstance.deleteLabel(e):(console.warn("[EngineManager] 3D Engine not initialized."),!1)}removeLabel(e){return this.engineInstance?this.engineInstance.removeLabel(e):(console.warn("[EngineManager] 3D Engine not initialized."),!1)}clearLabels(){if(!this.engineInstance){console.warn("[EngineManager] 3D Engine not initialized.");return}this.engineInstance.clearLabels()}getLabel(e){if(!this.engineInstance){console.warn("[EngineManager] 3D Engine not initialized.");return}return this.engineInstance.getLabel(e)}getLabels(){return this.engineInstance?this.engineInstance.getLabels():(console.warn("[EngineManager] 3D Engine not initialized."),[])}onLabelClick(e){return this.engineInstance?this.engineInstance.onLabelClick(e):(console.warn("[EngineManager] 3D Engine not initialized."),()=>{})}offLabelClick(e){if(!this.engineInstance){console.warn("[EngineManager] 3D Engine not initialized.");return}this.engineInstance.offLabelClick(e)}setCalibration(e){return this.engineInstance?this.engineInstance.setCalibration(e):(console.warn("[EngineManager] 3D Engine not initialized."),!1)}applyCalibration(e){return this.engineInstance?this.engineInstance.applyCalibration(e):(console.warn("[EngineManager] 3D Engine not initialized."),!1)}alignCalibrationBySegments(e){return this.engineInstance?this.engineInstance.alignCalibrationBySegments(e):(console.warn("[EngineManager] 3D Engine not initialized."),!1)}getCalibrationMatrix(e){return this.engineInstance?this.engineInstance.getCalibrationMatrix(e):(console.warn("[EngineManager] 3D Engine not initialized."),null)}clearCalibration(e){return this.engineInstance?this.engineInstance.clearCalibration(e):(console.warn("[EngineManager] 3D Engine not initialized."),!1)}setModelCalibrationTransform(e){return this.engineInstance?this.engineInstance.setModelCalibrationTransform(e):(console.warn("[EngineManager] 3D Engine not initialized."),!1)}getModelCalibrationTransform(e){return this.engineInstance?this.engineInstance.getModelCalibrationTransform(e):(console.warn("[EngineManager] 3D Engine not initialized."),null)}getModelCalibrationItems(){return this.engineInstance?this.engineInstance.getModelCalibrationItems():(console.warn("[EngineManager] 3D Engine not initialized."),[])}resetModelCalibration(e){return this.engineInstance?this.engineInstance.resetModelCalibration(e):(console.warn("[EngineManager] 3D Engine not initialized."),!1)}pauseRendering(){if(!this.engineInstance){console.warn("[EngineManager] 3D Engine not initialized.");return}this.engineInstance.pauseRendering()}resumeRendering(){if(!this.engineInstance){console.warn("[EngineManager] 3D Engine not initialized.");return}this.engineInstance.resumeRendering()}captureViewBase64(e="image/png",t){return this.engineInstance?this.engineInstance.captureViewBase64(e,t):(console.warn("[EngineManager] 3D Engine not initialized."),null)}addViewDropdownButton(e){return this.registry.viewDropdown?this.registry.viewDropdown.addButton(e):(console.warn("[EngineManager] View dropdown manager not initialized."),()=>{})}removeViewDropdownButton(e){if(!this.registry.viewDropdown){console.warn("[EngineManager] View dropdown manager not initialized.");return}this.registry.viewDropdown.removeButton(e)}async restoreViewSnapshot(e){if(!this.engineInstance){console.warn("[EngineManager] 3D Engine not initialized.");return}return this.engineInstance.restoreViewSnapshot(e)}getModelPosition(e){return this.engineInstance?this.engineInstance.getModelPosition(e):(console.warn("[EngineManager] 3D Engine not initialized."),null)}jumpToCamera(e){return this.engineInstance?this.engineInstance.jumpToCamera(e):(console.warn("[EngineManager] 3D Engine not initialized."),!1)}setMainViewPort(e){if(!this.engineInstance){console.warn("[EngineManager] 3D Engine not initialized.");return}this.engineInstance.setMainViewPort(e)}getConstructTreeData(e){if(!this.engineInstance)return console.warn("[EngineManager] 3D Engine not initialized."),{level:[],type:[],major:[]};const t=Act(e?.type),n={level:t.has("level")?this.engineInstance.getLevelTreeData():[],type:t.has("type")?this.engineInstance.getTypeTreeData():[],major:t.has("major")?this.engineInstance.getMajorTreeData():[]};return{level:GZ(n.level,e),type:GZ(n.type,e),major:GZ(n.major,e)}}getComponentProperties(e,t,n){if(!this.engineInstance){console.warn("[EngineManager] 3D Engine not initialized.");return}this.engineInstance.getComponentProperties(e,t,n)}highlightModel(e){if(!this.engineInstance){console.warn("[EngineManager] 3D Engine not initialized.");return}this.engineInstance.highlightModel(e)}hideModels(e){if(!this.engineInstance){console.warn("[EngineManager] 3D Engine not initialized.");return}this.engineInstance.hideModels(e)}translucentModels(e){if(!this.engineInstance){console.warn("[EngineManager] 3D Engine not initialized.");return}this.engineInstance.translucentModels(e)}showAllModels(e){if(!this.engineInstance){console.warn("[EngineManager] 3D Engine not initialized.");return}this.engineInstance.showAllModels(e)}activeModelLink3d(){if(!this.engineInstance){console.warn("[EngineManager] 3D Engine not initialized.");return}this.engineInstance.activeModelLink3d()}disActiveModelLink3d(){if(!this.engineInstance){console.warn("[EngineManager] 3D Engine not initialized.");return}this.engineInstance.disActiveModelLink3d()}unTranslucentModel(){if(!this.engineInstance){console.warn("[EngineManager] 3D Engine not initialized.");return}this.engineInstance.unTranslucentModel()}isolateModels(e){if(!this.engineInstance){console.warn("[EngineManager] 3D Engine not initialized.");return}this.engineInstance.isolateModels(e)}translucentOtherModels(e){if(!this.engineInstance){console.warn("[EngineManager] 3D Engine not initialized.");return}this.engineInstance.translucentOtherModels(e)}fitSectionBoxToModels(e){return this.engineInstance?this.engineInstance.fitSectionBoxToModels(e):(console.warn("[EngineManager] 3D Engine not initialized."),!1)}setPinRecords(e){if(console.log("[EngineManager] setPinRecords called, records count:",e.length),!this.engineInstance){console.warn("[EngineManager] 3D Engine not initialized.");return}this.engineInstance.setPinRecords(e)}setPinList(e){this.setPinRecords(e)}registerRightKeyHandler(e){if(!this.rightKey){console.warn("[EngineManager] RightKey manager not initialized.");return}this.rightKey.registerHandler(e)}unregisterRightKeyHandler(e){if(!this.rightKey){console.warn("[EngineManager] RightKey manager not initialized.");return}this.rightKey.unregisterHandler(e)}clearRightKeyHandlers(e=!0){if(!this.rightKey){console.warn("[EngineManager] RightKey manager not initialized.");return}this.rightKey.clearHandlers(e)}showRightKeyMenu(e,t,n,r){if(!this.rightKey){console.warn("[EngineManager] RightKey manager not initialized.");return}this.rightKey.showMenu(e,t,n,r)}hideRightKeyMenu(){if(!this.rightKey){console.warn("[EngineManager] RightKey manager not initialized.");return}this.rightKey.hide()}destroy(){this.closeModelColorPicker(),this.rightKey&&this.rightKey.unregisterHandler(this.defaultRightKeyHandler),this.engineInstance&&(this.engineInstance.destroy(),this.engineInstance=null),this.rightKey&&this.rightKey!==this.registry.rightKey&&this.rightKey.destroy(),this.rightKey=null,super.destroy()}}const ybe={测量:'<svg width="48" height="48" viewBox="0 0 48 48"><path fill="currentColor" d="M0,28.207H3.429v3.526H44.571V28.207H48v7.052H0ZM0,3.526v14.1a3.478,3.478,0,0,0,3.429,3.526H6.857V17.629h3.429v3.526h3.429V17.629h3.429v3.526h3.429V10.578H24V21.155h3.429V17.629h3.429v3.526h3.429V17.629h3.429v3.526h3.429V10.578h3.429V21.155A3.478,3.478,0,0,0,48,17.629V3.526A3.478,3.478,0,0,0,44.571,0H3.429A3.478,3.478,0,0,0,0,3.526Z" transform="translate(0 5.456)"/></svg>',地图:'<svg width="48" height="48" viewBox="0 0 48 48"><path fill="currentColor" d="M32.984,563.2H26.329a66.982,66.982,0,0,1-5.471,7.121l-1.455,1.61-1.455-1.61a66.978,66.978,0,0,1-5.471-7.121H5.821L0,580.662H38.8Z" transform="translate(4.598 -537.259)"/><path fill="currentColor" d="M275.4,9.7a9.7,9.7,0,1,0-19.4,0c0,6.636,9.7,17.462,9.7,17.462S275.4,16.337,275.4,9.7Zm-13.582,0a3.88,3.88,0,1,1,3.88,3.88,3.88,3.88,0,0,1-3.88-3.88Z" transform="translate(-241.701 4.598)"/></svg>',框选放大:'<svg width="48" height="48" viewBox="0 0 48 48"><path fill="currentColor" d="M336.351,336.158l-5.5.037-.037-5.5-3.665.025.037,5.5-5.491.037.025,3.665,5.491-.037.041,5.491,3.661-.025-.037-5.491,5.5-.041Z" transform="translate(-305.467 -314.477)"/><path fill="currentColor" d="M41.88,40.861l-.227-.223-7.167-7.068a14.787,14.787,0,1,0-2.832,2.4l7.4,7.3.227.223.021-.021a1.821,1.821,0,0,0,1.065.33,1.849,1.849,0,0,0,1.837-1.862,1.868,1.868,0,0,0-.343-1.061l.017-.021ZM23.648,34.668A11.1,11.1,0,1,1,34.675,23.487,11.106,11.106,0,0,1,23.648,34.668ZM3,41.492H6.241v3.241H3ZM3,15.564H6.241v3.241H3ZM3,2.6H6.241V5.841H3Zm12.964,0h3.241V5.841H15.964Zm-6.482,0h3.241V5.841H9.482Zm12.964,0h3.241V5.841H22.446Zm6.482,0h3.241V5.841H28.928Zm6.482,0h3.241V5.841H35.41Zm6.482,0h3.241V5.841H41.892Zm0,6.482h3.241v3.241H41.892Zm0,6.482h3.241v3.241H41.892Zm0,6.482h3.241v3.241H41.892ZM9.482,41.492h3.241v3.241H9.482Zm6.482,0h3.241v3.241H15.964Zm6.482,0h3.241v3.241H22.446ZM3,9.082H6.241v3.241H3ZM3,22.046H6.241v3.241H3Zm38.892,6.482h3.241v3.241H41.892ZM3,28.528H6.241v3.241H3ZM3,35.01H6.241v3.241H3Z" transform="translate(-0.067 0.333)"/></svg>',漫游:'<svg width="48" height="48" viewBox="0 0 48 48"><path fill="currentColor" d="M327.239,38.548a6.01,6.01,0,1,0-6.358-6A6.144,6.144,0,0,0,327.239,38.548Zm8.006,5.76a3.082,3.082,0,0,0-3.061-2.64h-1.648c-.471,0-.706.24-1.177.48l-2.119,1.68-2.119-1.92a1.781,1.781,0,0,0-1.177-.48h-1.648a2.914,2.914,0,0,0-3.061,2.64l-1.413,10.8c0,.48,0,.96.471,1.2a1.781,1.781,0,0,0,1.177.48h1.648l1.413,15.36a3.082,3.082,0,0,0,3.061,2.64h3.532a2.914,2.914,0,0,0,3.061-2.64l1.413-15.36h1.648a1.781,1.781,0,0,0,1.177-.48,2.2,2.2,0,0,0,.235-1.2Z" transform="translate(-303.239 -26.548)"/></svg>',目录树:'<svg width="48" height="48" viewBox="0 0 48 48"><path fill="currentColor" d="M116.8,153.474h12a1.2,1.2,0,0,0,1.2-1.185v-7.111a1.2,1.2,0,0,0-1.2-1.184h-12a1.2,1.2,0,0,0-1.2,1.184v1.629H93.553v-7.554H100a1.2,1.2,0,0,0,1.2-1.185v-7.112a1.2,1.2,0,0,0-1.2-1.185H83.2a1.2,1.2,0,0,0-1.2,1.185v7.112a1.2,1.2,0,0,0,1.2,1.185h6.45v28a2.383,2.383,0,0,0,2.4,2.37H115.6v1.63a1.2,1.2,0,0,0,1.2,1.185h12a1.2,1.2,0,0,0,1.2-1.185v-7.112a1.2,1.2,0,0,0-1.2-1.185h-12a1.2,1.2,0,0,0-1.2,1.185v1.63H93.553V150.657H115.6v1.629a1.2,1.2,0,0,0,1.2,1.185Z" transform="translate(-82 -126.874)"/></svg>',剖切:'<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48" fill="currentColor"><g transform="translate(-176.967 -101.068)"><path d="M306.33,364.55h14.737v19.115H306.33Z" transform="translate(-118.068 -248.554)"/><path d="M487.114,140.356a1.6,1.6,0,0,1-1.744-1.393V99.573a1.787,1.787,0,0,1,3.487,0v39.389A1.6,1.6,0,0,1,487.114,140.356Z" transform="translate(-285.677 6.11)"/><path d="M508.34,274.031H487.114a1.743,1.743,0,1,1,0-3.487h17.739V242.767H487.114a1.744,1.744,0,1,1,0-3.487H508.34Z" transform="translate(-285.677 -131.282)"/><path d="M201.437,274.031h-3.278a1.743,1.743,0,1,1,0-3.487h3.278a1.743,1.743,0,1,1,0,3.487Zm-8.858,0H187a1.743,1.743,0,1,1,0-3.487h5.579a1.743,1.743,0,1,1,0,3.487Zm-10.626-.532a1.743,1.743,0,0,1-1.743-1.744v-5.579a1.743,1.743,0,1,1,3.487,0v5.579A1.743,1.743,0,0,1,181.953,273.5Zm0-11.159a1.743,1.743,0,0,1-1.743-1.743v-5.579a1.743,1.743,0,1,1,3.487,0V260.6A1.743,1.743,0,0,1,181.953,262.34Zm0-11.158a1.744,1.744,0,0,1-1.743-1.744v-5.579a1.743,1.743,0,1,1,3.487,0v5.579A1.744,1.744,0,0,1,181.953,251.181Zm19.484-8.414h-5.579a1.744,1.744,0,1,1,0-3.487h5.579a1.744,1.744,0,0,1,0,3.487Zm-11.159,0H184.7a1.744,1.744,0,1,1,0-3.487h5.579a1.744,1.744,0,1,1,0,3.487Z" transform="translate(0 -131.282)"/></g></svg>',剖切盒:'<svg width="48" height="48" viewBox="0 0 48 48" fill="currentColor"><g transform="translate(-56.83 2.793)"><path d="M194.963,19.168a1.69,1.69,0,0,1-.607-.119l-19.027-8.292a1.253,1.253,0,0,1,0-2.35L191.289.112a1.592,1.592,0,0,1,1.24,0l18.663,8.294a1.267,1.267,0,0,1,.791,1.175,1.308,1.308,0,0,1-.791,1.175l-15.6,8.278a1.519,1.519,0,0,1-.633.143Zm-15.7-9.586,15.7,6.832,12.331-6.832L191.9,2.749Z" transform="translate(-109.947 0)"/><path d="M195.008,417.821a1.691,1.691,0,0,1-.607-.119l-19.025-8.294a1.253,1.253,0,0,1,0-2.35l15.958-8.294a1.592,1.592,0,0,1,1.24,0l18.657,8.294a1.267,1.267,0,0,1,.791,1.175,1.308,1.308,0,0,1-.791,1.175l-15.6,8.278c-.211.095-3.483.143-3.694.143Zm-15.6-9.588,15.6,6.832,12.329-6.832L191.948,401.4Z" transform="translate(-109.992 -382.638)"/><path d="M200.046,603.93a1.976,1.976,0,0,1-.634-.119l-18.774-8.3a1.257,1.257,0,0,1-.655-1.754,1.512,1.512,0,0,1,1.931-.595l18.131,8.013,14.971-8.007a1.51,1.51,0,0,1,1.928.6,1.256,1.256,0,0,1-.661,1.75l-15.6,8.282a1.489,1.489,0,0,1-.634.119Z" transform="translate(-115.041 -568.787)"/><path d="M101.029,216.82a1.467,1.467,0,0,1-1-.377,1.237,1.237,0,0,1-.41-.917V198.817a1.413,1.413,0,0,1,2.816,0V215.5a1.241,1.241,0,0,1-.4.931A1.472,1.472,0,0,1,101.029,216.82Zm-34.377.143a1.467,1.467,0,0,1-1-.377,1.237,1.237,0,0,1-.41-.917V198.817a1.413,1.413,0,0,1,2.816,0v16.852a1.237,1.237,0,0,1-.41.917A1.467,1.467,0,0,1,66.652,216.964Zm-5.215,2.8a1.467,1.467,0,0,1-1-.377,1.237,1.237,0,0,1-.41-.917V201.621a1.413,1.413,0,0,1,2.816,0v16.852a1.237,1.237,0,0,1-.41.917A1.467,1.467,0,0,1,61.436,219.768Z" transform="translate(-0.4 -189.683)"/><path d="M60.922,37.617A1.32,1.32,0,0,1,60,37.258a1.2,1.2,0,0,1-.378-.876V20.295a1.3,1.3,0,0,1,2.588,0V36.382a1.276,1.276,0,0,1-1.294,1.235Zm-1.175,8.411a1.341,1.341,0,0,1,1.75-.578l15.126,7.071a1.224,1.224,0,0,1,.6,1.671,1.337,1.337,0,0,1-1.75.572L60.347,47.708a1.228,1.228,0,0,1-.606-1.671Z" transform="translate(0 -18.25)"/><path d="M71.756,44.947a1.337,1.337,0,0,1,1.75-.582l15.126,7.118a1.235,1.235,0,0,1,.6,1.682,1.333,1.333,0,0,1-1.75.576L72.356,46.629a1.239,1.239,0,0,1-.606-1.682ZM59.915,12.652a1.337,1.337,0,0,1,1.75-.582L76.79,19.194a1.235,1.235,0,0,1,.6,1.682,1.333,1.333,0,0,1-1.75.576L60.515,14.334A1.247,1.247,0,0,1,59.915,12.652Z" transform="translate(-0.168 -11.442)"/><path d="M334.418,146.671a1.341,1.341,0,0,1,1.75-.578l15.126,7.073a1.224,1.224,0,0,1,.6,1.671,1.337,1.337,0,0,1-1.75.573l-15.126-7.09a1.25,1.25,0,0,1-.663-.7,1.177,1.177,0,0,1,.058-.945Zm16.3,35.276a1.32,1.32,0,0,1-.917-.36,1.2,1.2,0,0,1-.377-.875v-16.1a1.3,1.3,0,0,1,2.588,0V180.7a1.2,1.2,0,0,1-.38.878,1.321,1.321,0,0,1-.922.357Z" transform="translate(-260.918 -139.687)"/><path d="M576.438,360.4a1.288,1.288,0,0,1-1.294-1.294V342.253a1.294,1.294,0,1,1,2.588,0v16.852A1.3,1.3,0,0,1,576.438,360.4ZM572.8,344.248,573,361.1l-2.613.024-.2-16.857Z" transform="translate(-486.154 -327.316)"/><path d="M508.543,26.833l.192,16.852-2.613.024-.192-16.852Z" transform="translate(-425.253 -25.689)"/></g></svg>',全屏:'<svg width="48" height="48" viewBox="0 0 48 48"><path fill="currentColor" d="M6.241,3.671H12.85a1.734,1.734,0,0,0,1.836-1.836A1.734,1.734,0,0,0,12.85,0H1.469C1.1,0,.734.367.367.734A1.349,1.349,0,0,0,0,1.836V12.85a1.734,1.734,0,0,0,1.836,1.836A1.734,1.734,0,0,0,3.671,12.85V6.241l9.913,9.913a1.817,1.817,0,1,0,2.57-2.57ZM13.584,27.9,6.975,34.51l-3.3,3.3V31.206a1.734,1.734,0,0,0-1.836-1.836A1.734,1.734,0,0,0,0,31.206V42.22a1.734,1.734,0,0,0,1.836,1.836H12.85a1.836,1.836,0,0,0,0-3.671H6.241l3.3-3.3,6.608-6.608a1.817,1.817,0,1,0-2.57-2.57ZM42.22,29.371a1.734,1.734,0,0,0-1.836,1.836v6.608l-3.3-3.3L30.472,27.9a1.817,1.817,0,1,0-2.57,2.57L34.51,37.08l3.3,3.3H31.206a1.836,1.836,0,1,0,0,3.671H42.22a1.734,1.734,0,0,0,1.836-1.836V31.206a1.734,1.734,0,0,0-1.836-1.836ZM42.22,0H31.206a1.734,1.734,0,0,0-1.836,1.836,1.734,1.734,0,0,0,1.836,1.836h6.608l-3.3,3.3L27.9,13.584a1.817,1.817,0,1,0,2.57,2.57L37.08,9.545l3.3-3.3V12.85a1.836,1.836,0,0,0,3.671,0V1.836A1.734,1.734,0,0,0,42.22,0Z" transform="translate(1.972 1.972)"/></svg>',设置:'<svg width="48" height="48" viewBox="0 0 48 48"><path fill="currentColor" d="M112.388,106.443l-2.668-.373a1.687,1.687,0,0,1-1.306-1.031,16.337,16.337,0,0,0-2-3.475,1.681,1.681,0,0,1-.243-1.646l1.012-2.5a1.652,1.652,0,0,0-.709-2.057l-5.769-3.335a1.654,1.654,0,0,0-2.136.415L96.919,94.56a1.693,1.693,0,0,1-1.562.62,15.32,15.32,0,0,0-3.992,0,1.693,1.693,0,0,1-1.562-.62l-1.651-2.113a1.654,1.654,0,0,0-2.136-.415l-5.769,3.33a1.659,1.659,0,0,0-.709,2.057l1.012,2.5a1.679,1.679,0,0,1-.243,1.646,16.141,16.141,0,0,0-2,3.475A1.669,1.669,0,0,1,77,106.066l-2.668.373a1.663,1.663,0,0,0-1.432,1.646v6.665a1.662,1.662,0,0,0,1.427,1.642l2.668.373a1.687,1.687,0,0,1,1.306,1.031,16.338,16.338,0,0,0,2,3.475,1.681,1.681,0,0,1,.243,1.646l-1.012,2.5a1.652,1.652,0,0,0,.709,2.057l5.769,3.33a1.654,1.654,0,0,0,2.136-.415L89.8,128.27a1.693,1.693,0,0,1,1.562-.62,15.321,15.321,0,0,0,3.992,0,1.693,1.693,0,0,1,1.562.62l1.651,2.113a1.654,1.654,0,0,0,2.136.415l5.769-3.33a1.659,1.659,0,0,0,.709-2.057l-1.012-2.5a1.681,1.681,0,0,1,.243-1.646,16.141,16.141,0,0,0,2-3.475,1.669,1.669,0,0,1,1.306-1.031l2.668-.373a1.658,1.658,0,0,0,1.427-1.642v-6.665A1.639,1.639,0,0,0,112.388,106.443ZM93.36,117.893a6.478,6.478,0,1,1,6.478-6.478A6.479,6.479,0,0,1,93.36,117.893Z" transform="translate(-69.355 -87.415)"/></svg>',眼睛:'<svg width="48" height="48" viewBox="0 0 48 48" fill="currentColor"><path d="M24 10C13.2 10 5.2 18.2 2.4 23.1a1.8 1.8 0 0 0 0 1.8C5.2 29.8 13.2 38 24 38s18.8-8.2 21.6-13.1a1.8 1.8 0 0 0 0-1.8C42.8 18.2 34.8 10 24 10Zm0 24c-8.4 0-14.9-6-17.4-10C9.1 20 15.6 14 24 14s14.9 6 17.4 10C38.9 28 32.4 34 24 34Z"/><path d="M24 17a7 7 0 1 0 0 14a7 7 0 0 0 0-14Zm0 10a3 3 0 1 1 0-6a3 3 0 0 1 0 6Z"/></svg>',联动模型:'<svg width="48" height="48" viewBox="0 0 48 48" fill="currentColor"><path d="M18.2 31.7a9.2 9.2 0 0 1 0-13l4.3-4.3a9.2 9.2 0 0 1 13 13l-3.4 3.4a2 2 0 0 1-2.8-2.8l3.4-3.4a5.2 5.2 0 0 0-7.4-7.4L21 21.5a5.2 5.2 0 0 0 0 7.4a2 2 0 1 1-2.8 2.8Z"/><path d="M12.5 20.6l3.4-3.4a2 2 0 0 1 2.8 2.8l-3.4 3.4a5.2 5.2 0 0 0 7.4 7.4l4.3-4.3a5.2 5.2 0 0 0 0-7.4a2 2 0 0 1 2.8-2.8a9.2 9.2 0 0 1 0 13l-4.3 4.3a9.2 9.2 0 0 1-13-13Z"/></svg>',拾曲面剖切:'<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48" fill="currentColor"><g transform="translate(-59.63 -21.333)"><path d="M302.465,495.393l2.363-4.363a.842.842,0,0,1,1.091-.273.914.914,0,0,1,.454,1l-1.636,3,11.453-3.454c.091,0,.091,0,.182-.091a.785.785,0,1,1,.273,1.545l-11.453,3.454,3,1.545h.091a.645.645,0,0,1,.182,1,.842.842,0,0,1-1.091.273l-4.545-2.363c-.091,0-.182-.091-.273-.182A.742.742,0,0,1,302.465,495.393Z" transform="translate(205.84 -520.136) rotate(43)"/><path d="M88.23,54.014v2.86l-21.123,8.17V34l21.123-8.17V47.069h2.9l-.207-25.736L64,31.75V69.333L91.129,58.916v-4.9Z"/><path d="M199,255.9l-15.532,6.268v-21.23L199,234.667Z" transform="translate(-113.668 -202.979)"/></g></svg>',轴向剖切:'<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48" fill="currentColor"><g transform="translate(-59.63 -21.333)"><path d="M.194,3.727,2.558,8.089a.842.842,0,0,0,1.091.273.914.914,0,0,0,.454-1l-1.636-3L13.919,7.817c.091,0,.091,0,.182.091a.785.785,0,1,0,.273-1.545L2.921,2.909l3-1.545h.091a.645.645,0,0,0,.182-1A.842.842,0,0,0,5.1.091L.558,2.454c-.091,0-.182.091-.273.182A.742.742,0,0,0,.194,3.727Z" transform="translate(102.244 57.563) rotate(-178)"/><path d="M88.23,54.014v2.86l-21.123,8.17V34l21.123-8.17V47.069h2.9l-.207-25.736L64,31.75V69.333L91.129,58.916v-4.9Z"/><path d="M199,255.9l-15.532,6.268v-21.23L199,234.667Z" transform="translate(-113.668 -202.979)"/></g></svg>',主视角:'<svg width="48" height="48" viewBox="0 0 48 48"><path fill="currentColor" d="M122.32,181.835v-13.16h-9.87V163.74h19.74v18.095Zm-19.74,0V163.74h9.87v18.095ZM96,163.74,117.385,144l21.385,19.74Z" transform="translate(-93.385 -138.917)"/></svg>',文档:'<svg width="48" height="48" viewBox="0 0 48 48"><path fill="currentColor" d="M64,128h1.714v41.143H64Zm46.286,0H112v41.143h-1.714Zm-44.571,0h44.571v3.429H65.714Zm0,6.857h44.571v3.429H65.714Zm0-3.429h3.429v3.429H65.714Zm8.571,0h3.429v3.429H74.286Zm8.571,0h27.429v3.429H82.857Zm-17.143,36h44.571v1.714H65.714Zm5.143-24H76v1.714H70.857Zm10.286,0h24v1.714h-24Zm-10.286,6.857H76V152H70.857Zm10.286,0h24V152h-24Zm-10.286,6.857H76v1.714H70.857Zm10.286,0h24v1.714h-24Z" transform="translate(-64 -124.571)"/></svg>',第一人称漫游:'<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48" fill="currentColor"><path d="M178.325,132.27a6.411,6.411,0,0,0,0-9.429,7.359,7.359,0,0,0-9.984,0,6.411,6.411,0,0,0,0,9.429,7.359,7.359,0,0,0,9.984,0Zm-2-7.543a3.845,3.845,0,0,1,0,5.657,4.414,4.414,0,0,1-5.99,0,3.847,3.847,0,0,1,0-5.657,4.414,4.414,0,0,1,5.99,0Zm6.618,31.639q4.975,1.006,4.975,3.189t-4.975,3.189a57.4,57.4,0,0,1-19.226,0q-4.973-1.006-4.973-3.189t4.975-3.189q.777-.156,1.613-.284v-2.521a4.488,4.488,0,0,1-1.412.217,4.761,4.761,0,0,1-.587-.036l-.038,0a29.007,29.007,0,0,0-7.657,2.332q-3.482,1.712-3.482,3.484a2.944,2.944,0,0,0,1.3,2.116,14.359,14.359,0,0,0,4.4,2.293,46.614,46.614,0,0,0,15.477,2.258,46.614,46.614,0,0,0,15.477-2.258,14.362,14.362,0,0,0,4.4-2.293,2.943,2.943,0,0,0,1.3-2.116q0-1.772-3.482-3.484a29.007,29.007,0,0,0-7.657-2.332,4.908,4.908,0,0,1-.625.039,4.488,4.488,0,0,1-1.412-.217v2.521q.836.128,1.613.284Zm-14.788-6.588v5.979q2.391-.2,5.176-.2t5.176.2v-12.2h2.824v6.222a1.25,1.25,0,0,0,.414.942v0l.081.071q.744.1,1.457.22a1.41,1.41,0,0,0,.457-.293,1.25,1.25,0,0,0,.414-.942v-8a3.75,3.75,0,0,0-1.24-2.828,4.2,4.2,0,0,0-2.995-1.172H166.745a4.2,4.2,0,0,0-2.995,1.172,3.75,3.75,0,0,0-1.24,2.828v8a1.268,1.268,0,0,0,.414.942,1.415,1.415,0,0,0,.456.293q.715-.119,1.459-.222.041-.034.081-.071a1.25,1.25,0,0,0,.414-.942v-6.222h2.824Zm-8.471-6.222v-1.778a6.253,6.253,0,0,1,2.067-4.715,7.013,7.013,0,0,1,4.992-1.952h13.176a7.013,7.013,0,0,1,4.992,1.952,6.253,6.253,0,0,1,2.067,4.715v8a3.722,3.722,0,0,1-.484,1.881l0,.005a28.526,28.526,0,0,1,5.841,2.041q5,2.462,5,5.851,0,4.238-7.531,6.9a49.5,49.5,0,0,1-16.469,2.428,49.5,49.5,0,0,1-16.469-2.428q-7.531-2.667-7.531-6.9,0-3.388,5-5.849a28.381,28.381,0,0,1,5.841-2.044,3.707,3.707,0,0,1-.488-1.884Zm24.8,16a13.145,13.145,0,0,0-2.129-.581,54.5,54.5,0,0,0-18.044,0,13.079,13.079,0,0,0-2.127.581,13.078,13.078,0,0,0,2.127.581,54.5,54.5,0,0,0,18.044,0,13.078,13.078,0,0,0,2.127-.581Z" transform="translate(-149.333 -120.889)"/></svg>',反向:'<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48" fill="currentColor"><g transform="translate(0.364 4.658)"><path d="M0,287.1m0-.817v-2.042a.722.722,0,0,1,.817-.817H44.509a.722.722,0,0,1,.817.817v2.042a.722.722,0,0,1-.817.817H.817A.722.722,0,0,1,0,286.28Z" transform="translate(-0.001 -272.164)"/><path d="M829.7,13.238l-1.443,1.444a.817.817,0,0,1-1.155,0L815.263,2.844a.817.817,0,0,1,0-1.156L816.706.244a.817.817,0,0,1,1.155,0L829.7,12.083a.817.817,0,0,1,0,1.155Z" transform="translate(-782.667)"/><path d="M94.367,648m0,.817v2.042a.722.722,0,0,1-.817.817H49.858a.722.722,0,0,1-.817-.817v-2.042a.722.722,0,0,1,.817-.817H93.55A.722.722,0,0,1,94.367,648.816Z" transform="translate(-47.095 -622.268)"/><path d="M.239,649.97l1.443-1.444a.817.817,0,0,1,1.155,0l11.838,11.838a.817.817,0,0,1,0,1.156l-1.443,1.443a.817.817,0,0,1-1.155,0L.239,651.124a.817.817,0,0,1,0-1.155Z" transform="translate(0 -622.544)"/></g></svg>',路径漫游:'<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48" fill="currentColor"><g transform="translate(0 -4.9)"><path d="M43.755,35.8a23.352,23.352,0,0,1-8.074-3.095c-1.131-.912-2.263-1.819-2.263-3.458,0-.364-.164-.548-.486-.548-1.776-.364-2.263,0-1.935,2.183a5,5,0,0,0,1.776,3.095,14.337,14.337,0,0,0,4.521,2.551c2.1.912,4.521,1.276,6.461,2.551,1.935,1.091,2.1,2.551.809,4.37A12.572,12.572,0,0,1,37.3,48.187a30.594,30.594,0,0,1-17.115-1.455c-2.585-.912-4.2-.364-5.488,2,0,.184-.164.184-.323.548,2.1.728,3.876,1.455,5.811,2,5.811,1.639,11.786,2.367,17.76.548A14.453,14.453,0,0,0,46.663,45.1c2.422-4.2,1.613-8.381-2.908-9.293Zm-19.7-7.97a11.943,11.943,0,0,0-7.382-10.952A12.17,12.17,0,0,0,3.457,19.546a10.951,10.951,0,0,0-2.3,12.879c2.459,5.329,6.456,9.77,10.453,14.06.463.444.617.444,1.075,0,3.689-4.143,7.382-8.287,10-13.172A11.6,11.6,0,0,0,24.059,27.833Zm-4.151,3.255c-1.692,3.851-4.614,6.955-7.382,10.215-.463.444-.617.3-.921,0A44.891,44.891,0,0,1,4.228,31.088a7.684,7.684,0,0,1-.767-3.109A8.664,8.664,0,0,1,18.22,21.909a8.155,8.155,0,0,1,1.688,9.18ZM33.007,4.9c-5.685,0-9.785,6.416-7.274,11.76,1.454,3.34,4.1,5.745,6.746,8.15a.492.492,0,0,0,.795,0c2.908-2.537,5.554-5.211,7.008-8.821A8.117,8.117,0,0,0,33.007,4.9Zm4.366,10.422A16.825,16.825,0,0,1,33.4,20c-.4.269-.659.269-.926,0a16.342,16.342,0,0,1-3.969-4.545,5.033,5.033,0,1,1,8.864-.132Z"/><path d="M183.031,141.935a2.136,2.136,0,0,0,2.053-2.18,2.084,2.084,0,0,0-2.18-2.18,2.171,2.171,0,0,0-2.053,2.307A2.058,2.058,0,0,0,183.031,141.935Zm-20.094,7.854a4.7,4.7,0,0,0-4.6,4.881,4.913,4.913,0,0,0,4.74,4.881,4.882,4.882,0,0,0-.14-9.762Zm0,6.417a1.77,1.77,0,0,1-1.532-1.532A1.79,1.79,0,0,1,162.937,153a1.611,1.611,0,0,1,1.672,1.672A1.578,1.578,0,0,1,162.937,156.206Z" transform="translate(-150.629 -126.653)"/></g></svg>',适应到模型:'<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48" fill="currentColor"><g transform="translate(-84.667 -84.667)"><path d="M87.667,97V87.667H97V85.333H86.733a1.4,1.4,0,0,0-1.4,1.4V97Zm0,23.333H85.333V130.6a1.4,1.4,0,0,0,1.4,1.4H97v-2.333H87.667v-9.333Zm32.667,9.333V132H130.6a1.4,1.4,0,0,0,1.4-1.4V120.333h-2.333v9.333h-9.333ZM129.667,97H132V86.733a1.4,1.4,0,0,0-1.4-1.4H120.333v2.333h9.333Z"/><path d="M270.857,243.5l11.3-6.652V223.387l-11.3,6.361V243.5Zm-1.8,0v-13.75l-11.3-6.361v13.456l11.3,6.652Zm-10.278-21.621,11.177,6.284,11.177-6.284L269.958,215.3l-11.177,6.573Zm11.622-8.426,13.1,7.709a.919.919,0,0,1,.448.793v15.419a.926.926,0,0,1-.448.793l-13.1,7.709a.887.887,0,0,1-.9,0l-13.1-7.709a.905.905,0,0,1-.448-.793V221.954a.919.919,0,0,1,.448-.793l13.1-7.709A.887.887,0,0,1,270.4,213.452Z" transform="translate(-161.292 -120.997)"/></g></svg>',隐藏:'<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48" fill="currentColor"><path d="M61.274,76.178l0-.007-.007,0a32.458,32.458,0,0,0-7.014-9.981L51.53,68.91a28.382,28.382,0,0,1,6.124,8.635c-4.472,9.25-10.809,13.636-19.472,13.636A20.615,20.615,0,0,1,30.6,89.838l-2.937,2.933a23.916,23.916,0,0,0,10.514,2.277q15.472,0,23.088-16.116a3.229,3.229,0,0,0,0-2.755ZM57.839,58.351l-2.274-2.277a.429.429,0,0,0-.608,0l-6.265,6.262a23.775,23.775,0,0,0-10.51-2.281q-15.472,0-23.088,16.116v.007a3.236,3.236,0,0,0,0,2.765,32.617,32.617,0,0,0,7.014,9.985L16.7,94.32a.429.429,0,0,0,0,.608l2.274,2.277a.429.429,0,0,0,.608,0L57.839,58.949a.426.426,0,0,0,0-.6ZM32.113,78.915a6.011,6.011,0,0,1,7.22-7.22l-7.223,7.22Zm9.9-9.9A9.452,9.452,0,0,0,29.43,81.6l-4.6,4.6a28.424,28.424,0,0,1-6.124-8.635c4.475-9.25,10.816-13.636,19.472-13.636a20.615,20.615,0,0,1,7.577,1.343Zm-4.046,14.55a5.752,5.752,0,0,1-1.01-.086l-2.744,2.741A9.446,9.446,0,0,0,46.638,73.794L43.9,76.538a6.018,6.018,0,0,1-5.932,7.024Z" transform="translate(-14.182 -52.64)"/></svg>',重置:'<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48" fill="currentColor"><path d="M32.936,32.658a15.914,15.914,0,0,1-9.6,3.064c-.451-.006-.9-.042-1.342-.077-.182-.018-.357-.047-.539-.077-.352-.047-.7-.089-1.037-.164-.211-.036-.422-.1-.621-.148-.334-.077-.668-.154-.99-.254-.153-.059-.3-.11-.457-.177-.381-.124-.755-.26-1.113-.414-.082-.036-.162-.071-.24-.1-.422-.2-.844-.408-1.248-.627-.017-.012-.035-.018-.054-.03a16.485,16.485,0,0,1-3.732-2.9c-.017-.018-.035-.042-.054-.059-.34-.355-.668-.721-.979-1.118-.065-.083-.123-.16-.194-.254A17.286,17.286,0,0,1,7.149,18.751h3.98L6.318,9.076,0,18.874H3.942a20.809,20.809,0,0,0,3.5,11.57.871.871,0,0,0,.075.14c.225.34.486.648.724.961.1.113.177.232.274.362.354.443.746.869,1.133,1.285.043.043.075.076.108.113a19.778,19.778,0,0,0,4.436,3.446c.043.027.08.043.128.076.467.259.949.5,1.432.719.124.055.242.113.359.164.419.184.847.335,1.277.493.2.076.4.14.611.21.378.113.762.21,1.153.3.257.065.509.129.772.184a2.252,2.252,0,0,0,.316.076c.37.07.735.1,1.1.151.134.027.27.049.4.065.66.065,1.314.11,1.974.11,4.006,0,8.852-1.3,11.85-4.177a1.908,1.908,0,0,0,.333-2.484,2.228,2.228,0,0,0-2.952.023ZM44.053,20.424a20.728,20.728,0,0,0-3.47-11.537c-.032-.055-.054-.113-.08-.164-.284-.405-.574-.778-.869-1.161a1.289,1.289,0,0,1-.1-.14A19.86,19.86,0,0,0,32.168,1.7c-.086-.032-.155-.076-.242-.11-.456-.195-.922-.362-1.394-.53C30.37,1,30.2.937,30.033.883,29.62.754,29.212.651,28.792.548c-.231-.055-.467-.113-.7-.164-.113-.022-.22-.055-.338-.081-.311-.055-.617-.081-.933-.124C26.6.151,26.392.119,26.18.1,25.655.042,25.135.021,24.616.016c-.1,0-.188-.016-.284-.016-.016,0-.032.005-.049.005A19.124,19.124,0,0,0,13.02,3.695a1.682,1.682,0,0,0-.466,2.515,1.777,1.777,0,0,0,2.309.3A15.251,15.251,0,0,1,24.374,3.45c.486.006.971.03,1.441.077.147.012.287.036.432.059a11.3,11.3,0,0,1,1.16.189c.162.03.334.077.493.11.381.089.744.178,1.107.3a2.577,2.577,0,0,1,.34.124c.422.142.832.29,1.23.467.047.012.082.047.123.059a16.492,16.492,0,0,1,6.182,4.8.367.367,0,0,0,.024.036A17.308,17.308,0,0,1,40.629,20.43H36.645l5.048,9.787L48,20.424Zm0,0" transform="translate(0 4.349)"/></svg>',填充:'<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48" fill="currentColor"><path d="M24 6L10 22h10v18h8V22h10L24 6z" opacity="0.35"/><path d="M8 24h32v4H8z"/></svg>',标高:'<svg width="32" height="32" viewBox="0 0 32 32"><path fill="currentColor" d="M84.131,193.119a1.056,1.056,0,0,1,1.116.982v7.857a1.056,1.056,0,0,1-1.116.982H54.367a1.056,1.056,0,0,1-1.116-.982V194.1a1.056,1.056,0,0,1,1.116-.982Zm-1.116,1.964H55.483v5.893H83.015Zm1.116-13.749a1.064,1.064,0,0,1,1.114.935,1.032,1.032,0,0,1-1.007,1.025l-.107,0H71.2l-7.858,6.914a1.227,1.227,0,0,1-1.578,0l-8.185-7.2-.018-.016-.032-.031.049.047a1.107,1.107,0,0,1-.092-.092l-.011-.014a.869.869,0,0,1-.182-.857l0-.008L53.31,182l.012-.029.02-.045.019-.035a1.1,1.1,0,0,1,.891-.552h.007q.053,0,.107,0ZM68.043,183.3H57.06l5.492,4.831Z" transform="translate(-53.247 -176.136)"/></svg>',距离:'<svg width="32" height="32" viewBox="0 0 32 32"><path fill="currentColor" d="M29.692,3.03,27.55.919a.529.529,0,0,1-.014-.756A.549.549,0,0,1,28.3.15l.014.013,3.067,3.023a.529.529,0,0,1,0,.756L28.317,6.966a.549.549,0,0,1-.767.013.529.529,0,0,1-.014-.756l.014-.013L29.692,4.1H2.31L4.452,6.21a.528.528,0,0,1,.013.756.547.547,0,0,1-.766.013l-.014-.013L.616,3.942a.531.531,0,0,1,0-.756L3.685.163a.548.548,0,0,1,.767.014.528.528,0,0,1,0,.742L2.31,3.03ZM24.136,15.055H23.051V18H21.966v-2.94H20.882V18H19.8v-2.94H18.712V18H17.627v-2.94H16.543v5.078H15.458V15.055H14.373V18H13.288v-2.94H12.2V18H11.119v-2.94H10.034V18H8.949v-2.94H7.865V18H6.78v-2.94H5.7v5.078H4.61V15.055H1.9a.27.27,0,0,0-.272.268v6.413A.269.269,0,0,0,1.9,22H30.1a.268.268,0,0,0,.271-.267V15.323a.269.269,0,0,0-.271-.268H27.39v5.078H26.305V15.055H25.221V18H24.136Zm5.966-1.6A1.884,1.884,0,0,1,32,15.323v6.413a1.885,1.885,0,0,1-1.9,1.871H1.9A1.885,1.885,0,0,1,0,21.736V15.323a1.885,1.885,0,0,1,1.9-1.871Z" transform="translate(0 4.197)"/></svg>',最小距离:'<svg width="32" height="32" viewBox="0 0 32 32"><path fill="currentColor" d="M-5.839,24.8H-34.16A1.875,1.875,0,0,1-36,22.933V16.52a1.887,1.887,0,0,1,1.9-1.871H-5.9A1.887,1.887,0,0,1-4,16.52v6.412A1.875,1.875,0,0,1-5.839,24.8ZM-34.1,16.252a.27.27,0,0,0-.272.268v6.412a.27.27,0,0,0,.272.267H-5.9a.269.269,0,0,0,.271-.267V16.52a.27.27,0,0,0-.271-.268H-8.61V21.33H-9.695V16.252h-1.085v2.939h-1.085V16.252h-1.085v2.939h-1.085V16.252h-1.084v2.939H-16.2V16.252h-1.085v2.939h-1.085V16.252h-1.084V21.33h-1.084V16.252h-1.085v2.939h-1.085V16.252H-23.8v2.939h-1.085V16.252h-1.085v2.939h-1.085V16.252h-1.084v2.939H-29.22V16.252H-30.3V21.33H-31.39V16.252Z" transform="translate(36 2)"/><path fill="currentColor" d="M23.716,7.947V4.875c0-.8-.232-1.085-.765-1.085a1.573,1.573,0,0,0-1.133.585V7.947H20.4V2.75h1.163l.1.687H21.7a2.547,2.547,0,0,1,1.763-.817c1.172,0,1.676.78,1.676,2.089V7.947Zm-7.26,0V2.62h1.58V7.947Zm-3.8,0V4.875c0-.8-.243-1.085-.76-1.085a1.606,1.606,0,0,0-1.049.585V7.947H9.421V4.875c0-.8-.243-1.085-.758-1.085a1.608,1.608,0,0,0-1.05.585V7.947H6.194V2.75H7.36l.1.7H7.5A2.326,2.326,0,0,1,9.169,2.62a1.486,1.486,0,0,1,1.5.91A2.445,2.445,0,0,1,12.4,2.62c1.156,0,1.691.78,1.691,2.089V7.947Zm3.8-6.849a.79.79,0,0,1,1.58,0,.79.79,0,0,1-1.58,0Z" transform="translate(0.333 3.053)"/></svg>',激光边距:'<svg width="32" height="32" viewBox="0 0 32 32"><path fill="currentColor" d="M0,1.293v31.96H32V1.293ZM30.97,32.182H1.03V2.323H30.97Z"/><path fill="currentColor" d="M160.026,291.9l1.6,1.6,7.305-7.305-7.305-7.305-1.6,1.6,4.794,4.566h-6.392v2.283h6.392Zm-5.251,0-4.566-4.566h6.164v-2.283H150.21l4.566-4.566-1.37-1.6L146.1,286.19l7.305,7.305Z" transform="translate(-141.535 -268.917)"/></svg>',角度:'<svg width="32" height="32" viewBox="0 0 32 32"><path fill="currentColor" d="M39.587,50.766h13.7a1,1,0,0,1,0,2H23.171a1,1,0,0,1,0-2h1.418l6.582-7.006v-.006a.517.517,0,0,1,.14-.357.456.456,0,0,1,.337-.144l12.1-12.876a.451.451,0,0,1,.665,0,.524.524,0,0,1,0,.708L32.883,43.355a8.3,8.3,0,0,1,6.7,7.411Zm-.949,0a7.254,7.254,0,0,0-6.611-6.5l-6.108,6.5Z" transform="translate(-22.229 -26.489)"/></svg>',坡度:'<svg width="32" height="32" viewBox="0 0 32 32"><path fill="currentColor" d="M202.1,188.337l2.629-2.191-8.447-3.106,1.533,8.871,2.629-2.194,9.341,11.209,1.656-1.379Zm-13.726-.435a1.075,1.075,0,0,0-1.07-.341,1.057,1.057,0,0,0-.5.277l-5.11,4.08a1.08,1.08,0,0,0-.406.84l-.007,17.386a1.079,1.079,0,0,0,1.077,1.077L205.7,211.2a1.078,1.078,0,0,0,.822-1.774Zm-4.934,21.164.007-15.788,3.968-3.171,15.974,18.941Z" transform="translate(-180.36 -181.131)"/></svg>',体积:'<svg width="32" height="32" viewBox="0 0 32 32"><path fill="currentColor" d="M94.74,86.658V71.189a.371.371,0,0,1,.2-.329l13.869-7.22a.371.371,0,0,1,.344,0l13.053,6.891h0l.819.431a.371.371,0,0,1,.2.328v15.3a.371.371,0,0,1-.2.328l-13.872,7.255a.371.371,0,0,1-.342,0L94.94,86.987a.371.371,0,0,1-.2-.329Zm2.119-.837,11.2,5.8a.024.024,0,0,0,.035-.022V79.483a.371.371,0,0,0-.2-.328l-11.2-5.909a.024.024,0,0,0-.035.021V85.492A.371.371,0,0,0,96.859,85.821Zm13.151-6.459v12a.12.12,0,0,0,.176.106L114,89.474l3.334-1.745,3.771-1.978a.371.371,0,0,0,.2-.328V73.5a.193.193,0,0,0-.284-.171l-10.812,5.708A.371.371,0,0,0,110.01,79.362ZM97.925,71.725l10.839,5.72a.371.371,0,0,0,.346,0L119.8,71.808a.214.214,0,0,0,0-.378l-10.649-5.621a.371.371,0,0,0-.344,0L97.925,71.47A.144.144,0,0,0,97.925,71.725Z" transform="translate(-92.982 -62.907)"/></svg>',空间体积:'<svg width="32" height="32" viewBox="0 0 32 32"><path fill="currentColor" d="M125.977,128.829l13.076-7.363v-13.6l-13.076,6.8Zm-3.126-15.655a.565.565,0,0,1-.258-.064L109.3,106.323a.567.567,0,0,1-.011-1L122.578,98a.567.567,0,0,1,.55,0l13.288,7.325a.567.567,0,0,1-.011,1l-13.292,6.79A.63.63,0,0,1,122.851,113.174ZM110.773,105.8l12.078,6.172,12.078-6.172-12.078-6.657Z" transform="translate(-1.922)"/><path fill="currentColor" d="M120.649,322.52a.58.58,0,0,1-.262-.064l-13.08-6.8a.573.573,0,0,1-.307-.5V301a.566.566,0,0,1,.273-.486.573.573,0,0,1,.558-.019l13.076,6.8a.573.573,0,0,1,.307.5v14.161a.57.57,0,0,1-.565.569Zm-12.511-7.708,11.942,6.206V308.136l-11.942-6.206Zm15.917,9.408a.585.585,0,0,1-.288-.076.567.567,0,0,1-.281-.489V309.49a.562.562,0,0,1,.307-.5l13.076-6.8a.573.573,0,0,1,.558.019.562.562,0,0,1,.273.486v13.6a.568.568,0,0,1-.288.493l-13.076,7.359A.557.557,0,0,1,124.055,324.22Zm.569-14.385V322.68l11.942-6.722V303.629Z" transform="translate(0 -194.822)"/></svg>',close:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12z"/></svg>',check:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M9 16.17L4.83 12l-1.42 1.41L9 19L21 7l-1.41-1.41z"/></svg>',warning:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M1 21h22L12 2L1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"/></svg>',error:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10s10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"/></svg>',success:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10s10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5l1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>',plus:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/></svg>',minus:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M19 13H5v-2h14v2z"/></svg>',arrowUp:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6l-6 6z"/></svg>',arrowUpBold:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8l-8 8z"/></svg>',arrowDown:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6l-6-6z"/></svg>',arrowLeft:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M15.41 7.41L14 6l-6 6l6 6l1.41-1.41L10.83 12z"/></svg>',arrowRight:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M10 6L8.59 7.41L13.17 12l-4.58 4.59L10 18l6-6z"/></svg>',search:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5A6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5S14 7.01 14 9.5S11.99 14 9.5 14z"/></svg>',refresh:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M17.65 6.35A7.958 7.958 0 0 0 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08A5.99 5.99 0 0 1 12 18c-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"/></svg>',delete:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"/></svg>',edit:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04a.996.996 0 0 0 0-1.41l-2.34-2.34a.996.996 0 0 0-1.41 0l-1.83 1.83l3.75 3.75l1.83-1.83z"/></svg>',save:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M17 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V7l-4-4zm-5 16c-1.66 0-3-1.34-3-3s1.34-3 3-3s3 1.34 3 3s-1.34 3-3 3zm3-10H5V5h10v4z"/></svg>',expand:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M16.59 8.59L12 13.17L7.41 8.59L6 10l6 6l6-6z"/></svg>',collapse:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M12 8l-6 6l1.41 1.41L12 10.83l4.59 4.58L18 14z"/></svg>',bot:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M12 2a2 2 0 0 1 2 2c0 .74-.4 1.39-1 1.73V7h1a7 7 0 0 1 7 7h1a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1h-1v1a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-1H2a1 1 0 0 1-1-1v-3a1 1 0 0 1 1-1h1a7 7 0 0 1 7-7h1V5.73c-.6-.34-1-.99-1-1.73a2 2 0 0 1 2-2M7.5 13A2.5 2.5 0 0 0 5 15.5A2.5 2.5 0 0 0 7.5 18a2.5 2.5 0 0 0 2.5-2.5A2.5 2.5 0 0 0 7.5 13m9 0a2.5 2.5 0 0 0-2.5 2.5a2.5 2.5 0 0 0 2.5 2.5a2.5 2.5 0 0 0 2.5-2.5a2.5 2.5 0 0 0-2.5-2.5Z"/></svg>',history:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M13 3a9 9 0 0 0-9 9H1l3.89 3.89l.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7s-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42A8.954 8.954 0 0 0 13 21a9 9 0 0 0 0-18zm-1 5v5l4.28 2.54l.72-1.21l-3.5-2.08V8H12z"/></svg>',settings:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M12 15.5A3.5 3.5 0 0 1 8.5 12A3.5 3.5 0 0 1 12 8.5a3.5 3.5 0 0 1 3.5 3.5a3.5 3.5 0 0 1-3.5 3.5m7.43-2.53c.04-.32.07-.64.07-.97c0-.33-.03-.66-.07-1l2.11-1.63c.19-.15.24-.42.12-.64l-2-3.46c-.12-.22-.39-.31-.61-.22l-2.49 1c-.52-.39-1.06-.73-1.69-.98l-.37-2.65A.506.506 0 0 0 14 2h-4c-.25 0-.46.18-.5.42l-.37 2.65c-.63.25-1.17.59-1.69.98l-2.49-1c-.22-.09-.49 0-.61.22l-2 3.46c-.13.22-.07.49.12.64L4.57 11c-.04.34-.07.67-.07 1c0 .33.03.65.07.97l-2.11 1.66c-.19.15-.25.42-.12.64l2 3.46c.12.22.39.3.61.22l2.49-1.01c.52.4 1.06.74 1.69.99l.37 2.65c.04.24.25.42.5.42h4c.25 0 .46-.18.5-.42l.37-2.65c.63-.26 1.17-.59 1.69-.99l2.49 1.01c.22.08.49 0 .61-.22l2-3.46c.12-.22.07-.49-.12-.64l-2.11-1.66Z"/></svg>',loader:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M12 4V2A10 10 0 0 0 2 12h2a8 8 0 0 1 8-8Z"><animateTransform attributeName="transform" dur="0.75s" repeatCount="indefinite" type="rotate" values="0 12 12;360 12 12"/></path></svg>',send:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M2 21l21-9L2 3v7l15 2l-15 2v7z"/></svg>',透视相机:'<svg width="48" height="48" viewBox="0 0 48 48"><path fill="currentColor" d="M24 4L4 14v20l20 10l20-10V14L24 4zm0 4.5l14 7v14l-14 7l-14-7v-14l14-7zM24 18a6 6 0 100 12a6 6 0 000-12z"/></svg>',正交相机:'<svg width="48" height="48" viewBox="0 0 48 48"><path fill="currentColor" d="M6 6h36v36H6V6zm4 4v28h28V10H10zm4 4h20v20H14V14z"/></svg>',doubleArrowDown:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"/><path fill="currentColor" d="M7.41 14.59L12 19.17l4.59-4.58L18 16l-6 6-6-6 1.41-1.41z"/></svg>',pin:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="m3 21l4.63-4.631m.005-.005l-2.78-2.78c-.954-.953.006-2.996 1.31-3.078c1.178-.075 3.905.352 4.812-.555l2.49-2.49c.617-.618.225-2 .185-2.762c-.058-1.016 1.558-2.271 2.415-1.414l4.647 4.648c.86.858-.4 2.469-1.413 2.415c-.762-.04-2.145-.432-2.763.185l-2.49 2.49c-.906.907-.48 3.633-.554 4.811c-.082 1.305-2.125 2.265-3.08 1.31z"/></svg>',folder:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M10 4l2 2h8a2 2 0 0 1 2 2v8.5A3.5 3.5 0 0 1 18.5 20h-13A3.5 3.5 0 0 1 2 16.5v-9A3.5 3.5 0 0 1 5.5 4z" opacity="0.2"/><path fill="currentColor" d="M5.5 4A3.5 3.5 0 0 0 2 7.5v9A3.5 3.5 0 0 0 5.5 20h13a3.5 3.5 0 0 0 3.5-3.5V8A2 2 0 0 0 20 6h-8l-2-2zm0 1.5h3.879l2 2H20a.5.5 0 0 1 .5.5v1H3.5v-1.5a2 2 0 0 1 2-2m-2 5h17v6a2 2 0 0 1-2 2h-13a2 2 0 0 1-2-2z"/></svg>',folderPlus:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M10 4l2 2h8a2 2 0 0 1 2 2v1.5h-1.5V8a.5.5 0 0 0-.5-.5h-8.621l-2-2H5.5a2 2 0 0 0-2 2V9H2V7.5A3.5 3.5 0 0 1 5.5 4z"/><path fill="currentColor" d="M5.5 10A3.5 3.5 0 0 0 2 13.5v3A3.5 3.5 0 0 0 5.5 20H12v-1.5H5.5a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2H12V10z" opacity="0.4"/><path fill="currentColor" d="M17.25 12v3.25H14v1.5h3.25V20h1.5v-3.25H22v-1.5h-3.25V12z"/></svg>',default:'<svg width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10s10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8s8 3.59 8 8s-3.59 8-8 8zm-1-13h2v6h-2zm0 8h2v2h-2z"/></svg>'};function vn(i){const e=ybe[i];return e||(console.warn(`[IconManager] Icon "${i}" not found, using default icon`),ybe.default)}class wct{container;wrapper;mainButton;items=[];itemElements=[];itemButtonMap=new Map;toggleStateMap=new Map;isActive=!1;unsubscribeTheme=null;unsubscribeLocale=null;mainButtonLabel;onMainButtonClick;MAIN_BUTTON_SIZE=60;SUB_BUTTON_SIZE=46;BASE_RADIUS=80;RING_GAP=60;FAN_START_DEG=170;FAN_END_DEG=280;CANVAS_PADDING=28;FIXED_RING_CAPACITIES=[4,6,8];constructor(e){this.container=e.container,this.items=e.items===void 0?this.createDefaultItems():[...e.items],this.mainButtonLabel=e.mainButtonLabel??"toolbar.home",this.onMainButtonClick=e.onMainButtonClick,this.wrapper=this.createWrapper(),this.mainButton=this.createMainButton(e.mainButtonIcon),this.wrapper.appendChild(this.mainButton),this.container.appendChild(this.wrapper),this.renderItems(),this.updateLayoutMetrics(),this.bindEvents(),this.setTheme(qi.getTheme()),this.updateLocales(),this.unsubscribeTheme=qi.subscribe(t=>{this.setTheme(t)}),this.unsubscribeLocale=dr.subscribe(()=>{this.updateLocales()})}createDefaultItems(){return[{id:"zoom",label:"toolbar.zoomBox",icon:vn("框选放大")},{id:"measure",label:"toolbar.measure",icon:vn("测量")},{id:"section",label:"toolbar.section",icon:vn("剖切")},{id:"walk",label:"toolbar.walk",icon:vn("漫游")},{id:"setting",label:"toolbar.setting",icon:vn("设置")}]}createWrapper(){const e=document.createElement("div");return e.className="radial-toolbar-wrapper",e}createMainButton(e){const t=document.createElement("button");return t.className="radial-main-btn",t.type="button",t.innerHTML=e??vn("主视角"),t}bindEvents(){this.mainButton.addEventListener("click",this.handleMainButtonClick),this.mainButton.addEventListener("dblclick",this.handleMainButtonDoubleClick)}handleMainButtonClick=e=>{e.stopPropagation(),this.isActive?this.collapse():this.expand()};handleMainButtonDoubleClick=e=>{e.stopPropagation(),this.onMainButtonClick&&this.onMainButtonClick()};renderItems(){this.itemElements.forEach(e=>e.remove()),this.itemElements=[],this.itemButtonMap.clear(),this.toggleStateMap.clear(),this.items.forEach((e,t)=>{this.toggleStateMap.set(e.id,!!e.isActive);const n=this.createSubButton(e,t);this.wrapper.insertBefore(n,this.mainButton),this.itemElements.push(n),this.itemButtonMap.set(e.id,n)}),this.updateItemPositions()}createSubButton(e,t){const n=document.createElement("button");n.className="radial-sub-btn",n.type="button",n.dataset.index=String(t),this.applyItemActiveClass(n,e);const r=document.createElement("span");return r.className="radial-sub-btn-icon",e.icon?r.innerHTML=e.icon:r.textContent=this.getFallbackLabel(e.label),n.appendChild(r),n.addEventListener("click",s=>{if(s.stopPropagation(),e.isToggle){const a=!(this.toggleStateMap.get(e.id)??!1);this.toggleStateMap.set(e.id,a),e.isActive=a,this.applyItemActiveClass(n,e),e.onToggle?.(a,e);return}e.onClick?.(e)}),n}getRingCapacities(e){const t=[];let n=e;for(const r of this.FIXED_RING_CAPACITIES){if(n<=0)break;const s=Math.min(r,n);t.push(s),n-=s}return n>0&&t.push(n),t}updateItemPositions(){const e=this.itemElements.length;if(e===0)return;const t=this.FAN_END_DEG-this.FAN_START_DEG,n=this.getRingCapacities(e);let r=0;n.forEach((s,o)=>{const a=this.BASE_RADIUS+o*this.RING_GAP;for(let l=0;l<s;l++){const c=this.itemElements[r],h=s<=1?0:l/(s-1),d=(this.FAN_START_DEG+t*h)*Math.PI/180,p=Math.cos(d)*a,f=Math.sin(d)*a,g=(l+o*.5)*.045,_=(s-1-l+o*.4)*.032;c.style.setProperty("--rt-x",`${p.toFixed(2)}px`),c.style.setProperty("--rt-y",`${f.toFixed(2)}px`),c.style.setProperty("--rt-open-delay",`${g.toFixed(3)}s`),c.style.setProperty("--rt-close-delay",`${_.toFixed(3)}s`),r++}})}updateLayoutMetrics(){const e=this.items.length,n=this.getRingCapacities(e).length,r=this.BASE_RADIUS+(n-1)*this.RING_GAP,s=Math.ceil(r+this.MAIN_BUTTON_SIZE+this.SUB_BUTTON_SIZE+this.CANVAS_PADDING*2);this.wrapper.style.width=`${s}px`,this.wrapper.style.height=`${s}px`,this.wrapper.style.setProperty("--rt-main-size",`${this.MAIN_BUTTON_SIZE}px`),this.wrapper.style.setProperty("--rt-sub-size",`${this.SUB_BUTTON_SIZE}px`),this.wrapper.style.setProperty("--rt-main-offset",`${(this.MAIN_BUTTON_SIZE-this.SUB_BUTTON_SIZE)/2}px`)}expand(){this.isActive||this.items.length===0||(this.isActive=!0,this.wrapper.classList.add("is-active"))}collapse(){this.isActive&&(this.isActive=!1,this.wrapper.classList.remove("is-active"))}updateLocales(){const e=At(this.mainButtonLabel);this.mainButton.title=e,this.mainButton.setAttribute("aria-label",e),this.itemElements.forEach((t,n)=>{const r=this.items[n];if(!r)return;const s=r.title??At(r.label);if(t.title=s,t.setAttribute("aria-label",s),this.applyItemActiveClass(t,r),!r.icon){const o=t.querySelector(".radial-sub-btn-icon");o&&(o.textContent=this.getFallbackLabel(r.title??r.label))}})}applyItemActiveClass(e,t){if(!t.isToggle){e.classList.remove("is-active"),e.dataset.active="false";return}const n=this.toggleStateMap.get(t.id)??!!t.isActive;e.classList.toggle("is-active",n),e.dataset.active=n?"true":"false"}getFallbackLabel(e){const t=At(e).trim();return t?t.charAt(0).toUpperCase():"?"}setTheme(e){this.wrapper.classList.remove("theme-light","theme-dark"),this.wrapper.classList.add(`theme-${e.name}`);const t=this.wrapper.style;t.setProperty("--bim-primary",e.primary),t.setProperty("--bim-primary-hover",e.primaryHover),t.setProperty("--bim-primary-active",e.primaryActive),t.setProperty("--bim-text-inverse",e.textInverse),t.setProperty("--bim-icon-inverse",e.iconInverse),t.setProperty("--bim-shadow-glow",e.shadowGlow),t.setProperty("--rt-main-bg",e.bgBase),t.setProperty("--rt-main-bg-hover",e.bgBase),t.setProperty("--rt-main-border",e.floatingBtnBorder),t.setProperty("--rt-main-shadow",e.floatingBtnShadow),t.setProperty("--rt-main-shadow-hover",e.floatingBtnShadowHover),t.setProperty("--rt-main-icon",e.floatingIconColor),t.setProperty("--rt-main-icon-hover",e.floatingIconColorHover),t.setProperty("--rt-sub-bg",e.bgBase),t.setProperty("--rt-sub-bg-hover",e.primaryHover),t.setProperty("--rt-sub-border",e.floatingBtnBorder),t.setProperty("--rt-sub-shadow",e.floatingBtnShadow),t.setProperty("--rt-sub-shadow-hover",e.floatingBtnShadowHover),t.setProperty("--rt-sub-icon",e.floatingIconColor),t.setProperty("--rt-sub-icon-hover",e.iconHover)}setItemActive(e,t){const n=this.items.find(s=>s.id===e);if(!n||!n.isToggle)return;n.isActive=t,this.toggleStateMap.set(e,t);const r=this.itemButtonMap.get(e);r&&this.applyItemActiveClass(r,n)}addItem(e){this.items.push(e),this.renderItems(),this.updateLayoutMetrics()}init(){}setLocales(){this.updateLocales()}destroy(){this.unsubscribeTheme&&(this.unsubscribeTheme(),this.unsubscribeTheme=null),this.unsubscribeLocale&&(this.unsubscribeLocale(),this.unsubscribeLocale=null),this.mainButton.removeEventListener("click",this.handleMainButtonClick),this.mainButton.removeEventListener("dblclick",this.handleMainButtonDoubleClick),this.wrapper.parentNode&&this.wrapper.parentNode.removeChild(this.wrapper)}}const Ect=i=>({id:"measure",label:"toolbar.measure",icon:vn("测量"),isToggle:!0,isActive:i.bottomDock?.isOpen("measure")??!1,onToggle:e=>{const t=i.bottomDock;if(!t){console.warn("[RadialToolbar] bottom dock not initialized: measure");return}e?t.open("measure"):t.close("measure"),console.log(`[RadialToolbar] 测量${e?"已打开":"已关闭"}`)}}),Sct=i=>({id:"section",label:"toolbar.section",icon:vn("剖切"),isToggle:!0,isActive:i.bottomDock?.isOpen("section")??!1,onToggle:e=>{const t=i.bottomDock;if(!t){console.warn("[RadialToolbar] bottom dock not initialized: section");return}e?t.open("section"):t.close("section"),console.log(`[RadialToolbar] 剖切${e?"已打开":"已关闭"}`)}}),Tct=i=>({id:"setting",label:"toolbar.setting",icon:vn("设置"),onClick:()=>{i.setting?.toggle(),console.log(`[RadialToolbar] 设置${i.setting?.isOpen()?"已打开":"已关闭"}`)}}),Cct=i=>({id:"walk",label:"toolbar.walk",icon:vn("漫游"),isToggle:!0,isActive:i.bottomDock?.isOpen("walk")??!1,onToggle:e=>{const t=i.bottomDock;if(!t){console.warn("[RadialToolbar] bottom dock not initialized: walk");return}e?t.open("walk"):t.close("walk"),console.log(`[RadialToolbar] 漫游${e?"已打开":"已关闭"}`)}});class vbe extends Mc{toolbar=null;unsubscribeDockState=null;constructor(e,t,n){super(t),this.toolbar=new wct({container:e,items:n?.items??this.createDefaultItems(),mainButtonIcon:vn("主视角"),mainButtonLabel:"toolbar.home",onMainButtonClick:()=>{console.log("[RadialToolbar] main: home"),this.registry.engine3d?.getEngineComponent()?.CameraGoHome()}}),this.toolbar.setTheme(qi.getTheme()),this.unsubscribeDockState=this.registry.bottomDock?.onStateChange(({id:r,open:s})=>{this.toolbar?.setItemActive(r,s)})??null,this.syncInitialToggleStates()}createDefaultItems(){return[Tct(this.registry),Ect(this.registry),Sct(this.registry),Cct(this.registry),this.createModelLink3dRadialButton()]}createModelLink3dRadialButton(){return{id:"modelLink3d",label:"toolbar.modelLink3d",icon:vn("联动模型"),isToggle:!0,isActive:!1,onToggle:e=>{const t=this.registry.engine3d;if(!t?.isInitialized()){console.warn("[RadialToolbar] 3D engine not initialized: modelLink3d"),this.toolbar?.setItemActive("modelLink3d",!1);return}e?t.activeModelLink3d():t.disActiveModelLink3d(),console.log(`[RadialToolbar] 模型联动${e?"已开启":"已关闭"}`)}}}syncInitialToggleStates(){const e=this.registry.bottomDock;!e||!this.toolbar||(this.toolbar.setItemActive("measure",e.isOpen("measure")),this.toolbar.setItemActive("section",e.isOpen("section")),this.toolbar.setItemActive("walk",e.isOpen("walk")))}addItem(e){this.toolbar?.addItem(e)}setItemActive(e,t){this.toolbar?.setItemActive(e,t)}show(){this.toolbar?.expand()}hide(){this.toolbar?.collapse()}destroy(){this.unsubscribeDockState&&(this.unsubscribeDockState(),this.unsubscribeDockState=null),this.toolbar?.destroy(),this.toolbar=null,super.destroy()}}class Mct{container;root;panelGap=10;panelMap=new Map;panelOrder=[];resizeObserver;handleWindowResize=()=>{this.reflow()};constructor(e){this.container=e,this.root=document.createElement("div"),this.root.className="bottom-dock-stack",this.container.appendChild(this.root),this.resizeObserver=typeof ResizeObserver<"u"?new ResizeObserver(()=>{this.reflow()}):null,this.resizeObserver||window.addEventListener("resize",this.handleWindowResize)}setTheme(e){const t=this.root.style;t.setProperty("--bd-bg",e.floatingBtnBg),t.setProperty("--bd-border",e.floatingBtnBorder),t.setProperty("--bd-shadow",e.floatingBtnShadow),t.setProperty("--bd-close-color",e.floatingIconColor),t.setProperty("--bd-close-color-hover",e.floatingIconColorHover),t.setProperty("--bd-close-bg-hover",e.floatingBtnBgHover),t.setProperty("--bd-close-border-hover",e.floatingBtnBorder),t.setProperty("--bd-body-bg",e.floatingBtnBg),t.setProperty("--bd-placeholder-border",e.borderSubtle),t.setProperty("--bd-placeholder-text",e.textSecondary)}hasPanel(e){return this.panelMap.has(e)}addPanel(e){const t=this.panelMap.get(e.id);if(t&&t.leaving){t.leaving=!1,t.element.classList.remove("is-leaving"),t.removeTimer&&(clearTimeout(t.removeTimer),t.removeTimer=null),t.bodyElement.replaceChildren(e.content),this.panelOrder.includes(e.id)||this.panelOrder.push(e.id),this.reflow();return}if(t)return;const n=document.createElement("section");n.className="bottom-dock-panel is-entering",n.dataset.panelId=e.id;let r=null;e.closable!==!1&&(r=document.createElement("button"),r.className="bottom-dock-panel-close",r.type="button",r.setAttribute("aria-label","close-panel"),r.textContent="×",r.addEventListener("click",o=>{o.stopPropagation(),e.onClose(e.id)}),n.appendChild(r));const s=document.createElement("div");s.className="bottom-dock-panel-body",s.appendChild(e.content),n.appendChild(s),this.root.appendChild(n),this.panelOrder.push(e.id),this.panelMap.set(e.id,{id:e.id,element:n,bodyElement:s,closeButton:r,leaving:!1,removeTimer:null}),this.resizeObserver?.observe(n),this.reflow(),requestAnimationFrame(()=>{n.classList.remove("is-entering")})}removePanel(e){const t=this.panelMap.get(e);if(!t||t.leaving)return;t.leaving=!0,t.element.classList.add("is-leaving");const n=this.panelOrder.indexOf(e);n>=0&&this.panelOrder.splice(n,1),this.reflow(),t.removeTimer=window.setTimeout(()=>{this.resizeObserver?.unobserve(t.element),t.element.remove(),this.panelMap.delete(e),t.removeTimer=null},220)}createPlaceholderContent(e){const t=document.createElement("div");return t.className="bottom-dock-placeholder",t.textContent=e,t}destroy(){this.resizeObserver?.disconnect(),window.removeEventListener("resize",this.handleWindowResize),this.panelMap.clear(),this.panelOrder.length=0,this.root.remove()}reflow(){let e=0,t=0;this.panelOrder.forEach(s=>{const o=this.panelMap.get(s);o&&(o.element.style.transform=`translateX(-50%) translateY(-${e}px)`,e+=o.element.offsetHeight+this.panelGap,t=Math.max(t,o.element.offsetWidth))});const n=this.panelOrder.length,r=n>0?e-this.panelGap:0;this.root.style.height=`${r}px`,this.root.style.width=n>0?`${t}px`:"0px"}}class jZ extends Mc{stack;definitions=new Map;openStates=new Map;listeners=new Set;unsubscribeTheme=null;constructor(e,t,n={}){super(t),this.stack=new Mct(e),this.stack.setTheme(qi.getTheme()),this.unsubscribeTheme=qi.subscribe(r=>{this.stack.setTheme(r)}),n.registerDefaults!==!1&&this.registerDefaultPanels()}register(e){this.definitions.set(e.id,e),this.openStates.has(e.id)||this.openStates.set(e.id,!1)}unregister(e){this.isOpen(e)&&this.close(e),this.definitions.delete(e),this.openStates.delete(e)}toggle(e){if(this.isOpen(e)){this.close(e);return}this.open(e)}open(e){const t=this.definitions.get(e);if(!t){console.warn(`[BottomDock] Unknown panel id: ${e}`);return}if(this.isOpen(e))return;const n=t.createContent?t.createContent():this.stack.createPlaceholderContent(`${t.title} 面板内容占位`);this.stack.addPanel({id:e,content:n,closable:t.closable!==!1,onClose:()=>{this.close(e)}}),this.openStates.set(e,!0),this.emitState({id:e,open:!0})}close(e){this.isOpen(e)&&(this.stack.removePanel(e),this.openStates.set(e,!1),this.emitState({id:e,open:!1}))}isOpen(e){return this.openStates.get(e)??!1}createPlaceholderContent(e){return this.stack.createPlaceholderContent(e)}onStateChange(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}destroy(){this.unsubscribeTheme&&(this.unsubscribeTheme(),this.unsubscribeTheme=null),this.listeners.clear(),this.definitions.clear(),this.openStates.clear(),this.stack.destroy(),super.destroy()}emitState(e){this.listeners.forEach(t=>{t(e)})}registerDefaultPanels(){this.register({id:"measure",title:"测量",createContent:()=>{const e=this.registry.measureDock?.getPanelElement();return e||this.stack.createPlaceholderContent("测量面板占位")}}),this.register({id:"section",title:"剖切",createContent:()=>{const e=this.registry.sectionDock?.getPanelElement();return e||this.stack.createPlaceholderContent("剖切面板占位")}}),this.register({id:"walk",title:"漫游",createContent:()=>{const e=this.registry.walkDock?.getPanelElement();return e||this.stack.createPlaceholderContent("漫游面板占位")}}),this.register({id:"modelCalibration",title:"模型校准",createContent:()=>{const e=this.registry.modelCalibrationDock?.getPanelElement();return e||this.stack.createPlaceholderContent("模型校准面板占位")}})}}const QA={clearHeight:'<svg aria-hidden="true" viewBox="0 0 48 48"><path d="M19.0032 32.1184C18.712 32.1184 18.4032 32.1184 18.112 32.4096C17.512 32.6992 17.8224 33.5904 18.112 33.8816L23.1472 38.6256C23.7472 38.9152 24.6192 38.9152 24.928 38.6256L29.9632 33.8816C30.2528 33.5904 30.2528 33.2816 30.2528 32.9904C30.2528 32.3904 29.6528 32.1008 29.072 32.1008L25.7856 32.1008L25.7856 16.2192L29.0256 16.2192C29.3152 16.2192 29.6256 16.2192 29.9152 15.928C30.5152 15.6368 30.2064 14.7472 29.9152 14.456L24.8816 9.7072C24.2816 9.4176 23.4096 9.4176 23.0992 9.7072L18.0656 14.4512C17.7744 14.7424 17.7744 15.0512 17.7744 15.3424C17.7744 15.9424 18.3744 16.232 18.9568 16.232L22.24 16.232L22.24 32.1328L19.0016 32.1328L19.0016 32.1184L19.0032 32.1184ZM4.75842 6.80639L43.2384 6.80639C44.128 6.80639 44.7104 6.20639 44.7104 5.33442C44.7104 4.1536 44.1088 3.2624 43.2384 3.2624L4.75678 3.2624C4.1568 3.2624 3.5744 3.8624 3.2848 4.73442C3.2848 5.62561 3.8848 6.5152 4.75678 6.80639L4.75842 6.80639ZM43.256 41.1936L4.75842 41.1936C4.1584 41.1936 3.576 41.7936 3.2864 42.6656C3.2864 43.5568 3.8864 44.4464 4.75842 44.7376L43.2384 44.7376C44.128 44.7376 44.7104 44.1376 44.7104 43.2656C44.728 42.08 44.1328 41.1936 43.256 41.1936Z" fill="currentColor"/></svg>',clearDistance:'<svg aria-hidden="true" viewBox="0 0 48 48"><path d="M15.2619 20.2135C15.2619 20.8776 14.5628 21.2125 14.0415 21.0436L4.13531 16.0541C4.10363 16.0394 4.07281 16.023 4.04285 16.005C4.0129 15.987 3.98397 15.9675 3.95607 15.9464C3.92817 15.9254 3.90144 15.9029 3.87591 15.879C3.85037 15.8552 3.82615 15.83 3.80326 15.8036L3.80909 35.8838C3.80909 36.8159 3.18577 37.4393 2.2537 37.4393C1.32163 37.4393 0.701223 36.8159 0.701223 35.8838L0.701223 9.16557C0.698312 8.2335 1.31872 7.61016 2.25079 7.61016C3.18286 7.61016 3.80618 8.2335 3.80618 9.16557L3.80035 14.8075C3.82324 14.7811 3.84746 14.7559 3.873 14.7321C3.89853 14.7082 3.92525 14.6858 3.95315 14.6647C3.98106 14.6437 4.00999 14.6242 4.03994 14.6062C4.0699 14.5881 4.10072 14.5718 4.1324 14.557L14.0444 9.56752C14.5687 9.23546 15.2619 9.56752 15.2619 10.2316L15.2619 13.9074L32.9566 13.9074C33.3644 13.9074 33.6557 13.6628 33.7314 13.2725L33.7488 13.0686L33.7488 10.2142C33.7488 9.71316 34.3838 9.20925 34.8557 9.54422L43.8938 14.5803C44.0132 14.6415 44.1181 14.7259 44.2026 14.8337L44.1968 8.07624C44.1968 7.14413 44.8201 6.52374 45.7521 6.52374C46.6842 6.52374 47.3044 7.14413 47.3044 8.07624L47.3044 36.0383C47.3044 36.0637 47.3038 36.0891 47.3025 36.1145C47.3016 36.1399 47.2998 36.1652 47.2974 36.1905C47.2948 36.2158 47.2917 36.241 47.288 36.2662C47.2842 36.2914 47.2798 36.3164 47.2749 36.3413C47.2698 36.3663 47.2642 36.3911 47.258 36.4157C47.252 36.4404 47.2453 36.4649 47.2378 36.4892C47.2303 36.5136 47.2224 36.5377 47.2139 36.5617C47.2055 36.5856 47.1964 36.6093 47.1867 36.6328C47.1767 36.6563 47.1664 36.6795 47.1558 36.7025C47.1448 36.7255 47.1334 36.7482 47.1216 36.7707C47.1094 36.7931 47.0969 36.8152 47.0841 36.837C47.0709 36.8588 47.0574 36.8803 47.0433 36.9015C47.0289 36.9226 47.0142 36.9434 46.9992 36.9638C46.9842 36.9843 46.9686 37.0043 46.9524 37.024C46.9361 37.0436 46.9195 37.0629 46.9027 37.0818C46.8855 37.1006 46.8679 37.119 46.8501 37.137C46.8321 37.155 46.8137 37.1726 46.7949 37.1897C46.7761 37.2068 46.7569 37.2234 46.7372 37.2395C46.7176 37.2557 46.6975 37.2713 46.6772 37.2865C46.6568 37.3017 46.636 37.3163 46.6149 37.3305C46.5937 37.3447 46.5723 37.3583 46.5505 37.3714C46.5287 37.3845 46.5066 37.397 46.4842 37.409C46.4618 37.4211 46.4391 37.4325 46.4161 37.4434C46.3932 37.4543 46.3699 37.4646 46.3464 37.4744C46.323 37.4842 46.2993 37.4933 46.2754 37.5019C46.2514 37.5105 46.2273 37.5186 46.203 37.526C46.1786 37.5334 46.1542 37.5402 46.1296 37.5464C46.1049 37.5526 46.0801 37.5582 46.0552 37.5632C46.0302 37.5683 46.0052 37.5726 45.9801 37.5764C45.9549 37.5802 45.9297 37.5833 45.9044 37.5859C45.8791 37.5884 45.8537 37.5903 45.8284 37.5916C45.803 37.5929 45.7775 37.5936 45.7521 37.5936C44.8201 37.5936 44.1968 36.9732 44.1968 36.0412L44.1997 15.8357C44.1783 15.8546 44.1554 15.8715 44.1309 15.8861C44.1064 15.9008 44.0807 15.9131 44.054 15.9231L35.0188 20.9562C34.544 21.2912 33.9091 20.9562 33.9091 20.2863L33.9091 17.4318C33.9091 16.9279 33.5887 16.593 33.1168 16.593L15.2619 16.59L15.2619 20.2135L15.2619 20.2135ZM41.0889 24.2796L41.0889 36.0412C41.0889 36.8975 40.3899 37.5936 39.5335 37.5936C38.6014 37.5936 37.981 36.9732 37.981 36.0412L37.981 24.2796C37.981 23.3475 38.6014 22.7243 39.5335 22.7243C40.4656 22.7243 41.0889 23.3475 41.0889 24.2796ZM28.6604 24.2796L28.6604 36.0412C28.6603 36.0665 28.6596 36.0919 28.6584 36.1173C28.657 36.1426 28.6551 36.168 28.6526 36.1932C28.6501 36.2185 28.6469 36.2437 28.6432 36.2688C28.6394 36.2939 28.6351 36.3189 28.63 36.3438C28.625 36.3687 28.6194 36.3935 28.6133 36.4181C28.607 36.4427 28.6002 36.4672 28.5929 36.4915C28.5855 36.5158 28.5774 36.5399 28.5689 36.5638C28.5603 36.5877 28.5512 36.6113 28.5414 36.6348C28.5317 36.6583 28.5213 36.6815 28.5105 36.7044C28.4996 36.7274 28.4881 36.75 28.4762 36.7724C28.4642 36.7948 28.4517 36.8168 28.4386 36.8386C28.4255 36.8604 28.4119 36.8819 28.3978 36.903C28.3837 36.9241 28.369 36.9448 28.3539 36.9652C28.3388 36.9856 28.3232 37.0056 28.3071 37.0253C28.2909 37.0449 28.2744 37.0641 28.2573 37.0829C28.2402 37.1017 28.2227 37.1201 28.2048 37.1381C28.1868 37.156 28.1684 37.1735 28.1496 37.1906C28.1308 37.2076 28.1116 37.2242 28.092 37.2404C28.0723 37.2564 28.0523 37.2721 28.032 37.2872C28.0115 37.3024 27.9908 37.317 27.9697 37.3311C27.9486 37.3452 27.9272 37.3588 27.9054 37.3719C27.8836 37.385 27.8615 37.3975 27.8391 37.4094C27.8167 37.4214 27.7941 37.4329 27.7712 37.4438C27.7482 37.4546 27.725 37.4649 27.7015 37.4747C27.6781 37.4844 27.6544 37.4936 27.6305 37.5022C27.6066 37.5107 27.5825 37.5187 27.5582 37.5261C27.5339 37.5335 27.5094 37.5403 27.4848 37.5465C27.4602 37.5527 27.4354 37.5583 27.4105 37.5633C27.3857 37.5683 27.3606 37.5727 27.3355 37.5765C27.3104 37.5802 27.2852 37.5833 27.2599 37.5859C27.2347 37.5884 27.2094 37.5903 27.184 37.5916C27.1586 37.5929 27.1333 37.5936 27.1079 37.5936C26.1758 37.5936 25.5525 36.9732 25.5525 36.0412L25.5525 24.2796C25.5525 23.3475 26.1758 22.7243 27.1079 22.7243C28.0399 22.7243 28.6604 23.3475 28.6604 24.2796ZM10.019 24.2796L10.019 36.0412C10.0189 36.0666 10.0183 36.092 10.017 36.1174C10.0156 36.1428 10.0138 36.1681 10.0112 36.1934C10.0087 36.2187 10.0055 36.2439 10.0018 36.2691C9.99798 36.2942 9.99357 36.3193 9.9886 36.3442C9.98359 36.3691 9.97796 36.3939 9.97178 36.4185C9.96554 36.4432 9.95874 36.4677 9.95134 36.492C9.94393 36.5163 9.93592 36.5404 9.92729 36.5644C9.91867 36.5883 9.90952 36.612 9.89978 36.6355C9.88998 36.659 9.87967 36.6822 9.86879 36.7051C9.85787 36.7281 9.84638 36.7508 9.83438 36.7732C9.82238 36.7956 9.80982 36.8177 9.79674 36.8395C9.78362 36.8613 9.77003 36.8828 9.75587 36.9039C9.74171 36.925 9.72704 36.9458 9.7119 36.9662C9.69671 36.9866 9.68101 37.0066 9.66488 37.0262C9.64876 37.0459 9.63212 37.0651 9.61506 37.0839C9.59795 37.1027 9.58042 37.1212 9.56242 37.1391C9.54442 37.1571 9.52599 37.1745 9.50715 37.1916C9.48826 37.2087 9.46899 37.2253 9.44935 37.2414C9.42967 37.2575 9.40965 37.2731 9.38921 37.2883C9.36878 37.3034 9.34796 37.318 9.32682 37.3321C9.30563 37.3462 9.28417 37.3598 9.26237 37.3729C9.24053 37.3859 9.2184 37.3984 9.19599 37.4104C9.17359 37.4224 9.15085 37.4338 9.12788 37.4446C9.10487 37.4555 9.08162 37.4658 9.05818 37.4755C9.03465 37.4852 9.01093 37.4944 8.98703 37.5029C8.96303 37.5115 8.93888 37.5195 8.9146 37.5268C8.89023 37.5342 8.86576 37.541 8.8411 37.5471C8.81645 37.5533 8.79165 37.5589 8.76671 37.5638C8.74178 37.5688 8.7167 37.5731 8.69157 37.5768C8.6664 37.5805 8.64118 37.5837 8.61587 37.5862C8.59056 37.5886 8.56524 37.5905 8.53984 37.5917C8.51443 37.593 8.48903 37.5936 8.46362 37.5936C7.53156 37.5936 6.90821 36.9732 6.90821 36.0412L6.90821 24.2796C6.90821 23.3475 7.53156 22.7243 8.46362 22.7243C9.39568 22.7243 10.0161 23.3475 10.0161 24.2796L10.019 24.2796ZM33.3207 29.7147C34.2527 29.7147 34.8732 30.3381 34.8732 31.2701L34.8732 36.0412C34.8731 36.0665 34.8724 36.0919 34.8712 36.1173C34.8699 36.1426 34.8679 36.168 34.8654 36.1932C34.8629 36.2185 34.8597 36.2437 34.856 36.2688C34.8522 36.2939 34.8478 36.3189 34.8429 36.3438C34.8378 36.3687 34.8323 36.3935 34.8261 36.4181C34.8198 36.4427 34.813 36.4672 34.8057 36.4915C34.7983 36.5158 34.7903 36.5399 34.7817 36.5638C34.7731 36.5877 34.7639 36.6113 34.7542 36.6348C34.7445 36.6583 34.7341 36.6815 34.7233 36.7044C34.7124 36.7274 34.701 36.75 34.689 36.7724C34.677 36.7948 34.6644 36.8168 34.6514 36.8386C34.6383 36.8604 34.6247 36.8819 34.6106 36.903C34.5965 36.9241 34.5819 36.9448 34.5668 36.9652C34.5516 36.9856 34.536 37.0056 34.5199 37.0253C34.5038 37.0449 34.4872 37.0641 34.4701 37.0829C34.453 37.1017 34.4356 37.1201 34.4176 37.1381C34.3996 37.156 34.3812 37.1735 34.3624 37.1906C34.3436 37.2076 34.3244 37.2242 34.3048 37.2404C34.2851 37.2564 34.2652 37.2721 34.2448 37.2872C34.2244 37.3024 34.2036 37.317 34.1825 37.3311C34.1614 37.3452 34.1399 37.3588 34.1182 37.3719C34.0964 37.385 34.0743 37.3975 34.0519 37.4094C34.0296 37.4214 34.0069 37.4329 33.9839 37.4438C33.961 37.4546 33.9378 37.4649 33.9144 37.4747C33.8909 37.4844 33.8672 37.4936 33.8433 37.5022C33.8194 37.5107 33.7953 37.5187 33.771 37.5261C33.7467 37.5335 33.7223 37.5403 33.6977 37.5465C33.673 37.5527 33.6482 37.5583 33.6234 37.5633C33.5984 37.5683 33.5734 37.5727 33.5484 37.5765C33.5232 37.5802 33.498 37.5833 33.4727 37.5859C33.4475 37.5884 33.4222 37.5903 33.3968 37.5916C33.3714 37.5929 33.3461 37.5936 33.3207 37.5936C32.3886 37.5936 31.7682 36.9732 31.7682 36.0412L31.7682 31.2701C31.7682 30.3381 32.3886 29.7147 33.3207 29.7147ZM22.4446 31.2701L22.4446 36.0412C22.4446 36.8975 21.7485 37.5936 20.8892 37.5936C19.9572 37.5936 19.3367 36.9732 19.3367 36.0412L19.3367 31.2701C19.3367 30.3381 19.9572 29.7147 20.8892 29.7147C21.8213 29.7147 22.4446 30.3381 22.4446 31.2701ZM16.2289 31.2701L16.2289 36.0412C16.2288 36.0665 16.2282 36.0919 16.2269 36.1173C16.2256 36.1426 16.2237 36.168 16.2211 36.1932C16.2186 36.2185 16.2155 36.2437 16.2117 36.2688C16.2079 36.2939 16.2036 36.3189 16.1986 36.3438C16.1936 36.3687 16.188 36.3935 16.1818 36.4181C16.1756 36.4427 16.1688 36.4672 16.1614 36.4915C16.154 36.5158 16.146 36.5399 16.1374 36.5638C16.1288 36.5877 16.1197 36.6113 16.11 36.6348C16.1002 36.6583 16.0899 36.6815 16.079 36.7044C16.0681 36.7274 16.0567 36.75 16.0447 36.7724C16.0328 36.7948 16.0202 36.8168 16.0072 36.8386C15.994 36.8604 15.9804 36.8819 15.9664 36.903C15.9522 36.9241 15.9376 36.9448 15.9225 36.9652C15.9073 36.9856 15.8917 37.0056 15.8756 37.0253C15.8595 37.0449 15.8429 37.0641 15.8259 37.0829C15.8088 37.1017 15.7913 37.1201 15.7734 37.1381C15.7554 37.156 15.737 37.1735 15.7182 37.1906C15.6994 37.2076 15.6801 37.2242 15.6605 37.2404C15.6409 37.2564 15.6209 37.2721 15.6005 37.2872C15.5801 37.3024 15.5594 37.317 15.5382 37.3311C15.5171 37.3452 15.4957 37.3588 15.4739 37.3719C15.4521 37.385 15.43 37.3975 15.4077 37.4094C15.3853 37.4214 15.3626 37.4329 15.3397 37.4438C15.3167 37.4546 15.2935 37.4649 15.2701 37.4747C15.2466 37.4844 15.2229 37.4936 15.199 37.5022C15.1751 37.5107 15.151 37.5187 15.1268 37.5261C15.1025 37.5335 15.078 37.5403 15.0534 37.5465C15.0287 37.5527 15.0039 37.5583 14.9791 37.5633C14.9542 37.5683 14.9292 37.5727 14.9041 37.5765C14.8789 37.5802 14.8538 37.5833 14.8285 37.5859C14.8032 37.5884 14.7779 37.5903 14.7526 37.5916C14.7271 37.5929 14.7018 37.5936 14.6764 37.5936C13.7444 37.5936 13.1239 36.9732 13.1239 36.0412L13.1239 31.2701C13.1239 30.3381 13.7444 29.7147 14.6764 29.7147C15.6085 29.7147 16.2289 30.3381 16.2289 31.2701Z" fill="currentColor"/></svg>',distance:'<svg viewBox="0 0 32 32" aria-hidden="true"><g transform="translate(0 4.197)"><path fill="currentColor" d="M29.692,3.03,27.55.919a.529.529,0,0,1-.014-.756A.549.549,0,0,1,28.3.15l.014.013,3.067,3.023a.529.529,0,0,1,0,.756L28.317,6.966a.549.549,0,0,1-.767.013.529.529,0,0,1-.014-.756l.014-.013L29.692,4.1H2.31L4.452,6.21a.528.528,0,0,1,.013.756.547.547,0,0,1-.766.013l-.014-.013L.616,3.942a.531.531,0,0,1,0-.756L3.685.163a.548.548,0,0,1,.767.014.528.528,0,0,1,0,.742L2.31,3.03ZM24.136,15.055H23.051V18H21.966v-2.94H20.882V18H19.8v-2.94H18.712V18H17.627v-2.94H16.543v5.078H15.458V15.055H14.373V18H13.288v-2.94H12.2V18H11.119v-2.94H10.034V18H8.949v-2.94H7.865V18H6.78v-2.94H5.7v5.078H4.61V15.055H1.9a.27.27,0,0,0-.272.268v6.413A.269.269,0,0,0,1.9,22H30.1a.268.268,0,0,0,.271-.267V15.323a.269.269,0,0,0-.271-.268H27.39v5.078H26.305V15.055H25.221V18H24.136Zm5.966-1.6A1.884,1.884,0,0,1,32,15.323v6.413a1.885,1.885,0,0,1-1.9,1.871H1.9A1.885,1.885,0,0,1,0,21.736V15.323a1.885,1.885,0,0,1,1.9-1.871Z"/></g></svg>',elevation:'<svg viewBox="0 0 32 32" aria-hidden="true"><path fill="currentColor" d="M84.131,193.119a1.056,1.056,0,0,1,1.116.982v7.857a1.056,1.056,0,0,1-1.116.982H54.367a1.056,1.056,0,0,1-1.116-.982V194.1a1.056,1.056,0,0,1,1.116-.982Zm-1.116,1.964H55.483v5.893H83.015Zm1.116-13.749a1.064,1.064,0,0,1,1.114.935,1.032,1.032,0,0,1-1.007,1.025l-.107,0H71.2l-7.858,6.914a1.227,1.227,0,0,1-1.578,0l-8.185-7.2-.018-.016-.032-.031.049.047a1.107,1.107,0,0,1-.092-.092l-.011-.014a.869.869,0,0,1-.182-.857l0-.008L53.31,182l.012-.029.02-.045.019-.035a1.1,1.1,0,0,1,.891-.552h.007q.053,0,.107,0ZM68.043,183.3H57.06l5.492,4.831Z" transform="translate(-53.247 -176.136)"/></svg>',point:'<svg aria-hidden="true" viewBox="0 0 48 48"><path d="M40.1698 18.0929C40.1428 20.5301 39.3645 22.7586 38.3131 24.9092C36.7378 28.1319 34.6461 31.0118 32.3727 33.7664C30.2564 36.3308 27.9853 38.7519 25.5613 41.0284C24.7143 41.8237 23.9413 41.8481 23.073 41.0687C18.5767 37.0334 14.5359 32.6092 11.4515 27.3755C10.9495 26.5238 10.4945 25.6458 10.1025 24.7372C9.73107 23.8761 10.0514 22.9753 10.8534 22.6034C11.6577 22.2304 12.582 22.5576 12.9732 23.4086C14.8167 27.4176 17.5132 30.8241 20.4598 34.0548C21.596 35.3006 22.7863 36.4939 24.0184 37.6454C24.1708 37.7877 24.2667 37.9033 24.4831 37.6853C28.5664 33.5709 32.3892 29.2509 35.1723 24.1156C35.9836 22.6186 36.66 21.0543 36.8866 19.3498C37.2281 16.7802 36.712 14.3356 35.493 12.0807C33.1715 7.78618 29.5679 5.33714 24.6496 5.16445C19.0467 4.96786 14.0685 8.58606 12.3051 13.9294C11.8621 15.2717 11.6275 16.6474 11.6092 18.061C11.5962 19.0717 10.9335 19.7853 10.0201 19.783C9.10383 19.7808 8.43479 19.0505 8.43746 18.056C8.45818 10.5393 13.6357 4.02759 20.9324 2.34148C26.9693 0.946299 33.4364 3.45514 37.0904 8.60424C39.1088 11.4483 40.1115 14.6187 40.1698 18.0929ZM6.42075 43.1971C18.363 43.1971 30.2366 43.1971 42.1204 43.1971C42.1186 42.9919 41.9834 42.8579 41.8977 42.7076C40.3484 39.9866 38.7956 37.2673 37.2401 34.5498C36.9062 33.9668 36.8856 33.3861 37.257 32.8222C37.5915 32.314 38.0819 32.0681 38.6918 32.1099C39.2399 32.1477 39.6712 32.4169 39.9425 32.8899C42.0656 36.5932 44.1915 40.2948 46.2926 44.0105C46.9411 45.1576 46.1392 46.3818 44.7752 46.3821C37.6695 46.3845 30.564 46.3832 23.4585 46.3832C16.9643 46.3832 10.4699 46.3507 3.97625 46.4082C2.51885 46.4212 1.62531 45.0904 2.42647 43.7424C4.52293 40.2152 6.51577 36.6264 8.55216 33.0634C8.99072 32.2962 9.67627 31.9592 10.3942 32.1457C11.456 32.4219 11.9181 33.5491 11.3553 34.5444C10.2685 36.467 9.16594 38.3807 8.07099 40.2987C7.53258 41.2418 6.99643 42.1859 6.42075 43.1971ZM30.6461 17.8271C30.6465 21.3322 27.7864 24.1813 24.2754 24.1734C20.7946 24.1656 17.9554 21.3147 17.9555 17.8276C17.9557 14.3185 20.8087 11.4763 24.3244 11.4829C27.8051 11.4893 30.6458 14.3402 30.6461 17.8271ZM24.3201 14.6556C22.5583 14.656 21.1314 16.0714 21.1285 17.8213C21.1256 19.591 22.5741 21.0173 24.3575 21.0005C26.0699 20.9844 27.4807 19.5391 27.4733 17.8085C27.4659 16.0808 26.0403 14.6552 24.3201 14.6556Z" fill="currentColor"/></svg>',angle:'<svg viewBox="0 0 32 32" aria-hidden="true"><path fill="currentColor" d="M39.587,50.766h13.7a1,1,0,0,1,0,2H23.171a1,1,0,0,1,0-2h1.418l6.582-7.006v-.006a.517.517,0,0,1,.14-.357.456.456,0,0,1,.337-.144l12.1-12.876a.451.451,0,0,1,.665,0,.524.524,0,0,1,0,.708L32.883,43.355a8.3,8.3,0,0,1,6.7,7.411Zm-.949,0a7.254,7.254,0,0,0-6.611-6.5l-6.108,6.5Z" transform="translate(-22.229 -26.489)"/></svg>',area:'<svg aria-hidden="true" viewBox="0 0 48 48"><path d="M28.7725 16.8582L16.6882 28.9801C16.0335 29.6368 16.0335 30.7313 16.6882 31.3881C17.0156 31.7164 17.452 31.8806 17.8885 31.8806C18.3249 31.8806 18.7614 31.7164 19.0887 31.3881L31.173 19.2662C31.8277 18.6094 31.8277 17.5149 31.173 16.8582C30.5183 16.2015 29.4272 16.2015 28.7725 16.8582Z" fill="currentColor"/><path d="M44.5667 11.9055C45.385 11.9055 46.0397 11.2488 46.0397 10.4552L46.0397 3.47761C46.0397 2.65672 45.385 2 44.5667 2L37.6107 2C36.7924 2 36.1377 2.65672 36.1377 3.47761L36.1377 5.06468L11.9418 5.06468L11.9418 3.47761C11.9418 2.65672 11.2871 2 10.4688 2L3.51277 2C2.69442 2 2.03974 2.65672 2.03974 3.47761L2.03974 10.4279C2.03974 11.2488 2.69442 11.9055 3.51277 11.9055L5.20403 11.9055L5.20403 36.0671L3.51277 36.0671C2.69442 36.0671 2.03974 36.7239 2.03974 37.5448L2.03974 44.5224C2.03974 45.3433 2.69442 46 3.51277 46L10.4688 46C11.2598 46 11.9145 45.3433 11.9418 44.5224L11.9418 42.7438L36.1377 42.7438L36.1377 44.5224C36.1377 45.3433 36.7924 46 37.6107 46L44.5667 46C45.385 46 46.0397 45.3433 46.0397 44.5224L46.0397 37.5448C46.0397 36.7239 45.385 36.0671 44.5667 36.0671L42.7936 36.0671L42.7936 11.9055L44.5667 11.9055ZM39.0837 4.92786L43.0937 4.92786L43.0937 8.95024L39.0837 8.95024L39.0837 4.92786ZM4.9858 4.92786L8.99572 4.92786L8.99572 8.95024L4.9858 8.95024L4.9858 4.92786ZM8.99572 43.0448L4.9858 43.0448L4.9858 39.0224L8.99572 39.0224L8.99572 43.0448ZM43.0937 43.0448L39.0837 43.0448L39.0837 39.0224L43.0937 39.0224L43.0937 43.0448ZM39.3838 36.0671L37.6107 36.0671C36.7924 36.0671 36.1377 36.7239 36.1377 37.5448L36.1377 39.3234L11.9418 39.3234L11.9418 37.5448C11.9418 36.7239 11.2871 36.0671 10.4688 36.0671L8.61382 36.0671L8.61382 11.9055L10.4688 11.9055C11.2598 11.9055 11.9145 11.2488 11.9418 10.4552L11.9418 8.48507L36.1377 8.48507L36.1377 10.4279C36.1377 11.2488 36.7924 11.9055 37.6107 11.9055L39.3838 11.9055L39.3838 36.0671Z" fill="currentColor"/></svg>',slope:'<svg viewBox="0 0 32 32" aria-hidden="true"><path fill="currentColor" d="M202.1,188.337l2.629-2.191-8.447-3.106,1.533,8.871,2.629-2.194,9.341,11.209,1.656-1.379Zm-13.726-.435a1.075,1.075,0,0,0-1.07-.341,1.057,1.057,0,0,0-.5.277l-5.11,4.08a1.08,1.08,0,0,0-.406.84l-.007,17.386a1.079,1.079,0,0,0,1.077,1.077L205.7,211.2a1.078,1.078,0,0,0,.822-1.774Zm-4.934,21.164.007-15.788,3.968-3.171,15.974,18.941Z" transform="translate(-180.36 -181.131)"/></svg>'},VI={distance:{key:"distance",callBackType:"distance",icon:QA.distance,order:0},clearHeight:{key:"clearHeight",callBackType:"clear-height",icon:QA.clearHeight,order:1},clearDistance:{key:"clearDistance",callBackType:"clear-distance",icon:QA.clearDistance,order:2},elevation:{key:"elevation",callBackType:"elevation",icon:QA.elevation,order:3},point:{key:"point",callBackType:"point",icon:QA.point,order:4},angle:{key:"angle",callBackType:"angle",icon:QA.angle,order:5},area:{key:"area",callBackType:"area",icon:QA.area,order:6},slope:{key:"slope",callBackType:"slope",icon:QA.slope,order:7}},bbe=Object.values(VI).sort((i,e)=>i.order-e.order).map(i=>i.key);function Abe(i){switch(i){case"clearHeight":case"clearDistance":case"distance":case"elevation":return"length";case"area":return"area";case"angle":return"angle";case"slope":return"percent";default:return"point"}}function xbe(i){return Object.values(VI).find(e=>e.callBackType===i)?.key}const Ict=["distance","clearHeight","clearDistance","elevation"],Pct=["point","angle","area","slope"],wbe="bim-engine:measure:config",Dct={unit:"mm",precision:2};class Rct{element;options;modeButtons=new Map;clearBtn;expandBtn;settingsBtn;secondaryRow;clearHeightOptions;clearHeightDirectionLabel;clearHeightSelectTypeLabel;directionButtons=new Map;selectTypeButtons=new Map;mainView;settingsView;settingsUnitLabel;settingsPrecisionLabel;settingsUnitSelect;settingsPrecisionSelect;settingsSaveBtn;settingsBackBtn;activeMode;isExpanded;clearHeightDirection;clearHeightSelectType;view="main";config;lockedWidthPx=null;constructor(e={}){this.options=e,this.activeMode=e.defaultMode??"distance",this.isExpanded=e.defaultExpanded??!1,this.clearHeightDirection=e.defaultClearHeightDirection??1,this.clearHeightSelectType=e.defaultClearHeightSelectType??"point",this.config=this.loadConfigFromCache()??{...Dct};const{root:t,clearBtn:n,expandBtn:r,settingsBtn:s,secondaryRow:o,clearHeightOptions:a,clearHeightDirectionLabel:l,clearHeightSelectTypeLabel:c,mainView:h,settingsView:u,settingsUnitLabel:d,settingsPrecisionLabel:p,settingsUnitSelect:f,settingsPrecisionSelect:g,settingsSaveBtn:_,settingsBackBtn:y}=this.createDom();this.element=t,this.clearBtn=n,this.expandBtn=r,this.settingsBtn=s,this.secondaryRow=o,this.clearHeightOptions=a,this.clearHeightDirectionLabel=l,this.clearHeightSelectTypeLabel=c,this.mainView=h,this.settingsView=u,this.settingsUnitLabel=d,this.settingsPrecisionLabel=p,this.settingsUnitSelect=f,this.settingsPrecisionSelect=g,this.settingsSaveBtn=_,this.settingsBackBtn=y}init(){this.setLocales(),this.syncSettingsFormFromConfig(),this.applyExpandedState(),this.applyClearHeightOptionsState(),this.applyViewState(),this.syncActiveMode(this.activeMode??"distance")}setTheme(e){const t=this.element.style;t.setProperty("--bim-text-primary",e.textPrimary),t.setProperty("--bim-text-secondary",e.textSecondary),t.setProperty("--bim-text-tertiary",e.textTertiary),t.setProperty("--bim-border-default",e.borderDefault),t.setProperty("--bim-border-strong",e.borderStrong),t.setProperty("--bim-bg-inset",e.bgInset),t.setProperty("--bim-bg-elevated",e.bgElevated),t.setProperty("--bim-primary",e.primary),t.setProperty("--bim-primary-subtle",e.primarySubtle),t.setProperty("--bim-danger",e.danger),t.setProperty("--bim-component-bg-hover",e.componentBgHover)}setLocales(){for(const[r,s]of this.modeButtons.entries()){const o=At(`measure.modes.${r}`);s.dataset.tooltip=o,s.setAttribute("aria-label",o)}const e=At("measure.actions.clearAll");this.clearBtn.dataset.tooltip=e,this.clearBtn.setAttribute("aria-label",e);const t=this.isExpanded?At("measure.actions.collapse"):At("measure.actions.expand");delete this.expandBtn.dataset.tooltip,this.expandBtn.setAttribute("aria-label",t);const n=At("measure.actions.settings");this.settingsBtn.dataset.tooltip=n,this.settingsBtn.setAttribute("aria-label",n),this.clearHeightDirectionLabel.textContent=At("measure.clearHeight.direction"),this.clearHeightSelectTypeLabel.textContent=At("measure.clearHeight.selectType"),this.directionButtons.get(0).textContent=At("measure.clearHeight.directionDown"),this.directionButtons.get(1).textContent=At("measure.clearHeight.directionUp"),this.selectTypeButtons.get("point").textContent=At("measure.clearHeight.selectPoint"),this.selectTypeButtons.get("element").textContent=At("measure.clearHeight.selectElement"),this.settingsUnitLabel.textContent=At("measure.settings.unit"),this.settingsPrecisionLabel.textContent=At("measure.settings.precision"),this.settingsSaveBtn.textContent=At("measure.settings.save"),this.settingsBackBtn.textContent=At("measure.settings.cancel")}switchMode(e,t=!0){this.activeMode!==e&&(this.activeMode=e,this.syncActiveMode(e),this.applyClearHeightOptionsState(),this.closeSettingsView(),t&&this.options.onModeChange?.(e),e==="clearHeight"&&(this.options.onClearHeightDirectionChange?.(this.clearHeightDirection),this.options.onClearHeightSelectTypeChange?.(this.clearHeightSelectType)))}destroy(){this.element.remove()}getConfig(){return{...this.config}}createDom(){const e=document.createElement("div");e.className="measure-dock-panel";const t=document.createElement("div");t.className="measure-dock-panel-main";const n=document.createElement("div");n.className="measure-dock-clearheight-options";const r=document.createElement("div");r.className="measure-dock-clearheight-group";const s=document.createElement("span");s.className="measure-dock-clearheight-label";const o=document.createElement("div");o.className="measure-dock-clearheight-buttons";const a=this.createClearHeightOptionButton(()=>{this.setClearHeightDirection(0)}),l=this.createClearHeightOptionButton(()=>{this.setClearHeightDirection(1)});this.directionButtons.set(0,a),this.directionButtons.set(1,l),o.appendChild(a),o.appendChild(l),r.appendChild(s),r.appendChild(o);const c=document.createElement("div");c.className="measure-dock-clearheight-group";const h=document.createElement("span");h.className="measure-dock-clearheight-label";const u=document.createElement("div");u.className="measure-dock-clearheight-buttons";const d=this.createClearHeightOptionButton(()=>{this.setClearHeightSelectType("point")}),p=this.createClearHeightOptionButton(()=>{this.setClearHeightSelectType("element")});this.selectTypeButtons.set("point",d),this.selectTypeButtons.set("element",p),u.appendChild(d),u.appendChild(p),c.appendChild(h),c.appendChild(u),n.appendChild(r),n.appendChild(c);const f=document.createElement("div");f.className="measure-dock-panel-top";const g=document.createElement("div");g.className="measure-dock-panel-mode-zone";const _=document.createElement("div");_.className="measure-dock-panel-mode-row",Ict.forEach(v=>{_.appendChild(this.createModeButton(v))});const y=document.createElement("div");y.className="measure-dock-panel-mode-row measure-dock-panel-mode-row-secondary",Pct.forEach(v=>{y.appendChild(this.createModeButton(v))});const A=this.createIconButton("measure-dock-panel-action-clear",vn("delete"));A.addEventListener("click",()=>{this.options.onClearAll?.()});const x=this.createIconButton("measure-dock-panel-action-settings",vn("settings"));x.addEventListener("click",()=>{this.openSettingsView(),this.options.onSettings?.()}),_.appendChild(A),y.appendChild(x),g.appendChild(_),g.appendChild(y);const w=document.createElement("div");w.className="measure-dock-panel-actions";const E=this.createIconButton("measure-dock-panel-action-expand",vn("expand"));E.addEventListener("click",()=>{this.isExpanded=!this.isExpanded,this.applyExpandedState(),this.setLocales()}),w.appendChild(E),f.appendChild(g),f.appendChild(w),t.appendChild(n),t.appendChild(f);const{settingsView:S,settingsUnitLabel:I,settingsPrecisionLabel:C,settingsUnitSelect:T,settingsPrecisionSelect:D,settingsSaveBtn:M,settingsBackBtn:R}=this.createSettingsView();return e.appendChild(t),e.appendChild(S),{root:e,clearBtn:A,expandBtn:E,settingsBtn:x,secondaryRow:y,clearHeightOptions:n,clearHeightDirectionLabel:s,clearHeightSelectTypeLabel:h,mainView:t,settingsView:S,settingsUnitLabel:I,settingsPrecisionLabel:C,settingsUnitSelect:T,settingsPrecisionSelect:D,settingsSaveBtn:M,settingsBackBtn:R}}createSettingsView(){const e=document.createElement("div");e.className="measure-dock-panel-settings";const t=document.createElement("div");t.className="measure-dock-settings-row";const n=document.createElement("span");n.className="measure-dock-settings-label";const r=document.createElement("select");r.className="measure-dock-settings-select",["m","cm","mm","km"].forEach(u=>{const d=document.createElement("option");d.value=u,d.textContent=u,r.appendChild(d)}),t.appendChild(n),t.appendChild(r);const s=document.createElement("div");s.className="measure-dock-settings-row";const o=document.createElement("span");o.className="measure-dock-settings-label";const a=document.createElement("select");a.className="measure-dock-settings-select",[0,1,2,3].forEach(u=>{const d=document.createElement("option");d.value=String(u),d.textContent=u===0?"0":`0.${"0".repeat(u)}`,a.appendChild(d)}),s.appendChild(o),s.appendChild(a);const l=document.createElement("div");l.className="measure-dock-settings-actions";const c=document.createElement("button");c.type="button",c.className="measure-dock-settings-btn is-save",c.addEventListener("click",()=>{this.saveSettings()});const h=document.createElement("button");return h.type="button",h.className="measure-dock-settings-btn is-back",h.addEventListener("click",()=>{this.closeSettingsView()}),l.appendChild(c),l.appendChild(h),e.appendChild(t),e.appendChild(s),e.appendChild(l),{settingsView:e,settingsUnitLabel:n,settingsPrecisionLabel:o,settingsUnitSelect:r,settingsPrecisionSelect:a,settingsSaveBtn:c,settingsBackBtn:h}}createClearHeightOptionButton(e){const t=document.createElement("button");return t.type="button",t.className="measure-dock-clearheight-btn",t.addEventListener("click",e),t}createModeButton(e){const t=document.createElement("button");return t.type="button",t.className="measure-dock-panel-mode-btn",t.dataset.mode=e,t.innerHTML=`<span class="measure-dock-panel-mode-icon">${VI[e].icon}</span>`,t.addEventListener("click",()=>{this.switchMode(e)}),this.modeButtons.set(e,t),t}createIconButton(e,t){const n=document.createElement("button");return n.type="button",n.className=`measure-dock-panel-action-btn ${e}`,n.innerHTML=t,n}applyExpandedState(){this.secondaryRow.style.display=this.isExpanded?"grid":"none",this.expandBtn.classList.toggle("is-expanded",this.isExpanded),this.expandBtn.classList.toggle("is-collapsed",!this.isExpanded)}openSettingsView(){this.lockPanelWidth(),this.view="settings",this.syncSettingsFormFromConfig(),this.applyViewState()}closeSettingsView(){this.view==="settings"&&(this.view="main",this.unlockPanelWidth(),this.applyViewState())}saveSettings(){const e=this.settingsUnitSelect.value,t=Number(this.settingsPrecisionSelect.value);!this.isValidUnit(e)||!this.isValidPrecision(t)||(this.config={unit:e,precision:t},this.saveConfigToCache(this.config),this.options.onConfigSave?.(this.getConfig()),this.view="main",this.unlockPanelWidth(),this.applyViewState())}lockPanelWidth(){const e=this.element.getBoundingClientRect().width;e<=0||(this.lockedWidthPx=Math.ceil(e),this.element.style.width=`${this.lockedWidthPx}px`)}unlockPanelWidth(){this.lockedWidthPx=null,this.element.style.removeProperty("width")}syncSettingsFormFromConfig(){this.settingsUnitSelect.value=this.config.unit,this.settingsPrecisionSelect.value=String(this.config.precision)}applyViewState(){const e=this.view==="main";this.mainView.style.display=e?"block":"none",this.settingsView.style.display=e?"none":"flex"}applyClearHeightOptionsState(){this.clearHeightOptions.classList.remove("is-visible");for(const[e,t]of this.directionButtons.entries())t.classList.toggle("is-active",e===this.clearHeightDirection);for(const[e,t]of this.selectTypeButtons.entries())t.classList.toggle("is-active",e===this.clearHeightSelectType)}setClearHeightDirection(e){this.clearHeightDirection!==e&&(this.clearHeightDirection=e,this.applyClearHeightOptionsState(),this.options.onClearHeightDirectionChange?.(e))}setClearHeightSelectType(e){this.clearHeightSelectType!==e&&(this.clearHeightSelectType=e,this.applyClearHeightOptionsState(),this.options.onClearHeightSelectTypeChange?.(e))}loadConfigFromCache(){try{const e=localStorage.getItem(wbe);if(!e)return null;const t=JSON.parse(e);return!t||typeof t!="object"||!this.isValidUnit(t.unit)||!this.isValidPrecision(t.precision)?null:{unit:t.unit,precision:t.precision}}catch{return null}}saveConfigToCache(e){try{localStorage.setItem(wbe,JSON.stringify(e))}catch{return}}isValidUnit(e){return e==="m"||e==="cm"||e==="mm"||e==="km"}isValidPrecision(e){return e===0||e===1||e===2||e===3}syncActiveMode(e){for(const[t,n]of this.modeButtons.entries())n.classList.toggle("is-active",t===e)}clearActiveMode(){for(const e of this.modeButtons.values())e.classList.remove("is-active");this.activeMode=null}}class Ebe extends Mc{panel=null;unsubscribeTheme=null;unsubscribeLocale=null;unsubscribeDockState=null;unsubscribeMeasureEvents=null;constructor(e){super(e)}init(){this.unsubscribeTheme||(this.unsubscribeTheme=qi.subscribe(()=>{this.applyPresentation()})),this.unsubscribeLocale||(this.unsubscribeLocale=dr.subscribe(()=>{this.applyPresentation()})),this.unsubscribeDockState||(this.unsubscribeDockState=this.registry.bottomDock?.onStateChange(e=>{if(e.id!=="measure"||e.open){e.id==="measure"&&e.open&&this.ensureMeasureEventSubscription();return}this.engineComponent?.deactivateMeasure()})??null),this.ensureMeasureEventSubscription()}destroy(){this.unsubscribeTheme&&(this.unsubscribeTheme(),this.unsubscribeTheme=null),this.unsubscribeLocale&&(this.unsubscribeLocale(),this.unsubscribeLocale=null),this.unsubscribeDockState&&(this.unsubscribeDockState(),this.unsubscribeDockState=null),this.unsubscribeMeasureEvents&&(this.unsubscribeMeasureEvents(),this.unsubscribeMeasureEvents=null),this.panel?.destroy(),this.panel=null,super.destroy()}getPanelElement(){if(this.ensureMeasureEventSubscription(),this.panel)this.panel.switchMode("distance"),this.engineComponent?.activateMeasure("distance");else{this.panel=new Rct({defaultMode:"distance",defaultExpanded:!1,defaultClearHeightDirection:1,defaultClearHeightSelectType:"point",onModeChange:t=>{this.engineComponent?.activateMeasure(t)},onClearAll:()=>{this.engineComponent?.clearAllMeasures()},onConfigSave:t=>{this.engineComponent?.saveMeasureSetting({unit:t.unit,precision:t.precision})},onClearHeightDirectionChange:t=>{this.engineComponent?.setClearHeightDirection(t)},onClearHeightSelectTypeChange:t=>{this.engineComponent?.setClearHeightSelectType(t)}}),this.panel.init(),this.panel.switchMode("distance"),this.engineComponent?.activateMeasure("distance"),this.engineComponent?.setClearHeightDirection(1),this.engineComponent?.setClearHeightSelectType("point");const e=this.panel.getConfig();this.engineComponent?.saveMeasureSetting({unit:e.unit,precision:e.precision})}return this.applyPresentation(),this.panel.element}ensureMeasureEventSubscription(){if(this.unsubscribeMeasureEvents)return;const e=this.engineComponent;if(!e){console.warn("[MeasureDockManager] skip callback binding: engine component not ready yet");return}const t=s=>{this.handleMeasureCallback("measure-changed",s)},n=s=>{this.handleMeasureCallback("measure-click",s)},r=()=>{console.log("[MeasureDockManager] quit_measure_draw received"),this.panel?.clearActiveMode(),this.engineComponent?.resetMeasureState()};e.onRawEvent("measure-changed",t),e.onRawEvent("measure-click",n),e.onRawEvent("quit_measure_draw",r),this.unsubscribeMeasureEvents=()=>{e.offRawEvent("measure-changed",t),e.offRawEvent("measure-click",n),e.offRawEvent("quit_measure_draw",r)},console.log("[MeasureDockManager] raw event callbacks bound")}applyPresentation(){this.panel&&(this.panel.setTheme(qi.getTheme()),this.panel.setLocales())}handleMeasureCallback(e,t){const n=this.registry.bottomDock?.isOpen("measure")??!1,r=xbe(t.type);if(console.log("[MeasureDockManager] callback received",{event:e,type:t.type,mode:r,dockOpen:n,hasPanel:!!this.panel}),!n){console.log("[MeasureDockManager] skip mode switch: measure dock is closed");return}if(!r||!this.panel){console.log("[MeasureDockManager] skip mode switch: invalid mode or panel not ready");return}this.panel.switchMode(r,!1),this.engineComponent?.activateMeasure(r),console.log("[MeasureDockManager] switched mode by callback",{event:e,mode:r})}}class Lct{element;options;typeButtons=new Map;axisButtons=new Map;toolContainer;axisPanel;divider;toast;activeType;activeAxis;isHidden;isFilled;toastTimer=null;constructor(e={}){this.options=e,this.activeType=e.defaultType??null,this.activeAxis=e.defaultAxis??"x",this.isHidden=e.defaultHidden??!1,this.isFilled=e.defaultFill??!1;const{root:t,toolContainer:n,axisPanel:r,divider:s,toast:o}=this.createDom();this.element=t,this.toolContainer=n,this.axisPanel=r,this.divider=s,this.toast=o}init(){this.applyTypeState(),this.applyAxisState(),this.renderTools(),this.setLocales()}setTheme(e){const t=this.element.style;t.setProperty("--bim-text-primary",e.textPrimary),t.setProperty("--bim-text-secondary",e.textSecondary),t.setProperty("--bim-border-default",e.borderDefault),t.setProperty("--bim-border-strong",e.borderStrong),t.setProperty("--bim-bg-inset",e.bgInset),t.setProperty("--bim-bg-elevated",e.bgElevated),t.setProperty("--bim-primary",e.primary),t.setProperty("--bim-primary-subtle",e.primarySubtle),t.setProperty("--bim-component-bg-hover",e.componentBgHover)}setLocales(){this.typeButtons.get("face").dataset.tooltip=At("toolbar.sectionPlane"),this.typeButtons.get("axis").dataset.tooltip=At("toolbar.sectionAxis"),this.typeButtons.get("box").dataset.tooltip=At("toolbar.sectionBox"),this.axisButtons.get("x").dataset.label="X",this.axisButtons.get("y").dataset.label="Y",this.axisButtons.get("z").dataset.label="Z",this.typeButtons.get("selected").dataset.tooltip=At("toolbar.sectionSelected"),this.typeButtons.forEach(e=>{e.setAttribute("aria-label",e.dataset.tooltip??"")}),this.axisButtons.forEach(e=>{e.setAttribute("aria-label",e.dataset.label??"")}),this.renderTools()}destroy(){this.toastTimer&&(clearTimeout(this.toastTimer),this.toastTimer=null),this.element.remove()}resetForOpen(){this.activeType=null,this.isHidden=!1,this.applyTypeState(),this.renderTools()}getActiveType(){return this.activeType}getActiveAxis(){return this.activeAxis}setFillState(e){this.isFilled=e,this.renderTools()}getFillState(){return this.isFilled}createDom(){const e=document.createElement("div");e.className="section-dock-panel";const t=document.createElement("div");t.className="section-dock-axis-panel",["x","y","z"].forEach(d=>{const p=document.createElement("button");p.type="button",p.className="section-dock-axis-btn",p.textContent=d.toUpperCase(),p.addEventListener("click",()=>{this.handleAxisChange(d)}),this.axisButtons.set(d,p),t.appendChild(p)});const n=document.createElement("div");n.className="section-dock-main";const r=document.createElement("div");r.className="section-dock-types";const s=this.createTypeButton("face",vn("拾曲面剖切")),o=this.createTypeButton("axis",vn("轴向剖切")),a=this.createTypeButton("box",vn("剖切盒")),l=this.createTypeButton("selected",vn("适应到模型"));r.appendChild(s),r.appendChild(o),r.appendChild(a),r.appendChild(l);const c=document.createElement("div");c.className="section-dock-divider";const h=document.createElement("div");h.className="section-dock-tools",n.appendChild(r),n.appendChild(c),n.appendChild(h),e.appendChild(t),e.appendChild(n);const u=document.createElement("div");return u.className="section-dock-toast",u.setAttribute("role","status"),u.setAttribute("aria-live","polite"),e.appendChild(u),{root:e,toolContainer:h,axisPanel:t,divider:c,toast:u}}createTypeButton(e,t){const n=document.createElement("button");n.type="button",n.className="section-dock-type-btn";const r=document.createElement("span");return r.className="section-dock-type-icon",r.innerHTML=t,n.appendChild(r),n.addEventListener("click",()=>{this.handleTypeChange(e)}),this.typeButtons.set(e,n),n}handleTypeChange(e){if(this.activeType===e){this.activeType=null,this.isHidden=!1,this.applyTypeState(),this.renderTools(),this.options.onHideToggle?.(!1),this.options.onTypeChange?.(null,this.activeAxis);return}if(this.options.onTypeChange?.(e,this.activeAxis)===!1){this.showNoSelectionToast();return}this.activeType=e,this.applyTypeState(),this.renderTools(),this.isHidden&&(this.isHidden=!1,this.options.onHideToggle?.(!1))}handleAxisChange(e){this.activeAxis!==e&&(this.activeAxis=e,this.applyAxisState(),this.activeType==="axis"&&this.options.onAxisChange?.(e))}applyTypeState(){this.typeButtons.forEach((t,n)=>{t.classList.toggle("is-active",n===this.activeType)});const e=this.activeType==="axis";this.axisPanel.classList.toggle("is-visible",e)}applyAxisState(){this.axisButtons.forEach((e,t)=>{e.classList.toggle("is-active",t===this.activeAxis)})}renderTools(){if(this.toolContainer.innerHTML="",!this.activeType){this.divider.classList.add("is-hidden");return}this.divider.classList.remove("is-hidden"),this.getToolsForType(this.activeType).forEach(e=>{const t=document.createElement("button");t.type="button",t.className="section-dock-tool-btn",e.isActive&&t.classList.add("is-active");const n=document.createElement("span");n.className="section-dock-tool-icon",n.innerHTML=vn(e.iconName),t.appendChild(n);const r=At(e.textKey);t.dataset.tooltip=r,t.setAttribute("aria-label",r),t.addEventListener("click",e.onClick),this.toolContainer.appendChild(t)})}getToolsForType(e){const t={key:"fill",iconName:"填充",textKey:e==="box"||e==="selected"?"sectionBox.actions.fill":e==="axis"?"sectionAxis.actions.fill":"sectionPlane.actions.fill",isActive:this.isFilled,onClick:()=>{this.isFilled=!this.isFilled,this.options.onFillToggle?.(this.isFilled),this.renderTools()}},n={key:"hide",iconName:"隐藏",textKey:e==="box"||e==="selected"?"sectionBox.actions.hide":e==="axis"?"sectionAxis.actions.hide":"sectionPlane.actions.hide",isActive:this.isHidden,onClick:()=>{this.isHidden=!this.isHidden,this.options.onHideToggle?.(this.isHidden),this.renderTools()}},r={key:"reverse",iconName:"反向",textKey:e==="axis"?"sectionAxis.actions.reverse":e==="box"?"sectionBox.actions.reverse":"sectionPlane.actions.reverse",onClick:()=>{this.options.onReverse?.()}};return e==="axis"?[t,n,r,{key:"reset",iconName:"重置",textKey:"sectionAxis.actions.reset",onClick:()=>{this.isHidden=!1,this.options.onReset?.(e,this.activeAxis),this.renderTools()}}]:e==="box"||e==="selected"?[t,n,{key:"reset",iconName:"重置",textKey:"sectionBox.actions.reset",onClick:()=>{if(this.options.onReset?.(e,this.activeAxis)===!1){this.showNoSelectionToast();return}this.isHidden=!1,this.renderTools()}}]:[t,n,r,{key:"reset",iconName:"重置",textKey:"sectionPlane.actions.reset",onClick:()=>{this.isHidden=!1,this.options.onReset?.(e,this.activeAxis),this.renderTools()}}]}showNoSelectionToast(){this.showToast(At("panel.componentDetail.noSelection"))}showToast(e){this.toastTimer&&clearTimeout(this.toastTimer),this.toast.textContent=e,this.toast.classList.add("is-visible"),this.toastTimer=setTimeout(()=>{this.toast.classList.remove("is-visible"),this.toastTimer=null},1800)}}class Sbe extends Mc{panel=null;unsubscribeTheme=null;unsubscribeLocale=null;unsubscribeDockState=null;constructor(e){super(e)}init(){this.unsubscribeTheme||(this.unsubscribeTheme=qi.subscribe(()=>{this.applyPresentation()})),this.unsubscribeLocale||(this.unsubscribeLocale=dr.subscribe(()=>{this.applyPresentation()})),this.unsubscribeDockState||(this.unsubscribeDockState=this.registry.bottomDock?.onStateChange(e=>{if(e.id==="section"){if(!e.open){console.log("deactivateSection"),this.engineComponent?.deactivateSection();return}this.panel?.resetForOpen()}})??null)}destroy(){this.unsubscribeTheme&&(this.unsubscribeTheme(),this.unsubscribeTheme=null),this.unsubscribeLocale&&(this.unsubscribeLocale(),this.unsubscribeLocale=null),this.unsubscribeDockState&&(this.unsubscribeDockState(),this.unsubscribeDockState=null),this.panel?.destroy(),this.panel=null,super.destroy()}getPanelElement(){return this.panel||(this.panel=new Lct({defaultType:null,defaultAxis:"x",defaultHidden:!1,onTypeChange:(e,t)=>this.activateByType(e,t),onAxisChange:e=>{this.panel?.getActiveType()==="axis"&&this.engineComponent?.activeSection(e)},onHideToggle:e=>{if(e){this.engineComponent?.hideSection();return}this.engineComponent?.recoverSection()},onReverse:()=>{this.engineComponent?.reverseSection()},onReset:(e,t)=>(this.engineComponent?.deactivateSection(),this.activateByType(e,t)),onFitToModel:()=>{this.engineComponent?.scaleSectionBox()},defaultFill:this.engineComponent?.getFillCutFace()??!1,onFillToggle:e=>{this.engineComponent?.setFillCutFace(e)}}),this.panel.init()),this.panel.resetForOpen(),this.applyPresentation(),this.panel.element}activateByType(e,t){return e?e==="face"?(this.engineComponent?.activeSection("face"),!0):e==="box"?(this.engineComponent?.activeSection("box"),!0):e==="selected"?fbe(this.engineComponent):(this.engineComponent?.activeSection(t),!0):(this.engineComponent?.deactivateSection(),!0)}applyPresentation(){this.panel&&(this.panel.setTheme(qi.getTheme()),this.panel.setLocales())}}class Oct{element;options;state={mode:"none",isPlanViewActive:!1,speed:1,gravity:!1,collision:!1,viewMode:"first-person",characterModel:"construction-worker",walkMode:"walk"};planViewBtn;firstPersonBtn;thirdPersonBtn;pathModeBtn;settingsContainer;speedControl;speedDecreaseBtn;speedIncreaseBtn;speedDisplay;gravityCheckbox;gravityLabel;collisionCheckbox;collisionLabel;characterModelSelect;characterModelLabel;walkModeSelect;walkModeLabel;exitBtn;unsubscribeLocale=null;unsubscribeTheme=null;constructor(e={}){this.options=e}init(){this.element=this.createPanel(),this.updateSettingsView(),this.unsubscribeLocale=dr.subscribe(()=>this.setLocales()),this.unsubscribeTheme=qi.subscribe(e=>this.setTheme(e)),this.setLocales(),this.setTheme(qi.getTheme())}setPlanViewActive(e){this.state.isPlanViewActive=e,this.updateButtonStates()}setPathModeActive(e){if(!e&&this.state.mode!=="path")return;const t=e?"path":"none";this.setMode(t)}setViewMode(e){this.state.viewMode=e,this.updateButtonStates()}getState(){return{...this.state}}setSpeed(e){this.state.speed=Math.max(1,Math.min(10,e)),this.updateSpeedDisplay()}setGravity(e){this.state.gravity=e,this.gravityCheckbox&&(this.gravityCheckbox.checked=e)}setCollision(e){this.state.collision=e,this.collisionCheckbox&&(this.collisionCheckbox.checked=e)}createPanel(){const e=document.createElement("div");e.className="walk-dock-panel";const t=this.createLeftButtons(),n=document.createElement("div");n.className="walk-divider",this.settingsContainer=this.createSettingsContainer();const r=document.createElement("div");r.className="walk-divider";const s=this.createExitButton();return e.appendChild(t),e.appendChild(n),e.appendChild(this.settingsContainer),e.appendChild(r),e.appendChild(s),e}createLeftButtons(){const e=document.createElement("div");return e.className="walk-dock-left",this.planViewBtn=this.createIconButton("plan-view",()=>{this.state.isPlanViewActive=!this.state.isPlanViewActive,this.updateButtonStates(),this.options.onPlanViewToggle?.(this.state.isPlanViewActive)}),this.pathModeBtn=this.createIconButton("path",()=>{const t=this.state.mode==="path"?"none":"path";this.setMode(t),this.options.onPathModeToggle?.(t==="path")}),this.firstPersonBtn=this.createIconButton("first-person",()=>{this.setViewMode("first-person"),this.options.onViewModeChange?.("first-person")}),this.thirdPersonBtn=this.createIconButton("third-person",()=>{this.setViewMode("third-person"),this.options.onViewModeChange?.("third-person")}),e.appendChild(this.planViewBtn),e.appendChild(this.firstPersonBtn),e.appendChild(this.thirdPersonBtn),e}createSettingsContainer(){const e=document.createElement("div");e.className="walk-dock-settings",this.speedControl=this.createSpeedControl();const t=document.createElement("label");t.className="walk-checkbox-wrapper walk-checkbox-gravity",this.gravityCheckbox=document.createElement("input"),this.gravityCheckbox.type="checkbox",this.gravityCheckbox.className="walk-checkbox",this.gravityCheckbox.checked=this.state.gravity,this.gravityCheckbox.addEventListener("change",()=>{this.state.gravity=this.gravityCheckbox.checked,this.options.onGravityToggle?.(this.state.gravity)}),this.gravityLabel=document.createElement("span"),this.gravityLabel.className="walk-checkbox-label",t.appendChild(this.gravityCheckbox),t.appendChild(this.gravityLabel);const n=document.createElement("label");n.className="walk-checkbox-wrapper walk-checkbox-collision",this.collisionCheckbox=document.createElement("input"),this.collisionCheckbox.type="checkbox",this.collisionCheckbox.className="walk-checkbox",this.collisionCheckbox.checked=this.state.collision,this.collisionCheckbox.addEventListener("change",()=>{this.state.collision=this.collisionCheckbox.checked,this.options.onCollisionToggle?.(this.state.collision)}),this.collisionLabel=document.createElement("span"),this.collisionLabel.className="walk-checkbox-label",n.appendChild(this.collisionCheckbox),n.appendChild(this.collisionLabel);const r=document.createElement("div");r.className="walk-select-wrapper walk-select-wrapper-character-model",this.characterModelLabel=document.createElement("label"),this.characterModelLabel.className="walk-select-label",this.characterModelSelect=document.createElement("select"),this.characterModelSelect.className="walk-select walk-select-character-model",this.characterModelSelect.addEventListener("change",()=>{this.state.characterModel=this.characterModelSelect.value,this.options.onCharacterModelChange?.(this.state.characterModel)}),r.appendChild(this.characterModelLabel),r.appendChild(this.characterModelSelect);const s=document.createElement("div");return s.className="walk-select-wrapper walk-select-wrapper-walk-mode",this.walkModeLabel=document.createElement("label"),this.walkModeLabel.className="walk-select-label",this.walkModeSelect=document.createElement("select"),this.walkModeSelect.className="walk-select walk-select-walk-mode",this.walkModeSelect.addEventListener("change",()=>{this.state.walkMode=this.walkModeSelect.value,this.options.onWalkModeChange?.(this.state.walkMode)}),s.appendChild(this.walkModeLabel),s.appendChild(this.walkModeSelect),e.appendChild(this.speedControl),e.appendChild(r),e.appendChild(s),e.appendChild(t),e.appendChild(n),e}createSpeedControl(){const e=document.createElement("div");e.className="walk-speed-control";const t=document.createElement("label");t.className="walk-speed-label",t.textContent=At("walkControl.speed");const n=document.createElement("div");return n.className="walk-speed-group",this.speedDecreaseBtn=document.createElement("button"),this.speedDecreaseBtn.className="walk-speed-btn",this.speedDecreaseBtn.textContent="-",this.speedDecreaseBtn.addEventListener("click",()=>{this.state.speed>1&&(this.state.speed--,this.updateSpeedDisplay(),this.options.onSpeedChange?.(this.state.speed))}),this.speedDisplay=document.createElement("div"),this.speedDisplay.className="walk-speed-display",this.speedDisplay.textContent=`${this.state.speed}X`,this.speedIncreaseBtn=document.createElement("button"),this.speedIncreaseBtn.className="walk-speed-btn",this.speedIncreaseBtn.textContent="+",this.speedIncreaseBtn.addEventListener("click",()=>{this.state.speed<10&&(this.state.speed++,this.updateSpeedDisplay(),this.options.onSpeedChange?.(this.state.speed))}),n.appendChild(this.speedDecreaseBtn),n.appendChild(this.speedDisplay),n.appendChild(this.speedIncreaseBtn),e.appendChild(t),e.appendChild(n),e}createIconButton(e,t){const n=document.createElement("button");return n.className=`walk-icon-btn walk-icon-btn-${e}`,n.innerHTML=this.getIconSVG(e),n.addEventListener("click",t),n}createExitButton(){const e=document.createElement("button");return e.className="walk-exit-btn",e.addEventListener("click",()=>{this.options.onExit?.()}),this.exitBtn=e,e}setMode(e){const t=this.state.mode;t==="walk"&&e!=="walk"&&this.options.onWalkModeToggle?.(!1),t==="path"&&e!=="path"&&this.options.onPathModeToggle?.(!1),this.state.mode=e,e==="path"?(this.state.gravity=!1,this.state.collision=!1,this.gravityCheckbox.checked=!1,this.gravityCheckbox.disabled=!0,this.collisionCheckbox.checked=!1,this.collisionCheckbox.disabled=!0):(this.gravityCheckbox.disabled=!1,this.collisionCheckbox.disabled=!1),this.updateButtonStates(),this.updateSettingsView(),this.updateSpeedButtonStates()}updateButtonStates(){this.planViewBtn.classList.toggle("active",this.state.isPlanViewActive),this.firstPersonBtn.classList.toggle("active",this.state.viewMode==="first-person"),this.thirdPersonBtn.classList.toggle("active",this.state.viewMode==="third-person"),this.pathModeBtn.classList.toggle("active",this.state.mode==="path")}updateSettingsView(){const e=this.speedControl,t=this.gravityCheckbox.parentElement,n=this.collisionCheckbox.parentElement,r=this.characterModelSelect.parentElement,s=this.walkModeSelect.parentElement;this.state.mode==="walk"?(e.style.display="none",t.style.display="flex",n.style.display="flex",r.style.display="flex",s.style.display="flex"):(e.style.display="flex",t.style.display="flex",n.style.display="flex",r.style.display="none",s.style.display="none")}updateSpeedDisplay(){this.speedDisplay.textContent=`${this.state.speed}X`,this.updateSpeedButtonStates()}updateSpeedButtonStates(){this.speedDecreaseBtn.disabled=this.state.speed<=1,this.speedIncreaseBtn.disabled=this.state.speed>=10}getIconSVG(e){return{"plan-view":vn("地图"),"first-person":vn("眼睛"),"third-person":vn("第一人称漫游"),path:vn("路径漫游"),walk:vn("第一人称漫游")}[e]||""}setLocales(){this.setButtonTooltip(this.planViewBtn,At("walkControl.planView")),this.setButtonTooltip(this.firstPersonBtn,At("walkControl.viewMode.firstPerson")),this.setButtonTooltip(this.thirdPersonBtn,At("walkControl.viewMode.thirdPerson"));const e=this.speedControl.querySelector(".walk-speed-label");e&&(e.textContent=At("walkControl.speed")),this.gravityLabel.textContent=At("walkControl.gravity"),this.collisionLabel.textContent=At("walkControl.collision"),this.characterModelLabel.textContent=At("walkControl.characterModel.label"),this.characterModelSelect.innerHTML="";const t=document.createElement("option");t.value="construction-worker",t.textContent=At("walkControl.characterModel.constructionWorker"),t.selected=this.state.characterModel==="construction-worker",this.characterModelSelect.appendChild(t);const n=document.createElement("option");n.value="office-male",n.textContent=At("walkControl.characterModel.officeMale"),n.selected=this.state.characterModel==="office-male",this.characterModelSelect.appendChild(n),this.walkModeLabel.textContent=At("walkControl.walkMode.label"),this.walkModeSelect.innerHTML="";const r=document.createElement("option");r.value="walk",r.textContent=At("walkControl.walkMode.walk"),r.selected=this.state.walkMode==="walk",this.walkModeSelect.appendChild(r);const s=document.createElement("option");s.value="run",s.textContent=At("walkControl.walkMode.run"),s.selected=this.state.walkMode==="run",this.walkModeSelect.appendChild(s),this.exitBtn.textContent=At("walkControl.exit")}setButtonTooltip(e,t){e.title=t,e.setAttribute("aria-label",t),e.dataset.tooltip=t}setTheme(e){if(!this.element)return;const t=this.element.style;t.setProperty("--bim-bg-base",e.bgBase??"#152232"),t.setProperty("--bim-bg-elevated",e.bgElevated??"#1f2d3e"),t.setProperty("--bim-bg-inset",e.bgInset??"#152232"),t.setProperty("--bim-border-default",e.borderDefault??"#334155"),t.setProperty("--bim-border-strong",e.borderStrong??"#475569"),t.setProperty("--bim-border-subtle",e.borderSubtle??"#1e293b"),t.setProperty("--bim-divider",e.divider??"#334155"),t.setProperty("--bim-shadow-xl",e.shadowXl??"0 20px 40px rgba(0, 0, 0, 0.3)"),t.setProperty("--bim-primary",e.primary??"#3b82f6"),t.setProperty("--bim-primary-hover",e.primaryHover??"#60a5fa"),t.setProperty("--bim-primary-subtle",e.primarySubtle??"rgba(59, 130, 246, 0.15)"),t.setProperty("--bim-text-primary",e.textPrimary??"#ffffff"),t.setProperty("--bim-text-inverse",e.textInverse??"#152232"),t.setProperty("--bim-icon-default",e.iconDefault??"#ffffff"),t.setProperty("--bim-component-bg-hover",e.componentBgHover??"rgba(248, 250, 252, 0.06)"),t.setProperty("--bim-component-bg-active",e.componentBgActive??"rgba(248, 250, 252, 0.1)")}destroy(){this.unsubscribeLocale?.(),this.unsubscribeTheme?.(),this.element&&this.element.parentElement&&this.element.parentElement.removeChild(this.element)}}class ME extends Mc{dialog=null;isVisible=!1;constructor(e){super(e)}get dialogWidth(){return 300}get dialogHeight(){return"auto"}get dialogOptions(){return{draggable:!0,resizable:!1}}get dialogHeader(){}get dialogHideCloseButton(){return!1}onDialogClose(){}onDialogCreated(){}onBeforeDestroy(){}getDialogPosition(){const e=this.registry.container;if(!e)return{x:100,y:100};const t=e.clientWidth,n=e.clientHeight,r=this.dialogWidth,s=typeof this.dialogHeight=="number"?this.dialogHeight:300;return{x:t-r-20,y:(n-s)/2}}show(){if(!this.registry.dialog||!this.registry.container){console.warn(`[${this.dialogId}] Dialog manager or container is not initialized`);return}this.dialog&&this.destroyDialog();const e=this.getDialogPosition(),t=this.createContent(),n=this.dialogOptions;this.dialog=this.registry.dialog.create({id:this.dialogId,title:this.dialogTitle,content:t,width:this.dialogWidth,height:this.dialogHeight,position:e,draggable:n.draggable,resizable:n.resizable,header:this.dialogHeader,hideCloseButton:this.dialogHideCloseButton,onClose:()=>{this.onDialogClose(),this.destroyDialog()}}),this.dialog.init(),this.isVisible=!0,this.onDialogCreated()}hide(){this.destroyDialog()}toggle(){this.isVisible?this.hide():this.show()}isOpen(){return this.isVisible}destroyDialog(){this.onBeforeDestroy(),this.dialog&&(this.dialog.destroy(),this.dialog=null),this.isVisible=!1}destroy(){this.destroyDialog(),super.destroy()}}class Nct{element;registry;unsubscribeLocale=null;unsubscribeTheme=null;constructor(e){this.registry=e}points=[];duration=1e4;loop=!1;playingPointIndex=-1;isPlaying=!1;init(){this.element=document.createElement("div"),this.element.className="walk-path-panel",this.unsubscribeLocale=dr.subscribe(()=>this.render()),this.unsubscribeTheme=qi.subscribe(e=>this.setTheme(e)),this.loadPointsFromEngine(),this.render(),this.setTheme(qi.getTheme())}loadPointsFromEngine(){const e=this.registry.engine3d?.getEngineComponent()?.pathRoamingGetPoints()??[];this.points=e.map((t,n)=>({index:n}))}render(){this.element.innerHTML="";const e=this.createSettingsSection();this.element.appendChild(e);const t=this.createPointsSection();this.element.appendChild(t);const n=this.createPlayButton();this.element.appendChild(n)}createSettingsSection(){const e=document.createElement("div");e.className="walk-path-settings";const t=document.createElement("div");t.className="walk-path-form-group";const n=document.createElement("label");n.textContent=At("walkControl.path.duration");const r=document.createElement("div");r.className="walk-path-input-wrapper";const s=document.createElement("input");s.type="number",s.className="walk-path-input",s.value=String(this.duration/1e3),s.min="1",s.oninput=h=>{const u=parseInt(h.target.value)||1;this.duration=u*1e3};const o=document.createElement("span");o.className="walk-path-unit",o.textContent=At("walkControl.path.durationUnit"),r.appendChild(s),r.appendChild(o),t.appendChild(n),t.appendChild(r);const a=document.createElement("div");a.className="walk-path-form-group walk-path-form-group-inline";const l=document.createElement("input");l.type="checkbox",l.id="walk-path-loop-checkbox",l.className="walk-path-checkbox",l.checked=this.loop,l.onchange=h=>{this.loop=h.target.checked};const c=document.createElement("label");return c.htmlFor="walk-path-loop-checkbox",c.textContent=At("walkControl.path.loop"),a.appendChild(l),a.appendChild(c),e.appendChild(t),e.appendChild(a),e}createPointsSection(){const e=document.createElement("div");e.className="walk-path-points-section";const t=document.createElement("div");t.className="walk-path-points-toolbar";const n=document.createElement("button");n.className="walk-path-btn walk-path-btn-small",n.textContent=`+ ${At("walkControl.path.addPoint")}`,n.onclick=()=>this.addPoint();const r=document.createElement("button");r.className="walk-path-btn walk-path-btn-small walk-path-btn-danger",r.textContent=At("walkControl.path.deleteAll"),r.onclick=()=>this.deleteAllPoints(),t.appendChild(n),t.appendChild(r),e.appendChild(t);const s=document.createElement("div");if(s.className="walk-path-points-list",this.points.length===0){const o=document.createElement("div");o.className="walk-path-empty",o.textContent=At("walkControl.path.noPoints"),s.appendChild(o)}else this.points.forEach((o,a)=>{const l=this.createPointItem(a);s.appendChild(l)});return e.appendChild(s),e}createPointItem(e){const t=document.createElement("div");t.className="walk-path-point-item",this.playingPointIndex===e&&t.classList.add("walk-path-point-item-active");const n=document.createElement("span");n.className="walk-path-point-name",n.textContent=`${At("walkControl.path.point")}${e}`;const r=document.createElement("div");r.className="walk-path-point-actions";const s=document.createElement("button");s.className="walk-path-btn-icon",s.innerHTML="▶",s.title=At("walkControl.path.play"),s.onclick=a=>{a.stopPropagation(),this.jumpToPoint(e)};const o=document.createElement("button");return o.className="walk-path-btn-icon walk-path-btn-icon-danger",o.innerHTML="×",o.onclick=a=>{a.stopPropagation(),this.deletePoint(e)},r.appendChild(s),r.appendChild(o),t.appendChild(n),t.appendChild(r),t}createPlayButton(){const e=document.createElement("div");e.className="walk-path-btn-group";const t=document.createElement("button");t.className="walk-path-btn walk-path-btn-play",t.textContent=`▶ ${At("walkControl.path.play")}`,t.disabled=this.points.length===0||this.isPlaying,t.onclick=()=>this.playPath();const n=document.createElement("button");return n.className="walk-path-btn walk-path-btn-stop",n.textContent=`■ ${At("walkControl.path.stop")}`,n.disabled=!this.isPlaying,n.onclick=()=>this.stopPath(),e.appendChild(t),e.appendChild(n),e}addPoint(){this.registry.engine3d?.getEngineComponent()?.pathRoamingAddPoint();const e=this.points.length;this.points.push({index:e}),this.render()}deletePoint(e){this.registry.engine3d?.getEngineComponent()?.pathRoamingRemovePoint(e),this.points.splice(e,1),this.points.forEach((t,n)=>t.index=n),this.render()}deleteAllPoints(){this.registry.engine3d?.getEngineComponent()?.pathRoamingClearPoints(),this.points=[],this.render()}jumpToPoint(e){this.registry.engine3d?.getEngineComponent()?.pathRoamingJumpToPoint(e)}playPath(){this.points.length!==0&&(this.isPlaying=!0,this.render(),console.log("[WalkPathPanel] 开始播放漫游",{duration:this.duration,loop:this.loop,pointsCount:this.points.length}),this.registry.engine3d?.getEngineComponent()?.pathRoamingPlay({duration:this.duration,loop:this.loop,onPointComplete:e=>{console.log("[WalkPathPanel] onPointComplete",{pointIndex:e}),this.playingPointIndex=e,this.render()},onComplete:()=>{console.log("[WalkPathPanel] onComplete 播放完成"),this.isPlaying=!1,this.playingPointIndex=-1,this.render()}}))}stopPath(){console.log("[WalkPathPanel] 停止漫游"),this.registry.engine3d?.getEngineComponent()?.pathRoamingStop(),this.isPlaying=!1,this.playingPointIndex=-1,this.render()}setLocales(){this.render()}setTheme(e){this.element&&(this.element.style.setProperty("--bim-text-primary",e.textPrimary??"#fff"),this.element.style.setProperty("--bim-text-secondary",e.textPrimary??"#fff"),this.element.style.setProperty("--bim-bg-elevated",e.bgElevated??"#1f2d3e"),this.element.style.setProperty("--bim-border-default",e.borderDefault??"#334155"),this.element.style.setProperty("--bim-primary",e.primary??"#3b82f6"))}destroy(){this.isPlaying&&this.stopPath(),this.unsubscribeLocale?.(),this.unsubscribeTheme?.(),this.element?.parentElement&&this.element.parentElement.removeChild(this.element)}}class Bct extends ME{panel=null;constructor(e){super(e)}get dialogId(){return"walk-path-dialog"}get dialogTitle(){return"walkControl.path.dialogTitle"}get dialogWidth(){return 300}get dialogHeight(){return 450}init(){}getDialogPosition(){const e=this.registry.container;return e?{x:e.clientWidth-this.dialogWidth-20,y:20}:{x:100,y:100}}createContent(){return this.panel=new Nct(this.registry),this.panel.init(),this.panel.element}onDialogClose(){this.registry.walkDock?.setPathModeActive(!1)}onBeforeDestroy(){this.panel&&(this.panel.destroy(),this.panel=null)}}class Tbe extends Mc{panel=null;pathManager=null;unsubscribeDockState=null;constructor(e){super(e)}init(){this.pathManager=new Bct(this.registry),this.pathManager.init(),this.unsubscribeDockState||(this.unsubscribeDockState=this.registry.bottomDock?.onStateChange(e=>{if(e.id==="walk"){if(e.open){this.onOpen();return}this.onClose()}})??null)}destroy(){this.unsubscribeDockState&&(this.unsubscribeDockState(),this.unsubscribeDockState=null),this.onClose(),this.pathManager?.destroy(),this.pathManager=null,super.destroy()}getPanelElement(){return this.panel||(this.panel=new Oct({onPlanViewToggle:e=>{this.engineComponent?.toggleMiniMap(),this.registry.toolbar?.setBtnActive("map",e),this.emit("walk:plan-view-toggle",{isActive:e})},onPathModeToggle:e=>{e?this.pathManager?.show():this.pathManager?.hide(),this.emit("walk:path-mode-toggle",{isActive:e})},onWalkModeToggle:e=>{e&&this.pathManager?.hide(),this.emit("walk:walk-mode-toggle",{isActive:e})},onSpeedChange:e=>{this.engineComponent?.setWalkSpeed(e),this.emit("walk:speed-change",{speed:e})},onGravityToggle:e=>{this.engineComponent?.setWalkGravity(e),this.emit("walk:gravity-toggle",{enabled:e})},onCollisionToggle:e=>{this.engineComponent?.setWalkCollision(e),this.emit("walk:collision-toggle",{enabled:e})},onViewModeChange:e=>{e==="first-person"?this.engineComponent?.activateFirstPersonMode():this.engineComponent?.activateThirdPersonMode(),this.emit("walk:view-mode-change",{mode:e})},onCharacterModelChange:e=>{},onWalkModeChange:e=>{},onExit:()=>{this.registry.bottomDock?.close("walk")}}),this.panel.init()),this.syncMapState(),this.panel.element}setPlanViewActive(e){this.panel?.setPlanViewActive(e)}setPathModeActive(e){this.panel?.setPathModeActive(e)}onOpen(){this.engineComponent?.activateFirstPersonMode(),this.panel?.setViewMode("first-person"),this.engineComponent?.getMiniMapState()||(this.engineComponent?.toggleMiniMap(),this.registry.toolbar?.setBtnActive("map",!0)),this.syncMapState(),this.engineComponent?.setWalkSpeed(2),this.engineComponent?.setWalkCollision(!1);const e=this.engineComponent?.getWalkSpeed()??2,t=this.engineComponent?.getWalkGravity()??!1,n=this.engineComponent?.getWalkCollision()??!1;console.log("[WalkDock] 初始状态 - speed:",e,"gravity:",t,"collision:",n),this.panel?.setSpeed(e),this.panel?.setGravity(t),this.panel?.setCollision(n)}onClose(){this.pathManager?.hide(),this.engineComponent?.getMiniMapState()&&this.engineComponent.toggleMiniMap(),this.engineComponent?.deactivateFirstPersonMode(),this.panel&&(this.panel.destroy(),this.panel=null),this.registry.toolbar?.setBtnActive("map",!1)}syncMapState(){const e=this.engineComponent?.getMiniMapState()??!1;this.panel?.setPlanViewActive(e)}}class Fct{element;options;items=[];bodyEl;emptyEl;rowRefs=[];unsubscribeLocale=null;unsubscribeTheme=null;constructor(e={}){this.options=e}init(){this.element=this.createPanel(),this.unsubscribeLocale=dr.subscribe(()=>this.setLocales()),this.unsubscribeTheme=qi.subscribe(e=>this.setTheme(e)),this.setLocales(),this.setTheme(qi.getTheme())}setItems(e){this.items=e,this.renderRows()}setTheme(e){if(!this.element)return;const t=this.element.style;t.setProperty("--mcal-text-primary",e.textPrimary),t.setProperty("--mcal-text-secondary",e.textSecondary),t.setProperty("--mcal-border",e.borderSubtle),t.setProperty("--mcal-bg-inset",e.bgInset),t.setProperty("--mcal-bg-elevated",e.bgElevated),t.setProperty("--mcal-primary",e.primary),t.setProperty("--mcal-primary-subtle",e.primarySubtle)}setLocales(){this.element&&(this.element.querySelectorAll("[data-i18n]").forEach(e=>{const t=e.dataset.i18n;t&&(e.textContent=At(t))}),this.renderRows())}destroy(){this.unsubscribeLocale?.(),this.unsubscribeLocale=null,this.unsubscribeTheme?.(),this.unsubscribeTheme=null,this.rowRefs=[],this.element?.remove()}createPanel(){const e=document.createElement("div");e.className="model-calibration-dock-panel";const t=document.createElement("div");t.className="model-calibration-table-wrap";const n=document.createElement("table");return n.className="model-calibration-table",n.appendChild(this.createHead()),this.bodyEl=document.createElement("tbody"),n.appendChild(this.bodyEl),t.appendChild(n),this.emptyEl=document.createElement("div"),this.emptyEl.className="model-calibration-empty",this.emptyEl.textContent=At("modelCalibration.empty"),t.appendChild(this.emptyEl),e.append(t),e}createHead(){const e=document.createElement("thead"),t=document.createElement("tr");return["modelCalibration.model","modelCalibration.offsetX","modelCalibration.offsetY","modelCalibration.offsetZ","modelCalibration.rotationX","modelCalibration.rotationY","modelCalibration.rotationZ","modelCalibration.actions"].forEach(r=>{const s=document.createElement("th");s.dataset.i18n=r,s.textContent=At(r),t.appendChild(s)}),e.appendChild(t),e}renderRows(){this.bodyEl&&(this.bodyEl.innerHTML="",this.rowRefs=[],this.emptyEl.textContent=At("modelCalibration.empty"),this.emptyEl.classList.toggle("is-visible",this.items.length===0),this.items.forEach(e=>{const t=document.createElement("tr"),n={item:e,offsetInputs:this.createInputMap(e.offset),rotationInputs:this.createInputMap(e.rotation)};t.appendChild(this.createModelCell(e)),t.appendChild(this.createInputCell(n.offsetInputs.x)),t.appendChild(this.createInputCell(n.offsetInputs.y)),t.appendChild(this.createInputCell(n.offsetInputs.z)),t.appendChild(this.createInputCell(n.rotationInputs.x)),t.appendChild(this.createInputCell(n.rotationInputs.y)),t.appendChild(this.createInputCell(n.rotationInputs.z)),t.appendChild(this.createActionCell(n)),this.rowRefs.push(n),this.bodyEl.appendChild(t)}))}createModelCell(e){const t=document.createElement("td");t.className="model-calibration-model-cell";const n=document.createElement("div");return n.className="model-calibration-model-name",n.textContent=e.name,n.title=`${e.name}
|
|
4015
4015
|
${e.url}`,t.appendChild(n),t}createInputMap(e){return{x:this.createNumberInput(e.x),y:this.createNumberInput(e.y),z:this.createNumberInput(e.z)}}createNumberInput(e){const t=document.createElement("input");return t.type="number",t.className="model-calibration-input",t.step="0.01",t.value=this.formatNumber(e),t}createInputCell(e){const t=document.createElement("td");return t.className="model-calibration-input-cell",t.appendChild(e),t}createActionCell(e){const t=document.createElement("td");t.className="model-calibration-action-cell";const n=document.createElement("button");n.type="button",n.className="model-calibration-btn model-calibration-icon-btn is-primary",n.textContent="✓",n.title=At("modelCalibration.apply"),n.dataset.tooltip=At("modelCalibration.apply"),n.setAttribute("aria-label",At("modelCalibration.apply")),n.addEventListener("click",()=>{this.options.onApply?.({url:e.item.url,offset:this.readVector(e.offsetInputs),rotation:this.readVector(e.rotationInputs)})||(n.classList.add("is-error"),window.setTimeout(()=>n.classList.remove("is-error"),600))});const r=document.createElement("button");return r.type="button",r.className="model-calibration-btn model-calibration-icon-btn",r.textContent="↻",r.title=At("modelCalibration.reset"),r.dataset.tooltip=At("modelCalibration.reset"),r.setAttribute("aria-label",At("modelCalibration.reset")),r.addEventListener("click",()=>{this.options.onReset?.(e.item.url)||(r.classList.add("is-error"),window.setTimeout(()=>r.classList.remove("is-error"),600))}),t.append(n,r),t}readVector(e){return{x:this.readInput(e.x),y:this.readInput(e.y),z:this.readInput(e.z)}}readInput(e){const t=Number(e.value);return Number.isFinite(t)?t:0}formatNumber(e){if(!Number.isFinite(e))return"0";const t=Math.abs(e)<1e-10?0:Number(e.toFixed(4));return String(Object.is(t,-0)?0:t)}}class Cbe extends Mc{panel=null;unsubscribeTheme=null;unsubscribeLocale=null;unsubscribeDockState=null;unsubscribeModelLoaded=null;constructor(e){super(e)}init(){this.unsubscribeTheme||(this.unsubscribeTheme=qi.subscribe(()=>this.applyPresentation())),this.unsubscribeLocale||(this.unsubscribeLocale=dr.subscribe(()=>this.applyPresentation())),this.unsubscribeDockState||(this.unsubscribeDockState=this.registry.bottomDock?.onStateChange(e=>{e.id==="modelCalibration"&&e.open&&this.refreshPanel()})??null),this.unsubscribeModelLoaded||(this.unsubscribeModelLoaded=this.registry.on("engine:model-loading-completed",()=>{this.registry.bottomDock?.isOpen("modelCalibration")&&this.refreshPanel()}))}destroy(){this.unsubscribeTheme?.(),this.unsubscribeTheme=null,this.unsubscribeLocale?.(),this.unsubscribeLocale=null,this.unsubscribeDockState?.(),this.unsubscribeDockState=null,this.unsubscribeModelLoaded?.(),this.unsubscribeModelLoaded=null,this.panel?.destroy(),this.panel=null,super.destroy()}getPanelElement(){return this.panel||(this.panel=new Fct({onApply:({url:e,offset:t,rotation:n})=>this.applyCalibration(e,t,n),onReset:e=>this.resetCalibration(e),onRefresh:()=>this.refreshPanel()}),this.panel.init()),this.applyPresentation(),this.refreshPanel(),this.panel.element}applyCalibration(e,t,n){const r=this.engineComponent?.setModelCalibrationTransform({url:e,offset:t,rotation:n,rotationOrder:"XYZ"})??!1;return r&&this.refreshPanel(),r}resetCalibration(e){const t=this.engineComponent?.resetModelCalibration(e)??!1;return t&&this.refreshPanel(),t}refreshPanel(){this.panel&&this.panel.setItems(this.engineComponent?.getModelCalibrationItems()??[])}applyPresentation(){this.panel&&(this.panel.setTheme(qi.getTheme()),this.panel.setLocales())}}class Mbe{element;navElement;contentElement;options;activeId;tabMap=new Map;panelMap=new Map;panelTreeScrollTopMap=new Map;unsubscribeLocale=null;unsubscribeTheme=null;navClickHandler=null;constructor(e){this.options=e,this.activeId=e.activeId||(e.tabs[0]?.id??null),e.tabs.forEach(t=>this.tabMap.set(t.id,t)),this.element=document.createElement("div"),this.element.className="bim-tab",this.navElement=document.createElement("div"),this.navElement.className="bim-tab__nav",this.navElement.setAttribute("role","tablist"),this.element.appendChild(this.navElement),this.contentElement=document.createElement("div"),this.contentElement.className="bim-tab__content",this.element.appendChild(this.contentElement),this.options.container.appendChild(this.element)}init(){this.renderNav(),this.renderPanels(),this.setLocales(),this.setTheme(qi.getTheme()),this.unsubscribeLocale=dr.subscribe(()=>this.setLocales()),this.unsubscribeTheme=qi.subscribe(e=>this.setTheme(e))}renderNav(){this.navElement.innerHTML="",this.navClickHandler=e=>{const t=e.target.closest(".bim-tab__item");if(!t)return;const n=t.dataset.id;!n||this.tabMap.get(n)?.disabled||this.activateTab(n)},this.navElement.addEventListener("click",this.navClickHandler),this.options.tabs.forEach(e=>{const t=document.createElement("button");if(t.type="button",t.className="bim-tab__item",t.dataset.id=e.id,t.setAttribute("role","tab"),t.id=`tab-${e.id}`,t.setAttribute("aria-selected",`${e.id===this.activeId}`),e.disabled&&(t.disabled=!0,t.setAttribute("aria-disabled","true"),t.classList.add("is-disabled")),e.icon){const r=document.createElement("span");r.className="bim-tab__icon",r.innerHTML=e.icon,t.appendChild(r)}const n=document.createElement("span");n.className="bim-tab__title",n.textContent=this.resolveTitle(e.title),t.appendChild(n),e.id===this.activeId&&t.classList.add("is-active"),this.navElement.appendChild(t)})}renderPanels(){this.contentElement.innerHTML="",this.panelMap.clear(),this.options.tabs.forEach(e=>{const t=document.createElement("div");t.className="bim-tab__panel",t.dataset.id=e.id,t.setAttribute("role","tabpanel"),t.setAttribute("aria-labelledby",`tab-${e.id}`),e.content instanceof HTMLElement?t.appendChild(e.content):typeof e.content=="string"&&(t.innerHTML=e.content),e.id===this.activeId?t.classList.add("is-active"):t.style.display="none",this.panelMap.set(e.id,t),this.contentElement.appendChild(t)})}activateTab(e){if(this.activeId===e)return;const t=this.tabMap.get(e);if(!t||t.disabled)return;this.activeId=e,this.navElement.querySelectorAll(".bim-tab__item").forEach(r=>{const s=r.dataset.id===e;r.classList.toggle("is-active",s),r.setAttribute("aria-selected",`${s}`)}),this.panelMap.forEach((r,s)=>{const o=s===e;o||this.savePanelTreeScrollTop(s,r),r.classList.toggle("is-active",o),r.style.display=o?"":"none",o&&this.restorePanelTreeScrollTop(s,r)}),this.options.onChange&&this.options.onChange(e,t)}setTheme(e){const t=this.element.style;t.setProperty("--bim-tab-bg",e.bgElevated),t.setProperty("--bim-tab-nav-bg",e.bgElevated),t.setProperty("--bim-tab-text",e.textPrimary),t.setProperty("--bim-tab-text-secondary",e.textSecondary),t.setProperty("--bim-tab-text-active",e.primary),t.setProperty("--bim-tab-border",e.borderDefault),t.setProperty("--bim-tab-hover-bg",e.componentBgHover),t.setProperty("--bim-tab-active-bg",e.componentBgActive),t.setProperty("--bim-tab-icon",e.iconDefault)}setLocales(){this.navElement.querySelectorAll(".bim-tab__item").forEach(t=>{const n=t.dataset.id;if(!n)return;const r=this.tabMap.get(n);if(!r)return;const s=t.querySelector(".bim-tab__title");s&&(s.textContent=this.resolveTitle(r.title))})}destroy(){this.navClickHandler&&(this.navElement.removeEventListener("click",this.navClickHandler),this.navClickHandler=null),this.unsubscribeLocale&&(this.unsubscribeLocale(),this.unsubscribeLocale=null),this.unsubscribeTheme&&(this.unsubscribeTheme(),this.unsubscribeTheme=null),this.panelMap.clear(),this.panelTreeScrollTopMap.clear(),this.tabMap.clear(),this.element.remove()}savePanelTreeScrollTop(e,t){const n=t.querySelector(".bim-tree-content");n&&this.panelTreeScrollTopMap.set(e,n.scrollTop)}restorePanelTreeScrollTop(e,t){const n=this.panelTreeScrollTopMap.get(e);if(n===void 0)return;const r=t.querySelector(".bim-tree-content");r&&requestAnimationFrame(()=>{r.scrollTop=n})}resolveTitle(e){try{return At(e)||e}catch{return e}}}var na=(i=>(i[i.Unchecked=0]="Unchecked",i[i.Checked=1]="Checked",i[i.Indeterminate=2]="Indeterminate",i))(na||{});class kct{config;element;children=[];parent=null;checkState=na.Unchecked;contentEl;switcherEl;checkboxEl=null;titleEl;actionsEl;childrenContainer;onExpandChange;onCheckChange;onNodeClick;onNodeDblClick;renderActions;renderActionsContent(){if(!this.renderActions)return;const e=this.renderActions(this.config);this.actionsEl.innerHTML="",typeof e=="string"?this.actionsEl.innerHTML=e:e instanceof HTMLElement&&this.actionsEl.appendChild(e)}constructor(e,t,n){this.config=e,this.onExpandChange=n.onExpand,this.onCheckChange=n.onCheck,this.onNodeClick=n.onClick,this.onNodeDblClick=n.onDblClick,this.renderActions=t.renderActions,this.checkState=e.checked?na.Checked:na.Unchecked,this.element=this.createDom(t)}createDom(e){const t=document.createElement("div");t.className="bim-tree-node",this.config.disabled&&t.classList.add("is-disabled"),this.contentEl=document.createElement("div"),this.contentEl.className="bim-tree-node-content",this.switcherEl=document.createElement("span"),this.switcherEl.className="bim-tree-switcher",this.switcherEl.innerHTML='<svg viewBox="0 0 1024 1024"><path d="M288 192l448 320-448 320z"></path></svg>';const n=this.config.children&&this.config.children.length>0;if(n?this.config.expanded&&this.switcherEl.classList.add("is-expanded"):this.switcherEl.classList.add("is-hidden"),this.switcherEl.addEventListener("click",s=>{s.stopPropagation(),this.toggleExpand()}),this.contentEl.appendChild(this.switcherEl),e.checkable!==!1&&(this.checkboxEl=document.createElement("span"),this.checkboxEl.className="bim-tree-checkbox",this.updateCheckboxUI(),this.checkboxEl.addEventListener("click",s=>{s.stopPropagation(),!this.config.disabled&&this.toggleCheck()}),this.contentEl.appendChild(this.checkboxEl)),this.config.icon){const s=document.createElement("span");s.className="bim-tree-icon",s.innerHTML=this.config.icon.includes("<svg")?this.config.icon:`<img src="${this.config.icon}" />`,this.contentEl.appendChild(s)}this.titleEl=document.createElement("span"),this.titleEl.className="bim-tree-title",this.updateLabel(),this.contentEl.appendChild(this.titleEl),this.actionsEl=document.createElement("div"),this.actionsEl.className="bim-tree-node-actions",this.actionsEl.addEventListener("click",s=>{s.stopPropagation()}),this.renderActionsContent(),this.contentEl.appendChild(this.actionsEl),this.contentEl.addEventListener("click",s=>{if(s.stopPropagation(),this.config.disabled)return;if((this.config.clickAction||"select")==="expand")this.toggleExpand();else{if(this.onNodeDblClick&&s.detail>1)return;this.onNodeClick(this)}}),this.contentEl.addEventListener("dblclick",s=>{s.stopPropagation(),!this.config.disabled&&(this.config.clickAction||"select")==="select"&&this.onNodeDblClick?.(this)}),t.appendChild(this.contentEl),this.childrenContainer=document.createElement("div"),this.childrenContainer.className="bim-tree-children";const r=e.indent||24;return this.childrenContainer.style.paddingLeft=`${r}px`,this.config.expanded&&n&&this.childrenContainer.classList.add("is-visible"),t.appendChild(this.childrenContainer),t}setSelected(e){e?this.contentEl.classList.add("is-selected"):this.contentEl.classList.remove("is-selected")}updateLabel(){this.titleEl&&(this.titleEl.textContent=this.config.label)}toggleExpand(e){if(!this.config.children||this.config.children.length===0)return;const t=e!==void 0?e:!this.config.expanded;this.config.expanded=t,t?(this.switcherEl.classList.add("is-expanded"),this.childrenContainer.classList.add("is-visible")):(this.switcherEl.classList.remove("is-expanded"),this.childrenContainer.classList.remove("is-visible")),e===void 0&&this.onExpandChange(this)}toggleCheck(){const e=this.checkState!==na.Checked;this.setChecked(e?na.Checked:na.Unchecked,!0)}setChecked(e,t=!1,n=!1){!n&&this.checkState===e||(this.checkState=e,this.config.checked=e===na.Checked,this.updateCheckboxUI(),t&&this.onCheckChange(this))}updateCheckboxUI(){this.checkboxEl&&(this.checkboxEl.classList.remove("is-checked","is-indeterminate"),this.checkState===na.Checked?this.checkboxEl.classList.add("is-checked"):this.checkState===na.Indeterminate&&this.checkboxEl.classList.add("is-indeterminate"))}appendChild(e){e.parent=this,this.children.push(e),this.childrenContainer.appendChild(e.element),this.children.length===1&&this.switcherEl.classList.remove("is-hidden")}destroy(){this.children.forEach(e=>e.destroy()),this.children=[],this.element.remove(),this.parent=null}}class m8{element;contentElement;searchInput=null;searchResults=null;options;nodeMap=new Map;rootNodes=[];selectedNode=null;lastRevealedNodeId=null;unsubscribeLocale=null;unsubscribeTheme=null;clickOutsideHandler=null;onNodeCheck;onNodeSelect;onNodeDblClick;onNodeDeselect;onNodeExpand;constructor(e){this.options={checkable:!0,checkStrictly:!0,indent:24,defaultExpandAll:!0,enableSearch:!1,searchPlaceholder:"tree.searchPlaceholder",...e},this.element=document.createElement("div"),this.element.className="bim-tree",this.options.enableSearch&&this.createSearchDOM(),this.contentElement=document.createElement("div"),this.contentElement.className="bim-tree-content",this.element.appendChild(this.contentElement),e.onNodeCheck&&(this.onNodeCheck=e.onNodeCheck),e.onNodeSelect&&(this.onNodeSelect=e.onNodeSelect),e.onNodeDblClick&&(this.onNodeDblClick=e.onNodeDblClick),e.onNodeDeselect&&(this.onNodeDeselect=e.onNodeDeselect),e.onNodeExpand&&(this.onNodeExpand=e.onNodeExpand)}createSearchDOM(){const e=document.createElement("div");e.className="bim-tree-search";const t=document.createElement("div");t.className="bim-tree-search-wrapper";const n=document.createElement("span");n.className="bim-tree-search-icon",n.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="m21 21l-4.343-4.343m0 0A8 8 0 1 0 5.343 5.343a8 8 0 0 0 11.314 11.314"/></svg>',t.appendChild(n),this.searchInput=document.createElement("input"),this.searchInput.className="bim-tree-search-input",this.searchInput.type="text",this.searchInput.placeholder=At(this.options.searchPlaceholder||"搜索..."),this.searchInput.addEventListener("input",r=>{const s=r.target.value;this.handleSearch(s)}),t.appendChild(this.searchInput),e.appendChild(t),this.searchResults=document.createElement("div"),this.searchResults.className="bim-tree-search-results",e.appendChild(this.searchResults),this.element.appendChild(e),this.clickOutsideHandler=r=>{this.searchResults&&!this.searchResults.contains(r.target)&&!this.searchInput?.contains(r.target)&&this.searchResults.classList.remove("is-visible")},document.addEventListener("click",this.clickOutsideHandler)}init(){this.render(),this.unsubscribeLocale=dr.subscribe(()=>this.setLocales()),this.unsubscribeTheme=qi.subscribe(e=>this.setTheme(e)),this.setTheme(qi.getTheme())}handleSearch(e){if(!this.searchResults)return;if(!e.trim()){this.searchResults.classList.remove("is-visible"),this.searchResults.innerHTML="";return}const t=[],n=e.toLowerCase();this.nodeMap.forEach(r=>{const s=r.config.label;s.toLowerCase().includes(n)&&t.push({node:r,label:s,path:this.getNodePath(r)})}),this.renderSearchResults(t)}getNodePath(e){const t=[];let n=e.parent;for(;n;)t.unshift(n.config.label),n=n.parent;return t.join(" > ")}renderSearchResults(e){if(this.searchResults){if(this.searchResults.innerHTML="",e.length===0){const t=document.createElement("div");t.className="bim-tree-search-item",t.style.cursor="default",t.style.color="#999",t.textContent=At("tree.noResults"),this.searchResults.appendChild(t)}else e.forEach(t=>{const n=document.createElement("div");n.className="bim-tree-search-item";const r=document.createElement("span");r.className="bim-tree-search-item-title",r.textContent=t.label;const s=document.createElement("span");s.className="bim-tree-search-item-path",s.textContent=t.path,n.appendChild(r),t.path&&n.appendChild(s),n.addEventListener("click",()=>{this.revealNode(t.node)}),this.searchResults.appendChild(n)});this.searchResults.classList.add("is-visible")}}revealNode(e){if(this.lastRevealedNodeId===e.config.id&&this.isNodeFullyVisible(e))return;this.lastRevealedNodeId=e.config.id,this.searchResults&&(this.searchResults.classList.remove("is-visible"),this.searchInput&&(this.searchInput.value=""));let t=e.parent;for(;t;)t.toggleExpand(!0),t=t.parent;this.handleNodeSelect(e),requestAnimationFrame(()=>{requestAnimationFrame(()=>{this.scrollNodeIntoContentCenter(e)})})}isNodeFullyVisible(e){const t=this.contentElement;if(!t||!e?.element?.isConnected)return!1;const n=t.getBoundingClientRect(),r=e.element.getBoundingClientRect();return r.top>=n.top&&r.bottom<=n.bottom}scrollNodeIntoContentCenter(e){const t=this.contentElement;if(!t||!e?.element?.isConnected)return;const n=t.getBoundingClientRect(),r=e.element.getBoundingClientRect();if(r.top>=n.top&&r.bottom<=n.bottom)return;const s=r.top-n.top+t.scrollTop,o=Math.max(0,s-(t.clientHeight-r.height)/2);t.scrollTo({top:o,behavior:"auto"})}setTheme(e){const t=this.element.style;t.setProperty("--bim-primary",e.primary),t.setProperty("--bim-bg-elevated",e.bgElevated),t.setProperty("--bim-text-primary",e.textPrimary),t.setProperty("--bim-text-secondary",e.textSecondary),t.setProperty("--bim-text-tertiary",e.textTertiary),t.setProperty("--bim-text-disabled",e.textDisabled),t.setProperty("--bim-text-inverse",e.textInverse),t.setProperty("--bim-border-default",e.borderDefault),t.setProperty("--bim-border-disabled",e.borderDisabled),t.setProperty("--bim-component-bg-hover",e.componentBgHover),t.setProperty("--bim-component-bg-selected",e.componentBgSelected),t.setProperty("--bim-component-bg-disabled",e.componentBgDisabled),t.setProperty("--bim-shadow-md",e.shadowMd),t.setProperty("--bim-focus-ring",e.focusRing)}setLocales(){this.nodeMap.forEach(e=>e.updateLabel()),this.searchInput&&(this.searchInput.placeholder=At(this.options.searchPlaceholder||"tree.searchPlaceholder"))}destroy(){this.unsubscribeLocale&&(this.unsubscribeLocale(),this.unsubscribeLocale=null),this.unsubscribeTheme&&(this.unsubscribeTheme(),this.unsubscribeTheme=null),this.clickOutsideHandler&&(document.removeEventListener("click",this.clickOutsideHandler),this.clickOutsideHandler=null),this.rootNodes.forEach(e=>e.destroy()),this.rootNodes=[],this.nodeMap.clear(),this.lastRevealedNodeId=null,this.element.remove(),this.selectedNode=null}render(){this.contentElement.innerHTML="",this.nodeMap.clear(),this.rootNodes=[],this.options.data.forEach(e=>{this.createNodeRecursively(e,null)})}createNodeRecursively(e,t){e.expanded===void 0&&(e.expanded=this.options.defaultExpandAll);const n=new kct(e,this.options,{onExpand:r=>{this.onNodeExpand&&this.onNodeExpand(r)},onCheck:r=>this.handleNodeCheck(r),onClick:r=>this.handleNodeSelect(r),onDblClick:r=>{this.onNodeDblClick&&this.onNodeDblClick(r)}});this.nodeMap.set(e.id,n),t?t.appendChild(n):(this.rootNodes.push(n),this.contentElement.appendChild(n.element)),e.children&&e.children.length>0&&e.children.forEach(r=>{this.createNodeRecursively(r,n)})}handleNodeSelect(e){if(this.selectedNode===e){e.setSelected(!1),this.selectedNode=null,this.onNodeDeselect&&this.onNodeDeselect(e);return}this.selectedNode&&this.selectedNode.setSelected(!1),e.setSelected(!0),this.selectedNode=e,this.onNodeSelect&&this.onNodeSelect(e)}handleNodeCheck(e){const t=e.checkState===na.Checked;if(this.onNodeCheck&&this.onNodeCheck(e),this.options.checkStrictly===!1)return;const n=(s,o)=>{s.children.forEach(a=>{a.config.disabled||(a.setChecked(o,!1),n(a,o))})};t?n(e,na.Checked):n(e,na.Unchecked);let r=e.parent;for(;r;){if(r.config.disabled){r=r.parent;continue}const s=r.children,o=s.every(l=>l.checkState===na.Checked),a=s.every(l=>l.checkState===na.Unchecked);o?r.setChecked(na.Checked,!1):a?r.setChecked(na.Unchecked,!1):r.setChecked(na.Indeterminate,!1),r=r.parent}}getNode(e){return this.nodeMap.get(e)}checkNode(e,t){const n=this.nodeMap.get(e);n&&n.setChecked(t?na.Checked:na.Unchecked,!0)}expandAll(e){this.nodeMap.forEach(t=>t.toggleExpand(e))}checkAllNodes(e){const t=e?na.Checked:na.Unchecked;this.nodeMap.forEach(n=>n.setChecked(t,!1,!0))}getCheckedNodes(e=!1){const t=[];return this.nodeMap.forEach(n=>{(n.checkState===na.Checked||e&&n.checkState===na.Indeterminate)&&t.push(n.config)}),t}}function Ibe(i,e){let t=e>>>0;for(let n=0;n<i.length;n++){const r=i.charCodeAt(n);t^=r&255,t=Math.imul(t,16777619),t^=r>>>8&255,t=Math.imul(t,16777619)}return t>>>0}async function Uct(i){const e=JSON.stringify(i),t=Ibe(e,2166136261),n=Ibe(e,522970236);return`${t.toString(16).padStart(8,"0")}${n.toString(16).padStart(8,"0")}`}function Pbe(i){const e=new Map,t=r=>{const s=r.config.data,o=s?._modelUrl;if(o&&s?.ids?.length){let a=e.get(o);a||(a=new Set,e.set(o,a));for(const l of s.ids){const c=Number(l);Number.isFinite(c)&&a.add(c)}}for(const a of r.children||[])t(a)};t(i);const n=[];for(const[r,s]of e)s.size>0&&n.push({url:r,ids:Array.from(s)});return n}let zct=0;async function Hct(i){if(!i||i.length===0)return[];const e=async(t,n)=>{const r=t.children&&t.children.length>0;let s;return t.ids?.length?s=await Uct(t.ids):t.id?s=t.id:s=`node_${++zct}`,{id:s,label:t.name||"未命名",expanded:!1,checked:!0,children:r?await Promise.all(t.children.map(o=>e(o,n))):void 0,data:{...t,_modelUrl:n}}};return Promise.all(i.map(async t=>{const n=t.children&&t.children.length>0,r=t.url;return{id:r,label:t.name||"模型",expanded:!0,checked:!0,children:n?await Promise.all(t.children.map(s=>e(s,r))):void 0,data:{_modelUrl:r}}}))}class Vct{element;registry;mountElement;unsubscribeLocale=null;unsubscribeTheme=null;unsubscribeShowAll=null;activeTab=null;levelTree=null;typeTree=null;majorTree=null;refreshToken=0;isRendering=!1;pendingRefresh=!1;constructor(e){this.registry=e,this.element=document.createElement("section"),this.element.className="component-tree-drawer-construct-tree",this.element.dataset.tab="construct-tree",this.mountElement=document.createElement("div"),this.mountElement.className="component-tree-drawer-construct-tree-mount",this.element.appendChild(this.mountElement)}init(){this.setTheme(qi.getTheme()),this.unsubscribeLocale=dr.subscribe(()=>{this.setLocales(),this.refresh()}),this.unsubscribeTheme=qi.subscribe(e=>this.setTheme(e))}getElement(){return this.element}onShow(){this.refresh()}setTheme(e){const t=this.element.style;t.setProperty("--bim-component-tree-page-title",e.textPrimary),t.setProperty("--bim-component-tree-page-description",e.textSecondary),t.setProperty("--bim-component-tree-content-bg",e.bgElevated)}setLocales(){}destroy(){this.unsubscribeLocale&&(this.unsubscribeLocale(),this.unsubscribeLocale=null),this.unsubscribeTheme&&(this.unsubscribeTheme(),this.unsubscribeTheme=null),this.unsubscribeShowAll&&(this.unsubscribeShowAll(),this.unsubscribeShowAll=null),this.destroyCurrentContent(),this.element.remove()}async refresh(){if(!this.registry||!this.registry.engine3d)return;if(this.isRendering){this.pendingRefresh=!0;return}this.isRendering=!0;const e=++this.refreshToken;try{const t=this.registry.engine3d.getEngineComponent?.(),n=t?.getLevelTreeData()??[],r=t?.getTypeTreeData()??[],s=t?.getMajorTreeData()??[],[o,a,l]=await Promise.all([this.createTree(n),this.createTree(r),this.createTree(s)]);if(e!==this.refreshToken){o.destroy(),a.destroy(),l.destroy();return}this.destroyCurrentContent(),this.levelTree=o,this.typeTree=a,this.majorTree=l;const c=document.createElement("div");c.className="component-tree-drawer-construct-tree-panel",c.appendChild(o.element);const h=document.createElement("div");h.className="component-tree-drawer-construct-tree-panel",h.appendChild(a.element);const u=document.createElement("div");u.className="component-tree-drawer-construct-tree-panel",u.appendChild(l.element);const d=document.createElement("div");d.className="component-tree-drawer-construct-tree-tab-container";const p=new Mbe({container:d,tabs:[{id:"component",title:"tab.component",content:c},{id:"type",title:"tab.type",content:h},{id:"major",title:"tab.major",content:u}],activeId:"component"});p.init(),this.activeTab=p,this.mountElement.appendChild(d),this.resetAllTrees(),this.unsubscribeShowAll=this.registry.on("menu:show-all",()=>{this.resetAllTrees()})}finally{this.isRendering=!1,this.pendingRefresh&&(this.pendingRefresh=!1,this.refresh())}}async createTree(e){const t=await Hct(e),n=new m8({data:t,checkable:!0,indent:0,enableSearch:!0,checkStrictly:!0,defaultExpandAll:!0,onNodeCheck:r=>{const s=Pbe(r);s.length&&(r.checkState===na.Checked?this.registry?.engine3d?.getEngineComponent?.()?.showModel(s):this.registry?.engine3d?.getEngineComponent?.()?.hideModels(s))},onNodeSelect:r=>{const s=Pbe(r);if(!s.length)return;const o=this.registry?.engine3d?.getEngineComponent?.();o?.unhighlightAllModels(),o?.highlightModel(s),o?.viewScaleToModel(s)},onNodeDeselect:()=>{this.registry?.engine3d?.getEngineComponent?.()?.unhighlightAllModels()}});return n.init(),n}resetAllTrees(){this.registry?.engine3d?.getEngineComponent?.()?.showAllModels({preserveSection:!0}),this.levelTree?.checkAllNodes(!0),this.typeTree?.checkAllNodes(!0),this.majorTree?.checkAllNodes(!0)}destroyCurrentContent(){this.unsubscribeShowAll&&(this.unsubscribeShowAll(),this.unsubscribeShowAll=null),this.activeTab?.destroy(),this.activeTab=null,this.levelTree?.destroy(),this.levelTree=null,this.typeTree?.destroy(),this.typeTree=null,this.majorTree?.destroy(),this.majorTree=null,this.mountElement.innerHTML=""}}function Gct(i){return i.filter(e=>e.type==="pin"&&e.data!==void 0&&e.data!==null).map(e=>e.data)}class jct{element;registry;toolbarElement;pinEditBtnGroup;addPinBtn;addFolderBtn;toggleAllPinsBtn;emptyElement;listContainer;tree=null;records=[];nodes=[];editingId=null;deleteDialog=null;editable=!0;showAllPinsEnabled=!1;unsubscribeLocale=null;unsubscribeTheme=null;unsubscribeListUpdated=null;constructor(e){this.registry=e,this.element=document.createElement("section"),this.element.className="component-tree-drawer-page component-tree-drawer-pin-page",this.element.dataset.tab="pin",this.toolbarElement=document.createElement("div"),this.toolbarElement.className="component-tree-drawer-pin-toolbar",this.pinEditBtnGroup=document.createElement("div"),this.pinEditBtnGroup.className="component-tree-drawer-pin-btn-group",this.addPinBtn=document.createElement("button"),this.addPinBtn.type="button",this.addPinBtn.className="component-tree-drawer-add-pin-btn",this.addPinBtn.addEventListener("click",()=>this.handleAddPin()),this.addFolderBtn=document.createElement("button"),this.addFolderBtn.type="button",this.addFolderBtn.className="component-tree-drawer-add-folder-btn",this.addFolderBtn.addEventListener("click",()=>this.handleAddFolder()),this.toggleAllPinsBtn=document.createElement("button"),this.toggleAllPinsBtn.type="button",this.toggleAllPinsBtn.className="component-tree-drawer-toggle-pins-btn",this.toggleAllPinsBtn.addEventListener("click",()=>this.toggleAllPinLabels()),this.pinEditBtnGroup.appendChild(this.addPinBtn),this.pinEditBtnGroup.appendChild(this.addFolderBtn),this.toolbarElement.appendChild(this.pinEditBtnGroup),this.toolbarElement.appendChild(this.toggleAllPinsBtn),this.emptyElement=document.createElement("div"),this.emptyElement.className="component-tree-drawer-pin-empty";const t=document.createElement("div");t.className="component-tree-drawer-pin-empty-icon",t.innerHTML=vn("pin");const n=document.createElement("div");n.className="component-tree-drawer-pin-empty-title";const r=document.createElement("div");r.className="component-tree-drawer-pin-empty-desc",this.emptyElement.appendChild(t),this.emptyElement.appendChild(n),this.emptyElement.appendChild(r),this.listContainer=document.createElement("div"),this.listContainer.className="component-tree-drawer-pin-tree-container",this.element.appendChild(this.toolbarElement),this.element.appendChild(this.emptyElement),this.element.appendChild(this.listContainer)}init(){this.setLocales(),this.setTheme(qi.getTheme()),this.unsubscribeLocale=dr.subscribe(()=>this.setLocales()),this.unsubscribeTheme=qi.subscribe(e=>this.setTheme(e)),this.unsubscribeListUpdated=this.registry?.on("drawingPin:list-updated",e=>{console.log("[PinTab] received drawingPin:list-updated:",e),this.records=this.normalizeRecords(e.records),this.nodes=this.buildTree(this.records),this.renderTree(),this.syncAllPinLabels()})??null}getElement(){return this.element}createPin(e=null){if(!this.editable)return;const t=this.registry?.engine3d?.getEngineComponent?.();if(!t){console.warn("[PinTab] Engine component not available.");return}t.createDrawingPin(n=>{console.log("[PinTab] createDrawingPin callback received:",n);const r=this.getSiblingCount(e,"pin"),s={id:`pin_${Date.now()}`,parentId:e,name:this.buildDefaultName("pin",r+1),type:"pin",seq:this.getNextSeq(e),data:n};console.log("[PinTab] emitting drawingPin:create:",s),this.registry?.emit("drawingPin:create",s)})}setEditable(e){this.editable!==e&&(this.editable=e,e?this.tree&&this.renderTree():(this.cancelEdit(),this.closeDeleteDialog()),this.syncEditableState())}isEditable(){return this.editable}setTheme(e){const t=this.element.style;t.setProperty("--bim-component-tree-page-title",e.textPrimary),t.setProperty("--bim-component-tree-page-description",e.textSecondary),t.setProperty("--bim-pin-primary",e.primary),t.setProperty("--bim-pin-primary-hover",e.primaryHover),t.setProperty("--bim-pin-bg",e.bgElevated),t.setProperty("--bim-pin-card-bg",e.componentBg),t.setProperty("--bim-pin-card-hover",e.componentBgHover),t.setProperty("--bim-pin-border",e.borderSubtle),t.setProperty("--bim-pin-text",e.textPrimary),t.setProperty("--bim-pin-muted",e.textSecondary),t.setProperty("--bim-pin-shadow",e.shadowSm),t.setProperty("--bim-pin-shadow-hover",e.shadowMd),t.setProperty("--bim-pin-soft",e.primarySubtle)}setLocales(){this.addPinBtn.innerHTML=`${vn("plus")} <span>${At("componentTreeDrawer.actions.addPin")}</span>`,this.addFolderBtn.innerHTML=`${vn("folder")} <span>${At("componentTreeDrawer.actions.addFolder")}</span>`,this.updateToggleAllPinsButton();const e=this.emptyElement.querySelector(".component-tree-drawer-pin-empty-title"),t=this.emptyElement.querySelector(".component-tree-drawer-pin-empty-desc");e&&(e.textContent=At("componentTreeDrawer.empty.pinTitle")),t&&(t.textContent=At("componentTreeDrawer.empty.pinDesc"))}destroy(){this.unsubscribeLocale&&(this.unsubscribeLocale(),this.unsubscribeLocale=null),this.unsubscribeTheme&&(this.unsubscribeTheme(),this.unsubscribeTheme=null),this.unsubscribeListUpdated&&(this.unsubscribeListUpdated(),this.unsubscribeListUpdated=null),this.showAllPinsEnabled&&this.hideAllPinLabels(),this.closeDeleteDialog(),this.tree?.destroy(),this.tree=null,this.element.remove()}normalizeRecords(e){return[...e].map(t=>({...t,parentId:t.parentId??null}))}buildTree(e){const t=new Map,n=[];e.forEach(s=>{t.set(s.id,{...s,children:[]})}),e.forEach(s=>{const o=t.get(s.id);if(!o)return;const a=s.parentId??null;if(a&&t.has(a)){t.get(a)?.children?.push(o);return}n.push(o)});const r=s=>{s.sort((o,a)=>o.seq-a.seq||o.name.localeCompare(a.name)),s.forEach(o=>{o.children?.length?r(o.children):delete o.children})};return r(n),n}handleAddPin(e=null){this.createPin(e)}handleAddFolder(e=null){if(!this.editable)return;const t=this.getSiblingCount(e,"folder"),n={id:`folder_${Date.now()}`,parentId:e,name:this.buildDefaultName("folder",t+1),type:"folder",seq:this.getNextSeq(e)};console.log("[PinTab] emitting drawingPin:create (folder):",n),this.registry?.emit("drawingPin:create",n)}buildDefaultName(e,t){return`${At(e==="pin"?"componentTreeDrawer.defaultNames.pin":"componentTreeDrawer.defaultNames.folder")}${t}`}getNextSeq(e){return this.records.filter(t=>(t.parentId??null)===e).length}getSiblingCount(e,t){return this.records.filter(n=>n.type===t&&(n.parentId??null)===e).length}findNodeById(e,t=this.nodes){for(const n of t){if(n.id===e)return n;if(n.children?.length){const r=this.findNodeById(e,n.children);if(r)return r}}return null}renderTree(){if(this.tree?.destroy(),this.tree=null,this.nodes.length===0){this.emptyElement.style.display="flex",this.listContainer.style.display="none";return}this.emptyElement.style.display="none",this.listContainer.style.display="block",this.tree=new m8({data:this.toTreeConfig(this.nodes),checkable:!1,checkStrictly:!1,defaultExpandAll:!0,enableSearch:!0,searchPlaceholder:"tree.searchPlaceholder",renderActions:e=>this.renderNodeActions(e.data),onNodeDblClick:e=>{const t=e.config.data;if(t.type!=="pin"||!t.data)return;const n=this.registry?.engine3d?.getEngineComponent?.();if(n){if(!this.editable){n.restoreViewSnapshot(t.data);return}n.restoreDrawingPin(t.data,r=>{this.notifyPinUpdated(t.id,{data:r})})}}}),this.tree.init(),this.listContainer.innerHTML="",this.listContainer.appendChild(this.tree.element),this.syncEditableState()}toTreeConfig(e){return e.map(t=>({id:t.id,label:t.name,icon:t.type==="folder"?vn("folder"):vn("pin"),expanded:!0,data:t,children:t.children?.length?this.toTreeConfig(t.children):void 0,clickAction:t.type==="folder"?"expand":"select"}))}renderNodeActions(e){const t=document.createElement("div");if(t.className="pin-node-actions",!this.editable)return t.style.display="none",t;if(e.type==="folder"){const s=document.createElement("button");s.type="button",s.className="pin-node-action-btn",s.title=At("componentTreeDrawer.actions.edit"),s.setAttribute("aria-label",At("componentTreeDrawer.actions.edit")),s.innerHTML=vn("edit"),s.addEventListener("click",l=>{l.stopPropagation(),this.startEdit(e.id)}),t.appendChild(s);const o=document.createElement("button");o.type="button",o.className="pin-node-action-btn",o.title=At("componentTreeDrawer.actions.addPin"),o.setAttribute("aria-label",At("componentTreeDrawer.actions.addPin")),o.innerHTML=vn("plus"),o.addEventListener("click",l=>{l.stopPropagation(),this.handleAddPin(e.id)}),t.appendChild(o);const a=document.createElement("button");return a.type="button",a.className="pin-node-action-btn",a.title=At("componentTreeDrawer.actions.delete"),a.setAttribute("aria-label",At("componentTreeDrawer.actions.delete")),a.innerHTML=vn("delete"),a.addEventListener("click",l=>{l.stopPropagation(),this.openDeleteFolderDialog(e)}),t.appendChild(a),t}const n=document.createElement("button");n.type="button",n.className="pin-node-action-btn",n.title=At("componentTreeDrawer.actions.edit"),n.setAttribute("aria-label",At("componentTreeDrawer.actions.edit")),n.innerHTML=vn("edit"),n.addEventListener("click",s=>{s.stopPropagation(),this.startEdit(e.id)}),t.appendChild(n);const r=document.createElement("button");return r.type="button",r.className="pin-node-action-btn",r.title=At("componentTreeDrawer.actions.delete"),r.setAttribute("aria-label",At("componentTreeDrawer.actions.delete")),r.innerHTML=vn("delete"),r.addEventListener("click",s=>{s.stopPropagation(),console.log("[PinTab] emitting drawingPin:delete:",e),this.registry?.emit("drawingPin:delete",e)}),t.appendChild(r),t}startEdit(e){if(!this.editable||this.editingId===e)return;this.editingId=e;const t=this.findNodeById(e);if(!t)return;const n=this.tree?.getNode(e);if(!n)return;const r=n.element.querySelector(".bim-tree-node-content");if(!r)return;const s=r.querySelector(".bim-tree-title"),o=r.querySelector(".bim-tree-node-actions");if(!s||!o)return;s.style.display="none",o.style.display="none";const a=document.createElement("div");a.className="pin-node-edit-wrapper";const l=document.createElement("input");l.type="text",l.className="pin-node-edit-input",l.value=t.name,l.maxLength=12;const c=document.createElement("div");c.className="pin-node-edit-actions";const h=document.createElement("button");h.type="button",h.className="pin-node-edit-btn pin-node-edit-save",h.innerHTML=vn("check"),h.title=At("componentTreeDrawer.actions.save"),h.setAttribute("aria-label",At("componentTreeDrawer.actions.save")),h.addEventListener("click",p=>{p.stopPropagation(),this.saveEdit(e,l.value)});const u=document.createElement("button");u.type="button",u.className="pin-node-edit-btn pin-node-edit-cancel",u.innerHTML=vn("close"),u.title=At("componentTreeDrawer.actions.cancel"),u.setAttribute("aria-label",At("componentTreeDrawer.actions.cancel")),u.addEventListener("click",p=>{p.stopPropagation(),this.cancelEdit()}),c.appendChild(h),c.appendChild(u),a.appendChild(l),a.appendChild(c),r.appendChild(a),requestAnimationFrame(()=>{l.focus(),l.select()});const d=p=>{p.key==="Enter"?(p.preventDefault(),this.saveEdit(e,l.value)):p.key==="Escape"&&(p.preventDefault(),this.cancelEdit())};l.addEventListener("keydown",d),r._editWrapper=a,r._keydownHandler=d}saveEdit(e,t){const n=this.findNodeById(e);if(!n)return;const s=(t.trim()||n.name).slice(0,12);if(s===n.name){this.cancelEdit();return}this.notifyPinUpdated(e,{name:s}),this.editingId=null}notifyPinUpdated(e,t={}){const n=this.findNodeById(e);if(!n)return;const r={id:n.id,parentId:n.parentId,name:t.name??n.name,type:n.type,seq:t.seq??n.seq,data:t.data??n.data};console.log("[PinTab] emitting drawingPin:update with full record:",r),this.registry?.emit("drawingPin:update",r)}cancelEdit(){this.editingId=null,this.renderTree()}countPins(e){let t=0;return e.forEach(n=>{n.type==="pin"&&(t+=1),n.children?.length&&(t+=this.countPins(n.children))}),t}openDeleteFolderDialog(e){if(!this.editable)return;this.closeDeleteDialog();const t=document.createElement("div");t.className="pin-delete-dialog";const n=document.createElement("div");n.className="pin-delete-dialog-symbol",n.textContent="!";const r=document.createElement("div");r.className="pin-delete-dialog-text",r.textContent=`${At("componentTreeDrawer.dialogs.deleteFolderMessagePrefix")}${e.name}${At("componentTreeDrawer.dialogs.deleteFolderMessageSuffix")}`;const s=document.createElement("div");s.className="pin-delete-dialog-actions";const o=document.createElement("button");o.type="button",o.className="pin-delete-dialog-btn is-secondary",o.textContent=At("componentTreeDrawer.actions.cancel");const a=document.createElement("button");a.type="button",a.className="pin-delete-dialog-btn is-danger",a.textContent=At("componentTreeDrawer.dialogs.confirm"),o.addEventListener("click",()=>this.closeDeleteDialog()),a.addEventListener("click",()=>{console.log("[PinTab] emitting drawingPin:delete (folder):",e),this.registry?.emit("drawingPin:delete",e),this.closeDeleteDialog()}),s.appendChild(o),s.appendChild(a),t.appendChild(n),t.appendChild(r),t.appendChild(s),this.deleteDialog=this.registry?.dialog?.create({title:At("componentTreeDrawer.dialogs.noticeTitle"),content:t,width:360,height:"auto",position:"center",draggable:!1,resizable:!1})??null}closeDeleteDialog(){this.deleteDialog&&(this.deleteDialog.close(),this.deleteDialog=null)}toggleAllPinLabels(){if(this.showAllPinsEnabled){this.hideAllPinLabels();return}this.showAllPinsEnabled=this.showAllPinLabels(),this.updateToggleAllPinsButton()}showAllPinLabels(){const e=this.registry?.engine3d?.getEngineComponent?.();return e?.showDrawingPinLabels?(e.showDrawingPinLabels(Gct(this.records)),!0):(console.warn("[PinTab] drawingPin.showLabels not available."),!1)}hideAllPinLabels(){const e=this.registry?.engine3d?.getEngineComponent?.();e?.hideDrawingPinLabels?e.hideDrawingPinLabels():console.warn("[PinTab] drawingPin.hideLabels not available."),this.showAllPinsEnabled=!1,this.updateToggleAllPinsButton()}syncAllPinLabels(){this.showAllPinsEnabled&&(this.showAllPinsEnabled=this.showAllPinLabels(),this.updateToggleAllPinsButton())}updateToggleAllPinsButton(){const e=this.showAllPinsEnabled?At("componentTreeDrawer.actions.hideAllPins"):At("componentTreeDrawer.actions.showAllPins");this.toggleAllPinsBtn.innerHTML=vn("pin"),this.toggleAllPinsBtn.title=e,this.toggleAllPinsBtn.dataset.tooltip=e,this.toggleAllPinsBtn.setAttribute("aria-label",e),this.toggleAllPinsBtn.setAttribute("aria-pressed",String(this.showAllPinsEnabled)),this.toggleAllPinsBtn.classList.toggle("is-active",this.showAllPinsEnabled)}syncEditableState(){this.toolbarElement.style.display="flex",this.pinEditBtnGroup.style.display=this.editable?"flex":"none",this.element.dataset.editable=String(this.editable),this.updateToggleAllPinsButton()}}const Wct={ceilingPlans:"viewTab.category.ceilingPlans",elevations:"viewTab.category.elevations",floorPlans:"viewTab.category.floorPlans",sections:"viewTab.category.sections"};function $ct(i){if(!i||i.length===0)return[];const e=i.map(t=>{const n=[];return Object.keys(t.views).forEach(r=>{const s=t.views[r];!s||s.length===0||n.push({id:`${t.url}::${r}`,label:At(Wct[r]),clickAction:"expand",children:s.map(o=>({id:`${t.url}::${r}::${o.id}`,label:o.name,data:{url:o.url,viewId:o.id}}))})}),{id:t.url,label:t.name||t.url,expanded:!0,clickAction:"expand",children:n}});return e.unshift({id:"__default_3d__",label:At("viewTab.default3D"),clickAction:"select",data:{isDefault3D:!0}}),e}class qct{element;registry;mountElement;unsubscribeLocale=null;unsubscribeTheme=null;tree=null;refreshToken=0;isRendering=!1;pendingRefresh=!1;constructor(e){this.registry=e,this.element=document.createElement("section"),this.element.className="component-tree-drawer-view",this.element.dataset.tab="view",this.mountElement=document.createElement("div"),this.mountElement.className="component-tree-drawer-view-mount",this.element.appendChild(this.mountElement)}init(){this.setTheme(qi.getTheme()),this.unsubscribeLocale=dr.subscribe(()=>this.setLocales()),this.unsubscribeTheme=qi.subscribe(e=>this.setTheme(e))}getElement(){return this.element}onShow(){this.refresh()}setTheme(e){const t=this.element.style;t.setProperty("--bim-view-tab-text",e.textPrimary),t.setProperty("--bim-view-tab-muted",e.textSecondary),t.setProperty("--bim-view-tab-bg",e.bgElevated)}setLocales(){this.refresh()}destroy(){this.unsubscribeLocale&&(this.unsubscribeLocale(),this.unsubscribeLocale=null),this.unsubscribeTheme&&(this.unsubscribeTheme(),this.unsubscribeTheme=null),this.destroyCurrentContent(),this.element.remove()}async refresh(){if(!this.registry||!this.registry.engine3d)return;if(this.isRendering){this.pendingRefresh=!0;return}this.isRendering=!0;const e=++this.refreshToken;try{const t=this.registry.engine3d.getEngineComponent?.()?.getAllViewTreeData()??[],n=$ct(t);if(e!==this.refreshToken)return;if(this.destroyCurrentContent(),n.length===0){this.renderEmptyState();return}const r=new m8({data:n,checkable:!1,indent:0,enableSearch:!0,defaultExpandAll:!1,onNodeSelect:s=>{const o=s.config.data;if(o?.isDefault3D){this.registry?.engine3d?.getEngineComponent?.()?.deactivateSection(),this.registry?.engine3d?.getEngineComponent?.()?.CameraGoHome(500);return}o?.url&&o?.viewId&&this.registry?.engine3d?.getEngineComponent?.()?.openView(o.url,o.viewId)}});r.init(),this.tree=r,this.mountElement.appendChild(r.element)}finally{this.isRendering=!1,this.pendingRefresh&&(this.pendingRefresh=!1,this.refresh())}}renderEmptyState(){const e=document.createElement("div");e.className="component-tree-drawer-view-empty",e.textContent=At("viewTab.empty"),this.mountElement.appendChild(e)}destroyCurrentContent(){this.tree?.destroy(),this.tree=null,this.mountElement.innerHTML=""}}const g8=["view","pin","construct-tree"],Dbe=["click","dblclick","contextmenu","wheel","mousedown","mouseup","mousemove","pointerdown","pointerup","pointermove","pointerenter","pointerleave","pointerover","pointerout"];function Xct(i){i.type==="contextmenu"&&i.preventDefault(),i.stopPropagation()}class Yct{element;options;headerElement;tabsElement;closeButton;bodyElement;tabButtons=new Map;panelElements=new Map;tabInstances;unsubscribeLocale=null;unsubscribeTheme=null;activeTab;open=!1;blockDrawerEvent=e=>Xct(e);constructor(e={}){this.options=e,this.activeTab=e.defaultTab??"view";const t=e.registry;this.tabInstances={view:new qct(t??null),pin:new jct(t??null),"construct-tree":new Vct(t??null)},this.element=document.createElement("aside"),this.element.className="component-tree-drawer",this.element.setAttribute("aria-hidden","true"),Dbe.forEach(n=>{this.element.addEventListener(n,this.blockDrawerEvent,{passive:!1})}),this.headerElement=document.createElement("div"),this.headerElement.className="component-tree-drawer-header",this.tabsElement=document.createElement("div"),this.tabsElement.className="component-tree-drawer-tabs",this.closeButton=document.createElement("button"),this.closeButton.type="button",this.closeButton.className="component-tree-drawer-close",this.closeButton.innerHTML=vn("close"),this.closeButton.addEventListener("click",()=>this.close()),this.bodyElement=document.createElement("div"),this.bodyElement.className="component-tree-drawer-body",this.headerElement.appendChild(this.tabsElement),this.headerElement.appendChild(this.closeButton),this.element.appendChild(this.headerElement),this.element.appendChild(this.bodyElement),this.renderTabs(),this.renderPanels()}init(){const e=this.options.container??document.body;this.element.parentElement||e.appendChild(this.element),Object.values(this.tabInstances).forEach(t=>t.init()),this.setLocales(),this.setTheme(qi.getTheme()),this.applyActiveTab(),this.applyOpenState(),this.unsubscribeLocale=dr.subscribe(()=>this.setLocales()),this.unsubscribeTheme=qi.subscribe(t=>this.setTheme(t))}setTheme(e){const t=this.element.style;t.setProperty("--bim-component-tree-bg",e.bgGlass||e.bgElevated),t.setProperty("--bim-component-tree-blur",e.bgGlassBlur||"18px"),t.setProperty("--bim-component-tree-border",e.borderDefault),t.setProperty("--bim-component-tree-shadow",e.shadowLg),t.setProperty("--bim-component-tree-text",e.textPrimary),t.setProperty("--bim-component-tree-muted",e.textSecondary),t.setProperty("--bim-component-tree-tab-bg",e.componentBg),t.setProperty("--bim-component-tree-tab-hover",e.componentBgHover),t.setProperty("--bim-component-tree-tab-active",e.primarySubtle),t.setProperty("--bim-component-tree-tab-active-border",e.primary),t.setProperty("--bim-component-tree-tab-active-text",e.primary),t.setProperty("--bim-component-tree-close-bg",e.componentBg),t.setProperty("--bim-component-tree-close-hover",e.componentBgHover),t.setProperty("--bim-component-tree-surface",e.bgElevated),t.setProperty("--bim-component-tree-surface-border",e.borderSubtle),t.setProperty("--bim-component-tree-subtab-nav-bg",e.tabBg),t.setProperty("--bim-component-tree-subtab-nav-border",e.borderDefault),t.setProperty("--bim-component-tree-subtab-text",e.textSecondary),t.setProperty("--bim-component-tree-subtab-hover-bg",e.tabItemBgHover),t.setProperty("--bim-component-tree-subtab-hover-text",e.textPrimary),t.setProperty("--bim-component-tree-subtab-active-bg",e.tabItemBgActive),t.setProperty("--bim-component-tree-subtab-active-text",e.tabItemTextActive),t.setProperty("--bim-component-tree-subtab-active-border",e.primarySubtle),t.setProperty("--bim-component-tree-subtab-active-shadow",e.shadowSm),t.setProperty("--bim-component-tree-tree-bg",e.bgElevated),t.setProperty("--bim-component-tree-tree-border",e.borderDefault)}setLocales(){for(const t of g8){const n=this.tabButtons.get(t);n&&(n.textContent=this.getTabTitle(t))}const e=At("componentTreeDrawer.actions.close");this.closeButton.setAttribute("aria-label",e),this.closeButton.setAttribute("title",e)}destroy(){this.unsubscribeLocale&&(this.unsubscribeLocale(),this.unsubscribeLocale=null),this.unsubscribeTheme&&(this.unsubscribeTheme(),this.unsubscribeTheme=null),Object.values(this.tabInstances).forEach(e=>e.destroy()),Dbe.forEach(e=>{this.element.removeEventListener(e,this.blockDrawerEvent)}),this.tabButtons.clear(),this.panelElements.clear(),this.element.remove()}openDrawer(e){e&&(this.activeTab=e,this.applyActiveTab()),this.open=!0,this.applyOpenState(),this.tabInstances[this.activeTab].onShow?.()}close(){this.open&&(this.open=!1,this.applyOpenState(),this.options.onClose?.())}toggle(e){if(this.open){this.close();return}this.openDrawer(e)}isOpen(){return this.open}getActiveTab(){return this.activeTab}switchTab(e){this.activeTab!==e&&(this.activeTab=e,this.applyActiveTab(),this.tabInstances[e].onShow?.(),this.options.onTabChange?.(e))}getViewTabApi(){return this.tabInstances.view}getPinTabApi(){return this.tabInstances.pin}setPinEditable(e){this.getPinTabApi().setEditable(e)}isPinEditable(){return this.getPinTabApi().isEditable()}getConstructTreeTabApi(){return this.tabInstances["construct-tree"]}renderTabs(){this.tabsElement.innerHTML="";for(const e of g8){const t=document.createElement("button");t.type="button",t.className="component-tree-drawer-tab",t.dataset.tab=e,t.addEventListener("click",()=>this.switchTab(e)),this.tabButtons.set(e,t),this.tabsElement.appendChild(t)}}renderPanels(){this.bodyElement.innerHTML="";for(const e of g8){const t=document.createElement("div");t.className="component-tree-drawer-panel",t.dataset.tab=e,t.appendChild(this.tabInstances[e].getElement()),this.panelElements.set(e,t),this.bodyElement.appendChild(t)}}applyActiveTab(){for(const e of g8){const t=e===this.activeTab;this.tabButtons.get(e)?.classList.toggle("is-active",t),this.panelElements.get(e)?.classList.toggle("is-active",t)}}applyOpenState(){this.element.classList.toggle("is-open",this.open),this.element.setAttribute("aria-hidden",`${!this.open}`)}getTabTitle(e){return At({view:"componentTreeDrawer.tabs.view",pin:"componentTreeDrawer.tabs.pin","construct-tree":"componentTreeDrawer.tabs.constructTree"}[e])}}class Qct extends Mc{drawer=null;constructor(e){super(e),this.init()}init(){this.drawer||!this.registry.wrapper||(this.drawer=new Yct({container:this.registry.wrapper,registry:this.registry}),this.drawer.init())}open(e){this.drawer?.openDrawer(e)}close(){this.drawer?.close()}toggle(e){this.drawer?.toggle(e)}switchTab(e){this.drawer?.switchTab(e)}isOpen(){return this.drawer?.isOpen()??!1}getActiveTab(){return this.drawer?.getActiveTab()??"construct-tree"}getViewTabApi(){return this.drawer?.getViewTabApi()??null}getPinTabApi(){return this.drawer?.getPinTabApi()??null}createPin(e=null){this.getPinTabApi()?.createPin(e)}setPinEditable(e){this.drawer?.setPinEditable(e)}isPinEditable(){return this.drawer?.isPinEditable()??!0}getConstructTreeTabApi(){return this.drawer?.getConstructTreeTabApi()??null}destroy(){this.drawer?.destroy(),this.drawer=null,super.destroy()}}class nO{element;options;activeMode;isExpanded;result=null;clearHeightDirection=0;clearHeightSelectType="point";config;draftConfig=null;view="main";static CONFIG_CACHE_KEY="bim-engine:measure:config";static DEFAULT_CONFIG={unit:"mm",precision:2};toolButtons=new Map;toggleBtn;toggleTextEl;mainValueRowEl;mainValueValueEl;mainValueLabelEl;mainNumberEl;mainUnitEl;xyzBoxEl;xyzXEl;xyzYEl;xyzZEl;clearBtn;settingsBtn;modeOptionsEl;directionBtns=new Map;selectTypeBtns=new Map;mainViewEl;settingsViewEl;unitSelectEl;precisionSelectEl;saveSettingsBtn;cancelSettingsBtn;unsubscribeLocale=null;unsubscribeTheme=null;constructor(e={}){this.options=e,this.activeMode=e.defaultMode??"distance",this.isExpanded=e.defaultExpanded??!1,this.config=this.loadConfigFromCache()??{...nO.DEFAULT_CONFIG},this.element=this.createDom()}init(){this.unsubscribeLocale=dr.subscribe(()=>{this.setLocales()}),this.unsubscribeTheme=qi.subscribe(e=>{this.setTheme(e)}),this.setLocales(),this.setTheme(qi.getTheme()),this.applyExpandedState(),this.applyActiveModeState(),this.applyClearHeightOptionsState(),this.applyViewState(),this.renderResult(),this.options.onModeChange&&this.activeMode&&this.options.onModeChange(this.activeMode)}setTheme(e){const t=this.element.style;t.setProperty("--bim-bg-inset",e.bgInset??"#152232"),t.setProperty("--bim-bg-elevated",e.bgElevated??"#1f2d3e"),t.setProperty("--bim-border-default",e.borderDefault??"#334155"),t.setProperty("--bim-border-strong",e.borderStrong??"#475569"),t.setProperty("--bim-divider",e.divider??"#334155"),t.setProperty("--bim-primary",e.primary??"#3b82f6"),t.setProperty("--bim-primary-hover",e.primaryHover??"#60a5fa"),t.setProperty("--bim-primary-subtle",e.primarySubtle??"rgba(59, 130, 246, 0.15)"),t.setProperty("--bim-danger",e.danger??"#ef4444"),t.setProperty("--bim-text-primary",e.textPrimary??"#ffffff"),t.setProperty("--bim-text-secondary",e.textSecondary??"#94a3b8"),t.setProperty("--bim-text-tertiary",e.textTertiary??"#64748b"),t.setProperty("--bim-text-inverse",e.textInverse??"#152232"),t.setProperty("--bim-icon-default",e.iconDefault??"#ffffff"),t.setProperty("--bim-component-bg-hover",e.componentBgHover??"rgba(248, 250, 252, 0.06)")}setLocales(){for(const[t,n]of this.toolButtons.entries())n.title=At(this.getModeI18nKey(t)),n.setAttribute("aria-label",n.title);this.toggleBtn.title=this.isExpanded?At("measure.actions.collapse"):At("measure.actions.expand"),this.toggleBtn.setAttribute("aria-label",this.toggleBtn.title),this.toggleTextEl&&(this.toggleTextEl.textContent=this.toggleBtn.title),this.clearBtn.textContent=At("measure.actions.clearAll"),this.settingsBtn.title=At("measure.actions.settings"),this.settingsBtn.setAttribute("aria-label",this.settingsBtn.title),this.activeMode&&(this.mainValueLabelEl.textContent=At(this.getModeValueLabelI18nKey(this.activeMode))),this.element.querySelectorAll("[data-i18n-key]").forEach(t=>{const n=t.dataset.i18nKey;n&&(t.textContent=At(n))}),this.saveSettingsBtn.textContent=At("measure.settings.save"),this.cancelSettingsBtn.textContent=At("measure.settings.cancel")}destroy(){this.unsubscribeLocale&&(this.unsubscribeLocale(),this.unsubscribeLocale=null),this.unsubscribeTheme&&(this.unsubscribeTheme(),this.unsubscribeTheme=null),this.element.remove()}getActiveMode(){return this.activeMode}switchMode(e,t=!0){this.setActiveMode(e,t)}setActiveMode(e,t=!0){this.activeMode!==e&&(this.activeMode=e,this.applyActiveModeState(),this.applyClearHeightOptionsState(),this.mainValueLabelEl.textContent=At(this.getModeValueLabelI18nKey(this.activeMode)),t&&this.options.onModeChange&&this.options.onModeChange(e),this.renderResult(),this.options.onExpandedChange&&this.options.onExpandedChange(this.isExpanded))}setResult(e){this.result=e,this.renderResult()}clearAll(){this.result=null,this.renderResult(),this.options.onClearAll&&this.options.onClearAll()}openSettings(){this.enterSettingsView(),this.options.onSettings&&this.options.onSettings()}getConfig(){return{...this.config}}setConfig(e,t=!1){const n={unit:e.unit??this.config.unit,precision:e.precision??this.config.precision};this.config=n,t&&this.saveConfigToCache(n),this.renderResult(),this.view==="settings"&&this.syncSettingsFormFromConfig(n)}setExpanded(e){this.isExpanded!==e&&(this.isExpanded=e,this.applyExpandedState(),this.setLocales(),this.options.onExpandedChange&&this.options.onExpandedChange(this.isExpanded))}getExpanded(){return this.isExpanded}createDom(){const e=document.createElement("div");e.className="bim-measure-panel",this.mainViewEl=document.createElement("div"),this.mainViewEl.className="bim-measure-main";const t=document.createElement("div");t.className="bim-measure-tools";const n=document.createElement("div");n.className="bim-measure-tool-grid";const r=`
|
|
4016
4016
|
<svg viewBox="0 0 24 24" aria-hidden="true">
|
|
4017
4017
|
<circle cx="12" cy="12" r="9"></circle>
|
|
@@ -4357,7 +4357,7 @@ ${e.url}`,t.appendChild(n),t}createInputMap(e){return{x:this.createNumberInput(e
|
|
|
4357
4357
|
<span class="bim-ai-qa-answer">${this.escapeHtml(n||"")}</span>
|
|
4358
4358
|
</div>
|
|
4359
4359
|
</div>
|
|
4360
|
-
`}bindQuestionEvents(){this.messagesContainer?.querySelectorAll(".bim-ai-option").forEach(e=>{e.addEventListener("click",t=>{const n=t.currentTarget,r=n.dataset.questionId,s=n.dataset.optionId;if(r&&s){const o=this.messages.find(a=>a.id===r);o&&!o.answered&&(o.selectedOptionId=s,this.renderMessages())}})}),this.messagesContainer?.querySelectorAll(".bim-ai-option-input").forEach(e=>{e.addEventListener("input",t=>{const n=t.target,r=n.dataset.questionId;if(r){const s=this.messages.find(o=>o.id===r);s&&(s.customAnswer=n.value)}})}),this.messagesContainer?.querySelectorAll(".bim-ai-question-submit").forEach(e=>{e.addEventListener("click",t=>{const r=t.currentTarget.dataset.questionId;if(r){const s=this.messages.find(o=>o.id===r);s&&s.selectedOptionId&&(s.answered=!0,this.renderMessages(),this.options.onQuestionSubmit?.(r,s.selectedOptionId,s.customAnswer))}})})}scrollToBottom(){this.messagesContainer&&(this.messagesContainer.scrollTop=this.messagesContainer.scrollHeight)}escapeHtml(e){const t=document.createElement("div");return t.textContent=e,t.innerHTML}destroy(){this._isDestroyed||(this.unsubscribeTheme&&(this.unsubscribeTheme(),this.unsubscribeTheme=null),this.unsubscribeLocale&&(this.unsubscribeLocale(),this.unsubscribeLocale=null),this.element.remove(),this._isDestroyed=!0)}}class zbe{aiChat=null;registry;initialized=!1;constructor(e){this.registry=e}init(){if(this.initialized)return;const e=this.registry.wrapper;if(!e){console.warn("[AiChatManager] wrapper 不存在,无法初始化");return}this.aiChat=new oht({container:e,width:440,title:"aiChat.title",placeholder:"aiChat.placeholder",quickPrompts:[{id:"summarize",label:"aiChat.quickPrompt.summarize"},{id:"explain",label:"aiChat.quickPrompt.explain"},{id:"generate",label:"aiChat.quickPrompt.generate"}],onSend:t=>{console.log("[AiChatManager] 用户发送消息:",t),this.aiChat?.addUserMessage(t),this.registry.emit("aiChat:message-sent",{message:t})},onQuestionSubmit:(t,n,r)=>{console.log("[AiChatManager] 用户回答问题:",{questionId:t,optionId:n,customAnswer:r}),this.registry.emit("aiChat:question-answered",{questionId:t,optionId:n,customAnswer:r})},onNewChat:()=>{console.log("[AiChatManager] 新建对话"),this.registry.emit("aiChat:new-chat",{})},onHistory:()=>{console.log("[AiChatManager] 打开历史"),this.registry.emit("aiChat:history-opened",{})},onSettings:()=>{console.log("[AiChatManager] 打开设置"),this.registry.emit("aiChat:settings-opened",{})},onClose:()=>{console.log("[AiChatManager] 关闭 AI 聊天"),this.registry.emit("aiChat:closed",{}),this.registry.toolbar?.setBtnActive("aiChat",!1)}}),this.initialized=!0}show(){this.aiChat||this.init(),this.aiChat?.show(),this.registry.emit("aiChat:opened",{}),this.registry.toolbar?.setBtnActive("aiChat",!0)}hide(){this.aiChat?.hide(),this.registry.emit("aiChat:closed",{}),this.registry.toolbar?.setBtnActive("aiChat",!1)}toggle(){this.aiChat?.isVisible()?this.hide():this.show()}isVisible(){return this.aiChat?.isVisible()??!1}addUserMessage(e){return this.aiChat?.addUserMessage(e)??""}addAiMessage(e){return this.aiChat?.addAiMessage(e)??""}addStepMessage(e,t){return this.aiChat?.addStepMessage(e,t)??""}addThinkingMessage(){return this.aiChat?.addThinkingMessage()??""}addQuestionMessage(e,t,n){return this.aiChat?.addQuestionMessage(e,t,n)??""}updateMessage(e,t){this.aiChat?.updateMessage(e,t)}removeMessage(e){this.aiChat?.removeMessage(e)}clearMessages(){this.aiChat?.clearMessages()}destroy(){this.aiChat&&(this.aiChat.destroy(),this.aiChat=null),this.initialized=!1}}class aht{container;options;groups=[];activeBtnIds=new Set;btnRefs=new Map;dropdownElement=null;hoverTimeout=null;customColors=new Set;unsubscribeLocale=null;unsubscribeTheme=null;DEFAULT_ICON='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect></svg>';constructor(e){const t=typeof e.container=="string"?document.getElementById(e.container):e.container;if(!t)throw new Error("Container not found");this.container=t,this.options={showLabel:!0,visibility:{},direction:"row",position:"static",align:"vertical",expand:"down",...e},["backgroundColor","btnBackgroundColor","btnHoverColor","btnActiveColor","iconColor","iconActiveColor","textColor","textActiveColor"].forEach(r=>{e[r]&&this.customColors.add(r)}),this.initContainer(),this.applyStyles()}emit(e,t){this.options.registry?.emit(e,t)}initContainer(){this.container.innerHTML="",this.container.classList.add("bim-btn-group-root"),this.options.direction==="column"?this.container.classList.add("dir-column"):this.container.classList.add("dir-row"),this.options.className&&this.container.classList.add(this.options.className),this.options.type&&this.options.type!=="default"&&this.container.classList.add(`type-${this.options.type}`),this.updatePosition(),this.setupEventInterception(this.container)}setupEventInterception(e){const t=r=>{r.stopPropagation()};["click","dblclick","contextmenu","wheel","mousedown","mouseup","mousemove","touchstart","touchend","touchmove","pointerdown","pointerup","pointermove","pointerenter","pointerleave","pointerover","pointerout"].forEach(r=>{e.addEventListener(r,t,{passive:!1})})}updatePosition(){const e=this.options.position,t=this.container.style;if(t.top="",t.bottom="",t.left="",t.right="",t.transform="",e==="static"){this.container.classList.add("static");return}if(this.container.classList.remove("static"),this.container.style.position="absolute",typeof e=="object"&&"x"in e)t.left=`${e.x}px`,t.top=`${e.y}px`;else{const n="20px";switch(e){case"top-left":t.top=n,t.left=n;break;case"top-center":t.top=n,t.left="50%",t.transform="translateX(-50%)";break;case"top-right":t.top=n,t.right=n;break;case"bottom-left":t.bottom=n,t.left=n;break;case"bottom-center":t.bottom=n,t.left="50%",t.transform="translateX(-50%)";break;case"bottom-right":t.bottom=n,t.right=n;break;case"left-center":t.left=n,t.top="50%",t.transform="translateY(-50%)";break;case"right-center":t.right=n,t.top="50%",t.transform="translateY(-50%)";break;case"center":t.top="50%",t.left="50%",t.transform="translate(-50%, -50%)";break}}}applyStyles(){const e=this.container.style;this.options.backgroundColor&&e.setProperty("--bim-btn-group-section-bg",this.options.backgroundColor),this.options.btnBackgroundColor&&e.setProperty("--bim-btn-bg",this.options.btnBackgroundColor),this.options.btnHoverColor&&e.setProperty("--bim-btn-hover-bg",this.options.btnHoverColor),this.options.btnActiveColor&&e.setProperty("--bim-btn-active-bg",this.options.btnActiveColor),this.options.iconColor&&e.setProperty("--bim-icon-color",this.options.iconColor),this.options.iconActiveColor&&e.setProperty("--bim-icon-active-color",this.options.iconActiveColor),this.options.textColor&&e.setProperty("--bim-btn-text-color",this.options.textColor),this.options.textActiveColor&&e.setProperty("--bim-btn-text-active-color",this.options.textActiveColor),document.querySelectorAll(".opt-btn-dropdown").forEach(n=>{const r=n.style;this.options.iconColor&&r.setProperty("--bim-icon-color",this.options.iconColor),this.options.iconActiveColor&&r.setProperty("--bim-icon-active-color",this.options.iconActiveColor),this.options.textColor&&r.setProperty("--bim-btn-text-color",this.options.textColor),this.options.textActiveColor&&r.setProperty("--bim-btn-text-active-color",this.options.textActiveColor),this.options.btnBackgroundColor&&r.setProperty("--bim-btn-bg",this.options.btnBackgroundColor),this.options.btnHoverColor&&r.setProperty("--bim-btn-hover-bg",this.options.btnHoverColor),this.options.btnActiveColor&&r.setProperty("--bim-btn-active-bg",this.options.btnActiveColor)})}setPrimaryColor(e){this.container.style.setProperty("--bim-primary-color",e),document.querySelectorAll(".opt-btn-dropdown").forEach(n=>{n.style.setProperty("--bim-primary-color",e)})}setTheme(e){const t={backgroundColor:e.bgElevated,btnBackgroundColor:e.componentBg,btnHoverColor:e.componentBgHover,btnActiveColor:e.componentBgActive,iconColor:e.iconDefault,iconActiveColor:e.iconActive,textColor:e.textSecondary,textActiveColor:e.textPrimary};Object.entries(t).forEach(([n,r])=>{const s=n;this.customColors.has(s)||(this.options[s]=r)}),this.container.classList.remove("theme-dark","theme-light"),this.container.classList.add(`theme-${e.name}`),this.applyStyles(),this.setPrimaryColor(e.primary),this.applyThemeCssVars(e)}applyThemeCssVars(e){const t=this.container.style;t.setProperty("--bim-primary",e.primary),t.setProperty("--bim-primary-hover",e.primaryHover),t.setProperty("--bim-primary-active",e.primaryActive),t.setProperty("--bim-bg-glass",e.bgGlass),t.setProperty("--bim-bg-glass-blur",e.bgGlassBlur),t.setProperty("--bim-bg-elevated",e.bgElevated),t.setProperty("--bim-bg-overlay",e.bgOverlay),t.setProperty("--bim-bg-inset",e.bgInset),t.setProperty("--bim-text-primary",e.textPrimary),t.setProperty("--bim-text-secondary",e.textSecondary),t.setProperty("--bim-text-tertiary",e.textTertiary),t.setProperty("--bim-text-inverse",e.textInverse),t.setProperty("--bim-icon-default",e.iconDefault),t.setProperty("--bim-icon-hover",e.iconHover),t.setProperty("--bim-icon-active",e.iconActive),t.setProperty("--bim-icon-inverse",e.iconInverse),t.setProperty("--bim-border-default",e.borderDefault),t.setProperty("--bim-border-subtle",e.borderSubtle),t.setProperty("--bim-component-bg-hover",e.componentBgHover),t.setProperty("--bim-component-bg-active",e.componentBgActive),t.setProperty("--bim-shadow-sm",e.shadowSm),t.setProperty("--bim-shadow-md",e.shadowMd),t.setProperty("--bim-shadow-lg",e.shadowLg),t.setProperty("--bim-shadow-glow",e.shadowGlow),t.setProperty("--bim-floating-bg",e.floatingBg),t.setProperty("--bim-floating-border",e.floatingBorder),t.setProperty("--bim-floating-shadow",e.floatingShadow),t.setProperty("--bim-floating-btn-bg",e.floatingBtnBg),t.setProperty("--bim-floating-btn-border",e.floatingBtnBorder),t.setProperty("--bim-floating-btn-shadow",e.floatingBtnShadow),t.setProperty("--bim-floating-btn-bg-hover",e.floatingBtnBgHover),t.setProperty("--bim-floating-btn-shadow-hover",e.floatingBtnShadowHover),t.setProperty("--bim-floating-icon-color",e.floatingIconColor),t.setProperty("--bim-floating-icon-color-hover",e.floatingIconColorHover),this.syncDropdownCssVars(e)}syncDropdownCssVars(e){document.querySelectorAll(".opt-btn-dropdown").forEach(n=>{const r=n.style;r.setProperty("--bim-primary",e.primary),r.setProperty("--bim-bg-overlay",e.bgOverlay),r.setProperty("--bim-border-default",e.borderDefault),r.setProperty("--bim-text-primary",e.textPrimary),r.setProperty("--bim-text-inverse",e.textInverse),r.setProperty("--bim-shadow-lg",e.shadowLg),r.setProperty("--bim-floating-btn-bg",e.floatingBtnBg),r.setProperty("--bim-floating-btn-bg-hover",e.floatingBtnBgHover),r.setProperty("--bim-floating-icon-color",e.floatingIconColor)})}setColors(e){this.options={...this.options,...e},Object.keys(e).forEach(t=>{this.customColors.add(t)}),this.applyStyles()}async init(){this.render(),this.unsubscribeLocale=dr.subscribe(()=>{this.setLocales()}),this.unsubscribeTheme=qi.subscribe(e=>{this.setTheme(e)})}setLocales(){this.render()}addGroup(e,t){if(this.groups.some(r=>r.id===e))return;const n={id:e,buttons:[]};if(t){const r=this.groups.findIndex(s=>s.id===t);r!==-1?this.groups.splice(r,0,n):this.groups.push(n)}else this.groups.push(n)}addButton(e){const{groupId:t,parentId:n}=e,r=this.groups.find(o=>o.id===t);if(!r)return;const s={...e,children:e.children||[]};if(n){const o=this.findButton(r.buttons,n);o&&(o.children||(o.children=[]),o.children.push(s))}else r.buttons.push(s)}findButton(e,t){for(const n of e){if(n.id===t)return n;if(n.children){const r=this.findButton(n.children,t);if(r)return r}}}render(){this.container.innerHTML="",this.btnRefs.clear(),this.groups.forEach((e,t)=>{const n=this.renderGroup(e,t,this.groups.length);this.container.appendChild(n)})}renderGroup(e,t,n){const r=document.createElement("div");return r.className="bim-btn-group-section",t<n-1&&r.classList.add("has-divider"),e.buttons.forEach(s=>{if(this.isVisible(s.id)){const o=this.renderButton(s);r.appendChild(o)}}),r}renderButton(e){const t=document.createElement("div");t.className="opt-btn-wrapper";const n=document.createElement("div");n.className="opt-btn",e.isActive&&this.activeBtnIds.add(e.id),(e.align||this.options.align||"vertical")==="horizontal"?n.classList.add("align-horizontal"):n.classList.add("align-vertical"),this.activeBtnIds.has(e.id)&&n.classList.add("active"),e.disabled&&n.classList.add("disabled"),this.options.showLabel&&e.label||(n.classList.add("no-label"),e.label&&(n.title=At(e.label)));const o=e.iconSize||32,a=e.minWidth||50;n.style.minWidth=`${a}px`;const l=document.createElement("div");l.className="opt-btn-icon",l.style.width=`${o}px`,l.style.height=`${o}px`,l.innerHTML=this.getIcon(e.icon),n.appendChild(l);const c=document.createElement("div");if(c.className="opt-btn-text-wrapper",this.options.showLabel&&e.label){const h=document.createElement("span");h.className="opt-btn-label",h.textContent=At(e.label),c.appendChild(h)}return c.hasChildNodes()&&n.appendChild(c),n.addEventListener("click",()=>this.handleClick(e)),n.addEventListener("mouseenter",()=>this.handleMouseEnter(e,n)),n.addEventListener("mouseleave",()=>this.handleMouseLeave()),this.btnRefs.set(e.id,n),t.appendChild(n),t}setBtnActive(e,t){const n=this.findButtonById(e);if(!n)return;const r=t!==void 0?t:!this.activeBtnIds.has(e);r?this.activeBtnIds.add(e):this.activeBtnIds.delete(e),n.isActive=r,this.updateButtonState(e)}handleClick(e){if(!e.disabled&&(!e.children||e.children.length===0)){if(e.keepActive){const n=!this.activeBtnIds.has(e.id);this.setBtnActive(e.id,n),n&&e.exclusive&&e.groupId&&this.deactivateExclusiveSiblings(e)}this.closeDropdown(),e.onClick&&e.onClick(e)}}deactivateExclusiveSiblings(e){const t=this.groups.find(n=>n.id===e.groupId);if(t){if(e.parentId){const r=this.findButton(t.buttons,e.parentId)?.children||[];for(const s of r)s&&s.id!==e.id&&s.parentId===e.parentId&&s.groupId===e.groupId&&this.activeBtnIds.has(s.id)&&(this.setBtnActive(s.id,!1),s.onClick&&s.onClick(s));return}for(const n of t.buttons)n.id!==e.id&&n.groupId===e.groupId&&(n.parentId||this.activeBtnIds.has(n.id)&&(this.setBtnActive(n.id,!1),n.onClick&&n.onClick(n)))}}handleMouseEnter(e,t){this.hoverTimeout&&clearTimeout(this.hoverTimeout),e.children&&e.children.length>0?this.showDropdown(e,t):this.closeDropdown()}handleMouseLeave(){this.hoverTimeout=window.setTimeout(()=>this.closeDropdown(),200)}showDropdown(e,t){if(this.closeDropdown(),!e.children)return;const n=document.createElement("div");n.className="opt-btn-dropdown",this.options.backgroundColor&&n.style.setProperty("--bim-toolbar-bg",this.options.backgroundColor);const r=n.style;this.options.iconColor&&r.setProperty("--bim-icon-color",this.options.iconColor),this.options.iconActiveColor&&r.setProperty("--bim-icon-active-color",this.options.iconActiveColor),this.options.textColor&&r.setProperty("--bim-btn-text-color",this.options.textColor),this.options.textActiveColor&&r.setProperty("--bim-btn-text-active-color",this.options.textActiveColor),this.options.btnBackgroundColor&&r.setProperty("--bim-btn-bg",this.options.btnBackgroundColor),this.options.btnHoverColor&&r.setProperty("--bim-btn-hover-bg",this.options.btnHoverColor),this.options.btnActiveColor&&r.setProperty("--bim-btn-active-bg",this.options.btnActiveColor);const s=t.getBoundingClientRect(),o=this.options.expand||"down";this.options.direction==="row"?n.style.flexDirection="column":n.style.flexDirection="row",this.options.type&&this.options.type!=="default"&&n.classList.add(`type-${this.options.type}`);const a=qi.getTheme();n.classList.add(`theme-${a.name}`),r.setProperty("--bim-primary",a.primary),r.setProperty("--bim-bg-overlay",a.bgOverlay),r.setProperty("--bim-border-default",a.borderDefault),r.setProperty("--bim-text-primary",a.textPrimary),r.setProperty("--bim-text-inverse",a.textInverse),r.setProperty("--bim-shadow-lg",a.shadowLg),r.setProperty("--bim-floating-btn-bg",a.floatingBtnBg),r.setProperty("--bim-floating-btn-bg-hover",a.floatingBtnBgHover),r.setProperty("--bim-floating-icon-color",a.floatingIconColor),document.body.appendChild(n),this.setupEventInterception(n),e.children.forEach(c=>{if(this.isVisible(c.id)){const h=this.renderDropdownItem(c);n.appendChild(h)}});const l=n.getBoundingClientRect();o==="up"?(n.style.bottom=window.innerHeight-s.top+8+"px",n.style.left=s.left+(s.width-l.width)/2+"px"):o==="down"?(n.style.top=s.bottom+8+"px",n.style.left=s.left+(s.width-l.width)/2+"px"):o==="right"?(n.style.top=s.top+(s.height-l.height)/2+"px",n.style.left=s.right+8+"px"):o==="left"&&(n.style.top=s.top+(s.height-l.height)/2+"px",n.style.right=window.innerWidth-s.left+8+"px"),n.addEventListener("mouseenter",()=>{this.hoverTimeout&&clearTimeout(this.hoverTimeout)}),n.addEventListener("mouseleave",()=>this.handleMouseLeave()),this.dropdownElement=n}renderDropdownItem(e){const t=document.createElement("div");t.className="opt-btn-dropdown-item",(e.align||"horizontal")==="horizontal"?t.classList.add("align-horizontal"):t.classList.add("align-vertical"),(this.activeBtnIds.has(e.id)||e.isActive)&&t.classList.add("active");const r=e.iconSize||32,s=e.minWidth;s&&(t.style.minWidth=`${s}px`);const o=document.createElement("div");if(o.className="opt-btn-icon",o.style.width=`${r}px`,o.style.height=`${r}px`,o.innerHTML=this.getIcon(e.icon),t.appendChild(o),this.options.showLabel&&e.label){const a=document.createElement("span");a.className="opt-btn-dropdown-label",a.textContent=At(e.label),t.appendChild(a)}else e.label&&(t.title=At(e.label));return t.addEventListener("click",a=>{a.stopPropagation(),this.handleClick(e)}),t}closeDropdown(){this.dropdownElement&&(this.dropdownElement.remove(),this.dropdownElement=null),this.btnRefs.forEach(e=>{const t=e.querySelector(".opt-btn-arrow");t&&t.classList.remove("rotated")})}updateButtonState(e){const t=this.btnRefs.get(e);t&&(this.activeBtnIds.has(e)?t.classList.add("active"):t.classList.remove("active"))}getIcon(e){return e||this.DEFAULT_ICON}updateButtonIcon(e,t){const n=this.btnRefs.get(e);if(!n)return;const r=n.querySelector(".opt-btn-icon");r&&(r.innerHTML=this.getIcon(t));const s=this.findButtonById(e);s&&(s.icon=t)}updateButtonVisibility(e,t){this.options.visibility||(this.options.visibility={}),this.options.visibility[e]=t,this.render()}setShowLabel(e){this.options.showLabel=e,this.updateLabelsVisibility()}updateLabelsVisibility(){this.btnRefs.forEach((e,t)=>{const n=this.findButtonById(t);if(!n)return;this.options.showLabel&&n.label?(e.classList.remove("no-label"),e.removeAttribute("title")):(e.classList.add("no-label"),n.label&&(e.title=At(n.label)))})}findButtonById(e){for(const t of this.groups){const n=this.findButton(t.buttons,e);if(n)return n}}setBackgroundColor(e){this.setColors({backgroundColor:e})}isVisible(e){return this.options.visibility?.[e]!==!1}setType(e){this.container.classList.remove("type-default","type-glass-pill"),this.options.type=e,e&&e!=="default"&&this.container.classList.add(`type-${e}`),this.render()}getType(){return this.options.type||"default"}destroy(){this.unsubscribeLocale&&(this.unsubscribeLocale(),this.unsubscribeLocale=null),this.unsubscribeTheme&&(this.unsubscribeTheme(),this.unsubscribeTheme=null),this.closeDropdown(),this.container.innerHTML="",this.btnRefs.clear()}}function Hbe(i,e){let t=e>>>0;for(let n=0;n<i.length;n++){const r=i.charCodeAt(n);t^=r&255,t=Math.imul(t,16777619),t^=r>>>8&255,t=Math.imul(t,16777619)}return t>>>0}async function lht(i){const e=JSON.stringify(i),t=Hbe(e,2166136261),n=Hbe(e,522970236);return`${t.toString(16).padStart(8,"0")}${n.toString(16).padStart(8,"0")}`}function Vbe(i){const e=new Map,t=r=>{const s=r.config.data,o=s?._modelUrl;if(o&&s?.ids?.length){let a=e.get(o);a||(a=new Set,e.set(o,a));for(const l of s.ids){const c=Number(l);Number.isFinite(c)&&a.add(c)}}for(const a of r.children||[])t(a)};t(i);const n=[];for(const[r,s]of e)s.size>0&&n.push({url:r,ids:Array.from(s)});return n}let cht=0;async function hht(i){if(!i||i.length===0)return[];const e=async(t,n)=>{const r=t.children&&t.children.length>0;let s;return t.ids?.length?s=await lht(t.ids):t.id?s=t.id:s=`node_${++cht}`,{id:s,label:t.name||"未命名",expanded:!1,checked:!0,children:r?await Promise.all(t.children.map(o=>e(o,n))):void 0,data:{...t,_modelUrl:n}}};return Promise.all(i.map(async t=>{const n=t.children&&t.children.length>0,r=t.url;return{id:r,label:t.name||"模型",expanded:!0,checked:!0,children:n?await Promise.all(t.children.map(s=>e(s,r))):void 0,data:{_modelUrl:r}}}))}class uht extends Mc{toolbar=null;toolbarContainer=null;container;dialog=null;constructor(e,t){super(t),this.container=e,this.init()}init(){this.toolbarContainer=document.createElement("div"),this.toolbarContainer.id="bim-construct-tree",this.container.appendChild(this.toolbarContainer),this.toolbar=new aht({container:this.toolbarContainer,showLabel:!1,direction:"column",position:"top-left",align:"vertical",expand:"up",registry:this.registry}),this.toolbar.init(),this.toolbar.addGroup("construct-tree"),this.toolbar.addButton({id:"construct-tree-btn",groupId:"construct-tree",type:"button",label:"construct-tree",icon:vn("目录树"),onClick:()=>{if(this.registry.componentTreeDrawer){this.registry.componentTreeDrawer.toggle();return}this.openConstructTreeDialog()}}),this.toolbar.render()}async openConstructTreeDialog(){if(this.registry.componentTreeDrawer){this.registry.componentTreeDrawer.open();return}this.setVisible(!1);const e=this.engineComponent?.getLevelTreeData()??[],t=this.engineComponent?.getTypeTreeData()??[],n=this.engineComponent?.getMajorTreeData()??[];console.log("[ConstructTree] 原始数据 (Level):",e),console.log("[ConstructTree] 原始数据 (Type):",t),console.log("[ConstructTree] 原始数据 (Major):",n);const r=async(g,_)=>{const y=await hht(g);console.log(`[ConstructTree] 转换后数据 (${_}):`,y);const A=new m8({data:y,checkable:!0,indent:0,enableSearch:!0,checkStrictly:!0,defaultExpandAll:!0,onNodeCheck:x=>{const w=Vbe(x);w.length&&(x.checkState===na.Checked?this.engineComponent?.showModel(w):this.engineComponent?.hideModels(w))},onNodeSelect:x=>{const w=Vbe(x);w.length&&(this.engineComponent?.unhighlightAllModels(),this.engineComponent?.highlightModel(w),this.engineComponent?.viewScaleToModel(w))},onNodeDeselect:()=>{this.engineComponent?.unhighlightAllModels()},onNodeExpand:()=>{this.dialog?.fitWidth()}});return A.init(),A},s=await r(e,"Level"),o=await r(t,"Type"),a=await r(n,"Major"),l=document.createElement("div");l.className="construct-tab__panel-content",l.appendChild(s.element);const c=document.createElement("div");c.className="construct-tab__panel-content",c.appendChild(o.element);const h=document.createElement("div");h.className="construct-tab__panel-content",h.appendChild(a.element);const u=document.createElement("div");u.className="construct-tab__container",u.style.height="100%",u.style.overflow="hidden";const d=()=>{this.engineComponent?.showAllModels({preserveSection:!0}),s.checkAllNodes(!0),o.checkAllNodes(!0),a.checkAllNodes(!0)},p=new Mbe({container:u,tabs:[{id:"component",title:"tab.component",content:l},{id:"type",title:"tab.type",content:c},{id:"major",title:"tab.major",content:h}],activeId:"component",onChange:()=>{this.dialog?.fitWidth()}});p.init(),d();const f=this.registry.on("menu:show-all",()=>{d()});this.dialog=this.registry.dialog.create({title:"constructTree.title",minWidth:320,height:600,content:u,position:{x:20,y:20},resizable:!1,onClose:()=>{f(),p.destroy(),s.destroy(),o.destroy(),a.destroy(),this.setVisible(!0)}}),this.dialog?.fitWidth()}refresh(){this.toolbar?.render()}destroy(){this.toolbar?.destroy(),this.toolbar=null,super.destroy()}addGroup(e,t){this.toolbar?.addGroup(e,t),this.toolbar?.render()}addButton(e){this.toolbar?.addButton(e),this.toolbar?.render()}setButtonVisibility(e,t){this.toolbar?.updateButtonVisibility(e,t)}setShowLabel(e){this.toolbar?.setShowLabel(e)}setVisible(e){this.toolbarContainer&&(this.toolbarContainer.style.visibility=e?"visible":"hidden")}setBackgroundColor(e){this.toolbar?.setBackgroundColor(e)}setColors(e){this.toolbar?.setColors(e)}}class YZ{options;trigger=null;menu=null;unsubscribeLocale=null;closeOnOutsideClick=e=>{this.menu?.contains(e.target)||this.trigger?.contains(e.target)||this.closeMenu()};constructor(e){this.options=e}init(){if(this.trigger)return;this.options.container.classList.add("engine-view-dropdown-host");const e=document.createElement("div");e.className="engine-view-dropdown-trigger",this.options.triggerClassName&&e.classList.add(this.options.triggerClassName),e.innerHTML=vn("doubleArrowDown"),e.addEventListener("click",t=>{t.stopPropagation(),this.toggleMenu()}),this.options.container.appendChild(e),this.trigger=e,this.unsubscribeLocale=dr.subscribe(()=>this.updateText()),this.updateText()}destroy(){this.closeMenu(),document.removeEventListener("mousedown",this.closeOnOutsideClick),this.unsubscribeLocale?.(),this.unsubscribeLocale=null,this.trigger?.remove(),this.trigger=null,this.options.container.classList.remove("engine-view-dropdown-host")}setItems(e){this.options.items=e,this.closeMenu(),this.updateText()}toggleMenu(){if(this.menu){this.closeMenu();return}this.openMenu()}openMenu(){if(!this.trigger)return;const e=document.createElement("div");e.className="engine-view-dropdown-menu",this.options.items.forEach(n=>{const r=document.createElement("div");r.className="engine-view-dropdown-item",r.dataset.key=n.key,r.textContent=this.resolveLabel(n),r.addEventListener("click",s=>{s.stopPropagation(),n.action(s),n.closeOnClick!==!1&&this.closeMenu()}),e.appendChild(r)});const t=this.trigger.getBoundingClientRect();e.style.position="fixed",e.style.top=`${t.bottom+4}px`,e.style.right=`${window.innerWidth-t.right}px`,e.style.zIndex="10000",document.body.appendChild(e),this.menu=e,document.addEventListener("mousedown",this.closeOnOutsideClick)}closeMenu(){this.menu&&(this.menu.remove(),this.menu=null,document.removeEventListener("mousedown",this.closeOnOutsideClick))}updateText(){this.trigger&&(this.trigger.title=dr.t(this.options.triggerTitleKey??"viewDropdown.triggerTitle")),this.menu?.querySelectorAll(".engine-view-dropdown-item").forEach(e=>{const t=this.options.items.find(n=>n.key===e.dataset.key);t&&(e.textContent=this.resolveLabel(t))})}resolveLabel(e){return e.labelKey?dr.t(e.labelKey):e.label??e.key}}class dht extends Mc{dropdown=null;customButtons=[];constructor(e,t){super(t),this.dropdown=new YZ({container:e,items:this.getItems()}),this.dropdown.init()}addButton(e){return!e?.key||!e.label||typeof e.onClick!="function"?(console.warn("[ViewDropdownManager] Invalid view dropdown button config."),()=>{}):(this.customButtons=[...this.customButtons.filter(t=>t.key!==e.key),e],this.refreshItems(),()=>this.removeButton(e.key))}removeButton(e){const t=this.customButtons.filter(n=>n.key!==e);t.length!==this.customButtons.length&&(this.customButtons=t,this.refreshItems())}destroy(){this.dropdown?.destroy(),this.dropdown=null,this.customButtons=[],super.destroy()}refreshItems(){this.dropdown?.setItems(this.getItems())}getItems(){const e=()=>this.registry.engine3d?.getEngineComponent(),t=[{key:"switchOrthographic",labelKey:"viewDropdown.switchOrthographic",action:()=>e()?.switchToOrthographicCamera()},{key:"switchPerspective",labelKey:"viewDropdown.switchPerspective",action:()=>e()?.switchToPerspectiveCamera()},{key:"saveMainView",labelKey:"viewDropdown.saveMainView",action:()=>e()?.saveMainView()},{key:"restoreMainView",labelKey:"viewDropdown.restoreMainView",action:()=>e()?.restoreMainView()},{key:"captureScreenshot",labelKey:"viewDropdown.captureScreenshot",action:()=>e()?.captureScreenshot()},{key:"modelCalibration",labelKey:"viewDropdown.modelCalibration",action:()=>this.registry.bottomDock?.toggle("modelCalibration")}],n=this.customButtons.map(r=>({key:r.key,label:r.label,action:r.onClick,closeOnClick:r.closeOnClick}));return[...t,...n]}}class _8{element;overlay;container;options;viewTabBtn;fpsTabBtn;viewContent;fpsContent;confirmBtn;dontRemindBtn;unsubscribeLocale=null;unsubscribeTheme=null;static STORAGE_KEY="bim-engine:help-panel:hidden";constructor(e={}){this.options=e}init(){this.element=this.createPanel(),this.unsubscribeLocale=dr.subscribe(()=>this.setLocales()),this.unsubscribeTheme=qi.subscribe(e=>this.setTheme(e)),this.setLocales(),this.setTheme(qi.getTheme())}show(){this.overlay.classList.add("active")}hide(){this.overlay.classList.remove("active")}isVisible(){return this.overlay.classList.contains("active")}shouldAutoShow(){const e=this.options.storageKey??_8.STORAGE_KEY;return localStorage.getItem(e)!=="true"}createPanel(){const e=document.createElement("div");e.className="bim-help-panel-wrapper",this.overlay=document.createElement("div"),this.overlay.className="bim-help-panel-overlay",this.overlay.addEventListener("click",s=>{s.target===this.overlay&&this.hide()}),this.container=document.createElement("div"),this.container.className="bim-help-panel-container";const t=this.createHeader(),n=this.createBody(),r=this.createFooter();return this.container.appendChild(t),this.container.appendChild(n),this.container.appendChild(r),this.overlay.appendChild(this.container),e.appendChild(this.overlay),e}createHeader(){const e=document.createElement("div");return e.className="bim-help-panel-header",this.viewTabBtn=document.createElement("button"),this.viewTabBtn.className="bim-help-panel-tab-btn active",this.viewTabBtn.addEventListener("click",()=>this.switchTab("view")),this.fpsTabBtn=document.createElement("button"),this.fpsTabBtn.className="bim-help-panel-tab-btn",this.fpsTabBtn.addEventListener("click",()=>this.switchTab("fps")),e.appendChild(this.viewTabBtn),e.appendChild(this.fpsTabBtn),e}createBody(){const e=document.createElement("div");return e.className="bim-help-panel-body",this.viewContent=this.createViewTabContent(),this.fpsContent=this.createFpsTabContent(),e.appendChild(this.viewContent),e.appendChild(this.fpsContent),e}createViewTabContent(){const e=document.createElement("div");e.className="bim-help-panel-tab-content active",e.dataset.tab="view",e.appendChild(this.createMouseCard("rotateView","left")),e.appendChild(this.createMouseCard("panView","right")),e.appendChild(this.createMouseCard("zoomView","wheel"));const t=this.createCard("boxSelect","ctrlLeftDrag");e.appendChild(t);const n=this.createMultiSelectCard();e.appendChild(n);const r=this.createCard("resetView","doubleClickBlankShort");e.appendChild(r);const s=this.createRuleCard();return e.appendChild(s),e}createMouseCard(e,t){const n=document.createElement("div");n.className="bim-help-panel-card";const r=document.createElement("div");r.className="bim-help-panel-card-title",r.dataset.localeKey=`help.${e}`;const s=document.createElement("div");s.className="bim-help-panel-control-row";const o=document.createElement("div");if(o.className="bim-help-panel-mouse-box",t==="left"){const l=document.createElement("div");l.className="bim-help-panel-mouse-left",o.appendChild(l)}else if(t==="right"){const l=document.createElement("div");l.className="bim-help-panel-mouse-right",o.appendChild(l)}else if(t==="wheel"){const l=document.createElement("div");l.className="bim-help-panel-mouse-wheel",o.appendChild(l)}s.appendChild(o);const a=document.createElement("div");return a.className="bim-help-panel-rule-desc",a.dataset.localeKey=`help.${t==="left"?"mouseLeftDragShort":t==="right"?"mouseRightDragShort":"mouseWheelShort"}`,n.appendChild(r),n.appendChild(s),n.appendChild(a),n}createMultiSelectCard(){const e=document.createElement("div");e.className="bim-help-panel-card bim-help-panel-card-span-2";const t=document.createElement("div");t.className="bim-help-panel-card-title",t.dataset.localeKey="help.componentSelect";const n=document.createElement("div");n.className="bim-help-panel-control-row",n.style.gap="40px";const r=document.createElement("div");r.style.textAlign="center";const s=document.createElement("div");s.className="bim-help-panel-control-row",s.innerHTML='<kbd class="bim-help-panel-kbd">Ctrl</kbd> <span class="bim-help-panel-bold">+</span> <span class="bim-help-panel-bold" data-locale-key="help.click"></span>';const o=document.createElement("div");o.className="bim-help-panel-rule-desc",o.dataset.localeKey="help.addSelect",r.appendChild(s),r.appendChild(o);const a=document.createElement("div");a.style.textAlign="center";const l=document.createElement("div");l.className="bim-help-panel-control-row",l.innerHTML='<kbd class="bim-help-panel-kbd">Shift</kbd> <span class="bim-help-panel-bold">+</span> <span class="bim-help-panel-bold" data-locale-key="help.click"></span>';const c=document.createElement("div");return c.className="bim-help-panel-rule-desc",c.dataset.localeKey="help.removeSelect",a.appendChild(l),a.appendChild(c),n.appendChild(r),n.appendChild(a),e.appendChild(t),e.appendChild(n),e}createRuleCard(){const e=document.createElement("div");e.className="bim-help-panel-card bim-help-panel-card-span-2";const t=document.createElement("div");t.className="bim-help-panel-card-title",t.dataset.localeKey="help.rotateRuleTitle";const n=document.createElement("div");n.className="bim-help-panel-rule-desc",n.style.textAlign="left",n.style.width="100%";const r=document.createElement("div");r.style.marginBottom="6px";const s=document.createElement("span");s.className="bim-help-panel-bold",s.textContent="• ";const o=document.createElement("span");o.className="bim-help-panel-bold",o.dataset.localeKey="help.pointToComponent";const a=document.createElement("span");a.dataset.localeKey="help.pointToComponentDesc",r.appendChild(s),r.appendChild(o),r.appendChild(a);const l=document.createElement("div"),c=document.createElement("span");c.className="bim-help-panel-bold",c.textContent="• ";const h=document.createElement("span");h.className="bim-help-panel-bold",h.dataset.localeKey="help.pointToBlank";const u=document.createElement("span");return u.dataset.localeKey="help.pointToBlankDesc",l.appendChild(c),l.appendChild(h),l.appendChild(u),n.appendChild(r),n.appendChild(l),e.appendChild(t),e.appendChild(n),e}createFpsTabContent(){const e=document.createElement("div");e.className="bim-help-panel-tab-content",e.dataset.tab="fps";const t=document.createElement("div");t.className="bim-help-panel-card bim-help-panel-card-span-2";const n=document.createElement("div");n.className="bim-help-panel-card-title",n.dataset.localeKey="help.roamMove";const r=document.createElement("div");r.className="bim-help-panel-control-row",r.style.gap="48px",r.innerHTML=`
|
|
4360
|
+
`}bindQuestionEvents(){this.messagesContainer?.querySelectorAll(".bim-ai-option").forEach(e=>{e.addEventListener("click",t=>{const n=t.currentTarget,r=n.dataset.questionId,s=n.dataset.optionId;if(r&&s){const o=this.messages.find(a=>a.id===r);o&&!o.answered&&(o.selectedOptionId=s,this.renderMessages())}})}),this.messagesContainer?.querySelectorAll(".bim-ai-option-input").forEach(e=>{e.addEventListener("input",t=>{const n=t.target,r=n.dataset.questionId;if(r){const s=this.messages.find(o=>o.id===r);s&&(s.customAnswer=n.value)}})}),this.messagesContainer?.querySelectorAll(".bim-ai-question-submit").forEach(e=>{e.addEventListener("click",t=>{const r=t.currentTarget.dataset.questionId;if(r){const s=this.messages.find(o=>o.id===r);s&&s.selectedOptionId&&(s.answered=!0,this.renderMessages(),this.options.onQuestionSubmit?.(r,s.selectedOptionId,s.customAnswer))}})})}scrollToBottom(){this.messagesContainer&&(this.messagesContainer.scrollTop=this.messagesContainer.scrollHeight)}escapeHtml(e){const t=document.createElement("div");return t.textContent=e,t.innerHTML}destroy(){this._isDestroyed||(this.unsubscribeTheme&&(this.unsubscribeTheme(),this.unsubscribeTheme=null),this.unsubscribeLocale&&(this.unsubscribeLocale(),this.unsubscribeLocale=null),this.element.remove(),this._isDestroyed=!0)}}class zbe{aiChat=null;registry;initialized=!1;constructor(e){this.registry=e}init(){if(this.initialized)return;const e=this.registry.wrapper;if(!e){console.warn("[AiChatManager] wrapper 不存在,无法初始化");return}this.aiChat=new oht({container:e,width:440,title:"aiChat.title",placeholder:"aiChat.placeholder",quickPrompts:[{id:"summarize",label:"aiChat.quickPrompt.summarize"},{id:"explain",label:"aiChat.quickPrompt.explain"},{id:"generate",label:"aiChat.quickPrompt.generate"}],onSend:t=>{console.log("[AiChatManager] 用户发送消息:",t),this.aiChat?.addUserMessage(t),this.registry.emit("aiChat:message-sent",{message:t})},onQuestionSubmit:(t,n,r)=>{console.log("[AiChatManager] 用户回答问题:",{questionId:t,optionId:n,customAnswer:r}),this.registry.emit("aiChat:question-answered",{questionId:t,optionId:n,customAnswer:r})},onNewChat:()=>{console.log("[AiChatManager] 新建对话"),this.registry.emit("aiChat:new-chat",{})},onHistory:()=>{console.log("[AiChatManager] 打开历史"),this.registry.emit("aiChat:history-opened",{})},onSettings:()=>{console.log("[AiChatManager] 打开设置"),this.registry.emit("aiChat:settings-opened",{})},onClose:()=>{console.log("[AiChatManager] 关闭 AI 聊天"),this.registry.emit("aiChat:closed",{}),this.registry.toolbar?.setBtnActive("aiChat",!1)}}),this.initialized=!0}show(){this.aiChat||this.init(),this.aiChat?.show(),this.registry.emit("aiChat:opened",{}),this.registry.toolbar?.setBtnActive("aiChat",!0)}hide(){this.aiChat?.hide(),this.registry.emit("aiChat:closed",{}),this.registry.toolbar?.setBtnActive("aiChat",!1)}toggle(){this.aiChat?.isVisible()?this.hide():this.show()}isVisible(){return this.aiChat?.isVisible()??!1}addUserMessage(e){return this.aiChat?.addUserMessage(e)??""}addAiMessage(e){return this.aiChat?.addAiMessage(e)??""}addStepMessage(e,t){return this.aiChat?.addStepMessage(e,t)??""}addThinkingMessage(){return this.aiChat?.addThinkingMessage()??""}addQuestionMessage(e,t,n){return this.aiChat?.addQuestionMessage(e,t,n)??""}updateMessage(e,t){this.aiChat?.updateMessage(e,t)}removeMessage(e){this.aiChat?.removeMessage(e)}clearMessages(){this.aiChat?.clearMessages()}destroy(){this.aiChat&&(this.aiChat.destroy(),this.aiChat=null),this.initialized=!1}}class aht{container;options;groups=[];activeBtnIds=new Set;btnRefs=new Map;dropdownElement=null;hoverTimeout=null;customColors=new Set;unsubscribeLocale=null;unsubscribeTheme=null;DEFAULT_ICON='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect></svg>';constructor(e){const t=typeof e.container=="string"?document.getElementById(e.container):e.container;if(!t)throw new Error("Container not found");this.container=t,this.options={showLabel:!0,visibility:{},direction:"row",position:"static",align:"vertical",expand:"down",...e},["backgroundColor","btnBackgroundColor","btnHoverColor","btnActiveColor","iconColor","iconActiveColor","textColor","textActiveColor"].forEach(r=>{e[r]&&this.customColors.add(r)}),this.initContainer(),this.applyStyles()}emit(e,t){this.options.registry?.emit(e,t)}initContainer(){this.container.innerHTML="",this.container.classList.add("bim-btn-group-root"),this.options.direction==="column"?this.container.classList.add("dir-column"):this.container.classList.add("dir-row"),this.options.className&&this.container.classList.add(this.options.className),this.options.type&&this.options.type!=="default"&&this.container.classList.add(`type-${this.options.type}`),this.updatePosition(),this.setupEventInterception(this.container)}setupEventInterception(e){const t=r=>{r.stopPropagation()};["click","dblclick","contextmenu","wheel","mousedown","mouseup","mousemove","touchstart","touchend","touchmove","pointerdown","pointerup","pointermove","pointerenter","pointerleave","pointerover","pointerout"].forEach(r=>{e.addEventListener(r,t,{passive:!1})})}updatePosition(){const e=this.options.position,t=this.container.style;if(t.top="",t.bottom="",t.left="",t.right="",t.transform="",e==="static"){this.container.classList.add("static");return}if(this.container.classList.remove("static"),this.container.style.position="absolute",typeof e=="object"&&"x"in e)t.left=`${e.x}px`,t.top=`${e.y}px`;else{const n="20px";switch(e){case"top-left":t.top=n,t.left=n;break;case"top-center":t.top=n,t.left="50%",t.transform="translateX(-50%)";break;case"top-right":t.top=n,t.right=n;break;case"bottom-left":t.bottom=n,t.left=n;break;case"bottom-center":t.bottom=n,t.left="50%",t.transform="translateX(-50%)";break;case"bottom-right":t.bottom=n,t.right=n;break;case"left-center":t.left=n,t.top="50%",t.transform="translateY(-50%)";break;case"right-center":t.right=n,t.top="50%",t.transform="translateY(-50%)";break;case"center":t.top="50%",t.left="50%",t.transform="translate(-50%, -50%)";break}}}applyStyles(){const e=this.container.style;this.options.backgroundColor&&e.setProperty("--bim-btn-group-section-bg",this.options.backgroundColor),this.options.btnBackgroundColor&&e.setProperty("--bim-btn-bg",this.options.btnBackgroundColor),this.options.btnHoverColor&&e.setProperty("--bim-btn-hover-bg",this.options.btnHoverColor),this.options.btnActiveColor&&e.setProperty("--bim-btn-active-bg",this.options.btnActiveColor),this.options.iconColor&&e.setProperty("--bim-icon-color",this.options.iconColor),this.options.iconActiveColor&&e.setProperty("--bim-icon-active-color",this.options.iconActiveColor),this.options.textColor&&e.setProperty("--bim-btn-text-color",this.options.textColor),this.options.textActiveColor&&e.setProperty("--bim-btn-text-active-color",this.options.textActiveColor),document.querySelectorAll(".opt-btn-dropdown").forEach(n=>{const r=n.style;this.options.iconColor&&r.setProperty("--bim-icon-color",this.options.iconColor),this.options.iconActiveColor&&r.setProperty("--bim-icon-active-color",this.options.iconActiveColor),this.options.textColor&&r.setProperty("--bim-btn-text-color",this.options.textColor),this.options.textActiveColor&&r.setProperty("--bim-btn-text-active-color",this.options.textActiveColor),this.options.btnBackgroundColor&&r.setProperty("--bim-btn-bg",this.options.btnBackgroundColor),this.options.btnHoverColor&&r.setProperty("--bim-btn-hover-bg",this.options.btnHoverColor),this.options.btnActiveColor&&r.setProperty("--bim-btn-active-bg",this.options.btnActiveColor)})}setPrimaryColor(e){this.container.style.setProperty("--bim-primary-color",e),document.querySelectorAll(".opt-btn-dropdown").forEach(n=>{n.style.setProperty("--bim-primary-color",e)})}setTheme(e){const t={backgroundColor:e.bgElevated,btnBackgroundColor:e.componentBg,btnHoverColor:e.componentBgHover,btnActiveColor:e.componentBgActive,iconColor:e.iconDefault,iconActiveColor:e.iconActive,textColor:e.textSecondary,textActiveColor:e.textPrimary};Object.entries(t).forEach(([n,r])=>{const s=n;this.customColors.has(s)||(this.options[s]=r)}),this.container.classList.remove("theme-dark","theme-light"),this.container.classList.add(`theme-${e.name}`),this.applyStyles(),this.setPrimaryColor(e.primary),this.applyThemeCssVars(e)}applyThemeCssVars(e){const t=this.container.style;t.setProperty("--bim-primary",e.primary),t.setProperty("--bim-primary-hover",e.primaryHover),t.setProperty("--bim-primary-active",e.primaryActive),t.setProperty("--bim-bg-glass",e.bgGlass),t.setProperty("--bim-bg-glass-blur",e.bgGlassBlur),t.setProperty("--bim-bg-elevated",e.bgElevated),t.setProperty("--bim-bg-overlay",e.bgOverlay),t.setProperty("--bim-bg-inset",e.bgInset),t.setProperty("--bim-text-primary",e.textPrimary),t.setProperty("--bim-text-secondary",e.textSecondary),t.setProperty("--bim-text-tertiary",e.textTertiary),t.setProperty("--bim-text-inverse",e.textInverse),t.setProperty("--bim-icon-default",e.iconDefault),t.setProperty("--bim-icon-hover",e.iconHover),t.setProperty("--bim-icon-active",e.iconActive),t.setProperty("--bim-icon-inverse",e.iconInverse),t.setProperty("--bim-border-default",e.borderDefault),t.setProperty("--bim-border-subtle",e.borderSubtle),t.setProperty("--bim-component-bg-hover",e.componentBgHover),t.setProperty("--bim-component-bg-active",e.componentBgActive),t.setProperty("--bim-shadow-sm",e.shadowSm),t.setProperty("--bim-shadow-md",e.shadowMd),t.setProperty("--bim-shadow-lg",e.shadowLg),t.setProperty("--bim-shadow-glow",e.shadowGlow),t.setProperty("--bim-floating-bg",e.floatingBg),t.setProperty("--bim-floating-border",e.floatingBorder),t.setProperty("--bim-floating-shadow",e.floatingShadow),t.setProperty("--bim-floating-btn-bg",e.floatingBtnBg),t.setProperty("--bim-floating-btn-border",e.floatingBtnBorder),t.setProperty("--bim-floating-btn-shadow",e.floatingBtnShadow),t.setProperty("--bim-floating-btn-bg-hover",e.floatingBtnBgHover),t.setProperty("--bim-floating-btn-shadow-hover",e.floatingBtnShadowHover),t.setProperty("--bim-floating-icon-color",e.floatingIconColor),t.setProperty("--bim-floating-icon-color-hover",e.floatingIconColorHover),this.syncDropdownCssVars(e)}syncDropdownCssVars(e){document.querySelectorAll(".opt-btn-dropdown").forEach(n=>{const r=n.style;r.setProperty("--bim-primary",e.primary),r.setProperty("--bim-bg-overlay",e.bgOverlay),r.setProperty("--bim-border-default",e.borderDefault),r.setProperty("--bim-text-primary",e.textPrimary),r.setProperty("--bim-text-inverse",e.textInverse),r.setProperty("--bim-shadow-lg",e.shadowLg),r.setProperty("--bim-floating-btn-bg",e.floatingBtnBg),r.setProperty("--bim-floating-btn-bg-hover",e.floatingBtnBgHover),r.setProperty("--bim-floating-icon-color",e.floatingIconColor)})}setColors(e){this.options={...this.options,...e},Object.keys(e).forEach(t=>{this.customColors.add(t)}),this.applyStyles()}async init(){this.render(),this.unsubscribeLocale=dr.subscribe(()=>{this.setLocales()}),this.unsubscribeTheme=qi.subscribe(e=>{this.setTheme(e)})}setLocales(){this.render()}addGroup(e,t){if(this.groups.some(r=>r.id===e))return;const n={id:e,buttons:[]};if(t){const r=this.groups.findIndex(s=>s.id===t);r!==-1?this.groups.splice(r,0,n):this.groups.push(n)}else this.groups.push(n)}addButton(e){const{groupId:t,parentId:n}=e,r=this.groups.find(o=>o.id===t);if(!r)return;const s={...e,children:e.children||[]};if(n){const o=this.findButton(r.buttons,n);o&&(o.children||(o.children=[]),o.children.push(s))}else r.buttons.push(s)}findButton(e,t){for(const n of e){if(n.id===t)return n;if(n.children){const r=this.findButton(n.children,t);if(r)return r}}}render(){this.container.innerHTML="",this.btnRefs.clear(),this.groups.forEach((e,t)=>{const n=this.renderGroup(e,t,this.groups.length);this.container.appendChild(n)})}renderGroup(e,t,n){const r=document.createElement("div");return r.className="bim-btn-group-section",t<n-1&&r.classList.add("has-divider"),e.buttons.forEach(s=>{if(this.isVisible(s.id)){const o=this.renderButton(s);r.appendChild(o)}}),r}renderButton(e){const t=document.createElement("div");t.className="opt-btn-wrapper";const n=document.createElement("div");n.className="opt-btn",e.isActive&&this.activeBtnIds.add(e.id),(e.align||this.options.align||"vertical")==="horizontal"?n.classList.add("align-horizontal"):n.classList.add("align-vertical"),this.activeBtnIds.has(e.id)&&n.classList.add("active"),e.disabled&&n.classList.add("disabled"),this.options.showLabel&&e.label||(n.classList.add("no-label"),e.label&&(n.title=At(e.label)));const o=e.iconSize||32,a=e.minWidth||50;n.style.minWidth=`${a}px`;const l=document.createElement("div");l.className="opt-btn-icon",l.style.width=`${o}px`,l.style.height=`${o}px`,l.innerHTML=this.getIcon(e.icon),n.appendChild(l);const c=document.createElement("div");if(c.className="opt-btn-text-wrapper",this.options.showLabel&&e.label){const h=document.createElement("span");h.className="opt-btn-label",h.textContent=At(e.label),c.appendChild(h)}return c.hasChildNodes()&&n.appendChild(c),n.addEventListener("click",()=>this.handleClick(e)),n.addEventListener("mouseenter",()=>this.handleMouseEnter(e,n)),n.addEventListener("mouseleave",()=>this.handleMouseLeave()),this.btnRefs.set(e.id,n),t.appendChild(n),t}setBtnActive(e,t){const n=this.findButtonById(e);if(!n)return;const r=t!==void 0?t:!this.activeBtnIds.has(e);r?this.activeBtnIds.add(e):this.activeBtnIds.delete(e),n.isActive=r,this.updateButtonState(e)}handleClick(e){if(!e.disabled&&(!e.children||e.children.length===0)){if(e.keepActive){const n=!this.activeBtnIds.has(e.id);this.setBtnActive(e.id,n),n&&e.exclusive&&e.groupId&&this.deactivateExclusiveSiblings(e)}this.closeDropdown(),e.onClick&&e.onClick(e)}}deactivateExclusiveSiblings(e){const t=this.groups.find(n=>n.id===e.groupId);if(t){if(e.parentId){const r=this.findButton(t.buttons,e.parentId)?.children||[];for(const s of r)s&&s.id!==e.id&&s.parentId===e.parentId&&s.groupId===e.groupId&&this.activeBtnIds.has(s.id)&&(this.setBtnActive(s.id,!1),s.onClick&&s.onClick(s));return}for(const n of t.buttons)n.id!==e.id&&n.groupId===e.groupId&&(n.parentId||this.activeBtnIds.has(n.id)&&(this.setBtnActive(n.id,!1),n.onClick&&n.onClick(n)))}}handleMouseEnter(e,t){this.hoverTimeout&&clearTimeout(this.hoverTimeout),e.children&&e.children.length>0?this.showDropdown(e,t):this.closeDropdown()}handleMouseLeave(){this.hoverTimeout=window.setTimeout(()=>this.closeDropdown(),200)}showDropdown(e,t){if(this.closeDropdown(),!e.children)return;const n=document.createElement("div");n.className="opt-btn-dropdown",this.options.backgroundColor&&n.style.setProperty("--bim-toolbar-bg",this.options.backgroundColor);const r=n.style;this.options.iconColor&&r.setProperty("--bim-icon-color",this.options.iconColor),this.options.iconActiveColor&&r.setProperty("--bim-icon-active-color",this.options.iconActiveColor),this.options.textColor&&r.setProperty("--bim-btn-text-color",this.options.textColor),this.options.textActiveColor&&r.setProperty("--bim-btn-text-active-color",this.options.textActiveColor),this.options.btnBackgroundColor&&r.setProperty("--bim-btn-bg",this.options.btnBackgroundColor),this.options.btnHoverColor&&r.setProperty("--bim-btn-hover-bg",this.options.btnHoverColor),this.options.btnActiveColor&&r.setProperty("--bim-btn-active-bg",this.options.btnActiveColor);const s=t.getBoundingClientRect(),o=this.options.expand||"down";this.options.direction==="row"?n.style.flexDirection="column":n.style.flexDirection="row",this.options.type&&this.options.type!=="default"&&n.classList.add(`type-${this.options.type}`);const a=qi.getTheme();n.classList.add(`theme-${a.name}`),r.setProperty("--bim-primary",a.primary),r.setProperty("--bim-bg-overlay",a.bgOverlay),r.setProperty("--bim-border-default",a.borderDefault),r.setProperty("--bim-text-primary",a.textPrimary),r.setProperty("--bim-text-inverse",a.textInverse),r.setProperty("--bim-shadow-lg",a.shadowLg),r.setProperty("--bim-floating-btn-bg",a.floatingBtnBg),r.setProperty("--bim-floating-btn-bg-hover",a.floatingBtnBgHover),r.setProperty("--bim-floating-icon-color",a.floatingIconColor),document.body.appendChild(n),this.setupEventInterception(n),e.children.forEach(c=>{if(this.isVisible(c.id)){const h=this.renderDropdownItem(c);n.appendChild(h)}});const l=n.getBoundingClientRect();o==="up"?(n.style.bottom=window.innerHeight-s.top+8+"px",n.style.left=s.left+(s.width-l.width)/2+"px"):o==="down"?(n.style.top=s.bottom+8+"px",n.style.left=s.left+(s.width-l.width)/2+"px"):o==="right"?(n.style.top=s.top+(s.height-l.height)/2+"px",n.style.left=s.right+8+"px"):o==="left"&&(n.style.top=s.top+(s.height-l.height)/2+"px",n.style.right=window.innerWidth-s.left+8+"px"),n.addEventListener("mouseenter",()=>{this.hoverTimeout&&clearTimeout(this.hoverTimeout)}),n.addEventListener("mouseleave",()=>this.handleMouseLeave()),this.dropdownElement=n}renderDropdownItem(e){const t=document.createElement("div");t.className="opt-btn-dropdown-item",(e.align||"horizontal")==="horizontal"?t.classList.add("align-horizontal"):t.classList.add("align-vertical"),(this.activeBtnIds.has(e.id)||e.isActive)&&t.classList.add("active");const r=e.iconSize||32,s=e.minWidth;s&&(t.style.minWidth=`${s}px`);const o=document.createElement("div");if(o.className="opt-btn-icon",o.style.width=`${r}px`,o.style.height=`${r}px`,o.innerHTML=this.getIcon(e.icon),t.appendChild(o),this.options.showLabel&&e.label){const a=document.createElement("span");a.className="opt-btn-dropdown-label",a.textContent=At(e.label),t.appendChild(a)}else e.label&&(t.title=At(e.label));return t.addEventListener("click",a=>{a.stopPropagation(),this.handleClick(e)}),t}closeDropdown(){this.dropdownElement&&(this.dropdownElement.remove(),this.dropdownElement=null),this.btnRefs.forEach(e=>{const t=e.querySelector(".opt-btn-arrow");t&&t.classList.remove("rotated")})}updateButtonState(e){const t=this.btnRefs.get(e);t&&(this.activeBtnIds.has(e)?t.classList.add("active"):t.classList.remove("active"))}getIcon(e){return e||this.DEFAULT_ICON}updateButtonIcon(e,t){const n=this.btnRefs.get(e);if(!n)return;const r=n.querySelector(".opt-btn-icon");r&&(r.innerHTML=this.getIcon(t));const s=this.findButtonById(e);s&&(s.icon=t)}updateButtonVisibility(e,t){this.options.visibility||(this.options.visibility={}),this.options.visibility[e]=t,this.render()}setShowLabel(e){this.options.showLabel=e,this.updateLabelsVisibility()}updateLabelsVisibility(){this.btnRefs.forEach((e,t)=>{const n=this.findButtonById(t);if(!n)return;this.options.showLabel&&n.label?(e.classList.remove("no-label"),e.removeAttribute("title")):(e.classList.add("no-label"),n.label&&(e.title=At(n.label)))})}findButtonById(e){for(const t of this.groups){const n=this.findButton(t.buttons,e);if(n)return n}}setBackgroundColor(e){this.setColors({backgroundColor:e})}isVisible(e){return this.options.visibility?.[e]!==!1}setType(e){this.container.classList.remove("type-default","type-glass-pill"),this.options.type=e,e&&e!=="default"&&this.container.classList.add(`type-${e}`),this.render()}getType(){return this.options.type||"default"}destroy(){this.unsubscribeLocale&&(this.unsubscribeLocale(),this.unsubscribeLocale=null),this.unsubscribeTheme&&(this.unsubscribeTheme(),this.unsubscribeTheme=null),this.closeDropdown(),this.container.innerHTML="",this.btnRefs.clear()}}function Hbe(i,e){let t=e>>>0;for(let n=0;n<i.length;n++){const r=i.charCodeAt(n);t^=r&255,t=Math.imul(t,16777619),t^=r>>>8&255,t=Math.imul(t,16777619)}return t>>>0}async function lht(i){const e=JSON.stringify(i),t=Hbe(e,2166136261),n=Hbe(e,522970236);return`${t.toString(16).padStart(8,"0")}${n.toString(16).padStart(8,"0")}`}function Vbe(i){const e=new Map,t=r=>{const s=r.config.data,o=s?._modelUrl;if(o&&s?.ids?.length){let a=e.get(o);a||(a=new Set,e.set(o,a));for(const l of s.ids){const c=Number(l);Number.isFinite(c)&&a.add(c)}}for(const a of r.children||[])t(a)};t(i);const n=[];for(const[r,s]of e)s.size>0&&n.push({url:r,ids:Array.from(s)});return n}let cht=0;async function hht(i){if(!i||i.length===0)return[];const e=async(t,n)=>{const r=t.children&&t.children.length>0;let s;return t.ids?.length?s=await lht(t.ids):t.id?s=t.id:s=`node_${++cht}`,{id:s,label:t.name||"未命名",expanded:!1,checked:!0,children:r?await Promise.all(t.children.map(o=>e(o,n))):void 0,data:{...t,_modelUrl:n}}};return Promise.all(i.map(async t=>{const n=t.children&&t.children.length>0,r=t.url;return{id:r,label:t.name||"模型",expanded:!0,checked:!0,children:n?await Promise.all(t.children.map(s=>e(s,r))):void 0,data:{_modelUrl:r}}}))}class uht extends Mc{toolbar=null;toolbarContainer=null;container;dialog=null;constructor(e,t){super(t),this.container=e,this.init()}init(){this.toolbarContainer=document.createElement("div"),this.toolbarContainer.id="bim-construct-tree",this.container.appendChild(this.toolbarContainer),this.toolbar=new aht({container:this.toolbarContainer,showLabel:!1,direction:"column",position:"top-left",align:"vertical",expand:"up",registry:this.registry}),this.toolbar.init(),this.toolbar.addGroup("construct-tree"),this.toolbar.addButton({id:"construct-tree-btn",groupId:"construct-tree",type:"button",label:"construct-tree",icon:vn("目录树"),onClick:()=>{if(this.registry.componentTreeDrawer){this.registry.componentTreeDrawer.toggle();return}this.openConstructTreeDialog()}}),this.toolbar.render()}async openConstructTreeDialog(){if(this.registry.componentTreeDrawer){this.registry.componentTreeDrawer.open();return}this.setVisible(!1);const e=this.engineComponent?.getLevelTreeData()??[],t=this.engineComponent?.getTypeTreeData()??[],n=this.engineComponent?.getMajorTreeData()??[];console.log("[ConstructTree] 原始数据 (Level):",e),console.log("[ConstructTree] 原始数据 (Type):",t),console.log("[ConstructTree] 原始数据 (Major):",n);const r=async(g,_)=>{const y=await hht(g);console.log(`[ConstructTree] 转换后数据 (${_}):`,y);const A=new m8({data:y,checkable:!0,indent:0,enableSearch:!0,checkStrictly:!0,defaultExpandAll:!0,onNodeCheck:x=>{const w=Vbe(x);w.length&&(x.checkState===na.Checked?this.engineComponent?.showModel(w):this.engineComponent?.hideModels(w))},onNodeSelect:x=>{const w=Vbe(x);w.length&&(this.engineComponent?.unhighlightAllModels(),this.engineComponent?.highlightModel(w),this.engineComponent?.viewScaleToModel(w))},onNodeDeselect:()=>{this.engineComponent?.unhighlightAllModels()},onNodeExpand:()=>{this.dialog?.fitWidth()}});return A.init(),A},s=await r(e,"Level"),o=await r(t,"Type"),a=await r(n,"Major"),l=document.createElement("div");l.className="construct-tab__panel-content",l.appendChild(s.element);const c=document.createElement("div");c.className="construct-tab__panel-content",c.appendChild(o.element);const h=document.createElement("div");h.className="construct-tab__panel-content",h.appendChild(a.element);const u=document.createElement("div");u.className="construct-tab__container",u.style.height="100%",u.style.overflow="hidden";const d=()=>{this.engineComponent?.showAllModels({preserveSection:!0}),s.checkAllNodes(!0),o.checkAllNodes(!0),a.checkAllNodes(!0)},p=new Mbe({container:u,tabs:[{id:"component",title:"tab.component",content:l},{id:"type",title:"tab.type",content:c},{id:"major",title:"tab.major",content:h}],activeId:"component",onChange:()=>{this.dialog?.fitWidth()}});p.init(),d();const f=this.registry.on("menu:show-all",()=>{d()});this.dialog=this.registry.dialog.create({title:"constructTree.title",minWidth:320,height:600,content:u,position:{x:20,y:20},resizable:!1,onClose:()=>{f(),p.destroy(),s.destroy(),o.destroy(),a.destroy(),this.setVisible(!0)}}),this.dialog?.fitWidth()}refresh(){this.toolbar?.render()}destroy(){this.toolbar?.destroy(),this.toolbar=null,super.destroy()}addGroup(e,t){this.toolbar?.addGroup(e,t),this.toolbar?.render()}addButton(e){this.toolbar?.addButton(e),this.toolbar?.render()}setButtonVisibility(e,t){this.toolbar?.updateButtonVisibility(e,t)}setShowLabel(e){this.toolbar?.setShowLabel(e)}setVisible(e){this.toolbarContainer&&(this.toolbarContainer.style.visibility=e?"visible":"hidden")}setBackgroundColor(e){this.toolbar?.setBackgroundColor(e)}setColors(e){this.toolbar?.setColors(e)}}class YZ{options;trigger=null;menu=null;unsubscribeLocale=null;closeOnOutsideClick=e=>{this.menu?.contains(e.target)||this.trigger?.contains(e.target)||this.closeMenu()};constructor(e){this.options=e}init(){if(this.trigger?.isConnected){this.options.container.appendChild(this.trigger);return}this.trigger&&this.destroy(),this.options.container.classList.add("engine-view-dropdown-host");const e=document.createElement("div");e.className="engine-view-dropdown-trigger",this.options.triggerClassName&&e.classList.add(this.options.triggerClassName),e.innerHTML=vn("doubleArrowDown"),e.addEventListener("click",t=>{t.stopPropagation(),this.toggleMenu()}),this.options.container.appendChild(e),this.trigger=e,this.unsubscribeLocale=dr.subscribe(()=>this.updateText()),this.updateText()}destroy(){this.closeMenu(),document.removeEventListener("mousedown",this.closeOnOutsideClick),this.unsubscribeLocale?.(),this.unsubscribeLocale=null,this.trigger?.remove(),this.trigger=null,this.options.container.classList.remove("engine-view-dropdown-host")}setItems(e){this.options.items=e,this.closeMenu(),this.updateText()}toggleMenu(){if(this.menu){this.closeMenu();return}this.openMenu()}openMenu(){if(!this.trigger)return;const e=document.createElement("div");e.className="engine-view-dropdown-menu",this.options.items.forEach(n=>{const r=document.createElement("div");r.className="engine-view-dropdown-item",r.dataset.key=n.key,r.textContent=this.resolveLabel(n),r.addEventListener("click",s=>{s.stopPropagation(),n.action(s),n.closeOnClick!==!1&&this.closeMenu()}),e.appendChild(r)});const t=this.trigger.getBoundingClientRect();e.style.position="fixed",e.style.top=`${t.bottom+4}px`,e.style.right=`${window.innerWidth-t.right}px`,e.style.zIndex="10000",document.body.appendChild(e),this.menu=e,document.addEventListener("mousedown",this.closeOnOutsideClick)}closeMenu(){this.menu&&(this.menu.remove(),this.menu=null,document.removeEventListener("mousedown",this.closeOnOutsideClick))}updateText(){this.trigger&&(this.trigger.title=dr.t(this.options.triggerTitleKey??"viewDropdown.triggerTitle")),this.menu?.querySelectorAll(".engine-view-dropdown-item").forEach(e=>{const t=this.options.items.find(n=>n.key===e.dataset.key);t&&(e.textContent=this.resolveLabel(t))})}resolveLabel(e){return e.labelKey?dr.t(e.labelKey):e.label??e.key}}class dht extends Mc{dropdown=null;customButtons=[];constructor(e,t){super(t),this.dropdown=new YZ({container:e,items:this.getItems()}),this.init()}init(){this.dropdown?.init()}addButton(e){return!e?.key||!e.label||typeof e.onClick!="function"?(console.warn("[ViewDropdownManager] Invalid view dropdown button config."),()=>{}):(this.customButtons=[...this.customButtons.filter(t=>t.key!==e.key),e],this.refreshItems(),()=>this.removeButton(e.key))}removeButton(e){const t=this.customButtons.filter(n=>n.key!==e);t.length!==this.customButtons.length&&(this.customButtons=t,this.refreshItems())}destroy(){this.dropdown?.destroy(),this.dropdown=null,this.customButtons=[],super.destroy()}refreshItems(){this.dropdown?.setItems(this.getItems())}getItems(){const e=()=>this.registry.engine3d?.getEngineComponent(),t=[{key:"switchOrthographic",labelKey:"viewDropdown.switchOrthographic",action:()=>e()?.switchToOrthographicCamera()},{key:"switchPerspective",labelKey:"viewDropdown.switchPerspective",action:()=>e()?.switchToPerspectiveCamera()},{key:"saveMainView",labelKey:"viewDropdown.saveMainView",action:()=>e()?.saveMainView()},{key:"restoreMainView",labelKey:"viewDropdown.restoreMainView",action:()=>e()?.restoreMainView()},{key:"captureScreenshot",labelKey:"viewDropdown.captureScreenshot",action:()=>e()?.captureScreenshot()},{key:"modelCalibration",labelKey:"viewDropdown.modelCalibration",action:()=>this.registry.bottomDock?.toggle("modelCalibration")}],n=this.customButtons.map(r=>({key:r.key,label:r.label,action:r.onClick,closeOnClick:r.closeOnClick}));return[...t,...n]}}class _8{element;overlay;container;options;viewTabBtn;fpsTabBtn;viewContent;fpsContent;confirmBtn;dontRemindBtn;unsubscribeLocale=null;unsubscribeTheme=null;static STORAGE_KEY="bim-engine:help-panel:hidden";constructor(e={}){this.options=e}init(){this.element=this.createPanel(),this.unsubscribeLocale=dr.subscribe(()=>this.setLocales()),this.unsubscribeTheme=qi.subscribe(e=>this.setTheme(e)),this.setLocales(),this.setTheme(qi.getTheme())}show(){this.overlay.classList.add("active")}hide(){this.overlay.classList.remove("active")}isVisible(){return this.overlay.classList.contains("active")}shouldAutoShow(){const e=this.options.storageKey??_8.STORAGE_KEY;return localStorage.getItem(e)!=="true"}createPanel(){const e=document.createElement("div");e.className="bim-help-panel-wrapper",this.overlay=document.createElement("div"),this.overlay.className="bim-help-panel-overlay",this.overlay.addEventListener("click",s=>{s.target===this.overlay&&this.hide()}),this.container=document.createElement("div"),this.container.className="bim-help-panel-container";const t=this.createHeader(),n=this.createBody(),r=this.createFooter();return this.container.appendChild(t),this.container.appendChild(n),this.container.appendChild(r),this.overlay.appendChild(this.container),e.appendChild(this.overlay),e}createHeader(){const e=document.createElement("div");return e.className="bim-help-panel-header",this.viewTabBtn=document.createElement("button"),this.viewTabBtn.className="bim-help-panel-tab-btn active",this.viewTabBtn.addEventListener("click",()=>this.switchTab("view")),this.fpsTabBtn=document.createElement("button"),this.fpsTabBtn.className="bim-help-panel-tab-btn",this.fpsTabBtn.addEventListener("click",()=>this.switchTab("fps")),e.appendChild(this.viewTabBtn),e.appendChild(this.fpsTabBtn),e}createBody(){const e=document.createElement("div");return e.className="bim-help-panel-body",this.viewContent=this.createViewTabContent(),this.fpsContent=this.createFpsTabContent(),e.appendChild(this.viewContent),e.appendChild(this.fpsContent),e}createViewTabContent(){const e=document.createElement("div");e.className="bim-help-panel-tab-content active",e.dataset.tab="view",e.appendChild(this.createMouseCard("rotateView","left")),e.appendChild(this.createMouseCard("panView","right")),e.appendChild(this.createMouseCard("zoomView","wheel"));const t=this.createCard("boxSelect","ctrlLeftDrag");e.appendChild(t);const n=this.createMultiSelectCard();e.appendChild(n);const r=this.createCard("resetView","doubleClickBlankShort");e.appendChild(r);const s=this.createRuleCard();return e.appendChild(s),e}createMouseCard(e,t){const n=document.createElement("div");n.className="bim-help-panel-card";const r=document.createElement("div");r.className="bim-help-panel-card-title",r.dataset.localeKey=`help.${e}`;const s=document.createElement("div");s.className="bim-help-panel-control-row";const o=document.createElement("div");if(o.className="bim-help-panel-mouse-box",t==="left"){const l=document.createElement("div");l.className="bim-help-panel-mouse-left",o.appendChild(l)}else if(t==="right"){const l=document.createElement("div");l.className="bim-help-panel-mouse-right",o.appendChild(l)}else if(t==="wheel"){const l=document.createElement("div");l.className="bim-help-panel-mouse-wheel",o.appendChild(l)}s.appendChild(o);const a=document.createElement("div");return a.className="bim-help-panel-rule-desc",a.dataset.localeKey=`help.${t==="left"?"mouseLeftDragShort":t==="right"?"mouseRightDragShort":"mouseWheelShort"}`,n.appendChild(r),n.appendChild(s),n.appendChild(a),n}createMultiSelectCard(){const e=document.createElement("div");e.className="bim-help-panel-card bim-help-panel-card-span-2";const t=document.createElement("div");t.className="bim-help-panel-card-title",t.dataset.localeKey="help.componentSelect";const n=document.createElement("div");n.className="bim-help-panel-control-row",n.style.gap="40px";const r=document.createElement("div");r.style.textAlign="center";const s=document.createElement("div");s.className="bim-help-panel-control-row",s.innerHTML='<kbd class="bim-help-panel-kbd">Ctrl</kbd> <span class="bim-help-panel-bold">+</span> <span class="bim-help-panel-bold" data-locale-key="help.click"></span>';const o=document.createElement("div");o.className="bim-help-panel-rule-desc",o.dataset.localeKey="help.addSelect",r.appendChild(s),r.appendChild(o);const a=document.createElement("div");a.style.textAlign="center";const l=document.createElement("div");l.className="bim-help-panel-control-row",l.innerHTML='<kbd class="bim-help-panel-kbd">Shift</kbd> <span class="bim-help-panel-bold">+</span> <span class="bim-help-panel-bold" data-locale-key="help.click"></span>';const c=document.createElement("div");return c.className="bim-help-panel-rule-desc",c.dataset.localeKey="help.removeSelect",a.appendChild(l),a.appendChild(c),n.appendChild(r),n.appendChild(a),e.appendChild(t),e.appendChild(n),e}createRuleCard(){const e=document.createElement("div");e.className="bim-help-panel-card bim-help-panel-card-span-2";const t=document.createElement("div");t.className="bim-help-panel-card-title",t.dataset.localeKey="help.rotateRuleTitle";const n=document.createElement("div");n.className="bim-help-panel-rule-desc",n.style.textAlign="left",n.style.width="100%";const r=document.createElement("div");r.style.marginBottom="6px";const s=document.createElement("span");s.className="bim-help-panel-bold",s.textContent="• ";const o=document.createElement("span");o.className="bim-help-panel-bold",o.dataset.localeKey="help.pointToComponent";const a=document.createElement("span");a.dataset.localeKey="help.pointToComponentDesc",r.appendChild(s),r.appendChild(o),r.appendChild(a);const l=document.createElement("div"),c=document.createElement("span");c.className="bim-help-panel-bold",c.textContent="• ";const h=document.createElement("span");h.className="bim-help-panel-bold",h.dataset.localeKey="help.pointToBlank";const u=document.createElement("span");return u.dataset.localeKey="help.pointToBlankDesc",l.appendChild(c),l.appendChild(h),l.appendChild(u),n.appendChild(r),n.appendChild(l),e.appendChild(t),e.appendChild(n),e}createFpsTabContent(){const e=document.createElement("div");e.className="bim-help-panel-tab-content",e.dataset.tab="fps";const t=document.createElement("div");t.className="bim-help-panel-card bim-help-panel-card-span-2";const n=document.createElement("div");n.className="bim-help-panel-card-title",n.dataset.localeKey="help.roamMove";const r=document.createElement("div");r.className="bim-help-panel-control-row",r.style.gap="48px",r.innerHTML=`
|
|
4361
4361
|
<div class="bim-help-panel-wasd-group">
|
|
4362
4362
|
<div class="bim-help-panel-kbd-row"><kbd class="bim-help-panel-kbd">W</kbd></div>
|
|
4363
4363
|
<div class="bim-help-panel-kbd-row">
|
|
@@ -4366,7 +4366,7 @@ ${e.url}`,t.appendChild(n),t}createInputMap(e){return{x:this.createNumberInput(e
|
|
|
4366
4366
|
<kbd class="bim-help-panel-kbd">D</kbd>
|
|
4367
4367
|
</div>
|
|
4368
4368
|
</div>
|
|
4369
|
-
`;const s=document.createElement("div");s.className="bim-help-panel-rule-desc",s.dataset.localeKey="help.roamMoveDesc",t.appendChild(n),t.appendChild(r),t.appendChild(s),e.appendChild(t),e.appendChild(this.createCard("speedUp","shiftArrow")),e.appendChild(this.createCard("upDown","qeKey","landOnFloor"));const o=document.createElement("div");o.className="bim-help-panel-card";const a=document.createElement("div");a.className="bim-help-panel-card-title",a.dataset.localeKey="help.lookAround";const l=document.createElement("div");l.className="bim-help-panel-control-row";const c=document.createElement("div");c.className="bim-help-panel-mouse-box";const h=document.createElement("div");h.className="bim-help-panel-mouse-left",c.appendChild(h),l.appendChild(c);const u=document.createElement("div");u.className="bim-help-panel-rule-desc",u.dataset.localeKey="help.lookAroundDesc",o.appendChild(a),o.appendChild(l),o.appendChild(u),e.appendChild(o);const d=document.createElement("div");d.className="bim-help-panel-card";const p=document.createElement("div");p.className="bim-help-panel-card-title",p.dataset.localeKey="help.teleport";const f=document.createElement("div");f.className="bim-help-panel-control-row";const g=document.createElement("div");g.className="bim-help-panel-teleport-icon";const _=document.createElement("div");_.className="bim-help-panel-teleport-inner",g.appendChild(_),f.appendChild(g);const y=document.createElement("div");return y.className="bim-help-panel-rule-desc",y.dataset.localeKey="help.teleportDesc",d.appendChild(p),d.appendChild(f),d.appendChild(y),e.appendChild(d),e}createCard(e,t,n){const r=document.createElement("div");r.className="bim-help-panel-card";const s=document.createElement("div");s.className="bim-help-panel-card-title",s.dataset.localeKey=`help.${e}`;const o=document.createElement("div");if(o.className="bim-help-panel-control-row",o.dataset.localeKey=`help.${t}`,r.appendChild(s),r.appendChild(o),n){const a=document.createElement("div");a.className="bim-help-panel-rule-desc",a.dataset.localeKey=`help.${n}`,r.appendChild(a)}return r}createFooter(){const e=document.createElement("div");return e.className="bim-help-panel-footer",this.confirmBtn=document.createElement("button"),this.confirmBtn.className="bim-help-panel-btn bim-help-panel-btn-primary",this.confirmBtn.addEventListener("click",()=>this.hide()),this.dontRemindBtn=document.createElement("button"),this.dontRemindBtn.className="bim-help-panel-btn bim-help-panel-btn-secondary",this.dontRemindBtn.addEventListener("click",()=>this.dontRemind()),e.appendChild(this.confirmBtn),e.appendChild(this.dontRemindBtn),e}switchTab(e){this.viewTabBtn.classList.toggle("active",e==="view"),this.fpsTabBtn.classList.toggle("active",e==="fps"),this.viewContent.classList.toggle("active",e==="view"),this.fpsContent.classList.toggle("active",e==="fps")}dontRemind(){const e=this.options.storageKey??_8.STORAGE_KEY;localStorage.setItem(e,"true"),this.hide(),this.options.onDontRemind?.()}setLocales(){this.viewTabBtn.textContent=At("help.engineControl"),this.fpsTabBtn.textContent=At("help.fpsControl"),this.confirmBtn.textContent=At("help.gotIt"),this.dontRemindBtn.textContent=At("help.dontRemind"),this.element.querySelectorAll("[data-locale-key]").forEach(e=>{const t=e.getAttribute("data-locale-key");t&&(e.textContent=At(t))})}setTheme(e){this.element.style.setProperty("--bim-bg-overlay","rgba(0, 0, 0, 0.5)"),this.element.style.setProperty("--bim-panel-bg",e.bgElevated),this.element.style.setProperty("--bim-panel-border",e.panelBorder),this.element.style.setProperty("--bim-shadow-lg",e.shadowLg),this.element.style.setProperty("--bim-text-primary",e.textPrimary),this.element.style.setProperty("--bim-text-secondary",e.textSecondary),this.element.style.setProperty("--bim-text-tertiary",e.textTertiary),this.element.style.setProperty("--bim-primary",e.primary),this.element.style.setProperty("--bim-primary-hover",e.primaryHover),this.element.style.setProperty("--bim-text-inverse",e.textInverse),this.element.style.setProperty("--bim-divider",e.divider),this.element.style.setProperty("--bim-border-default",e.borderDefault),this.element.style.setProperty("--bim-border-subtle",e.borderSubtle),this.element.style.setProperty("--bim-component-bg",e.componentBg),this.element.style.setProperty("--bim-component-bg-hover",e.componentBgHover),this.element.style.setProperty("--bim-bg-inset",e.bgInset),this.element.style.setProperty("--bim-scrollbar-thumb",e.scrollbarThumb),this.element.style.setProperty("--bim-scrollbar-thumb-hover",e.scrollbarThumbHover)}destroy(){this.unsubscribeLocale&&(this.unsubscribeLocale(),this.unsubscribeLocale=null),this.unsubscribeTheme&&(this.unsubscribeTheme(),this.unsubscribeTheme=null),this.overlay&&this.overlay.remove()}}class pht extends Mc{container;helpPanel=null;infoButton=null;constructor(e,t){super(t),this.container=e,this.init()}init(){if(this.helpPanel||this.infoButton)return;this.helpPanel=new _8({onDontRemind:()=>{this.registry.emit("help:dont-remind",{})}}),this.helpPanel.init(),this.container.appendChild(this.helpPanel.element);const e=document.createElement("div");e.className="engine-info-button",e.innerHTML=vn("default"),e.title="信息",e.addEventListener("click",t=>{t.stopPropagation(),this.show()}),this.container.appendChild(e),this.infoButton=e}show(){this.helpPanel?.show()}destroy(){this.infoButton?.remove(),this.infoButton=null,this.helpPanel?.destroy(),this.helpPanel=null,super.destroy()}}class fht{events=new Map;on(e,t){return this.events.has(e)||this.events.set(e,[]),this.events.get(e).push(t),()=>this.off(e,t)}off(e,t){const n=this.events.get(e);if(!n)return;const r=n.indexOf(t);r!==-1&&n.splice(r,1)}emit(e,t){const n=this.events.get(e);n&&n.forEach(r=>{try{r(t)}catch(s){console.error(`[EventEmitter] Error in listener for event "${e}":`,s)}})}clear(){this.events.clear()}}class jI{eventEmitter=new fht;container=null;wrapper=null;mode="desktop";toolbar=null;dialog=null;engine3d=null;engine2d=null;engineGis=null;engineGaussian=null;buttonGroup=null;rightKey=null;constructTree=null;measure=null;sectionPlane=null;sectionAxis=null;sectionBox=null;walkPath=null;walkPlanView=null;engineInfo=null;componentDetail=null;aiChat=null;setting=null;radialToolbar=null;viewDropdown=null;helpPanel=null;bottomDock=null;measureDock=null;sectionDock=null;walkDock=null;modelCalibrationDock=null;gisModelCalibrationDock=null;componentTreeDrawer=null;constructor(){}reset(){this.eventEmitter.clear(),this.container=null,this.wrapper=null,this.mode="desktop",this.toolbar=null,this.dialog=null,this.engine3d=null,this.engine2d=null,this.engineGis=null,this.engineGaussian=null,this.buttonGroup=null,this.rightKey=null,this.constructTree=null,this.measure=null,this.sectionPlane=null,this.sectionAxis=null,this.sectionBox=null,this.walkPath=null,this.walkPlanView=null,this.engineInfo=null,this.componentDetail=null,this.aiChat=null,this.setting=null,this.radialToolbar=null,this.viewDropdown=null,this.helpPanel=null,this.bottomDock=null,this.measureDock=null,this.sectionDock=null,this.walkDock=null,this.modelCalibrationDock=null,this.gisModelCalibrationDock=null,this.componentTreeDrawer=null}emit(e,t){this.eventEmitter.emit(e,t)}on(e,t){return this.eventEmitter.on(e,t)}off(e,t){this.eventEmitter.off(e,t)}clearEvents(){this.eventEmitter.clear()}}class mht{container;wrapper=null;sizeEl=null;statsEl=null;resizeObserver=null;lastSyncedWidth=-1;lastSyncedHeight=-1;registry;mode;uiOptions;dialog=null;engine=null;rightKey=null;radialToolbar=null;viewDropdown=null;helpPanel=null;bottomDock=null;measureDock=null;sectionDock=null;walkDock=null;modelCalibrationDock=null;componentTreeDrawer=null;measure=null;sectionPlane=null;sectionAxis=null;sectionBox=null;engineInfo=null;componentDetail=null;aiChat=null;setting=null;constructTreeBtn=null;handleWindowResize=()=>{this.updateClientSizeDisplay()};constructor(e,t){const n=typeof e=="string"?document.getElementById(e):e;if(!n)throw new Error("Container not found");this.container=n,this.registry=new jI,this.mode=this.resolveMode(t?.mode??"desktop"),this.uiOptions={enableRadialToolbar:t?.enableRadialToolbar??!0,enableConstructTree:t?.enableConstructTree??!0,enableRightKeyMenu:t?.enableRightKeyMenu??!0,showModelInfoStats:t?.showModelInfoStats??!0},t?.locale&&dr.setLocale(t.locale),t?.theme&&(t.theme==="custom"?console.warn("Custom theme should be set via setCustomTheme()."):qi.setTheme(t.theme)),this.init()}emit(e,t){this.registry.emit(e,t)}on(e,t){return this.registry.on(e,t)}setLocale(e){dr.setLocale(e)}getLocale(){return dr.getLocale()}setTheme(e){qi.setTheme(e)}setCustomTheme(e){qi.setCustomTheme(e)}async initialize(e){return this.engine?this.engine.initialize(e):(console.warn("[BimEngine] 3D Engine manager not initialized."),!1)}loadModel(e,t){this.engine?.loadModel(e,t)}setPinEditable(e){this.componentTreeDrawer?.setPinEditable(e)}isPinEditable(){return this.componentTreeDrawer?.isPinEditable()??!0}addRadialToolbarButton(e){this.radialToolbar?.addItem(e)}setRadialToolbarButtonActive(e,t){this.radialToolbar?.setItemActive(e,t)}async loadModelByViewToken(e){if(!this.engine){console.warn("[BimEngine] 3D Engine manager not initialized.");return}await this.engine.loadModelByViewToken(e)}resolveMode(e){if(e!=="auto")return e;const t=typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(pointer: coarse)").matches,n=this.container.clientWidth>0&&this.container.clientWidth<=768;return t||n?"mobile":"desktop"}isDesktopUi(){return this.mode==="desktop"}init(){this.initContainer(),this.initCommonManagers(),this.isDesktopUi()?this.initDesktopUi():this.initMobileUi(),this.bindCommonEvents()}initContainer(){this.container.innerHTML="",this.wrapper=document.createElement("div"),this.wrapper.className=`bim-engine-wrapper bim-engine-wrapper--${this.mode}`,this.container.appendChild(this.wrapper),this.isDesktopUi()&&this.initDesktopStatusUi(),this.updateClientSizeDisplay(),this.bindSizeObserver(),this.registry.container=this.container,this.registry.wrapper=this.wrapper,this.registry.mode=this.mode}initDesktopStatusUi(){if(!this.wrapper)return;const e=document.createElement("div");e.className="bim-engine-footer-info",this.wrapper.appendChild(e);const t=document.createElement("span");t.className="bim-engine-version",t.textContent="v3.9.212",e.appendChild(t),this.uiOptions.showModelInfoStats&&(this.statsEl=document.createElement("span"),this.statsEl.className="bim-engine-stats",e.appendChild(this.statsEl)),this.sizeEl=document.createElement("div"),this.sizeEl.className="bim-engine-size",this.wrapper.appendChild(this.sizeEl)}initCommonManagers(){if(!this.wrapper)throw new Error("[BimEngine] Wrapper not initialized.");this.engine=new _be(this.wrapper,this.registry,{enableRightKeyMenu:this.isDesktopUi()&&this.uiOptions.enableRightKeyMenu}),this.registry.engine3d=this.engine}initDesktopUi(){if(!this.wrapper)throw new Error("[BimEngine] Wrapper not initialized.");this.dialog=new Cye(this.wrapper,this.registry),this.registry.dialog=this.dialog,this.uiOptions.enableRightKeyMenu&&(this.rightKey=new VZ(this.wrapper,this.registry),this.registry.rightKey=this.rightKey),this.bottomDock=new jZ(this.wrapper,this.registry),this.registry.bottomDock=this.bottomDock,this.viewDropdown=new dht(this.wrapper,this.registry),this.registry.viewDropdown=this.viewDropdown,this.helpPanel=new pht(this.wrapper,this.registry),this.registry.helpPanel=this.helpPanel,this.measureDock=new Ebe(this.registry),this.registry.measureDock=this.measureDock,this.measureDock.init(),this.sectionDock=new Sbe(this.registry),this.registry.sectionDock=this.sectionDock,this.sectionDock.init(),this.walkDock=new Tbe(this.registry),this.registry.walkDock=this.walkDock,this.walkDock.init(),this.modelCalibrationDock=new Cbe(this.registry),this.registry.modelCalibrationDock=this.modelCalibrationDock,this.modelCalibrationDock.init(),this.uiOptions.enableConstructTree&&(this.componentTreeDrawer=new Qct(this.registry),this.registry.componentTreeDrawer=this.componentTreeDrawer),this.uiOptions.enableRadialToolbar&&(this.radialToolbar=new vbe(this.wrapper,this.registry),this.registry.radialToolbar=this.radialToolbar),this.measure=new Rbe(this.registry),this.sectionPlane=new Lbe(this.registry),this.sectionAxis=new Obe(this.registry),this.sectionBox=new Bbe(this.registry),this.engineInfo=new Fbe(this.registry),this.engineInfo.init(),this.registry.measure=this.measure,this.registry.sectionPlane=this.sectionPlane,this.registry.sectionAxis=this.sectionAxis,this.registry.sectionBox=this.sectionBox,this.registry.engineInfo=this.engineInfo,this.componentDetail=new Ube(this.registry),this.registry.componentDetail=this.componentDetail,this.componentDetail.init(),this.aiChat=new zbe(this.registry),this.registry.aiChat=this.aiChat,this.aiChat.init(),this.uiOptions.enableConstructTree&&(this.constructTreeBtn=new uht(this.wrapper,this.registry),this.registry.constructTree=this.constructTreeBtn),this.setting=new Pv(this.registry),this.registry.setting=this.setting,this.setting.init()}initMobileUi(){}bindCommonEvents(){this.registry.on("engine:model-loading-completed",()=>{this.updateEngineStats()}),this.updateTheme(qi.getTheme()),qi.subscribe(e=>{this.updateTheme(e)}),dr.subscribe(()=>{this.updateEngineStats()})}updateTheme(e){this.wrapper&&(this.wrapper.style.color=e.textPrimary)}updateClientSizeDisplay(){const e=this.container.clientWidth,t=this.container.clientHeight;this.sizeEl&&(this.sizeEl.textContent=`${e}px x ${t}px`),this.syncEngineSize(e,t)}updateEngineStats(){if(!this.statsEl)return;const e=this.engine?.getEngineComponent?.();if(!e){this.statsEl.textContent="";return}const t=e.getEngineInfo?.();if(console.log("[BimEngine] updateEngineStats info:",t),!t){this.statsEl.textContent="";return}const n=[];t.meshCount!==void 0&&n.push(`${dr.t("info.meshCount")}: ${t.meshCount}`),t.totalTriangles!==void 0&&n.push(`${dr.t("info.totalTriangles")}: ${t.totalTriangles}`),t.totalVertices!==void 0&&n.push(`${dr.t("info.totalVertices")}: ${t.totalVertices}`),this.statsEl.textContent=n.join(" | ")}syncEngineSize(e,t){e<=0||t<=0||e===this.lastSyncedWidth&&t===this.lastSyncedHeight||(this.lastSyncedWidth=e,this.lastSyncedHeight=t,this.engine?.getEngineComponent()?.resize(e,t))}bindSizeObserver(){if(typeof ResizeObserver<"u"){this.resizeObserver=new ResizeObserver(()=>{this.updateClientSizeDisplay()}),this.resizeObserver.observe(this.container);return}window.addEventListener("resize",this.handleWindowResize)}unbindSizeObserver(){if(this.resizeObserver){this.resizeObserver.disconnect(),this.resizeObserver=null;return}window.removeEventListener("resize",this.handleWindowResize)}destroy(){this.unbindSizeObserver(),this.helpPanel?.destroy(),this.viewDropdown?.destroy(),this.radialToolbar?.destroy(),this.measureDock?.destroy(),this.sectionDock?.destroy(),this.walkDock?.destroy(),this.modelCalibrationDock?.destroy(),this.componentTreeDrawer?.destroy(),this.bottomDock?.destroy(),this.engine?.destroy(),this.dialog?.destroy(),this.rightKey?.destroy(),this.measure?.destroy(),this.sectionPlane?.destroy(),this.sectionAxis?.destroy(),this.sectionBox?.destroy(),this.constructTreeBtn?.destroy(),this.aiChat?.destroy(),this.setting?.destroy(),this.sizeEl=null,this.statsEl=null,this.lastSyncedWidth=-1,this.lastSyncedHeight=-1,this.container.innerHTML="",this.registry.reset()}}class ght{container;wrapper=null;sizeEl=null;resizeObserver=null;lastSyncedWidth=-1;lastSyncedHeight=-1;unsubscribeTheme=null;registry;dialog=null;engine=null;rightKey=null;radialToolbar=null;bottomDock=null;measureDock=null;sectionDock=null;walkDock=null;modelCalibrationDock=null;measure=null;sectionPlane=null;sectionAxis=null;sectionBox=null;engineInfo=null;componentDetail=null;aiChat=null;setting=null;handleWindowResize=()=>{this.updateClientSizeDisplay()};constructor(e,t){const n=typeof e=="string"?document.getElementById(e):e;if(!n)throw new Error("Container not found");this.container=n,this.registry=new jI,t?.locale&&dr.setLocale(t.locale),t?.theme&&(t.theme==="custom"?console.warn("Custom theme should be set via setCustomTheme()."):qi.setTheme(t.theme)),this.init()}emit(e,t){this.registry.emit(e,t)}on(e,t){return this.registry.on(e,t)}setLocale(e){dr.setLocale(e)}getLocale(){return dr.getLocale()}setTheme(e){qi.setTheme(e)}setCustomTheme(e){qi.setCustomTheme(e)}async initialize(e){return this.engine?this.engine.initialize(e):(console.warn("[CusBimEngine] 3D Engine manager not initialized."),!1)}loadModel(e,t){this.engine?.loadModel(e,t)}async loadModelByViewToken(e){if(!this.engine){console.warn("[CusBimEngine] 3D Engine manager not initialized.");return}await this.engine.loadModelByViewToken(e)}init(){this.container.innerHTML="",this.wrapper=document.createElement("div"),this.wrapper.className="bim-engine-wrapper",this.container.appendChild(this.wrapper);const e=document.createElement("div");e.className="bim-engine-version",e.textContent="v3.9.212",this.wrapper.appendChild(e),this.sizeEl=document.createElement("div"),this.sizeEl.className="bim-engine-size",this.wrapper.appendChild(this.sizeEl),this.updateClientSizeDisplay(),this.bindSizeObserver(),this.registry.container=this.container,this.registry.wrapper=this.wrapper,this.engine=new _be(this.wrapper,this.registry),this.dialog=new Cye(this.wrapper,this.registry),this.rightKey=new VZ(this.wrapper,this.registry),this.bottomDock=new jZ(this.wrapper,this.registry),this.registry.bottomDock=this.bottomDock,this.registry.engine3d=this.engine,this.registry.dialog=this.dialog,this.registry.rightKey=this.rightKey,this.measureDock=new Ebe(this.registry),this.registry.measureDock=this.measureDock,this.measureDock.init(),this.sectionDock=new Sbe(this.registry),this.registry.sectionDock=this.sectionDock,this.sectionDock.init(),this.walkDock=new Tbe(this.registry),this.registry.walkDock=this.walkDock,this.walkDock.init(),this.modelCalibrationDock=new Cbe(this.registry),this.registry.modelCalibrationDock=this.modelCalibrationDock,this.modelCalibrationDock.init(),this.radialToolbar=new vbe(this.wrapper,this.registry),this.measure=new Rbe(this.registry),this.sectionPlane=new Lbe(this.registry),this.sectionAxis=new Obe(this.registry),this.sectionBox=new Bbe(this.registry),this.engineInfo=new Fbe(this.registry),this.engineInfo.init(),this.registry.radialToolbar=this.radialToolbar,this.registry.measure=this.measure,this.registry.sectionPlane=this.sectionPlane,this.registry.sectionAxis=this.sectionAxis,this.registry.sectionBox=this.sectionBox,this.registry.engineInfo=this.engineInfo,this.componentDetail=new Ube(this.registry),this.registry.componentDetail=this.componentDetail,this.componentDetail.init(),this.aiChat=new zbe(this.registry),this.registry.aiChat=this.aiChat,this.aiChat.init(),this.setting=new Pv(this.registry),this.registry.setting=this.setting,this.setting.init(),this.updateTheme(qi.getTheme()),this.unsubscribeTheme=qi.subscribe(t=>{this.updateTheme(t)})}updateTheme(e){this.wrapper&&(this.wrapper.style.color=e.textPrimary)}updateClientSizeDisplay(){const e=this.container.clientWidth,t=this.container.clientHeight;this.sizeEl&&(this.sizeEl.textContent=`${e}px x ${t}px`),this.syncEngineSize(e,t)}syncEngineSize(e,t){e<=0||t<=0||e===this.lastSyncedWidth&&t===this.lastSyncedHeight||(this.lastSyncedWidth=e,this.lastSyncedHeight=t,this.engine?.getEngineComponent()?.resize(e,t))}bindSizeObserver(){if(typeof ResizeObserver<"u"){this.resizeObserver=new ResizeObserver(()=>{this.updateClientSizeDisplay()}),this.resizeObserver.observe(this.container);return}window.addEventListener("resize",this.handleWindowResize)}unbindSizeObserver(){if(this.resizeObserver){this.resizeObserver.disconnect(),this.resizeObserver=null;return}window.removeEventListener("resize",this.handleWindowResize)}destroy(){this.unbindSizeObserver(),this.unsubscribeTheme&&(this.unsubscribeTheme(),this.unsubscribeTheme=null),this.radialToolbar?.destroy(),this.measureDock?.destroy(),this.sectionDock?.destroy(),this.walkDock?.destroy(),this.modelCalibrationDock?.destroy(),this.bottomDock?.destroy(),this.engine?.destroy(),this.dialog?.destroy(),this.rightKey?.destroy(),this.measure?.destroy(),this.sectionPlane?.destroy(),this.sectionAxis?.destroy(),this.sectionBox?.destroy(),this.aiChat?.destroy(),this.setting?.destroy(),this.sizeEl=null,this.lastSyncedWidth=-1,this.lastSyncedHeight=-1,this.container.innerHTML="",this.registry.reset()}}const _ht=[{action:"search",dividerBefore:!0},{action:"hideElement",dividerBefore:!0},{action:"showAll"},{action:"hideLayer"},{action:"showAllLayers"},{action:"layerManage"},{action:"toggleBg",dividerBefore:!0},{action:"linkElement2d3d",visible:!0},{action:"linkView2d3d",visible:!0}],yht={search:"engine2d.contextMenu.search",hideElement:"engine2d.contextMenu.hideElement",showAll:"engine2d.contextMenu.showAll",hideLayer:"engine2d.contextMenu.hideLayer",showAllLayers:"engine2d.contextMenu.showAllLayers",layerManage:"engine2d.contextMenu.layerManage",toggleBg:"engine2d.contextMenu.toggleBg",linkElement2d3d:"engine2d.contextMenu.linkElement2d3d",linkView2d3d:"engine2d.contextMenu.linkView2d3d"};function vht(i){const e=yht[i.action];return{...i,label:i.label??(e?At(e):i.action)}}function bht(i){return{...i,items:(i?.items??_ht).map(vht)}}class Aht{engine=null;registry;container;containerId;options;_isInitialized=!1;_isDestroyed=!1;initPromise=null;unsubscribeTheme=null;viewDropdown=null;constructor(e,t){this.registry=t,this.container=e.container,this.container.id?this.containerId=this.container.id:(this.containerId=`engine2d-container-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,this.container.id=this.containerId),this.options={backgroundColor:e.backgroundColor??1710618,gridEnabled:e.gridEnabled??!0,axesEnabled:e.axesEnabled??!0,selectionColor:e.selectionColor,highlightColor:e.highlightColor,enablePerformanceMonitoring:e.enablePerformanceMonitoring??!1,cursorStyle:e.cursorStyle??"full-crosshair",loadingStyle:e.loadingStyle??1,showMouseCoordinates:e.showMouseCoordinates??!0,contextMenu:e.contextMenu}}async init(){if(this._isInitialized){console.warn("[Engine2d] Engine already initialized.");return}if(this.initPromise)return this.initPromise;if(this._isDestroyed){console.error("[Engine2d] Cannot initialize destroyed engine.");return}try{const e={containerId:this.containerId,backgroundColor:this.options.backgroundColor,gridEnabled:this.options.gridEnabled,axesEnabled:this.options.axesEnabled,enablePerformanceMonitoring:this.options.enablePerformanceMonitoring,cursorStyle:this.options.cursorStyle,loadingStyle:this.options.loadingStyle,showMouseCoordinates:this.options.showMouseCoordinates,contextMenu:bht(this.options.contextMenu),sdkAuth:iO};if(this.options.selectionColor!==void 0&&(e.selectionColor=this.options.selectionColor),this.options.highlightColor!==void 0&&(e.highlightColor=this.options.highlightColor),console.log("[Engine2d] 引擎配置信息:",e),this.initPromise=(async()=>{const t=await dct(e);if(!t)throw new Error("Failed to create 2D engine instance");if(this._isDestroyed){t.dispose?.();return}this.engine=t,this._isInitialized=!0})(),await this.initPromise,this._isDestroyed||!this.engine)return;this.unsubscribeTheme=qi.subscribe(t=>{this.setTheme(t)}),this.setTheme(qi.getTheme()),this.engine.events&&(this.engine.events.on("entity-click",t=>{console.log("[Engine2d] 实体点击:",t),this.registry.emit("engine2d:entity-clicked",{data:t})}),this.engine.events.on("layer-visibility-changed",t=>{console.log("[Engine2d] 图层可见性变更:",t),this.registry.emit("engine2d:layer-changed",{data:t})})),this.initViewDropdown()}catch(e){throw console.error("[Engine2d] Failed to initialize 2D engine:",e),this._isInitialized=!1,e}finally{this.initPromise=null}}setTheme(e){}setLocales(){}isInitialized(){return this._isInitialized}async loadDrawing(e,t){if(!this._isInitialized||!this.engine){console.error("[Engine2d] Engine not initialized. Please call init() first.");return}if(!e){console.error("[Engine2d] Drawing URL is required.");return}try{console.log("[Engine2d] 开始加载图纸:",e),await this.engine.loadModel(e,t),console.log("[Engine2d] 图纸加载完成:",e),this.registry.emit("engine2d:drawing-loaded",{url:e})}catch(n){throw console.error("[Engine2d] 图纸加载失败:",n),n}}async loadModelByViewToken(e){if(!this._isInitialized||!this.engine){console.error("[Engine2d] Engine not initialized. Please call init() first.");return}await this.engine.loadModelByViewToken(e)}getLayers(){if(!this._isInitialized||!this.engine)return[];try{return this.engine.getLayers?.()??[]}catch(e){return console.warn("[Engine2d] Failed to get layers:",e),[]}}setLayerVisible(e,t){if(!this._isInitialized||!this.engine){console.warn("[Engine2d] Engine not initialized.");return}try{this.engine.setLayerVisible?.(e,t)}catch(n){console.warn("[Engine2d] Failed to set layer visibility:",n)}}getRawLabel(e){const t=this.engine?.label;return!t||typeof t[e]!="function"?(console.warn(`[Engine2d] label.${e} not available.`),null):t}pickPoint(){return this.getRawLabel("pickPoint")?.pickPoint?.()??Promise.resolve(null)}startPickPoint(e){return this.getRawLabel("startPickPoint")?.startPickPoint?.(e)??Promise.resolve(null)}createLabel(e){return this.getRawLabel("createLabel")?.createLabel?.(e)}createLabels(e,t){t?.clearExisting&&this.clearLabels();const n=this.getRawLabel("createLabel");return n?.createLabel?e.map(r=>n.createLabel(r)).filter(r=>typeof r=="string"&&r.length>0):[]}updateLabel(e,t){return this.getRawLabel("updateLabel")?.updateLabel?.(e,t)??!1}deleteLabel(e){return this.getRawLabel("deleteLabel")?.deleteLabel?.(e)??!1}removeLabel(e){return this.getRawLabel("removeLabel")?.removeLabel?.(e)??!1}clearLabels(){this.getRawLabel("clearLabels")?.clearLabels?.()}getLabel(e){return this.getRawLabel("getLabel")?.getLabel?.(e)}getLabels(){return this.getRawLabel("getLabels")?.getLabels?.()??[]}onLabelClick(e){return this.getRawLabel("onLabelClick")?.onLabelClick?.(e)??(()=>{})}offLabelClick(e){this.getRawLabel("offLabelClick")?.offLabelClick?.(e)}resetView(){if(!(!this._isInitialized||!this.engine))try{this.engine.resetView?.()}catch(e){console.warn("[Engine2d] Failed to reset view:",e)}}fitToView(){if(!(!this._isInitialized||!this.engine))try{this.engine.fitToView?.()}catch(e){console.warn("[Engine2d] Failed to fit to view:",e)}}setZoom(e){!this._isInitialized||!this.engine||this.engine.setZoom?.(e)}getZoom(){return!this._isInitialized||!this.engine?1:this.engine.getZoom?.()??1}saveMainViewPort(){return!this._isInitialized||!this.engine?.viewCube?.saveMainViewPort?(console.warn("[Engine2d] viewCube.saveMainViewPort not available."),null):this.engine.viewCube.saveMainViewPort()??null}setMainViewPort(e){if(!this._isInitialized||!this.engine?.viewCube?.setMainViewPort){console.warn("[Engine2d] viewCube.setMainViewPort not available.");return}this.engine.viewCube.setMainViewPort(e)}goToMainPort(){if(!this._isInitialized||!this.engine?.viewCube?.goToMainPort){console.warn("[Engine2d] viewCube.goToMainPort not available.");return}this.engine.viewCube.goToMainPort()}resetMainViewPort(){if(!this._isInitialized||!this.engine?.viewCube?.resetMainViewPort){console.warn("[Engine2d] viewCube.resetMainViewPort not available.");return}this.engine.viewCube.resetMainViewPort()}initViewDropdown(){this.viewDropdown?.destroy(),this.viewDropdown=new YZ({container:this.container,triggerClassName:"engine-view-dropdown-trigger--top-right",items:[{key:"saveMainView",labelKey:"viewDropdown.saveMainView",action:()=>{const e=this.saveMainViewPort();this.registry.emit("view:main-view-saved",{viewData:e})}},{key:"restoreMainView",labelKey:"viewDropdown.restoreMainView",action:()=>{this.resetMainViewPort(),this.registry.emit("view:main-view-restored",{})}}]}),this.viewDropdown.init()}setBackgroundColor(e){!this._isInitialized||!this.engine||this.engine.setBackgroundColor?.(e)}clearScene(){!this._isInitialized||!this.engine||this.engine.clearScene?.()}resize(){!this._isInitialized||!this.engine||this.engine.resize?.()}onRawEvent(e,t){this.engine?.events?.on(e,t)}offRawEvent(e,t){this.engine?.events?.off(e,t)}destroy(){if(!this._isDestroyed){if(this.unsubscribeTheme&&(this.unsubscribeTheme(),this.unsubscribeTheme=null),this.viewDropdown?.destroy(),this.viewDropdown=null,this.engine){try{this.engine.dispose?.()}catch(e){console.warn("[Engine2d] Error during dispose:",e)}this.engine=null}this.container.innerHTML="",this.initPromise=null,this._isDestroyed=!0,this._isInitialized=!1}}}class xht extends Mc{container;engineInstance=null;constructor(e,t){super(t),this.container=e}getEngine2dComponent(){return this.engineInstance}async initialize(e){this.engineInstance&&this.engineInstance.isInitialized()&&(console.warn("[Engine2dManager] 2D Engine already initialized. Destroying old instance..."),this.engineInstance.destroy(),this.engineInstance=null);try{const t=new Aht({container:this.container,...e},this.registry);return this.engineInstance=t,await t.init(),this.engineInstance===t&&t.isInitialized()}catch(t){return console.error("[Engine2dManager] Failed to initialize 2D engine:",t),this.engineInstance=null,!1}}isInitialized(){return this.engineInstance!==null&&this.engineInstance.isInitialized()}async loadDrawing(e,t){if(!this.engineInstance){console.warn("[Engine2dManager] 2D Engine not initialized.");return}await this.engineInstance.loadDrawing(e,t)}async loadModelByViewToken(e){if(!this.engineInstance){console.warn("[Engine2dManager] 2D Engine not initialized.");return}await this.engineInstance.loadModelByViewToken(e)}getLayers(){return this.engineInstance?this.engineInstance.getLayers():[]}setLayerVisible(e,t){if(!this.engineInstance){console.warn("[Engine2dManager] 2D Engine not initialized.");return}this.engineInstance.setLayerVisible(e,t)}pickPoint(){return this.engineInstance?this.engineInstance.pickPoint():(console.warn("[Engine2dManager] 2D Engine not initialized."),Promise.resolve(null))}startPickPoint(e){return this.engineInstance?this.engineInstance.startPickPoint(e):(console.warn("[Engine2dManager] 2D Engine not initialized."),Promise.resolve(null))}createLabel(e){if(!this.engineInstance){console.warn("[Engine2dManager] 2D Engine not initialized.");return}return this.engineInstance.createLabel(e)}createLabels(e,t){return this.engineInstance?this.engineInstance.createLabels(e,t):(console.warn("[Engine2dManager] 2D Engine not initialized."),[])}updateLabel(e,t){return this.engineInstance?this.engineInstance.updateLabel(e,t):(console.warn("[Engine2dManager] 2D Engine not initialized."),!1)}deleteLabel(e){return this.engineInstance?this.engineInstance.deleteLabel(e):(console.warn("[Engine2dManager] 2D Engine not initialized."),!1)}removeLabel(e){return this.engineInstance?this.engineInstance.removeLabel(e):(console.warn("[Engine2dManager] 2D Engine not initialized."),!1)}clearLabels(){if(!this.engineInstance){console.warn("[Engine2dManager] 2D Engine not initialized.");return}this.engineInstance.clearLabels()}getLabel(e){if(!this.engineInstance){console.warn("[Engine2dManager] 2D Engine not initialized.");return}return this.engineInstance.getLabel(e)}getLabels(){return this.engineInstance?this.engineInstance.getLabels():(console.warn("[Engine2dManager] 2D Engine not initialized."),[])}onLabelClick(e){return this.engineInstance?this.engineInstance.onLabelClick(e):(console.warn("[Engine2dManager] 2D Engine not initialized."),()=>{})}offLabelClick(e){if(!this.engineInstance){console.warn("[Engine2dManager] 2D Engine not initialized.");return}this.engineInstance.offLabelClick(e)}resetView(){this.engineInstance?.resetView()}fitToView(){this.engineInstance?.fitToView()}setZoom(e){this.engineInstance?.setZoom(e)}getZoom(){return this.engineInstance?.getZoom()??1}saveMainViewPort(){return this.engineInstance?this.engineInstance.saveMainViewPort():(console.warn("[Engine2dManager] 2D Engine not initialized."),null)}setMainViewPort(e){if(!this.engineInstance){console.warn("[Engine2dManager] 2D Engine not initialized.");return}this.engineInstance.setMainViewPort(e)}goToMainPort(){if(!this.engineInstance){console.warn("[Engine2dManager] 2D Engine not initialized.");return}this.engineInstance.goToMainPort()}resetMainViewPort(){if(!this.engineInstance){console.warn("[Engine2dManager] 2D Engine not initialized.");return}this.engineInstance.resetMainViewPort()}resize(){this.engineInstance?.resize()}onRawEvent(e,t){this.engineInstance?.onRawEvent(e,t)}offRawEvent(e,t){this.engineInstance?.offRawEvent(e,t)}destroy(){this.engineInstance&&(this.engineInstance.destroy(),this.engineInstance=null),super.destroy()}}class wht{container;registry;resizeObserver=null;lastSyncedWidth=-1;lastSyncedHeight=-1;engine=null;ready;handleWindowResize=()=>{this.syncEngineSize()};constructor(e,t){const n=typeof e=="string"?document.getElementById(e):e;if(!n)throw new Error("Container not found");this.container=n,this.registry=new jI,t?.locale&&dr.setLocale(t.locale),t?.theme&&t.theme!=="custom"&&qi.setTheme(t.theme),this.engine=new xht(this.container,this.registry),this.registry.engine2d=this.engine,this.ready=this.engine.initialize({backgroundColor:t?.backgroundColor,gridEnabled:t?.gridEnabled,axesEnabled:t?.axesEnabled,selectionColor:t?.selectionColor,highlightColor:t?.highlightColor,enablePerformanceMonitoring:t?.enablePerformanceMonitoring,cursorStyle:t?.cursorStyle,loadingStyle:t?.loadingStyle,showMouseCoordinates:t?.showMouseCoordinates,contextMenu:t?.contextMenu}),this.bindSizeObserver(),this.syncEngineSize(!0)}async loadDrawing(e,t){return await this.ready,this.engine?.loadDrawing(e,t)}async loadModelByViewToken(e){return await this.ready,this.engine?.loadModelByViewToken(e)}getLayers(){return this.engine?.getLayers()??[]}setLayerVisible(e,t){this.engine?.setLayerVisible(e,t)}pickPoint(){return this.engine?.pickPoint()??Promise.resolve(null)}startPickPoint(e){return this.engine?.startPickPoint(e)??Promise.resolve(null)}createLabel(e){return this.engine?.createLabel(e)}createLabels(e,t){return this.engine?.createLabels(e,t)??[]}updateLabel(e,t){return this.engine?.updateLabel(e,t)??!1}deleteLabel(e){return this.engine?.deleteLabel(e)??!1}removeLabel(e){return this.engine?.removeLabel(e)??!1}clearLabels(){this.engine?.clearLabels()}getLabel(e){return this.engine?.getLabel(e)}getLabels(){return this.engine?.getLabels()??[]}onLabelClick(e){return this.engine?.onLabelClick(e)??(()=>{})}offLabelClick(e){this.engine?.offLabelClick(e)}resetView(){this.engine?.resetView()}fitToView(){this.engine?.fitToView()}setZoom(e){this.engine?.setZoom(e)}getZoom(){return this.engine?.getZoom()??1}saveMainViewPort(){return this.engine?.saveMainViewPort()??null}setMainViewPort(e){this.engine?.setMainViewPort(e)}goToMainPort(){this.engine?.goToMainPort()}resetMainViewPort(){this.engine?.resetMainViewPort()}resize(){this.syncEngineSize(!0)}setTheme(e){qi.setTheme(e)}on(e,t){return this.registry.on(e,t)}off(e,t){this.registry.off(e,t)}onRawEvent(e,t){this.engine?.onRawEvent(e,t)}offRawEvent(e,t){this.engine?.offRawEvent(e,t)}syncEngineSize(e=!1){const t=this.container.clientWidth,n=this.container.clientHeight;t<=0||n<=0||!e&&t===this.lastSyncedWidth&&n===this.lastSyncedHeight||(this.lastSyncedWidth=t,this.lastSyncedHeight=n,this.engine?.resize())}bindSizeObserver(){if(typeof ResizeObserver<"u"){this.resizeObserver=new ResizeObserver(()=>{this.syncEngineSize()}),this.resizeObserver.observe(this.container);return}window.addEventListener("resize",this.handleWindowResize)}unbindSizeObserver(){if(this.resizeObserver){this.resizeObserver.disconnect(),this.resizeObserver=null;return}window.removeEventListener("resize",this.handleWindowResize)}destroy(){this.unbindSizeObserver(),this.engine?.destroy(),this.engine=null,this.registry.reset()}}class Eht{engine=null;registry;container;containerId;options;_isInitialized=!1;_isDestroyed=!1;initPromise=null;unsubscribeTheme=null;constructor(e,t){this.registry=t,this.container=e.container,this.container.id?this.containerId=this.container.id:(this.containerId=`engine720-container-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,this.container.id=this.containerId),this.options={fov:e.fov??75,enableZoom:e.enableZoom??!0,enableRotate:e.enableRotate??!0,sphereRadius:e.sphereRadius??500,rotateSpeed:e.rotateSpeed,zoomSpeed:e.zoomSpeed,enableDamping:e.enableDamping,dampingFactor:e.dampingFactor,minFov:e.minFov,maxFov:e.maxFov}}async init(){if(this._isInitialized){console.warn("[Engine720] Engine already initialized.");return}if(this.initPromise)return this.initPromise;if(this._isDestroyed){console.error("[Engine720] Cannot initialize destroyed engine.");return}try{const e={containerId:this.containerId,fov:this.options.fov,enableZoom:this.options.enableZoom,enableRotate:this.options.enableRotate,sphereRadius:this.options.sphereRadius,sdkAuth:iO};if(this.options.rotateSpeed!==void 0&&(e.rotateSpeed=this.options.rotateSpeed),this.options.zoomSpeed!==void 0&&(e.zoomSpeed=this.options.zoomSpeed),this.options.enableDamping!==void 0&&(e.enableDamping=this.options.enableDamping),this.options.dampingFactor!==void 0&&(e.dampingFactor=this.options.dampingFactor),this.options.minFov!==void 0&&(e.minFov=this.options.minFov),this.options.maxFov!==void 0&&(e.maxFov=this.options.maxFov),console.log("[Engine720] 引擎配置信息:",e),this.initPromise=(async()=>{const t=await pct(e);if(!t)throw new Error("Failed to create 720 engine instance");if(this._isDestroyed){t.dispose?.();return}this.engine=t,this._isInitialized=!0})(),await this.initPromise,this._isDestroyed||!this.engine)return;this.unsubscribeTheme=qi.subscribe(t=>{this.setTheme(t)}),this.setTheme(qi.getTheme()),this.engine.events&&(this.engine.events.on("panorama-loaded",t=>{console.log("[Engine720] 全景加载完成:",t),this.registry.emit("engine720:panorama-loaded",{data:t})}),this.engine.events.on("panorama-load-error",t=>{console.error("[Engine720] 全景加载失败:",t),this.registry.emit("engine720:load-error",{data:t})}),this.engine.events.on("annotation-click",t=>{console.log("[Engine720] 标注点击:",t),this.registry.emit("engine720:annotation-click",{data:t})}),this.engine.events.on("view-angle-changed",t=>{this.registry.emit("engine720:view-changed",{data:t})}))}catch(e){throw console.error("[Engine720] Failed to initialize 720 engine:",e),this._isInitialized=!1,e}finally{this.initPromise=null}}setTheme(e){!this._isInitialized||this.engine}setLocales(){}isInitialized(){return this._isInitialized}async loadPanorama(e,t){if(!this._isInitialized||!this.engine){console.error("[Engine720] Engine not initialized. Please call init() first.");return}if(!e){console.error("[Engine720] Panorama URL is required.");return}try{console.log("[Engine720] 开始加载全景图:",e),await this.engine.loadPanorama(e),console.log("[Engine720] 全景图加载完成:",e)}catch(n){throw console.error("[Engine720] 全景图加载失败:",n),n}}async loadModelByViewToken(e){if(!this._isInitialized||!this.engine){console.error("[Engine720] Engine not initialized. Please call init() first.");return}await this.engine.loadModelByViewToken(e)}async preloadPanoramas(e){if(!(!this._isInitialized||!this.engine))try{await this.engine.preloadPanoramas?.(e)}catch(t){console.warn("[Engine720] Failed to preload panoramas:",t)}}setFov(e){!this._isInitialized||!this.engine||this.engine.setFov?.(e)}getFov(){return!this._isInitialized||!this.engine?75:this.engine.getFov?.()??75}lookAt(e,t,n){!this._isInitialized||!this.engine||this.engine.lookAt?.(e,t,n)}resetView(){if(!(!this._isInitialized||!this.engine))try{this.engine.lookAt?.(0,0,!0),this.engine.setFov?.(75)}catch(e){console.warn("[Engine720] Failed to reset view:",e)}}pauseRendering(){!this._isInitialized||!this.engine||this.engine.pauseRendering?.()}resumeRendering(){!this._isInitialized||!this.engine||this.engine.resumeRendering?.()}resize(e,t){!this._isInitialized||!this.engine||this.engine.resize?.(e,t)}onRawEvent(e,t){this.engine?.events?.on(e,t)}offRawEvent(e,t){this.engine?.events?.off(e,t)}destroy(){if(!this._isDestroyed){if(this.unsubscribeTheme&&(this.unsubscribeTheme(),this.unsubscribeTheme=null),this.engine){try{this.engine.dispose?.()}catch(e){console.warn("[Engine720] Error during dispose:",e)}this.engine=null}this.container.innerHTML="",this.initPromise=null,this._isDestroyed=!0,this._isInitialized=!1}}}class Sht{container;registry;engineComponent=null;ready;constructor(e,t){const n=typeof e=="string"?document.getElementById(e):e;if(!n)throw new Error("Container not found");this.container=n,this.registry=new jI,t?.locale&&dr.setLocale(t.locale),t?.theme&&t.theme!=="custom"&&qi.setTheme(t.theme),this.engineComponent=new Eht({container:this.container,fov:t?.fov,enableZoom:t?.enableZoom,enableRotate:t?.enableRotate,sphereRadius:t?.sphereRadius,rotateSpeed:t?.rotateSpeed,zoomSpeed:t?.zoomSpeed,enableDamping:t?.enableDamping,dampingFactor:t?.dampingFactor,minFov:t?.minFov,maxFov:t?.maxFov},this.registry),this.ready=this.engineComponent.init()}async loadPanorama(e,t){return await this.ready,this.engineComponent?.loadPanorama(e,t)}async loadModelByViewToken(e){return await this.ready,this.engineComponent?.loadModelByViewToken(e)}async preloadPanoramas(e){return await this.ready,this.engineComponent?.preloadPanoramas(e)}setFov(e){this.engineComponent?.setFov(e)}getFov(){return this.engineComponent?.getFov()??75}lookAt(e,t,n){this.engineComponent?.lookAt(e,t,n)}resetView(){this.engineComponent?.resetView()}setTheme(e){qi.setTheme(e)}on(e,t){return this.registry.on(e,t)}off(e,t){this.registry.off(e,t)}onRawEvent(e,t){this.engineComponent?.onRawEvent(e,t)}offRawEvent(e,t){this.engineComponent?.offRawEvent(e,t)}destroy(){this.engineComponent?.destroy(),this.engineComponent=null,this.registry.reset()}}const Tht="cesium",Cht={show:!0,flyTo:!0,maximumScreenSpaceError:16,dynamicScreenSpaceError:!0,tilesetOptions:{}},Mht=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];class Iht{engine=null;registry;container;containerId;options;_isInitialized=!1;_isDestroyed=!1;initPromise=null;calibrationItems=new Map;viewDropdown=null;constructor(e,t){this.registry=t,this.container=e.container,this.container.id?this.containerId=this.container.id:(this.containerId=`engine-gis-container-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,this.container.id=this.containerId),this.options={imageryUrl:e.imageryUrl,initialView:e.initialView,showCredit:e.showCredit,showStats:e.showStats}}async init(){if(this._isInitialized){console.warn("[EngineGis] GIS Engine already initialized.");return}if(this.initPromise)return this.initPromise;if(this._isDestroyed){console.error("[EngineGis] Cannot initialize destroyed engine.");return}const e={containerId:this.containerId,provider:Tht,imageryUrl:this.options.imageryUrl,initialView:this.options.initialView,showCredit:this.options.showCredit,showStats:this.options.showStats,sdkAuth:iO};Object.keys(e).forEach(t=>{e[t]===void 0&&delete e[t]}),console.log("[EngineGis] 最终传给底层 createEngineGIS 的参数:",e),this.initPromise=(async()=>{const t=await fct(e);if(!t)throw new Error("[EngineGis] Failed to create GIS engine instance.");if(this._isDestroyed){t.dispose();return}this.engine=t,this._isInitialized=!0,this.initViewDropdown(),this.registry})();try{await this.initPromise}finally{this.initPromise=null}}setTheme(e){}setLocales(){}isInitialized(){return this._isInitialized}getRawLabel(e){const t=this.engine?.label;return!this._isInitialized||!t||typeof t[e]!="function"?(console.warn(`[EngineGis] label.${e} not available.`),null):t}pickPoint(){return this.getRawLabel("pickPoint")?.pickPoint?.()??Promise.resolve(null)}startPickPoint(e){return this.getRawLabel("startPickPoint")?.startPickPoint?.(e)??Promise.resolve(null)}createLabel(e){return this.getRawLabel("createLabel")?.createLabel?.(e)}createLabels(e,t){t?.clearExisting&&this.clearLabels();const n=this.getRawLabel("createLabel");return n?.createLabel?e.map(r=>n.createLabel(r)).filter(r=>typeof r=="string"&&r.length>0):[]}updateLabel(e,t){return this.getRawLabel("updateLabel")?.updateLabel?.(e,t)??!1}deleteLabel(e){return this.getRawLabel("deleteLabel")?.deleteLabel?.(e)??!1}removeLabel(e){return this.getRawLabel("removeLabel")?.removeLabel?.(e)??!1}clearLabels(){this.getRawLabel("clearLabels")?.clearLabels?.()}getLabel(e){return this.getRawLabel("getLabel")?.getLabel?.(e)}getLabels(){return this.getRawLabel("getLabels")?.getLabels?.()??[]}onLabelClick(e){return this.getRawLabel("onLabelClick")?.onLabelClick?.(e)??(()=>{})}offLabelClick(e){this.getRawLabel("offLabelClick")?.offLabelClick?.(e)}saveMainViewPort(){return!this._isInitialized||!this.engine?.viewCube?.saveMainViewPort?(console.warn("[EngineGis] viewCube.saveMainViewPort not available."),null):this.engine.viewCube.saveMainViewPort()??null}setMainViewPort(e){if(!this._isInitialized||!this.engine?.viewCube?.setMainViewPort){console.warn("[EngineGis] viewCube.setMainViewPort not available.");return}this.engine.viewCube.setMainViewPort(e)}goToMainPort(){if(!this._isInitialized||!this.engine?.viewCube?.goToMainPort){console.warn("[EngineGis] viewCube.goToMainPort not available.");return}this.engine.viewCube.goToMainPort()}resetMainViewPort(){if(!this._isInitialized||!this.engine?.viewCube?.resetMainViewPort){console.warn("[EngineGis] viewCube.resetMainViewPort not available.");return}this.engine.viewCube.resetMainViewPort()}initViewDropdown(){this.viewDropdown?.destroy(),this.viewDropdown=new YZ({container:this.container,triggerClassName:"engine-view-dropdown-trigger--top-right",items:[{key:"saveMainView",labelKey:"viewDropdown.saveMainView",action:()=>{const e=this.saveMainViewPort();this.registry.emit("view:main-view-saved",{viewData:e})}},{key:"restoreMainView",labelKey:"viewDropdown.restoreMainView",action:()=>{this.resetMainViewPort(),this.registry.emit("view:main-view-restored",{})}},{key:"modelCalibration",labelKey:"viewDropdown.modelCalibration",action:()=>{this.registry.bottomDock?.toggle("gisModelCalibration")}}]}),this.viewDropdown.init()}async load3DTiles(e){if(!this._isInitialized||!this.engine)return console.warn("[EngineGis] GIS Engine not initialized."),null;if(!e?.url)return console.warn("[EngineGis] 3D Tiles url is required."),null;const t={...Cht,id:e.id,name:e.name,url:e.url,offset:e.offset,rotationUnit:e.rotationUnit};Object.keys(t).forEach(r=>{t[r]===void 0&&delete t[r]}),console.log("[EngineGis] 最终传给底层 load3DTiles 的参数:",t);const n=await this.engine.load3DTiles(t);return this.record3DTilesCalibrationItem(n),this.registry.emit("gis:model-loaded",{id:n.id,name:n.name,url:n.source||e.url,source:n.source}),n}async loadModelByViewToken(e){if(!this._isInitialized||!this.engine)return console.warn("[EngineGis] GIS Engine not initialized."),null;const t=await this.engine.loadModelByViewToken(e);return this.record3DTilesCalibrationItem(t),this.registry.emit("gis:model-loaded",{id:t.id,name:t.name,url:t.source??"",source:t.source}),t}getModelCalibrationItems(){return Array.from(this.calibrationItems.values()).map(e=>this.cloneCalibrationItem(e))}setModelCalibrationTransform(e){if(!this._isInitialized||!this.engine)return console.warn("[EngineGis] Cannot set GIS calibration: engine not initialized."),!1;const t=this.calibrationItems.get(e.id);if(!t)return console.warn("[EngineGis] Cannot set GIS calibration: model not found.",e.id),!1;const n=this.normalizeOffset(e.offset),r=this.normalizeRotation(e.rotation),s=this.engine.applyCalibration({url:t.url,matrix:t.baseMatrix,offset:[n.east,n.north,n.up,r.heading,r.pitch,r.roll],rotationUnit:"degrees"});if(s){const o={...t,offset:n,rotation:r,rotationUnit:"degrees"};this.calibrationItems.set(t.id,o),this.emitGisCalibrationChanged(o,"apply")}return s}resetModelCalibration(e){if(!this._isInitialized||!this.engine)return console.warn("[EngineGis] Cannot reset GIS calibration: engine not initialized."),!1;const t=this.calibrationItems.get(e);if(!t)return console.warn("[EngineGis] Cannot reset GIS calibration: model not found.",e),!1;const n=this.engine.applyCalibration({url:t.url,matrix:t.baseMatrix});if(n){const r={...t,offset:this.createZeroOffset(),rotation:this.createZeroRotation(),rotationUnit:"degrees"};this.calibrationItems.set(t.id,r),this.emitGisCalibrationChanged(r,"reset")}return n}destroy(){this.viewDropdown?.destroy(),this.viewDropdown=null,this.engine&&(this.engine.dispose(),this.engine=null),this.calibrationItems.clear(),this._isInitialized=!1,this._isDestroyed=!0,this.initPromise=null}record3DTilesCalibrationItem(e){if(e.type!=="3dtiles")return;const t=e.source||"";if(!t){console.warn("[EngineGis] GIS 3D Tiles model source is empty, skip calibration record.",e);return}const n=this.extractModelMatrix(e)??[...Mht];this.calibrationItems.set(e.id,{id:e.id,name:e.name||e.id,url:t,source:e.source,type:"3dtiles",offset:this.createZeroOffset(),rotation:this.createZeroRotation(),rotationUnit:"degrees",baseMatrix:n})}extractModelMatrix(e){const n=(e.primitive??e.raw)?.modelMatrix;if(!n)return null;const r=Array.from({length:16},(s,o)=>Number(n[o]));return r.every(Number.isFinite)?r:null}cloneCalibrationItem(e){return{...e,offset:{...e.offset},rotation:{...e.rotation},baseMatrix:[...e.baseMatrix]}}emitGisCalibrationChanged(e,t){const n={...this.cloneCalibrationItem(e),action:t,timestamp:Date.now()};this.registry.emit("gis:calibration:changed",n)}createZeroOffset(){return{east:0,north:0,up:0}}createZeroRotation(){return{heading:0,pitch:0,roll:0}}normalizeOffset(e){return{east:this.normalizeNumber(e?.east),north:this.normalizeNumber(e?.north),up:this.normalizeNumber(e?.up)}}normalizeRotation(e){return{heading:this.normalizeNumber(e?.heading),pitch:this.normalizeNumber(e?.pitch),roll:this.normalizeNumber(e?.roll)}}normalizeNumber(e){const t=Number(e);if(!Number.isFinite(t))return 0;const n=Math.abs(t)<1e-10?0:Number(t.toFixed(6));return Object.is(n,-0)?0:n}}class Pht extends Mc{container;engineInstance=null;constructor(e,t){super(t),this.container=e}async initialize(e){this.engineInstance&&this.engineInstance.isInitialized()&&(console.warn("[EngineGisManager] GIS Engine already initialized. Destroying old instance..."),this.engineInstance.destroy(),this.engineInstance=null);try{const t=new Iht({container:this.container,...e},this.registry);return this.engineInstance=t,await t.init(),this.engineInstance===t&&t.isInitialized()}catch(t){return console.error("[EngineGisManager] Failed to initialize GIS engine:",t),this.engineInstance=null,!1}}isInitialized(){return this.engineInstance!==null&&this.engineInstance.isInitialized()}pickPoint(){return this.engineInstance?this.engineInstance.pickPoint():(console.warn("[EngineGisManager] GIS Engine not initialized."),Promise.resolve(null))}startPickPoint(e){return this.engineInstance?this.engineInstance.startPickPoint(e):(console.warn("[EngineGisManager] GIS Engine not initialized."),Promise.resolve(null))}createLabel(e){if(!this.engineInstance){console.warn("[EngineGisManager] GIS Engine not initialized.");return}return this.engineInstance.createLabel(e)}createLabels(e,t){return this.engineInstance?this.engineInstance.createLabels(e,t):(console.warn("[EngineGisManager] GIS Engine not initialized."),[])}updateLabel(e,t){return this.engineInstance?this.engineInstance.updateLabel(e,t):(console.warn("[EngineGisManager] GIS Engine not initialized."),!1)}deleteLabel(e){return this.engineInstance?this.engineInstance.deleteLabel(e):(console.warn("[EngineGisManager] GIS Engine not initialized."),!1)}removeLabel(e){return this.engineInstance?this.engineInstance.removeLabel(e):(console.warn("[EngineGisManager] GIS Engine not initialized."),!1)}clearLabels(){if(!this.engineInstance){console.warn("[EngineGisManager] GIS Engine not initialized.");return}this.engineInstance.clearLabels()}getLabel(e){if(!this.engineInstance){console.warn("[EngineGisManager] GIS Engine not initialized.");return}return this.engineInstance.getLabel(e)}getLabels(){return this.engineInstance?this.engineInstance.getLabels():(console.warn("[EngineGisManager] GIS Engine not initialized."),[])}onLabelClick(e){return this.engineInstance?this.engineInstance.onLabelClick(e):(console.warn("[EngineGisManager] GIS Engine not initialized."),()=>{})}offLabelClick(e){if(!this.engineInstance){console.warn("[EngineGisManager] GIS Engine not initialized.");return}this.engineInstance.offLabelClick(e)}saveMainViewPort(){return this.engineInstance?this.engineInstance.saveMainViewPort():(console.warn("[EngineGisManager] GIS Engine not initialized."),null)}setMainViewPort(e){if(!this.engineInstance){console.warn("[EngineGisManager] GIS Engine not initialized.");return}this.engineInstance.setMainViewPort(e)}goToMainPort(){if(!this.engineInstance){console.warn("[EngineGisManager] GIS Engine not initialized.");return}this.engineInstance.goToMainPort()}resetMainViewPort(){if(!this.engineInstance){console.warn("[EngineGisManager] GIS Engine not initialized.");return}this.engineInstance.resetMainViewPort()}load3DTiles(e){return this.engineInstance?this.engineInstance.load3DTiles(e):(console.warn("[EngineGisManager] GIS Engine not initialized."),Promise.resolve(null))}loadModelByViewToken(e){return this.engineInstance?this.engineInstance.loadModelByViewToken(e):(console.warn("[EngineGisManager] GIS Engine not initialized."),Promise.resolve(null))}openModelCalibrationDock(){this.registry.bottomDock?.open("gisModelCalibration")}getModelCalibrationItems(){return this.engineInstance?this.engineInstance.getModelCalibrationItems():[]}setModelCalibrationTransform(e){return this.engineInstance?this.engineInstance.setModelCalibrationTransform(e):(console.warn("[EngineGisManager] GIS Engine not initialized."),!1)}resetModelCalibration(e){return this.engineInstance?this.engineInstance.resetModelCalibration(e):(console.warn("[EngineGisManager] GIS Engine not initialized."),!1)}destroy(){this.engineInstance&&(this.engineInstance.destroy(),this.engineInstance=null),super.destroy()}}class Dht{element;options;items=[];bodyEl;emptyEl;rowRefs=[];constructor(e={}){this.options=e}init(){this.element=this.createPanel()}setItems(e){this.items=e,this.renderRows()}setTheme(e){if(!this.element)return;const t=this.element.style;t.setProperty("--gmcal-text-primary",e.textPrimary),t.setProperty("--gmcal-text-secondary",e.textSecondary),t.setProperty("--gmcal-border",e.borderSubtle),t.setProperty("--gmcal-bg-inset",e.bgInset),t.setProperty("--gmcal-bg-elevated",e.bgElevated),t.setProperty("--gmcal-primary",e.primary),t.setProperty("--gmcal-primary-subtle",e.primarySubtle)}setLocales(){this.element&&this.element.querySelectorAll("[data-i18n]").forEach(e=>{const t=e.dataset.i18n;t&&(e.textContent=At(t))})}destroy(){this.rowRefs=[],this.element?.remove()}createPanel(){const e=document.createElement("div");e.className="gis-model-calibration-dock-panel";const t=document.createElement("div");t.className="gis-model-calibration-table-wrap";const n=document.createElement("table");return n.className="gis-model-calibration-table",n.appendChild(this.createHead()),this.bodyEl=document.createElement("tbody"),n.appendChild(this.bodyEl),t.appendChild(n),this.emptyEl=document.createElement("div"),this.emptyEl.className="gis-model-calibration-empty",this.emptyEl.dataset.i18n="gisModelCalibration.empty",this.emptyEl.textContent=At("gisModelCalibration.empty"),t.appendChild(this.emptyEl),e.append(t),e}createHead(){const e=document.createElement("thead"),t=document.createElement("tr");return["gisModelCalibration.model","gisModelCalibration.longitude","gisModelCalibration.latitude","gisModelCalibration.height","gisModelCalibration.heading","gisModelCalibration.pitch","gisModelCalibration.roll","gisModelCalibration.actions"].forEach(n=>{const r=document.createElement("th");r.dataset.i18n=n,r.textContent=At(n),t.appendChild(r)}),e.appendChild(t),e}renderRows(){this.bodyEl&&(this.bodyEl.innerHTML="",this.rowRefs=[],this.emptyEl.classList.toggle("is-visible",this.items.length===0),this.items.forEach(e=>{const t=document.createElement("tr"),n={item:e,offsetInputs:this.createOffsetInputs(e.offset),rotationInputs:this.createRotationInputs(e.rotation)};t.appendChild(this.createModelCell(e)),t.appendChild(this.createInputCell(n.offsetInputs.east)),t.appendChild(this.createInputCell(n.offsetInputs.north)),t.appendChild(this.createInputCell(n.offsetInputs.up)),t.appendChild(this.createInputCell(n.rotationInputs.heading)),t.appendChild(this.createInputCell(n.rotationInputs.pitch)),t.appendChild(this.createInputCell(n.rotationInputs.roll)),t.appendChild(this.createActionCell(n)),this.rowRefs.push(n),this.bodyEl.appendChild(t)}))}createModelCell(e){const t=document.createElement("td");t.className="gis-model-calibration-model-cell";const n=document.createElement("div");return n.className="gis-model-calibration-model-name",n.textContent=e.name,n.title=`${e.name}
|
|
4369
|
+
`;const s=document.createElement("div");s.className="bim-help-panel-rule-desc",s.dataset.localeKey="help.roamMoveDesc",t.appendChild(n),t.appendChild(r),t.appendChild(s),e.appendChild(t),e.appendChild(this.createCard("speedUp","shiftArrow")),e.appendChild(this.createCard("upDown","qeKey","landOnFloor"));const o=document.createElement("div");o.className="bim-help-panel-card";const a=document.createElement("div");a.className="bim-help-panel-card-title",a.dataset.localeKey="help.lookAround";const l=document.createElement("div");l.className="bim-help-panel-control-row";const c=document.createElement("div");c.className="bim-help-panel-mouse-box";const h=document.createElement("div");h.className="bim-help-panel-mouse-left",c.appendChild(h),l.appendChild(c);const u=document.createElement("div");u.className="bim-help-panel-rule-desc",u.dataset.localeKey="help.lookAroundDesc",o.appendChild(a),o.appendChild(l),o.appendChild(u),e.appendChild(o);const d=document.createElement("div");d.className="bim-help-panel-card";const p=document.createElement("div");p.className="bim-help-panel-card-title",p.dataset.localeKey="help.teleport";const f=document.createElement("div");f.className="bim-help-panel-control-row";const g=document.createElement("div");g.className="bim-help-panel-teleport-icon";const _=document.createElement("div");_.className="bim-help-panel-teleport-inner",g.appendChild(_),f.appendChild(g);const y=document.createElement("div");return y.className="bim-help-panel-rule-desc",y.dataset.localeKey="help.teleportDesc",d.appendChild(p),d.appendChild(f),d.appendChild(y),e.appendChild(d),e}createCard(e,t,n){const r=document.createElement("div");r.className="bim-help-panel-card";const s=document.createElement("div");s.className="bim-help-panel-card-title",s.dataset.localeKey=`help.${e}`;const o=document.createElement("div");if(o.className="bim-help-panel-control-row",o.dataset.localeKey=`help.${t}`,r.appendChild(s),r.appendChild(o),n){const a=document.createElement("div");a.className="bim-help-panel-rule-desc",a.dataset.localeKey=`help.${n}`,r.appendChild(a)}return r}createFooter(){const e=document.createElement("div");return e.className="bim-help-panel-footer",this.confirmBtn=document.createElement("button"),this.confirmBtn.className="bim-help-panel-btn bim-help-panel-btn-primary",this.confirmBtn.addEventListener("click",()=>this.hide()),this.dontRemindBtn=document.createElement("button"),this.dontRemindBtn.className="bim-help-panel-btn bim-help-panel-btn-secondary",this.dontRemindBtn.addEventListener("click",()=>this.dontRemind()),e.appendChild(this.confirmBtn),e.appendChild(this.dontRemindBtn),e}switchTab(e){this.viewTabBtn.classList.toggle("active",e==="view"),this.fpsTabBtn.classList.toggle("active",e==="fps"),this.viewContent.classList.toggle("active",e==="view"),this.fpsContent.classList.toggle("active",e==="fps")}dontRemind(){const e=this.options.storageKey??_8.STORAGE_KEY;localStorage.setItem(e,"true"),this.hide(),this.options.onDontRemind?.()}setLocales(){this.viewTabBtn.textContent=At("help.engineControl"),this.fpsTabBtn.textContent=At("help.fpsControl"),this.confirmBtn.textContent=At("help.gotIt"),this.dontRemindBtn.textContent=At("help.dontRemind"),this.element.querySelectorAll("[data-locale-key]").forEach(e=>{const t=e.getAttribute("data-locale-key");t&&(e.textContent=At(t))})}setTheme(e){this.element.style.setProperty("--bim-bg-overlay","rgba(0, 0, 0, 0.5)"),this.element.style.setProperty("--bim-panel-bg",e.bgElevated),this.element.style.setProperty("--bim-panel-border",e.panelBorder),this.element.style.setProperty("--bim-shadow-lg",e.shadowLg),this.element.style.setProperty("--bim-text-primary",e.textPrimary),this.element.style.setProperty("--bim-text-secondary",e.textSecondary),this.element.style.setProperty("--bim-text-tertiary",e.textTertiary),this.element.style.setProperty("--bim-primary",e.primary),this.element.style.setProperty("--bim-primary-hover",e.primaryHover),this.element.style.setProperty("--bim-text-inverse",e.textInverse),this.element.style.setProperty("--bim-divider",e.divider),this.element.style.setProperty("--bim-border-default",e.borderDefault),this.element.style.setProperty("--bim-border-subtle",e.borderSubtle),this.element.style.setProperty("--bim-component-bg",e.componentBg),this.element.style.setProperty("--bim-component-bg-hover",e.componentBgHover),this.element.style.setProperty("--bim-bg-inset",e.bgInset),this.element.style.setProperty("--bim-scrollbar-thumb",e.scrollbarThumb),this.element.style.setProperty("--bim-scrollbar-thumb-hover",e.scrollbarThumbHover)}destroy(){this.unsubscribeLocale&&(this.unsubscribeLocale(),this.unsubscribeLocale=null),this.unsubscribeTheme&&(this.unsubscribeTheme(),this.unsubscribeTheme=null),this.overlay&&this.overlay.remove()}}class pht extends Mc{container;helpPanel=null;infoButton=null;constructor(e,t){super(t),this.container=e,this.init()}init(){if(this.helpPanel&&this.infoButton?.isConnected)return;(this.helpPanel||this.infoButton)&&(this.infoButton?.remove(),this.infoButton=null,this.helpPanel?.destroy(),this.helpPanel=null),this.helpPanel=new _8({onDontRemind:()=>{this.registry.emit("help:dont-remind",{})}}),this.helpPanel.init(),this.container.appendChild(this.helpPanel.element);const e=document.createElement("div");e.className="engine-info-button",e.innerHTML=vn("default"),e.title="信息",e.addEventListener("click",t=>{t.stopPropagation(),this.show()}),this.container.appendChild(e),this.infoButton=e}show(){this.helpPanel?.show()}destroy(){this.infoButton?.remove(),this.infoButton=null,this.helpPanel?.destroy(),this.helpPanel=null,super.destroy()}}class fht{events=new Map;on(e,t){return this.events.has(e)||this.events.set(e,[]),this.events.get(e).push(t),()=>this.off(e,t)}off(e,t){const n=this.events.get(e);if(!n)return;const r=n.indexOf(t);r!==-1&&n.splice(r,1)}emit(e,t){const n=this.events.get(e);n&&n.forEach(r=>{try{r(t)}catch(s){console.error(`[EventEmitter] Error in listener for event "${e}":`,s)}})}clear(){this.events.clear()}}class jI{eventEmitter=new fht;container=null;wrapper=null;mode="desktop";toolbar=null;dialog=null;engine3d=null;engine2d=null;engineGis=null;engineGaussian=null;buttonGroup=null;rightKey=null;constructTree=null;measure=null;sectionPlane=null;sectionAxis=null;sectionBox=null;walkPath=null;walkPlanView=null;engineInfo=null;componentDetail=null;aiChat=null;setting=null;radialToolbar=null;viewDropdown=null;helpPanel=null;bottomDock=null;measureDock=null;sectionDock=null;walkDock=null;modelCalibrationDock=null;gisModelCalibrationDock=null;componentTreeDrawer=null;constructor(){}reset(){this.eventEmitter.clear(),this.container=null,this.wrapper=null,this.mode="desktop",this.toolbar=null,this.dialog=null,this.engine3d=null,this.engine2d=null,this.engineGis=null,this.engineGaussian=null,this.buttonGroup=null,this.rightKey=null,this.constructTree=null,this.measure=null,this.sectionPlane=null,this.sectionAxis=null,this.sectionBox=null,this.walkPath=null,this.walkPlanView=null,this.engineInfo=null,this.componentDetail=null,this.aiChat=null,this.setting=null,this.radialToolbar=null,this.viewDropdown=null,this.helpPanel=null,this.bottomDock=null,this.measureDock=null,this.sectionDock=null,this.walkDock=null,this.modelCalibrationDock=null,this.gisModelCalibrationDock=null,this.componentTreeDrawer=null}emit(e,t){this.eventEmitter.emit(e,t)}on(e,t){return this.eventEmitter.on(e,t)}off(e,t){this.eventEmitter.off(e,t)}clearEvents(){this.eventEmitter.clear()}}class mht{container;wrapper=null;sizeEl=null;statsEl=null;resizeObserver=null;lastSyncedWidth=-1;lastSyncedHeight=-1;registry;mode;uiOptions;dialog=null;engine=null;rightKey=null;radialToolbar=null;viewDropdown=null;helpPanel=null;bottomDock=null;measureDock=null;sectionDock=null;walkDock=null;modelCalibrationDock=null;componentTreeDrawer=null;measure=null;sectionPlane=null;sectionAxis=null;sectionBox=null;engineInfo=null;componentDetail=null;aiChat=null;setting=null;constructTreeBtn=null;handleWindowResize=()=>{this.updateClientSizeDisplay()};constructor(e,t){const n=typeof e=="string"?document.getElementById(e):e;if(!n)throw new Error("Container not found");this.container=n,this.registry=new jI,this.mode=this.resolveMode(t?.mode??"desktop"),this.uiOptions={enableRadialToolbar:t?.enableRadialToolbar??!0,enableConstructTree:t?.enableConstructTree??!0,enableRightKeyMenu:t?.enableRightKeyMenu??!0,showModelInfoStats:t?.showModelInfoStats??!0},t?.locale&&dr.setLocale(t.locale),t?.theme&&(t.theme==="custom"?console.warn("Custom theme should be set via setCustomTheme()."):qi.setTheme(t.theme)),this.init()}emit(e,t){this.registry.emit(e,t)}on(e,t){return this.registry.on(e,t)}setLocale(e){dr.setLocale(e)}getLocale(){return dr.getLocale()}setTheme(e){qi.setTheme(e)}setCustomTheme(e){qi.setCustomTheme(e)}async initialize(e){return this.engine?this.engine.initialize(e):(console.warn("[BimEngine] 3D Engine manager not initialized."),!1)}loadModel(e,t){this.engine?.loadModel(e,t)}setPinEditable(e){this.componentTreeDrawer?.setPinEditable(e)}isPinEditable(){return this.componentTreeDrawer?.isPinEditable()??!0}addRadialToolbarButton(e){this.radialToolbar?.addItem(e)}setRadialToolbarButtonActive(e,t){this.radialToolbar?.setItemActive(e,t)}async loadModelByViewToken(e){if(!this.engine){console.warn("[BimEngine] 3D Engine manager not initialized.");return}await this.engine.loadModelByViewToken(e)}resolveMode(e){if(e!=="auto")return e;const t=typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(pointer: coarse)").matches,n=this.container.clientWidth>0&&this.container.clientWidth<=768;return t||n?"mobile":"desktop"}isDesktopUi(){return this.mode==="desktop"}init(){this.initContainer(),this.initCommonManagers(),this.isDesktopUi()?this.initDesktopUi():this.initMobileUi(),this.bindCommonEvents()}initContainer(){this.container.innerHTML="",this.wrapper=document.createElement("div"),this.wrapper.className=`bim-engine-wrapper bim-engine-wrapper--${this.mode}`,this.container.appendChild(this.wrapper),this.isDesktopUi()&&this.initDesktopStatusUi(),this.updateClientSizeDisplay(),this.bindSizeObserver(),this.registry.container=this.container,this.registry.wrapper=this.wrapper,this.registry.mode=this.mode}initDesktopStatusUi(){if(!this.wrapper)return;const e=document.createElement("div");e.className="bim-engine-footer-info",this.wrapper.appendChild(e);const t=document.createElement("span");t.className="bim-engine-version",t.textContent="v3.9.213",e.appendChild(t),this.uiOptions.showModelInfoStats&&(this.statsEl=document.createElement("span"),this.statsEl.className="bim-engine-stats",e.appendChild(this.statsEl)),this.sizeEl=document.createElement("div"),this.sizeEl.className="bim-engine-size",this.wrapper.appendChild(this.sizeEl)}initCommonManagers(){if(!this.wrapper)throw new Error("[BimEngine] Wrapper not initialized.");this.engine=new _be(this.wrapper,this.registry,{enableRightKeyMenu:this.isDesktopUi()&&this.uiOptions.enableRightKeyMenu}),this.registry.engine3d=this.engine}initDesktopUi(){if(!this.wrapper)throw new Error("[BimEngine] Wrapper not initialized.");this.dialog=new Cye(this.wrapper,this.registry),this.registry.dialog=this.dialog,this.uiOptions.enableRightKeyMenu&&(this.rightKey=new VZ(this.wrapper,this.registry),this.registry.rightKey=this.rightKey),this.bottomDock=new jZ(this.wrapper,this.registry),this.registry.bottomDock=this.bottomDock,this.viewDropdown=new dht(this.wrapper,this.registry),this.registry.viewDropdown=this.viewDropdown,this.helpPanel=new pht(this.wrapper,this.registry),this.registry.helpPanel=this.helpPanel,this.measureDock=new Ebe(this.registry),this.registry.measureDock=this.measureDock,this.measureDock.init(),this.sectionDock=new Sbe(this.registry),this.registry.sectionDock=this.sectionDock,this.sectionDock.init(),this.walkDock=new Tbe(this.registry),this.registry.walkDock=this.walkDock,this.walkDock.init(),this.modelCalibrationDock=new Cbe(this.registry),this.registry.modelCalibrationDock=this.modelCalibrationDock,this.modelCalibrationDock.init(),this.uiOptions.enableConstructTree&&(this.componentTreeDrawer=new Qct(this.registry),this.registry.componentTreeDrawer=this.componentTreeDrawer),this.uiOptions.enableRadialToolbar&&(this.radialToolbar=new vbe(this.wrapper,this.registry),this.registry.radialToolbar=this.radialToolbar),this.measure=new Rbe(this.registry),this.sectionPlane=new Lbe(this.registry),this.sectionAxis=new Obe(this.registry),this.sectionBox=new Bbe(this.registry),this.engineInfo=new Fbe(this.registry),this.engineInfo.init(),this.registry.measure=this.measure,this.registry.sectionPlane=this.sectionPlane,this.registry.sectionAxis=this.sectionAxis,this.registry.sectionBox=this.sectionBox,this.registry.engineInfo=this.engineInfo,this.componentDetail=new Ube(this.registry),this.registry.componentDetail=this.componentDetail,this.componentDetail.init(),this.aiChat=new zbe(this.registry),this.registry.aiChat=this.aiChat,this.aiChat.init(),this.uiOptions.enableConstructTree&&(this.constructTreeBtn=new uht(this.wrapper,this.registry),this.registry.constructTree=this.constructTreeBtn),this.setting=new Pv(this.registry),this.registry.setting=this.setting,this.setting.init()}initMobileUi(){}bindCommonEvents(){this.registry.on("engine:model-loading-completed",()=>{this.updateEngineStats()}),this.updateTheme(qi.getTheme()),qi.subscribe(e=>{this.updateTheme(e)}),dr.subscribe(()=>{this.updateEngineStats()})}updateTheme(e){this.wrapper&&(this.wrapper.style.color=e.textPrimary)}updateClientSizeDisplay(){const e=this.container.clientWidth,t=this.container.clientHeight;this.sizeEl&&(this.sizeEl.textContent=`${e}px x ${t}px`),this.syncEngineSize(e,t)}updateEngineStats(){if(!this.statsEl)return;const e=this.engine?.getEngineComponent?.();if(!e){this.statsEl.textContent="";return}const t=e.getEngineInfo?.();if(console.log("[BimEngine] updateEngineStats info:",t),!t){this.statsEl.textContent="";return}const n=[];t.meshCount!==void 0&&n.push(`${dr.t("info.meshCount")}: ${t.meshCount}`),t.totalTriangles!==void 0&&n.push(`${dr.t("info.totalTriangles")}: ${t.totalTriangles}`),t.totalVertices!==void 0&&n.push(`${dr.t("info.totalVertices")}: ${t.totalVertices}`),this.statsEl.textContent=n.join(" | ")}syncEngineSize(e,t){e<=0||t<=0||e===this.lastSyncedWidth&&t===this.lastSyncedHeight||(this.lastSyncedWidth=e,this.lastSyncedHeight=t,this.engine?.getEngineComponent()?.resize(e,t))}bindSizeObserver(){if(typeof ResizeObserver<"u"){this.resizeObserver=new ResizeObserver(()=>{this.updateClientSizeDisplay()}),this.resizeObserver.observe(this.container);return}window.addEventListener("resize",this.handleWindowResize)}unbindSizeObserver(){if(this.resizeObserver){this.resizeObserver.disconnect(),this.resizeObserver=null;return}window.removeEventListener("resize",this.handleWindowResize)}destroy(){this.unbindSizeObserver(),this.helpPanel?.destroy(),this.viewDropdown?.destroy(),this.radialToolbar?.destroy(),this.measureDock?.destroy(),this.sectionDock?.destroy(),this.walkDock?.destroy(),this.modelCalibrationDock?.destroy(),this.componentTreeDrawer?.destroy(),this.bottomDock?.destroy(),this.engine?.destroy(),this.dialog?.destroy(),this.rightKey?.destroy(),this.measure?.destroy(),this.sectionPlane?.destroy(),this.sectionAxis?.destroy(),this.sectionBox?.destroy(),this.constructTreeBtn?.destroy(),this.aiChat?.destroy(),this.setting?.destroy(),this.sizeEl=null,this.statsEl=null,this.lastSyncedWidth=-1,this.lastSyncedHeight=-1,this.container.innerHTML="",this.registry.reset()}}class ght{container;wrapper=null;sizeEl=null;resizeObserver=null;lastSyncedWidth=-1;lastSyncedHeight=-1;unsubscribeTheme=null;registry;dialog=null;engine=null;rightKey=null;radialToolbar=null;bottomDock=null;measureDock=null;sectionDock=null;walkDock=null;modelCalibrationDock=null;measure=null;sectionPlane=null;sectionAxis=null;sectionBox=null;engineInfo=null;componentDetail=null;aiChat=null;setting=null;handleWindowResize=()=>{this.updateClientSizeDisplay()};constructor(e,t){const n=typeof e=="string"?document.getElementById(e):e;if(!n)throw new Error("Container not found");this.container=n,this.registry=new jI,t?.locale&&dr.setLocale(t.locale),t?.theme&&(t.theme==="custom"?console.warn("Custom theme should be set via setCustomTheme()."):qi.setTheme(t.theme)),this.init()}emit(e,t){this.registry.emit(e,t)}on(e,t){return this.registry.on(e,t)}setLocale(e){dr.setLocale(e)}getLocale(){return dr.getLocale()}setTheme(e){qi.setTheme(e)}setCustomTheme(e){qi.setCustomTheme(e)}async initialize(e){return this.engine?this.engine.initialize(e):(console.warn("[CusBimEngine] 3D Engine manager not initialized."),!1)}loadModel(e,t){this.engine?.loadModel(e,t)}async loadModelByViewToken(e){if(!this.engine){console.warn("[CusBimEngine] 3D Engine manager not initialized.");return}await this.engine.loadModelByViewToken(e)}init(){this.container.innerHTML="",this.wrapper=document.createElement("div"),this.wrapper.className="bim-engine-wrapper",this.container.appendChild(this.wrapper);const e=document.createElement("div");e.className="bim-engine-version",e.textContent="v3.9.213",this.wrapper.appendChild(e),this.sizeEl=document.createElement("div"),this.sizeEl.className="bim-engine-size",this.wrapper.appendChild(this.sizeEl),this.updateClientSizeDisplay(),this.bindSizeObserver(),this.registry.container=this.container,this.registry.wrapper=this.wrapper,this.engine=new _be(this.wrapper,this.registry),this.dialog=new Cye(this.wrapper,this.registry),this.rightKey=new VZ(this.wrapper,this.registry),this.bottomDock=new jZ(this.wrapper,this.registry),this.registry.bottomDock=this.bottomDock,this.registry.engine3d=this.engine,this.registry.dialog=this.dialog,this.registry.rightKey=this.rightKey,this.measureDock=new Ebe(this.registry),this.registry.measureDock=this.measureDock,this.measureDock.init(),this.sectionDock=new Sbe(this.registry),this.registry.sectionDock=this.sectionDock,this.sectionDock.init(),this.walkDock=new Tbe(this.registry),this.registry.walkDock=this.walkDock,this.walkDock.init(),this.modelCalibrationDock=new Cbe(this.registry),this.registry.modelCalibrationDock=this.modelCalibrationDock,this.modelCalibrationDock.init(),this.radialToolbar=new vbe(this.wrapper,this.registry),this.measure=new Rbe(this.registry),this.sectionPlane=new Lbe(this.registry),this.sectionAxis=new Obe(this.registry),this.sectionBox=new Bbe(this.registry),this.engineInfo=new Fbe(this.registry),this.engineInfo.init(),this.registry.radialToolbar=this.radialToolbar,this.registry.measure=this.measure,this.registry.sectionPlane=this.sectionPlane,this.registry.sectionAxis=this.sectionAxis,this.registry.sectionBox=this.sectionBox,this.registry.engineInfo=this.engineInfo,this.componentDetail=new Ube(this.registry),this.registry.componentDetail=this.componentDetail,this.componentDetail.init(),this.aiChat=new zbe(this.registry),this.registry.aiChat=this.aiChat,this.aiChat.init(),this.setting=new Pv(this.registry),this.registry.setting=this.setting,this.setting.init(),this.updateTheme(qi.getTheme()),this.unsubscribeTheme=qi.subscribe(t=>{this.updateTheme(t)})}updateTheme(e){this.wrapper&&(this.wrapper.style.color=e.textPrimary)}updateClientSizeDisplay(){const e=this.container.clientWidth,t=this.container.clientHeight;this.sizeEl&&(this.sizeEl.textContent=`${e}px x ${t}px`),this.syncEngineSize(e,t)}syncEngineSize(e,t){e<=0||t<=0||e===this.lastSyncedWidth&&t===this.lastSyncedHeight||(this.lastSyncedWidth=e,this.lastSyncedHeight=t,this.engine?.getEngineComponent()?.resize(e,t))}bindSizeObserver(){if(typeof ResizeObserver<"u"){this.resizeObserver=new ResizeObserver(()=>{this.updateClientSizeDisplay()}),this.resizeObserver.observe(this.container);return}window.addEventListener("resize",this.handleWindowResize)}unbindSizeObserver(){if(this.resizeObserver){this.resizeObserver.disconnect(),this.resizeObserver=null;return}window.removeEventListener("resize",this.handleWindowResize)}destroy(){this.unbindSizeObserver(),this.unsubscribeTheme&&(this.unsubscribeTheme(),this.unsubscribeTheme=null),this.radialToolbar?.destroy(),this.measureDock?.destroy(),this.sectionDock?.destroy(),this.walkDock?.destroy(),this.modelCalibrationDock?.destroy(),this.bottomDock?.destroy(),this.engine?.destroy(),this.dialog?.destroy(),this.rightKey?.destroy(),this.measure?.destroy(),this.sectionPlane?.destroy(),this.sectionAxis?.destroy(),this.sectionBox?.destroy(),this.aiChat?.destroy(),this.setting?.destroy(),this.sizeEl=null,this.lastSyncedWidth=-1,this.lastSyncedHeight=-1,this.container.innerHTML="",this.registry.reset()}}const _ht=[{action:"search",dividerBefore:!0},{action:"hideElement",dividerBefore:!0},{action:"showAll"},{action:"hideLayer"},{action:"showAllLayers"},{action:"layerManage"},{action:"toggleBg",dividerBefore:!0},{action:"linkElement2d3d",visible:!0},{action:"linkView2d3d",visible:!0}],yht={search:"engine2d.contextMenu.search",hideElement:"engine2d.contextMenu.hideElement",showAll:"engine2d.contextMenu.showAll",hideLayer:"engine2d.contextMenu.hideLayer",showAllLayers:"engine2d.contextMenu.showAllLayers",layerManage:"engine2d.contextMenu.layerManage",toggleBg:"engine2d.contextMenu.toggleBg",linkElement2d3d:"engine2d.contextMenu.linkElement2d3d",linkView2d3d:"engine2d.contextMenu.linkView2d3d"};function vht(i){const e=yht[i.action];return{...i,label:i.label??(e?At(e):i.action)}}function bht(i){return{...i,items:(i?.items??_ht).map(vht)}}class Aht{engine=null;registry;container;containerId;options;_isInitialized=!1;_isDestroyed=!1;initPromise=null;unsubscribeTheme=null;viewDropdown=null;constructor(e,t){this.registry=t,this.container=e.container,this.container.id?this.containerId=this.container.id:(this.containerId=`engine2d-container-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,this.container.id=this.containerId),this.options={backgroundColor:e.backgroundColor??1710618,gridEnabled:e.gridEnabled??!0,axesEnabled:e.axesEnabled??!0,selectionColor:e.selectionColor,highlightColor:e.highlightColor,enablePerformanceMonitoring:e.enablePerformanceMonitoring??!1,cursorStyle:e.cursorStyle??"full-crosshair",loadingStyle:e.loadingStyle??1,showMouseCoordinates:e.showMouseCoordinates??!0,contextMenu:e.contextMenu}}async init(){if(this._isInitialized){console.warn("[Engine2d] Engine already initialized.");return}if(this.initPromise)return this.initPromise;if(this._isDestroyed){console.error("[Engine2d] Cannot initialize destroyed engine.");return}try{const e={containerId:this.containerId,backgroundColor:this.options.backgroundColor,gridEnabled:this.options.gridEnabled,axesEnabled:this.options.axesEnabled,enablePerformanceMonitoring:this.options.enablePerformanceMonitoring,cursorStyle:this.options.cursorStyle,loadingStyle:this.options.loadingStyle,showMouseCoordinates:this.options.showMouseCoordinates,contextMenu:bht(this.options.contextMenu),sdkAuth:iO};if(this.options.selectionColor!==void 0&&(e.selectionColor=this.options.selectionColor),this.options.highlightColor!==void 0&&(e.highlightColor=this.options.highlightColor),console.log("[Engine2d] 引擎配置信息:",e),this.initPromise=(async()=>{const t=await dct(e);if(!t)throw new Error("Failed to create 2D engine instance");if(this._isDestroyed){t.dispose?.();return}this.engine=t,this._isInitialized=!0})(),await this.initPromise,this._isDestroyed||!this.engine)return;this.unsubscribeTheme=qi.subscribe(t=>{this.setTheme(t)}),this.setTheme(qi.getTheme()),this.engine.events&&(this.engine.events.on("entity-click",t=>{console.log("[Engine2d] 实体点击:",t),this.registry.emit("engine2d:entity-clicked",{data:t})}),this.engine.events.on("layer-visibility-changed",t=>{console.log("[Engine2d] 图层可见性变更:",t),this.registry.emit("engine2d:layer-changed",{data:t})})),this.initViewDropdown()}catch(e){throw console.error("[Engine2d] Failed to initialize 2D engine:",e),this._isInitialized=!1,e}finally{this.initPromise=null}}setTheme(e){}setLocales(){}isInitialized(){return this._isInitialized}async loadDrawing(e,t){if(!this._isInitialized||!this.engine){console.error("[Engine2d] Engine not initialized. Please call init() first.");return}if(!e){console.error("[Engine2d] Drawing URL is required.");return}try{console.log("[Engine2d] 开始加载图纸:",e),await this.engine.loadModel(e,t),console.log("[Engine2d] 图纸加载完成:",e),this.registry.emit("engine2d:drawing-loaded",{url:e})}catch(n){throw console.error("[Engine2d] 图纸加载失败:",n),n}}async loadModelByViewToken(e){if(!this._isInitialized||!this.engine){console.error("[Engine2d] Engine not initialized. Please call init() first.");return}await this.engine.loadModelByViewToken(e)}getLayers(){if(!this._isInitialized||!this.engine)return[];try{return this.engine.getLayers?.()??[]}catch(e){return console.warn("[Engine2d] Failed to get layers:",e),[]}}setLayerVisible(e,t){if(!this._isInitialized||!this.engine){console.warn("[Engine2d] Engine not initialized.");return}try{this.engine.setLayerVisible?.(e,t)}catch(n){console.warn("[Engine2d] Failed to set layer visibility:",n)}}getRawLabel(e){const t=this.engine?.label;return!t||typeof t[e]!="function"?(console.warn(`[Engine2d] label.${e} not available.`),null):t}pickPoint(){return this.getRawLabel("pickPoint")?.pickPoint?.()??Promise.resolve(null)}startPickPoint(e){return this.getRawLabel("startPickPoint")?.startPickPoint?.(e)??Promise.resolve(null)}createLabel(e){return this.getRawLabel("createLabel")?.createLabel?.(e)}createLabels(e,t){t?.clearExisting&&this.clearLabels();const n=this.getRawLabel("createLabel");return n?.createLabel?e.map(r=>n.createLabel(r)).filter(r=>typeof r=="string"&&r.length>0):[]}updateLabel(e,t){return this.getRawLabel("updateLabel")?.updateLabel?.(e,t)??!1}deleteLabel(e){return this.getRawLabel("deleteLabel")?.deleteLabel?.(e)??!1}removeLabel(e){return this.getRawLabel("removeLabel")?.removeLabel?.(e)??!1}clearLabels(){this.getRawLabel("clearLabels")?.clearLabels?.()}getLabel(e){return this.getRawLabel("getLabel")?.getLabel?.(e)}getLabels(){return this.getRawLabel("getLabels")?.getLabels?.()??[]}onLabelClick(e){return this.getRawLabel("onLabelClick")?.onLabelClick?.(e)??(()=>{})}offLabelClick(e){this.getRawLabel("offLabelClick")?.offLabelClick?.(e)}resetView(){if(!(!this._isInitialized||!this.engine))try{this.engine.resetView?.()}catch(e){console.warn("[Engine2d] Failed to reset view:",e)}}fitToView(){if(!(!this._isInitialized||!this.engine))try{this.engine.fitToView?.()}catch(e){console.warn("[Engine2d] Failed to fit to view:",e)}}setZoom(e){!this._isInitialized||!this.engine||this.engine.setZoom?.(e)}getZoom(){return!this._isInitialized||!this.engine?1:this.engine.getZoom?.()??1}saveMainViewPort(){return!this._isInitialized||!this.engine?.viewCube?.saveMainViewPort?(console.warn("[Engine2d] viewCube.saveMainViewPort not available."),null):this.engine.viewCube.saveMainViewPort()??null}setMainViewPort(e){if(!this._isInitialized||!this.engine?.viewCube?.setMainViewPort){console.warn("[Engine2d] viewCube.setMainViewPort not available.");return}this.engine.viewCube.setMainViewPort(e)}goToMainPort(){if(!this._isInitialized||!this.engine?.viewCube?.goToMainPort){console.warn("[Engine2d] viewCube.goToMainPort not available.");return}this.engine.viewCube.goToMainPort()}resetMainViewPort(){if(!this._isInitialized||!this.engine?.viewCube?.resetMainViewPort){console.warn("[Engine2d] viewCube.resetMainViewPort not available.");return}this.engine.viewCube.resetMainViewPort()}initViewDropdown(){this.viewDropdown?.destroy(),this.viewDropdown=new YZ({container:this.container,triggerClassName:"engine-view-dropdown-trigger--top-right",items:[{key:"saveMainView",labelKey:"viewDropdown.saveMainView",action:()=>{const e=this.saveMainViewPort();this.registry.emit("view:main-view-saved",{viewData:e})}},{key:"restoreMainView",labelKey:"viewDropdown.restoreMainView",action:()=>{this.resetMainViewPort(),this.registry.emit("view:main-view-restored",{})}}]}),this.viewDropdown.init()}setBackgroundColor(e){!this._isInitialized||!this.engine||this.engine.setBackgroundColor?.(e)}clearScene(){!this._isInitialized||!this.engine||this.engine.clearScene?.()}resize(){!this._isInitialized||!this.engine||this.engine.resize?.()}onRawEvent(e,t){this.engine?.events?.on(e,t)}offRawEvent(e,t){this.engine?.events?.off(e,t)}destroy(){if(!this._isDestroyed){if(this.unsubscribeTheme&&(this.unsubscribeTheme(),this.unsubscribeTheme=null),this.viewDropdown?.destroy(),this.viewDropdown=null,this.engine){try{this.engine.dispose?.()}catch(e){console.warn("[Engine2d] Error during dispose:",e)}this.engine=null}this.container.innerHTML="",this.initPromise=null,this._isDestroyed=!0,this._isInitialized=!1}}}class xht extends Mc{container;engineInstance=null;constructor(e,t){super(t),this.container=e}getEngine2dComponent(){return this.engineInstance}async initialize(e){this.engineInstance&&this.engineInstance.isInitialized()&&(console.warn("[Engine2dManager] 2D Engine already initialized. Destroying old instance..."),this.engineInstance.destroy(),this.engineInstance=null);try{const t=new Aht({container:this.container,...e},this.registry);return this.engineInstance=t,await t.init(),this.engineInstance===t&&t.isInitialized()}catch(t){return console.error("[Engine2dManager] Failed to initialize 2D engine:",t),this.engineInstance=null,!1}}isInitialized(){return this.engineInstance!==null&&this.engineInstance.isInitialized()}async loadDrawing(e,t){if(!this.engineInstance){console.warn("[Engine2dManager] 2D Engine not initialized.");return}await this.engineInstance.loadDrawing(e,t)}async loadModelByViewToken(e){if(!this.engineInstance){console.warn("[Engine2dManager] 2D Engine not initialized.");return}await this.engineInstance.loadModelByViewToken(e)}getLayers(){return this.engineInstance?this.engineInstance.getLayers():[]}setLayerVisible(e,t){if(!this.engineInstance){console.warn("[Engine2dManager] 2D Engine not initialized.");return}this.engineInstance.setLayerVisible(e,t)}pickPoint(){return this.engineInstance?this.engineInstance.pickPoint():(console.warn("[Engine2dManager] 2D Engine not initialized."),Promise.resolve(null))}startPickPoint(e){return this.engineInstance?this.engineInstance.startPickPoint(e):(console.warn("[Engine2dManager] 2D Engine not initialized."),Promise.resolve(null))}createLabel(e){if(!this.engineInstance){console.warn("[Engine2dManager] 2D Engine not initialized.");return}return this.engineInstance.createLabel(e)}createLabels(e,t){return this.engineInstance?this.engineInstance.createLabels(e,t):(console.warn("[Engine2dManager] 2D Engine not initialized."),[])}updateLabel(e,t){return this.engineInstance?this.engineInstance.updateLabel(e,t):(console.warn("[Engine2dManager] 2D Engine not initialized."),!1)}deleteLabel(e){return this.engineInstance?this.engineInstance.deleteLabel(e):(console.warn("[Engine2dManager] 2D Engine not initialized."),!1)}removeLabel(e){return this.engineInstance?this.engineInstance.removeLabel(e):(console.warn("[Engine2dManager] 2D Engine not initialized."),!1)}clearLabels(){if(!this.engineInstance){console.warn("[Engine2dManager] 2D Engine not initialized.");return}this.engineInstance.clearLabels()}getLabel(e){if(!this.engineInstance){console.warn("[Engine2dManager] 2D Engine not initialized.");return}return this.engineInstance.getLabel(e)}getLabels(){return this.engineInstance?this.engineInstance.getLabels():(console.warn("[Engine2dManager] 2D Engine not initialized."),[])}onLabelClick(e){return this.engineInstance?this.engineInstance.onLabelClick(e):(console.warn("[Engine2dManager] 2D Engine not initialized."),()=>{})}offLabelClick(e){if(!this.engineInstance){console.warn("[Engine2dManager] 2D Engine not initialized.");return}this.engineInstance.offLabelClick(e)}resetView(){this.engineInstance?.resetView()}fitToView(){this.engineInstance?.fitToView()}setZoom(e){this.engineInstance?.setZoom(e)}getZoom(){return this.engineInstance?.getZoom()??1}saveMainViewPort(){return this.engineInstance?this.engineInstance.saveMainViewPort():(console.warn("[Engine2dManager] 2D Engine not initialized."),null)}setMainViewPort(e){if(!this.engineInstance){console.warn("[Engine2dManager] 2D Engine not initialized.");return}this.engineInstance.setMainViewPort(e)}goToMainPort(){if(!this.engineInstance){console.warn("[Engine2dManager] 2D Engine not initialized.");return}this.engineInstance.goToMainPort()}resetMainViewPort(){if(!this.engineInstance){console.warn("[Engine2dManager] 2D Engine not initialized.");return}this.engineInstance.resetMainViewPort()}resize(){this.engineInstance?.resize()}onRawEvent(e,t){this.engineInstance?.onRawEvent(e,t)}offRawEvent(e,t){this.engineInstance?.offRawEvent(e,t)}destroy(){this.engineInstance&&(this.engineInstance.destroy(),this.engineInstance=null),super.destroy()}}class wht{container;registry;resizeObserver=null;lastSyncedWidth=-1;lastSyncedHeight=-1;engine=null;ready;handleWindowResize=()=>{this.syncEngineSize()};constructor(e,t){const n=typeof e=="string"?document.getElementById(e):e;if(!n)throw new Error("Container not found");this.container=n,this.registry=new jI,t?.locale&&dr.setLocale(t.locale),t?.theme&&t.theme!=="custom"&&qi.setTheme(t.theme),this.engine=new xht(this.container,this.registry),this.registry.engine2d=this.engine,this.ready=this.engine.initialize({backgroundColor:t?.backgroundColor,gridEnabled:t?.gridEnabled,axesEnabled:t?.axesEnabled,selectionColor:t?.selectionColor,highlightColor:t?.highlightColor,enablePerformanceMonitoring:t?.enablePerformanceMonitoring,cursorStyle:t?.cursorStyle,loadingStyle:t?.loadingStyle,showMouseCoordinates:t?.showMouseCoordinates,contextMenu:t?.contextMenu}),this.bindSizeObserver(),this.syncEngineSize(!0)}async loadDrawing(e,t){return await this.ready,this.engine?.loadDrawing(e,t)}async loadModelByViewToken(e){return await this.ready,this.engine?.loadModelByViewToken(e)}getLayers(){return this.engine?.getLayers()??[]}setLayerVisible(e,t){this.engine?.setLayerVisible(e,t)}pickPoint(){return this.engine?.pickPoint()??Promise.resolve(null)}startPickPoint(e){return this.engine?.startPickPoint(e)??Promise.resolve(null)}createLabel(e){return this.engine?.createLabel(e)}createLabels(e,t){return this.engine?.createLabels(e,t)??[]}updateLabel(e,t){return this.engine?.updateLabel(e,t)??!1}deleteLabel(e){return this.engine?.deleteLabel(e)??!1}removeLabel(e){return this.engine?.removeLabel(e)??!1}clearLabels(){this.engine?.clearLabels()}getLabel(e){return this.engine?.getLabel(e)}getLabels(){return this.engine?.getLabels()??[]}onLabelClick(e){return this.engine?.onLabelClick(e)??(()=>{})}offLabelClick(e){this.engine?.offLabelClick(e)}resetView(){this.engine?.resetView()}fitToView(){this.engine?.fitToView()}setZoom(e){this.engine?.setZoom(e)}getZoom(){return this.engine?.getZoom()??1}saveMainViewPort(){return this.engine?.saveMainViewPort()??null}setMainViewPort(e){this.engine?.setMainViewPort(e)}goToMainPort(){this.engine?.goToMainPort()}resetMainViewPort(){this.engine?.resetMainViewPort()}resize(){this.syncEngineSize(!0)}setTheme(e){qi.setTheme(e)}on(e,t){return this.registry.on(e,t)}off(e,t){this.registry.off(e,t)}onRawEvent(e,t){this.engine?.onRawEvent(e,t)}offRawEvent(e,t){this.engine?.offRawEvent(e,t)}syncEngineSize(e=!1){const t=this.container.clientWidth,n=this.container.clientHeight;t<=0||n<=0||!e&&t===this.lastSyncedWidth&&n===this.lastSyncedHeight||(this.lastSyncedWidth=t,this.lastSyncedHeight=n,this.engine?.resize())}bindSizeObserver(){if(typeof ResizeObserver<"u"){this.resizeObserver=new ResizeObserver(()=>{this.syncEngineSize()}),this.resizeObserver.observe(this.container);return}window.addEventListener("resize",this.handleWindowResize)}unbindSizeObserver(){if(this.resizeObserver){this.resizeObserver.disconnect(),this.resizeObserver=null;return}window.removeEventListener("resize",this.handleWindowResize)}destroy(){this.unbindSizeObserver(),this.engine?.destroy(),this.engine=null,this.registry.reset()}}class Eht{engine=null;registry;container;containerId;options;_isInitialized=!1;_isDestroyed=!1;initPromise=null;unsubscribeTheme=null;constructor(e,t){this.registry=t,this.container=e.container,this.container.id?this.containerId=this.container.id:(this.containerId=`engine720-container-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,this.container.id=this.containerId),this.options={fov:e.fov??75,enableZoom:e.enableZoom??!0,enableRotate:e.enableRotate??!0,sphereRadius:e.sphereRadius??500,rotateSpeed:e.rotateSpeed,zoomSpeed:e.zoomSpeed,enableDamping:e.enableDamping,dampingFactor:e.dampingFactor,minFov:e.minFov,maxFov:e.maxFov}}async init(){if(this._isInitialized){console.warn("[Engine720] Engine already initialized.");return}if(this.initPromise)return this.initPromise;if(this._isDestroyed){console.error("[Engine720] Cannot initialize destroyed engine.");return}try{const e={containerId:this.containerId,fov:this.options.fov,enableZoom:this.options.enableZoom,enableRotate:this.options.enableRotate,sphereRadius:this.options.sphereRadius,sdkAuth:iO};if(this.options.rotateSpeed!==void 0&&(e.rotateSpeed=this.options.rotateSpeed),this.options.zoomSpeed!==void 0&&(e.zoomSpeed=this.options.zoomSpeed),this.options.enableDamping!==void 0&&(e.enableDamping=this.options.enableDamping),this.options.dampingFactor!==void 0&&(e.dampingFactor=this.options.dampingFactor),this.options.minFov!==void 0&&(e.minFov=this.options.minFov),this.options.maxFov!==void 0&&(e.maxFov=this.options.maxFov),console.log("[Engine720] 引擎配置信息:",e),this.initPromise=(async()=>{const t=await pct(e);if(!t)throw new Error("Failed to create 720 engine instance");if(this._isDestroyed){t.dispose?.();return}this.engine=t,this._isInitialized=!0})(),await this.initPromise,this._isDestroyed||!this.engine)return;this.unsubscribeTheme=qi.subscribe(t=>{this.setTheme(t)}),this.setTheme(qi.getTheme()),this.engine.events&&(this.engine.events.on("panorama-loaded",t=>{console.log("[Engine720] 全景加载完成:",t),this.registry.emit("engine720:panorama-loaded",{data:t})}),this.engine.events.on("panorama-load-error",t=>{console.error("[Engine720] 全景加载失败:",t),this.registry.emit("engine720:load-error",{data:t})}),this.engine.events.on("annotation-click",t=>{console.log("[Engine720] 标注点击:",t),this.registry.emit("engine720:annotation-click",{data:t})}),this.engine.events.on("view-angle-changed",t=>{this.registry.emit("engine720:view-changed",{data:t})}))}catch(e){throw console.error("[Engine720] Failed to initialize 720 engine:",e),this._isInitialized=!1,e}finally{this.initPromise=null}}setTheme(e){!this._isInitialized||this.engine}setLocales(){}isInitialized(){return this._isInitialized}async loadPanorama(e,t){if(!this._isInitialized||!this.engine){console.error("[Engine720] Engine not initialized. Please call init() first.");return}if(!e){console.error("[Engine720] Panorama URL is required.");return}try{console.log("[Engine720] 开始加载全景图:",e),await this.engine.loadPanorama(e),console.log("[Engine720] 全景图加载完成:",e)}catch(n){throw console.error("[Engine720] 全景图加载失败:",n),n}}async loadModelByViewToken(e){if(!this._isInitialized||!this.engine){console.error("[Engine720] Engine not initialized. Please call init() first.");return}await this.engine.loadModelByViewToken(e)}async preloadPanoramas(e){if(!(!this._isInitialized||!this.engine))try{await this.engine.preloadPanoramas?.(e)}catch(t){console.warn("[Engine720] Failed to preload panoramas:",t)}}setFov(e){!this._isInitialized||!this.engine||this.engine.setFov?.(e)}getFov(){return!this._isInitialized||!this.engine?75:this.engine.getFov?.()??75}lookAt(e,t,n){!this._isInitialized||!this.engine||this.engine.lookAt?.(e,t,n)}resetView(){if(!(!this._isInitialized||!this.engine))try{this.engine.lookAt?.(0,0,!0),this.engine.setFov?.(75)}catch(e){console.warn("[Engine720] Failed to reset view:",e)}}pauseRendering(){!this._isInitialized||!this.engine||this.engine.pauseRendering?.()}resumeRendering(){!this._isInitialized||!this.engine||this.engine.resumeRendering?.()}resize(e,t){!this._isInitialized||!this.engine||this.engine.resize?.(e,t)}onRawEvent(e,t){this.engine?.events?.on(e,t)}offRawEvent(e,t){this.engine?.events?.off(e,t)}destroy(){if(!this._isDestroyed){if(this.unsubscribeTheme&&(this.unsubscribeTheme(),this.unsubscribeTheme=null),this.engine){try{this.engine.dispose?.()}catch(e){console.warn("[Engine720] Error during dispose:",e)}this.engine=null}this.container.innerHTML="",this.initPromise=null,this._isDestroyed=!0,this._isInitialized=!1}}}class Sht{container;registry;engineComponent=null;ready;constructor(e,t){const n=typeof e=="string"?document.getElementById(e):e;if(!n)throw new Error("Container not found");this.container=n,this.registry=new jI,t?.locale&&dr.setLocale(t.locale),t?.theme&&t.theme!=="custom"&&qi.setTheme(t.theme),this.engineComponent=new Eht({container:this.container,fov:t?.fov,enableZoom:t?.enableZoom,enableRotate:t?.enableRotate,sphereRadius:t?.sphereRadius,rotateSpeed:t?.rotateSpeed,zoomSpeed:t?.zoomSpeed,enableDamping:t?.enableDamping,dampingFactor:t?.dampingFactor,minFov:t?.minFov,maxFov:t?.maxFov},this.registry),this.ready=this.engineComponent.init()}async loadPanorama(e,t){return await this.ready,this.engineComponent?.loadPanorama(e,t)}async loadModelByViewToken(e){return await this.ready,this.engineComponent?.loadModelByViewToken(e)}async preloadPanoramas(e){return await this.ready,this.engineComponent?.preloadPanoramas(e)}setFov(e){this.engineComponent?.setFov(e)}getFov(){return this.engineComponent?.getFov()??75}lookAt(e,t,n){this.engineComponent?.lookAt(e,t,n)}resetView(){this.engineComponent?.resetView()}setTheme(e){qi.setTheme(e)}on(e,t){return this.registry.on(e,t)}off(e,t){this.registry.off(e,t)}onRawEvent(e,t){this.engineComponent?.onRawEvent(e,t)}offRawEvent(e,t){this.engineComponent?.offRawEvent(e,t)}destroy(){this.engineComponent?.destroy(),this.engineComponent=null,this.registry.reset()}}const Tht="cesium",Cht={show:!0,flyTo:!0,maximumScreenSpaceError:16,dynamicScreenSpaceError:!0,tilesetOptions:{}},Mht=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];class Iht{engine=null;registry;container;containerId;options;_isInitialized=!1;_isDestroyed=!1;initPromise=null;calibrationItems=new Map;viewDropdown=null;constructor(e,t){this.registry=t,this.container=e.container,this.container.id?this.containerId=this.container.id:(this.containerId=`engine-gis-container-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,this.container.id=this.containerId),this.options={imageryUrl:e.imageryUrl,initialView:e.initialView,showCredit:e.showCredit,showStats:e.showStats}}async init(){if(this._isInitialized){console.warn("[EngineGis] GIS Engine already initialized.");return}if(this.initPromise)return this.initPromise;if(this._isDestroyed){console.error("[EngineGis] Cannot initialize destroyed engine.");return}const e={containerId:this.containerId,provider:Tht,imageryUrl:this.options.imageryUrl,initialView:this.options.initialView,showCredit:this.options.showCredit,showStats:this.options.showStats,sdkAuth:iO};Object.keys(e).forEach(t=>{e[t]===void 0&&delete e[t]}),console.log("[EngineGis] 最终传给底层 createEngineGIS 的参数:",e),this.initPromise=(async()=>{const t=await fct(e);if(!t)throw new Error("[EngineGis] Failed to create GIS engine instance.");if(this._isDestroyed){t.dispose();return}this.engine=t,this._isInitialized=!0,this.initViewDropdown(),this.registry})();try{await this.initPromise}finally{this.initPromise=null}}setTheme(e){}setLocales(){}isInitialized(){return this._isInitialized}getRawLabel(e){const t=this.engine?.label;return!this._isInitialized||!t||typeof t[e]!="function"?(console.warn(`[EngineGis] label.${e} not available.`),null):t}pickPoint(){return this.getRawLabel("pickPoint")?.pickPoint?.()??Promise.resolve(null)}startPickPoint(e){return this.getRawLabel("startPickPoint")?.startPickPoint?.(e)??Promise.resolve(null)}createLabel(e){return this.getRawLabel("createLabel")?.createLabel?.(e)}createLabels(e,t){t?.clearExisting&&this.clearLabels();const n=this.getRawLabel("createLabel");return n?.createLabel?e.map(r=>n.createLabel(r)).filter(r=>typeof r=="string"&&r.length>0):[]}updateLabel(e,t){return this.getRawLabel("updateLabel")?.updateLabel?.(e,t)??!1}deleteLabel(e){return this.getRawLabel("deleteLabel")?.deleteLabel?.(e)??!1}removeLabel(e){return this.getRawLabel("removeLabel")?.removeLabel?.(e)??!1}clearLabels(){this.getRawLabel("clearLabels")?.clearLabels?.()}getLabel(e){return this.getRawLabel("getLabel")?.getLabel?.(e)}getLabels(){return this.getRawLabel("getLabels")?.getLabels?.()??[]}onLabelClick(e){return this.getRawLabel("onLabelClick")?.onLabelClick?.(e)??(()=>{})}offLabelClick(e){this.getRawLabel("offLabelClick")?.offLabelClick?.(e)}saveMainViewPort(){return!this._isInitialized||!this.engine?.viewCube?.saveMainViewPort?(console.warn("[EngineGis] viewCube.saveMainViewPort not available."),null):this.engine.viewCube.saveMainViewPort()??null}setMainViewPort(e){if(!this._isInitialized||!this.engine?.viewCube?.setMainViewPort){console.warn("[EngineGis] viewCube.setMainViewPort not available.");return}this.engine.viewCube.setMainViewPort(e)}goToMainPort(){if(!this._isInitialized||!this.engine?.viewCube?.goToMainPort){console.warn("[EngineGis] viewCube.goToMainPort not available.");return}this.engine.viewCube.goToMainPort()}resetMainViewPort(){if(!this._isInitialized||!this.engine?.viewCube?.resetMainViewPort){console.warn("[EngineGis] viewCube.resetMainViewPort not available.");return}this.engine.viewCube.resetMainViewPort()}initViewDropdown(){this.viewDropdown?.destroy(),this.viewDropdown=new YZ({container:this.container,triggerClassName:"engine-view-dropdown-trigger--top-right",items:[{key:"saveMainView",labelKey:"viewDropdown.saveMainView",action:()=>{const e=this.saveMainViewPort();this.registry.emit("view:main-view-saved",{viewData:e})}},{key:"restoreMainView",labelKey:"viewDropdown.restoreMainView",action:()=>{this.resetMainViewPort(),this.registry.emit("view:main-view-restored",{})}},{key:"modelCalibration",labelKey:"viewDropdown.modelCalibration",action:()=>{this.registry.bottomDock?.toggle("gisModelCalibration")}}]}),this.viewDropdown.init()}async load3DTiles(e){if(!this._isInitialized||!this.engine)return console.warn("[EngineGis] GIS Engine not initialized."),null;if(!e?.url)return console.warn("[EngineGis] 3D Tiles url is required."),null;const t={...Cht,id:e.id,name:e.name,url:e.url,offset:e.offset,rotationUnit:e.rotationUnit};Object.keys(t).forEach(r=>{t[r]===void 0&&delete t[r]}),console.log("[EngineGis] 最终传给底层 load3DTiles 的参数:",t);const n=await this.engine.load3DTiles(t);return this.record3DTilesCalibrationItem(n),this.registry.emit("gis:model-loaded",{id:n.id,name:n.name,url:n.source||e.url,source:n.source}),n}async loadModelByViewToken(e){if(!this._isInitialized||!this.engine)return console.warn("[EngineGis] GIS Engine not initialized."),null;const t=await this.engine.loadModelByViewToken(e);return this.record3DTilesCalibrationItem(t),this.registry.emit("gis:model-loaded",{id:t.id,name:t.name,url:t.source??"",source:t.source}),t}getModelCalibrationItems(){return Array.from(this.calibrationItems.values()).map(e=>this.cloneCalibrationItem(e))}setModelCalibrationTransform(e){if(!this._isInitialized||!this.engine)return console.warn("[EngineGis] Cannot set GIS calibration: engine not initialized."),!1;const t=this.calibrationItems.get(e.id);if(!t)return console.warn("[EngineGis] Cannot set GIS calibration: model not found.",e.id),!1;const n=this.normalizeOffset(e.offset),r=this.normalizeRotation(e.rotation),s=this.engine.applyCalibration({url:t.url,matrix:t.baseMatrix,offset:[n.east,n.north,n.up,r.heading,r.pitch,r.roll],rotationUnit:"degrees"});if(s){const o={...t,offset:n,rotation:r,rotationUnit:"degrees"};this.calibrationItems.set(t.id,o),this.emitGisCalibrationChanged(o,"apply")}return s}resetModelCalibration(e){if(!this._isInitialized||!this.engine)return console.warn("[EngineGis] Cannot reset GIS calibration: engine not initialized."),!1;const t=this.calibrationItems.get(e);if(!t)return console.warn("[EngineGis] Cannot reset GIS calibration: model not found.",e),!1;const n=this.engine.applyCalibration({url:t.url,matrix:t.baseMatrix});if(n){const r={...t,offset:this.createZeroOffset(),rotation:this.createZeroRotation(),rotationUnit:"degrees"};this.calibrationItems.set(t.id,r),this.emitGisCalibrationChanged(r,"reset")}return n}destroy(){this.viewDropdown?.destroy(),this.viewDropdown=null,this.engine&&(this.engine.dispose(),this.engine=null),this.calibrationItems.clear(),this._isInitialized=!1,this._isDestroyed=!0,this.initPromise=null}record3DTilesCalibrationItem(e){if(e.type!=="3dtiles")return;const t=e.source||"";if(!t){console.warn("[EngineGis] GIS 3D Tiles model source is empty, skip calibration record.",e);return}const n=this.extractModelMatrix(e)??[...Mht];this.calibrationItems.set(e.id,{id:e.id,name:e.name||e.id,url:t,source:e.source,type:"3dtiles",offset:this.createZeroOffset(),rotation:this.createZeroRotation(),rotationUnit:"degrees",baseMatrix:n})}extractModelMatrix(e){const n=(e.primitive??e.raw)?.modelMatrix;if(!n)return null;const r=Array.from({length:16},(s,o)=>Number(n[o]));return r.every(Number.isFinite)?r:null}cloneCalibrationItem(e){return{...e,offset:{...e.offset},rotation:{...e.rotation},baseMatrix:[...e.baseMatrix]}}emitGisCalibrationChanged(e,t){const n={...this.cloneCalibrationItem(e),action:t,timestamp:Date.now()};this.registry.emit("gis:calibration:changed",n)}createZeroOffset(){return{east:0,north:0,up:0}}createZeroRotation(){return{heading:0,pitch:0,roll:0}}normalizeOffset(e){return{east:this.normalizeNumber(e?.east),north:this.normalizeNumber(e?.north),up:this.normalizeNumber(e?.up)}}normalizeRotation(e){return{heading:this.normalizeNumber(e?.heading),pitch:this.normalizeNumber(e?.pitch),roll:this.normalizeNumber(e?.roll)}}normalizeNumber(e){const t=Number(e);if(!Number.isFinite(t))return 0;const n=Math.abs(t)<1e-10?0:Number(t.toFixed(6));return Object.is(n,-0)?0:n}}class Pht extends Mc{container;engineInstance=null;constructor(e,t){super(t),this.container=e}async initialize(e){this.engineInstance&&this.engineInstance.isInitialized()&&(console.warn("[EngineGisManager] GIS Engine already initialized. Destroying old instance..."),this.engineInstance.destroy(),this.engineInstance=null);try{const t=new Iht({container:this.container,...e},this.registry);return this.engineInstance=t,await t.init(),this.engineInstance===t&&t.isInitialized()}catch(t){return console.error("[EngineGisManager] Failed to initialize GIS engine:",t),this.engineInstance=null,!1}}isInitialized(){return this.engineInstance!==null&&this.engineInstance.isInitialized()}pickPoint(){return this.engineInstance?this.engineInstance.pickPoint():(console.warn("[EngineGisManager] GIS Engine not initialized."),Promise.resolve(null))}startPickPoint(e){return this.engineInstance?this.engineInstance.startPickPoint(e):(console.warn("[EngineGisManager] GIS Engine not initialized."),Promise.resolve(null))}createLabel(e){if(!this.engineInstance){console.warn("[EngineGisManager] GIS Engine not initialized.");return}return this.engineInstance.createLabel(e)}createLabels(e,t){return this.engineInstance?this.engineInstance.createLabels(e,t):(console.warn("[EngineGisManager] GIS Engine not initialized."),[])}updateLabel(e,t){return this.engineInstance?this.engineInstance.updateLabel(e,t):(console.warn("[EngineGisManager] GIS Engine not initialized."),!1)}deleteLabel(e){return this.engineInstance?this.engineInstance.deleteLabel(e):(console.warn("[EngineGisManager] GIS Engine not initialized."),!1)}removeLabel(e){return this.engineInstance?this.engineInstance.removeLabel(e):(console.warn("[EngineGisManager] GIS Engine not initialized."),!1)}clearLabels(){if(!this.engineInstance){console.warn("[EngineGisManager] GIS Engine not initialized.");return}this.engineInstance.clearLabels()}getLabel(e){if(!this.engineInstance){console.warn("[EngineGisManager] GIS Engine not initialized.");return}return this.engineInstance.getLabel(e)}getLabels(){return this.engineInstance?this.engineInstance.getLabels():(console.warn("[EngineGisManager] GIS Engine not initialized."),[])}onLabelClick(e){return this.engineInstance?this.engineInstance.onLabelClick(e):(console.warn("[EngineGisManager] GIS Engine not initialized."),()=>{})}offLabelClick(e){if(!this.engineInstance){console.warn("[EngineGisManager] GIS Engine not initialized.");return}this.engineInstance.offLabelClick(e)}saveMainViewPort(){return this.engineInstance?this.engineInstance.saveMainViewPort():(console.warn("[EngineGisManager] GIS Engine not initialized."),null)}setMainViewPort(e){if(!this.engineInstance){console.warn("[EngineGisManager] GIS Engine not initialized.");return}this.engineInstance.setMainViewPort(e)}goToMainPort(){if(!this.engineInstance){console.warn("[EngineGisManager] GIS Engine not initialized.");return}this.engineInstance.goToMainPort()}resetMainViewPort(){if(!this.engineInstance){console.warn("[EngineGisManager] GIS Engine not initialized.");return}this.engineInstance.resetMainViewPort()}load3DTiles(e){return this.engineInstance?this.engineInstance.load3DTiles(e):(console.warn("[EngineGisManager] GIS Engine not initialized."),Promise.resolve(null))}loadModelByViewToken(e){return this.engineInstance?this.engineInstance.loadModelByViewToken(e):(console.warn("[EngineGisManager] GIS Engine not initialized."),Promise.resolve(null))}openModelCalibrationDock(){this.registry.bottomDock?.open("gisModelCalibration")}getModelCalibrationItems(){return this.engineInstance?this.engineInstance.getModelCalibrationItems():[]}setModelCalibrationTransform(e){return this.engineInstance?this.engineInstance.setModelCalibrationTransform(e):(console.warn("[EngineGisManager] GIS Engine not initialized."),!1)}resetModelCalibration(e){return this.engineInstance?this.engineInstance.resetModelCalibration(e):(console.warn("[EngineGisManager] GIS Engine not initialized."),!1)}destroy(){this.engineInstance&&(this.engineInstance.destroy(),this.engineInstance=null),super.destroy()}}class Dht{element;options;items=[];bodyEl;emptyEl;rowRefs=[];constructor(e={}){this.options=e}init(){this.element=this.createPanel()}setItems(e){this.items=e,this.renderRows()}setTheme(e){if(!this.element)return;const t=this.element.style;t.setProperty("--gmcal-text-primary",e.textPrimary),t.setProperty("--gmcal-text-secondary",e.textSecondary),t.setProperty("--gmcal-border",e.borderSubtle),t.setProperty("--gmcal-bg-inset",e.bgInset),t.setProperty("--gmcal-bg-elevated",e.bgElevated),t.setProperty("--gmcal-primary",e.primary),t.setProperty("--gmcal-primary-subtle",e.primarySubtle)}setLocales(){this.element&&this.element.querySelectorAll("[data-i18n]").forEach(e=>{const t=e.dataset.i18n;t&&(e.textContent=At(t))})}destroy(){this.rowRefs=[],this.element?.remove()}createPanel(){const e=document.createElement("div");e.className="gis-model-calibration-dock-panel";const t=document.createElement("div");t.className="gis-model-calibration-table-wrap";const n=document.createElement("table");return n.className="gis-model-calibration-table",n.appendChild(this.createHead()),this.bodyEl=document.createElement("tbody"),n.appendChild(this.bodyEl),t.appendChild(n),this.emptyEl=document.createElement("div"),this.emptyEl.className="gis-model-calibration-empty",this.emptyEl.dataset.i18n="gisModelCalibration.empty",this.emptyEl.textContent=At("gisModelCalibration.empty"),t.appendChild(this.emptyEl),e.append(t),e}createHead(){const e=document.createElement("thead"),t=document.createElement("tr");return["gisModelCalibration.model","gisModelCalibration.longitude","gisModelCalibration.latitude","gisModelCalibration.height","gisModelCalibration.heading","gisModelCalibration.pitch","gisModelCalibration.roll","gisModelCalibration.actions"].forEach(n=>{const r=document.createElement("th");r.dataset.i18n=n,r.textContent=At(n),t.appendChild(r)}),e.appendChild(t),e}renderRows(){this.bodyEl&&(this.bodyEl.innerHTML="",this.rowRefs=[],this.emptyEl.classList.toggle("is-visible",this.items.length===0),this.items.forEach(e=>{const t=document.createElement("tr"),n={item:e,offsetInputs:this.createOffsetInputs(e.offset),rotationInputs:this.createRotationInputs(e.rotation)};t.appendChild(this.createModelCell(e)),t.appendChild(this.createInputCell(n.offsetInputs.east)),t.appendChild(this.createInputCell(n.offsetInputs.north)),t.appendChild(this.createInputCell(n.offsetInputs.up)),t.appendChild(this.createInputCell(n.rotationInputs.heading)),t.appendChild(this.createInputCell(n.rotationInputs.pitch)),t.appendChild(this.createInputCell(n.rotationInputs.roll)),t.appendChild(this.createActionCell(n)),this.rowRefs.push(n),this.bodyEl.appendChild(t)}))}createModelCell(e){const t=document.createElement("td");t.className="gis-model-calibration-model-cell";const n=document.createElement("div");return n.className="gis-model-calibration-model-name",n.textContent=e.name,n.title=`${e.name}
|
|
4370
4370
|
${e.url}`,t.appendChild(n),t}createOffsetInputs(e){return{east:this.createNumberInput(e.east),north:this.createNumberInput(e.north),up:this.createNumberInput(e.up)}}createRotationInputs(e){return{heading:this.createNumberInput(e.heading),pitch:this.createNumberInput(e.pitch),roll:this.createNumberInput(e.roll)}}createNumberInput(e){const t=document.createElement("input");return t.type="number",t.className="gis-model-calibration-input",t.step="0.01",t.value=this.formatNumber(e),t}createInputCell(e){const t=document.createElement("td");return t.className="gis-model-calibration-input-cell",t.appendChild(e),t}createActionCell(e){const t=document.createElement("td");t.className="gis-model-calibration-action-cell";const n=document.createElement("button");n.type="button",n.className="gis-model-calibration-btn is-primary",n.textContent="✓",n.title=At("gisModelCalibration.apply"),n.setAttribute("aria-label",At("gisModelCalibration.apply")),n.addEventListener("click",()=>{this.options.onApply?.({id:e.item.id,offset:this.readOffset(e.offsetInputs),rotation:this.readRotation(e.rotationInputs)})||this.flashError(n)});const r=document.createElement("button");return r.type="button",r.className="gis-model-calibration-btn",r.textContent="↻",r.title=At("gisModelCalibration.reset"),r.setAttribute("aria-label",At("gisModelCalibration.reset")),r.addEventListener("click",()=>{this.options.onReset?.(e.item.id)||this.flashError(r)}),t.append(n,r),t}readOffset(e){return{east:this.readInput(e.east),north:this.readInput(e.north),up:this.readInput(e.up)}}readRotation(e){return{heading:this.readInput(e.heading),pitch:this.readInput(e.pitch),roll:this.readInput(e.roll)}}readInput(e){const t=Number(e.value);return Number.isFinite(t)?t:0}flashError(e){e.classList.add("is-error"),window.setTimeout(()=>e.classList.remove("is-error"),600)}formatNumber(e){if(!Number.isFinite(e))return"0";const t=Math.abs(e)<1e-10?0:Number(e.toFixed(4));return String(Object.is(t,-0)?0:t)}}class Rht extends Mc{panel=null;unsubscribeTheme=null;unsubscribeLocale=null;unsubscribeDockState=null;unsubscribeModelLoaded=null;constructor(e){super(e)}init(){this.unsubscribeTheme||(this.unsubscribeTheme=qi.subscribe(()=>this.applyPresentation())),this.unsubscribeLocale||(this.unsubscribeLocale=dr.subscribe(()=>this.applyPresentation())),this.unsubscribeDockState||(this.unsubscribeDockState=this.registry.bottomDock?.onStateChange(e=>{e.id==="gisModelCalibration"&&e.open&&this.refreshPanel()})??null),this.unsubscribeModelLoaded||(this.unsubscribeModelLoaded=this.registry.on("gis:model-loaded",()=>{this.registry.bottomDock?.isOpen("gisModelCalibration")&&this.refreshPanel()}))}destroy(){this.unsubscribeTheme?.(),this.unsubscribeTheme=null,this.unsubscribeLocale?.(),this.unsubscribeLocale=null,this.unsubscribeDockState?.(),this.unsubscribeDockState=null,this.unsubscribeModelLoaded?.(),this.unsubscribeModelLoaded=null,this.panel?.destroy(),this.panel=null,super.destroy()}getPanelElement(){return this.panel||(this.panel=new Dht({onApply:({id:e,offset:t,rotation:n})=>this.applyCalibration(e,t,n),onReset:e=>this.resetCalibration(e),onRefresh:()=>this.refreshPanel()}),this.panel.init()),this.applyPresentation(),this.refreshPanel(),this.panel.element}applyCalibration(e,t,n){const r=this.registry.engineGis?.setModelCalibrationTransform({id:e,offset:t,rotation:n})??!1;return r&&this.refreshPanel(),r}resetCalibration(e){const t=this.registry.engineGis?.resetModelCalibration(e)??!1;return t&&this.refreshPanel(),t}refreshPanel(){this.panel&&this.panel.setItems(this.registry.engineGis?.getModelCalibrationItems()??[])}applyPresentation(){this.panel&&(this.panel.setTheme(qi.getTheme()),this.panel.setLocales())}}class Lht{container;registry;engine=null;ready;bottomDock=null;gisModelCalibrationDock=null;constructor(e,t){const n=typeof e=="string"?document.getElementById(e):e;if(!n)throw new Error("Container not found");this.container=n,this.registry=new jI,t?.locale&&dr.setLocale(t.locale),t?.theme&&t.theme!=="custom"&&qi.setTheme(t.theme),this.engine=new Pht(this.container,this.registry),this.registry.engineGis=this.engine,this.ready=this.engine.initialize({imageryUrl:t?.imageryUrl,initialView:t?.initialView,showCredit:t?.showCredit,showStats:t?.showStats}),this.bottomDock=new jZ(this.container,this.registry,{registerDefaults:!1}),this.registry.bottomDock=this.bottomDock,this.gisModelCalibrationDock=new Rht(this.registry),this.registry.gisModelCalibrationDock=this.gisModelCalibrationDock,this.gisModelCalibrationDock.init(),this.bottomDock.register({id:"gisModelCalibration",title:"GIS 模型校验",createContent:()=>this.registry.gisModelCalibrationDock?.getPanelElement()??this.bottomDock.createPlaceholderContent("GIS 模型校验面板占位")})}on(e,t){return this.registry.on(e,t)}off(e,t){this.registry.off(e,t)}saveMainViewPort(){return this.engine?.saveMainViewPort()??null}setMainViewPort(e){this.engine?.setMainViewPort(e)}goToMainPort(){this.engine?.goToMainPort()}resetMainViewPort(){this.engine?.resetMainViewPort()}async loadModelByViewToken(e){return await this.ready,this.engine?.loadModelByViewToken(e)??null}destroy(){this.gisModelCalibrationDock?.destroy(),this.gisModelCalibrationDock=null,this.bottomDock?.destroy(),this.bottomDock=null,this.engine?.destroy(),this.engine=null,this.registry.reset()}}const y8="183",Oht={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},Nht={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},Gbe=0,QZ=1,jbe=2,Bht=3,Fht=0,rO=1,Wbe=2,WI=3,Dv=0,cd=1,x_=2,w_=0,DE=1,KZ=2,JZ=3,ZZ=4,$be=5,kht=6,KA=100,qbe=101,Xbe=102,Ybe=103,Qbe=104,Kbe=200,Jbe=201,Zbe=202,eAe=203,v8=204,b8=205,tAe=206,iAe=207,nAe=208,rAe=209,sAe=210,oAe=211,aAe=212,lAe=213,cAe=214,A8=0,x8=1,w8=2,RE=3,E8=4,S8=5,T8=6,C8=7,sO=0,hAe=1,uAe=2,jg=0,eee=1,tee=2,iee=3,nee=4,ree=5,see=6,oee=7,aee="attached",dAe="detached",M8=300,E_=301,JA=302,oO=303,aO=304,$I=306,lO=1e3,hp=1001,cO=1002,kl=1003,lee=1004,Uht=1004,qI=1005,zht=1005,ua=1006,hO=1007,Hht=1007,S_=1008,Vht=1008,up=1009,cee=1010,hee=1011,XI=1012,I8=1013,wm=1014,hd=1015,T_=1016,P8=1017,D8=1018,YI=1020,uee=35902,dee=35899,pee=1021,fee=1022,ud=1023,C_=1026,ZA=1027,R8=1028,uO=1029,LE=1030,L8=1031,Ght=1032,O8=1033,dO=33776,pO=33777,fO=33778,mO=33779,N8=35840,B8=35841,F8=35842,k8=35843,U8=36196,z8=37492,H8=37496,V8=37488,G8=37489,j8=37490,W8=37491,$8=37808,q8=37809,X8=37810,Y8=37811,Q8=37812,K8=37813,J8=37814,Z8=37815,e6=37816,t6=37817,i6=37818,n6=37819,r6=37820,s6=37821,o6=36492,a6=36494,l6=36495,c6=36283,h6=36284,u6=36285,d6=36286,pAe=2200,fAe=2201,mAe=2202,gO=2300,p6=2301,f6=2302,mee=2303,OE=2400,NE=2401,_O=2402,m6=2500,gee=2501,jht=0,Wht=1,$ht=2,gAe=3200,qht=3201,Xht=3202,Yht=3203,ex=0,_Ae=1,Rv="",dp="srgb",BE="srgb-linear",yO="linear",oo="srgb",Qht="",Kht="rg",Jht="ga",Zht=0,FE=7680,eut=7681,tut=7682,iut=7683,nut=34055,rut=34056,sut=5386,out=512,aut=513,lut=514,cut=515,hut=516,uut=517,dut=518,_ee=519,yAe=512,vAe=513,bAe=514,g6=515,AAe=516,xAe=517,_6=518,wAe=519,vO=35044,put=35048,fut=35040,mut=35045,gut=35049,_ut=35041,yut=35046,vut=35050,but=35042,Aut="100",yee="300 es",uf=2e3,kE=2001,xut={COMPUTE:"compute",RENDER:"render"},wut={PERSPECTIVE:"perspective",LINEAR:"linear",FLAT:"flat"},Eut={NORMAL:"normal",CENTROID:"centroid",SAMPLE:"sample",FIRST:"first",EITHER:"either"},Sut={TEXTURE_COMPARE:"depthTextureCompare"};function Tut(i){for(let e=i.length-1;e>=0;--e)if(i[e]>=65535)return!0;return!1}const Cut={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function QI(i,e){return new Cut[i](e)}function EAe(i){return ArrayBuffer.isView(i)&&!(i instanceof DataView)}function bO(i){return document.createElementNS("http://www.w3.org/1999/xhtml",i)}function SAe(){const i=bO("canvas");return i.style.display="block",i}const TAe={};let tx=null;function Mut(i){tx=i}function Iut(){return tx}function AO(...i){const e="THREE."+i.shift();tx?tx("log",e,...i):console.log(e,...i)}function CAe(i){const e=i[0];if(typeof e=="string"&&e.startsWith("TSL:")){const t=i[1];t&&t.isStackTrace?i[0]+=" "+t.getLocation():i[1]='Stack trace not available. Enable "THREE.Node.captureStackTrace" to capture stack traces.'}return i}function Oi(...i){i=CAe(i);const e="THREE."+i.shift();if(tx)tx("warn",e,...i);else{const t=i[0];t&&t.isStackTrace?console.warn(t.getError(e)):console.warn(e,...i)}}function xn(...i){i=CAe(i);const e="THREE."+i.shift();if(tx)tx("error",e,...i);else{const t=i[0];t&&t.isStackTrace?console.error(t.getError(e)):console.error(e,...i)}}function xO(...i){const e=i.join(" ");e in TAe||(TAe[e]=!0,Oi(...i))}function Put(i,e,t){return new Promise(function(n,r){function s(){switch(i.clientWaitSync(e,i.SYNC_FLUSH_COMMANDS_BIT,0)){case i.WAIT_FAILED:r();break;case i.TIMEOUT_EXPIRED:setTimeout(s,t);break;default:n()}}setTimeout(s,t)})}const Dut={[A8]:x8,[w8]:T8,[E8]:C8,[RE]:S8,[x8]:A8,[T8]:w8,[C8]:E8,[S8]:RE};class M_{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){const n=this._listeners;return n===void 0?!1:n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){const n=this._listeners;if(n===void 0)return;const r=n[e];if(r!==void 0){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}}dispatchEvent(e){const t=this._listeners;if(t===void 0)return;const n=t[e.type];if(n!==void 0){e.target=this;const r=n.slice(0);for(let s=0,o=r.length;s<o;s++)r[s].call(this,e);e.target=null}}}const _u=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let MAe=1234567;const UE=Math.PI/180,KI=180/Math.PI;function df(){const i=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(_u[i&255]+_u[i>>8&255]+_u[i>>16&255]+_u[i>>24&255]+"-"+_u[e&255]+_u[e>>8&255]+"-"+_u[e>>16&15|64]+_u[e>>24&255]+"-"+_u[t&63|128]+_u[t>>8&255]+"-"+_u[t>>16&255]+_u[t>>24&255]+_u[n&255]+_u[n>>8&255]+_u[n>>16&255]+_u[n>>24&255]).toLowerCase()}function Xn(i,e,t){return Math.max(e,Math.min(t,i))}function vee(i,e){return(i%e+e)%e}function Rut(i,e,t,n,r){return n+(i-e)*(r-n)/(t-e)}function Lut(i,e,t){return i!==e?(t-i)/(e-i):0}function wO(i,e,t){return(1-t)*i+t*e}function Out(i,e,t,n){return wO(i,e,1-Math.exp(-t*n))}function Nut(i,e=1){return e-Math.abs(vee(i,e*2)-e)}function But(i,e,t){return i<=e?0:i>=t?1:(i=(i-e)/(t-e),i*i*(3-2*i))}function Fut(i,e,t){return i<=e?0:i>=t?1:(i=(i-e)/(t-e),i*i*i*(i*(i*6-15)+10))}function kut(i,e){return i+Math.floor(Math.random()*(e-i+1))}function Uut(i,e){return i+Math.random()*(e-i)}function zut(i){return i*(.5-Math.random())}function Hut(i){i!==void 0&&(MAe=i);let e=MAe+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function Vut(i){return i*UE}function Gut(i){return i*KI}function jut(i){return(i&i-1)===0&&i!==0}function Wut(i){return Math.pow(2,Math.ceil(Math.log(i)/Math.LN2))}function $ut(i){return Math.pow(2,Math.floor(Math.log(i)/Math.LN2))}function qut(i,e,t,n,r){const s=Math.cos,o=Math.sin,a=s(t/2),l=o(t/2),c=s((e+n)/2),h=o((e+n)/2),u=s((e-n)/2),d=o((e-n)/2),p=s((n-e)/2),f=o((n-e)/2);switch(r){case"XYX":i.set(a*h,l*u,l*d,a*c);break;case"YZY":i.set(l*d,a*h,l*u,a*c);break;case"ZXZ":i.set(l*u,l*d,a*h,a*c);break;case"XZX":i.set(a*h,l*f,l*p,a*c);break;case"YXY":i.set(l*p,a*h,l*f,a*c);break;case"ZYZ":i.set(l*f,l*p,a*h,a*c);break;default:Oi("MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function dd(i,e){switch(e.constructor){case Float32Array:return i;case Uint32Array:return i/4294967295;case Uint16Array:return i/65535;case Uint8Array:return i/255;case Int32Array:return Math.max(i/2147483647,-1);case Int16Array:return Math.max(i/32767,-1);case Int8Array:return Math.max(i/127,-1);default:throw new Error("Invalid component type.")}}function Tr(i,e){switch(e.constructor){case Float32Array:return i;case Uint32Array:return Math.round(i*4294967295);case Uint16Array:return Math.round(i*65535);case Uint8Array:return Math.round(i*255);case Int32Array:return Math.round(i*2147483647);case Int16Array:return Math.round(i*32767);case Int8Array:return Math.round(i*127);default:throw new Error("Invalid component type.")}}const Xut={DEG2RAD:UE,RAD2DEG:KI,generateUUID:df,clamp:Xn,euclideanModulo:vee,mapLinear:Rut,inverseLerp:Lut,lerp:wO,damp:Out,pingpong:Nut,smoothstep:But,smootherstep:Fut,randInt:kut,randFloat:Uut,randFloatSpread:zut,seededRandom:Hut,degToRad:Vut,radToDeg:Gut,isPowerOfTwo:jut,ceilPowerOfTwo:Wut,floorPowerOfTwo:$ut,setQuaternionFromProperEuler:qut,normalize:Tr,denormalize:dd};class pi{constructor(e=0,t=0){pi.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Xn(this.x,e.x,t.x),this.y=Xn(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=Xn(this.x,e,t),this.y=Xn(this.y,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Xn(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(Xn(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const n=Math.cos(t),r=Math.sin(t),s=this.x-e.x,o=this.y-e.y;return this.x=s*n-o*r+e.x,this.y=s*r+o*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class pd{constructor(e=0,t=0,n=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=r}static slerpFlat(e,t,n,r,s,o,a){let l=n[r+0],c=n[r+1],h=n[r+2],u=n[r+3],d=s[o+0],p=s[o+1],f=s[o+2],g=s[o+3];if(u!==g||l!==d||c!==p||h!==f){let _=l*d+c*p+h*f+u*g;_<0&&(d=-d,p=-p,f=-f,g=-g,_=-_);let y=1-a;if(_<.9995){const A=Math.acos(_),x=Math.sin(A);y=Math.sin(y*A)/x,a=Math.sin(a*A)/x,l=l*y+d*a,c=c*y+p*a,h=h*y+f*a,u=u*y+g*a}else{l=l*y+d*a,c=c*y+p*a,h=h*y+f*a,u=u*y+g*a;const A=1/Math.sqrt(l*l+c*c+h*h+u*u);l*=A,c*=A,h*=A,u*=A}}e[t]=l,e[t+1]=c,e[t+2]=h,e[t+3]=u}static multiplyQuaternionsFlat(e,t,n,r,s,o){const a=n[r],l=n[r+1],c=n[r+2],h=n[r+3],u=s[o],d=s[o+1],p=s[o+2],f=s[o+3];return e[t]=a*f+h*u+l*p-c*d,e[t+1]=l*f+h*d+c*u-a*p,e[t+2]=c*f+h*p+a*d-l*u,e[t+3]=h*f-a*u-l*d-c*p,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const n=e._x,r=e._y,s=e._z,o=e._order,a=Math.cos,l=Math.sin,c=a(n/2),h=a(r/2),u=a(s/2),d=l(n/2),p=l(r/2),f=l(s/2);switch(o){case"XYZ":this._x=d*h*u+c*p*f,this._y=c*p*u-d*h*f,this._z=c*h*f+d*p*u,this._w=c*h*u-d*p*f;break;case"YXZ":this._x=d*h*u+c*p*f,this._y=c*p*u-d*h*f,this._z=c*h*f-d*p*u,this._w=c*h*u+d*p*f;break;case"ZXY":this._x=d*h*u-c*p*f,this._y=c*p*u+d*h*f,this._z=c*h*f+d*p*u,this._w=c*h*u-d*p*f;break;case"ZYX":this._x=d*h*u-c*p*f,this._y=c*p*u+d*h*f,this._z=c*h*f-d*p*u,this._w=c*h*u+d*p*f;break;case"YZX":this._x=d*h*u+c*p*f,this._y=c*p*u+d*h*f,this._z=c*h*f-d*p*u,this._w=c*h*u-d*p*f;break;case"XZY":this._x=d*h*u-c*p*f,this._y=c*p*u-d*h*f,this._z=c*h*f+d*p*u,this._w=c*h*u+d*p*f;break;default:Oi("Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],r=t[4],s=t[8],o=t[1],a=t[5],l=t[9],c=t[2],h=t[6],u=t[10],d=n+a+u;if(d>0){const p=.5/Math.sqrt(d+1);this._w=.25/p,this._x=(h-l)*p,this._y=(s-c)*p,this._z=(o-r)*p}else if(n>a&&n>u){const p=2*Math.sqrt(1+n-a-u);this._w=(h-l)/p,this._x=.25*p,this._y=(r+o)/p,this._z=(s+c)/p}else if(a>u){const p=2*Math.sqrt(1+a-n-u);this._w=(s-c)/p,this._x=(r+o)/p,this._y=.25*p,this._z=(l+h)/p}else{const p=2*Math.sqrt(1+u-n-a);this._w=(o-r)/p,this._x=(s+c)/p,this._y=(l+h)/p,this._z=.25*p}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<1e-8?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Xn(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(n===0)return this;const r=Math.min(1,t/n);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,r=e._y,s=e._z,o=e._w,a=t._x,l=t._y,c=t._z,h=t._w;return this._x=n*h+o*a+r*c-s*l,this._y=r*h+o*l+s*a-n*c,this._z=s*h+o*c+n*l-r*a,this._w=o*h-n*a-r*l-s*c,this._onChangeCallback(),this}slerp(e,t){let n=e._x,r=e._y,s=e._z,o=e._w,a=this.dot(e);a<0&&(n=-n,r=-r,s=-s,o=-o,a=-a);let l=1-t;if(a<.9995){const c=Math.acos(a),h=Math.sin(c);l=Math.sin(l*c)/h,t=Math.sin(t*c)/h,this._x=this._x*l+n*t,this._y=this._y*l+r*t,this._z=this._z*l+s*t,this._w=this._w*l+o*t,this._onChangeCallback()}else this._x=this._x*l+n*t,this._y=this._y*l+r*t,this._z=this._z*l+s*t,this._w=this._w*l+o*t,this.normalize();return this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),r=Math.sqrt(1-n),s=Math.sqrt(n);return this.set(r*Math.sin(e),r*Math.cos(e),s*Math.sin(t),s*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class ht{constructor(e=0,t=0,n=0){ht.prototype.isVector3=!0,this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(IAe.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(IAe.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[3]*n+s[6]*r,this.y=s[1]*t+s[4]*n+s[7]*r,this.z=s[2]*t+s[5]*n+s[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,r=this.z,s=e.elements,o=1/(s[3]*t+s[7]*n+s[11]*r+s[15]);return this.x=(s[0]*t+s[4]*n+s[8]*r+s[12])*o,this.y=(s[1]*t+s[5]*n+s[9]*r+s[13])*o,this.z=(s[2]*t+s[6]*n+s[10]*r+s[14])*o,this}applyQuaternion(e){const t=this.x,n=this.y,r=this.z,s=e.x,o=e.y,a=e.z,l=e.w,c=2*(o*r-a*n),h=2*(a*t-s*r),u=2*(s*n-o*t);return this.x=t+l*c+o*u-a*h,this.y=n+l*h+a*c-s*u,this.z=r+l*u+s*h-o*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,n=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[4]*n+s[8]*r,this.y=s[1]*t+s[5]*n+s[9]*r,this.z=s[2]*t+s[6]*n+s[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Xn(this.x,e.x,t.x),this.y=Xn(this.y,e.y,t.y),this.z=Xn(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=Xn(this.x,e,t),this.y=Xn(this.y,e,t),this.z=Xn(this.z,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Xn(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,r=e.y,s=e.z,o=t.x,a=t.y,l=t.z;return this.x=r*l-s*a,this.y=s*o-n*l,this.z=n*a-r*o,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return bee.copy(this).projectOnVector(e),this.sub(bee)}reflect(e){return this.sub(bee.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(Xn(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){const r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const bee=new ht,IAe=new pd;class Ar{constructor(e,t,n,r,s,o,a,l,c){Ar.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,n,r,s,o,a,l,c)}set(e,t,n,r,s,o,a,l,c){const h=this.elements;return h[0]=e,h[1]=r,h[2]=a,h[3]=t,h[4]=s,h[5]=l,h[6]=n,h[7]=o,h[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,r=t.elements,s=this.elements,o=n[0],a=n[3],l=n[6],c=n[1],h=n[4],u=n[7],d=n[2],p=n[5],f=n[8],g=r[0],_=r[3],y=r[6],A=r[1],x=r[4],w=r[7],E=r[2],S=r[5],I=r[8];return s[0]=o*g+a*A+l*E,s[3]=o*_+a*x+l*S,s[6]=o*y+a*w+l*I,s[1]=c*g+h*A+u*E,s[4]=c*_+h*x+u*S,s[7]=c*y+h*w+u*I,s[2]=d*g+p*A+f*E,s[5]=d*_+p*x+f*S,s[8]=d*y+p*w+f*I,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],h=e[8];return t*o*h-t*a*c-n*s*h+n*a*l+r*s*c-r*o*l}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],h=e[8],u=h*o-a*c,d=a*l-h*s,p=c*s-o*l,f=t*u+n*d+r*p;if(f===0)return this.set(0,0,0,0,0,0,0,0,0);const g=1/f;return e[0]=u*g,e[1]=(r*c-h*n)*g,e[2]=(a*n-r*o)*g,e[3]=d*g,e[4]=(h*t-r*l)*g,e[5]=(r*s-a*t)*g,e[6]=p*g,e[7]=(n*l-c*t)*g,e[8]=(o*t-n*s)*g,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,r,s,o,a){const l=Math.cos(s),c=Math.sin(s);return this.set(n*l,n*c,-n*(l*o+c*a)+o+e,-r*c,r*l,-r*(-c*o+l*a)+a+t,0,0,1),this}scale(e,t){return this.premultiply(Aee.makeScale(e,t)),this}rotate(e){return this.premultiply(Aee.makeRotation(-e)),this}translate(e,t){return this.premultiply(Aee.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,n=e.elements;for(let r=0;r<9;r++)if(t[r]!==n[r])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const Aee=new Ar,PAe=new Ar().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),DAe=new Ar().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function Yut(){const i={enabled:!0,workingColorSpace:BE,spaces:{},convert:function(r,s,o){return this.enabled===!1||s===o||!s||!o||(this.spaces[s].transfer===oo&&(r.r=Lv(r.r),r.g=Lv(r.g),r.b=Lv(r.b)),this.spaces[s].primaries!==this.spaces[o].primaries&&(r.applyMatrix3(this.spaces[s].toXYZ),r.applyMatrix3(this.spaces[o].fromXYZ)),this.spaces[o].transfer===oo&&(r.r=JI(r.r),r.g=JI(r.g),r.b=JI(r.b))),r},workingToColorSpace:function(r,s){return this.convert(r,this.workingColorSpace,s)},colorSpaceToWorking:function(r,s){return this.convert(r,s,this.workingColorSpace)},getPrimaries:function(r){return this.spaces[r].primaries},getTransfer:function(r){return r===Rv?yO:this.spaces[r].transfer},getToneMappingMode:function(r){return this.spaces[r].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(r,s=this.workingColorSpace){return r.fromArray(this.spaces[s].luminanceCoefficients)},define:function(r){Object.assign(this.spaces,r)},_getMatrix:function(r,s,o){return r.copy(this.spaces[s].toXYZ).multiply(this.spaces[o].fromXYZ)},_getDrawingBufferColorSpace:function(r){return this.spaces[r].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(r=this.workingColorSpace){return this.spaces[r].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(r,s){return xO("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),i.workingToColorSpace(r,s)},toWorkingColorSpace:function(r,s){return xO("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),i.colorSpaceToWorking(r,s)}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],n=[.3127,.329];return i.define({[BE]:{primaries:e,whitePoint:n,transfer:yO,toXYZ:PAe,fromXYZ:DAe,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:dp},outputColorSpaceConfig:{drawingBufferColorSpace:dp}},[dp]:{primaries:e,whitePoint:n,transfer:oo,toXYZ:PAe,fromXYZ:DAe,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:dp}}}),i}const _s=Yut();function Lv(i){return i<.04045?i*.0773993808:Math.pow(i*.9478672986+.0521327014,2.4)}function JI(i){return i<.0031308?i*12.92:1.055*Math.pow(i,.41666)-.055}let ZI;class RAe{static getDataURL(e,t="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{ZI===void 0&&(ZI=bO("canvas")),ZI.width=e.width,ZI.height=e.height;const r=ZI.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),n=ZI}return n.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=bO("canvas");t.width=e.width,t.height=e.height;const n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);const r=n.getImageData(0,0,e.width,e.height),s=r.data;for(let o=0;o<s.length;o++)s[o]=Lv(s[o]/255)*255;return n.putImageData(r,0,0),t}else if(e.data){const t=e.data.slice(0);for(let n=0;n<t.length;n++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[n]=Math.floor(Lv(t[n]/255)*255):t[n]=Lv(t[n]);return{data:t,width:e.width,height:e.height}}else return Oi("ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let Qut=0;class ix{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:Qut++}),this.uuid=df(),this.data=e,this.dataReady=!0,this.version=0}getSize(e){const t=this.data;return typeof HTMLVideoElement<"u"&&t instanceof HTMLVideoElement?e.set(t.videoWidth,t.videoHeight,0):typeof VideoFrame<"u"&&t instanceof VideoFrame?e.set(t.displayHeight,t.displayWidth,0):t!==null?e.set(t.width,t.height,t.depth||0):e.set(0,0,0),e}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const n={uuid:this.uuid,url:""},r=this.data;if(r!==null){let s;if(Array.isArray(r)){s=[];for(let o=0,a=r.length;o<a;o++)r[o].isDataTexture?s.push(xee(r[o].image)):s.push(xee(r[o]))}else s=xee(r);n.url=s}return t||(e.images[this.uuid]=n),n}}function xee(i){return typeof HTMLImageElement<"u"&&i instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&i instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&i instanceof ImageBitmap?RAe.getDataURL(i):i.data?{data:Array.from(i.data),width:i.width,height:i.height,type:i.data.constructor.name}:(Oi("Texture: Unable to serialize Texture."),{})}let Kut=0;const wee=new ht;class dl extends M_{constructor(e=dl.DEFAULT_IMAGE,t=dl.DEFAULT_MAPPING,n=hp,r=hp,s=ua,o=S_,a=ud,l=up,c=dl.DEFAULT_ANISOTROPY,h=Rv){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:Kut++}),this.uuid=df(),this.name="",this.source=new ix(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=r,this.magFilter=s,this.minFilter=o,this.anisotropy=c,this.format=a,this.internalFormat=null,this.type=l,this.offset=new pi(0,0),this.repeat=new pi(1,1),this.center=new pi(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Ar,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=h,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!(e&&e.depth&&e.depth>1),this.pmremVersion=0}get width(){return this.source.getSize(wee).x}get height(){return this.source.getSize(wee).y}get depth(){return this.source.getSize(wee).z}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(const t in e){const n=e[t];if(n===void 0){Oi(`Texture.setValues(): parameter '${t}' has value of undefined.`);continue}const r=this[t];if(r===void 0){Oi(`Texture.setValues(): property '${t}' does not exist.`);continue}r&&n&&r.isVector2&&n.isVector2||r&&n&&r.isVector3&&n.isVector3||r&&n&&r.isMatrix3&&n.isMatrix3?r.copy(n):this[t]=n}}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const n={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==M8)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case lO:e.x=e.x-Math.floor(e.x);break;case hp:e.x=e.x<0?0:1;break;case cO:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case lO:e.y=e.y-Math.floor(e.y);break;case hp:e.y=e.y<0?0:1;break;case cO:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}dl.DEFAULT_IMAGE=null,dl.DEFAULT_MAPPING=M8,dl.DEFAULT_ANISOTROPY=1;class zo{constructor(e=0,t=0,n=0,r=1){zo.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,n=this.y,r=this.z,s=this.w,o=e.elements;return this.x=o[0]*t+o[4]*n+o[8]*r+o[12]*s,this.y=o[1]*t+o[5]*n+o[9]*r+o[13]*s,this.z=o[2]*t+o[6]*n+o[10]*r+o[14]*s,this.w=o[3]*t+o[7]*n+o[11]*r+o[15]*s,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,r,s;const l=e.elements,c=l[0],h=l[4],u=l[8],d=l[1],p=l[5],f=l[9],g=l[2],_=l[6],y=l[10];if(Math.abs(h-d)<.01&&Math.abs(u-g)<.01&&Math.abs(f-_)<.01){if(Math.abs(h+d)<.1&&Math.abs(u+g)<.1&&Math.abs(f+_)<.1&&Math.abs(c+p+y-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const x=(c+1)/2,w=(p+1)/2,E=(y+1)/2,S=(h+d)/4,I=(u+g)/4,C=(f+_)/4;return x>w&&x>E?x<.01?(n=0,r=.707106781,s=.707106781):(n=Math.sqrt(x),r=S/n,s=I/n):w>E?w<.01?(n=.707106781,r=0,s=.707106781):(r=Math.sqrt(w),n=S/r,s=C/r):E<.01?(n=.707106781,r=.707106781,s=0):(s=Math.sqrt(E),n=I/s,r=C/s),this.set(n,r,s,t),this}let A=Math.sqrt((_-f)*(_-f)+(u-g)*(u-g)+(d-h)*(d-h));return Math.abs(A)<.001&&(A=1),this.x=(_-f)/A,this.y=(u-g)/A,this.z=(d-h)/A,this.w=Math.acos((c+p+y-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Xn(this.x,e.x,t.x),this.y=Xn(this.y,e.y,t.y),this.z=Xn(this.z,e.z,t.z),this.w=Xn(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=Xn(this.x,e,t),this.y=Xn(this.y,e,t),this.z=Xn(this.z,e,t),this.w=Xn(this.w,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Xn(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class Eee extends M_{constructor(e=1,t=1,n={}){super(),n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:ua,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},n),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=n.depth,this.scissor=new zo(0,0,e,t),this.scissorTest=!1,this.viewport=new zo(0,0,e,t),this.textures=[];const r={width:e,height:t,depth:n.depth},s=new dl(r),o=n.count;for(let a=0;a<o;a++)this.textures[a]=s.clone(),this.textures[a].isRenderTargetTexture=!0,this.textures[a].renderTarget=this;this._setTextureOptions(n),this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=n.depthTexture,this.samples=n.samples,this.multiview=n.multiview}_setTextureOptions(e={}){const t={minFilter:ua,generateMipmaps:!1,flipY:!1,internalFormat:null};e.mapping!==void 0&&(t.mapping=e.mapping),e.wrapS!==void 0&&(t.wrapS=e.wrapS),e.wrapT!==void 0&&(t.wrapT=e.wrapT),e.wrapR!==void 0&&(t.wrapR=e.wrapR),e.magFilter!==void 0&&(t.magFilter=e.magFilter),e.minFilter!==void 0&&(t.minFilter=e.minFilter),e.format!==void 0&&(t.format=e.format),e.type!==void 0&&(t.type=e.type),e.anisotropy!==void 0&&(t.anisotropy=e.anisotropy),e.colorSpace!==void 0&&(t.colorSpace=e.colorSpace),e.flipY!==void 0&&(t.flipY=e.flipY),e.generateMipmaps!==void 0&&(t.generateMipmaps=e.generateMipmaps),e.internalFormat!==void 0&&(t.internalFormat=e.internalFormat);for(let n=0;n<this.textures.length;n++)this.textures[n].setValues(t)}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}set depthTexture(e){this._depthTexture!==null&&(this._depthTexture.renderTarget=null),e!==null&&(e.renderTarget=this),this._depthTexture=e}get depthTexture(){return this._depthTexture}setSize(e,t,n=1){if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(let r=0,s=this.textures.length;r<s;r++)this.textures[r].image.width=e,this.textures[r].image.height=t,this.textures[r].image.depth=n,this.textures[r].isData3DTexture!==!0&&(this.textures[r].isArrayTexture=this.textures[r].image.depth>1);this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let t=0,n=e.textures.length;t<n;t++){this.textures[t]=e.textures[t].clone(),this.textures[t].isRenderTargetTexture=!0,this.textures[t].renderTarget=this;const r=Object.assign({},e.textures[t].image);this.textures[t].source=new ix(r)}return this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class pf extends Eee{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}}class y6 extends dl{constructor(e=null,t=1,n=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:r},this.magFilter=kl,this.minFilter=kl,this.wrapR=hp,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class Jut extends pf{constructor(e=1,t=1,n=1,r={}){super(e,t,r),this.isWebGLArrayRenderTarget=!0,this.depth=n,this.texture=new y6(null,e,t,n),this._setTextureOptions(r),this.texture.isRenderTargetTexture=!0}}class v6 extends dl{constructor(e=null,t=1,n=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:r},this.magFilter=kl,this.minFilter=kl,this.wrapR=hp,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Zut extends pf{constructor(e=1,t=1,n=1,r={}){super(e,t,r),this.isWebGL3DRenderTarget=!0,this.depth=n,this.texture=new v6(null,e,t,n),this._setTextureOptions(r),this.texture.isRenderTargetTexture=!0}}class er{constructor(e,t,n,r,s,o,a,l,c,h,u,d,p,f,g,_){er.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,n,r,s,o,a,l,c,h,u,d,p,f,g,_)}set(e,t,n,r,s,o,a,l,c,h,u,d,p,f,g,_){const y=this.elements;return y[0]=e,y[4]=t,y[8]=n,y[12]=r,y[1]=s,y[5]=o,y[9]=a,y[13]=l,y[2]=c,y[6]=h,y[10]=u,y[14]=d,y[3]=p,y[7]=f,y[11]=g,y[15]=_,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new er().fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return this.determinant()===0?(e.set(1,0,0),t.set(0,1,0),n.set(0,0,1),this):(e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this)}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){if(e.determinant()===0)return this.identity();const t=this.elements,n=e.elements,r=1/e2.setFromMatrixColumn(e,0).length(),s=1/e2.setFromMatrixColumn(e,1).length(),o=1/e2.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*s,t[5]=n[5]*s,t[6]=n[6]*s,t[7]=0,t[8]=n[8]*o,t[9]=n[9]*o,t[10]=n[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,n=e.x,r=e.y,s=e.z,o=Math.cos(n),a=Math.sin(n),l=Math.cos(r),c=Math.sin(r),h=Math.cos(s),u=Math.sin(s);if(e.order==="XYZ"){const d=o*h,p=o*u,f=a*h,g=a*u;t[0]=l*h,t[4]=-l*u,t[8]=c,t[1]=p+f*c,t[5]=d-g*c,t[9]=-a*l,t[2]=g-d*c,t[6]=f+p*c,t[10]=o*l}else if(e.order==="YXZ"){const d=l*h,p=l*u,f=c*h,g=c*u;t[0]=d+g*a,t[4]=f*a-p,t[8]=o*c,t[1]=o*u,t[5]=o*h,t[9]=-a,t[2]=p*a-f,t[6]=g+d*a,t[10]=o*l}else if(e.order==="ZXY"){const d=l*h,p=l*u,f=c*h,g=c*u;t[0]=d-g*a,t[4]=-o*u,t[8]=f+p*a,t[1]=p+f*a,t[5]=o*h,t[9]=g-d*a,t[2]=-o*c,t[6]=a,t[10]=o*l}else if(e.order==="ZYX"){const d=o*h,p=o*u,f=a*h,g=a*u;t[0]=l*h,t[4]=f*c-p,t[8]=d*c+g,t[1]=l*u,t[5]=g*c+d,t[9]=p*c-f,t[2]=-c,t[6]=a*l,t[10]=o*l}else if(e.order==="YZX"){const d=o*l,p=o*c,f=a*l,g=a*c;t[0]=l*h,t[4]=g-d*u,t[8]=f*u+p,t[1]=u,t[5]=o*h,t[9]=-a*h,t[2]=-c*h,t[6]=p*u+f,t[10]=d-g*u}else if(e.order==="XZY"){const d=o*l,p=o*c,f=a*l,g=a*c;t[0]=l*h,t[4]=-u,t[8]=c*h,t[1]=d*u+g,t[5]=o*h,t[9]=p*u-f,t[2]=f*u-p,t[6]=a*h,t[10]=g*u+d}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(edt,e,tdt)}lookAt(e,t,n){const r=this.elements;return ff.subVectors(e,t),ff.lengthSq()===0&&(ff.z=1),ff.normalize(),nx.crossVectors(n,ff),nx.lengthSq()===0&&(Math.abs(n.z)===1?ff.x+=1e-4:ff.z+=1e-4,ff.normalize(),nx.crossVectors(n,ff)),nx.normalize(),b6.crossVectors(ff,nx),r[0]=nx.x,r[4]=b6.x,r[8]=ff.x,r[1]=nx.y,r[5]=b6.y,r[9]=ff.y,r[2]=nx.z,r[6]=b6.z,r[10]=ff.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,r=t.elements,s=this.elements,o=n[0],a=n[4],l=n[8],c=n[12],h=n[1],u=n[5],d=n[9],p=n[13],f=n[2],g=n[6],_=n[10],y=n[14],A=n[3],x=n[7],w=n[11],E=n[15],S=r[0],I=r[4],C=r[8],T=r[12],D=r[1],M=r[5],R=r[9],v=r[13],P=r[2],O=r[6],B=r[10],k=r[14],H=r[3],z=r[7],j=r[11],$=r[15];return s[0]=o*S+a*D+l*P+c*H,s[4]=o*I+a*M+l*O+c*z,s[8]=o*C+a*R+l*B+c*j,s[12]=o*T+a*v+l*k+c*$,s[1]=h*S+u*D+d*P+p*H,s[5]=h*I+u*M+d*O+p*z,s[9]=h*C+u*R+d*B+p*j,s[13]=h*T+u*v+d*k+p*$,s[2]=f*S+g*D+_*P+y*H,s[6]=f*I+g*M+_*O+y*z,s[10]=f*C+g*R+_*B+y*j,s[14]=f*T+g*v+_*k+y*$,s[3]=A*S+x*D+w*P+E*H,s[7]=A*I+x*M+w*O+E*z,s[11]=A*C+x*R+w*B+E*j,s[15]=A*T+x*v+w*k+E*$,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[4],r=e[8],s=e[12],o=e[1],a=e[5],l=e[9],c=e[13],h=e[2],u=e[6],d=e[10],p=e[14],f=e[3],g=e[7],_=e[11],y=e[15],A=l*p-c*d,x=a*p-c*u,w=a*d-l*u,E=o*p-c*h,S=o*d-l*h,I=o*u-a*h;return t*(g*A-_*x+y*w)-n*(f*A-_*E+y*S)+r*(f*x-g*E+y*I)-s*(f*w-g*S+_*I)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],h=e[8],u=e[9],d=e[10],p=e[11],f=e[12],g=e[13],_=e[14],y=e[15],A=t*a-n*o,x=t*l-r*o,w=t*c-s*o,E=n*l-r*a,S=n*c-s*a,I=r*c-s*l,C=h*g-u*f,T=h*_-d*f,D=h*y-p*f,M=u*_-d*g,R=u*y-p*g,v=d*y-p*_,P=A*v-x*R+w*M+E*D-S*T+I*C;if(P===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const O=1/P;return e[0]=(a*v-l*R+c*M)*O,e[1]=(r*R-n*v-s*M)*O,e[2]=(g*I-_*S+y*E)*O,e[3]=(d*S-u*I-p*E)*O,e[4]=(l*D-o*v-c*T)*O,e[5]=(t*v-r*D+s*T)*O,e[6]=(_*w-f*I-y*x)*O,e[7]=(h*I-d*w+p*x)*O,e[8]=(o*R-a*D+c*C)*O,e[9]=(n*D-t*R-s*C)*O,e[10]=(f*S-g*w+y*A)*O,e[11]=(u*w-h*S-p*A)*O,e[12]=(a*T-o*M-l*C)*O,e[13]=(t*M-n*T+r*C)*O,e[14]=(g*x-f*E-_*A)*O,e[15]=(h*E-u*x+d*A)*O,this}scale(e){const t=this.elements,n=e.x,r=e.y,s=e.z;return t[0]*=n,t[4]*=r,t[8]*=s,t[1]*=n,t[5]*=r,t[9]*=s,t[2]*=n,t[6]*=r,t[10]*=s,t[3]*=n,t[7]*=r,t[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))}makeTranslation(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),r=Math.sin(t),s=1-n,o=e.x,a=e.y,l=e.z,c=s*o,h=s*a;return this.set(c*o+n,c*a-r*l,c*l+r*a,0,c*a+r*l,h*a+n,h*l-r*o,0,c*l-r*a,h*l+r*o,s*l*l+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,r,s,o){return this.set(1,n,s,0,e,1,o,0,t,r,1,0,0,0,0,1),this}compose(e,t,n){const r=this.elements,s=t._x,o=t._y,a=t._z,l=t._w,c=s+s,h=o+o,u=a+a,d=s*c,p=s*h,f=s*u,g=o*h,_=o*u,y=a*u,A=l*c,x=l*h,w=l*u,E=n.x,S=n.y,I=n.z;return r[0]=(1-(g+y))*E,r[1]=(p+w)*E,r[2]=(f-x)*E,r[3]=0,r[4]=(p-w)*S,r[5]=(1-(d+y))*S,r[6]=(_+A)*S,r[7]=0,r[8]=(f+x)*I,r[9]=(_-A)*I,r[10]=(1-(d+g))*I,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,n){const r=this.elements;e.x=r[12],e.y=r[13],e.z=r[14];const s=this.determinant();if(s===0)return n.set(1,1,1),t.identity(),this;let o=e2.set(r[0],r[1],r[2]).length();const a=e2.set(r[4],r[5],r[6]).length(),l=e2.set(r[8],r[9],r[10]).length();s<0&&(o=-o),Wg.copy(this);const c=1/o,h=1/a,u=1/l;return Wg.elements[0]*=c,Wg.elements[1]*=c,Wg.elements[2]*=c,Wg.elements[4]*=h,Wg.elements[5]*=h,Wg.elements[6]*=h,Wg.elements[8]*=u,Wg.elements[9]*=u,Wg.elements[10]*=u,t.setFromRotationMatrix(Wg),n.x=o,n.y=a,n.z=l,this}makePerspective(e,t,n,r,s,o,a=uf,l=!1){const c=this.elements,h=2*s/(t-e),u=2*s/(n-r),d=(t+e)/(t-e),p=(n+r)/(n-r);let f,g;if(l)f=s/(o-s),g=o*s/(o-s);else if(a===uf)f=-(o+s)/(o-s),g=-2*o*s/(o-s);else if(a===kE)f=-o/(o-s),g=-o*s/(o-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return c[0]=h,c[4]=0,c[8]=d,c[12]=0,c[1]=0,c[5]=u,c[9]=p,c[13]=0,c[2]=0,c[6]=0,c[10]=f,c[14]=g,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}makeOrthographic(e,t,n,r,s,o,a=uf,l=!1){const c=this.elements,h=2/(t-e),u=2/(n-r),d=-(t+e)/(t-e),p=-(n+r)/(n-r);let f,g;if(l)f=1/(o-s),g=o/(o-s);else if(a===uf)f=-2/(o-s),g=-(o+s)/(o-s);else if(a===kE)f=-1/(o-s),g=-s/(o-s);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return c[0]=h,c[4]=0,c[8]=0,c[12]=d,c[1]=0,c[5]=u,c[9]=0,c[13]=p,c[2]=0,c[6]=0,c[10]=f,c[14]=g,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let r=0;r<16;r++)if(t[r]!==n[r])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}const e2=new ht,Wg=new er,edt=new ht(0,0,0),tdt=new ht(1,1,1),nx=new ht,b6=new ht,ff=new ht,LAe=new er,OAe=new pd;class mf{constructor(e=0,t=0,n=0,r=mf.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,r=this._order){return this._x=e,this._y=t,this._z=n,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){const r=e.elements,s=r[0],o=r[4],a=r[8],l=r[1],c=r[5],h=r[9],u=r[2],d=r[6],p=r[10];switch(t){case"XYZ":this._y=Math.asin(Xn(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-h,p),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-Xn(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(a,p),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-u,s),this._z=0);break;case"ZXY":this._x=Math.asin(Xn(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-u,p),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-Xn(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(d,p),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(Xn(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,c),this._y=Math.atan2(-u,s)):(this._x=0,this._y=Math.atan2(a,p));break;case"XZY":this._z=Math.asin(-Xn(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-h,p),this._y=0);break;default:Oi("Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return LAe.makeRotationFromQuaternion(e),this.setFromRotationMatrix(LAe,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return OAe.setFromEuler(this),this.setFromQuaternion(OAe,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}mf.DEFAULT_ORDER="XYZ";class A6{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}}let idt=0;const NAe=new ht,t2=new pd,Ov=new er,x6=new ht,EO=new ht,ndt=new ht,rdt=new pd,BAe=new ht(1,0,0),FAe=new ht(0,1,0),kAe=new ht(0,0,1),UAe={type:"added"},sdt={type:"removed"},i2={type:"childadded",child:null},See={type:"childremoved",child:null};class Ls extends M_{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:idt++}),this.uuid=df(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Ls.DEFAULT_UP.clone();const e=new ht,t=new mf,n=new pd,r=new ht(1,1,1);function s(){n.setFromEuler(t,!1)}function o(){t.setFromQuaternion(n,void 0,!1)}t._onChange(s),n._onChange(o),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new er},normalMatrix:{value:new Ar}}),this.matrix=new er,this.matrixWorld=new er,this.matrixAutoUpdate=Ls.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=Ls.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new A6,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.static=!1,this.userData={},this.pivot=null}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return t2.setFromAxisAngle(e,t),this.quaternion.multiply(t2),this}rotateOnWorldAxis(e,t){return t2.setFromAxisAngle(e,t),this.quaternion.premultiply(t2),this}rotateX(e){return this.rotateOnAxis(BAe,e)}rotateY(e){return this.rotateOnAxis(FAe,e)}rotateZ(e){return this.rotateOnAxis(kAe,e)}translateOnAxis(e,t){return NAe.copy(e).applyQuaternion(this.quaternion),this.position.add(NAe.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(BAe,e)}translateY(e){return this.translateOnAxis(FAe,e)}translateZ(e){return this.translateOnAxis(kAe,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(Ov.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?x6.copy(e):x6.set(e,t,n);const r=this.parent;this.updateWorldMatrix(!0,!1),EO.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Ov.lookAt(EO,x6,this.up):Ov.lookAt(x6,EO,this.up),this.quaternion.setFromRotationMatrix(Ov),r&&(Ov.extractRotation(r.matrixWorld),t2.setFromRotationMatrix(Ov),this.quaternion.premultiply(t2.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(xn("Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(UAe),i2.child=e,this.dispatchEvent(i2),i2.child=null):xn("Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}const t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(sdt),See.child=e,this.dispatchEvent(See),See.child=null),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),Ov.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),Ov.multiply(e.parent.matrixWorld)),e.applyMatrix4(Ov),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(UAe),i2.child=e,this.dispatchEvent(i2),i2.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let n=0,r=this.children.length;n<r;n++){const o=this.children[n].getObjectByProperty(e,t);if(o!==void 0)return o}}getObjectsByProperty(e,t,n=[]){this[e]===t&&n.push(this);const r=this.children;for(let s=0,o=r.length;s<o;s++)r[s].getObjectsByProperty(e,t,n);return n}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(EO,e,ndt),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(EO,rdt,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverseVisible(e)}traverseAncestors(e){const t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale);const e=this.pivot;if(e!==null){const t=e.x,n=e.y,r=e.z,s=this.matrix.elements;s[12]+=t-s[0]*t-s[4]*n-s[8]*r,s[13]+=n-s[1]*t-s[5]*n-s[9]*r,s[14]+=r-s[2]*t-s[6]*n-s[10]*r}this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].updateMatrixWorld(e)}updateWorldMatrix(e,t){const n=this.parent;if(e===!0&&n!==null&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),t===!0){const r=this.children;for(let s=0,o=r.length;s<o;s++)r[s].updateWorldMatrix(!1,!0)}}toJSON(e){const t=e===void 0||typeof e=="string",n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});const r={};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.castShadow===!0&&(r.castShadow=!0),this.receiveShadow===!0&&(r.receiveShadow=!0),this.visible===!1&&(r.visible=!1),this.frustumCulled===!1&&(r.frustumCulled=!1),this.renderOrder!==0&&(r.renderOrder=this.renderOrder),this.static!==!1&&(r.static=this.static),Object.keys(this.userData).length>0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.pivot!==null&&(r.pivot=this.pivot.toArray()),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.morphTargetDictionary!==void 0&&(r.morphTargetDictionary=Object.assign({},this.morphTargetDictionary)),this.morphTargetInfluences!==void 0&&(r.morphTargetInfluences=this.morphTargetInfluences.slice()),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.geometryInfo=this._geometryInfo.map(a=>({...a,boundingBox:a.boundingBox?a.boundingBox.toJSON():void 0,boundingSphere:a.boundingSphere?a.boundingSphere.toJSON():void 0})),r.instanceInfo=this._instanceInfo.map(a=>({...a})),r.availableInstanceIds=this._availableInstanceIds.slice(),r.availableGeometryIds=this._availableGeometryIds.slice(),r.nextIndexStart=this._nextIndexStart,r.nextVertexStart=this._nextVertexStart,r.geometryCount=this._geometryCount,r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.matricesTexture=this._matricesTexture.toJSON(e),r.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(r.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(r.boundingBox=this.boundingBox.toJSON()));function s(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=s(e.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const l=a.shapes;if(Array.isArray(l))for(let c=0,h=l.length;c<h;c++){const u=l[c];s(e.shapes,u)}else s(e.shapes,l)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(e.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const a=[];for(let l=0,c=this.material.length;l<c;l++)a.push(s(e.materials,this.material[l]));r.material=a}else r.material=s(e.materials,this.material);if(this.children.length>0){r.children=[];for(let a=0;a<this.children.length;a++)r.children.push(this.children[a].toJSON(e).object)}if(this.animations.length>0){r.animations=[];for(let a=0;a<this.animations.length;a++){const l=this.animations[a];r.animations.push(s(e.animations,l))}}if(t){const a=o(e.geometries),l=o(e.materials),c=o(e.textures),h=o(e.images),u=o(e.shapes),d=o(e.skeletons),p=o(e.animations),f=o(e.nodes);a.length>0&&(n.geometries=a),l.length>0&&(n.materials=l),c.length>0&&(n.textures=c),h.length>0&&(n.images=h),u.length>0&&(n.shapes=u),d.length>0&&(n.skeletons=d),p.length>0&&(n.animations=p),f.length>0&&(n.nodes=f)}return n.object=r,n;function o(a){const l=[];for(const c in a){const h=a[c];delete h.metadata,l.push(h)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),e.pivot!==null&&(this.pivot=e.pivot.clone()),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.static=e.static,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let n=0;n<e.children.length;n++){const r=e.children[n];this.add(r.clone())}return this}}Ls.DEFAULT_UP=new ht(0,1,0),Ls.DEFAULT_MATRIX_AUTO_UPDATE=!0,Ls.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;class n2 extends Ls{constructor(){super(),this.isGroup=!0,this.type="Group"}}const odt={type:"move"};class w6{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new n2,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new n2,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new ht,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new ht),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new n2,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new ht,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new ht),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const n of e.hand.values())this._getHandJoint(t,n)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,n){let r=null,s=null,o=null;const a=this._targetRay,l=this._grip,c=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(c&&e.hand){o=!0;for(const g of e.hand.values()){const _=t.getJointPose(g,n),y=this._getHandJoint(c,g);_!==null&&(y.matrix.fromArray(_.transform.matrix),y.matrix.decompose(y.position,y.rotation,y.scale),y.matrixWorldNeedsUpdate=!0,y.jointRadius=_.radius),y.visible=_!==null}const h=c.joints["index-finger-tip"],u=c.joints["thumb-tip"],d=h.position.distanceTo(u.position),p=.02,f=.005;c.inputState.pinching&&d>p+f?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&d<=p-f&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,n),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));a!==null&&(r=t.getPose(e.targetRaySpace,n),r===null&&s!==null&&(r=s),r!==null&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,r.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(r.linearVelocity)):a.hasLinearVelocity=!1,r.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(r.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(odt)))}return a!==null&&(a.visible=r!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const n=new n2;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}const zAe={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},rx={h:0,s:0,l:0},E6={h:0,s:0,l:0};function Tee(i,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?i+(e-i)*6*t:t<1/2?e:t<2/3?i+(e-i)*6*(2/3-t):i}class Qi{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(t===void 0&&n===void 0){const r=e;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=dp){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,_s.colorSpaceToWorking(this,t),this}setRGB(e,t,n,r=_s.workingColorSpace){return this.r=e,this.g=t,this.b=n,_s.colorSpaceToWorking(this,r),this}setHSL(e,t,n,r=_s.workingColorSpace){if(e=vee(e,1),t=Xn(t,0,1),n=Xn(n,0,1),t===0)this.r=this.g=this.b=n;else{const s=n<=.5?n*(1+t):n+t-n*t,o=2*n-s;this.r=Tee(o,s,e+1/3),this.g=Tee(o,s,e),this.b=Tee(o,s,e-1/3)}return _s.colorSpaceToWorking(this,r),this}setStyle(e,t=dp){function n(s){s!==void 0&&parseFloat(s)<1&&Oi("Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const o=r[1],a=r[2];switch(o){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,t);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,t);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,t);break;default:Oi("Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=r[1],o=s.length;if(o===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(s,16),t);Oi("Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=dp){const n=zAe[e.toLowerCase()];return n!==void 0?this.setHex(n,t):Oi("Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=Lv(e.r),this.g=Lv(e.g),this.b=Lv(e.b),this}copyLinearToSRGB(e){return this.r=JI(e.r),this.g=JI(e.g),this.b=JI(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=dp){return _s.workingToColorSpace(yu.copy(this),e),Math.round(Xn(yu.r*255,0,255))*65536+Math.round(Xn(yu.g*255,0,255))*256+Math.round(Xn(yu.b*255,0,255))}getHexString(e=dp){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=_s.workingColorSpace){_s.workingToColorSpace(yu.copy(this),t);const n=yu.r,r=yu.g,s=yu.b,o=Math.max(n,r,s),a=Math.min(n,r,s);let l,c;const h=(a+o)/2;if(a===o)l=0,c=0;else{const u=o-a;switch(c=h<=.5?u/(o+a):u/(2-o-a),o){case n:l=(r-s)/u+(r<s?6:0);break;case r:l=(s-n)/u+2;break;case s:l=(n-r)/u+4;break}l/=6}return e.h=l,e.s=c,e.l=h,e}getRGB(e,t=_s.workingColorSpace){return _s.workingToColorSpace(yu.copy(this),t),e.r=yu.r,e.g=yu.g,e.b=yu.b,e}getStyle(e=dp){_s.workingToColorSpace(yu.copy(this),e);const t=yu.r,n=yu.g,r=yu.b;return e!==dp?`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${r.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(n*255)},${Math.round(r*255)})`}offsetHSL(e,t,n){return this.getHSL(rx),this.setHSL(rx.h+e,rx.s+t,rx.l+n)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){this.getHSL(rx),e.getHSL(E6);const n=wO(rx.h,E6.h,t),r=wO(rx.s,E6.s,t),s=wO(rx.l,E6.l,t);return this.setHSL(n,r,s),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,n=this.g,r=this.b,s=e.elements;return this.r=s[0]*t+s[3]*n+s[6]*r,this.g=s[1]*t+s[4]*n+s[7]*r,this.b=s[2]*t+s[5]*n+s[8]*r,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const yu=new Qi;Qi.NAMES=zAe;class S6{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new Qi(e),this.density=t}clone(){return new S6(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class T6{constructor(e,t=1,n=1e3){this.isFog=!0,this.name="",this.color=new Qi(e),this.near=t,this.far=n}clone(){return new T6(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class Cee extends Ls{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new mf,this.environmentIntensity=1,this.environmentRotation=new mf,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}const $g=new ht,Nv=new ht,Mee=new ht,Bv=new ht,r2=new ht,s2=new ht,HAe=new ht,Iee=new ht,Pee=new ht,Dee=new ht,Ree=new zo,Lee=new zo,Oee=new zo;class pp{constructor(e=new ht,t=new ht,n=new ht){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,r){r.subVectors(n,t),$g.subVectors(e,t),r.cross($g);const s=r.lengthSq();return s>0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(e,t,n,r,s){$g.subVectors(r,t),Nv.subVectors(n,t),Mee.subVectors(e,t);const o=$g.dot($g),a=$g.dot(Nv),l=$g.dot(Mee),c=Nv.dot(Nv),h=Nv.dot(Mee),u=o*c-a*a;if(u===0)return s.set(0,0,0),null;const d=1/u,p=(c*l-a*h)*d,f=(o*h-a*l)*d;return s.set(1-p-f,f,p)}static containsPoint(e,t,n,r){return this.getBarycoord(e,t,n,r,Bv)===null?!1:Bv.x>=0&&Bv.y>=0&&Bv.x+Bv.y<=1}static getInterpolation(e,t,n,r,s,o,a,l){return this.getBarycoord(e,t,n,r,Bv)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(s,Bv.x),l.addScaledVector(o,Bv.y),l.addScaledVector(a,Bv.z),l)}static getInterpolatedAttribute(e,t,n,r,s,o){return Ree.setScalar(0),Lee.setScalar(0),Oee.setScalar(0),Ree.fromBufferAttribute(e,t),Lee.fromBufferAttribute(e,n),Oee.fromBufferAttribute(e,r),o.setScalar(0),o.addScaledVector(Ree,s.x),o.addScaledVector(Lee,s.y),o.addScaledVector(Oee,s.z),o}static isFrontFacing(e,t,n,r){return $g.subVectors(n,t),Nv.subVectors(e,t),$g.cross(Nv).dot(r)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,n,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return $g.subVectors(this.c,this.b),Nv.subVectors(this.a,this.b),$g.cross(Nv).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return pp.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return pp.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,r,s){return pp.getInterpolation(e,this.a,this.b,this.c,t,n,r,s)}containsPoint(e){return pp.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return pp.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,r=this.b,s=this.c;let o,a;r2.subVectors(r,n),s2.subVectors(s,n),Iee.subVectors(e,n);const l=r2.dot(Iee),c=s2.dot(Iee);if(l<=0&&c<=0)return t.copy(n);Pee.subVectors(e,r);const h=r2.dot(Pee),u=s2.dot(Pee);if(h>=0&&u<=h)return t.copy(r);const d=l*u-h*c;if(d<=0&&l>=0&&h<=0)return o=l/(l-h),t.copy(n).addScaledVector(r2,o);Dee.subVectors(e,s);const p=r2.dot(Dee),f=s2.dot(Dee);if(f>=0&&p<=f)return t.copy(s);const g=p*c-l*f;if(g<=0&&c>=0&&f<=0)return a=c/(c-f),t.copy(n).addScaledVector(s2,a);const _=h*f-p*u;if(_<=0&&u-h>=0&&p-f>=0)return HAe.subVectors(s,r),a=(u-h)/(u-h+(p-f)),t.copy(r).addScaledVector(HAe,a);const y=1/(_+g+d);return o=g*y,a=d*y,t.copy(n).addScaledVector(r2,o).addScaledVector(s2,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}class vu{constructor(e=new ht(1/0,1/0,1/0),t=new ht(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t+=3)this.expandByPoint(qg.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(qg.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=qg.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);const n=e.geometry;if(n!==void 0){const s=n.getAttribute("position");if(t===!0&&s!==void 0&&e.isInstancedMesh!==!0)for(let o=0,a=s.count;o<a;o++)e.isMesh===!0?e.getVertexPosition(o,qg):qg.fromBufferAttribute(s,o),qg.applyMatrix4(e.matrixWorld),this.expandByPoint(qg);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),C6.copy(e.boundingBox)):(n.boundingBox===null&&n.computeBoundingBox(),C6.copy(n.boundingBox)),C6.applyMatrix4(e.matrixWorld),this.union(C6)}const r=e.children;for(let s=0,o=r.length;s<o;s++)this.expandByObject(r[s],t);return this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,qg),qg.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(SO),M6.subVectors(this.max,SO),o2.subVectors(e.a,SO),a2.subVectors(e.b,SO),l2.subVectors(e.c,SO),sx.subVectors(a2,o2),ox.subVectors(l2,a2),zE.subVectors(o2,l2);let t=[0,-sx.z,sx.y,0,-ox.z,ox.y,0,-zE.z,zE.y,sx.z,0,-sx.x,ox.z,0,-ox.x,zE.z,0,-zE.x,-sx.y,sx.x,0,-ox.y,ox.x,0,-zE.y,zE.x,0];return!Nee(t,o2,a2,l2,M6)||(t=[1,0,0,0,1,0,0,0,1],!Nee(t,o2,a2,l2,M6))?!1:(I6.crossVectors(sx,ox),t=[I6.x,I6.y,I6.z],Nee(t,o2,a2,l2,M6))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,qg).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(qg).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(Fv[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Fv[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Fv[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Fv[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Fv[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Fv[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Fv[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Fv[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Fv),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}}const Fv=[new ht,new ht,new ht,new ht,new ht,new ht,new ht,new ht],qg=new ht,C6=new vu,o2=new ht,a2=new ht,l2=new ht,sx=new ht,ox=new ht,zE=new ht,SO=new ht,M6=new ht,I6=new ht,HE=new ht;function Nee(i,e,t,n,r){for(let s=0,o=i.length-3;s<=o;s+=3){HE.fromArray(i,s);const a=r.x*Math.abs(HE.x)+r.y*Math.abs(HE.y)+r.z*Math.abs(HE.z),l=e.dot(HE),c=t.dot(HE),h=n.dot(HE);if(Math.max(-Math.max(l,c,h),Math.min(l,c,h))>a)return!1}return!0}const kv=adt();function adt(){const i=new ArrayBuffer(4),e=new Float32Array(i),t=new Uint32Array(i),n=new Uint32Array(512),r=new Uint32Array(512);for(let l=0;l<256;++l){const c=l-127;c<-27?(n[l]=0,n[l|256]=32768,r[l]=24,r[l|256]=24):c<-14?(n[l]=1024>>-c-14,n[l|256]=1024>>-c-14|32768,r[l]=-c-1,r[l|256]=-c-1):c<=15?(n[l]=c+15<<10,n[l|256]=c+15<<10|32768,r[l]=13,r[l|256]=13):c<128?(n[l]=31744,n[l|256]=64512,r[l]=24,r[l|256]=24):(n[l]=31744,n[l|256]=64512,r[l]=13,r[l|256]=13)}const s=new Uint32Array(2048),o=new Uint32Array(64),a=new Uint32Array(64);for(let l=1;l<1024;++l){let c=l<<13,h=0;for(;(c&8388608)===0;)c<<=1,h-=8388608;c&=-8388609,h+=947912704,s[l]=c|h}for(let l=1024;l<2048;++l)s[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)o[l]=l<<23;o[31]=1199570944,o[32]=2147483648;for(let l=33;l<63;++l)o[l]=2147483648+(l-32<<23);o[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(a[l]=1024);return{floatView:e,uint32View:t,baseTable:n,shiftTable:r,mantissaTable:s,exponentTable:o,offsetTable:a}}function fp(i){Math.abs(i)>65504&&Oi("DataUtils.toHalfFloat(): Value out of range."),i=Xn(i,-65504,65504),kv.floatView[0]=i;const e=kv.uint32View[0],t=e>>23&511;return kv.baseTable[t]+((e&8388607)>>kv.shiftTable[t])}function TO(i){const e=i>>10;return kv.uint32View[0]=kv.mantissaTable[kv.offsetTable[e]+(i&1023)]+kv.exponentTable[e],kv.floatView[0]}class ldt{static toHalfFloat(e){return fp(e)}static fromHalfFloat(e){return TO(e)}}const oc=new ht,P6=new pi;let cdt=0;class Mo{constructor(e,t,n=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:cdt++}),this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=n,this.usage=vO,this.updateRanges=[],this.gpuType=hd,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let r=0,s=this.itemSize;r<s;r++)this.array[e+r]=t.array[n+r];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,n=this.count;t<n;t++)P6.fromBufferAttribute(this,t),P6.applyMatrix3(e),this.setXY(t,P6.x,P6.y);else if(this.itemSize===3)for(let t=0,n=this.count;t<n;t++)oc.fromBufferAttribute(this,t),oc.applyMatrix3(e),this.setXYZ(t,oc.x,oc.y,oc.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)oc.fromBufferAttribute(this,t),oc.applyMatrix4(e),this.setXYZ(t,oc.x,oc.y,oc.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)oc.fromBufferAttribute(this,t),oc.applyNormalMatrix(e),this.setXYZ(t,oc.x,oc.y,oc.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)oc.fromBufferAttribute(this,t),oc.transformDirection(e),this.setXYZ(t,oc.x,oc.y,oc.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let n=this.array[e*this.itemSize+t];return this.normalized&&(n=dd(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=Tr(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=dd(t,this.array)),t}setX(e,t){return this.normalized&&(t=Tr(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=dd(t,this.array)),t}setY(e,t){return this.normalized&&(t=Tr(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=dd(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Tr(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=dd(t,this.array)),t}setW(e,t){return this.normalized&&(t=Tr(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=Tr(t,this.array),n=Tr(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,r){return e*=this.itemSize,this.normalized&&(t=Tr(t,this.array),n=Tr(n,this.array),r=Tr(r,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this}setXYZW(e,t,n,r,s){return e*=this.itemSize,this.normalized&&(t=Tr(t,this.array),n=Tr(n,this.array),r=Tr(r,this.array),s=Tr(s,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this.array[e+3]=s,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==vO&&(e.usage=this.usage),e}}class hdt extends Mo{constructor(e,t,n){super(new Int8Array(e),t,n)}}class udt extends Mo{constructor(e,t,n){super(new Uint8Array(e),t,n)}}class ddt extends Mo{constructor(e,t,n){super(new Uint8ClampedArray(e),t,n)}}class pdt extends Mo{constructor(e,t,n){super(new Int16Array(e),t,n)}}class Bee extends Mo{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class fdt extends Mo{constructor(e,t,n){super(new Int32Array(e),t,n)}}class Fee extends Mo{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class mdt extends Mo{constructor(e,t,n){super(new Uint16Array(e),t,n),this.isFloat16BufferAttribute=!0}getX(e){let t=TO(this.array[e*this.itemSize]);return this.normalized&&(t=dd(t,this.array)),t}setX(e,t){return this.normalized&&(t=Tr(t,this.array)),this.array[e*this.itemSize]=fp(t),this}getY(e){let t=TO(this.array[e*this.itemSize+1]);return this.normalized&&(t=dd(t,this.array)),t}setY(e,t){return this.normalized&&(t=Tr(t,this.array)),this.array[e*this.itemSize+1]=fp(t),this}getZ(e){let t=TO(this.array[e*this.itemSize+2]);return this.normalized&&(t=dd(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Tr(t,this.array)),this.array[e*this.itemSize+2]=fp(t),this}getW(e){let t=TO(this.array[e*this.itemSize+3]);return this.normalized&&(t=dd(t,this.array)),t}setW(e,t){return this.normalized&&(t=Tr(t,this.array)),this.array[e*this.itemSize+3]=fp(t),this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=Tr(t,this.array),n=Tr(n,this.array)),this.array[e+0]=fp(t),this.array[e+1]=fp(n),this}setXYZ(e,t,n,r){return e*=this.itemSize,this.normalized&&(t=Tr(t,this.array),n=Tr(n,this.array),r=Tr(r,this.array)),this.array[e+0]=fp(t),this.array[e+1]=fp(n),this.array[e+2]=fp(r),this}setXYZW(e,t,n,r,s){return e*=this.itemSize,this.normalized&&(t=Tr(t,this.array),n=Tr(n,this.array),r=Tr(r,this.array),s=Tr(s,this.array)),this.array[e+0]=fp(t),this.array[e+1]=fp(n),this.array[e+2]=fp(r),this.array[e+3]=fp(s),this}}class rn extends Mo{constructor(e,t,n){super(new Float32Array(e),t,n)}}const gdt=new vu,CO=new ht,kee=new ht;class Nh{constructor(e=new ht,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;t!==void 0?n.copy(t):gdt.setFromPoints(e).getCenter(n);let r=0;for(let s=0,o=e.length;s<o;s++)r=Math.max(r,n.distanceToSquared(e[s]));return this.radius=Math.sqrt(r),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const n=this.center.distanceToSquared(e);return t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;CO.subVectors(e,this.center);const t=CO.lengthSq();if(t>this.radius*this.radius){const n=Math.sqrt(t),r=(n-this.radius)*.5;this.center.addScaledVector(CO,r/n),this.radius+=r}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(kee.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(CO.copy(e.center).add(kee)),this.expandByPoint(CO.copy(e.center).sub(kee))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}}let _dt=0;const Em=new er,Uee=new Ls,c2=new ht,gf=new vu,MO=new vu,nh=new ht;class yr extends M_{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:_dt++}),this.uuid=df(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.indirectOffset=0,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(Tut(e)?Fee:Bee)(e,1):this.index=e,this}setIndirect(e,t=0){return this.indirect=e,this.indirectOffset=t,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);const n=this.attributes.normal;if(n!==void 0){const s=new Ar().getNormalMatrix(e);n.applyNormalMatrix(s),n.needsUpdate=!0}const r=this.attributes.tangent;return r!==void 0&&(r.transformDirection(e),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return Em.makeRotationFromQuaternion(e),this.applyMatrix4(Em),this}rotateX(e){return Em.makeRotationX(e),this.applyMatrix4(Em),this}rotateY(e){return Em.makeRotationY(e),this.applyMatrix4(Em),this}rotateZ(e){return Em.makeRotationZ(e),this.applyMatrix4(Em),this}translate(e,t,n){return Em.makeTranslation(e,t,n),this.applyMatrix4(Em),this}scale(e,t,n){return Em.makeScale(e,t,n),this.applyMatrix4(Em),this}lookAt(e){return Uee.lookAt(e),Uee.updateMatrix(),this.applyMatrix4(Uee.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(c2).negate(),this.translate(c2.x,c2.y,c2.z),this}setFromPoints(e){const t=this.getAttribute("position");if(t===void 0){const n=[];for(let r=0,s=e.length;r<s;r++){const o=e[r];n.push(o.x,o.y,o.z||0)}this.setAttribute("position",new rn(n,3))}else{const n=Math.min(e.length,t.count);for(let r=0;r<n;r++){const s=e[r];t.setXYZ(r,s.x,s.y,s.z||0)}e.length>t.count&&Oi("BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),t.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new vu);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){xn("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new ht(-1/0,-1/0,-1/0),new ht(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let n=0,r=t.length;n<r;n++){const s=t[n];gf.setFromBufferAttribute(s),this.morphTargetsRelative?(nh.addVectors(this.boundingBox.min,gf.min),this.boundingBox.expandByPoint(nh),nh.addVectors(this.boundingBox.max,gf.max),this.boundingBox.expandByPoint(nh)):(this.boundingBox.expandByPoint(gf.min),this.boundingBox.expandByPoint(gf.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&xn('BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Nh);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){xn("BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new ht,1/0);return}if(e){const n=this.boundingSphere.center;if(gf.setFromBufferAttribute(e),t)for(let s=0,o=t.length;s<o;s++){const a=t[s];MO.setFromBufferAttribute(a),this.morphTargetsRelative?(nh.addVectors(gf.min,MO.min),gf.expandByPoint(nh),nh.addVectors(gf.max,MO.max),gf.expandByPoint(nh)):(gf.expandByPoint(MO.min),gf.expandByPoint(MO.max))}gf.getCenter(n);let r=0;for(let s=0,o=e.count;s<o;s++)nh.fromBufferAttribute(e,s),r=Math.max(r,n.distanceToSquared(nh));if(t)for(let s=0,o=t.length;s<o;s++){const a=t[s],l=this.morphTargetsRelative;for(let c=0,h=a.count;c<h;c++)nh.fromBufferAttribute(a,c),l&&(c2.fromBufferAttribute(e,c),nh.add(c2)),r=Math.max(r,n.distanceToSquared(nh))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&xn('BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){xn("BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const n=t.position,r=t.normal,s=t.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new Mo(new Float32Array(4*n.count),4));const o=this.getAttribute("tangent"),a=[],l=[];for(let C=0;C<n.count;C++)a[C]=new ht,l[C]=new ht;const c=new ht,h=new ht,u=new ht,d=new pi,p=new pi,f=new pi,g=new ht,_=new ht;function y(C,T,D){c.fromBufferAttribute(n,C),h.fromBufferAttribute(n,T),u.fromBufferAttribute(n,D),d.fromBufferAttribute(s,C),p.fromBufferAttribute(s,T),f.fromBufferAttribute(s,D),h.sub(c),u.sub(c),p.sub(d),f.sub(d);const M=1/(p.x*f.y-f.x*p.y);isFinite(M)&&(g.copy(h).multiplyScalar(f.y).addScaledVector(u,-p.y).multiplyScalar(M),_.copy(u).multiplyScalar(p.x).addScaledVector(h,-f.x).multiplyScalar(M),a[C].add(g),a[T].add(g),a[D].add(g),l[C].add(_),l[T].add(_),l[D].add(_))}let A=this.groups;A.length===0&&(A=[{start:0,count:e.count}]);for(let C=0,T=A.length;C<T;++C){const D=A[C],M=D.start,R=D.count;for(let v=M,P=M+R;v<P;v+=3)y(e.getX(v+0),e.getX(v+1),e.getX(v+2))}const x=new ht,w=new ht,E=new ht,S=new ht;function I(C){E.fromBufferAttribute(r,C),S.copy(E);const T=a[C];x.copy(T),x.sub(E.multiplyScalar(E.dot(T))).normalize(),w.crossVectors(S,T);const M=w.dot(l[C])<0?-1:1;o.setXYZW(C,x.x,x.y,x.z,M)}for(let C=0,T=A.length;C<T;++C){const D=A[C],M=D.start,R=D.count;for(let v=M,P=M+R;v<P;v+=3)I(e.getX(v+0)),I(e.getX(v+1)),I(e.getX(v+2))}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(t!==void 0){let n=this.getAttribute("normal");if(n===void 0)n=new Mo(new Float32Array(t.count*3),3),this.setAttribute("normal",n);else for(let d=0,p=n.count;d<p;d++)n.setXYZ(d,0,0,0);const r=new ht,s=new ht,o=new ht,a=new ht,l=new ht,c=new ht,h=new ht,u=new ht;if(e)for(let d=0,p=e.count;d<p;d+=3){const f=e.getX(d+0),g=e.getX(d+1),_=e.getX(d+2);r.fromBufferAttribute(t,f),s.fromBufferAttribute(t,g),o.fromBufferAttribute(t,_),h.subVectors(o,s),u.subVectors(r,s),h.cross(u),a.fromBufferAttribute(n,f),l.fromBufferAttribute(n,g),c.fromBufferAttribute(n,_),a.add(h),l.add(h),c.add(h),n.setXYZ(f,a.x,a.y,a.z),n.setXYZ(g,l.x,l.y,l.z),n.setXYZ(_,c.x,c.y,c.z)}else for(let d=0,p=t.count;d<p;d+=3)r.fromBufferAttribute(t,d+0),s.fromBufferAttribute(t,d+1),o.fromBufferAttribute(t,d+2),h.subVectors(o,s),u.subVectors(r,s),h.cross(u),n.setXYZ(d+0,h.x,h.y,h.z),n.setXYZ(d+1,h.x,h.y,h.z),n.setXYZ(d+2,h.x,h.y,h.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)nh.fromBufferAttribute(e,t),nh.normalize(),e.setXYZ(t,nh.x,nh.y,nh.z)}toNonIndexed(){function e(a,l){const c=a.array,h=a.itemSize,u=a.normalized,d=new c.constructor(l.length*h);let p=0,f=0;for(let g=0,_=l.length;g<_;g++){a.isInterleavedBufferAttribute?p=l[g]*a.data.stride+a.offset:p=l[g]*h;for(let y=0;y<h;y++)d[f++]=c[p++]}return new Mo(d,h,u)}if(this.index===null)return Oi("BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new yr,n=this.index.array,r=this.attributes;for(const a in r){const l=r[a],c=e(l,n);t.setAttribute(a,c)}const s=this.morphAttributes;for(const a in s){const l=[],c=s[a];for(let h=0,u=c.length;h<u;h++){const d=c[h],p=e(d,n);l.push(p)}t.morphAttributes[a]=l}t.morphTargetsRelative=this.morphTargetsRelative;const o=this.groups;for(let a=0,l=o.length;a<l;a++){const c=o[a];t.addGroup(c.start,c.count,c.materialIndex)}return t}toJSON(){const e={metadata:{version:4.7,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const n=this.attributes;for(const l in n){const c=n[l];e.data.attributes[l]=c.toJSON(e.data)}const r={};let s=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],h=[];for(let u=0,d=c.length;u<d;u++){const p=c[u];h.push(p.toJSON(e.data))}h.length>0&&(r[l]=h,s=!0)}s&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere=a.toJSON()),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const n=e.index;n!==null&&this.setIndex(n.clone());const r=e.attributes;for(const c in r){const h=r[c];this.setAttribute(c,h.clone(t))}const s=e.morphAttributes;for(const c in s){const h=[],u=s[c];for(let d=0,p=u.length;d<p;d++)h.push(u[d].clone(t));this.morphAttributes[c]=h}this.morphTargetsRelative=e.morphTargetsRelative;const o=e.groups;for(let c=0,h=o.length;c<h;c++){const u=o[c];this.addGroup(u.start,u.count,u.materialIndex)}const a=e.boundingBox;a!==null&&(this.boundingBox=a.clone());const l=e.boundingSphere;return l!==null&&(this.boundingSphere=l.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}class D6{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=vO,this.updateRanges=[],this.version=0,this.uuid=df()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let r=0,s=this.stride;r<s;r++)this.array[e+r]=t.array[n+r];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=df()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(t,this.stride);return n.setUsage(this.usage),n}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=df()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}const fd=new ht;class VE{constructor(e,t,n,r=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=n,this.normalized=r}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,n=this.data.count;t<n;t++)fd.fromBufferAttribute(this,t),fd.applyMatrix4(e),this.setXYZ(t,fd.x,fd.y,fd.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)fd.fromBufferAttribute(this,t),fd.applyNormalMatrix(e),this.setXYZ(t,fd.x,fd.y,fd.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)fd.fromBufferAttribute(this,t),fd.transformDirection(e),this.setXYZ(t,fd.x,fd.y,fd.z);return this}getComponent(e,t){let n=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(n=dd(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=Tr(n,this.array)),this.data.array[e*this.data.stride+this.offset+t]=n,this}setX(e,t){return this.normalized&&(t=Tr(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=Tr(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=Tr(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=Tr(t,this.array)),this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(t=dd(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=dd(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=dd(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=dd(t,this.array)),t}setXY(e,t,n){return e=e*this.data.stride+this.offset,this.normalized&&(t=Tr(t,this.array),n=Tr(n,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this}setXYZ(e,t,n,r){return e=e*this.data.stride+this.offset,this.normalized&&(t=Tr(t,this.array),n=Tr(n,this.array),r=Tr(r,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this}setXYZW(e,t,n,r,s){return e=e*this.data.stride+this.offset,this.normalized&&(t=Tr(t,this.array),n=Tr(n,this.array),r=Tr(r,this.array),s=Tr(s,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this.data.array[e+3]=s,this}clone(e){if(e===void 0){AO("InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let n=0;n<this.count;n++){const r=n*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[r+s])}return new Mo(new this.array.constructor(t),this.itemSize,this.normalized)}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new VE(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){AO("InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let n=0;n<this.count;n++){const r=n*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[r+s])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}let ydt=0;class bu extends M_{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:ydt++}),this.uuid=df(),this.name="",this.type="Material",this.blending=DE,this.side=Dv,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=v8,this.blendDst=b8,this.blendEquation=KA,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Qi(0,0,0),this.blendAlpha=0,this.depthFunc=RE,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=_ee,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=FE,this.stencilZFail=FE,this.stencilZPass=FE,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const n=e[t];if(n===void 0){Oi(`Material: parameter '${t}' has value of undefined.`);continue}const r=this[t];if(r===void 0){Oi(`Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[t]=n}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const n={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(n.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(n.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),this.dispersion!==void 0&&(n.dispersion=this.dispersion),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==DE&&(n.blending=this.blending),this.side!==Dv&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==v8&&(n.blendSrc=this.blendSrc),this.blendDst!==b8&&(n.blendDst=this.blendDst),this.blendEquation!==KA&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==RE&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==_ee&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==FE&&(n.stencilFail=this.stencilFail),this.stencilZFail!==FE&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==FE&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.allowOverride===!1&&(n.allowOverride=!1),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function r(s){const o=[];for(const a in s){const l=s[a];delete l.metadata,o.push(l)}return o}if(t){const s=r(e.textures),o=r(e.images);s.length>0&&(n.textures=s),o.length>0&&(n.images=o)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let n=null;if(t!==null){const r=t.length;n=new Array(r);for(let s=0;s!==r;++s)n[s]=t[s].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.allowOverride=e.allowOverride,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class zee extends bu{constructor(e){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new Qi(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}let h2;const IO=new ht,u2=new ht,d2=new ht,p2=new pi,PO=new pi,VAe=new er,R6=new ht,DO=new ht,L6=new ht,GAe=new pi,Hee=new pi,jAe=new pi;class WAe extends Ls{constructor(e=new zee){if(super(),this.isSprite=!0,this.type="Sprite",h2===void 0){h2=new yr;const t=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),n=new D6(t,5);h2.setIndex([0,1,2,0,2,3]),h2.setAttribute("position",new VE(n,3,0,!1)),h2.setAttribute("uv",new VE(n,2,3,!1))}this.geometry=h2,this.material=e,this.center=new pi(.5,.5),this.count=1}raycast(e,t){e.camera===null&&xn('Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),u2.setFromMatrixScale(this.matrixWorld),VAe.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),d2.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&u2.multiplyScalar(-d2.z);const n=this.material.rotation;let r,s;n!==0&&(s=Math.cos(n),r=Math.sin(n));const o=this.center;O6(R6.set(-.5,-.5,0),d2,o,u2,r,s),O6(DO.set(.5,-.5,0),d2,o,u2,r,s),O6(L6.set(.5,.5,0),d2,o,u2,r,s),GAe.set(0,0),Hee.set(1,0),jAe.set(1,1);let a=e.ray.intersectTriangle(R6,DO,L6,!1,IO);if(a===null&&(O6(DO.set(-.5,.5,0),d2,o,u2,r,s),Hee.set(0,1),a=e.ray.intersectTriangle(R6,L6,DO,!1,IO),a===null))return;const l=e.ray.origin.distanceTo(IO);l<e.near||l>e.far||t.push({distance:l,point:IO.clone(),uv:pp.getInterpolation(IO,R6,DO,L6,GAe,Hee,jAe,new pi),face:null,object:this})}copy(e,t){return super.copy(e,t),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function O6(i,e,t,n,r,s){p2.subVectors(i,t).addScalar(.5).multiply(n),r!==void 0?(PO.x=s*p2.x-r*p2.y,PO.y=r*p2.x+s*p2.y):PO.copy(p2),i.copy(e),i.x+=PO.x,i.y+=PO.y,i.applyMatrix4(VAe)}const N6=new ht,$Ae=new ht;class qAe extends Ls{constructor(){super(),this.isLOD=!0,this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let n=0,r=t.length;n<r;n++){const s=t[n];this.addLevel(s.object.clone(),s.distance,s.hysteresis)}return this.autoUpdate=e.autoUpdate,this}addLevel(e,t=0,n=0){t=Math.abs(t);const r=this.levels;let s;for(s=0;s<r.length&&!(t<r[s].distance);s++);return r.splice(s,0,{distance:t,hysteresis:n,object:e}),this.add(e),this}removeLevel(e){const t=this.levels;for(let n=0;n<t.length;n++)if(t[n].distance===e){const r=t.splice(n,1);return this.remove(r[0].object),!0}return!1}getCurrentLevel(){return this._currentLevel}getObjectForDistance(e){const t=this.levels;if(t.length>0){let n,r;for(n=1,r=t.length;n<r;n++){let s=t[n].distance;if(t[n].object.visible&&(s-=s*t[n].hysteresis),e<s)break}return t[n-1].object}return null}raycast(e,t){if(this.levels.length>0){N6.setFromMatrixPosition(this.matrixWorld);const r=e.ray.origin.distanceTo(N6);this.getObjectForDistance(r).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){N6.setFromMatrixPosition(e.matrixWorld),$Ae.setFromMatrixPosition(this.matrixWorld);const n=N6.distanceTo($Ae)/e.zoom;t[0].object.visible=!0;let r,s;for(r=1,s=t.length;r<s;r++){let o=t[r].distance;if(t[r].object.visible&&(o-=o*t[r].hysteresis),n>=o)t[r-1].object.visible=!1,t[r].object.visible=!0;else break}for(this._currentLevel=r-1;r<s;r++)t[r].object.visible=!1}}toJSON(e){const t=super.toJSON(e);this.autoUpdate===!1&&(t.object.autoUpdate=!1),t.object.levels=[];const n=this.levels;for(let r=0,s=n.length;r<s;r++){const o=n[r];t.object.levels.push({object:o.object.uuid,distance:o.distance,hysteresis:o.hysteresis})}return t}}const Uv=new ht,Vee=new ht,B6=new ht,ax=new ht,Gee=new ht,F6=new ht,jee=new ht;let f2=class{constructor(e=new ht,t=new ht(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Uv)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=Uv.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Uv.copy(this.origin).addScaledVector(this.direction,t),Uv.distanceToSquared(e))}distanceSqToSegment(e,t,n,r){Vee.copy(e).add(t).multiplyScalar(.5),B6.copy(t).sub(e).normalize(),ax.copy(this.origin).sub(Vee);const s=e.distanceTo(t)*.5,o=-this.direction.dot(B6),a=ax.dot(this.direction),l=-ax.dot(B6),c=ax.lengthSq(),h=Math.abs(1-o*o);let u,d,p,f;if(h>0)if(u=o*l-a,d=o*a-l,f=s*h,u>=0)if(d>=-f)if(d<=f){const g=1/h;u*=g,d*=g,p=u*(u+o*d+2*a)+d*(o*u+d+2*l)+c}else d=s,u=Math.max(0,-(o*d+a)),p=-u*u+d*(d+2*l)+c;else d=-s,u=Math.max(0,-(o*d+a)),p=-u*u+d*(d+2*l)+c;else d<=-f?(u=Math.max(0,-(-o*s+a)),d=u>0?-s:Math.min(Math.max(-s,-l),s),p=-u*u+d*(d+2*l)+c):d<=f?(u=0,d=Math.min(Math.max(-s,-l),s),p=d*(d+2*l)+c):(u=Math.max(0,-(o*s+a)),d=u>0?s:Math.min(Math.max(-s,-l),s),p=-u*u+d*(d+2*l)+c);else d=o>0?-s:s,u=Math.max(0,-(o*d+a)),p=-u*u+d*(d+2*l)+c;return n&&n.copy(this.origin).addScaledVector(this.direction,u),r&&r.copy(Vee).addScaledVector(B6,d),p}intersectSphere(e,t){Uv.subVectors(e.center,this.origin);const n=Uv.dot(this.direction),r=Uv.dot(Uv)-n*n,s=e.radius*e.radius;if(r>s)return null;const o=Math.sqrt(s-r),a=n-o,l=n+o;return l<0?null:a<0?this.at(l,t):this.at(a,t)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,r,s,o,a,l;const c=1/this.direction.x,h=1/this.direction.y,u=1/this.direction.z,d=this.origin;return c>=0?(n=(e.min.x-d.x)*c,r=(e.max.x-d.x)*c):(n=(e.max.x-d.x)*c,r=(e.min.x-d.x)*c),h>=0?(s=(e.min.y-d.y)*h,o=(e.max.y-d.y)*h):(s=(e.max.y-d.y)*h,o=(e.min.y-d.y)*h),n>o||s>r||((s>n||isNaN(n))&&(n=s),(o<r||isNaN(r))&&(r=o),u>=0?(a=(e.min.z-d.z)*u,l=(e.max.z-d.z)*u):(a=(e.max.z-d.z)*u,l=(e.min.z-d.z)*u),n>l||a>r)||((a>n||n!==n)&&(n=a),(l<r||r!==r)&&(r=l),r<0)?null:this.at(n>=0?n:r,t)}intersectsBox(e){return this.intersectBox(e,Uv)!==null}intersectTriangle(e,t,n,r,s){Gee.subVectors(t,e),F6.subVectors(n,e),jee.crossVectors(Gee,F6);let o=this.direction.dot(jee),a;if(o>0){if(r)return null;a=1}else if(o<0)a=-1,o=-o;else return null;ax.subVectors(this.origin,e);const l=a*this.direction.dot(F6.crossVectors(ax,F6));if(l<0)return null;const c=a*this.direction.dot(Gee.cross(ax));if(c<0||l+c>o)return null;const h=-a*ax.dot(jee);return h<0?null:this.at(h/o,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}};class lx extends bu{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Qi(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new mf,this.combine=sO,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const XAe=new er,GE=new f2,k6=new Nh,YAe=new ht,U6=new ht,z6=new ht,H6=new ht,Wee=new ht,V6=new ht,QAe=new ht,G6=new ht;class ac extends Ls{constructor(e=new yr,t=new lx){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const r=t[n[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s<o;s++){const a=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=s}}}}getVertexPosition(e,t){const n=this.geometry,r=n.attributes.position,s=n.morphAttributes.position,o=n.morphTargetsRelative;t.fromBufferAttribute(r,e);const a=this.morphTargetInfluences;if(s&&a){V6.set(0,0,0);for(let l=0,c=s.length;l<c;l++){const h=a[l],u=s[l];h!==0&&(Wee.fromBufferAttribute(u,e),o?V6.addScaledVector(Wee,h):V6.addScaledVector(Wee.sub(t),h))}t.add(V6)}return t}raycast(e,t){const n=this.geometry,r=this.material,s=this.matrixWorld;r!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),k6.copy(n.boundingSphere),k6.applyMatrix4(s),GE.copy(e.ray).recast(e.near),!(k6.containsPoint(GE.origin)===!1&&(GE.intersectSphere(k6,YAe)===null||GE.origin.distanceToSquared(YAe)>(e.far-e.near)**2))&&(XAe.copy(s).invert(),GE.copy(e.ray).applyMatrix4(XAe),!(n.boundingBox!==null&&GE.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(e,t,GE)))}_computeIntersections(e,t,n){let r;const s=this.geometry,o=this.material,a=s.index,l=s.attributes.position,c=s.attributes.uv,h=s.attributes.uv1,u=s.attributes.normal,d=s.groups,p=s.drawRange;if(a!==null)if(Array.isArray(o))for(let f=0,g=d.length;f<g;f++){const _=d[f],y=o[_.materialIndex],A=Math.max(_.start,p.start),x=Math.min(a.count,Math.min(_.start+_.count,p.start+p.count));for(let w=A,E=x;w<E;w+=3){const S=a.getX(w),I=a.getX(w+1),C=a.getX(w+2);r=j6(this,y,e,n,c,h,u,S,I,C),r&&(r.faceIndex=Math.floor(w/3),r.face.materialIndex=_.materialIndex,t.push(r))}}else{const f=Math.max(0,p.start),g=Math.min(a.count,p.start+p.count);for(let _=f,y=g;_<y;_+=3){const A=a.getX(_),x=a.getX(_+1),w=a.getX(_+2);r=j6(this,o,e,n,c,h,u,A,x,w),r&&(r.faceIndex=Math.floor(_/3),t.push(r))}}else if(l!==void 0)if(Array.isArray(o))for(let f=0,g=d.length;f<g;f++){const _=d[f],y=o[_.materialIndex],A=Math.max(_.start,p.start),x=Math.min(l.count,Math.min(_.start+_.count,p.start+p.count));for(let w=A,E=x;w<E;w+=3){const S=w,I=w+1,C=w+2;r=j6(this,y,e,n,c,h,u,S,I,C),r&&(r.faceIndex=Math.floor(w/3),r.face.materialIndex=_.materialIndex,t.push(r))}}else{const f=Math.max(0,p.start),g=Math.min(l.count,p.start+p.count);for(let _=f,y=g;_<y;_+=3){const A=_,x=_+1,w=_+2;r=j6(this,o,e,n,c,h,u,A,x,w),r&&(r.faceIndex=Math.floor(_/3),t.push(r))}}}}function vdt(i,e,t,n,r,s,o,a){let l;if(e.side===cd?l=n.intersectTriangle(o,s,r,!0,a):l=n.intersectTriangle(r,s,o,e.side===Dv,a),l===null)return null;G6.copy(a),G6.applyMatrix4(i.matrixWorld);const c=t.ray.origin.distanceTo(G6);return c<t.near||c>t.far?null:{distance:c,point:G6.clone(),object:i}}function j6(i,e,t,n,r,s,o,a,l,c){i.getVertexPosition(a,U6),i.getVertexPosition(l,z6),i.getVertexPosition(c,H6);const h=vdt(i,e,t,n,U6,z6,H6,QAe);if(h){const u=new ht;pp.getBarycoord(QAe,U6,z6,H6,u),r&&(h.uv=pp.getInterpolatedAttribute(r,a,l,c,u,new pi)),s&&(h.uv1=pp.getInterpolatedAttribute(s,a,l,c,u,new pi)),o&&(h.normal=pp.getInterpolatedAttribute(o,a,l,c,u,new ht),h.normal.dot(n.direction)>0&&h.normal.multiplyScalar(-1));const d={a,b:l,c,normal:new ht,materialIndex:0};pp.getNormal(U6,z6,H6,d.normal),h.face=d,h.barycoord=u}return h}const KAe=new ht,JAe=new zo,ZAe=new zo,bdt=new ht,exe=new er,W6=new ht,$ee=new Nh,txe=new er,qee=new f2;class ixe extends ac{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=aee,this.bindMatrix=new er,this.bindMatrixInverse=new er,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const e=this.geometry;this.boundingBox===null&&(this.boundingBox=new vu),this.boundingBox.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,W6),this.boundingBox.expandByPoint(W6)}computeBoundingSphere(){const e=this.geometry;this.boundingSphere===null&&(this.boundingSphere=new Nh),this.boundingSphere.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,W6),this.boundingSphere.expandByPoint(W6)}copy(e,t){return super.copy(e,t),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}raycast(e,t){const n=this.material,r=this.matrixWorld;n!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),$ee.copy(this.boundingSphere),$ee.applyMatrix4(r),e.ray.intersectsSphere($ee)!==!1&&(txe.copy(r).invert(),qee.copy(e.ray).applyMatrix4(txe),!(this.boundingBox!==null&&qee.intersectsBox(this.boundingBox)===!1)&&this._computeIntersections(e,t,qee)))}getVertexPosition(e,t){return super.getVertexPosition(e,t),this.applyBoneTransform(e,t),t}bind(e,t){this.skeleton=e,t===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new zo,t=this.geometry.attributes.skinWeight;for(let n=0,r=t.count;n<r;n++){e.fromBufferAttribute(t,n);const s=1/e.manhattanLength();s!==1/0?e.multiplyScalar(s):e.set(1,0,0,0),t.setXYZW(n,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode===aee?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===dAe?this.bindMatrixInverse.copy(this.bindMatrix).invert():Oi("SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,t){const n=this.skeleton,r=this.geometry;JAe.fromBufferAttribute(r.attributes.skinIndex,e),ZAe.fromBufferAttribute(r.attributes.skinWeight,e),KAe.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let s=0;s<4;s++){const o=ZAe.getComponent(s);if(o!==0){const a=JAe.getComponent(s);exe.multiplyMatrices(n.bones[a].matrixWorld,n.boneInverses[a]),t.addScaledVector(bdt.copy(KAe).applyMatrix4(exe),o)}}return t.applyMatrix4(this.bindMatrixInverse)}}class Xee extends Ls{constructor(){super(),this.isBone=!0,this.type="Bone"}}class Xg extends dl{constructor(e=null,t=1,n=1,r,s,o,a,l,c=kl,h=kl,u,d){super(null,o,a,l,c,h,r,s,u,d),this.isDataTexture=!0,this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const nxe=new er,Adt=new er;class $6{constructor(e=[],t=[]){this.uuid=df(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.previousBoneMatrices=null,this.boneTexture=null,this.init()}init(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(e.length*16),t.length===0)this.calculateInverses();else if(e.length!==t.length){Oi("Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let n=0,r=this.bones.length;n<r;n++)this.boneInverses.push(new er)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const n=new er;this.bones[e]&&n.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(n)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){const n=this.bones[e];n&&n.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){const n=this.bones[e];n&&(n.parent&&n.parent.isBone?(n.matrix.copy(n.parent.matrixWorld).invert(),n.matrix.multiply(n.matrixWorld)):n.matrix.copy(n.matrixWorld),n.matrix.decompose(n.position,n.quaternion,n.scale))}}update(){const e=this.bones,t=this.boneInverses,n=this.boneMatrices,r=this.boneTexture;for(let s=0,o=e.length;s<o;s++){const a=e[s]?e[s].matrixWorld:Adt;nxe.multiplyMatrices(a,t[s]),nxe.toArray(n,s*16)}r!==null&&(r.needsUpdate=!0)}clone(){return new $6(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(this.bones.length*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const n=new Xg(t,e,e,ud,hd);return n.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=n,this}getBoneByName(e){for(let t=0,n=this.bones.length;t<n;t++){const r=this.bones[t];if(r.name===e)return r}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let n=0,r=e.bones.length;n<r;n++){const s=e.bones[n];let o=t[s];o===void 0&&(Oi("Skeleton: No bone found with UUID:",s),o=new Xee),this.bones.push(o),this.boneInverses.push(new er().fromArray(e.boneInverses[n]))}return this.init(),this}toJSON(){const e={metadata:{version:4.7,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const t=this.bones,n=this.boneInverses;for(let r=0,s=t.length;r<s;r++){const o=t[r];e.bones.push(o.uuid);const a=n[r];e.boneInverses.push(a.toArray())}return e}}class m2 extends Mo{constructor(e,t,n,r=1){super(e,t,n),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=r}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}const g2=new er,rxe=new er,q6=[],sxe=new vu,xdt=new er,RO=new ac,LO=new Nh;class oxe extends ac{constructor(e,t,n){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new m2(new Float32Array(n*16),16),this.previousInstanceMatrix=null,this.instanceColor=null,this.morphTexture=null,this.count=n,this.boundingBox=null,this.boundingSphere=null;for(let r=0;r<n;r++)this.setMatrixAt(r,xdt)}computeBoundingBox(){const e=this.geometry,t=this.count;this.boundingBox===null&&(this.boundingBox=new vu),e.boundingBox===null&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,g2),sxe.copy(e.boundingBox).applyMatrix4(g2),this.boundingBox.union(sxe)}computeBoundingSphere(){const e=this.geometry,t=this.count;this.boundingSphere===null&&(this.boundingSphere=new Nh),e.boundingSphere===null&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,g2),LO.copy(e.boundingSphere).applyMatrix4(g2),this.boundingSphere.union(LO)}copy(e,t){return super.copy(e,t),this.instanceMatrix.copy(e.instanceMatrix),e.previousInstanceMatrix!==null&&(this.previousInstanceMatrix=e.previousInstanceMatrix.clone()),e.morphTexture!==null&&(this.morphTexture=e.morphTexture.clone()),e.instanceColor!==null&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}getColorAt(e,t){t.fromArray(this.instanceColor.array,e*3)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,e*16)}getMorphAt(e,t){const n=t.morphTargetInfluences,r=this.morphTexture.source.data.data,s=n.length+1,o=e*s+1;for(let a=0;a<n.length;a++)n[a]=r[o+a]}raycast(e,t){const n=this.matrixWorld,r=this.count;if(RO.geometry=this.geometry,RO.material=this.material,RO.material!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),LO.copy(this.boundingSphere),LO.applyMatrix4(n),e.ray.intersectsSphere(LO)!==!1))for(let s=0;s<r;s++){this.getMatrixAt(s,g2),rxe.multiplyMatrices(n,g2),RO.matrixWorld=rxe,RO.raycast(e,q6);for(let o=0,a=q6.length;o<a;o++){const l=q6[o];l.instanceId=s,l.object=this,t.push(l)}q6.length=0}}setColorAt(e,t){this.instanceColor===null&&(this.instanceColor=new m2(new Float32Array(this.instanceMatrix.count*3).fill(1),3)),t.toArray(this.instanceColor.array,e*3)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,e*16)}setMorphAt(e,t){const n=t.morphTargetInfluences,r=n.length+1;this.morphTexture===null&&(this.morphTexture=new Xg(new Float32Array(r*this.count),r,this.count,R8,hd));const s=this.morphTexture.source.data.data;let o=0;for(let c=0;c<n.length;c++)o+=n[c];const a=this.geometry.morphTargetsRelative?1:1-o,l=r*e;s[l]=a,s.set(n,l+1)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"}),this.morphTexture!==null&&(this.morphTexture.dispose(),this.morphTexture=null)}}const Yee=new ht,wdt=new ht,Edt=new Ar;class cx{constructor(e=new ht(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,r){return this.normal.set(e,t,n),this.constant=r,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){const r=Yee.subVectors(n,t).cross(wdt.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const n=e.delta(Yee),r=this.normal.dot(n);if(r===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const s=-(e.start.dot(this.normal)+this.constant)/r;return s<0||s>1?null:t.copy(e.start).addScaledVector(n,s)}intersectsLine(e){const t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const n=t||Edt.getNormalMatrix(e),r=this.coplanarPoint(Yee).applyMatrix4(e),s=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const jE=new Nh,Sdt=new pi(.5,.5),X6=new ht;class _2{constructor(e=new cx,t=new cx,n=new cx,r=new cx,s=new cx,o=new cx){this.planes=[e,t,n,r,s,o]}set(e,t,n,r,s,o){const a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(n),a[3].copy(r),a[4].copy(s),a[5].copy(o),this}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=uf,n=!1){const r=this.planes,s=e.elements,o=s[0],a=s[1],l=s[2],c=s[3],h=s[4],u=s[5],d=s[6],p=s[7],f=s[8],g=s[9],_=s[10],y=s[11],A=s[12],x=s[13],w=s[14],E=s[15];if(r[0].setComponents(c-o,p-h,y-f,E-A).normalize(),r[1].setComponents(c+o,p+h,y+f,E+A).normalize(),r[2].setComponents(c+a,p+u,y+g,E+x).normalize(),r[3].setComponents(c-a,p-u,y-g,E-x).normalize(),n)r[4].setComponents(l,d,_,w).normalize(),r[5].setComponents(c-l,p-d,y-_,E-w).normalize();else if(r[4].setComponents(c-l,p-d,y-_,E-w).normalize(),t===uf)r[5].setComponents(c+l,p+d,y+_,E+w).normalize();else if(t===kE)r[5].setComponents(l,d,_,w).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),jE.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),jE.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(jE)}intersectsSprite(e){jE.center.set(0,0,0);const t=Sdt.distanceTo(e.center);return jE.radius=.7071067811865476+t,jE.applyMatrix4(e.matrixWorld),this.intersectsSphere(jE)}intersectsSphere(e){const t=this.planes,n=e.center,r=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(n)<r)return!1;return!0}intersectsBox(e){const t=this.planes;for(let n=0;n<6;n++){const r=t[n];if(X6.x=r.normal.x>0?e.max.x:e.min.x,X6.y=r.normal.y>0?e.max.y:e.min.y,X6.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(X6)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}const I_=new er,P_=new _2;class Y6{constructor(){this.coordinateSystem=uf}intersectsObject(e,t){if(!t.isArrayCamera||t.cameras.length===0)return!1;for(let n=0;n<t.cameras.length;n++){const r=t.cameras[n];if(I_.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),P_.setFromProjectionMatrix(I_,r.coordinateSystem,r.reversedDepth),P_.intersectsObject(e))return!0}return!1}intersectsSprite(e,t){if(!t||!t.cameras||t.cameras.length===0)return!1;for(let n=0;n<t.cameras.length;n++){const r=t.cameras[n];if(I_.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),P_.setFromProjectionMatrix(I_,r.coordinateSystem,r.reversedDepth),P_.intersectsSprite(e))return!0}return!1}intersectsSphere(e,t){if(!t||!t.cameras||t.cameras.length===0)return!1;for(let n=0;n<t.cameras.length;n++){const r=t.cameras[n];if(I_.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),P_.setFromProjectionMatrix(I_,r.coordinateSystem,r.reversedDepth),P_.intersectsSphere(e))return!0}return!1}intersectsBox(e,t){if(!t||!t.cameras||t.cameras.length===0)return!1;for(let n=0;n<t.cameras.length;n++){const r=t.cameras[n];if(I_.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),P_.setFromProjectionMatrix(I_,r.coordinateSystem,r.reversedDepth),P_.intersectsBox(e))return!0}return!1}containsPoint(e,t){if(!t||!t.cameras||t.cameras.length===0)return!1;for(let n=0;n<t.cameras.length;n++){const r=t.cameras[n];if(I_.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),P_.setFromProjectionMatrix(I_,r.coordinateSystem,r.reversedDepth),P_.containsPoint(e))return!0}return!1}clone(){return new Y6}}function Qee(i,e){return i-e}function Tdt(i,e){return i.z-e.z}function Cdt(i,e){return e.z-i.z}class Mdt{constructor(){this.index=0,this.pool=[],this.list=[]}push(e,t,n,r){const s=this.pool,o=this.list;this.index>=s.length&&s.push({start:-1,count:-1,z:-1,index:-1});const a=s[this.index];o.push(a),this.index++,a.start=e,a.count=t,a.z=n,a.index=r}reset(){this.list.length=0,this.index=0}}const mp=new er,Idt=new Qi(1,1,1),axe=new _2,Pdt=new Y6,Q6=new vu,WE=new Nh,OO=new ht,lxe=new ht,Ddt=new ht,Kee=new Mdt,Au=new ac,K6=[];function Rdt(i,e,t=0){const n=e.itemSize;if(i.isInterleavedBufferAttribute||i.array.constructor!==e.array.constructor){const r=i.count;for(let s=0;s<r;s++)for(let o=0;o<n;o++)e.setComponent(s+t,o,i.getComponent(s,o))}else e.array.set(i.array,t*n);e.needsUpdate=!0}function $E(i,e){if(i.constructor!==e.constructor){const t=Math.min(i.length,e.length);for(let n=0;n<t;n++)e[n]=i[n]}else{const t=Math.min(i.length,e.length);e.set(new i.constructor(i.buffer,0,t))}}class cxe extends ac{constructor(e,t,n=t*2,r){super(new yr,r),this.isBatchedMesh=!0,this.perObjectFrustumCulled=!0,this.sortObjects=!0,this.boundingBox=null,this.boundingSphere=null,this.customSort=null,this._instanceInfo=[],this._geometryInfo=[],this._availableInstanceIds=[],this._availableGeometryIds=[],this._nextIndexStart=0,this._nextVertexStart=0,this._geometryCount=0,this._visibilityChanged=!0,this._geometryInitialized=!1,this._maxInstanceCount=e,this._maxVertexCount=t,this._maxIndexCount=n,this._multiDrawCounts=new Int32Array(e),this._multiDrawStarts=new Int32Array(e),this._multiDrawCount=0,this._multiDrawInstances=null,this._matricesTexture=null,this._indirectTexture=null,this._colorsTexture=null,this._initMatricesTexture(),this._initIndirectTexture()}get maxInstanceCount(){return this._maxInstanceCount}get instanceCount(){return this._instanceInfo.length-this._availableInstanceIds.length}get unusedVertexCount(){return this._maxVertexCount-this._nextVertexStart}get unusedIndexCount(){return this._maxIndexCount-this._nextIndexStart}_initMatricesTexture(){let e=Math.sqrt(this._maxInstanceCount*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);const t=new Float32Array(e*e*4),n=new Xg(t,e,e,ud,hd);this._matricesTexture=n}_initIndirectTexture(){let e=Math.sqrt(this._maxInstanceCount);e=Math.ceil(e);const t=new Uint32Array(e*e),n=new Xg(t,e,e,uO,wm);this._indirectTexture=n}_initColorsTexture(){let e=Math.sqrt(this._maxInstanceCount);e=Math.ceil(e);const t=new Float32Array(e*e*4).fill(1),n=new Xg(t,e,e,ud,hd);n.colorSpace=_s.workingColorSpace,this._colorsTexture=n}_initializeGeometry(e){const t=this.geometry,n=this._maxVertexCount,r=this._maxIndexCount;if(this._geometryInitialized===!1){for(const s in e.attributes){const o=e.getAttribute(s),{array:a,itemSize:l,normalized:c}=o,h=new a.constructor(n*l),u=new Mo(h,l,c);t.setAttribute(s,u)}if(e.getIndex()!==null){const s=n>65535?new Uint32Array(r):new Uint16Array(r);t.setIndex(new Mo(s,1))}this._geometryInitialized=!0}}_validateGeometry(e){const t=this.geometry;if(!!e.getIndex()!=!!t.getIndex())throw new Error('THREE.BatchedMesh: All geometries must consistently have "index".');for(const n in t.attributes){if(!e.hasAttribute(n))throw new Error(`THREE.BatchedMesh: Added geometry missing "${n}". All geometries must have consistent attributes.`);const r=e.getAttribute(n),s=t.getAttribute(n);if(r.itemSize!==s.itemSize||r.normalized!==s.normalized)throw new Error("THREE.BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}validateInstanceId(e){const t=this._instanceInfo;if(e<0||e>=t.length||t[e].active===!1)throw new Error(`THREE.BatchedMesh: Invalid instanceId ${e}. Instance is either out of range or has been deleted.`)}validateGeometryId(e){const t=this._geometryInfo;if(e<0||e>=t.length||t[e].active===!1)throw new Error(`THREE.BatchedMesh: Invalid geometryId ${e}. Geometry is either out of range or has been deleted.`)}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new vu);const e=this.boundingBox,t=this._instanceInfo;e.makeEmpty();for(let n=0,r=t.length;n<r;n++){if(t[n].active===!1)continue;const s=t[n].geometryIndex;this.getMatrixAt(n,mp),this.getBoundingBoxAt(s,Q6).applyMatrix4(mp),e.union(Q6)}}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Nh);const e=this.boundingSphere,t=this._instanceInfo;e.makeEmpty();for(let n=0,r=t.length;n<r;n++){if(t[n].active===!1)continue;const s=t[n].geometryIndex;this.getMatrixAt(n,mp),this.getBoundingSphereAt(s,WE).applyMatrix4(mp),e.union(WE)}}addInstance(e){if(this._instanceInfo.length>=this.maxInstanceCount&&this._availableInstanceIds.length===0)throw new Error("THREE.BatchedMesh: Maximum item count reached.");const n={visible:!0,active:!0,geometryIndex:e};let r=null;this._availableInstanceIds.length>0?(this._availableInstanceIds.sort(Qee),r=this._availableInstanceIds.shift(),this._instanceInfo[r]=n):(r=this._instanceInfo.length,this._instanceInfo.push(n));const s=this._matricesTexture;mp.identity().toArray(s.image.data,r*16),s.needsUpdate=!0;const o=this._colorsTexture;return o&&(Idt.toArray(o.image.data,r*4),o.needsUpdate=!0),this._visibilityChanged=!0,r}addGeometry(e,t=-1,n=-1){this._initializeGeometry(e),this._validateGeometry(e);const r={vertexStart:-1,vertexCount:-1,reservedVertexCount:-1,indexStart:-1,indexCount:-1,reservedIndexCount:-1,start:-1,count:-1,boundingBox:null,boundingSphere:null,active:!0},s=this._geometryInfo;r.vertexStart=this._nextVertexStart,r.reservedVertexCount=t===-1?e.getAttribute("position").count:t;const o=e.getIndex();if(o!==null&&(r.indexStart=this._nextIndexStart,r.reservedIndexCount=n===-1?o.count:n),r.indexStart!==-1&&r.indexStart+r.reservedIndexCount>this._maxIndexCount||r.vertexStart+r.reservedVertexCount>this._maxVertexCount)throw new Error("THREE.BatchedMesh: Reserved space request exceeds the maximum buffer size.");let l;return this._availableGeometryIds.length>0?(this._availableGeometryIds.sort(Qee),l=this._availableGeometryIds.shift(),s[l]=r):(l=this._geometryCount,this._geometryCount++,s.push(r)),this.setGeometryAt(l,e),this._nextIndexStart=r.indexStart+r.reservedIndexCount,this._nextVertexStart=r.vertexStart+r.reservedVertexCount,l}setGeometryAt(e,t){if(e>=this._geometryCount)throw new Error("THREE.BatchedMesh: Maximum geometry count reached.");this._validateGeometry(t);const n=this.geometry,r=n.getIndex()!==null,s=n.getIndex(),o=t.getIndex(),a=this._geometryInfo[e];if(r&&o.count>a.reservedIndexCount||t.attributes.position.count>a.reservedVertexCount)throw new Error("THREE.BatchedMesh: Reserved space not large enough for provided geometry.");const l=a.vertexStart,c=a.reservedVertexCount;a.vertexCount=t.getAttribute("position").count;for(const h in n.attributes){const u=t.getAttribute(h),d=n.getAttribute(h);Rdt(u,d,l);const p=u.itemSize;for(let f=u.count,g=c;f<g;f++){const _=l+f;for(let y=0;y<p;y++)d.setComponent(_,y,0)}d.needsUpdate=!0,d.addUpdateRange(l*p,c*p)}if(r){const h=a.indexStart,u=a.reservedIndexCount;a.indexCount=t.getIndex().count;for(let d=0;d<o.count;d++)s.setX(h+d,l+o.getX(d));for(let d=o.count,p=u;d<p;d++)s.setX(h+d,l);s.needsUpdate=!0,s.addUpdateRange(h,a.reservedIndexCount)}return a.start=r?a.indexStart:a.vertexStart,a.count=r?a.indexCount:a.vertexCount,a.boundingBox=null,t.boundingBox!==null&&(a.boundingBox=t.boundingBox.clone()),a.boundingSphere=null,t.boundingSphere!==null&&(a.boundingSphere=t.boundingSphere.clone()),this._visibilityChanged=!0,e}deleteGeometry(e){const t=this._geometryInfo;if(e>=t.length||t[e].active===!1)return this;const n=this._instanceInfo;for(let r=0,s=n.length;r<s;r++)n[r].active&&n[r].geometryIndex===e&&this.deleteInstance(r);return t[e].active=!1,this._availableGeometryIds.push(e),this._visibilityChanged=!0,this}deleteInstance(e){return this.validateInstanceId(e),this._instanceInfo[e].active=!1,this._availableInstanceIds.push(e),this._visibilityChanged=!0,this}optimize(){let e=0,t=0;const n=this._geometryInfo,r=n.map((o,a)=>a).sort((o,a)=>n[o].vertexStart-n[a].vertexStart),s=this.geometry;for(let o=0,a=n.length;o<a;o++){const l=r[o],c=n[l];if(c.active!==!1){if(s.index!==null){if(c.indexStart!==t){const{indexStart:h,vertexStart:u,reservedIndexCount:d}=c,p=s.index,f=p.array,g=e-u;for(let _=h;_<h+d;_++)f[_]=f[_]+g;p.array.copyWithin(t,h,h+d),p.addUpdateRange(t,d),p.needsUpdate=!0,c.indexStart=t}t+=c.reservedIndexCount}if(c.vertexStart!==e){const{vertexStart:h,reservedVertexCount:u}=c,d=s.attributes;for(const p in d){const f=d[p],{array:g,itemSize:_}=f;g.copyWithin(e*_,h*_,(h+u)*_),f.addUpdateRange(e*_,u*_),f.needsUpdate=!0}c.vertexStart=e}e+=c.reservedVertexCount,c.start=s.index?c.indexStart:c.vertexStart}}return this._nextIndexStart=t,this._nextVertexStart=e,this._visibilityChanged=!0,this}getBoundingBoxAt(e,t){if(e>=this._geometryCount)return null;const n=this.geometry,r=this._geometryInfo[e];if(r.boundingBox===null){const s=new vu,o=n.index,a=n.attributes.position;for(let l=r.start,c=r.start+r.count;l<c;l++){let h=l;o&&(h=o.getX(h)),s.expandByPoint(OO.fromBufferAttribute(a,h))}r.boundingBox=s}return t.copy(r.boundingBox),t}getBoundingSphereAt(e,t){if(e>=this._geometryCount)return null;const n=this.geometry,r=this._geometryInfo[e];if(r.boundingSphere===null){const s=new Nh;this.getBoundingBoxAt(e,Q6),Q6.getCenter(s.center);const o=n.index,a=n.attributes.position;let l=0;for(let c=r.start,h=r.start+r.count;c<h;c++){let u=c;o&&(u=o.getX(u)),OO.fromBufferAttribute(a,u),l=Math.max(l,s.center.distanceToSquared(OO))}s.radius=Math.sqrt(l),r.boundingSphere=s}return t.copy(r.boundingSphere),t}setMatrixAt(e,t){this.validateInstanceId(e);const n=this._matricesTexture,r=this._matricesTexture.image.data;return t.toArray(r,e*16),n.needsUpdate=!0,this}getMatrixAt(e,t){return this.validateInstanceId(e),t.fromArray(this._matricesTexture.image.data,e*16)}setColorAt(e,t){return this.validateInstanceId(e),this._colorsTexture===null&&this._initColorsTexture(),t.toArray(this._colorsTexture.image.data,e*4),this._colorsTexture.needsUpdate=!0,this}getColorAt(e,t){return this.validateInstanceId(e),t.fromArray(this._colorsTexture.image.data,e*4)}setVisibleAt(e,t){return this.validateInstanceId(e),this._instanceInfo[e].visible===t?this:(this._instanceInfo[e].visible=t,this._visibilityChanged=!0,this)}getVisibleAt(e){return this.validateInstanceId(e),this._instanceInfo[e].visible}setGeometryIdAt(e,t){return this.validateInstanceId(e),this.validateGeometryId(t),this._instanceInfo[e].geometryIndex=t,this}getGeometryIdAt(e){return this.validateInstanceId(e),this._instanceInfo[e].geometryIndex}getGeometryRangeAt(e,t={}){this.validateGeometryId(e);const n=this._geometryInfo[e];return t.vertexStart=n.vertexStart,t.vertexCount=n.vertexCount,t.reservedVertexCount=n.reservedVertexCount,t.indexStart=n.indexStart,t.indexCount=n.indexCount,t.reservedIndexCount=n.reservedIndexCount,t.start=n.start,t.count=n.count,t}setInstanceCount(e){const t=this._availableInstanceIds,n=this._instanceInfo;for(t.sort(Qee);t[t.length-1]===n.length-1;)n.pop(),t.pop();if(e<n.length)throw new Error(`BatchedMesh: Instance ids outside the range ${e} are being used. Cannot shrink instance count.`);const r=new Int32Array(e),s=new Int32Array(e);$E(this._multiDrawCounts,r),$E(this._multiDrawStarts,s),this._multiDrawCounts=r,this._multiDrawStarts=s,this._maxInstanceCount=e;const o=this._indirectTexture,a=this._matricesTexture,l=this._colorsTexture;o.dispose(),this._initIndirectTexture(),$E(o.image.data,this._indirectTexture.image.data),a.dispose(),this._initMatricesTexture(),$E(a.image.data,this._matricesTexture.image.data),l&&(l.dispose(),this._initColorsTexture(),$E(l.image.data,this._colorsTexture.image.data))}setGeometrySize(e,t){const n=[...this._geometryInfo].filter(a=>a.active);if(Math.max(...n.map(a=>a.vertexStart+a.reservedVertexCount))>e)throw new Error(`BatchedMesh: Geometry vertex values are being used outside the range ${t}. Cannot shrink further.`);if(this.geometry.index&&Math.max(...n.map(l=>l.indexStart+l.reservedIndexCount))>t)throw new Error(`BatchedMesh: Geometry index values are being used outside the range ${t}. Cannot shrink further.`);const s=this.geometry;s.dispose(),this._maxVertexCount=e,this._maxIndexCount=t,this._geometryInitialized&&(this._geometryInitialized=!1,this.geometry=new yr,this._initializeGeometry(s));const o=this.geometry;s.index&&$E(s.index.array,o.index.array);for(const a in s.attributes)$E(s.attributes[a].array,o.attributes[a].array)}raycast(e,t){const n=this._instanceInfo,r=this._geometryInfo,s=this.matrixWorld,o=this.geometry;Au.material=this.material,Au.geometry.index=o.index,Au.geometry.attributes=o.attributes,Au.geometry.boundingBox===null&&(Au.geometry.boundingBox=new vu),Au.geometry.boundingSphere===null&&(Au.geometry.boundingSphere=new Nh);for(let a=0,l=n.length;a<l;a++){if(!n[a].visible||!n[a].active)continue;const c=n[a].geometryIndex,h=r[c];Au.geometry.setDrawRange(h.start,h.count),this.getMatrixAt(a,Au.matrixWorld).premultiply(s),this.getBoundingBoxAt(c,Au.geometry.boundingBox),this.getBoundingSphereAt(c,Au.geometry.boundingSphere),Au.raycast(e,K6);for(let u=0,d=K6.length;u<d;u++){const p=K6[u];p.object=this,p.batchId=a,t.push(p)}K6.length=0}Au.material=null,Au.geometry.index=null,Au.geometry.attributes={},Au.geometry.setDrawRange(0,1/0)}copy(e){return super.copy(e),this.geometry=e.geometry.clone(),this.perObjectFrustumCulled=e.perObjectFrustumCulled,this.sortObjects=e.sortObjects,this.boundingBox=e.boundingBox!==null?e.boundingBox.clone():null,this.boundingSphere=e.boundingSphere!==null?e.boundingSphere.clone():null,this._geometryInfo=e._geometryInfo.map(t=>({...t,boundingBox:t.boundingBox!==null?t.boundingBox.clone():null,boundingSphere:t.boundingSphere!==null?t.boundingSphere.clone():null})),this._instanceInfo=e._instanceInfo.map(t=>({...t})),this._availableInstanceIds=e._availableInstanceIds.slice(),this._availableGeometryIds=e._availableGeometryIds.slice(),this._nextIndexStart=e._nextIndexStart,this._nextVertexStart=e._nextVertexStart,this._geometryCount=e._geometryCount,this._maxInstanceCount=e._maxInstanceCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._indirectTexture=e._indirectTexture.clone(),this._indirectTexture.image.data=this._indirectTexture.image.data.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.data.slice(),this._colorsTexture!==null&&(this._colorsTexture=e._colorsTexture.clone(),this._colorsTexture.image.data=this._colorsTexture.image.data.slice()),this}dispose(){this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this._indirectTexture.dispose(),this._indirectTexture=null,this._colorsTexture!==null&&(this._colorsTexture.dispose(),this._colorsTexture=null)}onBeforeRender(e,t,n,r,s){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const o=r.getIndex();let a=o===null?1:o.array.BYTES_PER_ELEMENT,l=1;s.wireframe&&(l=2,a=r.attributes.position.count>65535?4:2);const c=this._instanceInfo,h=this._multiDrawStarts,u=this._multiDrawCounts,d=this._geometryInfo,p=this.perObjectFrustumCulled,f=this._indirectTexture,g=f.image.data,_=n.isArrayCamera?Pdt:axe;p&&!n.isArrayCamera&&(mp.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse).multiply(this.matrixWorld),axe.setFromProjectionMatrix(mp,n.coordinateSystem,n.reversedDepth));let y=0;if(this.sortObjects){mp.copy(this.matrixWorld).invert(),OO.setFromMatrixPosition(n.matrixWorld).applyMatrix4(mp),lxe.set(0,0,-1).transformDirection(n.matrixWorld).transformDirection(mp);for(let w=0,E=c.length;w<E;w++)if(c[w].visible&&c[w].active){const S=c[w].geometryIndex;this.getMatrixAt(w,mp),this.getBoundingSphereAt(S,WE).applyMatrix4(mp);let I=!1;if(p&&(I=!_.intersectsSphere(WE,n)),!I){const C=d[S],T=Ddt.subVectors(WE.center,OO).dot(lxe);Kee.push(C.start,C.count,T,w)}}const A=Kee.list,x=this.customSort;x===null?A.sort(s.transparent?Cdt:Tdt):x.call(this,A,n);for(let w=0,E=A.length;w<E;w++){const S=A[w];h[y]=S.start*a*l,u[y]=S.count*l,g[y]=S.index,y++}Kee.reset()}else for(let A=0,x=c.length;A<x;A++)if(c[A].visible&&c[A].active){const w=c[A].geometryIndex;let E=!1;if(p&&(this.getMatrixAt(A,mp),this.getBoundingSphereAt(w,WE).applyMatrix4(mp),E=!_.intersectsSphere(WE,n)),!E){const S=d[w];h[y]=S.start*a*l,u[y]=S.count*l,g[y]=A,y++}}f.needsUpdate=!0,this._multiDrawCount=y,this._visibilityChanged=!1}onBeforeShadow(e,t,n,r,s,o){this.onBeforeRender(e,null,r,s,o)}}class md extends bu{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Qi(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const J6=new ht,Z6=new ht,hxe=new er,NO=new f2,e9=new Nh,Jee=new ht,uxe=new ht;class hx extends Ls{constructor(e=new yr,t=new md){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,n=[0];for(let r=1,s=t.count;r<s;r++)J6.fromBufferAttribute(t,r-1),Z6.fromBufferAttribute(t,r),n[r]=n[r-1],n[r]+=J6.distanceTo(Z6);e.setAttribute("lineDistance",new rn(n,1))}else Oi("Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){const n=this.geometry,r=this.matrixWorld,s=e.params.Line.threshold,o=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),e9.copy(n.boundingSphere),e9.applyMatrix4(r),e9.radius+=s,e.ray.intersectsSphere(e9)===!1)return;hxe.copy(r).invert(),NO.copy(e.ray).applyMatrix4(hxe);const a=s/((this.scale.x+this.scale.y+this.scale.z)/3),l=a*a,c=this.isLineSegments?2:1,h=n.index,d=n.attributes.position;if(h!==null){const p=Math.max(0,o.start),f=Math.min(h.count,o.start+o.count);for(let g=p,_=f-1;g<_;g+=c){const y=h.getX(g),A=h.getX(g+1),x=t9(this,e,NO,l,y,A,g);x&&t.push(x)}if(this.isLineLoop){const g=h.getX(f-1),_=h.getX(p),y=t9(this,e,NO,l,g,_,f-1);y&&t.push(y)}}else{const p=Math.max(0,o.start),f=Math.min(d.count,o.start+o.count);for(let g=p,_=f-1;g<_;g+=c){const y=t9(this,e,NO,l,g,g+1,g);y&&t.push(y)}if(this.isLineLoop){const g=t9(this,e,NO,l,f-1,p,f-1);g&&t.push(g)}}}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const r=t[n[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s<o;s++){const a=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=s}}}}}function t9(i,e,t,n,r,s,o){const a=i.geometry.attributes.position;if(J6.fromBufferAttribute(a,r),Z6.fromBufferAttribute(a,s),t.distanceSqToSegment(J6,Z6,Jee,uxe)>n)return;Jee.applyMatrix4(i.matrixWorld);const c=e.ray.origin.distanceTo(Jee);if(!(c<e.near||c>e.far))return{distance:c,point:uxe.clone().applyMatrix4(i.matrixWorld),index:o,face:null,faceIndex:null,barycoord:null,object:i}}const dxe=new ht,pxe=new ht;class D_ extends hx{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,n=[];for(let r=0,s=t.count;r<s;r+=2)dxe.fromBufferAttribute(t,r),pxe.fromBufferAttribute(t,r+1),n[r]=r===0?0:n[r-1],n[r+1]=n[r]+dxe.distanceTo(pxe);e.setAttribute("lineDistance",new rn(n,1))}else Oi("LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class fxe extends hx{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type="LineLoop"}}class Zee extends bu{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new Qi(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}const mxe=new er,ete=new f2,i9=new Nh,n9=new ht;class gxe extends Ls{constructor(e=new yr,t=new Zee){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,t){const n=this.geometry,r=this.matrixWorld,s=e.params.Points.threshold,o=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),i9.copy(n.boundingSphere),i9.applyMatrix4(r),i9.radius+=s,e.ray.intersectsSphere(i9)===!1)return;mxe.copy(r).invert(),ete.copy(e.ray).applyMatrix4(mxe);const a=s/((this.scale.x+this.scale.y+this.scale.z)/3),l=a*a,c=n.index,u=n.attributes.position;if(c!==null){const d=Math.max(0,o.start),p=Math.min(c.count,o.start+o.count);for(let f=d,g=p;f<g;f++){const _=c.getX(f);n9.fromBufferAttribute(u,_),_xe(n9,_,l,r,e,t,this)}}else{const d=Math.max(0,o.start),p=Math.min(u.count,o.start+o.count);for(let f=d,g=p;f<g;f++)n9.fromBufferAttribute(u,f),_xe(n9,f,l,r,e,t,this)}}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const r=t[n[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s<o;s++){const a=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=s}}}}}function _xe(i,e,t,n,r,s,o){const a=ete.distanceSqToPoint(i);if(a<t){const l=new ht;ete.closestPointToPoint(i,l),l.applyMatrix4(n);const c=r.ray.origin.distanceTo(l);if(c<r.near||c>r.far)return;s.push({distance:c,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,faceIndex:null,barycoord:null,object:o})}}class yxe extends dl{constructor(e,t,n,r,s=ua,o=ua,a,l,c){super(e,t,n,r,s,o,a,l,c),this.isVideoTexture=!0,this.generateMipmaps=!1,this._requestVideoFrameCallbackId=0;const h=this;function u(){h.needsUpdate=!0,h._requestVideoFrameCallbackId=e.requestVideoFrameCallback(u)}"requestVideoFrameCallback"in e&&(this._requestVideoFrameCallbackId=e.requestVideoFrameCallback(u))}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}dispose(){this._requestVideoFrameCallbackId!==0&&(this.source.data.cancelVideoFrameCallback(this._requestVideoFrameCallbackId),this._requestVideoFrameCallbackId=0),super.dispose()}}class Ldt extends yxe{constructor(e,t,n,r,s,o,a,l){super({},e,t,n,r,s,o,a,l),this.isVideoFrameTexture=!0}update(){}clone(){return new this.constructor().copy(this)}setFrame(e){this.image=e,this.needsUpdate=!0}}class Odt extends dl{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=kl,this.minFilter=kl,this.generateMipmaps=!1,this.needsUpdate=!0}}class r9 extends dl{constructor(e,t,n,r,s,o,a,l,c,h,u,d){super(null,o,a,l,c,h,r,s,u,d),this.isCompressedTexture=!0,this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class Ndt extends r9{constructor(e,t,n,r,s,o){super(e,t,n,s,o),this.isCompressedArrayTexture=!0,this.image.depth=r,this.wrapR=hp,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class Bdt extends r9{constructor(e,t,n){super(void 0,e[0].width,e[0].height,t,n,E_),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class BO extends dl{constructor(e=[],t=E_,n,r,s,o,a,l,c,h){super(e,t,n,r,s,o,a,l,c,h),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class Fdt extends dl{constructor(e,t,n,r,s,o,a,l,c){super(e,t,n,r,s,o,a,l,c),this.isCanvasTexture=!0,this.needsUpdate=!0}}class y2 extends dl{constructor(e,t,n=wm,r,s,o,a=kl,l=kl,c,h=C_,u=1){if(h!==C_&&h!==ZA)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");const d={width:e,height:t,depth:u};super(d,r,s,o,a,l,h,n,c),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new ix(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}class vxe extends y2{constructor(e,t=wm,n=E_,r,s,o=kl,a=kl,l,c=C_){const h={width:e,height:e,depth:1},u=[h,h,h,h,h,h];super(e,e,t,n,r,s,o,a,l,c),this.image=u,this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(e){this.image=e}}class tte extends dl{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}}class qE extends yr{constructor(e=1,t=1,n=1,r=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:s,depthSegments:o};const a=this;r=Math.floor(r),s=Math.floor(s),o=Math.floor(o);const l=[],c=[],h=[],u=[];let d=0,p=0;f("z","y","x",-1,-1,n,t,e,o,s,0),f("z","y","x",1,-1,n,t,-e,o,s,1),f("x","z","y",1,1,e,n,t,r,o,2),f("x","z","y",1,-1,e,n,-t,r,o,3),f("x","y","z",1,-1,e,t,n,r,s,4),f("x","y","z",-1,-1,e,t,-n,r,s,5),this.setIndex(l),this.setAttribute("position",new rn(c,3)),this.setAttribute("normal",new rn(h,3)),this.setAttribute("uv",new rn(u,2));function f(g,_,y,A,x,w,E,S,I,C,T){const D=w/I,M=E/C,R=w/2,v=E/2,P=S/2,O=I+1,B=C+1;let k=0,H=0;const z=new ht;for(let j=0;j<B;j++){const $=j*M-v;for(let Q=0;Q<O;Q++){const se=Q*D-R;z[g]=se*A,z[_]=$*x,z[y]=P,c.push(z.x,z.y,z.z),z[g]=0,z[_]=0,z[y]=S>0?1:-1,h.push(z.x,z.y,z.z),u.push(Q/I),u.push(1-j/C),k+=1}}for(let j=0;j<C;j++)for(let $=0;$<I;$++){const Q=d+$+O*j,se=d+$+O*(j+1),te=d+($+1)+O*(j+1),ue=d+($+1)+O*j;l.push(Q,se,ue),l.push(se,te,ue),H+=6}a.addGroup(p,H,T),p+=H,d+=k}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new qE(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}class s9 extends yr{constructor(e=1,t=1,n=4,r=8,s=1){super(),this.type="CapsuleGeometry",this.parameters={radius:e,height:t,capSegments:n,radialSegments:r,heightSegments:s},t=Math.max(0,t),n=Math.max(1,Math.floor(n)),r=Math.max(3,Math.floor(r)),s=Math.max(1,Math.floor(s));const o=[],a=[],l=[],c=[],h=t/2,u=Math.PI/2*e,d=t,p=2*u+d,f=n*2+s,g=r+1,_=new ht,y=new ht;for(let A=0;A<=f;A++){let x=0,w=0,E=0,S=0;if(A<=n){const T=A/n,D=T*Math.PI/2;w=-h-e*Math.cos(D),E=e*Math.sin(D),S=-e*Math.cos(D),x=T*u}else if(A<=n+s){const T=(A-n)/s;w=-h+T*t,E=e,S=0,x=u+T*d}else{const T=(A-n-s)/n,D=T*Math.PI/2;w=h+e*Math.sin(D),E=e*Math.cos(D),S=e*Math.sin(D),x=u+d+T*u}const I=Math.max(0,Math.min(1,x/p));let C=0;A===0?C=.5/r:A===f&&(C=-.5/r);for(let T=0;T<=r;T++){const D=T/r,M=D*Math.PI*2,R=Math.sin(M),v=Math.cos(M);y.x=-E*v,y.y=w,y.z=E*R,a.push(y.x,y.y,y.z),_.set(-E*v,S,E*R),_.normalize(),l.push(_.x,_.y,_.z),c.push(D+C,I)}if(A>0){const T=(A-1)*g;for(let D=0;D<r;D++){const M=T+D,R=T+D+1,v=A*g+D,P=A*g+D+1;o.push(M,R,v),o.push(R,P,v)}}}this.setIndex(o),this.setAttribute("position",new rn(a,3)),this.setAttribute("normal",new rn(l,3)),this.setAttribute("uv",new rn(c,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new s9(e.radius,e.height,e.capSegments,e.radialSegments,e.heightSegments)}}class o9 extends yr{constructor(e=1,t=32,n=0,r=Math.PI*2){super(),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:r},t=Math.max(3,t);const s=[],o=[],a=[],l=[],c=new ht,h=new pi;o.push(0,0,0),a.push(0,0,1),l.push(.5,.5);for(let u=0,d=3;u<=t;u++,d+=3){const p=n+u/t*r;c.x=e*Math.cos(p),c.y=e*Math.sin(p),o.push(c.x,c.y,c.z),a.push(0,0,1),h.x=(o[d]/e+1)/2,h.y=(o[d+1]/e+1)/2,l.push(h.x,h.y)}for(let u=1;u<=t;u++)s.push(u,u+1,0);this.setIndex(s),this.setAttribute("position",new rn(o,3)),this.setAttribute("normal",new rn(a,3)),this.setAttribute("uv",new rn(l,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new o9(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class FO extends yr{constructor(e=1,t=1,n=1,r=32,s=1,o=!1,a=0,l=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:r,heightSegments:s,openEnded:o,thetaStart:a,thetaLength:l};const c=this;r=Math.floor(r),s=Math.floor(s);const h=[],u=[],d=[],p=[];let f=0;const g=[],_=n/2;let y=0;A(),o===!1&&(e>0&&x(!0),t>0&&x(!1)),this.setIndex(h),this.setAttribute("position",new rn(u,3)),this.setAttribute("normal",new rn(d,3)),this.setAttribute("uv",new rn(p,2));function A(){const w=new ht,E=new ht;let S=0;const I=(t-e)/n;for(let C=0;C<=s;C++){const T=[],D=C/s,M=D*(t-e)+e;for(let R=0;R<=r;R++){const v=R/r,P=v*l+a,O=Math.sin(P),B=Math.cos(P);E.x=M*O,E.y=-D*n+_,E.z=M*B,u.push(E.x,E.y,E.z),w.set(O,I,B).normalize(),d.push(w.x,w.y,w.z),p.push(v,1-D),T.push(f++)}g.push(T)}for(let C=0;C<r;C++)for(let T=0;T<s;T++){const D=g[T][C],M=g[T+1][C],R=g[T+1][C+1],v=g[T][C+1];(e>0||T!==0)&&(h.push(D,M,v),S+=3),(t>0||T!==s-1)&&(h.push(M,R,v),S+=3)}c.addGroup(y,S,0),y+=S}function x(w){const E=f,S=new pi,I=new ht;let C=0;const T=w===!0?e:t,D=w===!0?1:-1;for(let R=1;R<=r;R++)u.push(0,_*D,0),d.push(0,D,0),p.push(.5,.5),f++;const M=f;for(let R=0;R<=r;R++){const P=R/r*l+a,O=Math.cos(P),B=Math.sin(P);I.x=T*B,I.y=_*D,I.z=T*O,u.push(I.x,I.y,I.z),d.push(0,D,0),S.x=O*.5+.5,S.y=B*.5*D+.5,p.push(S.x,S.y),f++}for(let R=0;R<r;R++){const v=E+R,P=M+R;w===!0?h.push(P,P+1,v):h.push(P+1,P,v),C+=3}c.addGroup(y,C,w===!0?1:2),y+=C}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new FO(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class kO extends FO{constructor(e=1,t=1,n=32,r=1,s=!1,o=0,a=Math.PI*2){super(0,e,t,n,r,s,o,a),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:r,openEnded:s,thetaStart:o,thetaLength:a}}static fromJSON(e){return new kO(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class ux extends yr{constructor(e=[],t=[],n=1,r=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:r};const s=[],o=[];a(r),c(n),h(),this.setAttribute("position",new rn(s,3)),this.setAttribute("normal",new rn(s.slice(),3)),this.setAttribute("uv",new rn(o,2)),r===0?this.computeVertexNormals():this.normalizeNormals();function a(A){const x=new ht,w=new ht,E=new ht;for(let S=0;S<t.length;S+=3)p(t[S+0],x),p(t[S+1],w),p(t[S+2],E),l(x,w,E,A)}function l(A,x,w,E){const S=E+1,I=[];for(let C=0;C<=S;C++){I[C]=[];const T=A.clone().lerp(w,C/S),D=x.clone().lerp(w,C/S),M=S-C;for(let R=0;R<=M;R++)R===0&&C===S?I[C][R]=T:I[C][R]=T.clone().lerp(D,R/M)}for(let C=0;C<S;C++)for(let T=0;T<2*(S-C)-1;T++){const D=Math.floor(T/2);T%2===0?(d(I[C][D+1]),d(I[C+1][D]),d(I[C][D])):(d(I[C][D+1]),d(I[C+1][D+1]),d(I[C+1][D]))}}function c(A){const x=new ht;for(let w=0;w<s.length;w+=3)x.x=s[w+0],x.y=s[w+1],x.z=s[w+2],x.normalize().multiplyScalar(A),s[w+0]=x.x,s[w+1]=x.y,s[w+2]=x.z}function h(){const A=new ht;for(let x=0;x<s.length;x+=3){A.x=s[x+0],A.y=s[x+1],A.z=s[x+2];const w=_(A)/2/Math.PI+.5,E=y(A)/Math.PI+.5;o.push(w,1-E)}f(),u()}function u(){for(let A=0;A<o.length;A+=6){const x=o[A+0],w=o[A+2],E=o[A+4],S=Math.max(x,w,E),I=Math.min(x,w,E);S>.9&&I<.1&&(x<.2&&(o[A+0]+=1),w<.2&&(o[A+2]+=1),E<.2&&(o[A+4]+=1))}}function d(A){s.push(A.x,A.y,A.z)}function p(A,x){const w=A*3;x.x=e[w+0],x.y=e[w+1],x.z=e[w+2]}function f(){const A=new ht,x=new ht,w=new ht,E=new ht,S=new pi,I=new pi,C=new pi;for(let T=0,D=0;T<s.length;T+=9,D+=6){A.set(s[T+0],s[T+1],s[T+2]),x.set(s[T+3],s[T+4],s[T+5]),w.set(s[T+6],s[T+7],s[T+8]),S.set(o[D+0],o[D+1]),I.set(o[D+2],o[D+3]),C.set(o[D+4],o[D+5]),E.copy(A).add(x).add(w).divideScalar(3);const M=_(E);g(S,D+0,A,M),g(I,D+2,x,M),g(C,D+4,w,M)}}function g(A,x,w,E){E<0&&A.x===1&&(o[x]=A.x-1),w.x===0&&w.z===0&&(o[x]=E/2/Math.PI+.5)}function _(A){return Math.atan2(A.z,-A.x)}function y(A){return Math.atan2(-A.y,Math.sqrt(A.x*A.x+A.z*A.z))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new ux(e.vertices,e.indices,e.radius,e.detail)}}class a9 extends ux{constructor(e=1,t=0){const n=(1+Math.sqrt(5))/2,r=1/n,s=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-r,-n,0,-r,n,0,r,-n,0,r,n,-r,-n,0,-r,n,0,r,-n,0,r,n,0,-n,0,-r,n,0,-r,-n,0,r,n,0,r],o=[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9];super(s,o,e,t),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new a9(e.radius,e.detail)}}const l9=new ht,c9=new ht,ite=new ht,h9=new pp;class bxe extends yr{constructor(e=null,t=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:e,thresholdAngle:t},e!==null){const r=Math.pow(10,4),s=Math.cos(UE*t),o=e.getIndex(),a=e.getAttribute("position"),l=o?o.count:a.count,c=[0,0,0],h=["a","b","c"],u=new Array(3),d={},p=[];for(let f=0;f<l;f+=3){o?(c[0]=o.getX(f),c[1]=o.getX(f+1),c[2]=o.getX(f+2)):(c[0]=f,c[1]=f+1,c[2]=f+2);const{a:g,b:_,c:y}=h9;if(g.fromBufferAttribute(a,c[0]),_.fromBufferAttribute(a,c[1]),y.fromBufferAttribute(a,c[2]),h9.getNormal(ite),u[0]=`${Math.round(g.x*r)},${Math.round(g.y*r)},${Math.round(g.z*r)}`,u[1]=`${Math.round(_.x*r)},${Math.round(_.y*r)},${Math.round(_.z*r)}`,u[2]=`${Math.round(y.x*r)},${Math.round(y.y*r)},${Math.round(y.z*r)}`,!(u[0]===u[1]||u[1]===u[2]||u[2]===u[0]))for(let A=0;A<3;A++){const x=(A+1)%3,w=u[A],E=u[x],S=h9[h[A]],I=h9[h[x]],C=`${w}_${E}`,T=`${E}_${w}`;T in d&&d[T]?(ite.dot(d[T].normal)<=s&&(p.push(S.x,S.y,S.z),p.push(I.x,I.y,I.z)),d[T]=null):C in d||(d[C]={index0:c[A],index1:c[x],normal:ite.clone()})}}for(const f in d)if(d[f]){const{index0:g,index1:_}=d[f];l9.fromBufferAttribute(a,g),c9.fromBufferAttribute(a,_),p.push(l9.x,l9.y,l9.z),p.push(c9.x,c9.y,c9.z)}this.setAttribute("position",new rn(p,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}class Yg{constructor(){this.type="Curve",this.arcLengthDivisions=200,this.needsUpdate=!1,this.cacheArcLengths=null}getPoint(){Oi("Curve: .getPoint() not implemented.")}getPointAt(e,t){const n=this.getUtoTmapping(e);return this.getPoint(n,t)}getPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return t}getSpacedPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let n,r=this.getPoint(0),s=0;t.push(0);for(let o=1;o<=e;o++)n=this.getPoint(o/e),s+=n.distanceTo(r),t.push(s),r=n;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t=null){const n=this.getLengths();let r=0;const s=n.length;let o;t?o=t:o=e*n[s-1];let a=0,l=s-1,c;for(;a<=l;)if(r=Math.floor(a+(l-a)/2),c=n[r]-o,c<0)a=r+1;else if(c>0)l=r-1;else{l=r;break}if(r=l,n[r]===o)return r/(s-1);const h=n[r],d=n[r+1]-h,p=(o-h)/d;return(r+p)/(s-1)}getTangent(e,t){let r=e-1e-4,s=e+1e-4;r<0&&(r=0),s>1&&(s=1);const o=this.getPoint(r),a=this.getPoint(s),l=t||(o.isVector2?new pi:new ht);return l.copy(a).sub(o).normalize(),l}getTangentAt(e,t){const n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t=!1){const n=new ht,r=[],s=[],o=[],a=new ht,l=new er;for(let p=0;p<=e;p++){const f=p/e;r[p]=this.getTangentAt(f,new ht)}s[0]=new ht,o[0]=new ht;let c=Number.MAX_VALUE;const h=Math.abs(r[0].x),u=Math.abs(r[0].y),d=Math.abs(r[0].z);h<=c&&(c=h,n.set(1,0,0)),u<=c&&(c=u,n.set(0,1,0)),d<=c&&n.set(0,0,1),a.crossVectors(r[0],n).normalize(),s[0].crossVectors(r[0],a),o[0].crossVectors(r[0],s[0]);for(let p=1;p<=e;p++){if(s[p]=s[p-1].clone(),o[p]=o[p-1].clone(),a.crossVectors(r[p-1],r[p]),a.length()>Number.EPSILON){a.normalize();const f=Math.acos(Xn(r[p-1].dot(r[p]),-1,1));s[p].applyMatrix4(l.makeRotationAxis(a,f))}o[p].crossVectors(r[p],s[p])}if(t===!0){let p=Math.acos(Xn(s[0].dot(s[e]),-1,1));p/=e,r[0].dot(a.crossVectors(s[0],s[e]))>0&&(p=-p);for(let f=1;f<=e;f++)s[f].applyMatrix4(l.makeRotationAxis(r[f],p*f)),o[f].crossVectors(r[f],s[f])}return{tangents:r,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.7,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class u9 extends Yg{constructor(e=0,t=0,n=1,r=1,s=0,o=Math.PI*2,a=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=r,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=a,this.aRotation=l}getPoint(e,t=new pi){const n=t,r=Math.PI*2;let s=this.aEndAngle-this.aStartAngle;const o=Math.abs(s)<Number.EPSILON;for(;s<0;)s+=r;for(;s>r;)s-=r;s<Number.EPSILON&&(o?s=0:s=r),this.aClockwise===!0&&!o&&(s===r?s=-r:s=s-r);const a=this.aStartAngle+e*s;let l=this.aX+this.xRadius*Math.cos(a),c=this.aY+this.yRadius*Math.sin(a);if(this.aRotation!==0){const h=Math.cos(this.aRotation),u=Math.sin(this.aRotation),d=l-this.aX,p=c-this.aY;l=d*h-p*u+this.aX,c=d*u+p*h+this.aY}return n.set(l,c)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){const e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}}class Axe extends u9{constructor(e,t,n,r,s,o){super(e,t,n,n,r,s,o),this.isArcCurve=!0,this.type="ArcCurve"}}function nte(){let i=0,e=0,t=0,n=0;function r(s,o,a,l){i=s,e=a,t=-3*s+3*o-2*a-l,n=2*s-2*o+a+l}return{initCatmullRom:function(s,o,a,l,c){r(o,a,c*(a-s),c*(l-o))},initNonuniformCatmullRom:function(s,o,a,l,c,h,u){let d=(o-s)/c-(a-s)/(c+h)+(a-o)/h,p=(a-o)/h-(l-o)/(h+u)+(l-a)/u;d*=h,p*=h,r(o,a,d,p)},calc:function(s){const o=s*s,a=o*s;return i+e*s+t*o+n*a}}}const d9=new ht,rte=new nte,ste=new nte,ote=new nte;class xxe extends Yg{constructor(e=[],t=!1,n="centripetal",r=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=n,this.tension=r}getPoint(e,t=new ht){const n=t,r=this.points,s=r.length,o=(s-(this.closed?0:1))*e;let a=Math.floor(o),l=o-a;this.closed?a+=a>0?0:(Math.floor(Math.abs(a)/s)+1)*s:l===0&&a===s-1&&(a=s-2,l=1);let c,h;this.closed||a>0?c=r[(a-1)%s]:(d9.subVectors(r[0],r[1]).add(r[0]),c=d9);const u=r[a%s],d=r[(a+1)%s];if(this.closed||a+2<s?h=r[(a+2)%s]:(d9.subVectors(r[s-1],r[s-2]).add(r[s-1]),h=d9),this.curveType==="centripetal"||this.curveType==="chordal"){const p=this.curveType==="chordal"?.5:.25;let f=Math.pow(c.distanceToSquared(u),p),g=Math.pow(u.distanceToSquared(d),p),_=Math.pow(d.distanceToSquared(h),p);g<1e-4&&(g=1),f<1e-4&&(f=g),_<1e-4&&(_=g),rte.initNonuniformCatmullRom(c.x,u.x,d.x,h.x,f,g,_),ste.initNonuniformCatmullRom(c.y,u.y,d.y,h.y,f,g,_),ote.initNonuniformCatmullRom(c.z,u.z,d.z,h.z,f,g,_)}else this.curveType==="catmullrom"&&(rte.initCatmullRom(c.x,u.x,d.x,h.x,this.tension),ste.initCatmullRom(c.y,u.y,d.y,h.y,this.tension),ote.initCatmullRom(c.z,u.z,d.z,h.z,this.tension));return n.set(rte.calc(l),ste.calc(l),ote.calc(l)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const r=e.points[t];this.points.push(r.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const r=this.points[t];e.points.push(r.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const r=e.points[t];this.points.push(new ht().fromArray(r))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}function wxe(i,e,t,n,r){const s=(n-e)*.5,o=(r-t)*.5,a=i*i,l=i*a;return(2*t-2*n+s+o)*l+(-3*t+3*n-2*s-o)*a+s*i+t}function kdt(i,e){const t=1-i;return t*t*e}function Udt(i,e){return 2*(1-i)*i*e}function zdt(i,e){return i*i*e}function UO(i,e,t,n){return kdt(i,e)+Udt(i,t)+zdt(i,n)}function Hdt(i,e){const t=1-i;return t*t*t*e}function Vdt(i,e){const t=1-i;return 3*t*t*i*e}function Gdt(i,e){return 3*(1-i)*i*i*e}function jdt(i,e){return i*i*i*e}function zO(i,e,t,n,r){return Hdt(i,e)+Vdt(i,t)+Gdt(i,n)+jdt(i,r)}class ate extends Yg{constructor(e=new pi,t=new pi,n=new pi,r=new pi){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=n,this.v3=r}getPoint(e,t=new pi){const n=t,r=this.v0,s=this.v1,o=this.v2,a=this.v3;return n.set(zO(e,r.x,s.x,o.x,a.x),zO(e,r.y,s.y,o.y,a.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class Exe extends Yg{constructor(e=new ht,t=new ht,n=new ht,r=new ht){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=n,this.v3=r}getPoint(e,t=new ht){const n=t,r=this.v0,s=this.v1,o=this.v2,a=this.v3;return n.set(zO(e,r.x,s.x,o.x,a.x),zO(e,r.y,s.y,o.y,a.y),zO(e,r.z,s.z,o.z,a.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class lte extends Yg{constructor(e=new pi,t=new pi){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new pi){const n=t;return e===1?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new pi){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class Sxe extends Yg{constructor(e=new ht,t=new ht){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=e,this.v2=t}getPoint(e,t=new ht){const n=t;return e===1?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new ht){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class cte extends Yg{constructor(e=new pi,t=new pi,n=new pi){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new pi){const n=t,r=this.v0,s=this.v1,o=this.v2;return n.set(UO(e,r.x,s.x,o.x),UO(e,r.y,s.y,o.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class hte extends Yg{constructor(e=new ht,t=new ht,n=new ht){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new ht){const n=t,r=this.v0,s=this.v1,o=this.v2;return n.set(UO(e,r.x,s.x,o.x),UO(e,r.y,s.y,o.y),UO(e,r.z,s.z,o.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class ute extends Yg{constructor(e=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=e}getPoint(e,t=new pi){const n=t,r=this.points,s=(r.length-1)*e,o=Math.floor(s),a=s-o,l=r[o===0?o:o-1],c=r[o],h=r[o>r.length-2?r.length-1:o+1],u=r[o>r.length-3?r.length-1:o+2];return n.set(wxe(a,l.x,c.x,h.x,u.x),wxe(a,l.y,c.y,h.y,u.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const r=e.points[t];this.points.push(r.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const r=this.points[t];e.points.push(r.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const r=e.points[t];this.points.push(new pi().fromArray(r))}return this}}var p9=Object.freeze({__proto__:null,ArcCurve:Axe,CatmullRomCurve3:xxe,CubicBezierCurve:ate,CubicBezierCurve3:Exe,EllipseCurve:u9,LineCurve:lte,LineCurve3:Sxe,QuadraticBezierCurve:cte,QuadraticBezierCurve3:hte,SplineCurve:ute});class Txe extends Yg{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){const e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);if(!e.equals(t)){const n=e.isVector2===!0?"LineCurve":"LineCurve3";this.curves.push(new p9[n](t,e))}return this}getPoint(e,t){const n=e*this.getLength(),r=this.getCurveLengths();let s=0;for(;s<r.length;){if(r[s]>=n){const o=r[s]-n,a=this.curves[s],l=a.getLength(),c=l===0?0:1-o/l;return a.getPointAt(c,t)}s++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let n=0,r=this.curves.length;n<r;n++)t+=this.curves[n].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(e=40){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return this.autoClose&&t.push(t[0]),t}getPoints(e=12){const t=[];let n;for(let r=0,s=this.curves;r<s.length;r++){const o=s[r],a=o.isEllipseCurve?e*2:o.isLineCurve||o.isLineCurve3?1:o.isSplineCurve?e*o.points.length:e,l=o.getPoints(a);for(let c=0;c<l.length;c++){const h=l[c];n&&n.equals(h)||(t.push(h),n=h)}}return this.autoClose&&t.length>1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){const r=e.curves[t];this.curves.push(r.clone())}return this.autoClose=e.autoClose,this}toJSON(){const e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,n=this.curves.length;t<n;t++){const r=this.curves[t];e.curves.push(r.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){const r=e.curves[t];this.curves.push(new p9[r.type]().fromJSON(r))}return this}}class f9 extends Txe{constructor(e){super(),this.type="Path",this.currentPoint=new pi,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,n=e.length;t<n;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){const n=new lte(this.currentPoint.clone(),new pi(e,t));return this.curves.push(n),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,n,r){const s=new cte(this.currentPoint.clone(),new pi(e,t),new pi(n,r));return this.curves.push(s),this.currentPoint.set(n,r),this}bezierCurveTo(e,t,n,r,s,o){const a=new ate(this.currentPoint.clone(),new pi(e,t),new pi(n,r),new pi(s,o));return this.curves.push(a),this.currentPoint.set(s,o),this}splineThru(e){const t=[this.currentPoint.clone()].concat(e),n=new ute(t);return this.curves.push(n),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,n,r,s,o){const a=this.currentPoint.x,l=this.currentPoint.y;return this.absarc(e+a,t+l,n,r,s,o),this}absarc(e,t,n,r,s,o){return this.absellipse(e,t,n,n,r,s,o),this}ellipse(e,t,n,r,s,o,a,l){const c=this.currentPoint.x,h=this.currentPoint.y;return this.absellipse(e+c,t+h,n,r,s,o,a,l),this}absellipse(e,t,n,r,s,o,a,l){const c=new u9(e,t,n,r,s,o,a,l);if(this.curves.length>0){const u=c.getPoint(0);u.equals(this.currentPoint)||this.lineTo(u.x,u.y)}this.curves.push(c);const h=c.getPoint(1);return this.currentPoint.copy(h),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class XE extends f9{constructor(e){super(e),this.uuid=df(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let n=0,r=this.holes.length;n<r;n++)t[n]=this.holes[n].getPoints(e);return t}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){const r=e.holes[t];this.holes.push(r.clone())}return this}toJSON(){const e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,n=this.holes.length;t<n;t++){const r=this.holes[t];e.holes.push(r.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){const r=e.holes[t];this.holes.push(new f9().fromJSON(r))}return this}}function Wdt(i,e,t=2){const n=e&&e.length,r=n?e[0]*t:i.length;let s=Cxe(i,0,r,t,!0);const o=[];if(!s||s.next===s.prev)return o;let a,l,c;if(n&&(s=Qdt(i,e,s,t)),i.length>80*t){a=i[0],l=i[1];let h=a,u=l;for(let d=t;d<r;d+=t){const p=i[d],f=i[d+1];p<a&&(a=p),f<l&&(l=f),p>h&&(h=p),f>u&&(u=f)}c=Math.max(h-a,u-l),c=c!==0?32767/c:0}return HO(s,o,t,a,l,c,0),o}function Cxe(i,e,t,n,r){let s;if(r===apt(i,e,t,n)>0)for(let o=e;o<t;o+=n)s=Dxe(o/n|0,i[o],i[o+1],s);else for(let o=t-n;o>=e;o-=n)s=Dxe(o/n|0,i[o],i[o+1],s);return s&&v2(s,s.next)&&(jO(s),s=s.next),s}function YE(i,e){if(!i)return i;e||(e=i);let t=i,n;do if(n=!1,!t.steiner&&(v2(t,t.next)||qa(t.prev,t,t.next)===0)){if(jO(t),t=e=t.prev,t===t.next)break;n=!0}else t=t.next;while(n||t!==e);return e}function HO(i,e,t,n,r,s,o){if(!i)return;!o&&s&&tpt(i,n,r,s);let a=i;for(;i.prev!==i.next;){const l=i.prev,c=i.next;if(s?qdt(i,n,r,s):$dt(i)){e.push(l.i,i.i,c.i),jO(i),i=c.next,a=c.next;continue}if(i=c,i===a){o?o===1?(i=Xdt(YE(i),e),HO(i,e,t,n,r,s,2)):o===2&&Ydt(i,e,t,n,r,s):HO(YE(i),e,t,n,r,s,1);break}}}function $dt(i){const e=i.prev,t=i,n=i.next;if(qa(e,t,n)>=0)return!1;const r=e.x,s=t.x,o=n.x,a=e.y,l=t.y,c=n.y,h=Math.min(r,s,o),u=Math.min(a,l,c),d=Math.max(r,s,o),p=Math.max(a,l,c);let f=n.next;for(;f!==e;){if(f.x>=h&&f.x<=d&&f.y>=u&&f.y<=p&&VO(r,a,s,l,o,c,f.x,f.y)&&qa(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function qdt(i,e,t,n){const r=i.prev,s=i,o=i.next;if(qa(r,s,o)>=0)return!1;const a=r.x,l=s.x,c=o.x,h=r.y,u=s.y,d=o.y,p=Math.min(a,l,c),f=Math.min(h,u,d),g=Math.max(a,l,c),_=Math.max(h,u,d),y=dte(p,f,e,t,n),A=dte(g,_,e,t,n);let x=i.prevZ,w=i.nextZ;for(;x&&x.z>=y&&w&&w.z<=A;){if(x.x>=p&&x.x<=g&&x.y>=f&&x.y<=_&&x!==r&&x!==o&&VO(a,h,l,u,c,d,x.x,x.y)&&qa(x.prev,x,x.next)>=0||(x=x.prevZ,w.x>=p&&w.x<=g&&w.y>=f&&w.y<=_&&w!==r&&w!==o&&VO(a,h,l,u,c,d,w.x,w.y)&&qa(w.prev,w,w.next)>=0))return!1;w=w.nextZ}for(;x&&x.z>=y;){if(x.x>=p&&x.x<=g&&x.y>=f&&x.y<=_&&x!==r&&x!==o&&VO(a,h,l,u,c,d,x.x,x.y)&&qa(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;w&&w.z<=A;){if(w.x>=p&&w.x<=g&&w.y>=f&&w.y<=_&&w!==r&&w!==o&&VO(a,h,l,u,c,d,w.x,w.y)&&qa(w.prev,w,w.next)>=0)return!1;w=w.nextZ}return!0}function Xdt(i,e){let t=i;do{const n=t.prev,r=t.next.next;!v2(n,r)&&Ixe(n,t,t.next,r)&&GO(n,r)&&GO(r,n)&&(e.push(n.i,t.i,r.i),jO(t),jO(t.next),t=i=r),t=t.next}while(t!==i);return YE(t)}function Ydt(i,e,t,n,r,s){let o=i;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&rpt(o,a)){let l=Pxe(o,a);o=YE(o,o.next),l=YE(l,l.next),HO(o,e,t,n,r,s,0),HO(l,e,t,n,r,s,0);return}a=a.next}o=o.next}while(o!==i)}function Qdt(i,e,t,n){const r=[];for(let s=0,o=e.length;s<o;s++){const a=e[s]*n,l=s<o-1?e[s+1]*n:i.length,c=Cxe(i,a,l,n,!1);c===c.next&&(c.steiner=!0),r.push(npt(c))}r.sort(Kdt);for(let s=0;s<r.length;s++)t=Jdt(r[s],t);return t}function Kdt(i,e){let t=i.x-e.x;if(t===0&&(t=i.y-e.y,t===0)){const n=(i.next.y-i.y)/(i.next.x-i.x),r=(e.next.y-e.y)/(e.next.x-e.x);t=n-r}return t}function Jdt(i,e){const t=Zdt(i,e);if(!t)return e;const n=Pxe(t,i);return YE(n,n.next),YE(t,t.next)}function Zdt(i,e){let t=e;const n=i.x,r=i.y;let s=-1/0,o;if(v2(i,t))return t;do{if(v2(i,t.next))return t.next;if(r<=t.y&&r>=t.next.y&&t.next.y!==t.y){const u=t.x+(r-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(u<=n&&u>s&&(s=u,o=t.x<t.next.x?t:t.next,u===n))return o}t=t.next}while(t!==e);if(!o)return null;const a=o,l=o.x,c=o.y;let h=1/0;t=o;do{if(n>=t.x&&t.x>=l&&n!==t.x&&Mxe(r<c?n:s,r,l,c,r<c?s:n,r,t.x,t.y)){const u=Math.abs(r-t.y)/(n-t.x);GO(t,i)&&(u<h||u===h&&(t.x>o.x||t.x===o.x&&ept(o,t)))&&(o=t,h=u)}t=t.next}while(t!==a);return o}function ept(i,e){return qa(i.prev,i,e.prev)<0&&qa(e.next,i,i.next)<0}function tpt(i,e,t,n){let r=i;do r.z===0&&(r.z=dte(r.x,r.y,e,t,n)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==i);r.prevZ.nextZ=null,r.prevZ=null,ipt(r)}function ipt(i){let e,t=1;do{let n=i,r;i=null;let s=null;for(e=0;n;){e++;let o=n,a=0;for(let c=0;c<t&&(a++,o=o.nextZ,!!o);c++);let l=t;for(;a>0||l>0&&o;)a!==0&&(l===0||!o||n.z<=o.z)?(r=n,n=n.nextZ,a--):(r=o,o=o.nextZ,l--),s?s.nextZ=r:i=r,r.prevZ=s,s=r;n=o}s.nextZ=null,t*=2}while(e>1);return i}function dte(i,e,t,n,r){return i=(i-t)*r|0,e=(e-n)*r|0,i=(i|i<<8)&16711935,i=(i|i<<4)&252645135,i=(i|i<<2)&858993459,i=(i|i<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,i|e<<1}function npt(i){let e=i,t=i;do(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next;while(e!==i);return t}function Mxe(i,e,t,n,r,s,o,a){return(r-o)*(e-a)>=(i-o)*(s-a)&&(i-o)*(n-a)>=(t-o)*(e-a)&&(t-o)*(s-a)>=(r-o)*(n-a)}function VO(i,e,t,n,r,s,o,a){return!(i===o&&e===a)&&Mxe(i,e,t,n,r,s,o,a)}function rpt(i,e){return i.next.i!==e.i&&i.prev.i!==e.i&&!spt(i,e)&&(GO(i,e)&&GO(e,i)&&opt(i,e)&&(qa(i.prev,i,e.prev)||qa(i,e.prev,e))||v2(i,e)&&qa(i.prev,i,i.next)>0&&qa(e.prev,e,e.next)>0)}function qa(i,e,t){return(e.y-i.y)*(t.x-e.x)-(e.x-i.x)*(t.y-e.y)}function v2(i,e){return i.x===e.x&&i.y===e.y}function Ixe(i,e,t,n){const r=g9(qa(i,e,t)),s=g9(qa(i,e,n)),o=g9(qa(t,n,i)),a=g9(qa(t,n,e));return!!(r!==s&&o!==a||r===0&&m9(i,t,e)||s===0&&m9(i,n,e)||o===0&&m9(t,i,n)||a===0&&m9(t,e,n))}function m9(i,e,t){return e.x<=Math.max(i.x,t.x)&&e.x>=Math.min(i.x,t.x)&&e.y<=Math.max(i.y,t.y)&&e.y>=Math.min(i.y,t.y)}function g9(i){return i>0?1:i<0?-1:0}function spt(i,e){let t=i;do{if(t.i!==i.i&&t.next.i!==i.i&&t.i!==e.i&&t.next.i!==e.i&&Ixe(t,t.next,i,e))return!0;t=t.next}while(t!==i);return!1}function GO(i,e){return qa(i.prev,i,i.next)<0?qa(i,e,i.next)>=0&&qa(i,i.prev,e)>=0:qa(i,e,i.prev)<0||qa(i,i.next,e)<0}function opt(i,e){let t=i,n=!1;const r=(i.x+e.x)/2,s=(i.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&r<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(n=!n),t=t.next;while(t!==i);return n}function Pxe(i,e){const t=pte(i.i,i.x,i.y),n=pte(e.i,e.x,e.y),r=i.next,s=e.prev;return i.next=e,e.prev=i,t.next=r,r.prev=t,n.next=t,t.prev=n,s.next=n,n.prev=s,n}function Dxe(i,e,t,n){const r=pte(i,e,t);return n?(r.next=n.next,r.prev=n,n.next.prev=r,n.next=r):(r.prev=r,r.next=r),r}function jO(i){i.next.prev=i.prev,i.prev.next=i.next,i.prevZ&&(i.prevZ.nextZ=i.nextZ),i.nextZ&&(i.nextZ.prevZ=i.prevZ)}function pte(i,e,t){return{i,x:e,y:t,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function apt(i,e,t,n){let r=0;for(let s=e,o=t-n;s<t;s+=n)r+=(i[o]-i[s])*(i[s+1]+i[o+1]),o=s;return r}class lpt{static triangulate(e,t,n=2){return Wdt(e,t,n)}}class Qg{static area(e){const t=e.length;let n=0;for(let r=t-1,s=0;s<t;r=s++)n+=e[r].x*e[s].y-e[s].x*e[r].y;return n*.5}static isClockWise(e){return Qg.area(e)<0}static triangulateShape(e,t){const n=[],r=[],s=[];Rxe(e),Lxe(n,e);let o=e.length;t.forEach(Rxe);for(let l=0;l<t.length;l++)r.push(o),o+=t[l].length,Lxe(n,t[l]);const a=lpt.triangulate(n,r);for(let l=0;l<a.length;l+=3)s.push(a.slice(l,l+3));return s}}function Rxe(i){const e=i.length;e>2&&i[e-1].equals(i[0])&&i.pop()}function Lxe(i,e){for(let t=0;t<e.length;t++)i.push(e[t].x),i.push(e[t].y)}class _9 extends yr{constructor(e=new XE([new pi(.5,.5),new pi(-.5,.5),new pi(-.5,-.5),new pi(.5,-.5)]),t={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];const n=this,r=[],s=[];for(let a=0,l=e.length;a<l;a++){const c=e[a];o(c)}this.setAttribute("position",new rn(r,3)),this.setAttribute("uv",new rn(s,2)),this.computeVertexNormals();function o(a){const l=[],c=t.curveSegments!==void 0?t.curveSegments:12,h=t.steps!==void 0?t.steps:1,u=t.depth!==void 0?t.depth:1;let d=t.bevelEnabled!==void 0?t.bevelEnabled:!0,p=t.bevelThickness!==void 0?t.bevelThickness:.2,f=t.bevelSize!==void 0?t.bevelSize:p-.1,g=t.bevelOffset!==void 0?t.bevelOffset:0,_=t.bevelSegments!==void 0?t.bevelSegments:3;const y=t.extrudePath,A=t.UVGenerator!==void 0?t.UVGenerator:cpt;let x,w=!1,E,S,I,C;if(y){x=y.getSpacedPoints(h),w=!0,d=!1;const X=y.isCatmullRomCurve3?y.closed:!1;E=y.computeFrenetFrames(h,X),S=new ht,I=new ht,C=new ht}d||(_=0,p=0,f=0,g=0);const T=a.extractPoints(c);let D=T.shape;const M=T.holes;if(!Qg.isClockWise(D)){D=D.reverse();for(let X=0,ce=M.length;X<ce;X++){const _e=M[X];Qg.isClockWise(_e)&&(M[X]=_e.reverse())}}function v(X){const _e=10000000000000001e-36;let le=X[0];for(let G=1;G<=X.length;G++){const xe=G%X.length,ze=X[xe],Ke=ze.x-le.x,we=ze.y-le.y,U=Ke*Ke+we*we,N=Math.max(Math.abs(ze.x),Math.abs(ze.y),Math.abs(le.x),Math.abs(le.y)),Y=_e*N*N;if(U<=Y){X.splice(xe,1),G--;continue}le=ze}}v(D),M.forEach(v);const P=M.length,O=D;for(let X=0;X<P;X++){const ce=M[X];D=D.concat(ce)}function B(X,ce,_e){return ce||xn("ExtrudeGeometry: vec does not exist"),X.clone().addScaledVector(ce,_e)}const k=D.length;function H(X,ce,_e){let le,G,xe;const ze=X.x-ce.x,Ke=X.y-ce.y,we=_e.x-X.x,U=_e.y-X.y,N=ze*ze+Ke*Ke,Y=ze*U-Ke*we;if(Math.abs(Y)>Number.EPSILON){const de=Math.sqrt(N),he=Math.sqrt(we*we+U*U),ae=ce.x-Ke/de,Ge=ce.y+ze/de,Oe=_e.x-U/he,tt=_e.y+we/he,De=((Oe-ae)*U-(tt-Ge)*we)/(ze*U-Ke*we);le=ae+ze*De-X.x,G=Ge+Ke*De-X.y;const Ae=le*le+G*G;if(Ae<=2)return new pi(le,G);xe=Math.sqrt(Ae/2)}else{let de=!1;ze>Number.EPSILON?we>Number.EPSILON&&(de=!0):ze<-Number.EPSILON?we<-Number.EPSILON&&(de=!0):Math.sign(Ke)===Math.sign(U)&&(de=!0),de?(le=-Ke,G=ze,xe=Math.sqrt(N)):(le=ze,G=Ke,xe=Math.sqrt(N/2))}return new pi(le/xe,G/xe)}const z=[];for(let X=0,ce=O.length,_e=ce-1,le=X+1;X<ce;X++,_e++,le++)_e===ce&&(_e=0),le===ce&&(le=0),z[X]=H(O[X],O[_e],O[le]);const j=[];let $,Q=z.concat();for(let X=0,ce=P;X<ce;X++){const _e=M[X];$=[];for(let le=0,G=_e.length,xe=G-1,ze=le+1;le<G;le++,xe++,ze++)xe===G&&(xe=0),ze===G&&(ze=0),$[le]=H(_e[le],_e[xe],_e[ze]);j.push($),Q=Q.concat($)}let se;if(_===0)se=Qg.triangulateShape(O,M);else{const X=[],ce=[];for(let _e=0;_e<_;_e++){const le=_e/_,G=p*Math.cos(le*Math.PI/2),xe=f*Math.sin(le*Math.PI/2)+g;for(let ze=0,Ke=O.length;ze<Ke;ze++){const we=B(O[ze],z[ze],xe);pe(we.x,we.y,-G),le===0&&X.push(we)}for(let ze=0,Ke=P;ze<Ke;ze++){const we=M[ze];$=j[ze];const U=[];for(let N=0,Y=we.length;N<Y;N++){const de=B(we[N],$[N],xe);pe(de.x,de.y,-G),le===0&&U.push(de)}le===0&&ce.push(U)}}se=Qg.triangulateShape(X,ce)}const te=se.length,ue=f+g;for(let X=0;X<k;X++){const ce=d?B(D[X],Q[X],ue):D[X];w?(I.copy(E.normals[0]).multiplyScalar(ce.x),S.copy(E.binormals[0]).multiplyScalar(ce.y),C.copy(x[0]).add(I).add(S),pe(C.x,C.y,C.z)):pe(ce.x,ce.y,0)}for(let X=1;X<=h;X++)for(let ce=0;ce<k;ce++){const _e=d?B(D[ce],Q[ce],ue):D[ce];w?(I.copy(E.normals[X]).multiplyScalar(_e.x),S.copy(E.binormals[X]).multiplyScalar(_e.y),C.copy(x[X]).add(I).add(S),pe(C.x,C.y,C.z)):pe(_e.x,_e.y,u/h*X)}for(let X=_-1;X>=0;X--){const ce=X/_,_e=p*Math.cos(ce*Math.PI/2),le=f*Math.sin(ce*Math.PI/2)+g;for(let G=0,xe=O.length;G<xe;G++){const ze=B(O[G],z[G],le);pe(ze.x,ze.y,u+_e)}for(let G=0,xe=M.length;G<xe;G++){const ze=M[G];$=j[G];for(let Ke=0,we=ze.length;Ke<we;Ke++){const U=B(ze[Ke],$[Ke],le);w?pe(U.x,U.y+x[h-1].y,x[h-1].x+_e):pe(U.x,U.y,u+_e)}}}V(),ee();function V(){const X=r.length/3;if(d){let ce=0,_e=k*ce;for(let le=0;le<te;le++){const G=se[le];ve(G[2]+_e,G[1]+_e,G[0]+_e)}ce=h+_*2,_e=k*ce;for(let le=0;le<te;le++){const G=se[le];ve(G[0]+_e,G[1]+_e,G[2]+_e)}}else{for(let ce=0;ce<te;ce++){const _e=se[ce];ve(_e[2],_e[1],_e[0])}for(let ce=0;ce<te;ce++){const _e=se[ce];ve(_e[0]+k*h,_e[1]+k*h,_e[2]+k*h)}}n.addGroup(X,r.length/3-X,0)}function ee(){const X=r.length/3;let ce=0;oe(O,ce),ce+=O.length;for(let _e=0,le=M.length;_e<le;_e++){const G=M[_e];oe(G,ce),ce+=G.length}n.addGroup(X,r.length/3-X,1)}function oe(X,ce){let _e=X.length;for(;--_e>=0;){const le=_e;let G=_e-1;G<0&&(G=X.length-1);for(let xe=0,ze=h+_*2;xe<ze;xe++){const Ke=k*xe,we=k*(xe+1),U=ce+le+Ke,N=ce+G+Ke,Y=ce+G+we,de=ce+le+we;ge(U,N,Y,de)}}}function pe(X,ce,_e){l.push(X),l.push(ce),l.push(_e)}function ve(X,ce,_e){je(X),je(ce),je(_e);const le=r.length/3,G=A.generateTopUV(n,r,le-3,le-2,le-1);fe(G[0]),fe(G[1]),fe(G[2])}function ge(X,ce,_e,le){je(X),je(ce),je(le),je(ce),je(_e),je(le);const G=r.length/3,xe=A.generateSideWallUV(n,r,G-6,G-3,G-2,G-1);fe(xe[0]),fe(xe[1]),fe(xe[3]),fe(xe[1]),fe(xe[2]),fe(xe[3])}function je(X){r.push(l[X*3+0]),r.push(l[X*3+1]),r.push(l[X*3+2])}function fe(X){s.push(X.x),s.push(X.y)}}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON(),t=this.parameters.shapes,n=this.parameters.options;return hpt(t,n,e)}static fromJSON(e,t){const n=[];for(let s=0,o=e.shapes.length;s<o;s++){const a=t[e.shapes[s]];n.push(a)}const r=e.options.extrudePath;return r!==void 0&&(e.options.extrudePath=new p9[r.type]().fromJSON(r)),new _9(n,e.options)}}const cpt={generateTopUV:function(i,e,t,n,r){const s=e[t*3],o=e[t*3+1],a=e[n*3],l=e[n*3+1],c=e[r*3],h=e[r*3+1];return[new pi(s,o),new pi(a,l),new pi(c,h)]},generateSideWallUV:function(i,e,t,n,r,s){const o=e[t*3],a=e[t*3+1],l=e[t*3+2],c=e[n*3],h=e[n*3+1],u=e[n*3+2],d=e[r*3],p=e[r*3+1],f=e[r*3+2],g=e[s*3],_=e[s*3+1],y=e[s*3+2];return Math.abs(a-h)<Math.abs(o-c)?[new pi(o,1-l),new pi(c,1-u),new pi(d,1-f),new pi(g,1-y)]:[new pi(a,1-l),new pi(h,1-u),new pi(p,1-f),new pi(_,1-y)]}};function hpt(i,e,t){if(t.shapes=[],Array.isArray(i))for(let n=0,r=i.length;n<r;n++){const s=i[n];t.shapes.push(s.uuid)}else t.shapes.push(i.uuid);return t.options=Object.assign({},e),e.extrudePath!==void 0&&(t.options.extrudePath=e.extrudePath.toJSON()),t}class y9 extends ux{constructor(e=1,t=0){const n=(1+Math.sqrt(5))/2,r=[-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,0,1],s=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1];super(r,s,e,t),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new y9(e.radius,e.detail)}}class v9 extends yr{constructor(e=[new pi(0,-.5),new pi(.5,0),new pi(0,.5)],t=12,n=0,r=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:r},t=Math.floor(t),r=Xn(r,0,Math.PI*2);const s=[],o=[],a=[],l=[],c=[],h=1/t,u=new ht,d=new pi,p=new ht,f=new ht,g=new ht;let _=0,y=0;for(let A=0;A<=e.length-1;A++)switch(A){case 0:_=e[A+1].x-e[A].x,y=e[A+1].y-e[A].y,p.x=y*1,p.y=-_,p.z=y*0,g.copy(p),p.normalize(),l.push(p.x,p.y,p.z);break;case e.length-1:l.push(g.x,g.y,g.z);break;default:_=e[A+1].x-e[A].x,y=e[A+1].y-e[A].y,p.x=y*1,p.y=-_,p.z=y*0,f.copy(p),p.x+=g.x,p.y+=g.y,p.z+=g.z,p.normalize(),l.push(p.x,p.y,p.z),g.copy(f)}for(let A=0;A<=t;A++){const x=n+A*h*r,w=Math.sin(x),E=Math.cos(x);for(let S=0;S<=e.length-1;S++){u.x=e[S].x*w,u.y=e[S].y,u.z=e[S].x*E,o.push(u.x,u.y,u.z),d.x=A/t,d.y=S/(e.length-1),a.push(d.x,d.y);const I=l[3*S+0]*w,C=l[3*S+1],T=l[3*S+0]*E;c.push(I,C,T)}}for(let A=0;A<t;A++)for(let x=0;x<e.length-1;x++){const w=x+A*e.length,E=w,S=w+e.length,I=w+e.length+1,C=w+1;s.push(E,S,C),s.push(I,C,S)}this.setIndex(s),this.setAttribute("position",new rn(o,3)),this.setAttribute("uv",new rn(a,2)),this.setAttribute("normal",new rn(c,3))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new v9(e.points,e.segments,e.phiStart,e.phiLength)}}class WO extends ux{constructor(e=1,t=0){const n=[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],r=[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2];super(n,r,e,t),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new WO(e.radius,e.detail)}}class b2 extends yr{constructor(e=1,t=1,n=1,r=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:r};const s=e/2,o=t/2,a=Math.floor(n),l=Math.floor(r),c=a+1,h=l+1,u=e/a,d=t/l,p=[],f=[],g=[],_=[];for(let y=0;y<h;y++){const A=y*d-o;for(let x=0;x<c;x++){const w=x*u-s;f.push(w,-A,0),g.push(0,0,1),_.push(x/a),_.push(1-y/l)}}for(let y=0;y<l;y++)for(let A=0;A<a;A++){const x=A+c*y,w=A+c*(y+1),E=A+1+c*(y+1),S=A+1+c*y;p.push(x,w,S),p.push(w,E,S)}this.setIndex(p),this.setAttribute("position",new rn(f,3)),this.setAttribute("normal",new rn(g,3)),this.setAttribute("uv",new rn(_,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new b2(e.width,e.height,e.widthSegments,e.heightSegments)}}class b9 extends yr{constructor(e=.5,t=1,n=32,r=1,s=0,o=Math.PI*2){super(),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:r,thetaStart:s,thetaLength:o},n=Math.max(3,n),r=Math.max(1,r);const a=[],l=[],c=[],h=[];let u=e;const d=(t-e)/r,p=new ht,f=new pi;for(let g=0;g<=r;g++){for(let _=0;_<=n;_++){const y=s+_/n*o;p.x=u*Math.cos(y),p.y=u*Math.sin(y),l.push(p.x,p.y,p.z),c.push(0,0,1),f.x=(p.x/t+1)/2,f.y=(p.y/t+1)/2,h.push(f.x,f.y)}u+=d}for(let g=0;g<r;g++){const _=g*(n+1);for(let y=0;y<n;y++){const A=y+_,x=A,w=A+n+1,E=A+n+2,S=A+1;a.push(x,w,S),a.push(w,E,S)}}this.setIndex(a),this.setAttribute("position",new rn(l,3)),this.setAttribute("normal",new rn(c,3)),this.setAttribute("uv",new rn(h,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new b9(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)}}class A9 extends yr{constructor(e=new XE([new pi(0,.5),new pi(-.5,-.5),new pi(.5,-.5)]),t=12){super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:t};const n=[],r=[],s=[],o=[];let a=0,l=0;if(Array.isArray(e)===!1)c(e);else for(let h=0;h<e.length;h++)c(e[h]),this.addGroup(a,l,h),a+=l,l=0;this.setIndex(n),this.setAttribute("position",new rn(r,3)),this.setAttribute("normal",new rn(s,3)),this.setAttribute("uv",new rn(o,2));function c(h){const u=r.length/3,d=h.extractPoints(t);let p=d.shape;const f=d.holes;Qg.isClockWise(p)===!1&&(p=p.reverse());for(let _=0,y=f.length;_<y;_++){const A=f[_];Qg.isClockWise(A)===!0&&(f[_]=A.reverse())}const g=Qg.triangulateShape(p,f);for(let _=0,y=f.length;_<y;_++){const A=f[_];p=p.concat(A)}for(let _=0,y=p.length;_<y;_++){const A=p[_];r.push(A.x,A.y,0),s.push(0,0,1),o.push(A.x,A.y)}for(let _=0,y=g.length;_<y;_++){const A=g[_],x=A[0]+u,w=A[1]+u,E=A[2]+u;n.push(x,w,E),l+=3}}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON(),t=this.parameters.shapes;return upt(t,e)}static fromJSON(e,t){const n=[];for(let r=0,s=e.shapes.length;r<s;r++){const o=t[e.shapes[r]];n.push(o)}return new A9(n,e.curveSegments)}}function upt(i,e){if(e.shapes=[],Array.isArray(i))for(let t=0,n=i.length;t<n;t++){const r=i[t];e.shapes.push(r.uuid)}else e.shapes.push(i.uuid);return e}class $O extends yr{constructor(e=1,t=32,n=16,r=0,s=Math.PI*2,o=0,a=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:r,phiLength:s,thetaStart:o,thetaLength:a},t=Math.max(3,Math.floor(t)),n=Math.max(2,Math.floor(n));const l=Math.min(o+a,Math.PI);let c=0;const h=[],u=new ht,d=new ht,p=[],f=[],g=[],_=[];for(let y=0;y<=n;y++){const A=[],x=y/n;let w=0;y===0&&o===0?w=.5/t:y===n&&l===Math.PI&&(w=-.5/t);for(let E=0;E<=t;E++){const S=E/t;u.x=-e*Math.cos(r+S*s)*Math.sin(o+x*a),u.y=e*Math.cos(o+x*a),u.z=e*Math.sin(r+S*s)*Math.sin(o+x*a),f.push(u.x,u.y,u.z),d.copy(u).normalize(),g.push(d.x,d.y,d.z),_.push(S+w,1-x),A.push(c++)}h.push(A)}for(let y=0;y<n;y++)for(let A=0;A<t;A++){const x=h[y][A+1],w=h[y][A],E=h[y+1][A],S=h[y+1][A+1];(y!==0||o>0)&&p.push(x,w,S),(y!==n-1||l<Math.PI)&&p.push(w,E,S)}this.setIndex(p),this.setAttribute("position",new rn(f,3)),this.setAttribute("normal",new rn(g,3)),this.setAttribute("uv",new rn(_,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new $O(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class x9 extends ux{constructor(e=1,t=0){const n=[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],r=[2,1,0,0,3,2,1,3,0,2,3,1];super(n,r,e,t),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new x9(e.radius,e.detail)}}class w9 extends yr{constructor(e=1,t=.4,n=12,r=48,s=Math.PI*2,o=0,a=Math.PI*2){super(),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:r,arc:s,thetaStart:o,thetaLength:a},n=Math.floor(n),r=Math.floor(r);const l=[],c=[],h=[],u=[],d=new ht,p=new ht,f=new ht;for(let g=0;g<=n;g++){const _=o+g/n*a;for(let y=0;y<=r;y++){const A=y/r*s;p.x=(e+t*Math.cos(_))*Math.cos(A),p.y=(e+t*Math.cos(_))*Math.sin(A),p.z=t*Math.sin(_),c.push(p.x,p.y,p.z),d.x=e*Math.cos(A),d.y=e*Math.sin(A),f.subVectors(p,d).normalize(),h.push(f.x,f.y,f.z),u.push(y/r),u.push(g/n)}}for(let g=1;g<=n;g++)for(let _=1;_<=r;_++){const y=(r+1)*g+_-1,A=(r+1)*(g-1)+_-1,x=(r+1)*(g-1)+_,w=(r+1)*g+_;l.push(y,A,w),l.push(A,x,w)}this.setIndex(l),this.setAttribute("position",new rn(c,3)),this.setAttribute("normal",new rn(h,3)),this.setAttribute("uv",new rn(u,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new w9(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}class E9 extends yr{constructor(e=1,t=.4,n=64,r=8,s=2,o=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:r,p:s,q:o},n=Math.floor(n),r=Math.floor(r);const a=[],l=[],c=[],h=[],u=new ht,d=new ht,p=new ht,f=new ht,g=new ht,_=new ht,y=new ht;for(let x=0;x<=n;++x){const w=x/n*s*Math.PI*2;A(w,s,o,e,p),A(w+.01,s,o,e,f),_.subVectors(f,p),y.addVectors(f,p),g.crossVectors(_,y),y.crossVectors(g,_),g.normalize(),y.normalize();for(let E=0;E<=r;++E){const S=E/r*Math.PI*2,I=-t*Math.cos(S),C=t*Math.sin(S);u.x=p.x+(I*y.x+C*g.x),u.y=p.y+(I*y.y+C*g.y),u.z=p.z+(I*y.z+C*g.z),l.push(u.x,u.y,u.z),d.subVectors(u,p).normalize(),c.push(d.x,d.y,d.z),h.push(x/n),h.push(E/r)}}for(let x=1;x<=n;x++)for(let w=1;w<=r;w++){const E=(r+1)*(x-1)+(w-1),S=(r+1)*x+(w-1),I=(r+1)*x+w,C=(r+1)*(x-1)+w;a.push(E,S,C),a.push(S,I,C)}this.setIndex(a),this.setAttribute("position",new rn(l,3)),this.setAttribute("normal",new rn(c,3)),this.setAttribute("uv",new rn(h,2));function A(x,w,E,S,I){const C=Math.cos(x),T=Math.sin(x),D=E/w*x,M=Math.cos(D);I.x=S*(2+M)*.5*C,I.y=S*(2+M)*T*.5,I.z=S*Math.sin(D)*.5}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new E9(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}}class S9 extends yr{constructor(e=new hte(new ht(-1,-1,0),new ht(-1,1,0),new ht(1,1,0)),t=64,n=1,r=8,s=!1){super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:r,closed:s};const o=e.computeFrenetFrames(t,s);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals;const a=new ht,l=new ht,c=new pi;let h=new ht;const u=[],d=[],p=[],f=[];g(),this.setIndex(f),this.setAttribute("position",new rn(u,3)),this.setAttribute("normal",new rn(d,3)),this.setAttribute("uv",new rn(p,2));function g(){for(let x=0;x<t;x++)_(x);_(s===!1?t:0),A(),y()}function _(x){h=e.getPointAt(x/t,h);const w=o.normals[x],E=o.binormals[x];for(let S=0;S<=r;S++){const I=S/r*Math.PI*2,C=Math.sin(I),T=-Math.cos(I);l.x=T*w.x+C*E.x,l.y=T*w.y+C*E.y,l.z=T*w.z+C*E.z,l.normalize(),d.push(l.x,l.y,l.z),a.x=h.x+n*l.x,a.y=h.y+n*l.y,a.z=h.z+n*l.z,u.push(a.x,a.y,a.z)}}function y(){for(let x=1;x<=t;x++)for(let w=1;w<=r;w++){const E=(r+1)*(x-1)+(w-1),S=(r+1)*x+(w-1),I=(r+1)*x+w,C=(r+1)*(x-1)+w;f.push(E,S,C),f.push(S,I,C)}}function A(){for(let x=0;x<=t;x++)for(let w=0;w<=r;w++)c.x=x/t,c.y=w/r,p.push(c.x,c.y)}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON();return e.path=this.parameters.path.toJSON(),e}static fromJSON(e){return new S9(new p9[e.path.type]().fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class Oxe extends yr{constructor(e=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:e},e!==null){const t=[],n=new Set,r=new ht,s=new ht;if(e.index!==null){const o=e.attributes.position,a=e.index;let l=e.groups;l.length===0&&(l=[{start:0,count:a.count,materialIndex:0}]);for(let c=0,h=l.length;c<h;++c){const u=l[c],d=u.start,p=u.count;for(let f=d,g=d+p;f<g;f+=3)for(let _=0;_<3;_++){const y=a.getX(f+_),A=a.getX(f+(_+1)%3);r.fromBufferAttribute(o,y),s.fromBufferAttribute(o,A),Nxe(r,s,n)===!0&&(t.push(r.x,r.y,r.z),t.push(s.x,s.y,s.z))}}}else{const o=e.attributes.position;for(let a=0,l=o.count/3;a<l;a++)for(let c=0;c<3;c++){const h=3*a+c,u=3*a+(c+1)%3;r.fromBufferAttribute(o,h),s.fromBufferAttribute(o,u),Nxe(r,s,n)===!0&&(t.push(r.x,r.y,r.z),t.push(s.x,s.y,s.z))}}this.setAttribute("position",new rn(t,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}function Nxe(i,e,t){const n=`${i.x},${i.y},${i.z}-${e.x},${e.y},${e.z}`,r=`${e.x},${e.y},${e.z}-${i.x},${i.y},${i.z}`;return t.has(n)===!0||t.has(r)===!0?!1:(t.add(n),t.add(r),!0)}var Bxe=Object.freeze({__proto__:null,BoxGeometry:qE,CapsuleGeometry:s9,CircleGeometry:o9,ConeGeometry:kO,CylinderGeometry:FO,DodecahedronGeometry:a9,EdgesGeometry:bxe,ExtrudeGeometry:_9,IcosahedronGeometry:y9,LatheGeometry:v9,OctahedronGeometry:WO,PlaneGeometry:b2,PolyhedronGeometry:ux,RingGeometry:b9,ShapeGeometry:A9,SphereGeometry:$O,TetrahedronGeometry:x9,TorusGeometry:w9,TorusKnotGeometry:E9,TubeGeometry:S9,WireframeGeometry:Oxe});class Fxe extends bu{constructor(e){super(),this.isShadowMaterial=!0,this.type="ShadowMaterial",this.color=new Qi(0),this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.fog=e.fog,this}}function A2(i){const e={};for(const t in i){e[t]={};for(const n in i[t]){const r=i[t][n];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?r.isRenderTargetTexture?(Oi("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][n]=null):e[t][n]=r.clone():Array.isArray(r)?e[t][n]=r.slice():e[t][n]=r}}return e}function gd(i){const e={};for(let t=0;t<i.length;t++){const n=A2(i[t]);for(const r in n)e[r]=n[r]}return e}function dpt(i){const e=[];for(let t=0;t<i.length;t++)e.push(i[t].clone());return e}function kxe(i){const e=i.getRenderTarget();return e===null?i.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:_s.workingColorSpace}const Uxe={clone:A2,merge:gd};var ppt=`void main() {
|
|
4371
4371
|
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
4372
4372
|
}`,fpt=`void main() {
|