@mappedin/mappedin-js 6.0.1-alpha.37 → 6.0.1-alpha.38
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/lib/esm/{GLTFExporter-NKQIJINX.js → GLTFExporter-YN2TI56M.js} +1 -1
- package/lib/esm/{GLTFLoader-GDJUALCQ.js → GLTFLoader-Y4C6DPID.js} +1 -1
- package/lib/esm/{browser-2CZ5S7PQ.js → browser-XN3UTUP4.js} +1 -1
- package/lib/esm/{chunk-K4GII35P.js → chunk-OGCEJHI4.js} +1 -1
- package/lib/esm/chunk-OIEP2Y7R.js +950 -0
- package/lib/esm/{chunk-3JQFKFB7.js → chunk-TBN4Y7GI.js} +1 -1
- package/lib/esm/{chunk-BDZ2PK2A.js → chunk-TI4WUUIG.js} +1 -1
- package/lib/esm/{chunk-H43ODW5U.js → chunk-TWVA43IF.js} +1 -1
- package/lib/esm/index.d.ts +2959 -2812
- package/lib/esm/index.js +1 -1
- package/lib/esm/inspector-CNSU6RQU.js +425 -0
- package/lib/esm/{outdoor-context-v4-4QE2XOX2.js → outdoor-context-v4-RXLG6HMM.js} +1 -1
- package/package.json +2 -2
- package/lib/esm/chunk-TUEE7MUR.js +0 -950
- package/lib/esm/inspector-QGUFLX5C.js +0 -425
|
@@ -1,425 +0,0 @@
|
|
|
1
|
-
import{c as W,n as R}from"./chunk-TUEE7MUR.js";import"./chunk-H43ODW5U.js";import"./chunk-K4GII35P.js";import{J as X}from"./chunk-BDZ2PK2A.js";import{a as o,j as y}from"./chunk-3JQFKFB7.js";y();y();y();y();var E=class E{constructor(t,e,i,r,s="div"){this.parent=t,this.object=e,this.property=i,this._disabled=!1,this._hidden=!1,this.initialValue=this.getValue(),this.domElement=document.createElement(s),this.domElement.classList.add("controller"),this.domElement.classList.add(r),this.$name=document.createElement("div"),this.$name.classList.add("name"),E.nextNameID=E.nextNameID||0,this.$name.id=`lil-gui-name-${++E.nextNameID}`,this.$widget=document.createElement("div"),this.$widget.classList.add("widget"),this.$disable=this.$widget,this.domElement.appendChild(this.$name),this.domElement.appendChild(this.$widget),this.domElement.addEventListener("keydown",a=>a.stopPropagation()),this.domElement.addEventListener("keyup",a=>a.stopPropagation()),this.parent.children.push(this),this.parent.controllers.push(this),this.parent.$children.appendChild(this.domElement),this._listenCallback=this._listenCallback.bind(this),this.name(i)}name(t){return this._name=t,this.$name.textContent=t,this}onChange(t){return this._onChange=t,this}_callOnChange(){this.parent._callOnChange(this),this._onChange!==void 0&&this._onChange.call(this,this.getValue()),this._changed=!0}onFinishChange(t){return this._onFinishChange=t,this}_callOnFinishChange(){this._changed&&(this.parent._callOnFinishChange(this),this._onFinishChange!==void 0&&this._onFinishChange.call(this,this.getValue())),this._changed=!1}reset(){return this.setValue(this.initialValue),this._callOnFinishChange(),this}enable(t=!0){return this.disable(!t)}disable(t=!0){return t===this._disabled?this:(this._disabled=t,this.domElement.classList.toggle("disabled",t),this.$disable.toggleAttribute("disabled",t),this)}show(t=!0){return this._hidden=!t,this.domElement.style.display=this._hidden?"none":"",this}hide(){return this.show(!1)}options(t){let e=this.parent.add(this.object,this.property,t);return e.name(this._name),this.destroy(),e}min(t){return this}max(t){return this}step(t){return this}decimals(t){return this}listen(t=!0){return this._listening=t,this._listenCallbackID!==void 0&&(cancelAnimationFrame(this._listenCallbackID),this._listenCallbackID=void 0),this._listening&&this._listenCallback(),this}_listenCallback(){this._listenCallbackID=requestAnimationFrame(this._listenCallback);let t=this.save();t!==this._listenPrevValue&&this.updateDisplay(),this._listenPrevValue=t}getValue(){return this.object[this.property]}setValue(t){return this.getValue()!==t&&(this.object[this.property]=t,this._callOnChange(),this.updateDisplay()),this}updateDisplay(){return this}load(t){return this.setValue(t),this._callOnFinishChange(),this}save(){return this.getValue()}destroy(){this.listen(!1),this.parent.children.splice(this.parent.children.indexOf(this),1),this.parent.controllers.splice(this.parent.controllers.indexOf(this),1),this.parent.$children.removeChild(this.domElement)}};o(E,"Controller");var _=E,G=class G extends _{constructor(t,e,i){super(t,e,i,"boolean","label"),this.$input=document.createElement("input"),this.$input.setAttribute("type","checkbox"),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$widget.appendChild(this.$input),this.$input.addEventListener("change",()=>{this.setValue(this.$input.checked),this._callOnFinishChange()}),this.$disable=this.$input,this.updateDisplay()}updateDisplay(){return this.$input.checked=this.getValue(),this}};o(G,"BooleanController");var M=G;function I(n){let t,e;return(t=n.match(/(#|0x)?([a-f0-9]{6})/i))?e=t[2]:(t=n.match(/rgb\(\s*(\d*)\s*,\s*(\d*)\s*,\s*(\d*)\s*\)/))?e=parseInt(t[1]).toString(16).padStart(2,0)+parseInt(t[2]).toString(16).padStart(2,0)+parseInt(t[3]).toString(16).padStart(2,0):(t=n.match(/^#?([a-f0-9])([a-f0-9])([a-f0-9])$/i))&&(e=t[1]+t[1]+t[2]+t[2]+t[3]+t[3]),e?"#"+e:!1}o(I,"normalizeColorString");var ht={isPrimitive:!0,match:n=>typeof n=="string",fromHexString:I,toHexString:I},k={isPrimitive:!0,match:n=>typeof n=="number",fromHexString:n=>parseInt(n.substring(1),16),toHexString:n=>"#"+n.toString(16).padStart(6,0)},ct={isPrimitive:!1,match:n=>Array.isArray(n),fromHexString(n,t,e=1){let i=k.fromHexString(n);t[0]=(i>>16&255)/255*e,t[1]=(i>>8&255)/255*e,t[2]=(i&255)/255*e},toHexString([n,t,e],i=1){i=255/i;let r=n*i<<16^t*i<<8^e*i<<0;return k.toHexString(r)}},ut={isPrimitive:!1,match:n=>Object(n)===n,fromHexString(n,t,e=1){let i=k.fromHexString(n);t.r=(i>>16&255)/255*e,t.g=(i>>8&255)/255*e,t.b=(i&255)/255*e},toHexString({r:n,g:t,b:e},i=1){i=255/i;let r=n*i<<16^t*i<<8^e*i<<0;return k.toHexString(r)}},pt=[ht,k,ct,ut];function gt(n){return pt.find(t=>t.match(n))}o(gt,"getColorFormat");var H=class H extends _{constructor(t,e,i,r){super(t,e,i,"color"),this.$input=document.createElement("input"),this.$input.setAttribute("type","color"),this.$input.setAttribute("tabindex",-1),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$text=document.createElement("input"),this.$text.setAttribute("type","text"),this.$text.setAttribute("spellcheck","false"),this.$text.setAttribute("aria-labelledby",this.$name.id),this.$display=document.createElement("div"),this.$display.classList.add("display"),this.$display.appendChild(this.$input),this.$widget.appendChild(this.$display),this.$widget.appendChild(this.$text),this._format=gt(this.initialValue),this._rgbScale=r,this._initialValueHexString=this.save(),this._textFocused=!1,this.$input.addEventListener("input",()=>{this._setValueFromHexString(this.$input.value)}),this.$input.addEventListener("blur",()=>{this._callOnFinishChange()}),this.$text.addEventListener("input",()=>{let s=I(this.$text.value);s&&this._setValueFromHexString(s)}),this.$text.addEventListener("focus",()=>{this._textFocused=!0,this.$text.select()}),this.$text.addEventListener("blur",()=>{this._textFocused=!1,this.updateDisplay(),this._callOnFinishChange()}),this.$disable=this.$text,this.updateDisplay()}reset(){return this._setValueFromHexString(this._initialValueHexString),this}_setValueFromHexString(t){if(this._format.isPrimitive){let e=this._format.fromHexString(t);this.setValue(e)}else this._format.fromHexString(t,this.getValue(),this._rgbScale),this._callOnChange(),this.updateDisplay()}save(){return this._format.toHexString(this.getValue(),this._rgbScale)}load(t){return this._setValueFromHexString(t),this._callOnFinishChange(),this}updateDisplay(){return this.$input.value=this._format.toHexString(this.getValue(),this._rgbScale),this._textFocused||(this.$text.value=this.$input.value.substring(1)),this.$display.style.backgroundColor=this.$input.value,this}};o(H,"ColorController");var F=H,V=class V extends _{constructor(t,e,i){super(t,e,i,"function"),this.$button=document.createElement("button"),this.$button.appendChild(this.$name),this.$widget.appendChild(this.$button),this.$button.addEventListener("click",r=>{r.preventDefault(),this.getValue().call(this.object),this._callOnChange()}),this.$button.addEventListener("touchstart",()=>{},{passive:!0}),this.$disable=this.$button}};o(V,"FunctionController");var $=V,T=class T extends _{constructor(t,e,i,r,s,a){super(t,e,i,"number"),this._initInput(),this.min(r),this.max(s);let u=a!==void 0;this.step(u?a:this._getImplicitStep(),u),this.updateDisplay()}decimals(t){return this._decimals=t,this.updateDisplay(),this}min(t){return this._min=t,this._onUpdateMinMax(),this}max(t){return this._max=t,this._onUpdateMinMax(),this}step(t,e=!0){return this._step=t,this._stepExplicit=e,this}updateDisplay(){let t=this.getValue();if(this._hasSlider){let e=(t-this._min)/(this._max-this._min);e=Math.max(0,Math.min(e,1)),this.$fill.style.width=e*100+"%"}return this._inputFocused||(this.$input.value=this._decimals===void 0?t:t.toFixed(this._decimals)),this}_initInput(){this.$input=document.createElement("input"),this.$input.setAttribute("type","text"),this.$input.setAttribute("aria-labelledby",this.$name.id),window.matchMedia("(pointer: coarse)").matches&&(this.$input.setAttribute("type","number"),this.$input.setAttribute("step","any")),this.$widget.appendChild(this.$input),this.$disable=this.$input;let e=o(()=>{let p=parseFloat(this.$input.value);isNaN(p)||(this._stepExplicit&&(p=this._snap(p)),this.setValue(this._clamp(p)))},"onInput"),i=o(p=>{let C=parseFloat(this.$input.value);isNaN(C)||(this._snapClampSetValue(C+p),this.$input.value=this.getValue())},"increment"),r=o(p=>{p.key==="Enter"&&this.$input.blur(),p.code==="ArrowUp"&&(p.preventDefault(),i(this._step*this._arrowKeyMultiplier(p))),p.code==="ArrowDown"&&(p.preventDefault(),i(this._step*this._arrowKeyMultiplier(p)*-1))},"onKeyDown"),s=o(p=>{this._inputFocused&&(p.preventDefault(),i(this._step*this._normalizeMouseWheel(p)))},"onWheel"),a=!1,u,g,b,f,c,d=5,l=o(p=>{u=p.clientX,g=b=p.clientY,a=!0,f=this.getValue(),c=0,window.addEventListener("mousemove",h),window.addEventListener("mouseup",v)},"onMouseDown"),h=o(p=>{if(a){let C=p.clientX-u,L=p.clientY-g;Math.abs(L)>d?(p.preventDefault(),this.$input.blur(),a=!1,this._setDraggingStyle(!0,"vertical")):Math.abs(C)>d&&v()}if(!a){let C=p.clientY-b;c-=C*this._step*this._arrowKeyMultiplier(p),f+c>this._max?c=this._max-f:f+c<this._min&&(c=this._min-f),this._snapClampSetValue(f+c)}b=p.clientY},"onMouseMove"),v=o(()=>{this._setDraggingStyle(!1,"vertical"),this._callOnFinishChange(),window.removeEventListener("mousemove",h),window.removeEventListener("mouseup",v)},"onMouseUp"),A=o(()=>{this._inputFocused=!0},"onFocus"),m=o(()=>{this._inputFocused=!1,this.updateDisplay(),this._callOnFinishChange()},"onBlur");this.$input.addEventListener("input",e),this.$input.addEventListener("keydown",r),this.$input.addEventListener("wheel",s,{passive:!1}),this.$input.addEventListener("mousedown",l),this.$input.addEventListener("focus",A),this.$input.addEventListener("blur",m)}_initSlider(){this._hasSlider=!0,this.$slider=document.createElement("div"),this.$slider.classList.add("slider"),this.$fill=document.createElement("div"),this.$fill.classList.add("fill"),this.$slider.appendChild(this.$fill),this.$widget.insertBefore(this.$slider,this.$input),this.domElement.classList.add("hasSlider");let t=o((m,p,C,L,dt)=>(m-p)/(C-p)*(dt-L)+L,"map"),e=o(m=>{let p=this.$slider.getBoundingClientRect(),C=t(m,p.left,p.right,this._min,this._max);this._snapClampSetValue(C)},"setValueFromX"),i=o(m=>{this._setDraggingStyle(!0),e(m.clientX),window.addEventListener("mousemove",r),window.addEventListener("mouseup",s)},"mouseDown"),r=o(m=>{e(m.clientX)},"mouseMove"),s=o(()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("mousemove",r),window.removeEventListener("mouseup",s)},"mouseUp"),a=!1,u,g,b=o(m=>{m.preventDefault(),this._setDraggingStyle(!0),e(m.touches[0].clientX),a=!1},"beginTouchDrag"),f=o(m=>{m.touches.length>1||(this._hasScrollBar?(u=m.touches[0].clientX,g=m.touches[0].clientY,a=!0):b(m),window.addEventListener("touchmove",c,{passive:!1}),window.addEventListener("touchend",d))},"onTouchStart"),c=o(m=>{if(a){let p=m.touches[0].clientX-u,C=m.touches[0].clientY-g;Math.abs(p)>Math.abs(C)?b(m):(window.removeEventListener("touchmove",c),window.removeEventListener("touchend",d))}else m.preventDefault(),e(m.touches[0].clientX)},"onTouchMove"),d=o(()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("touchmove",c),window.removeEventListener("touchend",d)},"onTouchEnd"),l=this._callOnFinishChange.bind(this),h=400,v,A=o(m=>{if(Math.abs(m.deltaX)<Math.abs(m.deltaY)&&this._hasScrollBar)return;m.preventDefault();let C=this._normalizeMouseWheel(m)*this._step;this._snapClampSetValue(this.getValue()+C),this.$input.value=this.getValue(),clearTimeout(v),v=setTimeout(l,h)},"onWheel");this.$slider.addEventListener("mousedown",i),this.$slider.addEventListener("touchstart",f,{passive:!1}),this.$slider.addEventListener("wheel",A,{passive:!1})}_setDraggingStyle(t,e="horizontal"){this.$slider&&this.$slider.classList.toggle("active",t),document.body.classList.toggle("lil-gui-dragging",t),document.body.classList.toggle(`lil-gui-${e}`,t)}_getImplicitStep(){return this._hasMin&&this._hasMax?(this._max-this._min)/1e3:.1}_onUpdateMinMax(){!this._hasSlider&&this._hasMin&&this._hasMax&&(this._stepExplicit||this.step(this._getImplicitStep(),!1),this._initSlider(),this.updateDisplay())}_normalizeMouseWheel(t){let{deltaX:e,deltaY:i}=t;return Math.floor(t.deltaY)!==t.deltaY&&t.wheelDelta&&(e=0,i=-t.wheelDelta/120,i*=this._stepExplicit?1:10),e+-i}_arrowKeyMultiplier(t){let e=this._stepExplicit?1:10;return t.shiftKey?e*=10:t.altKey&&(e/=10),e}_snap(t){let e=Math.round(t/this._step)*this._step;return parseFloat(e.toPrecision(15))}_clamp(t){return t<this._min&&(t=this._min),t>this._max&&(t=this._max),t}_snapClampSetValue(t){this.setValue(this._clamp(this._snap(t)))}get _hasScrollBar(){let t=this.parent.root.$children;return t.scrollHeight>t.clientHeight}get _hasMin(){return this._min!==void 0}get _hasMax(){return this._max!==void 0}};o(T,"NumberController");var D=T,U=class U extends _{constructor(t,e,i,r){super(t,e,i,"option"),this.$select=document.createElement("select"),this.$select.setAttribute("aria-labelledby",this.$name.id),this.$display=document.createElement("div"),this.$display.classList.add("display"),this.$select.addEventListener("change",()=>{this.setValue(this._values[this.$select.selectedIndex]),this._callOnFinishChange()}),this.$select.addEventListener("focus",()=>{this.$display.classList.add("focus")}),this.$select.addEventListener("blur",()=>{this.$display.classList.remove("focus")}),this.$widget.appendChild(this.$select),this.$widget.appendChild(this.$display),this.$disable=this.$select,this.options(r)}options(t){return this._values=Array.isArray(t)?t:Object.values(t),this._names=Array.isArray(t)?t:Object.keys(t),this.$select.replaceChildren(),this._names.forEach(e=>{let i=document.createElement("option");i.textContent=e,this.$select.appendChild(i)}),this.updateDisplay(),this}updateDisplay(){let t=this.getValue(),e=this._values.indexOf(t);return this.$select.selectedIndex=e,this.$display.textContent=e===-1?t:this._names[e],this}};o(U,"OptionController");var O=U,P=class P extends _{constructor(t,e,i){super(t,e,i,"string"),this.$input=document.createElement("input"),this.$input.setAttribute("type","text"),this.$input.setAttribute("spellcheck","false"),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$input.addEventListener("input",()=>{this.setValue(this.$input.value)}),this.$input.addEventListener("keydown",r=>{r.code==="Enter"&&this.$input.blur()}),this.$input.addEventListener("blur",()=>{this._callOnFinishChange()}),this.$widget.appendChild(this.$input),this.$disable=this.$input,this.updateDisplay()}updateDisplay(){return this.$input.value=this.getValue(),this}};o(P,"StringController");var z=P,mt=`.lil-gui {
|
|
2
|
-
font-family: var(--font-family);
|
|
3
|
-
font-size: var(--font-size);
|
|
4
|
-
line-height: 1;
|
|
5
|
-
font-weight: normal;
|
|
6
|
-
font-style: normal;
|
|
7
|
-
text-align: left;
|
|
8
|
-
color: var(--text-color);
|
|
9
|
-
user-select: none;
|
|
10
|
-
-webkit-user-select: none;
|
|
11
|
-
touch-action: manipulation;
|
|
12
|
-
--background-color: #1f1f1f;
|
|
13
|
-
--text-color: #ebebeb;
|
|
14
|
-
--title-background-color: #111111;
|
|
15
|
-
--title-text-color: #ebebeb;
|
|
16
|
-
--widget-color: #424242;
|
|
17
|
-
--hover-color: #4f4f4f;
|
|
18
|
-
--focus-color: #595959;
|
|
19
|
-
--number-color: #2cc9ff;
|
|
20
|
-
--string-color: #a2db3c;
|
|
21
|
-
--font-size: 11px;
|
|
22
|
-
--input-font-size: 11px;
|
|
23
|
-
--font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
|
|
24
|
-
--font-family-mono: Menlo, Monaco, Consolas, "Droid Sans Mono", monospace;
|
|
25
|
-
--padding: 4px;
|
|
26
|
-
--spacing: 4px;
|
|
27
|
-
--widget-height: 20px;
|
|
28
|
-
--title-height: calc(var(--widget-height) + var(--spacing) * 1.25);
|
|
29
|
-
--name-width: 45%;
|
|
30
|
-
--slider-knob-width: 2px;
|
|
31
|
-
--slider-input-width: 27%;
|
|
32
|
-
--color-input-width: 27%;
|
|
33
|
-
--slider-input-min-width: 45px;
|
|
34
|
-
--color-input-min-width: 45px;
|
|
35
|
-
--folder-indent: 7px;
|
|
36
|
-
--widget-padding: 0 0 0 3px;
|
|
37
|
-
--widget-border-radius: 2px;
|
|
38
|
-
--checkbox-size: calc(0.75 * var(--widget-height));
|
|
39
|
-
--scrollbar-width: 5px;
|
|
40
|
-
}
|
|
41
|
-
.lil-gui, .lil-gui * {
|
|
42
|
-
box-sizing: border-box;
|
|
43
|
-
margin: 0;
|
|
44
|
-
padding: 0;
|
|
45
|
-
}
|
|
46
|
-
.lil-gui.root {
|
|
47
|
-
width: var(--width, 245px);
|
|
48
|
-
display: flex;
|
|
49
|
-
flex-direction: column;
|
|
50
|
-
background: var(--background-color);
|
|
51
|
-
}
|
|
52
|
-
.lil-gui.root > .title {
|
|
53
|
-
background: var(--title-background-color);
|
|
54
|
-
color: var(--title-text-color);
|
|
55
|
-
}
|
|
56
|
-
.lil-gui.root > .children {
|
|
57
|
-
overflow-x: hidden;
|
|
58
|
-
overflow-y: auto;
|
|
59
|
-
}
|
|
60
|
-
.lil-gui.root > .children::-webkit-scrollbar {
|
|
61
|
-
width: var(--scrollbar-width);
|
|
62
|
-
height: var(--scrollbar-width);
|
|
63
|
-
background: var(--background-color);
|
|
64
|
-
}
|
|
65
|
-
.lil-gui.root > .children::-webkit-scrollbar-thumb {
|
|
66
|
-
border-radius: var(--scrollbar-width);
|
|
67
|
-
background: var(--focus-color);
|
|
68
|
-
}
|
|
69
|
-
@media (pointer: coarse) {
|
|
70
|
-
.lil-gui.allow-touch-styles, .lil-gui.allow-touch-styles .lil-gui {
|
|
71
|
-
--widget-height: 28px;
|
|
72
|
-
--padding: 6px;
|
|
73
|
-
--spacing: 6px;
|
|
74
|
-
--font-size: 13px;
|
|
75
|
-
--input-font-size: 16px;
|
|
76
|
-
--folder-indent: 10px;
|
|
77
|
-
--scrollbar-width: 7px;
|
|
78
|
-
--slider-input-min-width: 50px;
|
|
79
|
-
--color-input-min-width: 65px;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
.lil-gui.force-touch-styles, .lil-gui.force-touch-styles .lil-gui {
|
|
83
|
-
--widget-height: 28px;
|
|
84
|
-
--padding: 6px;
|
|
85
|
-
--spacing: 6px;
|
|
86
|
-
--font-size: 13px;
|
|
87
|
-
--input-font-size: 16px;
|
|
88
|
-
--folder-indent: 10px;
|
|
89
|
-
--scrollbar-width: 7px;
|
|
90
|
-
--slider-input-min-width: 50px;
|
|
91
|
-
--color-input-min-width: 65px;
|
|
92
|
-
}
|
|
93
|
-
.lil-gui.autoPlace {
|
|
94
|
-
max-height: 100%;
|
|
95
|
-
position: fixed;
|
|
96
|
-
top: 0;
|
|
97
|
-
right: 15px;
|
|
98
|
-
z-index: 1001;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
.lil-gui .controller {
|
|
102
|
-
display: flex;
|
|
103
|
-
align-items: center;
|
|
104
|
-
padding: 0 var(--padding);
|
|
105
|
-
margin: var(--spacing) 0;
|
|
106
|
-
}
|
|
107
|
-
.lil-gui .controller.disabled {
|
|
108
|
-
opacity: 0.5;
|
|
109
|
-
}
|
|
110
|
-
.lil-gui .controller.disabled, .lil-gui .controller.disabled * {
|
|
111
|
-
pointer-events: none !important;
|
|
112
|
-
}
|
|
113
|
-
.lil-gui .controller > .name {
|
|
114
|
-
min-width: var(--name-width);
|
|
115
|
-
flex-shrink: 0;
|
|
116
|
-
white-space: pre;
|
|
117
|
-
padding-right: var(--spacing);
|
|
118
|
-
line-height: var(--widget-height);
|
|
119
|
-
}
|
|
120
|
-
.lil-gui .controller .widget {
|
|
121
|
-
position: relative;
|
|
122
|
-
display: flex;
|
|
123
|
-
align-items: center;
|
|
124
|
-
width: 100%;
|
|
125
|
-
min-height: var(--widget-height);
|
|
126
|
-
}
|
|
127
|
-
.lil-gui .controller.string input {
|
|
128
|
-
color: var(--string-color);
|
|
129
|
-
}
|
|
130
|
-
.lil-gui .controller.boolean {
|
|
131
|
-
cursor: pointer;
|
|
132
|
-
}
|
|
133
|
-
.lil-gui .controller.color .display {
|
|
134
|
-
width: 100%;
|
|
135
|
-
height: var(--widget-height);
|
|
136
|
-
border-radius: var(--widget-border-radius);
|
|
137
|
-
position: relative;
|
|
138
|
-
}
|
|
139
|
-
@media (hover: hover) {
|
|
140
|
-
.lil-gui .controller.color .display:hover:before {
|
|
141
|
-
content: " ";
|
|
142
|
-
display: block;
|
|
143
|
-
position: absolute;
|
|
144
|
-
border-radius: var(--widget-border-radius);
|
|
145
|
-
border: 1px solid #fff9;
|
|
146
|
-
top: 0;
|
|
147
|
-
right: 0;
|
|
148
|
-
bottom: 0;
|
|
149
|
-
left: 0;
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
.lil-gui .controller.color input[type=color] {
|
|
153
|
-
opacity: 0;
|
|
154
|
-
width: 100%;
|
|
155
|
-
height: 100%;
|
|
156
|
-
cursor: pointer;
|
|
157
|
-
}
|
|
158
|
-
.lil-gui .controller.color input[type=text] {
|
|
159
|
-
margin-left: var(--spacing);
|
|
160
|
-
font-family: var(--font-family-mono);
|
|
161
|
-
min-width: var(--color-input-min-width);
|
|
162
|
-
width: var(--color-input-width);
|
|
163
|
-
flex-shrink: 0;
|
|
164
|
-
}
|
|
165
|
-
.lil-gui .controller.option select {
|
|
166
|
-
opacity: 0;
|
|
167
|
-
position: absolute;
|
|
168
|
-
width: 100%;
|
|
169
|
-
max-width: 100%;
|
|
170
|
-
}
|
|
171
|
-
.lil-gui .controller.option .display {
|
|
172
|
-
position: relative;
|
|
173
|
-
pointer-events: none;
|
|
174
|
-
border-radius: var(--widget-border-radius);
|
|
175
|
-
height: var(--widget-height);
|
|
176
|
-
line-height: var(--widget-height);
|
|
177
|
-
max-width: 100%;
|
|
178
|
-
overflow: hidden;
|
|
179
|
-
word-break: break-all;
|
|
180
|
-
padding-left: 0.55em;
|
|
181
|
-
padding-right: 1.75em;
|
|
182
|
-
background: var(--widget-color);
|
|
183
|
-
}
|
|
184
|
-
@media (hover: hover) {
|
|
185
|
-
.lil-gui .controller.option .display.focus {
|
|
186
|
-
background: var(--focus-color);
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
.lil-gui .controller.option .display.active {
|
|
190
|
-
background: var(--focus-color);
|
|
191
|
-
}
|
|
192
|
-
.lil-gui .controller.option .display:after {
|
|
193
|
-
font-family: "lil-gui";
|
|
194
|
-
content: "\u2195";
|
|
195
|
-
position: absolute;
|
|
196
|
-
top: 0;
|
|
197
|
-
right: 0;
|
|
198
|
-
bottom: 0;
|
|
199
|
-
padding-right: 0.375em;
|
|
200
|
-
}
|
|
201
|
-
.lil-gui .controller.option .widget,
|
|
202
|
-
.lil-gui .controller.option select {
|
|
203
|
-
cursor: pointer;
|
|
204
|
-
}
|
|
205
|
-
@media (hover: hover) {
|
|
206
|
-
.lil-gui .controller.option .widget:hover .display {
|
|
207
|
-
background: var(--hover-color);
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
.lil-gui .controller.number input {
|
|
211
|
-
color: var(--number-color);
|
|
212
|
-
}
|
|
213
|
-
.lil-gui .controller.number.hasSlider input {
|
|
214
|
-
margin-left: var(--spacing);
|
|
215
|
-
width: var(--slider-input-width);
|
|
216
|
-
min-width: var(--slider-input-min-width);
|
|
217
|
-
flex-shrink: 0;
|
|
218
|
-
}
|
|
219
|
-
.lil-gui .controller.number .slider {
|
|
220
|
-
width: 100%;
|
|
221
|
-
height: var(--widget-height);
|
|
222
|
-
background: var(--widget-color);
|
|
223
|
-
border-radius: var(--widget-border-radius);
|
|
224
|
-
padding-right: var(--slider-knob-width);
|
|
225
|
-
overflow: hidden;
|
|
226
|
-
cursor: ew-resize;
|
|
227
|
-
touch-action: pan-y;
|
|
228
|
-
}
|
|
229
|
-
@media (hover: hover) {
|
|
230
|
-
.lil-gui .controller.number .slider:hover {
|
|
231
|
-
background: var(--hover-color);
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
.lil-gui .controller.number .slider.active {
|
|
235
|
-
background: var(--focus-color);
|
|
236
|
-
}
|
|
237
|
-
.lil-gui .controller.number .slider.active .fill {
|
|
238
|
-
opacity: 0.95;
|
|
239
|
-
}
|
|
240
|
-
.lil-gui .controller.number .fill {
|
|
241
|
-
height: 100%;
|
|
242
|
-
border-right: var(--slider-knob-width) solid var(--number-color);
|
|
243
|
-
box-sizing: content-box;
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
.lil-gui-dragging .lil-gui {
|
|
247
|
-
--hover-color: var(--widget-color);
|
|
248
|
-
}
|
|
249
|
-
.lil-gui-dragging * {
|
|
250
|
-
cursor: ew-resize !important;
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
.lil-gui-dragging.lil-gui-vertical * {
|
|
254
|
-
cursor: ns-resize !important;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
.lil-gui .title {
|
|
258
|
-
height: var(--title-height);
|
|
259
|
-
line-height: calc(var(--title-height) - 4px);
|
|
260
|
-
font-weight: 600;
|
|
261
|
-
padding: 0 var(--padding);
|
|
262
|
-
-webkit-tap-highlight-color: transparent;
|
|
263
|
-
cursor: pointer;
|
|
264
|
-
outline: none;
|
|
265
|
-
text-decoration-skip: objects;
|
|
266
|
-
}
|
|
267
|
-
.lil-gui .title:before {
|
|
268
|
-
font-family: "lil-gui";
|
|
269
|
-
content: "\u25BE";
|
|
270
|
-
padding-right: 2px;
|
|
271
|
-
display: inline-block;
|
|
272
|
-
}
|
|
273
|
-
.lil-gui .title:active {
|
|
274
|
-
background: var(--title-background-color);
|
|
275
|
-
opacity: 0.75;
|
|
276
|
-
}
|
|
277
|
-
@media (hover: hover) {
|
|
278
|
-
body:not(.lil-gui-dragging) .lil-gui .title:hover {
|
|
279
|
-
background: var(--title-background-color);
|
|
280
|
-
opacity: 0.85;
|
|
281
|
-
}
|
|
282
|
-
.lil-gui .title:focus {
|
|
283
|
-
text-decoration: underline var(--focus-color);
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
.lil-gui.root > .title:focus {
|
|
287
|
-
text-decoration: none !important;
|
|
288
|
-
}
|
|
289
|
-
.lil-gui.closed > .title:before {
|
|
290
|
-
content: "\u25B8";
|
|
291
|
-
}
|
|
292
|
-
.lil-gui.closed > .children {
|
|
293
|
-
transform: translateY(-7px);
|
|
294
|
-
opacity: 0;
|
|
295
|
-
}
|
|
296
|
-
.lil-gui.closed:not(.transition) > .children {
|
|
297
|
-
display: none;
|
|
298
|
-
}
|
|
299
|
-
.lil-gui.transition > .children {
|
|
300
|
-
transition-duration: 300ms;
|
|
301
|
-
transition-property: height, opacity, transform;
|
|
302
|
-
transition-timing-function: cubic-bezier(0.2, 0.6, 0.35, 1);
|
|
303
|
-
overflow: hidden;
|
|
304
|
-
pointer-events: none;
|
|
305
|
-
}
|
|
306
|
-
.lil-gui .children:empty:before {
|
|
307
|
-
content: "Empty";
|
|
308
|
-
padding: 0 var(--padding);
|
|
309
|
-
margin: var(--spacing) 0;
|
|
310
|
-
display: block;
|
|
311
|
-
height: var(--widget-height);
|
|
312
|
-
font-style: italic;
|
|
313
|
-
line-height: var(--widget-height);
|
|
314
|
-
opacity: 0.5;
|
|
315
|
-
}
|
|
316
|
-
.lil-gui.root > .children > .lil-gui > .title {
|
|
317
|
-
border: 0 solid var(--widget-color);
|
|
318
|
-
border-width: 1px 0;
|
|
319
|
-
transition: border-color 300ms;
|
|
320
|
-
}
|
|
321
|
-
.lil-gui.root > .children > .lil-gui.closed > .title {
|
|
322
|
-
border-bottom-color: transparent;
|
|
323
|
-
}
|
|
324
|
-
.lil-gui + .controller {
|
|
325
|
-
border-top: 1px solid var(--widget-color);
|
|
326
|
-
margin-top: 0;
|
|
327
|
-
padding-top: var(--spacing);
|
|
328
|
-
}
|
|
329
|
-
.lil-gui .lil-gui .lil-gui > .title {
|
|
330
|
-
border: none;
|
|
331
|
-
}
|
|
332
|
-
.lil-gui .lil-gui .lil-gui > .children {
|
|
333
|
-
border: none;
|
|
334
|
-
margin-left: var(--folder-indent);
|
|
335
|
-
border-left: 2px solid var(--widget-color);
|
|
336
|
-
}
|
|
337
|
-
.lil-gui .lil-gui .controller {
|
|
338
|
-
border: none;
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
.lil-gui label, .lil-gui input, .lil-gui button {
|
|
342
|
-
-webkit-tap-highlight-color: transparent;
|
|
343
|
-
}
|
|
344
|
-
.lil-gui input {
|
|
345
|
-
border: 0;
|
|
346
|
-
outline: none;
|
|
347
|
-
font-family: var(--font-family);
|
|
348
|
-
font-size: var(--input-font-size);
|
|
349
|
-
border-radius: var(--widget-border-radius);
|
|
350
|
-
height: var(--widget-height);
|
|
351
|
-
background: var(--widget-color);
|
|
352
|
-
color: var(--text-color);
|
|
353
|
-
width: 100%;
|
|
354
|
-
}
|
|
355
|
-
@media (hover: hover) {
|
|
356
|
-
.lil-gui input:hover {
|
|
357
|
-
background: var(--hover-color);
|
|
358
|
-
}
|
|
359
|
-
.lil-gui input:active {
|
|
360
|
-
background: var(--focus-color);
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
.lil-gui input:disabled {
|
|
364
|
-
opacity: 1;
|
|
365
|
-
}
|
|
366
|
-
.lil-gui input[type=text],
|
|
367
|
-
.lil-gui input[type=number] {
|
|
368
|
-
padding: var(--widget-padding);
|
|
369
|
-
-moz-appearance: textfield;
|
|
370
|
-
}
|
|
371
|
-
.lil-gui input[type=text]:focus,
|
|
372
|
-
.lil-gui input[type=number]:focus {
|
|
373
|
-
background: var(--focus-color);
|
|
374
|
-
}
|
|
375
|
-
.lil-gui input[type=checkbox] {
|
|
376
|
-
appearance: none;
|
|
377
|
-
width: var(--checkbox-size);
|
|
378
|
-
height: var(--checkbox-size);
|
|
379
|
-
border-radius: var(--widget-border-radius);
|
|
380
|
-
text-align: center;
|
|
381
|
-
cursor: pointer;
|
|
382
|
-
}
|
|
383
|
-
.lil-gui input[type=checkbox]:checked:before {
|
|
384
|
-
font-family: "lil-gui";
|
|
385
|
-
content: "\u2713";
|
|
386
|
-
font-size: var(--checkbox-size);
|
|
387
|
-
line-height: var(--checkbox-size);
|
|
388
|
-
}
|
|
389
|
-
@media (hover: hover) {
|
|
390
|
-
.lil-gui input[type=checkbox]:focus {
|
|
391
|
-
box-shadow: inset 0 0 0 1px var(--focus-color);
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
.lil-gui button {
|
|
395
|
-
outline: none;
|
|
396
|
-
cursor: pointer;
|
|
397
|
-
font-family: var(--font-family);
|
|
398
|
-
font-size: var(--font-size);
|
|
399
|
-
color: var(--text-color);
|
|
400
|
-
width: 100%;
|
|
401
|
-
height: var(--widget-height);
|
|
402
|
-
text-transform: none;
|
|
403
|
-
background: var(--widget-color);
|
|
404
|
-
border-radius: var(--widget-border-radius);
|
|
405
|
-
border: none;
|
|
406
|
-
}
|
|
407
|
-
@media (hover: hover) {
|
|
408
|
-
.lil-gui button:hover {
|
|
409
|
-
background: var(--hover-color);
|
|
410
|
-
}
|
|
411
|
-
.lil-gui button:focus {
|
|
412
|
-
box-shadow: inset 0 0 0 1px var(--focus-color);
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
.lil-gui button:active {
|
|
416
|
-
background: var(--focus-color);
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
@font-face {
|
|
420
|
-
font-family: "lil-gui";
|
|
421
|
-
src: url("data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAAAUsAAsAAAAACJwAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAAH4AAADAImwmYE9TLzIAAAGIAAAAPwAAAGBKqH5SY21hcAAAAcgAAAD0AAACrukyyJBnbHlmAAACvAAAAF8AAACEIZpWH2hlYWQAAAMcAAAAJwAAADZfcj2zaGhlYQAAA0QAAAAYAAAAJAC5AHhobXR4AAADXAAAABAAAABMAZAAAGxvY2EAAANsAAAAFAAAACgCEgIybWF4cAAAA4AAAAAeAAAAIAEfABJuYW1lAAADoAAAASIAAAIK9SUU/XBvc3QAAATEAAAAZgAAAJCTcMc2eJxVjbEOgjAURU+hFRBK1dGRL+ALnAiToyMLEzFpnPz/eAshwSa97517c/MwwJmeB9kwPl+0cf5+uGPZXsqPu4nvZabcSZldZ6kfyWnomFY/eScKqZNWupKJO6kXN3K9uCVoL7iInPr1X5baXs3tjuMqCtzEuagm/AAlzQgPAAB4nGNgYRBlnMDAysDAYM/gBiT5oLQBAwuDJAMDEwMrMwNWEJDmmsJwgCFeXZghBcjlZMgFCzOiKOIFAB71Bb8AeJy1kjFuwkAQRZ+DwRAwBtNQRUGKQ8OdKCAWUhAgKLhIuAsVSpWz5Bbkj3dEgYiUIszqWdpZe+Z7/wB1oCYmIoboiwiLT2WjKl/jscrHfGg/pKdMkyklC5Zs2LEfHYpjcRoPzme9MWWmk3dWbK9ObkWkikOetJ554fWyoEsmdSlt+uR0pCJR34b6t/TVg1SY3sYvdf8vuiKrpyaDXDISiegp17p7579Gp3p++y7HPAiY9pmTibljrr85qSidtlg4+l25GLCaS8e6rRxNBmsnERunKbaOObRz7N72ju5vdAjYpBXHgJylOAVsMseDAPEP8LYoUHicY2BiAAEfhiAGJgZWBgZ7RnFRdnVJELCQlBSRlATJMoLV2DK4glSYs6ubq5vbKrJLSbGrgEmovDuDJVhe3VzcXFwNLCOILB/C4IuQ1xTn5FPilBTj5FPmBAB4WwoqAHicY2BkYGAA4sk1sR/j+W2+MnAzpDBgAyEMQUCSg4EJxAEAwUgFHgB4nGNgZGBgSGFggJMhDIwMqEAYAByHATJ4nGNgAIIUNEwmAABl3AGReJxjYAACIQYlBiMGJ3wQAEcQBEV4nGNgZGBgEGZgY2BiAAEQyQWEDAz/wXwGAAsPATIAAHicXdBNSsNAHAXwl35iA0UQXYnMShfS9GPZA7T7LgIu03SSpkwzYTIt1BN4Ak/gKTyAeCxfw39jZkjymzcvAwmAW/wgwHUEGDb36+jQQ3GXGot79L24jxCP4gHzF/EIr4jEIe7wxhOC3g2TMYy4Q7+Lu/SHuEd/ivt4wJd4wPxbPEKMX3GI5+DJFGaSn4qNzk8mcbKSR6xdXdhSzaOZJGtdapd4vVPbi6rP+cL7TGXOHtXKll4bY1Xl7EGnPtp7Xy2n00zyKLVHfkHBa4IcJ2oD3cgggWvt/V/FbDrUlEUJhTn/0azVWbNTNr0Ens8de1tceK9xZmfB1CPjOmPH4kitmvOubcNpmVTN3oFJyjzCvnmrwhJTzqzVj9jiSX911FjeAAB4nG3HMRKCMBBA0f0giiKi4DU8k0V2GWbIZDOh4PoWWvq6J5V8If9NVNQcaDhyouXMhY4rPTcG7jwYmXhKq8Wz+p762aNaeYXom2n3m2dLTVgsrCgFJ7OTmIkYbwIbC6vIB7WmFfAAAA==") format("woff");
|
|
422
|
-
}`;function ft(n){let t=document.createElement("style");t.innerHTML=n;let e=document.querySelector("head link[rel=stylesheet], head style");e?document.head.insertBefore(t,e):document.head.appendChild(t)}o(ft,"_injectStyles");var K=!1,S=class S{constructor({parent:t,autoPlace:e=t===void 0,container:i,width:r,title:s="Controls",closeFolders:a=!1,injectStyles:u=!0,touchStyles:g=!0}={}){if(this.parent=t,this.root=t?t.root:this,this.children=[],this.controllers=[],this.folders=[],this._closed=!1,this._hidden=!1,this.domElement=document.createElement("div"),this.domElement.classList.add("lil-gui"),this.$title=document.createElement("div"),this.$title.classList.add("title"),this.$title.setAttribute("role","button"),this.$title.setAttribute("aria-expanded",!0),this.$title.setAttribute("tabindex",0),this.$title.addEventListener("click",()=>this.openAnimated(this._closed)),this.$title.addEventListener("keydown",b=>{(b.code==="Enter"||b.code==="Space")&&(b.preventDefault(),this.$title.click())}),this.$title.addEventListener("touchstart",()=>{},{passive:!0}),this.$children=document.createElement("div"),this.$children.classList.add("children"),this.domElement.appendChild(this.$title),this.domElement.appendChild(this.$children),this.title(s),this.parent){this.parent.children.push(this),this.parent.folders.push(this),this.parent.$children.appendChild(this.domElement);return}this.domElement.classList.add("root"),g&&this.domElement.classList.add("allow-touch-styles"),!K&&u&&(ft(mt),K=!0),i?i.appendChild(this.domElement):e&&(this.domElement.classList.add("autoPlace"),document.body.appendChild(this.domElement)),r&&this.domElement.style.setProperty("--width",r+"px"),this._closeFolders=a}add(t,e,i,r,s){if(Object(i)===i)return new O(this,t,e,i);let a=t[e];switch(typeof a){case"number":return new D(this,t,e,i,r,s);case"boolean":return new M(this,t,e);case"string":return new z(this,t,e);case"function":return new $(this,t,e)}console.error(`gui.add failed
|
|
423
|
-
property:`,e,`
|
|
424
|
-
object:`,t,`
|
|
425
|
-
value:`,a)}addColor(t,e,i=1){return new F(this,t,e,i)}addFolder(t){let e=new S({parent:this,title:t});return this.root._closeFolders&&e.close(),e}load(t,e=!0){return t.controllers&&this.controllers.forEach(i=>{i instanceof $||i._name in t.controllers&&i.load(t.controllers[i._name])}),e&&t.folders&&this.folders.forEach(i=>{i._title in t.folders&&i.load(t.folders[i._title])}),this}save(t=!0){let e={controllers:{},folders:{}};return this.controllers.forEach(i=>{if(!(i instanceof $)){if(i._name in e.controllers)throw new Error(`Cannot save GUI with duplicate property "${i._name}"`);e.controllers[i._name]=i.save()}}),t&&this.folders.forEach(i=>{if(i._title in e.folders)throw new Error(`Cannot save GUI with duplicate folder "${i._title}"`);e.folders[i._title]=i.save()}),e}open(t=!0){return this._setClosed(!t),this.$title.setAttribute("aria-expanded",!this._closed),this.domElement.classList.toggle("closed",this._closed),this}close(){return this.open(!1)}_setClosed(t){this._closed!==t&&(this._closed=t,this._callOnOpenClose(this))}show(t=!0){return this._hidden=!t,this.domElement.style.display=this._hidden?"none":"",this}hide(){return this.show(!1)}openAnimated(t=!0){return this._setClosed(!t),this.$title.setAttribute("aria-expanded",!this._closed),requestAnimationFrame(()=>{let e=this.$children.clientHeight;this.$children.style.height=e+"px",this.domElement.classList.add("transition");let i=o(s=>{s.target===this.$children&&(this.$children.style.height="",this.domElement.classList.remove("transition"),this.$children.removeEventListener("transitionend",i))},"onTransitionEnd");this.$children.addEventListener("transitionend",i);let r=t?this.$children.scrollHeight:0;this.domElement.classList.toggle("closed",!t),requestAnimationFrame(()=>{this.$children.style.height=r+"px"})}),this}title(t){return this._title=t,this.$title.textContent=t,this}reset(t=!0){return(t?this.controllersRecursive():this.controllers).forEach(i=>i.reset()),this}onChange(t){return this._onChange=t,this}_callOnChange(t){this.parent&&this.parent._callOnChange(t),this._onChange!==void 0&&this._onChange.call(this,{object:t.object,property:t.property,value:t.getValue(),controller:t})}onFinishChange(t){return this._onFinishChange=t,this}_callOnFinishChange(t){this.parent&&this.parent._callOnFinishChange(t),this._onFinishChange!==void 0&&this._onFinishChange.call(this,{object:t.object,property:t.property,value:t.getValue(),controller:t})}onOpenClose(t){return this._onOpenClose=t,this}_callOnOpenClose(t){this.parent&&this.parent._callOnOpenClose(t),this._onOpenClose!==void 0&&this._onOpenClose.call(this,t)}destroy(){this.parent&&(this.parent.children.splice(this.parent.children.indexOf(this),1),this.parent.folders.splice(this.parent.folders.indexOf(this),1)),this.domElement.parentElement&&this.domElement.parentElement.removeChild(this.domElement),Array.from(this.children).forEach(t=>t.destroy())}controllersRecursive(){let t=Array.from(this.controllers);return this.folders.forEach(e=>{t=t.concat(e.controllersRecursive())}),t}foldersRecursive(){let t=Array.from(this.folders);return this.folders.forEach(e=>{t=t.concat(e.foldersRecursive())}),t}};o(S,"GUI");var B=S,Z=B;y();y();var w=(()=>{let n=new X;return o(function(e){return n.set(e),`#${n.getHexString()}`},"normalize")})();function Q(n){let t;for(t of n)t()}o(Q,"runAll");function q(n,t){let e=window.location.href,i=new URL(e),r=new URLSearchParams(i.search);for(let s in n)if(n.hasOwnProperty(s)){let a=`${t}.${s}`;r.set(a,n[s])}i.search=r.toString(),history.pushState({path:i.toString()},"",i.toString())}o(q,"updateCurrentUrlParamsWithNamespace");function tt(n,t){let e=new URLSearchParams(window.location.search),i={};for(let[r,s]of e)if(r.startsWith(`${n}.`)){let a=r.slice(n.length+1);s==="true"||s==="false"?i[a]=s==="true":typeof t[a]=="number"?i[a]=Number(s):i[a]=s}return{namespace:n,params:i}}o(tt,"getUrlParamsWithNamespace");y();function et(n,t){t.domElement.id="interactionPanel";let e=t.addFolder("Click \u{1F447}");vt(n,e);let i=t.addFolder("Hover \u{1F681}");yt(n,i)}o(et,"createInteractionControls");function vt(n,t){let e={position:"",hoverColor:w(n.getHoverColor())},i=t.add(e,"position").disable(),r=[];function s(){r.forEach(u=>u()),r.length=0}o(s,"reset");let a=0;n.on("click",u=>{var l;let{labels:g,markers:b,coordinate:f}=u;s(),clearInterval(a),i.load(JSON.stringify([f.longitude,f.latitude]));let c=g[0]||b[0];if(c){let h=Y(n,c,t);if(!h)return;r.push(h.destroy),h.labelItemFolder.openAnimated()}let d=(l=u.spaces[0])!=null?l:u.objects[0];if(d){let h={id:d.id,...n.getState(d.id),type:d.type,isInView:!1,isInViewCheck:j(n,d.id)},{cleanup:v}=At(n,h,t);a=setInterval(()=>{h.isInView=n.isInView(c||d)},500),r.push(v)}})}o(vt,"createClickControls");var bt=["interactive"];function At(n,t,e){let i=e.addFolder(`${t.type}-${t.id}`);for(let r in t){if(r==="visible"&&i.add(t,r).onChange(s=>{n.updateState(t.id,{[r]:s})}),r==="color"||r==="hoverColor"){t[r]=w(t[r]),i.addColor(t,r).onChange(s=>{n.updateState(t.id,{[r]:s})});continue}if(r==="height"){i.add(t,r,0,20,1).onChange(s=>{n.updateState(t.id,{[r]:s})});continue}bt.includes(r)&&i.add(t,r).onChange(s=>{n.updateState(t.id,{[r]:s})})}return i.add(t,"isInView").listen().disable(),i.add(t,"isInViewCheck"),{cleanup(){i.destroy()}}}o(At,"renderByProp");function yt(n,t){n.setHoverColor("#1f3a7a");let e={position:"",hoverColor:w(n.getHoverColor()),intersected:"",type:"",id:""},i=t.add(e,"position").disable();t.add(e,"id").disable().listen(),t.add(e,"type").disable().listen(),t.addColor(e,"hoverColor").onChange(a=>{n.setHoverColor(a)});let r=[];function s(){r.forEach(a=>a()),r.length=0}o(s,"reset"),n.on("hover",a=>{var h,v,A;let{coordinate:u,spaces:g,objects:b,markers:f,labels:c}=a;s(),i.load(JSON.stringify([u.longitude,u.latitude]));let d=(A=(v=(h=g[0])!=null?h:b[0])!=null?v:f[0])!=null?A:c[0];if(!d)return;let l=n.getState(d);l&&(e.type=l.type,e.id=d.id)})}o(yt,"createHoverControls");function j(n,t){return o(function(){console.log("isInView",n.isInView(t))},"isInView")}o(j,"createIsInViewHandler");function it(n,t,e){let i={labels:{},all(){e.Labels.all().forEach(l=>{this.labels[l.id]=l}),g()},removeAllLabels(){e.Labels.removeAll().forEach(l=>{delete this.labels[l.id]}),g()}},{addLabel:r,destroy:s}=Ct(n,e);n.add(i,"all"),n.add(i,"removeAllLabels");let a=n.addFolder("Label List");n.close();let u=new Map,{rerender:g}=b();function b(){function d(v){var A;delete i.labels[v.id],(A=u.get(v.id))==null||A.destroy()}o(d,"remove");function l(v){let A=Y(e,v,a,{onRemove:p=>{d(p)}});if(!A)return;let{labelItemFolder:m}=A;u.set(v.id,m)}o(l,"add");function h(){a.destroy(),a=n.addFolder("Label");for(let v in i.labels){let A=i.labels[v];l(A)}}return o(h,"rerender"),{rerender:h,add:l,remove:d}}o(b,"createLabelControls"),n.domElement.classList.add("list-items");let f;e.on("click",({labels:d,coordinate:l})=>{if(!n._closed)if(d[0]){f==null||f.close();let h=u.get(d[0].id);if(n.open(),!h)return;h==null||h.open(),h==null||h.domElement.scrollIntoView({block:"start"}),h==null||h.domElement.focus(),f=h}else r(l)});function c(d){for(let l of d)i.labels[l.id]=l;g()}return o(c,"populatelabels"),{populatelabels:c,destroy(){s()}}}o(it,"createLabelControls");function Y(n,t,e,{onRemove:i}={}){var b,f,c,d;let r=e.addFolder(`${(b=t.text)==null?void 0:b.substring(0,12)}`);r.onChange(l=>{n.updateState(t,{appearance:g.appearance,interactive:g.interactive})}),r.close();let s=n.getState(t);if((s==null?void 0:s.type)!=="label")throw new Error(`error getting state for label: ${t.id}`);let{appearance:a,interactive:u}=s;if(!a||a.margin==null||u==null)throw new Error("incomplte label state");let g={text:t.text,interactive:u,appearance:{...a,margin:a.margin||0,marker:{foregroundColor:(c=(f=a.marker)==null?void 0:f.foregroundColor)!=null&&c.active?w((d=a.marker.foregroundColor)==null?void 0:d.active):"black"},text:{foregroundColor:w(a.text.foregroundColor)}},remove(){n.Labels.remove(t),i==null||i(t),r.destroy()},isInView:j(n,t.id)};return r.add(g.appearance,"margin",0,20).name("margin"),r.add(g,"text"),r.add(g,"interactive"),r.addColor(g.appearance.marker,"foregroundColor").name("marker foreground"),r.addColor(g.appearance.text,"foregroundColor").name("text forground"),r.add(g,"isInView"),r.add(g,"remove"),{labelItemFolder:r,destroy(){r.destroy()}}}o(Y,"addLabelControlToFolder");function Ct(n,t){let e=n.addFolder("Add"),i={onClick:!1,margin:0,text:"New Label!",interactive:!0,marginForegroundColor:w("skyblue"),marginBackgroundColor:w("coral"),textForegroundColor:w("slategray"),textBackgroundColor:w("white")};return e.add(i,"onClick"),e.add(i,"margin"),e.add(i,"interactive"),e.add(i,"text"),e.addColor(i,"marginForegroundColor"),e.addColor(i,"marginBackgroundColor"),e.addColor(i,"textForegroundColor"),e.addColor(i,"textBackgroundColor"),{destroy(){e.destroy()},addLabel(r){return e._closed||!i.onClick?void 0:t.Labels.add(r,i.text,{appearance:{margin:i.margin,marker:{foregroundColor:{active:i.marginForegroundColor,inactive:i.marginForegroundColor},backgroundColor:{active:i.marginBackgroundColor,inactive:i.marginBackgroundColor}},text:{foregroundColor:i.textForegroundColor,backgroundColor:i.marginBackgroundColor}},interactive:i.interactive})}}}o(Ct,"createAddControl");var nt={};y();function rt(n,t){let e=n.addFolder("Camera \u{1F4F7}").close(),i=t.Camera.center.toJSON(),r=document.createElement("div");Object.assign(r.style,{display:"none",position:"absolute",left:"0px",top:"0px",bottom:"0px",right:"0px",backgroundColor:"aqua",pointerEvents:"none",opacity:.5,zIndex:99999}),document.body.appendChild(r);let s={center_lat:i.latitude,center_lon:i.longitude,zoomLevel:t.Camera.zoomLevel,pitch:t.Camera.pitch,bearing:t.Camera.bearing,minZoomLevel:t.Camera.minZoomLevel,maxZoomLevel:t.Camera.maxZoomLevel,inset_top:0,inset_left:0,inset_right:0,inset_bottom:0,animateOnLoad:!0,share:()=>{q(e.save().controllers,"camera"),navigator.clipboard.writeText(window.location.href)},visualizeInset:!1};function a(){Object.assign(r.style,{left:s.inset_left+"px",top:s.inset_top+"px",bottom:s.inset_bottom+"px",right:s.inset_right+"px"})}o(a,"updateInsetVisualizer"),e.add(s,"center_lat").listen().disable(),e.add(s,"center_lon").listen().disable(),e.add(s,"zoomLevel",16,22,.5).listen().disable(),e.add(s,"pitch").listen().disable(),e.add(s,"bearing").listen().disable(),e.add(s,"minZoomLevel",5,22,.5).onChange(l=>{t.Camera.setMinZoomLevel(l)}),e.add(s,"maxZoomLevel",10,22,.5).onChange(l=>{t.Camera.setMaxZoomLevel(l)}),e.add(s,"animateOnLoad"),e.add(s,"visualizeInset").onChange(l=>{l?r.style.display="block":r.style.display="none"});let{innerHeight:u,innerWidth:g}=window;e.add(s,"inset_top",0,u,1).onChange(d),e.add(s,"inset_bottom",0,u,1).onChange(d),e.add(s,"inset_left",0,g,1).onChange(d),e.add(s,"inset_right",0,g,1).onChange(d),e.add(s,"share");let b=o(l=>{e._closed||(s.center_lat=l.center.latitude,s.center_lon=l.center.longitude,s.zoomLevel=l.zoomLevel,s.bearing=l.bearing,s.pitch=l.pitch)},"onCameraChanged");t.on("camera-change",b);let{params:f}=tt("camera",s);if(Object.keys(f).length>0){let l=f;t.Camera.setScreenOffsets({top:l.inset_top,left:l.inset_left,right:l.inset_right,bottom:l.inset_bottom});let h={pitch:l.pitch,center:new W(l.center_lat,l.center_lon),bearing:l.bearing,zoomLevel:l.zoomLevel};l.animateOnLoad?t.Camera.animateTo(h):t.Camera.set(h),e.load({controllers:l,folders:{}}),a()}let c=[()=>{t.off("camera-change",b)}];function d(){t.Camera.setScreenOffsets({top:s.inset_top,left:s.inset_left,right:s.inset_right,bottom:s.inset_bottom}),a()}return o(d,"updateInset"),()=>({destroy(){e.destroy(),Q(c)}})}o(rt,"createCameraControls");y();function st(n,t,e){let i={markers:{},removeAllMarkers(){e.Markers.removeAll().forEach(l=>{delete this.markers[l.id]}),g()}},{addMarker:r,destroy:s}=_t(n,e);n.add(i,"removeAllMarkers");let a=n.addFolder("Marker List");n.close();let u=new Map,{rerender:g}=b();function b(){function d(v){var A;delete i.markers[v.id],(A=u.get(v.id))==null||A.destroy()}o(d,"remove");function l(v){let A=xt(e,v,a,{onRemove:p=>{d(p)}});if(!A)return;let{markerItemFolder:m}=A;u.set(v.id,m)}o(l,"add");function h(){a.destroy(),a=n.addFolder("marker");for(let v in i.markers){let A=i.markers[v];l(A)}}return o(h,"rerender"),{rerender:h,add:l,remove:d}}o(b,"createMarkerControls"),n.domElement.classList.add("list-items");let f;e.on("click",({markers:d,coordinate:l})=>{if(!n._closed)if(d[0]){f==null||f.close();let h=u.get(d[0].id);if(n.open(),!h)return;h==null||h.open(),h==null||h.domElement.scrollIntoView({block:"start"}),h==null||h.domElement.focus(),f=h}else r(l)});function c(d){for(let l of d)i.markers[l.id]=l;g()}return o(c,"populateMarkers"),{populateMarkers:c,destroy(){s()}}}o(st,"createMarkerControls");function xt(n,t,e,{onRemove:i}={}){let r=e.addFolder(`${t.id.toString().substring(0,8)}`);r.onChange(g=>{n.updateState(t,{interactive:u.interactive})}),r.close();let s=n.getState(t);if((s==null?void 0:s.type)!=="marker")throw new Error(`error getting state for marker: ${t.id}`);let{interactive:a}=s;if(a==null)throw new Error("incomplte label state");let u={interactive:a,remove(){n.Markers.remove(t),i==null||i(t),r.destroy()}};return r.add(u,"interactive"),r.add(u,"remove"),{markerItemFolder:r,destroy(){r.destroy()}}}o(xt,"addMarkerControlToFolder");function _t(n,t){let e=n.addFolder("Add"),i={onClick:!1,interactive:!0};return e.add(i,"onClick"),e.add(i,"interactive"),{destroy(){e.destroy()},addMarker(r){return e._closed||!i.onClick?void 0:t.Markers.add(r,"<div>New Marker</div>",{interactive:i.interactive})}}}o(_t,"createAddControl");y();function ot(n,t){let e=n.addFolder("Walls").close(),i={visible:!0,topColor:"#3269a8"};e.add(i,"visible").onChange(r=>{t.updateState("walls",{visible:r})}),e.addColor(i,"topColor").onChange(r=>{t.updateState("walls",{topColor:r})}),t.updateState("walls",{topColor:i.topColor})}o(ot,"createGeometryControl");function lt(n,t){Et();let e=new Z({title:"SDK Controls"});e.domElement.classList.add("mappedin-js-inspector"),et(t,e),rt(e,t);let i=e.addFolder("Levels").close(),r=e.addFolder("Scene Controls"),s=e.addFolder("Labels"),a=e.addFolder("Markers");ot(e,t);let u={level:t.currentFloor.id,load:()=>{let c=localStorage.getItem("mappedin-debug"),d=c?JSON.parse(c):{};for(let l in d)t.updateState(l,d[l])},clear(){localStorage.removeItem("mappedin-debug")}};e.add(u,"load"),e.add(u,"clear");let{populatelabels:g}=it(s,n,t),{populateMarkers:b}=st(a,n,t),f=n.getByType("floor").reduce((c,d)=>(c[d.name]=d.id,c),{});return i.add(u,"level",f).onChange(c=>{t.setFloor(c)}),t.on("floor-change-start",c=>{i.controllers[0].setValue(c.floor.id)}),n.getByType("space").forEach(c=>{t.updateState(c,{interactive:!0})}),n.getByType("object").forEach(c=>{t.updateState(c,{interactive:!0})}),n.getByType("object").forEach(c=>{t.updateState(c,{interactive:!0})}),t.setHoverColor("#a2b7e6"),{populatelabels:g,sceneFolder:r,populateMarkers:b}}o(lt,"createUi");var at="mappedin-sdk-debug-css";function Et(){if(document.getElementById(at))return;let n=document.createElement("style");n.id=at,n.textContent=nt,document.head.appendChild(n)}o(Et,"injectCss");var N=class N{_enabled=!1;mv;api;mapData;storeStateToLocalStorageEnabled=!1;constructor(t,e){this.mv=t,this.api=e,this.mapData=this.api.getMapData()}setMapData(t){this.mapData=t}async enable(){var e;if(this._enabled)return;if(this._enabled=!0,!this.mapData)throw new Error("Please set mapData before enable debug.");let{sceneFolder:t}=lt(this.mapData,this.mv);R(this.api.core,t),(e=this.api.getMapDataInternal())==null||e.spaces.forEach(i=>{this.mv.updateState(i.id,{interactive:!0})})}get enabled(){return this._enabled}storeState(t,e){if(!this.storeStateToLocalStorageEnabled)return;let i=localStorage.getItem("mappedin-debug"),r=i?JSON.parse(i):{};r[t]={...r[t],...e},localStorage.setItem("mappedin-debug",JSON.stringify(r))}};o(N,"Inspector");var J=N;export{J as Inspector};
|