1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[439],{72:e=>{function t(e,t,r,n){this.x="number"==typeof e?e:0,this.y="number"==typeof t?t:0,this.z="number"==typeof r?r:0,this.half="number"==typeof n?n:0}e.exports=t,t.prototype.contains=function(e,t,r){var n=this.half;return this.x-n<=e&&e<this.x+n&&this.y-n<=t&&t<this.y+n&&this.z-n<=r&&r<this.z+n}},114:(e,t,r)=>{"use strict";function n(e,t){return e*=1,t*=1,function(r){return Math.round(e*(1-r)+t*r)}}r.d(t,{A:()=>n})},314:(e,t,r)=>{"use strict";var n=r(23),i=r(2690),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},a=i.useSyncExternalStore,s=n.useRef,l=n.useEffect,u=n.useMemo,c=n.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,r,n,i){var h=s(null);if(null===h.current){var f={hasValue:!1,value:null};h.current=f}else f=h.current;var d=a(e,(h=u(function(){function e(e){if(!l){if(l=!0,a=e,e=n(e),void 0!==i&&f.hasValue){var t=f.value;if(i(t,e))return s=t}return s=e}if(t=s,o(a,e))return t;var r=n(e);return void 0!==i&&i(t,r)?(a=e,t):(a=e,s=r)}var a,s,l=!1,u=void 0===r?null:r;return[function(){return e(t())},null===u?void 0:function(){return e(u())}]},[t,r,n,i]))[0],h[1]);return l(function(){f.hasValue=!0,f.value=d},[d]),c(d),d}},381:(e,t,r)=>{"use strict";r.r(t),r.d(t,{computeMikkTSpaceTangents:()=>i,computeMorphedAttributes:()=>p,deepCloneAttribute:()=>s,deinterleaveAttribute:()=>u,deinterleaveGeometry:()=>c,estimateBytesUsed:()=>h,interleaveAttributes:()=>l,mergeAttributes:()=>a,mergeGeometries:()=>o,mergeGroups:()=>m,mergeVertices:()=>f,toCreasedNormals:()=>g,toTrianglesDrawMode:()=>d});var n=r(1698);function i(e,t,r=!0){if(!t||!t.isReady)throw Error("BufferGeometryUtils: Initialized MikkTSpace library required.");if(!e.hasAttribute("position")||!e.hasAttribute("normal")||!e.hasAttribute("uv"))throw Error('BufferGeometryUtils: Tangents require "position", "normal", and "uv" attributes.');function o(e){if(e.normalized||e.isInterleavedBufferAttribute){let t=new Float32Array(e.count*e.itemSize);for(let r=0,n=0;r<e.count;r++)t[n++]=e.getX(r),t[n++]=e.getY(r),e.itemSize>2&&(t[n++]=e.getZ(r));return t}return e.array instanceof Float32Array?e.array:new Float32Array(e.array)}let a=e.index?e.toNonIndexed():e,s=t.generateTangents(o(a.attributes.position),o(a.attributes.normal),o(a.attributes.uv));if(r)for(let e=3;e<s.length;e+=4)s[e]*=-1;return a.setAttribute("tangent",new n.BufferAttribute(s,4)),e!==a&&e.copy(a),e}function o(e,t=!1){let r=null!==e[0].index,i=new Set(Object.keys(e[0].attributes)),s=new Set(Object.keys(e[0].morphAttributes)),l={},u={},c=e[0].morphTargetsRelative,h=new n.BufferGeometry,f=0;for(let n=0;n<e.length;++n){let o=e[n],a=0;if(r!==(null!==o.index))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+n+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(let e in o.attributes){if(!i.has(e))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+n+'. All geometries must have compatible attributes; make sure "'+e+'" attribute exists among all geometries, or in none of them.'),null;void 0===l[e]&&(l[e]=[]),l[e].push(o.attributes[e]),a++}if(a!==i.size)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+n+". Make sure all geometries have the same number of attributes."),null;if(c!==o.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+n+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(let e in o.morphAttributes){if(!s.has(e))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+n+". .morphAttributes must be consistent throughout all geometries."),null;void 0===u[e]&&(u[e]=[]),u[e].push(o.morphAttributes[e])}if(t){let e;if(r)e=o.index.count;else{if(void 0===o.attributes.position)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+n+". The geometry must have either an index or a position attribute"),null;e=o.attributes.position.count}h.addGroup(f,e,n),f+=e}}if(r){let t=0,r=[];for(let n=0;n<e.length;++n){let i=e[n].index;for(let e=0;e<i.count;++e)r.push(i.getX(e)+t);t+=e[n].attributes.position.count}h.setIndex(r)}for(let e in l){let t=a(l[e]);if(!t)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+e+" attribute."),null;h.setAttribute(e,t)}for(let e in u){let t=u[e][0].length;if(0===t)break;h.morphAttributes=h.morphAttributes||{},h.morphAttributes[e]=[];for(let r=0;r<t;++r){let t=[];for(let n=0;n<u[e].length;++n)t.push(u[e][n][r]);let n=a(t);if(!n)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+e+" morphAttribute."),null;h.morphAttributes[e].push(n)}}return h}function a(e){let t,r,i,o=-1,a=0;for(let n=0;n<e.length;++n){let s=e[n];if(void 0===t&&(t=s.array.constructor),t!==s.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(void 0===r&&(r=s.itemSize),r!==s.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(void 0===i&&(i=s.normalized),i!==s.normalized)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;if(-1===o&&(o=s.gpuType),o!==s.gpuType)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.gpuType must be consistent across matching attributes."),null;a+=s.count*r}let s=new t(a),l=new n.BufferAttribute(s,r,i),u=0;for(let t=0;t<e.length;++t){let n=e[t];if(n.isInterleavedBufferAttribute){let e=u/r;for(let t=0,i=n.count;t<i;t++)for(let i=0;i<r;i++){let r=n.getComponent(t,i);l.setComponent(t+e,i,r)}}else s.set(n.array,u);u+=n.count*r}return void 0!==o&&(l.gpuType=o),l}function s(e){return e.isInstancedInterleavedBufferAttribute||e.isInterleavedBufferAttribute?u(e):e.isInstancedBufferAttribute?new n.InstancedBufferAttribute().copy(e):new n.BufferAttribute().copy(e)}function l(e){let t,r=0,i=0;for(let n=0,o=e.length;n<o;++n){let o=e[n];
1if(void 0===t&&(t=o.array.constructor),t!==o.array.constructor)return console.error("AttributeBuffers of different types cannot be interleaved"),null;r+=o.array.length,i+=o.itemSize}let o=new n.InterleavedBuffer(new t(r),i),a=0,s=[],l=["getX","getY","getZ","getW"],u=["setX","setY","setZ","setW"];for(let t=0,r=e.length;t<r;t++){let r=e[t],i=r.itemSize,c=r.count,h=new n.InterleavedBufferAttribute(o,i,a,r.normalized);s.push(h),a+=i;for(let e=0;e<c;e++)for(let t=0;t<i;t++)h[u[t]](e,r[l[t]](e))}return s}function u(e){let t,r=e.data.array.constructor,i=e.count,o=e.itemSize,a=e.normalized,s=new r(i*o);t=e.isInstancedInterleavedBufferAttribute?new n.InstancedBufferAttribute(s,o,a,e.meshPerAttribute):new n.BufferAttribute(s,o,a);for(let r=0;r<i;r++)t.setX(r,e.getX(r)),o>=2&&t.setY(r,e.getY(r)),o>=3&&t.setZ(r,e.getZ(r)),o>=4&&t.setW(r,e.getW(r));return t}function c(e){let t=e.attributes,r=e.morphTargets,n=new Map;for(let e in t){let r=t[e];r.isInterleavedBufferAttribute&&(n.has(r)||n.set(r,u(r)),t[e]=n.get(r))}for(let e in r){let t=r[e];t.isInterleavedBufferAttribute&&(n.has(t)||n.set(t,u(t)),r[e]=n.get(t))}}function h(e){let t=0;for(let r in e.attributes){let n=e.getAttribute(r);t+=n.count*n.itemSize*n.array.BYTES_PER_ELEMENT}let r=e.getIndex();return t+(r?r.count*r.itemSize*r.array.BYTES_PER_ELEMENT:0)}function f(e,t=1e-4){t=Math.max(t,Number.EPSILON);let r={},n=e.getIndex(),i=e.getAttribute("position"),o=n?n.count:i.count,a=0,s=Object.keys(e.attributes),l={},u={},c=[],h=["getX","getY","getZ","getW"],d=["setX","setY","setZ","setW"];for(let t=0,r=s.length;t<r;t++){let r=s[t],n=e.attributes[r];l[r]=new n.constructor(new n.array.constructor(n.count*n.itemSize),n.itemSize,n.normalized);let i=e.morphAttributes[r];i&&(u[r]||(u[r]=[]),i.forEach((e,t)=>{let n=new e.array.constructor(e.count*e.itemSize);u[r][t]=new e.constructor(n,e.itemSize,e.normalized)}))}let p=.5*t,m=Math.pow(10,Math.log10(1/t)),g=p*m;for(let t=0;t<o;t++){let i=n?n.getX(t):t,o="";for(let t=0,r=s.length;t<r;t++){let r=s[t],n=e.getAttribute(r),a=n.itemSize;for(let e=0;e<a;e++)o+=`${~~(n[h[e]](i)*m+g)},`}if(o in r)c.push(r[o]);else{for(let t=0,r=s.length;t<r;t++){let r=s[t],n=e.getAttribute(r),o=e.morphAttributes[r],c=n.itemSize,f=l[r],p=u[r];for(let e=0;e<c;e++){let t=h[e],r=d[e];if(f[r](a,n[t](i)),o)for(let e=0,n=o.length;e<n;e++)p[e][r](a,o[e][t](i))}}r[o]=a,c.push(a),a++}}let v=e.clone();for(let t in e.attributes){let e=l[t];if(v.setAttribute(t,new e.constructor(e.array.slice(0,a*e.itemSize),e.itemSize,e.normalized)),t in u)for(let e=0;e<u[t].length;e++){let r=u[t][e];v.morphAttributes[t][e]=new r.constructor(r.array.slice(0,a*r.itemSize),r.itemSize,r.normalized)}}return v.setIndex(c),v}function d(e,t){if(t===n.TrianglesDrawMode)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),e;if(t!==n.TriangleFanDrawMode&&t!==n.TriangleStripDrawMode)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",t),e;{let r=e.getIndex();if(null===r){let t=[],n=e.getAttribute("position");if(void 0===n)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),e;for(let e=0;e<n.count;e++)t.push(e);e.setIndex(t),r=e.getIndex()}let i=r.count-2,o=[];if(t===n.TriangleFanDrawMode)for(let e=1;e<=i;e++)o.push(r.getX(0)),o.push(r.getX(e)),o.push(r.getX(e+1));else for(let e=0;e<i;e++)e%2==0?(o.push(r.getX(e)),o.push(r.getX(e+1)),o.push(r.getX(e+2))):(o.push(r.getX(e+2)),o.push(r.getX(e+1)),o.push(r.getX(e)));o.length/3!==i&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");let a=e.clone();return a.setIndex(o),a.clearGroups(),a}}function p(e){let t,r,i,o,a,s,l,u,c,h,f=new n.Vector3,d=new n.Vector3,p=new n.Vector3,m=new n.Vector3,g=new n.Vector3,v=new n.Vector3,y=new n.Vector3,A=new n.Vector3,_=new n.Vector3;function b(e,t,r,n,i,o,a,s){f.fromBufferAttribute(t,i),d.fromBufferAttribute(t,o),p.fromBufferAttribute(t,a);let l=e.morphTargetInfluences;if(r&&l){y.set(0,0,0),A.set(0,0,0),_.set(0,0,0);for(let e=0,t=r.length;e<t;e++){let t=l[e],s=r[e];0!==t&&(m.fromBufferAttribute(s,i),g.fromBufferAttribute(s,o),v.fromBufferAttribute(s,a),n?(y.addScaledVector(m,t),A.addScaledVector(g,t),_.addScaledVector(v,t)):(y.addScaledVector(m.sub(f),t),A.addScaledVector(g.sub(d),t),_.addScaledVector(v.sub(p),t)))}f.add(y),d.add(A),p.add(_)}e.isSkinnedMesh&&(e.applyBoneTransform(i,f),e.applyBoneTransform(o,d),e.applyBoneTransform(a,p)),s[3*i+0]=f.x,s[3*i+1]=f.y,s[3*i+2]=f.z,s[3*o+0]=d.x,s[3*o+1]=d.y,s[3*o+2]=d.z,s[3*a+0]=p.x,s[3*a+1]=p.y,s[3*a+2]=p.z}let B=e.geometry,x=e.material,C=B.index,w=B.attributes.position,E=B.morphAttributes.position,M=B.morphTargetsRelative,T=B.attributes.normal,F=B.morphAttributes.position,S=B.groups,O=B.drawRange,R=new Float32Array(w.count*w.itemSize),I=new Float32Array(T.count*T.itemSize);if(null!==C)if(Array.isArray(x))for(o=0,s=S.length;o<s;o++)for(c=Math.max((u=S[o]).start,O.start),h=Math.min(u.start+u.count,O.start+O.count),a=c,l=h;a<l;a+=3)t=C.getX(a),b(e,w,E,M,t,r=C.getX(a+1),i=C.getX(a+2),R),b(e,T,F,M,t,r,i,I);else for(c=Math.max(0,O.start),h=Math.min(C.count,O.start+O.count),o=c,s=h;o<s;o+=3)t=C.getX(o),b(e,w,E,M,t,r=C.getX(o+1),i=C.getX(o+2),R),b(e,T,F,M,t,r,i,I);else if(Array.isArray(x))for(o=0,s=S.length;o<s;o++)for(c=Math.max((u=S[o]).start,O.start),h=Math.min(u.start+u.count,O.start+O.count),a=c,l=h;a<l;a+=3)b(e,w,E,M,t=a,r=a+1,i=a+2,R),b(e,T,F,M,t,r,i,I);else for(c=Math.max(0,O.start),h=Math.min(w.count,O.start+O.count),o=c,s=h;o<s;o+=3)b(e,w,E,M,t=o,r=o+1,i=o+2,R),b(e,T,F,M,t,r,i,I);return{positionAttribute:w,normalAttribute:T,morphedPositionAttribute:new n.Float32BufferAttribute(R,3),morphedNormalAttribute:new n.Float32BufferAttribute(I,3)}}function m(e){if(0===e.groups.length)return console.warn("THREE.BufferGeometryUtils.mergeGroups(): No groups are defined. Nothing to merge."),e;let t=e.groups;if(t=t.sort((e,t)=>
1e.materialIndex!==t.materialIndex?e.materialIndex-t.materialIndex:e.start-t.start),null===e.getIndex()){let t=e.getAttribute("position"),r=[];for(let e=0;e<t.count;e+=3)r.push(e,e+1,e+2);e.setIndex(r)}let r=e.getIndex(),n=[];for(let e=0;e<t.length;e++){let i=t[e],o=i.start,a=o+i.count;for(let e=o;e<a;e++)n.push(r.getX(e))}e.dispose(),e.setIndex(n);let i=0;for(let e=0;e<t.length;e++){let r=t[e];r.start=i,i+=r.count}let o=t[0];e.groups=[o];for(let r=1;r<t.length;r++){let n=t[r];o.materialIndex===n.materialIndex?o.count+=n.count:(o=n,e.groups.push(o))}return e}function g(e,t=Math.PI/3){let r=Math.cos(t),i=(1+1e-10)*100,o=[new n.Vector3,new n.Vector3,new n.Vector3],a=new n.Vector3,s=new n.Vector3,l=new n.Vector3,u=new n.Vector3;function c(e){let t=~~(e.x*i),r=~~(e.y*i),n=~~(e.z*i);return`${t},${r},${n}`}let h=e.index?e.toNonIndexed():e,f=h.attributes.position,d={};for(let e=0,t=f.count/3;e<t;e++){let t=3*e,r=o[0].fromBufferAttribute(f,t+0),i=o[1].fromBufferAttribute(f,t+1),l=o[2].fromBufferAttribute(f,t+2);a.subVectors(l,i),s.subVectors(r,i);let u=new n.Vector3().crossVectors(a,s).normalize();for(let e=0;e<3;e++){let t=c(o[e]);t in d||(d[t]=[]),d[t].push(u)}}let p=new Float32Array(3*f.count),m=new n.BufferAttribute(p,3,!1);for(let e=0,t=f.count/3;e<t;e++){let t=3*e,n=o[0].fromBufferAttribute(f,t+0),i=o[1].fromBufferAttribute(f,t+1),h=o[2].fromBufferAttribute(f,t+2);a.subVectors(h,i),s.subVectors(n,i),l.crossVectors(a,s).normalize();for(let e=0;e<3;e++){let n=d[c(o[e])];u.set(0,0,0);for(let e=0,t=n.length;e<t;e++){let t=n[e];l.dot(t)>r&&u.add(t)}u.normalize(),m.setXYZ(t+e,u.x,u.y,u.z)}}return h.setAttribute("normal",m),h}},822:(e,t,r)=>{"use strict";r.d(t,{Hl:()=>h});var n=r(3354),i=r(23),o=r(1698);function a(e,t){let r;return(...n)=>{window.clearTimeout(r),r=window.setTimeout(()=>e(...n),t)}}let s=["x","y","top","bottom","left","right","width","height"];var l=r(2861),u=r(1087);function c({ref:e,children:t,fallback:r,resize:l,style:c,gl:h,events:f=n.f,eventSource:d,eventPrefix:p,shadows:m,linear:g,flat:v,legacy:y,orthographic:A,frameloop:_,dpr:b,performance:B,raycaster:x,camera:C,scene:w,onPointerMissed:E,onCreated:M,...T}){i.useMemo(()=>(0,n.e)(o),[]);let F=(0,n.u)(),[S,O]=function({debounce:e,scroll:t,polyfill:r,offsetSize:n}={debounce:0,scroll:!1,offsetSize:!1}){var o,l,u;let c=r||("undefined"==typeof window?class{}:window.ResizeObserver);if(!c)throw Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");let[h,f]=(0,i.useState)({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),d=(0,i.useRef)({element:null,scrollContainers:null,resizeObserver:null,lastBounds:h,orientationHandler:null}),p=e?"number"==typeof e?e:e.scroll:null,m=e?"number"==typeof e?e:e.resize:null,g=(0,i.useRef)(!1);(0,i.useEffect)(()=>(g.current=!0,()=>void(g.current=!1)));let[v,y,A]=(0,i.useMemo)(()=>{let e=()=>{let e,t;if(!d.current.element)return;let{left:r,top:i,width:o,height:a,bottom:l,right:u,x:c,y:h}=d.current.element.getBoundingClientRect(),p={left:r,top:i,width:o,height:a,bottom:l,right:u,x:c,y:h};d.current.element instanceof HTMLElement&&n&&(p.height=d.current.element.offsetHeight,p.width=d.current.element.offsetWidth),Object.freeze(p),g.current&&(e=d.current.lastBounds,t=p,!s.every(r=>e[r]===t[r]))&&f(d.current.lastBounds=p)};return[e,m?a(e,m):e,p?a(e,p):e]},[f,n,p,m]);function _(){d.current.scrollContainers&&(d.current.scrollContainers.forEach(e=>e.removeEventListener("scroll",A,!0)),d.current.scrollContainers=null),d.current.resizeObserver&&(d.current.resizeObserver.disconnect(),d.current.resizeObserver=null),d.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",d.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",d.current.orientationHandler))}function b(){d.current.element&&(d.current.resizeObserver=new c(A),d.current.resizeObserver.observe(d.current.element),t&&d.current.scrollContainers&&d.current.scrollC
1ontainers.forEach(e=>e.addEventListener("scroll",A,{capture:!0,passive:!0})),d.current.orientationHandler=()=>{A()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",d.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",d.current.orientationHandler))}return o=A,l=!!t,(0,i.useEffect)(()=>{if(l)return window.addEventListener("scroll",o,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",o,!0)},[o,l]),u=y,(0,i.useEffect)(()=>(window.addEventListener("resize",u),()=>void window.removeEventListener("resize",u)),[u]),(0,i.useEffect)(()=>{_(),b()},[t,A,y]),(0,i.useEffect)(()=>_,[]),[e=>{e&&e!==d.current.element&&(_(),d.current.element=e,d.current.scrollContainers=function e(t){let r=[];if(!t||t===document.body)return r;let{overflow:n,overflowX:i,overflowY:o}=window.getComputedStyle(t);return[n,i,o].some(e=>"auto"===e||"scroll"===e)&&r.push(t),[...r,...e(t.parentElement)]}(e),b())},h,v]}({scroll:!0,debounce:{scroll:50,resize:0},...l}),R=i.useRef(null),I=i.useRef(null);i.useImperativeHandle(e,()=>R.current);let P=(0,n.a)(E),[D,H]=i.useState(!1),[L,G]=i.useState(!1);if(D)throw D;if(L)throw L;let U=i.useRef(null);(0,n.b)(()=>{let e=R.current;O.width>0&&O.height>0&&e&&(U.current||(U.current=(0,n.c)(e)),async function(){await U.current.configure({gl:h,scene:w,events:f,shadows:m,linear:g,flat:v,legacy:y,orthographic:A,frameloop:_,dpr:b,performance:B,raycaster:x,camera:C,size:O,onPointerMissed:(...e)=>null==P.current?void 0:P.current(...e),onCreated:e=>{null==e.events.connect||e.events.connect(d?(0,n.i)(d)?d.current:d:I.current),p&&e.setEvents({compute:(e,t)=>{let r=e[p+"X"],n=e[p+"Y"];t.pointer.set(r/t.size.width*2-1,-(2*(n/t.size.height))+1),t.raycaster.setFromCamera(t.pointer,t.camera)}}),null==M||M(e)}}),U.current.render((0,u.jsx)(F,{children:(0,u.jsx)(n.E,{set:G,children:(0,u.jsx)(i.Suspense,{fallback:(0,u.jsx)(n.B,{set:H}),children:null!=t?t:null})})}))}())}),i.useEffect(()=>{let e=R.current;if(e)return()=>(0,n.d)(e)},[]);let k=d?"none":"auto";return(0,u.jsx)("div",{ref:I,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:k,...c},...T,children:(0,u.jsx)("div",{ref:S,style:{width:"100%",height:"100%"},children:(0,u.jsx)("canvas",{ref:R,style:{display:"block"},children:r})})})}function h(e){return(0,u.jsx)(l.Af,{children:(0,u.jsx)(c,{...e})})}r(7678),r(2863),r(2368)},1155:(e,t,r)=>{"use strict";r.d(t,{_c:()=>i,pb:()=>o});var n=r(1698);function i(e,t){if(t===n.TrianglesDrawMode)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),e;if(t!==n.TriangleFanDrawMode&&t!==n.TriangleStripDrawMode)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",t),e;{let r=e.getIndex();if(null===r){let t=[],n=e.getAttribute("position");if(void 0===n)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),e;for(let e=0;e<n.count;e++)t.push(e);e.setIndex(t),r=e.getIndex()}let i=r.count-2,o=[];if(r)if(t===n.TriangleFanDrawMode)for(let e=1;e<=i;e++)o.push(r.getX(0)),o.push(r.getX(e)),o.push(r.getX(e+1));else for(let e=0;e<i;e++)e%2==0?(o.push(r.getX(e)),o.push(r.getX(e+1)),o.push(r.getX(e+2))):(o.push(r.getX(e+2)),o.push(r.getX(e+1)),o.push(r.getX(e)));o.length/3!==i&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");let a=e.clone();return a.setIndex(o),a.clearGroups(),a}}function o(e,t=Math.PI/3){let r=Math.cos(t),i=(1+1e-10)*100,a=[new n.Vector3,new n.Vector3,new n.Vector3],s=new n.Vector3,l=new n.Vector3,u=new n.Vector3,c=new n.Vector3;function h(e){let t=~~(e.x*i),r=~~(e.y*i),n=~~(e.z*i);return`${t},${r},${n}`}let f=e.index?e.toNonIndexed():e,d=f.attributes.position,p={};for(let e=0,t=d.count/3;e<t;e++){let t=3*e,r=a[0].fromBufferAttribute(d,t+0),i=a[1].fromBufferAttribute(d,t+1),o=a[2].fromBufferAttribute(d,t+2);s.subVectors(o,i),l.subVectors(r,i);let u=new n.Vector3().crossVectors(s,l).normalize();for(let e=0;e<3;e++){let t=h(a[e]);t in p||(p[t]=[]),p[t].push(u)}}let m=new Float32Array(3*d.count),g=new n.BufferAttribute(m,3,!1);for(let e=0,t=d.count/3;e<t;e++){let t=3*e,n=a[0].fromBufferAttribute(d,t+0),i=a[1].fromBufferAttribute(d,t+1),o=a[2].fromBufferAttribute(d,t+2);s.subVectors(o,i),l.subVectors(n,i),u.crossVectors(s,l).normalize();for(let e=0;e<3;e++){let n=p[h(a[e])];c.set(0,0,0);for(let e=0,t=n.length;e<t;e++){let t=n[e];u.dot(t)>r&&c.add(t)}c.normalize(),g.setXYZ(t+e,c.x,c.y,c.z)}}return f.setAttribute("normal",g),f}},1708:(e,t,r)=>{"use strict";r.d(t,{ph:()=>n});
1class n{constructor(){this._partials=new Float64Array(32),this._n=0}add(e){let t=this._partials,r=0;for(let n=0;n<this._n&&n<32;n++){let i=t[n],o=e+i,a=Math.abs(e)<Math.abs(i)?e-(o-i):i-(o-e);a&&(t[r++]=a),e=o}return t[r]=e,this._n=r+1,this}valueOf(){let e=this._partials,t=this._n,r,n,i,o=0;if(t>0){for(o=e[--t];t>0&&(o=(r=o)+(n=e[--t]),!(i=n-(o-r))););t>0&&(i<0&&e[t-1]<0||i>0&&e[t-1]>0)&&(r=o+(n=2*i),n==r-o&&(o=r))}return o}}},1994:(e,t,r)=>{var n=r(72),i=r(3202),o=new n,a=r(8860);e.exports=function(e){e=e||{};var t,r,s=[],l={initAsync:function(e,n){u(e);var i=c(e);a(e,function(t,r){i.insert(r,e,0)},function(){r=e,t=i,"function"==typeof n&&n(l)},{step:3})},init:function(e){u(e),r=e,t=c(e);for(var n=0;n<e.length;n+=3)t.insert(n,r,0)},bounds:function(){return t?t.bounds:o},intersectRay:function(e,n,i,o){if(!t)return s;void 0===i&&(i=0),void 0===o&&(o=1/0),i*=i,o*=o;var a=[];return t.query(a,r,function(t){var r,i=t.half,a=(t.x-i-e.x)/n.x,s=(t.x+i-e.x)/n.x,l=(t.y+i-e.y)/n.y,u=(t.y-i-e.y)/n.y,c=(t.z-i-e.z)/n.z,h=(t.z+i-e.z)/n.z,f=Math.min(Math.min(Math.max(a,s),Math.max(l,u)),Math.max(c,h));return!(f<0)&&(r=Math.max(Math.max(Math.min(a,s),Math.min(l,u)),Math.min(c,h)))<=f&&r<=o},function(t,r,n){var a=(t-e.x)*(t-e.x)+(r-e.y)*(r-e.y)+(n-e.z)*(n-e.z);return i<=a&&a<=o}),a.sort(function(t,r){var n=e[t],i=e[t+1],o=e[t+2],a=(n-e.x)*(n-e.x)+(i-e.y)*(i-e.y)+(o-e.z)*(o-e.z),s=e[r],l=e[r+1],u=e[r+2];return a-((s-e.x)*(s-e.x)+(l-e.y)*(l-e.y)+(u-e.z)*(u-e.z))})},intersectSphere:function(e,n,i,o){if(!t)return s;var a=[],l=o*o;return t.query(a,r,function(t){var r=l,o=t.half;return e<t.x-o?r-=function(e){return e*e}(e-(t.x-o)):e>t.x+o&&(r-=function(e){return e*e}(e-(t.x+o))),n<t.y-o?r-=function(e){return e*e}(n-(t.y-o)):n>t.y+o&&(r-=function(e){return e*e}(n-(t.y+o))),i<t.z-o?r-=function(e){return e*e}(i-(t.z-o)):i>t.z+o&&(r-=function(e){return e*e}(i-(t.z+o))),r>0},function(t,r,o){return function(e){return e*e}(t-e)+function(e){return e*e}(r-n)+function(e){return e*e}(o-i)<l}),a},getRoot:function(){return t}};return l;function u(e){if(!e)throw Error("Points array is required for quadtree to work");if("number"!=typeof e.length)throw Error("Points should be array-like object");if(e.length%3!=0)throw Error("Points array should consist of series of x,y,z coordinates and be multiple of 3")}function c(e){if(0===e.length)return new i(new n);for(var t=1/0,r=1/0,o=1/0,a=-1/0,s=-1/0,l=-1/0,u=0;u<e.length;u+=3){var c=e[u],h=e[u+1],f=e[u+2];c<t&&(t=c),c>a&&(a=c),h<r&&(r=h),h>s&&(s=h),f<o&&(o=f),f>l&&(l=f)}var d=Math.max(Math.max(a-t,s-r),l-o),p=(d+=2)/2;return new i(new n((t-=1)+p,(r-=1)+p,(o-=1)+p,p))}}},2042:(e,t,r)=>{"use strict";r.d(t,{A:()=>v});var n,i,o,a,s=r(1708),l=r(2493),u=r(2047),c=r(2439),h={sphere:u.A,point:u.A,lineStart:function(){h.point=d,h.lineEnd=f},lineEnd:u.A,polygonStart:u.A,polygonEnd:u.A};function f(){h.point=h.lineEnd=u.A}function d(e,t){e*=l.F2,t*=l.F2,i=e,o=(0,l.F8)(t),a=(0,l.gn)(t),h.point=p}function p(e,t){e*=l.F2,t*=l.F2;var r=(0,l.F8)(t),s=(0,l.gn)(t),u=(0,l.tn)(e-i),c=(0,l.gn)(u),h=s*(0,l.F8)(u),f=a*r-o*s*c,d=o*r+a*s*c;n.add((0,l.FP)((0,l.RZ)(h*h+f*f),d)),i=e,o=r,a=s}var m=[null,null],g={type:"LineString",coordinates:m};function v(e,t){return m[0]=e,m[1]=t,n=new s.ph,(0,c.A)(g,h),+n}},2047:(e,t,r)=>{"use strict";function n(){}r.d(t,{A:()=>n})},2247:function(e){e.exports=function(){var e=[function(e,t,r){"use strict";var n=r(1),i=function(){function e(e,t,r){void 0===e&&(e=NaN),void 0===t&&(t=NaN),void 0===r&&(r=!1),this._minFPS=t,this._maxFPS=e,this._timeScale=1,this._currentTick=0,this._currentTime=0,this._tickDeltaTime=0,this._isRunning=!1,this._maxInterval=isNaN(this._minFPS)?NaN:1e3/this._minFPS,this._minInterval=isNaN(this._maxFPS)?NaN:1e3/this._maxFPS,this._onResume=new n.default,this._onPause=new n.default,this._onTick=new n.default,this._onTickOncePerFrame=new n.default,r||this.resume()}return e.prototype.updateOnce=function(e){e(this.currentTimeSeconds,this.tickDeltaTimeSeconds,this.currentTick)},e.prototype.resume=function(){this._isRunning||(this._isRunning=!0,this._lastTimeUpdated=this.getTimer(),this._onResume.dispatch(),this.animateO
1nce())},e.prototype.pause=function(){this._isRunning&&(this._isRunning=!1,this._onPause.dispatch(),window.cancelAnimationFrame(this._animationFrameHandle))},e.prototype.dispose=function(){this.pause(),this._onResume.removeAll(),this._onPause.removeAll(),this._onTick.removeAll()},Object.defineProperty(e.prototype,"currentTick",{get:function(){return this._currentTick},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentTimeSeconds",{get:function(){return this._currentTime/1e3},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tickDeltaTimeSeconds",{get:function(){return this._tickDeltaTime/1e3},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"timeScale",{get:function(){return this._timeScale},set:function(e){this._timeScale!==e&&(this._timeScale=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onResume",{get:function(){return this._onResume},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onPause",{get:function(){return this._onPause},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onTick",{get:function(){return this._onTick},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onTickOncePerFrame",{get:function(){return this._onTickOncePerFrame},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isRunning",{get:function(){return this._isRunning},enumerable:!0,configurable:!0}),e.prototype.animateOnce=function(){var e=this;this._animationFrameHandle=window.requestAnimationFrame(function(){return e.onFrame()})},e.prototype.onFrame=function(){if(this._now=this.getTimer(),this._frameDeltaTime=this._now-this._lastTimeUpdated,isNaN(this._minInterval)||this._frameDeltaTime>=this._minInterval)if(isNaN(this._maxInterval))this.update(this._frameDeltaTime*this._timeScale,!0),this._lastTimeUpdated=this._now;else for(this._interval=Math.min(this._frameDeltaTime,this._maxInterval);this._now>=this._lastTimeUpdated+this._interval;)this.update(this._interval*this._timeScale,this._now<=this._lastTimeUpdated+2*this._maxInterval),this._lastTimeUpdated+=this._interval;this._isRunning&&this.animateOnce()},e.prototype.update=function(e,t){void 0===t&&(t=!0),this._currentTick++,this._currentTime+=e,this._tickDeltaTime=e,this._onTick.dispatch(this.currentTimeSeconds,this.tickDeltaTimeSeconds,this.currentTick),t&&this._onTickOncePerFrame.dispatch(this.currentTimeSeconds,this.tickDeltaTimeSeconds,this.currentTick)},e.prototype.getTimer=function(){return Date.now()},e}();Object.defineProperty(t,"__esModule",{value:!0}),t.default=i},function(e,t,r){e.exports=function(){var e=[function(e,t){"use strict";var r=function(){function e(){this.functions=[]}return e.prototype.add=function(e){return -1===this.functions.indexOf(e)&&(this.functions.push(e),!0)},e.prototype.remove=function(e){var t=this.functions.indexOf(e);return t>-1&&(this.functions.splice(t,1),!0)},e.prototype.removeAll=function(){return this.functions.length>0&&(this.functions.length=0,!0)},e.prototype.dispatch=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.functions.concat().forEach(function(t){t.apply(void 0,e)})},Object.defineProperty(e.prototype,"numItems",{get:function(){return this.functions.length},enumerable:!0,configurable:!0}),e}();Object.defineProperty(t,"__esModule",{value:!0}),t.default=r}];function t(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return e[n].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}()}];function t(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return e[n].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}()},2363:(e,t,r)=>{"use strict";r.d(t,{$:()=>a,A:()=>o});var n=r(7831),i=r(5880);function o(e,t){return((0,i.p)(t)?i.A:a)(e,t)}function a(e,t){var r,i=t?t.length:0,o=e?Math.min(i,e.length):0,a=Array(o),s=Array(i);for(r=0;r<o;++r)a[r]=(0,n.A)(e[r],t[r]);for(;r<i;++r)s[r]=t[r];return function(e){for(r=0;r<o;++r)s[r]=a[r](e);return s}}},2368:(e,t,r)=>{"use strict";e.exports=r(3909)},2439:(e,t,r)=>{"use strict";function n(e,t){e&&o.hasOwnProperty(e.type)&&o[e.type](e,t)}r.d(t,{A:()=>l});var i={Feature:function(e,t){n(e.geometry,t)},FeatureCollection:function(e,t){for(var r=e.features,i=-1,o=r.length;++i<o;)n(r[i].geometry,t)}},o={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var r=e.coordinates,n=-1,i=r.length;++n<i;)e=r[n],t.point(e[0],e[1],e[2])},LineString:function(e,t){a(e.coordinates,t,0)},MultiLineString:function(e,t){for(var r=e.coordinates,n=-1,i=r.length;++n<i;)a(r[n],t,0)},Polygon:function(e,t){s(e.coordinates,t)},MultiPolygon:function(e,t){for(var r=e.coordinates,n=-1,i=r.length;++n<i;)s(r[n],t)},GeometryCollection:function(e,t){for(var r=e.geometries,i=-1,o=r.length;++i<o;)n(r[i],t)}};function a(e,t,r){var n,i=-1,o=e.length-r;for(t.lineStart();++i<o;)n=e[i],t.point(n[0],n[1],n[2]);t.lineEnd()}function s(e,t){var r=-1,n=e.length;for(t.polygonStart();++r<n;)a(e[r],t,1);t.polygonEnd()}function l(e,t){e&&i.hasOwnProperty(e.type)?i[e.type](e,t):n(e,t)}},2493:(e,t,r)=>{"use strict";r.d(t,{$t:()=>i,F2:()=>c,F8:()=>v,FA:()=>l,FP:()=>d,HQ:()=>_,Ni:()=>n,RZ:()=>A,TW:()=>a,_S:()=>y,bo:()=>B,dY:()=>g,gn:()=>p,gz:()=>s,mk:()=>m,pi:()=>o,qR:()=>b,rY:()=>f,tn:()=>h,uj:()=>u});
1var n=1e-6,i=1e-12,o=Math.PI,a=o/2,s=o/4,l=2*o,u=180/o,c=o/180,h=Math.abs,f=Math.atan,d=Math.atan2,p=Math.cos,m=Math.ceil,g=Math.hypot,v=Math.sin,y=Math.sign||function(e){return e>0?1:e<0?-1:0},A=Math.sqrt;function _(e){return e>1?0:e<-1?o:Math.acos(e)}function b(e){return e>1?a:e<-1?-a:Math.asin(e)}function B(e){return(e=v(e/2))*e}},2575:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var n=r(2623),i=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,o=RegExp(i.source,"g");function a(e,t){var r,a,s,l,u,c=i.lastIndex=o.lastIndex=0,h=-1,f=[],d=[];for(e+="",t+="";(s=i.exec(e))&&(l=o.exec(t));)(u=l.index)>c&&(u=t.slice(c,u),f[h]?f[h]+=u:f[++h]=u),(s=s[0])===(l=l[0])?f[h]?f[h]+=l:f[++h]=l:(f[++h]=null,d.push({i:h,x:(0,n.A)(s,l)})),c=o.lastIndex;return c<t.length&&(u=t.slice(c),f[h]?f[h]+=u:f[++h]=u),f.length<2?d[0]?(r=d[0].x,function(e){return r(e)+""}):(a=t,function(){return a}):(t=d.length,function(e){for(var r,n=0;n<t;++n)f[(r=d[n]).i]=r.x(e);return f.join("")})}},2613:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}r.d(t,{A:()=>a});var i=/^\s+/,o=/\s+$/;function a(e,t){if(t=t||{},(e=e||"")instanceof a)return e;if(!(this instanceof a))return new a(e,t);var r,s,l,u,c,h,f,d,p,m,g,v,y,A,_,b,B,C,M,F,O=(s={r:0,g:0,b:0},l=1,u=null,c=null,h=null,f=!1,d=!1,"string"==typeof(r=e)&&(r=function(e){e=e.replace(i,"").replace(o,"").toLowerCase();var t,r=!1;if(x[e])e=x[e],r=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};return(t=R.rgb.exec(e))?{r:t[1],g:t[2],b:t[3]}:(t=R.rgba.exec(e))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=R.hsl.exec(e))?{h:t[1],s:t[2],l:t[3]}:(t=R.hsla.exec(e))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=R.hsv.exec(e))?{h:t[1],s:t[2],v:t[3]}:(t=R.hsva.exec(e))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=R.hex8.exec(e))?{r:T(t[1]),g:T(t[2]),b:T(t[3]),a:T(t[4])/255,format:r?"name":"hex8"}:(t=R.hex6.exec(e))?{r:T(t[1]),g:T(t[2]),b:T(t[3]),format:r?"name":"hex"}:(t=R.hex4.exec(e))?{r:T(t[1]+""+t[1]),g:T(t[2]+""+t[2]),b:T(t[3]+""+t[3]),a:T(t[4]+""+t[4])/255,format:r?"name":"hex8"}:!!(t=R.hex3.exec(e))&&{r:T(t[1]+""+t[1]),g:T(t[2]+""+t[2]),b:T(t[3]+""+t[3]),format:r?"name":"hex"}}(r)),"object"==n(r)&&(I(r.r)&&I(r.g)&&I(r.b)?(p=r.r,m=r.g,g=r.b,s={r:255*E(p,255),g:255*E(m,255),b:255*E(g,255)},f=!0,d="%"===String(r.r).substr(-1)?"prgb":"rgb"):I(r.h)&&I(r.s)&&I(r.v)?(u=S(r.s),c=S(r.v),v=r.h,y=u,A=c,v=6*E(v,360),y=E(y,100),A=E(A,100),_=Math.floor(v),b=v-_,B=A*(1-y),C=A*(1-b*y),M=A*(1-(1-b)*y),s={r:255*[A,C,B,B,M,A][F=_%6],g:255*[M,A,A,C,B,B][F],b:255*[B,B,M,A,A,C][F]},f=!0,d="hsv"):I(r.h)&&I(r.s)&&I(r.l)&&(u=S(r.s),h=S(r.l),s=function(e,t,r){var n,i,o;function a(e,t,r){return(r<0&&(r+=1),r>1&&(r-=1),r<1/6)?e+(t-e)*6*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}if(e=E(e,360),t=E(t,100),r=E(r,100),0===t)n=i=o=r;else{var s=r<.5?r*(1+t):r+t-r*t,l=2*r-s;n=a(l,s,e+1/3),i=a(l,s,e),o=a(l,s,e-1/3)}return{r:255*n,g:255*i,b:255*o}}(r.h,u,h),f=!0,d="hsl"),r.hasOwnProperty("a")&&(l=r.a)),l=w(l),{ok:f,format:r.format||d,r:Math.min(255,Math.max(s.r,0)),g:Math.min(255,Math.max(s.g,0)),b:Math.min(255,Math.max(s.b,0)),a:l});this._originalInput=e,this._r=O.r,this._g=O.g,this._b=O.b,this._a=O.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||O.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=O.ok}function s(e,t,r){e=E(e,255);var n,i,o=Math.max(e,t=E(t,255),r=E(r,255)),a=Math.min(e,t,r),s=(o+a)/2;if(o==a)n=i=0;else{var l=o-a;switch(i=s>.5?l/(2-o-a):l/(o+a),o){case e:n=(t-r)/l+6*(t<r);break;case t:n=(r-e)/l+2;break;case r:n=(e-t)/l+4}n/=6}return{h:n,s:i,l:s}}function l(e,t,r){e=E(e,255);var n,i=Math.max(e,t=E(t,255),r=E(r,255)),o=Math.min(e,t,r),a=i-o;if(i==o)n=0;else{switch(i){case e:n=(t-r)/a+6*(t<r);break;case t:n=(r-e)/a+2;break;case r:n=(e-t)/a+4}n/=6}return{h:n,s:0===i?0:a/i,v:i}}function u(e,t,r,n){var i=[F(Math.round(e).toString(16)),F(Math.round(t).toString(16)),F(Math.round(r).toString(16))];return n&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function c(e,t,r,n){return[F(O(n)),F(Math.round(e).toString(16)),F(Math.round(t).toString(16)),F(Math.round(r).toString(16))].join("")}function h(e,t){t=0===t?0:t||10;var r=a(e).toHsl();return r.s-=t/100,r.s=M(r.s),a(r)}function f(e,t){t=0===t?0:t||10;var r=a(e).toHsl();return r.s+=t/100,r.s=M(r.s),a(r)}function d(e){return a(e).desaturate(100)}function p(e,t){t=0===t?0:t||10;var r=a(e).toHsl();return r.l+=t/100,r.l=M(r.l),a(r)}
1function m(e,t){t=0===t?0:t||10;var r=a(e).toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(-(t/100*255)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(-(t/100*255)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(-(t/100*255)))),a(r)}function g(e,t){t=0===t?0:t||10;var r=a(e).toHsl();return r.l-=t/100,r.l=M(r.l),a(r)}function v(e,t){var r=a(e).toHsl(),n=(r.h+t)%360;return r.h=n<0?360+n:n,a(r)}function y(e){var t=a(e).toHsl();return t.h=(t.h+180)%360,a(t)}function A(e,t){if(isNaN(t)||t<=0)throw Error("Argument to polyad must be a positive number");for(var r=a(e).toHsl(),n=[a(e)],i=360/t,o=1;o<t;o++)n.push(a({h:(r.h+o*i)%360,s:r.s,l:r.l}));return n}function _(e){var t=a(e).toHsl(),r=t.h;return[a(e),a({h:(r+72)%360,s:t.s,l:t.l}),a({h:(r+216)%360,s:t.s,l:t.l})]}function b(e,t,r){t=t||6,r=r||30;var n=a(e).toHsl(),i=360/r,o=[a(e)];for(n.h=(n.h-(i*t>>1)+720)%360;--t;)n.h=(n.h+i)%360,o.push(a(n));return o}function B(e,t){t=t||6;for(var r=a(e).toHsv(),n=r.h,i=r.s,o=r.v,s=[],l=1/t;t--;)s.push(a({h:n,s:i,v:o})),o=(o+l)%1;return s}a.prototype={isDark:function(){return 128>this.getBrightness()},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,t,r,n=this.toRgb();return e=n.r/255,t=n.g/255,.2126*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.0722*((r=n.b/255)<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))},setAlpha:function(e){return this._a=w(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=l(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=l(this._r,this._g,this._b),t=Math.round(360*e.h),r=Math.round(100*e.s),n=Math.round(100*e.v);return 1==this._a?"hsv("+t+", "+r+"%, "+n+"%)":"hsva("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var e=s(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=s(this._r,this._g,this._b),t=Math.round(360*e.h),r=Math.round(100*e.s),n=Math.round(100*e.l);return 1==this._a?"hsl("+t+", "+r+"%, "+n+"%)":"hsla("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(e){return u(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){var t,r,n,i,o,a;return t=this._r,r=this._g,n=this._b,i=this._a,o=e,a=[F(Math.round(t).toString(16)),F(Math.round(r).toString(16)),F(Math.round(n).toString(16)),F(O(i))],o&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join("")},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*E(this._r,255))+"%",g:Math.round(100*E(this._g,255))+"%",b:Math.round(100*E(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*E(this._r,255))+"%, "+Math.round(100*E(this._g,255))+"%, "+Math.round(100*E(this._b,255))+"%)":"rgba("+Math.round(100*E(this._r,255))+"%, "+Math.round(100*E(this._g,255))+"%, "+Math.round(100*E(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(C[u(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+c(this._r,this._g,this._b,this._a),r=t,n=this._gradientType?"GradientType = 1, ":"";if(e){var i=a(e);r="#"+c(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,n=this._a<1&&this._a>=0;return!t&&n&&("hex"===e||"hex6"===e||"hex3"===e||"hex4"===e||"hex8"===e||"name"===e)?"name"===e&&0===this._a?this.toName():this.toRgbString():("rgb"===e&&(r=this.toRgbString()),"prgb"===e&&(r=this.toPercentageRgbString()),("hex"===e||"hex6"===e)&&(r=this.toHexString()),"hex3"===e&&(r=this.toHexString(!0)),"hex4"===e&&(r=this.toHex8String(!0)),"hex8"===e&&(r=this.toHex8String()),"name"===e&&(r=this.toName()),"hsl"===e&&(r=this.toHslString()),"hsv"===e&&(r=this.toHsvString()),r||this.toHexString())},clone:function(){return a(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(p,arguments)},brighten:function(){return this._applyModification(m,arguments)},darken:function(){return this._applyModification(g,arguments)},desaturate:function(){return this._applyModification(h,arguments)},saturate:function(){return this._applyModification(f,arguments)},greyscale:function(){return this._applyModification(d,arguments)},spin:function(){return this._applyModification(v,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(b,arguments)},complement:function(){return this._applyCombination(y,arguments)},monochromatic:function(){return this._applyCombination(B,arguments)},splitcomplement:function(){return this._applyCombination(_,arguments)},triad:function(){return this._applyCombination(A,[3])},tetrad:function(){return this._applyCombination(A,[4])}},a.fromRatio=function(e,t){if("object"==n(e)){var r={};for(var i in e)e.hasOwnProperty(i)&&("a"===i?r[i]=e[i]:r[i]=S(e[i]));e=r}return a(e,t)},a.equals=function(e,t){return!!e&&!!t&&a(e).toRgbString()==a(t).toRgbString()},a.random=function(){return a.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},a.mix=function(e,t,r){r=0===r?0:r||50;var n=a(e).toRgb(),i=a(t).toRgb(),o=r/100;return a({r:(i.r-n.r)*o+n.r,g:(i.g-n.g)*o+n.g,b:(i.b-n.b)*o+n.b,a:(i.a-n.a)
1*o+n.a})},a.readability=function(e,t){var r=a(e),n=a(t);return(Math.max(r.getLuminance(),n.getLuminance())+.05)/(Math.min(r.getLuminance(),n.getLuminance())+.05)},a.isReadable=function(e,t,r){var n,i,o,s,l,u=a.readability(e,t);switch(l=!1,(i=((n=(n=r)||{level:"AA",size:"small"}).level||"AA").toUpperCase(),o=(n.size||"small").toLowerCase(),"AA"!==i&&"AAA"!==i&&(i="AA"),"small"!==o&&"large"!==o&&(o="small"),s={level:i,size:o}).level+s.size){case"AAsmall":case"AAAlarge":l=u>=4.5;break;case"AAlarge":l=u>=3;break;case"AAAsmall":l=u>=7}return l},a.mostReadable=function(e,t,r){var n,i,o,s,l=null,u=0;i=(r=r||{}).includeFallbackColors,o=r.level,s=r.size;for(var c=0;c<t.length;c++)(n=a.readability(e,t[c]))>u&&(u=n,l=a(t[c]));return a.isReadable(e,l,{level:o,size:s})||!i?l:(r.includeFallbackColors=!1,a.mostReadable(e,["#fff","#000"],r))};var x=a.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee9
10",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},C=a.hexNames=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}(x);function w(e){return(isNaN(e=parseFloat(e))||e<0||e>1)&&(e=1),e}function E(e,t){"string"==typeof(r=e)&&-1!=r.indexOf(".")&&1===parseFloat(r)&&(e="100%");var r,n,i="string"==typeof(n=e)&&-1!=n.indexOf("%");return(e=Math.min(t,Math.max(0,parseFloat(e))),i&&(e=parseInt(e*t,10)/100),1e-6>Math.abs(e-t))?1:e%t/parseFloat(t)}function M(e){return Math.min(1,Math.max(0,e))}function T(e){return parseInt(e,16)}function F(e){return 1==e.length?"0"+e:""+e}function S(e){return e<=1&&(e=100*e+"%"),e}function O(e){return Math.round(255*parseFloat(e)).toString(16)}var R=function(){var e="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",t="[\\s|\\(]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")\\s*\\)?",r="[\\s|\\(]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")\\s*\\)?";return{CSS_UNIT:new RegExp(e),rgb:RegExp("rgb"+t),rgba:RegExp("rgba"+r),hsl:RegExp("hsl"+t),hsla:RegExp("hsla"+r),hsv:RegExp("hsv"+t),hsva:RegExp("hsva"
1+r),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function I(e){return!!R.CSS_UNIT.exec(e)}},2623:(e,t,r)=>{"use strict";function n(e,t){return e*=1,t*=1,function(r){return e*(1-r)+t*r}}r.d(t,{A:()=>n})},2658:(e,t,r)=>{"use strict";let n;r.d(t,{OH:()=>eu});var i=r(7656),o=r(23),a=r(3354),s=r(1698);class l extends s.Mesh{constructor(e,t){var r,n;let i=(e=>e&&e.isCubeTexture)(e),o=Math.floor(Math.log2((null!=(n=i?null==(r=e.image[0])?void 0:r.width:e.image.width)?n:1024)/4)),a=Math.pow(2,o),l=3*Math.max(a,112),u=` 2 varying vec3 vWorldPosition; 3 void main() 4 { 5 vec4 worldPosition = ( modelMatrix * vec4( position, 1.0 ) ); 6 vWorldPosition = worldPosition.xyz; 7 8 gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); 9 } 10 `,c=[i?"#define ENVMAP_TYPE_CUBE":"",`#define CUBEUV_TEXEL_WIDTH ${1/l}`,`#define CUBEUV_TEXEL_HEIGHT ${1/(4*a)}`,`#define CUBEUV_MAX_MIP ${o}.0`].join("\n")+` 11 #define ENVMAP_TYPE_CUBE_UV 12 varying vec3 vWorldPosition; 13 uniform float radius; 14 uniform float height; 15 uniform float angle; 16 #ifdef ENVMAP_TYPE_CUBE 17 uniform samplerCube map; 18 #else 19 uniform sampler2D map; 20 #endif 21 // From: https://www.shadertoy.com/view/4tsBD7 22 float diskIntersectWithBackFaceCulling( vec3 ro, vec3 rd, vec3 c, vec3 n, float r ) 23 { 24 float d = dot ( rd, n ); 25 26 if( d > 0.0 ) { return 1e6; } 27 28 vec3 o = ro - c; 29 float t = - dot( n, o ) / d; 30 vec3 q = o + rd * t; 31 32 return ( dot( q, q ) < r * r ) ? t : 1e6; 33 } 34 // From: https://www.iquilezles.org/www/articles/intersectors/intersectors.htm 35 float sphereIntersect( vec3 ro, vec3 rd, vec3 ce, float ra ) 36 { 37 vec3 oc = ro - ce; 38 float b = dot( oc, rd ); 39 float c = dot( oc, oc ) - ra * ra; 40 float h = b * b - c; 41 42 if( h < 0.0 ) { return -1.0; } 43 44 h = sqrt( h ); 45 46 return - b + h; 47 } 48 vec3 project() 49 { 50 vec3 p = normalize( vWorldPosition ); 51 vec3 camPos = cameraPosition; 52 camPos.y -= height; 53 float intersection = sphereIntersect( camPos, p, vec3( 0.0 ), radius ); 54 if( intersection > 0.0 ) { 55 56 vec3 h = vec3( 0.0, - height, 0.0 ); 57 float intersection2 = diskIntersectWithBackFaceCulling( camPos, p, h, vec3( 0.0, 1.0, 0.0 ), radius ); 58 p = ( camPos + min( intersection, intersection2 ) * p ) / radius; 59 } else { 60 p = vec3( 0.0, 1.0, 0.0 ); 61 } 62 return p; 63 } 64 #include <common> 65 #include <cube_uv_reflection_fragment> 66 void main() 67 { 68 vec3 projectedWorldPosition = project(); 69 70 #ifdef ENVMAP_TYPE_CUBE 71 vec3 outcolor = textureCube( map, projectedWorldPosition ).rgb; 72 #else 73 vec3 direction = normalize( projectedWorldPosition ); 74 vec2 uv = equirectUv( direction ); 75 vec3 outcolor = texture2D( map, uv ).rgb; 76 #endif 77 gl_FragColor = vec4( outcolor, 1.0 ); 78 #include <tonemapping_fragment> 79 #include <${parseInt(s.REVISION.replace(/\D+/g,""))>=154?"colorspace_fragment":"encodings_fragment"}> 80 } 81 `,h={map:{value:e},height:{value:(null==t?void 0:t.height)||15},radius:{value:(null==t?void 0:t.radius)||100}};super(new s.IcosahedronGeometry(1,16),new s.ShaderMaterial({uniforms:h,fragmentShader:c,vertexShader:u,side:s.DoubleSide}))}set radius(e){this.material.uniforms.radius.value=e}get radius(){return this.material.uniforms.radius.value}set height(e){this.material.uniforms.height.value=e}get height(){return this.material.uniforms.height.value}}class u extends s.DataTextureLoader{constructor(e){super(e),this.type=s.HalfFloatType}parse(e){let t,r,n,i=function(e,t){switch(e){case 1:throw Error("THREE.RGBELoader: Read Error: "+(t||""));case 2:throw Error("THREE.RGBELoader: Write Error: "+(t||""));case 3:throw Error("THREE.RGBELoader: Bad File Format: "+(t||""));default:throw Error("THREE.RGBELoader: Memory Error: "+(t||""))}},o=function(e,t,r){t=t||1024;let n=e.pos,i=-1,o=0,a="",s=String.fromCharCode.apply(null,new Uint16Array(e.subarray(n,n+128)));for(;0>(i=s.indexOf("\n"))&&o<t&&n<e.byteLength;)a+=s,o+=s.length,n+=128,s+=String.fromCharCode.apply(null,new Uint16Array(e.subarray(n,n+128)));return -1<i&&(!1!==r&&(e.pos+=o+i+1),a+s.slice(0,i))},a=new Uint8Array(e);a.pos=0;let l=function(e){let t,r,n=/^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/,a=/^\s*EXPOSURE\s*=\s
81*(\d+(\.\d+)?)\s*$/,s=/^\s*FORMAT=(\S+)\s*$/,l=/^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/,u={valid:0,string:"",comments:"",programtype:"RGBE",format:"",gamma:1,exposure:1,width:0,height:0};for(!(e.pos>=e.byteLength)&&(t=o(e))||i(1,"no header found"),(r=t.match(/^#\?(\S+)/))||i(3,"bad initial token"),u.valid|=1,u.programtype=r[1],u.string+=t+"\n";!1!==(t=o(e));){if(u.string+=t+"\n","#"===t.charAt(0)){u.comments+=t+"\n";continue}if((r=t.match(n))&&(u.gamma=parseFloat(r[1])),(r=t.match(a))&&(u.exposure=parseFloat(r[1])),(r=t.match(s))&&(u.valid|=2,u.format=r[1]),(r=t.match(l))&&(u.valid|=4,u.height=parseInt(r[1],10),u.width=parseInt(r[2],10)),2&u.valid&&4&u.valid)break}return 2&u.valid||i(3,"missing format specifier"),4&u.valid||i(3,"missing image size specifier"),u}(a),u=l.width,c=l.height,h=function(e,t,r){if(t<8||t>32767||2!==e[0]||2!==e[1]||128&e[2])return new Uint8Array(e);t!==(e[2]<<8|e[3])&&i(3,"wrong scanline width");let n=new Uint8Array(4*t*r);n.length||i(4,"unable to allocate buffer space");let o=0,a=0,s=4*t,l=new Uint8Array(4),u=new Uint8Array(s),c=r;for(;c>0&&a<e.byteLength;){a+4>e.byteLength&&i(1),l[0]=e[a++],l[1]=e[a++],l[2]=e[a++],l[3]=e[a++],(2!=l[0]||2!=l[1]||(l[2]<<8|l[3])!=t)&&i(3,"bad rgbe scanline format");let r=0,h;for(;r<s&&a<e.byteLength;){let t=(h=e[a++])>128;if(t&&(h-=128),(0===h||r+h>s)&&i(3,"bad scanline data"),t){let t=e[a++];for(let e=0;e<h;e++)u[r++]=t}else u.set(e.subarray(a,a+h),r),r+=h,a+=h}for(let e=0;e<t;e++){let r=0;n[o]=u[e+r],r+=t,n[o+1]=u[e+r],r+=t,n[o+2]=u[e+r],r+=t,n[o+3]=u[e+r],o+=4}c--}return n}(a.subarray(a.pos),u,c);switch(this.type){case s.FloatType:let f=new Float32Array(4*(n=h.length/4));for(let e=0;e<n;e++)!function(e,t,r,n){let i=Math.pow(2,e[t+3]-128)/255;r[n+0]=e[t+0]*i,r[n+1]=e[t+1]*i,r[n+2]=e[t+2]*i,r[n+3]=1}(h,4*e,f,4*e);t=f,r=s.FloatType;break;case s.HalfFloatType:let d=new Uint16Array(4*(n=h.length/4));for(let e=0;e<n;e++)!function(e,t,r,n){let i=Math.pow(2,e[t+3]-128)/255;r[n+0]=s.DataUtils.toHalfFloat(Math.min(e[t+0]*i,65504)),r[n+1]=s.DataUtils.toHalfFloat(Math.min(e[t+1]*i,65504)),r[n+2]=s.DataUtils.toHalfFloat(Math.min(e[t+2]*i,65504)),r[n+3]=s.DataUtils.toHalfFloat(1)}(h,4*e,d,4*e);t=d,r=s.HalfFloatType;break;default:throw Error("THREE.RGBELoader: Unsupported type: "+this.type)}return{width:u,height:c,data:t,header:l.string,gamma:l.gamma,exposure:l.exposure,type:r}}setDataType(e){return this.type=e,this}load(e,t,r,n){return super.load(e,function(e,r){switch(e.type){case s.FloatType:case s.HalfFloatType:"colorSpace"in e?e.colorSpace="srgb-linear":e.encoding=3e3,e.minFilter=s.LinearFilter,e.magFilter=s.LinearFilter,e.generateMipmaps=!1,e.flipY=!0}t&&t(e,r)},r,n)}}var c=Uint8Array,h=Uint16Array,f=Uint32Array,d=new c([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),p=new c([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),m=new c([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),g=function(e,t){for(var r=new h(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];for(var i=new f(r[30]),n=1;n<30;++n)for(var o=r[n];o<r[n+1];++o)i[o]=o-r[n]<<5|n;return[r,i]},v=g(d,2),y=v[0],A=v[1];y[28]=258,A[258]=28;var _=g(p,0),b=_[0];_[1];for(var B=new h(32768),x=0;x<32768;++x){var C=(43690&x)>>>1|(21845&x)<<1;C=(61680&(C=(52428&C)>>>2|(13107&C)<<2))>>>4|(3855&C)<<4,B[x]=((65280&C)>>>8|(255&C)<<8)>>>1}for(var w=function(e,t,r){for(var n,i=e.length,o=0,a=new h(t);o<i;++o)++a[e[o]-1];var s=new h(t);for(o=0;o<t;
81++o)s[o]=s[o-1]+a[o-1]<<1;if(r){n=new h(1<<t);var l=15-t;for(o=0;o<i;++o)if(e[o])for(var u=o<<4|e[o],c=t-e[o],f=s[e[o]-1]++<<c,d=f|(1<<c)-1;f<=d;++f)n[B[f]>>>l]=u}else for(o=0,n=new h(i);o<i;++o)e[o]&&(n[o]=B[s[e[o]-1]++]>>>15-e[o]);return n},E=new c(288),x=0;x<144;++x)E[x]=8;for(var x=144;x<256;++x)E[x]=9;for(var x=256;x<280;++x)E[x]=7;for(var x=280;x<288;++x)E[x]=8;for(var M=new c(32),x=0;x<32;++x)M[x]=5;var T=w(E,9,1),F=w(M,5,1),S=function(e){for(var t=e[0],r=1;r<e.length;++r)e[r]>t&&(t=e[r]);return t},O=function(e,t,r){var n=t/8|0;return(e[n]|e[n+1]<<8)>>(7&t)&r},R=function(e,t){var r=t/8|0;return(e[r]|e[r+1]<<8|e[r+2]<<16)>>(7&t)},I=function(e,t,r){(null==t||t<0)&&(t=0),(null==r||r>e.length)&&(r=e.length);var n=new(e instanceof h?h:e instanceof f?f:c)(r-t);return n.set(e.subarray(t,r)),n},P=function(e,t,r){var n=e.length;if(!n||r&&!r.l&&n<5)return t||new c(0);var i=!t||r,o=!r||r.i;r||(r={}),t||(t=new c(3*n));var a=function(e){var r=t.length;if(e>r){var n=new c(Math.max(2*r,e));n.set(t),t=n}},s=r.f||0,l=r.p||0,u=r.b||0,h=r.l,f=r.d,g=r.m,v=r.n,A=8*n;do{if(!h){r.f=s=O(e,l,1);var _=O(e,l+1,3);if(l+=3,_)if(1==_)h=T,f=F,g=9,v=5;
81else if(2==_){var B=O(e,l,31)+257,x=O(e,l+10,15)+4,C=B+O(e,l+5,31)+1;l+=14;for(var E=new c(C),M=new c(19),P=0;P<x;++P)M[m[P]]=O(e,l+3*P,7);l+=3*x;for(var D=S(M),H=(1<<D)-1,L=w(M,D,1),P=0;P<C;){var G=L[O(e,l,H)];l+=15&G;var U=G>>>4;if(U<16)E[P++]=U;else{var k=0,N=0;for(16==U?(N=3+O(e,l,3),l+=2,k=E[P-1]):17==U?(N=3+O(e,l,7),l+=3):18==U&&(N=11+O(e,l,127),l+=7);N--;)E[P++]=k}}var j=E.subarray(0,B),J=E.subarray(B);g=S(j),v=S(J),h=w(j,g,1),f=w(J,v,1)}else throw"invalid block type";else{var z,U=((z=l)/8|0)+(7&z&&1)+4,K=e[U-4]|e[U-3]<<8,V=U+K;if(V>n){if(o)throw"unexpected EOF";break}i&&a(u+K),t.set(e.subarray(U,V),u),r.b=u+=K,r.p=l=8*V;continue}if(l>A){if(o)throw"unexpected EOF";break}}i&&a(u+131072);for(var Q=(1<<g)-1,X=(1<<v)-1,Y=l;;Y=l){var k=h[R(e,l)&Q],Z=k>>>4;if((l+=15&k)>A){if(o)throw"unexpected EOF";break}if(!k)throw"invalid length/literal";if(Z<256)t[u++]=Z;else if(256==Z){Y=l,h=null;break}else{var q=Z-254;if(Z>264){var P=Z-257,W=d[P];q=O(e,l,(1<<W)-1)+y[P],l+=W}var $=f[R(e,l)&X],ee=$>>>4;if(!$)throw"invalid distance";l+=15&$;var J=b[ee];if(ee>3){var W=p[ee];J+=R(e,l)&(1<<W)-1,l+=W}if(l>A){if(o)throw"unexpected EOF";break}i&&a(u+131072);for(var et=u+q;u<et;u+=4)t[u]=t[u-J],t[u+1]=t[u+1-J],t[u+2]=t[u+2-J],t[u+3]=t[u+3-J];u=et}}r.l=h,r.p=Y,r.b=u,h&&(s=1,r.m=g,r.d=f,r.n=v)}while(!s);return u==t.length?t:I(t,0,u)},D=new c(0),H=function(e){if((15&e[0])!=8||e[0]>>>4>7||(e[0]<<8|e[1])%31)throw"invalid zlib data";if(32&e[1])throw"invalid zlib data: preset dictionaries not supported"};function L(e,t){return P((H(e),e.subarray(2,-4)),t)}var G="undefined"!=typeof TextDecoder&&new TextDecoder;try{G.decode(D,{stream:!0})}catch(e){}let U="colorSpace"in new s.Texture;class k extends s.DataTextureLoader{constructor(e){super(e),this.type=s.HalfFloatType}parse(e){let t={l:0,c:0,lc:0};function r(e,r,n,i,o){for(;n<e;)r=r<<8|E(i,o),n+=8;t.l=r>>(n-=e)&(1<<e)-1,t.c=r,t.lc=n}let n=Array(59),i={c:0,lc:0};function o(e,t,r,n){e=e<<8|E(r,n),t+=8,i.c=e,i.lc=t}let a={c:0,lc:0};function l(e,t,r,n,s,l,u,c,h,f){if(e==t){n<8&&(o(r,n,s,u),r=i.c,n=i.lc);var d=r>>(n-=8),d=new Uint8Array([d])[0];if(h.value+d>f)return!1;for(var p=c[h.value-1];d-- >0;)c[h.value++]=p}else{if(!(h.value<f))return!1;c[h.value++]=e}a.c=r,a.lc=n}function u(e){var t=65535&e;return t>32767?t-65536:t}let c={a:0,b:0};function h(e,t){var r=u(e),n=u(t),i=r+(1&n)+(n>>1),o=i-n;c.a=i,c.b=o}function f(e,t){var r=65535&t,n=(65535&e)-(r>>1)&65535;c.a=r+n-32768&65535,c.b=n}function d(e,s,u,c,h,f){var d=u.value,p=w(s,u),m=w(s,u);u.value+=4;var g=w(s,u);if(u.value+=4,p<0||p>=65537||m<0||m>=65537)throw"Something wrong with HUF_ENCSIZE";for(var v=Array(65537),y=Array(16384),A=0;A<16384;A++)y[A]={},y[A].len=0,y[A].lit=0,y[A].p=null;var _=c-(u.value-d);if(!function(e,i,o,a,s,l,u){for(var c=0,h=0;s<=l;s++){if(o.value-o.value>a)return!1;r(6,c,h,e,o);var f=t.l;if(c=t.c,h=t.lc,u[s]=f,63==f){if(o.value-o.value>a)throw"Something wrong with hufUnpackEncTable";r(8,c,h,e,o);var d=t.l+6;if(c=t.c,h=t.lc,s+d>l+1)throw"Something wrong with hufUnpackEncTable";for(;d--;)u[s++]=0;s--}else if(f>=59){var d=f-59+2;if(s+d>l+1)throw"Something wrong with hufUnpackEncTable";for(;d--;)u[s++]=0;s--}}!function(e){for(var t=0;t<=58;++t)n[t]=0;for(var t=0;t<65537;++t)n[e[t]]+=1;for(var r=0,t=58;t>0;--t){var i=r+n[t]>>1;n[t]=r,r=i}for(var t=0;t<65537;++t){var o=e[t];o>0&&(e[t]=o|n[o]++<<6)}}(u)}(e,0,u,_,p,m,v),g>8*(c-(u.value-d)))throw"Something wrong with hufUncompress";!function(e,t,r,n){for(;t<=r;t++){var i=e[t]>>6,o=63&e[t];if(i>>o)throw"Invalid table entry";if(o>14){var a=n[i>>o-14];if(a.len)throw"Invalid table entry";if(a.lit++,a.p){var s=a.p;a.p=Array(a.lit);for(var l=0;l<a.lit-1;++l)a.p[l]=s[l]}else a.p=[,];a.p[a.lit-1]=t}else if(o)for(var u=0,l=1<<14-o;l>0;l--){var a=n[(i<<14-o)+u];if(a.len||a.p)throw"Invalid table entry";a.len=o,a.lit=t,u++}}}(v,p,m,y),function(e,t,r,n,s,u,c,h,f,d){for(var p=0,m=0,g=Math.trunc(s.value+(u+7)/8);s.value<g;)for(o(p,m,r,s),p=i.c,m=i.lc;m>=14;){var v=t[p>>m-14&16383];if(v.len)m-=v.len,l(v.lit,c,p,m,r,n,s,f,d,h),p=a.c,m=a.lc;else{if(!v.p)throw"hufDecode issues";for(y=0;y<v.lit;y++){for(var y,A=63&e[v.p[y]];m<A&&s.value<g;)o(p,m,r,s),p=i.c,m=i.lc;if(m>=A&&e[v.p[y]]>>6==(p>>m-A&(1<<A)-1)){m-=A,l(v.p[y],c,p,m,r,n,s,f,d,h),p=a.c,m=a.lc;break}}if(y==v.lit)throw"hufDecode issues"}}var _=8-u&7;for(p>>=_,m-=_;m>0;){var v=t[p<<14-m&16383];if(v.len)m-=v.len,l(v.lit,c,p,m,r,n,s,f,d,h),p=a.c,m=a.lc;else throw"hufDecode issues"}}(v,y,e,s,u,g,m,f,h,{value:0})}function p(e){for(var t=1;t<e.length;t++){var r=e[t-1]+e[t]-128;e[t]=r}}function m(e,t){for(var r=0,n=Math.floor((e.length+1)/2),i=0,o=e.length-1;!(i>o)&&(t[i++]=e[r++],!(i>o));){;t[i++]=e[n++]}}function g(e){for(var t=e.byteLength,r=[],n=0,i=new DataView(e);t>0;){var o=i.getInt8(n++);if(o<0){var a=-o;t-=a+1;for(var s=0;s<a;s++)r.push(i.getUint8(n++))}else{var a=o;t-=2;for(var l=i.getUint8(n++),s=0;s<a+1;s++)r.push(l)}}return r}function v(e){return new DataView(e.array.buffer,e.offset.value,e.size)}function y(e){var t=new Uint8Array(g(e.viewer.buffer.slice(e.offset.value,e.offset.value+e.size))),r=new
81Uint8Array(t.length);return p(t),m(t,r),new DataView(r.buffer)}function A(e){var t=L(e.array.slice(e.offset.value,e.offset.value+e.size)),r=new Uint8Array(t.length);return p(t),m(t,r),new DataView(r.buffer)}function _(e){for(var t=e.viewer,r={value:e.offset.value},n=new Uint16Array(e.width*e.scanlineBlockSize*(e.channels*e.type)),i=new Uint8Array(8192),o=0,a=Array(e.channels),s=0;s<e.channels;s++)a[s]={},a[s].start=o,a[s].end=a[s].start,a[s].nx=e.width,a[s].ny=e.lines,a[s].size=e.type,o+=a[s].nx*a[s].ny*a[s].size;var l=R(t,r),u=R(t,r);if(u>=8192)throw"Something is wrong with PIZ_COMPRESSION BITMAP_SIZE";if(l<=u)for(var s=0;s<u-l+1;s++)i[s+l]=M(t,r);var p=new Uint16Array(65536),m=function(e,t){for(var r=0,n=0;n<65536;++n)(0==n||e[n>>3]&1<<(7&n))&&(t[r++]=n);for(var i=r-1;r<65536;)t[r++]=0;return i}(i,p),g=w(t,r);d(e.array,t,r,g,n,o);for(var s=0;s<e.channels;++s)for(var v=a[s],y=0;y<a[s].size;++y)!function(e,t,r,n,i,o,a){for(var s=a<16384,l=r>i?i:r,u=1;u<=l;)u<<=1;for(u>>=1,d=u,u>>=1;u>=1;){for(var d,p,m,g,v,y=0,A=0+o*(i-d),_=o*u,b=o*d,B=n*u,x=n*d;y<=A;y+=b){for(var C=y,w=y+n*(r-d);C<=w;C+=x){var E=C+B,M=C+_,T=M+B;s?(h(e[C+t],e[M+t]),p=c.a,g=c.b,h(e[E+t],e[T+t]),m=c.a,v=c.b,h(p,m),e[C+t]=c.a,e[E+t]=c.b,h(g,v)):(f(e[C+t],e[M+t]),p=c.a,g=c.b,f(e[E+t],e[T+t]),m=c.a,v=c.b,f(p,m),e[C+t]=c.a,e[E+t]=c.b,f(g,v)),e[M+t]=c.a,e[T+t]=c.b}if(r&u){var M=C+_;s?h(e[C+t],e[M+t]):f(e[C+t],e[M+t]),p=c.a,e[M+t]=c.b,e[C+t]=p}}if(i&u)for(var C=y,w=y+n*(r-d);C<=w;C+=x){var E=C+B;s?h(e[C+t],e[E+t]):f(e[C+t],e[E+t]),p=c.a,e[E+t]=c.b,e[C+t]=p}d=u,u>>=1}}(n,v.start+y,v.nx,v.size,v.ny,v.nx*v.size,m);for(var A=o,_=0;_<A;++_)n[_]=p[n[_]];for(var b=0,B=new Uint8Array(n.buffer.byteLength),x=0;x<e.lines;x++)for(var C=0;C<e.channels;C++){var v=a[C],E=v.nx*v.size,T=new Uint8Array(n.buffer,2*v.end,2*E);B.set(T,b),b+=2*E,v.end+=E}return new DataView(B.buffer)}function b(e){var t=L(e.array.slice(e.offset.value,e.offset.value+e.size));let r=e.lines*e.channels*e.width,n=1==e.type?new Uint16Array(r):new Uint32Array(r),i=0,o=0,a=[,,,,];for(let r=0;r<e.lines;r++)for(let r=0;r<e.channels;r++){let r=0;switch(e.type){case 1:a[0]=i,a[1]=a[0]+e.width,i=a[1]+e.width;for(let i=0;i<e.width;++i)r+=t[a[0]++]<<8|t[a[1]++],n[o]=r,o++;break;case 2:a[0]=i,a[1]=a[0]+e.width,a[2]=a[1]+e.width,i=a[2]+e.width;for(let i=0;i<e.width;++i)r+=t[a[0]++]<<24|t[a[1]++]<<16|t[a[2]++]<<8,n[o]=r,o++}}return new DataView(n.buffer)}function B(e){var t=e.viewer,r={value:e.offset.value},n=new Uint8Array(e.width*e.lines*(e.channels*e.type*2)),i={version:T(t,r),unknownUncompressedSize:T(t,r),unknownCompressedSize:T(t,r),acCompressedSize:T(t,r),dcCompressedSize:T(t,r),rleCompressedSize:T(t,r),rleUncompressedSize:T(t,r),rleRawSize:T(t,r),totalAcUncompressedCount:T(t,r),totalDcUncompressedCount:T(t,r),acCompression:T(t,r)};if(i.version<2)throw"EXRLoader.parse: "+G.compression+" version "+i.version+" is unsupported";for(var o=[],a=R(t,r)-2;a>0;){var l=x(t.buffer,r),u=M(t,r),c=u>>2&3,h=new Int8Array([(u>>4)-1])[0],f=M(t,r);o.push({name:l,index:h,type:f,compression:c}),a-=l.length+3}for(var p=G.channels,m=Array(e.channels),v=0;v<e.channels;++v){var y=m[v]={},_=p[v];y.name=_.name,y.compression=0,y.decoded=!1,y.type=_.pixelType,y.pLinear=_.pLinear,y.width=e.width,y.height=e.lines}for(var b={idx:[,,,]},B=0;B<e.channels;++B)for(var y=m[B],v=0;v<o.length;++v){var C=o[v];y.name==C.name&&(y.compression=C.compression,C.index>=0&&(b.idx[C.index]=B),y.offset=B)}if(i.acCompressedSize>0)switch(i.acCompression){case 0:var w=new Uint16Array(i.totalAcUncompressedCount);d(e.array,t,r,i.acCompressedSize,w,i.totalAcUncompressedCount);break;case 1:var E=e.array.slice(r.value,r.value+i.totalAcUncompressedCount),F=L(E),w=new Uint16Array(F.buffer);r.value+=i.totalAcUncompressedCount}if(i.dcCompressedSize>0){var S=new Uint16Array(A({array:e.array,offset:r,size:i.dcCompressedSize}).buffer);r.value+=i.dcCompressedSize}if(i.rleRawSize>0){var E=e.array.slice(r.value,r.value+i.rleCompressedSize),F=L(E),I=g(F.buffer);r.value+=i.rleCompressedSize}for(var P=0,D=Array(m.length),v=0;v<D.length;++v)D[v]=[];for(var H=0;H<e.lines;++H)for(var U=0;U<m.length;++U)D[U].push(P),P+=m[U].width*e.type*2;!function(e,t,r,n,i,o){var a=new DataView(o.buffer),l=r[e.idx[0]].width,u=r[e.idx[0]].height,c=Math.floor(l/8),h=Math.ceil(l/8),f=Math.ceil(u/8),d=l-(h-1)*8,p=u-(f-1)*8,m={value:0},g=[,,,],v=[,,,],y=[,,,],A=[,,,],_=[,,,];for(let r=0;r<3;++r)_[r]=t[e.idx[r]],g[r]=r<1?0:g[r-1]+h*f,v[r]=new Float32Array(64),y[r]=new Uint16Array(64),A[r]=new Uint16Array(64*h);for(let t=0;t<f;++t){var b,B,x=8;t==f-1&&(x=p);var C=8;for(let e=0;e<h;++e){e==h-1&&(C=d);for(let e=0;e<3;++e){y[e].fill(0),y[e][0]=i[g[e]++],function(e,t,r){for(var n,i=1;i<64;)65280==(n=t[e.value])?i=64:n>>8==255?i+=255&n:(r[i]=n,i++),e.value++}(m,n,y[e]),b=y[e],(B=v[e])[0]=O(b[0]),B[1]=O(b[1]),B[2]=O(b[5]),B[3]=O(b[6]),B[4]=O(b[14]),B[5]=O(b[15]),B[6]=O(b[27]),B[7]=O(b[28]),B[8]=O(b[2]),B[9]=O(b[4]),B[10]=O(b[7]),B[11]=O(b[13]),B[12]=O(b[16]),B[13]=O(b[26]),B[14]=O(b[29]),B[15]=O(b[42]),B[16]=O(b[3]),B[17]=O(b[8]),B[18]=O(b[12]),B[19]=O(b[17]),B[20]=O(b[25]
81),B[21]=O(b[30]),B[22]=O(b[41]),B[23]=O(b[43]),B[24]=O(b[9]),B[25]=O(b[11]),B[26]=O(b[18]),B[27]=O(b[24]),B[28]=O(b[31]),B[29]=O(b[40]),B[30]=O(b[44]),B[31]=O(b[53]),B[32]=O(b[10]),B[33]=O(b[19]),B[34]=O(b[23]),B[35]=O(b[32]),B[36]=O(b[39]),B[37]=O(b[45]),B[38]=O(b[52]),B[39]=O(b[54]),B[40]=O(b[20]),B[41]=O(b[22]),B[42]=O(b[33]),B[43]=O(b[38]),B[44]=O(b[46]),B[45]=O(b[51]),B[46]=O(b[55]),B[47]=O(b[60]),B[48]=O(b[21]),B[49]=O(b[34]),B[50]=O(b[37]),B[51]=O(b[47]),B[52]=O(b[50]),B[53]=O(b[56]),B[54]=O(b[59]),B[55]=O(b[61]),B[56]=O(b[35]),B[57]=O(b[36]),B[58]=O(b[48]),B[59]=O(b[49]),B[60]=O(b[57]),B[61]=O(b[58]),B[62]=O(b[62]),B[63]=O(b[63]),function(e){let t=.5*Math.cos(3.14159/16),r=.5*Math.cos(3.14159/8),n=.5*Math.cos(3*3.14159/16),i=.5*Math.cos(3*3.14159/8);for(var o=[,,,,],a=[,,,,],s=[,,,,],l=[,,,,],u=0;u<8;++u){var c=8*u;o[0]=r*e[c+2],o[1]=i*e[c+2],o[2]=r*e[c+6],o[3]=i*e[c+6],a[0]=t*e[c+1]+n*e[c+3]+.2777854612564676*e[c+5]+.09754573032714427*e[c+7],a[1]=n*e[c+1]-.09754573032714427*e[c+3]-t*e[c+5]-.2777854612564676*e[c+7],a[2]=.2777854612564676*e[c+1]-t*e[c+3]+.09754573032714427*e[c+5]+n*e[c+7],a[3]=.09754573032714427*e[c+1]-.2777854612564676*e[c+3]+n*e[c+5]-t*e[c+
817],s[0]=.35355362513961314*(e[c+0]+e[c+4]),s[3]=.35355362513961314*(e[c+0]-e[c+4]),s[1]=o[0]+o[3],s[2]=o[1]-o[2],l[0]=s[0]+s[1],l[1]=s[3]+s[2],l[2]=s[3]-s[2],l[3]=s[0]-s[1],e[c+0]=l[0]+a[0],e[c+1]=l[1]+a[1],e[c+2]=l[2]+a[2],e[c+3]=l[3]+a[3],e[c+4]=l[3]-a[3],e[c+5]=l[2]-a[2],e[c+6]=l[1]-a[1],e[c+7]=l[0]-a[0]}for(var h=0;h<8;++h)o[0]=r*e[16+h],o[1]=i*e[16+h],o[2]=r*e[48+h],o[3]=i*e[48+h],a[0]=t*e[8+h]+n*e[24+h]+.2777854612564676*e[40+h]+.09754573032714427*e[56+h],a[1]=n*e[8+h]-.09754573032714427*e[24+h]-t*e[40+h]-.2777854612564676*e[56+h],a[2]=.2777854612564676*e[8+h]-t*e[24+h]+.09754573032714427*e[40+h]+n*e[56+h],a[3]=.09754573032714427*e[8+h]-.2777854612564676*e[24+h]+n*e[40+h]-t*e[56+h],s[0]=.35355362513961314*(e[h]+e[32+h]),s[3]=.35355362513961314*(e[h]-e[32+h]),s[1]=o[0]+o[3],s[2]=o[1]-o[2],l[0]=s[0]+s[1],l[1]=s[3]+s[2],l[2]=s[3]-s[2],l[3]=s[0]-s[1],e[0+h]=l[0]+a[0],e[8+h]=l[1]+a[1],e[16+h]=l[2]+a[2],e[24+h]=l[3]+a[3],e[32+h]=l[3]-a[3],e[40+h]=l[2]-a[2],e[48+h]=l[1]-a[1],e[56+h]=l[0]-a[0]}(v[e])}for(var w=v,E=0;E<64;++E){var M=w[0][E],T=w[1][E],F=w[2][E];w[0][E]=M+1.5747*F,w[1][E]=M-.1873*T-.4682*F,w[2][E]=M+1.8556*T}for(let t=0;t<3;++t)!function(e,t,r){for(var n,i=0;i<64;++i){t[r+i]=s.DataUtils.toHalfFloat((n=e[i])<=1?Math.sign(n)*Math.pow(Math.abs(n),2.2):Math.sign(n)*Math.pow(9.025013291561939,Math.abs(n)-1))}}(v[t],A[t],64*e)}let o=0;for(let n=0;n<3;++n){let i=r[e.idx[n]].type;for(let e=8*t;e<8*t+x;++e){o=_[n][e];for(let t=0;t<c;++t){let r=64*t+(7&e)*8;
81a.setUint16(o+0*i,A[n][r+0],!0),a.setUint16(o+2*i,A[n][r+1],!0),a.setUint16(o+4*i,A[n][r+2],!0),a.setUint16(o+6*i,A[n][r+3],!0),a.setUint16(o+8*i,A[n][r+4],!0),a.setUint16(o+10*i,A[n][r+5],!0),a.setUint16(o+12*i,A[n][r+6],!0),a.setUint16(o+14*i,A[n][r+7],!0),o+=16*i}}if(c!=h)for(let e=8*t;e<8*t+x;++e){let t=_[n][e]+8*c*2*i,r=64*c+(7&e)*8;for(let e=0;e<C;++e)a.setUint16(t+2*e*i,A[n][r+e],!0)}}}for(var S=new Uint16Array(l),a=new DataView(o.buffer),R=0;R<3;++R){r[e.idx[R]].decoded=!0;var I=r[e.idx[R]].type;if(2==r[R].type)for(var P=0;P<u;++P){let e=_[R][P];for(var D=0;D<l;++D)S[D]=a.getUint16(e+2*D*I,!0);for(var D=0;D<l;++D)a.setFloat32(e+2*D*I,O(S[D]),!0)}}}(b,D,m,w,S,n);for(var v=0;v<m.length;++v){var y=m[v];if(!y.decoded)if(2===y.compression)for(var k=0,N=0,H=0;H<e.lines;++H){for(var j=D[v][k],J=0;J<y.width;++J){for(var z=0;z<2*y.type;++z)n[j++]=I[N+z*y.width*y.height];N++}k++}else throw"EXRLoader.parse: unsupported channel compression"}return new DataView(n.buffer)}function x(e,t){for(var r=new Uint8Array(e),n=0;0!=r[t.value+n];)n+=1;var i=new TextDecoder().decode(r.slice(t.value,t.value+n));return t.value=t.value+n+1,i}function C(e,t){var r=e.getInt32(t.value,!0);return t.value=t.value+4,r}function w(e,t){var r=e.getUint32(t.value,!0);return t.value=t.value+4,r}function E(e,t){var r=e[t.value];return t.value=t.value+1,r}function M(e,t){var r=e.getUint8(t.value);return t.value=t.value+1,r}let T=function(e,t){let r;return r="getBigInt64"in DataView.prototype?Number(e.getBigInt64(t.value,!0)):e.getUint32(t.value+4,!0)+Number(e.getUint32(t.value,!0)<<32),t.value+=8,r};function F(e,t){var r=e.getFloat32(t.value,!0);return t.value+=4,r}function S(e,t){return s.DataUtils.toHalfFloat(F(e,t))}function O(e){var t=(31744&e)>>10,r=1023&e;return(e>>15?-1:1)*(t?31===t?r?NaN:1/0:Math.pow(2,t-15)*(1+r/1024):r/1024*6103515625e-14)}function R(e,t){var r=e.getUint16(t.value,!0);return t.value+=2,r}function I(e,t){return O(R(e,t))}let P=new DataView(e),D=new Uint8Array(e),H={value:0},G=function(e,t,r){let n={};if(0x1312f76!=e.getUint32(0,!0))throw"THREE.EXRLoader: provided file doesn't appear to be in OpenEXR format.";n.version=e.getUint8(4);let i=e.getUint8(5);n.spec={singleTile:!!(2&i),longName:!!(4&i),deepFormat:!!(8&i),multiPart:!!(16&i)},r.value=8;for(var o=!0;o;){var a=x(t,r);if(0==a)o=!1;else{var s=x(t,r),l=w(e,r),u=function(e,t,r,n,i){var o,a,s,l,u,c,h;if("string"===n||"stringvector"===n||"iccProfile"===n)return o=new TextDecoder().decode(new Uint8Array(t).slice(r.value,r.value+i)),r.value=r.value+i,o;if("chlist"===n)return function(e,t,r,n){for(var i=r.value,o=[];r.value<i+n-1;){var a=x(t,r),s=C(e,r),l=M(e,r);r.value+=3;var u=C(e,r),c=C(e,r);o.push({name:a,pixelType:s,pLinear:l,xSampling:u,ySampling:c})}return r.value+=1,o}(e,t,r,i);if("chromaticities"===n)return a=F(e,r),s=F(e,r),l=F(e,r),u=F(e,r),c=F(e,r),{redX:a,redY:s,greenX:l,greenY:u,blueX:c,blueY:F(e,r),whiteX:F(e,r),whiteY:F(e,r)};if("compression"===n)return["NO_COMPRESSION","RLE_COMPRESSION","ZIPS_COMPRESSION","ZIP_COMPRESSION","PIZ_COMPRESSION","PXR24_COMPRESSION","B44_COMPRESSION","B44A_COMPRESSION","DWAA_COMPRESSION","DWAB_COMPRESSION"][M(e,r)];if("box2i"===n)return h=w(e,r),{xMin:h,yMin:w(e,r),xMax:w(e,r),yMax:w(e,r)};else if("lineOrder"===n)return["INCREASING_Y"][M(e,r)];else if("float"===n)return F(e,r);else if("v2f"===n)return[F(e,r),F(e,r)];else if("v3f"===n)return[F(e,r),F(e,r),F(e,r)];else if("int"===n)return C(e,r);else if("rational"===n)return[C(e,r),w(e,r)];else if("timecode"===n)return[w(e,r),w(e,r)];else return"preview"===n?(r.value+=i,"skipped"):(r.value+=i,void 0)}(e,t,r,s,l);void 0===u?console.warn(`EXRLoader.parse: skipped unknown header attribute type '${s}'.`):n[a]=u}}if((-5&i)!=0)throw console.error("EXRHeader:",n),"THREE.EXRLoader: provided file is currently unsupported.";return n}(P,e,H),k=function(e,t,r,n,i){let o={size:0,viewer:t,array:r,offset:n,width:e.dataWindow.xMax-e.dataWindow.xMin+1,height:e.dataWindow.yMax-e.dataWindow.yMin+1,channels:e.channels.length,bytesPerLine:null,lines:null,inputSize:null,type:e.channels[0].pixelType,uncompress:null,getter:null,format:null,[U?"colorSpace":"encoding"]:null};switch(e.compression){case"NO_COMPRESSION":o.lines=1,o.uncompress=v;break;case"RLE_COMPRESSION":o.lines=1,o.uncompress=y;break;case"ZIPS_COMPRESSION":o.lines=1,o.uncompress=A;break;case"ZIP_COMPRESSION":o.lines=16,o.uncompress=A;break;case"PIZ_COMPRESSION":o.lines=32,o.uncompress=_;break;case"PXR24_COMPRESSION":o.lines=16,o.uncompress=b;break;case"DWAA_COMPRESSION":o.lines=32,o.uncompress=B;break;case"DWAB_COMPRESSION":o.lines=256,o.uncompress=B;break;default:throw"EXRLoader.parse: "+e.compression+" is unsupported"}if(o.scanlineBlockSize=o.lines,1==o.type)switch(i){case s.FloatType:o.getter=I,o.inputSize=2;break;case s.HalfFloatType:o.getter=R,o.inputSize=2}else if(2==o.type)switch(i){case s.FloatType:o.getter=F,o.inputSize=4;break;case s.HalfFloatType:o.getter=S,o.inputSize=4}else throw"EXRLoader.parse: unsupported pixelType "+o.type+" for "+e.compression+".";o.blockCount=(e.dataWindow.yMax+1)/o.scanlineBlockSize;for(var a=0;a<o.blockCount;a++)T(t,n);o.outputChannels=3==o.channels?4:o.channels;let l=o.width*o.height*o.outputChannels;switch(i){case s.FloatType:o.byteArray=new Float32Array(l),o.channels<o.outputChannels&&o.byteArray.fill(1,0,l);break;case s.HalfFloatType:o.byteArray=new Uint16Array(l),o.channels<o.outputChannels&&o.byteArray.fill(15360,0,l);break;default:console.error("THREE.EXRLoader: unsupported type: ",i)}
81return o.bytesPerLine=o.width*o.inputSize*o.channels,4==o.outputChannels?o.format=s.RGBAFormat:o.format=s.RedFormat,U?o.colorSpace="srgb-linear":o.encoding=3e3,o}(G,P,D,H,this.type),N={value:0},j={R:0,G:1,B:2,A:3,Y:0};for(let e=0;e<k.height/k.scanlineBlockSize;e++){let t=w(P,H);k.size=w(P,H),k.lines=t+k.scanlineBlockSize>k.height?k.height-t:k.scanlineBlockSize;let r=k.size<k.lines*k.bytesPerLine?k.uncompress(k):v(k);H.value+=k.size;for(let t=0;t<k.scanlineBlockSize;t++){let n=t+e*k.scanlineBlockSize;if(n>=k.height)break;for(let e=0;e<k.channels;e++){let i=j[G.channels[e].name];for(let o=0;o<k.width;o++){N.value=(t*(k.channels*k.width)+e*k.width+o)*k.inputSize;let a=(k.height-1-n)*(k.width*k.outputChannels)+o*k.outputChannels+i;k.byteArray[a]=k.getter(r,N)}}}}return{header:G,width:k.width,height:k.height,data:k.byteArray,format:k.format,[U?"colorSpace":"encoding"]:k[U?"colorSpace":"encoding"],type:this.type}}setDataType(e){return this.type=e,this}load(e,t,r,n){return super.load(e,function(e,r){U?e.colorSpace=r.colorSpace:e.encoding=r.encoding,e.minFilter=s.LinearFilter,e.magFilter=s.LinearFilter,e.generateMipmaps=!1,e.flipY=!1,t&&t(e,r)},r,n)}}let N=(e,t,r)=>{let n;switch(e){case s.UnsignedByteType:n=new Uint8ClampedArray(t*r*4);break;case s.HalfFloatType:n=new Uint16Array(t*r*4);break;case s.UnsignedIntType:n=new Uint32Array(t*r*4);break;case s.ByteType:n=new Int8Array(t*r*4);break;case s.ShortType:n=new Int16Array(t*r*4);break;case s.IntType:n=new Int32Array(t*r*4);break;case s.FloatType:n=new Float32Array(t*r*4);break;default:throw Error("Unsupported data type")}return n};class j{constructor(e){var t,r,i,o,a,l,u,c,h,f,d,p,m,g,v,y;this._rendererIsDisposable=!1,this._supportsReadPixels=!0,this.render=()=>{this._renderer.setRenderTarget(this._renderTarget);try{this._renderer.render(this._scene,this._camera)}catch(e){throw this._renderer.setRenderTarget(null),e}this._renderer.setRenderTarget(null)},this._width=e.width,this._height=e.height,this._type=e.type,this._colorSpace
81=e.colorSpace;let A={format:s.RGBAFormat,depthBuffer:!1,stencilBuffer:!1,type:this._type,colorSpace:this._colorSpace,anisotropy:(null==(t=e.renderTargetOptions)?void 0:t.anisotropy)!==void 0?null==(r=e.renderTargetOptions)?void 0:r.anisotropy:1,generateMipmaps:(null==(i=e.renderTargetOptions)?void 0:i.generateMipmaps)!==void 0&&(null==(o=e.renderTargetOptions)?void 0:o.generateMipmaps),magFilter:(null==(a=e.renderTargetOptions)?void 0:a.magFilter)!==void 0?null==(l=e.renderTargetOptions)?void 0:l.magFilter:s.LinearFilter,minFilter:(null==(u=e.renderTargetOptions)?void 0:u.minFilter)!==void 0?null==(c=e.renderTargetOptions)?void 0:c.minFilter:s.LinearFilter,samples:(null==(h=e.renderTargetOptions)?void 0:h.samples)!==void 0?null==(f=e.renderTargetOptions)?void 0:f.samples:void 0,wrapS:(null==(d=e.renderTargetOptions)?void 0:d.wrapS)!==void 0?null==(p=e.renderTargetOptions)?void 0:p.wrapS:s.ClampToEdgeWrapping,wrapT:(null==(m=e.renderTargetOptions)?void 0:m.wrapT)!==void 0?null==(g=e.renderTargetOptions)?void 0:g.wrapT:s.ClampToEdgeWrapping};if(this._material=e.material,e.renderer?this._renderer=e.renderer:(this._renderer=j.instantiateRenderer(),this._rendererIsDisposable=!0),this._scene=new s.Scene,this._camera=new s.OrthographicCamera,this._camera.position.set(0,0,10),this._camera.left=-.5,this._camera.right=.5,this._camera.top=.5,this._camera.bottom=-.5,this._camera.updateProjectionMatrix(),!((e,t,r,i)=>{if(void 0!==n)return n;let o=new s.WebGLRenderTarget(1,1,i);t.setRenderTarget(o);let a=new s.Mesh(new s.PlaneGeometry,new s.MeshBasicMaterial({color:0xffffff}));t.render(a,r),t.setRenderTarget(null);let l=N(e,o.width,o.height);return t.readRenderTargetPixels(o,0,0,o.width,o.height,l),o.dispose(),a.geometry.dispose(),a.material.dispose(),n=0!==l[0]})(this._type,this._renderer,this._camera,A)){let e;this._type===s.HalfFloatType&&(e=this._renderer.extensions.has("EXT_color_buffer_float")?s.FloatType:void 0),void 0!==e?(console.warn(`This browser does not support reading pixels from ${this._type} RenderTargets, switching to ${s.FloatType}`),this._type=e):(this._supportsReadPixels=!1,console.warn("This browser dos not support toArray or toDataTexture, calls to those methods will result in an error thrown"))}this._quad=new s.Mesh(new s.PlaneGeometry,this._material),this._quad.geometry.computeBoundingBox(),this._scene.add(this._quad),this._renderTarget=new s.WebGLRenderTarget(this.width,this.height,A),this._renderTarget.texture.mapping=(null==(v=e.renderTargetOptions)?void 0:v.mapping)!==void 0?null==(y=e.renderTargetOptions)?void 0:y.mapping:s.UVMapping}static instantiateRenderer(){let e=new s.WebGLRenderer;return e.setSize(128,128),e}toArray(){if(!this._supportsReadPixels)throw Error("Can't read pixels in this browser");let e=N(this._type,this._width,this._height);return this._renderer.readRenderTargetPixels(this._renderTarget,0,0,this._width,this._height,e),e}toDataTexture(e){let t=new s.DataTexture(this.toArray(),this.width,this.height,s.RGBAFormat,this._type,(null==e?void 0:e.mapping)||s.UVMapping,(null==e?void 0:e.wrapS)||s.ClampToEdgeWrapping,(null==e?void 0:e.wrapT)||s.ClampToEdgeWrapping,(null==e?void 0:e.magFilter)||s.LinearFilter,(null==e?void 0:e.minFilter)||s.LinearFilter,(null==e?void 0:e.anisotropy)||1,s.LinearSRGBColorSpace);return t.generateMipmaps=(null==e?void 0:e.generateMipmaps)!==void 0&&(null==e?void 0:e.generateMipmaps),t}disposeOnDemandRenderer(){this._renderer.setRenderTarget(null),this._rendererIsDisposable&&(this._renderer.dispose(),this._renderer.forceContextLoss())}dispose(e){this.disposeOnDemandRenderer(),e&&this.renderTarget.dispose(),this.material instanceof s.ShaderMaterial&&Object.values(this.material.uniforms).forEach(e=>{e.value instanceof s.Texture&&e.value.dispose()}),Object.values(this.material).forEach(e=>{e instanceof s.Texture&&e.dispose()}),this.material.dispose(),this._quad.geometry.dispose()}get width(){return this._width}set width(e){this._width=e,this._renderTarget.setSize(this._width,this._height)}get height(){return this._height}set height(e){this._height=e,this._renderTarget.setSize(this._width,this._height)}get renderer(){return this._renderer}get renderTarget(){return this._renderTarget}set renderTarget(e){this._renderTarget=e,this._width=e.width,this._height=e.height}get material(){return this._material}get type(){return this._type}get colorSpace(){return this._colorSpace}}let J=` 82varying vec2 vUv; 83 84void main() { 85 vUv = uv; 86 gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0
86); 87} 88`,z=` 89// min half float value 90#define HALF_FLOAT_MIN vec3( -65504, -65504, -65504 ) 91// max half float value 92#define HALF_FLOAT_MAX vec3( 65504, 65504, 65504 ) 93 94uniform sampler2D sdr; 95uniform sampler2D gainMap; 96uniform vec3 gamma; 97uniform vec3 offsetHdr; 98uniform vec3 offsetSdr; 99uniform vec3 gainMapMin; 100uniform vec3 gainMapMax; 101uniform float weightFactor; 102 103varying vec2 vUv; 104 105void main() { 106 vec3 rgb = texture2D( sdr, vUv ).rgb; 107 vec3 recovery = texture2D( gainMap, vUv ).rgb; 108 vec3 logRecovery = pow( recovery, gamma ); 109 vec3 logBoost = gainMapMin * ( 1.0 - logRecovery ) + gainMapMax * logRecovery; 110 vec3 hdrColor = (rgb + offsetSdr) * exp2( logBoost * weightFactor ) - offsetHdr; 111 vec3 clampedHdrColor = max( HALF_FLOAT_MIN, min( HALF_FLOAT_MAX, hdrColor )); 112 gl_FragColor = vec4( clampedHdrColor , 1.0 ); 113} 114`;class K extends s.ShaderMaterial{constructor({gamma:e,offsetHdr:t,offsetSdr:r,gainMapMin:n,gainMapMax:i,maxDisplayBoost:o,hdrCapacityMin:a,hdrCapacityMax:l,sdr:u,gainMap:c}){super({name:"GainMapDecoderMaterial",vertexShader:J,fragmentShader:z,uniforms:{sdr:{value:u},gainMap:{value:c},gamma:{value:new s.Vector3(1/e[0],1/e[1],1/e[2])},offsetHdr:{value:new s.Vector3().fromArray(t)},offsetSdr:{value:new s.Vector3().fromArray(r)},gainMapMin:{value:new s.Vector3().fromArray(n)},gainMapMax:{value:new s.Vector3().fromArray(i)},weightFactor:{value:(Math.log2(o)-a)/(l-a)}},blending:s.NoBlending,depthTest:!1,depthWrite:!1}),this._maxDisplayBoost=o,this._hdrCapacityMin=a,this._hdrCapacityMax=l,this.needsUpdate=!0,this.uniformsNeedUpdate=!0}get sdr(){return this.uniforms.sdr.value}set sdr(e){this.uniforms.sdr.value=e}get gainMap(){return this.uniforms.gainMap.value}set gainMap(e){this.uniforms.gainMap.value=e}get offsetHdr(){return this.uniforms.offsetHdr.value.toArray()}set offsetHdr(e){this.uniforms.offsetHdr.value.fromArray(e)}get offsetSdr(){return this.uniforms.offsetSdr.value.toArray()}set offsetSdr(e){this.uniforms.offsetSdr.value.fromArray(e)}get gainMapMin(){return this.uniforms.gainMapMin.value.toArray()}set gainMapMin(e){this.uniforms.gainMapMin.value.fromArray(e)}get gainMapMax(){return this.uniforms.gainMapMax.value.toArray()}set gainMapMax(e){this.uniforms.gainMapMax.value.fromArray(e)}get gamma(){let e=this.uniforms.gamma.value;return[1/e.x,1/e.y,1/e.z]}set gamma(e){let t=this.uniforms.gamma.value;t.x=1/e[0],t.y=1/e[1],t.z=1/e[2]}get hdrCapacityMin(){return this._hdrCapacityMin}set hdrCapacityMin(e){this._hdrCapacityMin=e,this.calculateWeight()}get hdrCapacityMax(){return this._hdrCapacityMax}set hdrCapacityMax(e){this._hdrCapacityMax=e,this.calculateWeight()}get maxDisplayBoost(){return this._maxDisplayBoost}set maxDisplayBoost(e){this._maxDisplayBoost=Math.max(1,Math.min(65504,e)),this.calculateWeight()}calculateWeight(){let e=(Math.log2(this._maxDisplayBoost)-this._hdrCapacityMin)/(this._hdrCapacityMax-this._hdrCapacityMin);this.uniforms.weightFactor.value=Math.max(0,Math.min(1,e))}}class V extends Error{}class Q extends Error{}let X=(e,t,r)=>{var n;let i,o=null==(n=e.attributes.getNamedItem(t))?void 0:n.nodeValue;if(o)i=o;else{let n=e.getElementsByTagName(t)[0];if(n){let e=n.getElementsByTagName("rdf:li");if(3===e.length)i=Array.from(e).map(e=>e.innerHTML);else throw Error(`Gainmap metadata contains an array of items for ${t} but its length is not 3`)}else if(r)return r;else throw Error(`Can't find ${t} in gainmap metadata`)}return i};class Y{constructor(e){this.options={debug:!!e&&void 0!==e.debug&&e.debug,extractFII:!e||void 0===e.extractFII||e.extractFII,extractNonFII:!e||void 0===e.extractNonFII||e.extractNonFII}}extract(e){return new Promise((t,r)=>{let n,i=this.options.debug,o=new DataView(e.buffer);if(65496!==o.getUint16(0))return void r(Error("Not a valid jpeg"));let a=o.byteLength,s=2,l=0;for(;s<a;){if(++l>250)return void r(Error(`Found no marker after ${l} loops 😵`));if(255!==o.getUint8(s))return void r(Error(`Not a valid marker at offset 0x${s.toString(16)}, found: 0x${o.getUint8(s).toString(16)}`));if(n=o.getUint8(s+1),i&&console.log(`Marker: ${n.toString(16)}`),226===n){i&&console.log("Found APP2 marker (0xffe2)");let e=s+4;if(0x4d504600===o.getUint32(e)){let n,i=e+4;if(18761===o.getUint16(i))n=!1;else{if(19789!==o.getUint16(i))return void r(Error("No valid endianness marker found in TIFF header"));n=!0}if(42!==o.getUint16(i+2,!n))return void r(Error("Not valid TIFF data! (no 0x002A marker)"));let a=o.getUint32(i+4,!n);if(a<8)return void r(Error("Not valid TIFF data! (First offset less than 8)"));let s=i+a,l=o.getUint16(s,!n),u=s+2,c=0;for(let e=u;e<u+12*l;e+=12)45057===o.getUint16(e,!n)&&(c=o.getUint32(e+8,!n));let h=s+2+12*l+4,f=[];for(let e=h;e<h+16*c;
114e+=16){let t={MPType:o.getUint32(e,!n),size:o.getUint32(e+4,!n),dataOffset:o.getUint32(e+8,!n),dependantImages:o.getUint32(e+12,!n),start:-1,end:-1,isFII:!1};t.dataOffset?(t.start=i+t.dataOffset,t.isFII=!1):(t.start=0,t.isFII=!0),t.end=t.start+t.size,f.push(t)}if(this.options.extractNonFII&&f.length){let e=new Blob([o]),r=[];for(let t of f){if(t.isFII&&!this.options.extractFII)continue;let n=e.slice(t.start,t.end+1,"image/jpeg");r.push(n)}t(r)}}}s+=2+o.getUint16(s+2)}})}}let Z=async e=>{let t=(e=>{var t,r;let n,i=(n="undefined"!=typeof TextDecoder?new TextDecoder().decode(e):e.toString()).indexOf("<x:xmpmeta"),o=new DOMParser;for(;-1!==i;){let e=n.indexOf("x:xmpmeta>",i);n.slice(i,e+10);let a=n.slice(i,e+10);try{let e=o.parseFromString(a,"text/xml").getElementsByTagName("rdf:Description")[0],n=X(e,"hdrgm:GainMapMin","0"),i=X(e,"hdrgm:GainMapMax"),s=X(e,"hdrgm:Gamma","1"),l=X(e,"hdrgm:OffsetSDR","0.015625"),u=X(e,"hdrgm:OffsetHDR","0.015625"),c=null==(t=e.attributes.getNamedItem("hdrgm:HDRCapacityMin"))?void 0:t.nodeValue;c||(c="0");let h=null==(r=e.attributes.getNamedItem("hdrgm:HDRCapacityMax"))?void 0:r.nodeValue;if(!h)throw Error("Incomplete gainmap metadata");return{gainMapMin:Array.isArray(n)?n.map(e=>parseFloat(e)):[parseFloat(n),parseFloat(n),parseFloat(n)],gainMapMax:Array.isArray(i)?i.map(e=>parseFloat(e)):[parseFloat(i),parseFloat(i),parseFloat(i)],gamma:Array.isArray(s)?s.map(e=>parseFloat(e)):[parseFloat(s),parseFloat(s),parseFloat(s)],offsetSdr:Array.isArray(l)?l.map(e=>parseFloat(e)):[parseFloat(l),parseFloat(l),parseFloat(l)],offsetHdr:Array.isArray(u)?u.map(e=>parseFloat(e)):[parseFloat(u),parseFloat(u),parseFloat(u)],hdrCapacityMin:parseFloat(c),hdrCapacityMax:parseFloat(h)}}catch(e){}i=n.indexOf("<x:xmpmeta",e)}})(e);if(!t)throw new Q("Gain map XMP metadata not found");let r=new Y({extractFII:!0,extractNonFII:!0}),n=await r.extract(e);if(2!==n.length)throw new V("Gain map recovery image not found");return{sdr:new Uint8Array(await n[0].arrayBuffer()),gainMap:new Uint8Array(await n[1].arrayBuffer()),metadata:t}},q=e=>new Promise((t,r)=>{let n=document.createElement("img");n.onload=()=>{t(n)},n.onerror=e=>{r(e)},n.src=URL.createObjectURL(e)});class W extends s.Loader{constructor(e,t){super(t),e&&(this._renderer=e),this._internalLoadingManager=new s.LoadingManager}setRenderer(e){return this._renderer=e,this}setRenderTargetOptions(e){return this._renderTargetOptions=e,this}prepareQuadRenderer(){this._renderer||console.warn("WARNING: An existing WebGL Renderer was not passed to this Loader constructor or in setRenderer, the result of this Loader will need to be converted to a Data Texture with toDataTexture() before you can use it in your renderer.");let e=new K({gainMapMax:[1,1,1],gainMapMin:[0,0,0],gamma:[1,1,1],offsetHdr:[1,1,1],offsetSdr:[1,1,1],hdrCapacityMax:1,hdrCapacityMin:0,maxDisplayBoost:1,gainMap:new s.Texture,sdr:new s.Texture});return new j({width:16,height:16,type:s.HalfFloatType,colorSpace:s.LinearSRGBColorSpace,material:e,renderer:this._renderer,renderTargetOptions:this._renderTargetOptions})}async render(e,t,r,n){let i,o,a=n?new Blob([n],{type:"image/jpeg"}):void 0,l=new Blob([r],{type:"image/jpeg"}),u=!1;if("undefined"==typeof createImageBitmap){let e=await Promise.all([a?q(a):Promise.resolve(void 0),q(l)]);o=e[0],i=e[1],u=!0}else{let e=await Promise.all([a?createImageBitmap(a,{imageOrientation:"flipY"}):Promise.resolve(void 0),createImageBitmap(l,{imageOrientation:"flipY"})]);o=e[0],i=e[1]}let c=new s.Texture(o||new ImageData(2,2),s.UVMapping,s.ClampToEdgeWrapping,s.ClampToEdgeWrapping,s.LinearFilter,s.LinearMipMapLinearFilter,s.RGBAFormat,s.UnsignedByteType,1,s.LinearSRGBColorSpace);c.flipY=u,c.needsUpdate=!0;let h=new s.Texture(i,s.UVMapping,s.ClampToEdgeWrapping,s.ClampToEdgeWrapping,s.LinearFilter,s.LinearMipMapLinearFilter,s.RGBAFormat,s.UnsignedByteType,1,s.SRGBColorSpace);h.flipY=u,h.needsUpdate=!0,e.width=i.width,e.height=i.height,e.material.gainMap=c,e.material.sdr=h,e.material.gainMapMin=t.gainMapMin,e.material.gainMapMax=t.gainMapMax,e.material.offsetHdr=t.offsetHdr,e.material.offsetSdr=t.offsetSdr,e.material.gamma=t.gamma,e.material.hdrCapacityMin=t.hdrCapacityMin,e.material.hdrCapacityMax=t.hdrCapacityMax,e.material.maxDisplayBoost=Math.pow(2,t.hdrCapacityMax),e.material.needsUpdate=!0,e.render()}}class $ extends W{load([e,t,r],n,i,o){let a,l,u,c=this.prepareQuadRenderer(),h=async()=>
114{if(a&&l&&u){try{await this.render(c,u,a,l)}catch(n){this.manager.itemError(e),this.manager.itemError(t),this.manager.itemError(r),"function"==typeof o&&o(n),c.disposeOnDemandRenderer();return}"function"==typeof n&&n(c),this.manager.itemEnd(e),this.manager.itemEnd(t),this.manager.itemEnd(r),c.disposeOnDemandRenderer()}},f=!0,d=0,p=0,m=!0,g=0,v=0,y=!0,A=0,_=0,b=()=>{"function"==typeof i&&i(new ProgressEvent("progress",{lengthComputable:f&&m&&y,loaded:p+v+_,total:d+g+A}))};this.manager.itemStart(e),this.manager.itemStart(t),this.manager.itemStart(r);let B=new s.FileLoader(this._internalLoadingManager);B.setResponseType("arraybuffer"),B.setRequestHeader(this.requestHeader),B.setPath(this.path),B.setWithCredentials(this.withCredentials),B.load(e,async e=>{if("string"==typeof e)throw Error("Invalid sdr buffer");a=e,await h()},e=>{f=e.lengthComputable,p=e.loaded,d=e.total,b()},t=>{this.manager.itemError(e),"function"==typeof o&&o(t)});let x=new s.FileLoader(this._internalLoadingManager);x.setResponseType("arraybuffer"),x.setRequestHeader(this.requestHeader),x.setPath(this.path),x.setWithCredentials(this.withCredentials),x.load(t,async e=>{if("string"==typeof e)throw Error("Invalid gainmap buffer");l=e,await h()},e=>{m=e.lengthComputable,v=e.loaded,g=e.total,b()},e=>{this.manager.itemError(t),"function"==typeof o&&o(e)});let C=new s.FileLoader(this._internalLoadingManager);return C.setRequestHeader(this.requestHeader),C.setPath(this.path),C.setWithCredentials(this.withCredentials),C.load(r,async e=>{if("string"!=typeof e)throw Error("Invalid metadata string");u=JSON.parse(e),await h()},e=>{y=e.lengthComputable,_=e.loaded,A=e.total,b()},e=>{this.manager.itemError(r),"function"==typeof o&&o(e)}),c}}class ee extends W{load(e,t,r,n){let i=this.prepareQuadRenderer(),o=new s.FileLoader(this._internalLoadingManager);return o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setPath(this.path),o.setWithCredentials(this.withCredentials),this.manager.itemStart(e),o.load(e,async r=>{let o,a,s;if("string"==typeof r)throw Error("Invalid buffer, received [string], was expecting [ArrayBuffer]");let l=new Uint8Array(r);try{let e=await Z(l);o=e.sdr,a=e.gainMap,s=e.metadata}catch(t){if(t instanceof Q||t instanceof V)console.warn(`Failure to reconstruct an HDR image from ${e}: Gain map metadata not found in the file, HDRJPGLoader will render the SDR jpeg`),s={gainMapMin:[0,0,0],gainMapMax:[1,1,1],gamma:[1,1,1],hdrCapacityMin:0,hdrCapacityMax:1,offsetHdr:[0,0,0],offsetSdr:[0,0,0]},o=l;else throw t}try{await this.render(i,s,o,a)}catch(t){this.manager.itemError(e),"function"==typeof n&&n(t),i.disposeOnDemandRenderer();return}"function"==typeof t&&t(i),this.manager.itemEnd(e),i.disposeOnDemandRenderer()},r,t=>{this.manager.itemError(e),"function"==typeof n&&n(t)}),i}}let et={apartment:"lebombo_1k.hdr",city:"potsdamer_platz_1k.hdr",dawn:"kiara_1_dawn_1k.hdr",forest:"forest_slope_1k.hdr",lobby:"st_fagans_interior_1k.hdr",night:"dikhololo_night_1k.hdr",park:"rooitou_park_1k.hdr",studio:"studio_small_03_1k.hdr",sunset:"venice_sunset_1k.hdr",warehouse:"empty_warehouse_01_1k.hdr"},er=e=>Array.isArray(e);function en({files:e=["/px.png","/nx.png","/py.png","/ny.png","/pz.png","/nz.png"],path:t="",preset:r,encoding:n,extensions:i}={}){var o,l;let c,h=null,f=!1;if(r){if(!(r in et))throw Error("Preset must be one of: "+Object.keys(et).join(", "));e=et[r],t="https://raw.githack.com/pmndrs/drei-assets/456060a26bbeb8fdf79326f224b6d99b8bcce736/hdri/"}let d=er(e)&&6===e.length,p=er(e)&&3===e.length&&e.some(e=>e.endsWith("json")),m=er(e)?e[0]:e;if(f=er(e),!(h="cube"===(c=d?"cube":p?"webp":m.startsWith("data:application/exr")?"exr":m.startsWith("data:application/hdr")?"hdr":m.startsWith("data:image/jpeg")?"jpg":null==(o=m.split(".").pop())||null==(o=o.split("?"))||null==(o=o.shift())?void 0:o.toLowerCase())?s.CubeTextureLoader:"hdr"===c?u:"exr"===c?k:"jpg"===c||"jpeg"===c?ee:"webp"===c?$:null))throw Error("useEnvironment: Unrecognized file extension: "+e);let g=(0,a.A)(e=>e.gl),v=(0,a.F)(h,f?[e]:e,e=>{("webp"===c||"jpg"===c||"jpeg"===c)&&e.setRenderer(g),null==e.setPath||e.setPath(t),i&&i(e)}),y=f?v[0]:v;return("jpg"===c||"jpeg"===c||"webp"===c)&&(y=null==(l=y.renderTarget)?void 0:l.texture),y.mapping=d?s.CubeReflectionMapping:s.EquirectangularReflectionMapping,"colorSpace"in y?y.colorSpace
114=(null!=n?n:d)?"srgb":"srgb-linear":y.encoding=(null!=n?n:d)?3001:3e3,y}function ei(e,t,r,n,i={}){var o,s,l,u,c;let h,f;i={backgroundBlurriness:null!=(o=i.blur)?o:0,backgroundIntensity:1,backgroundRotation:[0,0,0],environmentIntensity:1,environmentRotation:[0,0,0],...i};let d=(f=h=t||r).current&&f.current.isScene?h.current:h,p=d.background,m=d.environment,g={backgroundBlurriness:d.backgroundBlurriness,backgroundIntensity:d.backgroundIntensity,backgroundRotation:null!=(s=null==(l=d.backgroundRotation)||null==l.clone?void 0:l.clone())?s:[0,0,0],environmentIntensity:d.environmentIntensity,environmentRotation:null!=(u=null==(c=d.environmentRotation)||null==c.clone?void 0:c.clone())?u:[0,0,0]};return"only"!==e&&(d.environment=n),e&&(d.background=n),(0,a.q)(d,i),()=>{"only"!==e&&(d.environment=m),e&&(d.background=p),(0,a.q)(d,g)}}function eo({scene:e,background:t=!1,map:r,...n}){let i=(0,a.A)(e=>e.scene);return o.useLayoutEffect(()=>{if(r)return ei(t,e,i,r,n)}),null}function ea({background:e=!1,scene:t,blur:r,backgroundBlurriness:n,backgroundIntensity:i,backgroundRotation:s,environmentIntensity:l,environmentRotation:u,...c}){let h=en(c),f=(0,a.A)(e=>e.scene);return o.useLayoutEffect(()=>ei(e,t,f,h,{blur:r,backgroundBlurriness:n,backgroundIntensity:i,backgroundRotation:s,environmentIntensity:l,environmentRotation:u})),null}function es({children:e,near:t=1,far:r=1e3,resolution:n=256,frames:i=1,map:l,background:u=!1,blur:c,backgroundBlurriness:h,backgroundIntensity:f,backgroundRotation:d,environmentIntensity:p,environmentRotation:m,scene:g,files:v,path:y,preset:A,extensions:_}){let b=(0,a.A)(e=>e.gl),B=(0,a.A)(e=>e.scene),x=o.useRef(null),[C]=o.useState(()=>new s.Scene),w=o.useMemo(()=>{let e=new s.WebGLCubeRenderTarget(n);return e.texture.type=s.HalfFloatType,e},[n]);o.useLayoutEffect(()=>(1===i&&x.current.update(b,C),ei(u,g,B,w.texture,{blur:c,backgroundBlurriness:h,backgroundIntensity:f,backgroundRotation:d,environmentIntensity:p,environmentRotation:m})),[e,C,w.texture,g,B,u,i,b]);let E=1;return(0,a.C)(()=>{(i===1/0||E<i)&&(x.current.update(b,C),E++)}),o.createElement(o.Fragment,null,(0,a.o)(o.createElement(o.Fragment,null,e,o.createElement("cubeCamera",{ref:x,args:[t,r,w]}),v||A?o.createElement(ea,{background:!0,files:v,preset:A,path:y,extensions:_}):l?o.createElement(eo,{background:!0,map:l,extensions:_}):null),C))}function el(e){var t,r,n,s;let u=en(e),c=e.map||u;o.useMemo(()=>(0,a.e)({GroundProjectedEnvImpl:l}),[]);let h=o.useMemo(()=>[c],[c]),f=null==(t=e.ground)?void 0:t.height,d=null==(r=e.ground)?void 0:r.radius,p=null!=(n=null==(s=e.ground)?void 0:s.scale)?n:1e3;return o.createElement(o.Fragment,null,o.createElement(eo,(0,i.A)({},e,{map:c})),o.createElement("groundProjectedEnvImpl",{args:h,scale:p,height:f,radius:d}))}function eu(e){return e.ground?o.createElement(el,e):e.map?o.createElement(eo,e):e.children?o.createElement(es,e):o.createElement(ea,e)}},2690:(e,t,r)=>{"use strict";e.exports=r(2921)},2861:(e,t,r)=>{"use strict";r.d(t,{Af:()=>s,Nz:()=>i,u5:()=>l,y3:()=>h});var n=r(23);function i(e,t,r){if(!e)return;if(!0===r(e))return e;let n=t?e.return:e.child;for(;n;){let e=i(n,t,r);if(e)return e;n=t?null:n.sibling}}function o(e){try{return Object.defineProperties(e,{_currentRenderer:{get:()=>null,set(){}},_currentRenderer2:{get:()=>null,set(){}}})}catch(t){return e}}(()=>{var e,t;return"undefined"!=typeof window&&((null==(e=window.document)?void 0:e.createElement)||(null==(t=window.navigator)?void 0:t.product)==="ReactNative")})()?n.useLayoutEffect:n.useEffect;let a=o(n.createContext(null));class s extends n.Component{render(){return n.createElement(a.Provider,{value:this._reactInternals},this.props.children)}}function l(){let e=n.useContext(a);if(null===e)throw Error("its-fine: useFiber must be called within a <FiberProvider />!");let t=n.useId();return n.useMemo(()=>{for(let r of[e,null==e?void 0:e.alternate]){if(!r)continue;let e=i(r,!1,e=>{let r=e.memoizedState;for(;r;){if(r.memoizedState===t)return!0;r=r.next}});if(e)return e}},[e,t])}let u=Symbol.for("react.context"),c=e=>null!==e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===u;function h(){let e=function(){let e=l(),[t]=n.useState(()=>new Map);t.clear();let r=e;for(;r;){let e=r.type;c(e)&&e!==a&&!t.has(e)&&t.set(e,n.use(o(e))),r=r.return}return t}();return n.useMemo(()=>Array.from(e.keys()).reduce((t,r)=>i=>n.createElement(t,null,n.createElement(r.Provider,{...i,value:e.get(r)})),e=>n.createElement(s,{...e})),[e])}},2863:(e,t,r)=>{"use strict";e.exports=r(9071)},2921:(e,t,r)=>{"use strict";var n=r(23),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=n.useState,a=n.useEffect,s=n.useLayoutEffect,l=n.useDebugValue;function u(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!i(e,r)}catch(e){return!0}}var c="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var r=t(),n=o({inst:{value:r,getSnapshot:t}}),i=n[0].inst,c=n[1];return s(function(){i.value=r,i.getSnapshot=t,u(i)&&c({inst:i})},[e,r,t]),a(function(){return u(i)&&c({inst:i}),e(function(){u(i)&&c({inst:i})})},[e]),l(r),r};t.useSyncExternalStore=void 0!==n.useSyncExternalStore?n.useSyncExternalStore:c},2937:(e,t,r)=>{"use strict";r.d(t,{k:()=>g});
114var n=r(1698),i=r(4098),o=r(2042),a=r(7134);function s(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(s=function(){return!!e})()}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){return(u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,u=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,t)||h(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e,t){if(e){if("string"==typeof e)return f(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return f(e,t)}}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var d=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=[],n=null;return e.forEach(function(e){if(n){var i=180*(0,o.A)(e,n)/Math.PI;if(i>t)for(var s=(0,a.A)(n,e),l=1/Math.ceil(i/t),u=l;u<1;)r.push(s(u)),u+=l}r.push(n=e)}),r},p="undefined"!=typeof window&&window.THREE?window.THREE:{BufferGeometry:n.BufferGeometry,Float32BufferAttribute:n.Float32BufferAttribute},m=new p.BufferGeometry().setAttribute?"setAttribute":"addAttribute",g=function(e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function t(e){var r,n,o,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5;if(!(this instanceof t))throw TypeError("Cannot call a class as a function");r=l(r=t),(o=function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,s()?Reflect.construct(r,[],l(this).constructor):r.apply(this,n))).type="GeoJsonGeometry",o.parameters={geoJson:e,radius:a,resolution:u};var h=(({Point:_,MultiPoint:function(e,t){var r={vertices:[],indices:[]};return e.map(function(e){return _(e,t)}).forEach(function(e){v(r,c(e,1)[0])}),[r]},LineString:b,MultiLineString:function(e,t){var r={vertices:[],indices:[]};return e.map(function(e){return b(e,t)}).forEach(function(e){v(r,c(e,1)[0])}),[r]},Polygon:B,MultiPolygon:function(e,t){var r={vertices:[],indices:[]},n={vertices:[],indices:[]};e.map(function(e){return B(e,t)}).forEach(function(e){var t=c(e,2),i=t[0],o=t[1];v(r,i),o&&v(n,o)});var i=[r];return n.vertices.length&&i.push(n),i}})[e.type]||function(){return[]})(e.coordinates,a),f=[],g=[],y=0;function _(e,t){return[{vertices:A(e[1],e[0],t),indices:[]}]}function b(e,t){for(var r=d(e,u).map(function(e){var r=c(e,2),n=r[0];return A(r[1],n,t)}),n=i.flatten([r]).vertices,o=Math.round(n.length/3),a=[],s=1;s<o;s++)a.push(s-1,s);return[{vertices:n,indices:a}]}function B(e,t){for(var r=e.map(function(e){return d(e,u).map(function(e){var r=c(e,2),n=r[0];return A(r[1],n,t)})}),n=i.flatten(r),o=n.vertices,a=n.holes,s=a[0]||1/0,l=o.slice(0,3*s),h=o.slice(3*s),f=new Set(a),p=Math.round(o.length/3),m=[],g=[],v=1;v<p;v++)f.has(v)||(v<s?m.push(v-1,v):g.push(v-1-s,v-s));var y=[{indices:m,vertices:l}];return a.length&&y.push({indices:g,vertices:h}),y}return h.forEach(function(e){var t=f.length;v({indices:f,vertices:g},e),o.addGroup(t,f.length-t,y++)}),f.length&&o.setIndex(f),g.length&&o[m]("position",new p.Float32BufferAttribute(g,3)),o}return t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&u(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(p.BufferGeometry);function v(e,t){var r=Math.round(e.vertices.length/3);y(e.vertices,t.vertices),y(e.indices,t.indices.map(function(e){return e+r}))}function y(e,t){var r,n=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=h(e))){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}
114}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}(t);try{for(n.s();!(r=n.n()).done;){var i=r.value;e.push(i)}}catch(e){n.e(e)}finally{n.f()}}function A(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=(90-e)*Math.PI/180,i=(90-t)*Math.PI/180;return[r*Math.sin(n)*Math.cos(i),r*Math.cos(n),r*Math.sin(n)*Math.sin(i)]}},3202:(e,t,r)=>{var n=r(72);function i(e){this.bounds=e,this.q0=null,this.q1=null,this.q2=null,this.q3=null,this.q4=null,this.q5=null,this.q6=null,this.q7=null,this.items=null}e.exports=i,i.prototype.subdivide=function(){var e=this.bounds,t=e.half/2;this.q0=new i(new n(e.x-t,e.y-t,e.z-t,t)),this.q1=new i(new n(e.x+t,e.y-t,e.z-t,t)),this.q2=new i(new n(e.x-t,e.y+t,e.z-t,t)),this.q3=new i(new n(e.x+t,e.y+t,e.z-t,t)),this.q4=new i(new n(e.x-t,e.y-t,e.z+t,t)),this.q5=new i(new n(e.x+t,e.y-t,e.z+t,t)),this.q6=new i(new n(e.x-t,e.y+t,e.z+t,t)),this.q7=new i(new n(e.x+t,e.y+t,e.z+t,t))},i.prototype.insert=function(e,t,r){if(null===this.q0){if(null===this.items?this.items=[e]:this.items.push(e),this.items.length>=4&&r<16){this.subdivide();for(var n=0;n<this.items.length;++n)this.insert(this.items[n],t,r+1);this.items=null}}else{var i,o,a=t[e],s=t[e+1],l=t[e+2],u=this.bounds,c=0;a>u.x&&(c+=1),s>u.y&&(c+=2),l>u.z&&(c+=4),(i=this,0===(o=c)?i.q0:1===o?i.q1:2===o?i.q2:3===o?i.q3:4===o?i.q4:5===o?i.q5:6===o?i.q6:7===o?i.q7:void 0).insert(e,t,r+1)}},i.prototype.query=function(e,t,r,n){if(r(this.bounds)){var i=this.items,o="function"==typeof n;if(i)for(var a=0;a<i.length;++a){var s=i[a];o?n(t[s],t[s+1],t[s+2])&&e.push(s):e.push(s)}this.q0&&(this.q0.query(e,t,r,n),this.q1.query(e,t,r,n),this.q2.query(e,t,r,n),this.q3.query(e,t,r,n),this.q4.query(e,t,r,n),this.q5.query(e,t,r,n),this.q6.query(e,t,r,n),this.q7.query(e,t,r,n))}}},3354:(e,t,r)=>{"use strict";let n,i,o,a,s;r.d(t,{A:()=>ee,B:()=>S,C:()=>et,E:()=>O,F:()=>ei,a:()=>T,b:()=>M,c:()=>eC,d:()=>eE,e:()=>eu,f:()=>ej,i:()=>w,j:()=>eR,o:()=>eM,q:()=>K,u:()=>F});var l=r(1698),u=r(23),c=r(7678),h=r(8896);let f=e=>{let t,r=new Set,n=(e,n)=>{let i="function"==typeof e?e(t):e;if(!Object.is(i,t)){let e=t;t=(null!=n?n:"object"!=typeof i||null===i)?i:Object.assign({},t,i),r.forEach(r=>r(t,e))}},i=()=>t,o={setState:n,getState:i,getInitialState:()=>a,subscribe:e=>(r.add(e),()=>r.delete(e))},a=t=e(n,i,o);return o},{useSyncExternalStoreWithSelector:d}=h,p=(e,t)=>{let r=(e=>e?f(e):f)(e),n=(e,n=t)=>(function(e,t=e=>e,r){let n=d(e.subscribe,e.getState,e.getInitialState,t,r);return u.useDebugValue(n),n})(r,e,n);return Object.assign(n,r),n},m=(e,t)=>e?p(e,t):p;var g=r(2863),v=r.n(g),y=r(2368);let A=[];function _(e,t,r=(e,t)=>e===t){if(e===t)return!0;if(!e||!t)return!1;let n=e.length;if(t.length!==n)return!1;for(let i=0;i<n;i++)if(!r(e[i],t[i]))return!1;return!0}function b(e,t=null,r=!1,n={}){for(let i of(null===t&&(t=[e]),A))if(_(t,i.keys,i.equal)){if(r)return;if(Object.prototype.hasOwnProperty.call(i,"error"))throw i.error;if(Object.prototype.hasOwnProperty.call(i,"response"))return n.lifespan&&n.lifespan>0&&(i.timeout&&clearTimeout(i.timeout),i.timeout=setTimeout(i.remove,n.lifespan)),i.response;if(!r)throw i.promise}let i={keys:t,equal:n.equal,remove:()=>{let e=A.indexOf(i);-1!==e&&A.splice(e,1)},promise:("object"==typeof e&&"function"==typeof e.then?e:e(...t)).then(e=>{i.response=e,n.lifespan&&n.lifespan>0&&(i.timeout=setTimeout(i.remove,n.lifespan))}).catch(e=>i.error=e)};if(A.push(i),!r)throw i.promise}var B=r(1087),x=r(2861);function C(e){let t=e.root;for(;t.getState().previousRoot;)t=t.getState().previousRoot;return t}r(9236),u.act;let w=e=>e&&e.hasOwnProperty("current"),E=e=>null!=e&&("string"==typeof e||"number"==typeof e||e.isColor),M=((e,t)=>"undefined"!=typeof window&&((null==(e=window.document)?void 0:e.createElement)||(null==(t=window.navigator)?void 0:t.product)==="ReactNative"))()?u.useLayoutEffect:u.useEffect;function T(e){let t=u.useRef(e);return M(()=>void(t.current=e),[e]),t}function F(){let e=(0,x.u5)(),t=(0,x.y3)();return u.useMemo(()=>({children:r})=>{let n=(0,x.Nz)(e,!0,e=>e.type===u.StrictMode)?u.StrictMode:u.Fragment;return(0,B.jsx)(n,{children:(0,B.jsx)(t,{children:r})})},[e,t])}function S({set:e}){return M(()=>(e(new Promise(()=>null)),()=>e(!1)),[e]),null}let O=(e=>((e=class extends u.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}}).getDerivedStateFromError=()=>({error:!0}),e))();function R(e){var t;let r="undefined"!=typeof window?null!=(t=window.devicePixelRatio)?t:2:1;return Array.isArray(e)?Math.min(Math.max(e[0],r),e[1]):e}function I(e){var t;return null==(t=e.__r3f)?void 0:t.root.getState()}let P={obj:e=>e===Object(e)&&!P.arr(e)&&"function"!=typeof e,fun:e=>"function"==typeof e,str:e=>"string"==typeof e,num:e=>"number"==typeof e,boo:e=>"boolean"==typeof e,und:e=>void 0===e,nul:e=>null===e,arr:e=>Array.isArray(e),equ(e,t,{arrays:r="shallow",objects:n="reference",strict:i=!0}={}){let o;if(typeof e!=typeof t||!!e!=!!t)return!1;if(P.str(e)||P.num(e)||P.boo(e))return e===t;let a=P.obj(e);if(a&&"reference"===n)return e===t;let s=P.arr(e);if(s&&"reference"===r)return e===t;if((s||a)&&e===t)return!0;for(o in e)if(!(o in t))return!1;if(a&&"shallow"===r&&"shallow"===n){for(o in i?t:e)if(!P.equ(e[o],t[o],{strict:i,objects:"reference"}))return!1}else for(o in i?t:e)if(e[o]!==t[o])return!1;if(P.und(o)){if(s&&0===e.length&&0===t.length||a&&0===Object.keys(e).length&&0===Object.keys(t).length)return!0;
114if(e!==t)return!1}return!0}},D=["children","key","ref"];function H(e,t,r,n){let i=null==e?void 0:e.__r3f;return!i&&(i={root:t,type:r,parent:null,children:[],props:function(e){let t={};for(let r in e)D.includes(r)||(t[r]=e[r]);return t}(n),object:e,eventCount:0,handlers:{},isHidden:!1},e&&(e.__r3f=i)),i}function L(e,t){let r=e[t];if(!t.includes("-"))return{root:e,key:t,target:r};for(let i of(r=e,t.split("-"))){var n;t=i,e=r,r=null==(n=r)?void 0:n[t]}return{root:e,key:t,target:r}}let G=/-\d+$/;function U(e,t){if(P.str(t.props.attach)){if(G.test(t.props.attach)){let r=t.props.attach.replace(G,""),{root:n,key:i}=L(e.object,r);Array.isArray(n[i])||(n[i]=[])}let{root:r,key:n}=L(e.object,t.props.attach);t.previousAttach=r[n],r[n]=t.object}else P.fun(t.props.attach)&&(t.previousAttach=t.props.attach(e.object,t.object))}function k(e,t){if(P.str(t.props.attach)){let{root:r,key:n}=L(e.object,t.props.attach),i=t.previousAttach;void 0===i?delete r[n]:r[n]=i}else null==t.previousAttach||t.previousAttach(e.object,t.object);delete t.previousAttach}let N=[...D,"args","dispose","attach","object","onUpdate","dispose"],j=new Map,J=["map","emissiveMap","sheenColorMap","specularColorMap","envMap"],z=/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/;function K(e,t){var r,n;let i=e.__r3f,o=i&&C(i).getState(),a=null==i?void 0:i.eventCount;for(let r in t){let a=t[r];if(N.includes(r))continue;if(i&&z.test(r)){"function"==typeof a?i.handlers[r]=a:delete i.handlers[r],i.eventCount=Object.keys(i.handlers).length;continue}if(void 0===a)continue;let{root:s,key:u,target:c}=L(e,r);c instanceof l.Layers&&a instanceof l.Layers?c.mask=a.mask:c instanceof l.Color&&E(a)?c.set(a):null!==c&&"object"==typeof c&&"function"==typeof c.set&&"function"==typeof c.copy&&null!=a&&a.constructor&&c.constructor===a.constructor?c.copy(a):null!==c&&"object"==typeof c&&"function"==typeof c.set&&Array.isArray(a)?"function"==typeof c.fromArray?c.fromArray(a):c.set(...a):null!==c&&"object"==typeof c&&"function"==typeof c.set&&"number"==typeof a?"function"==typeof c.setScalar?c.setScalar(a):c.set(a):(s[u]=a,o&&!o.linear&&J.includes(u)&&null!=(n=s[u])&&n.isTexture&&s[u].format===l.RGBAFormat&&s[u].type===l.UnsignedByteType&&(s[u].colorSpace=l.SRGBColorSpace))}if(null!=i&&i.parent&&null!=o&&o.internal&&null!=(r=i.object)&&r.isObject3D&&a!==i.eventCount){let e=i.object,t=o.internal.interaction.indexOf(e);t>-1&&o.internal.interaction.splice(t,1),i.eventCount&&null!==e.raycast&&o.internal.interaction.push(e)}return i&&void 0===i.props.attach&&(i.object.isBufferGeometry?i.props.attach="geometry":i.object.isMaterial&&(i.props.attach="material")),i&&V(i),e}function V(e){var t;if(!e.parent)return;null==e.props.onUpdate||e.props.onUpdate(e.object);let r=null==(t=e.root)||null==t.getState?void 0:t.getState();r&&0===r.internal.frames&&r.invalidate()}function Q(e,t){!e.manual&&(e&&e.isOrthographicCamera?(e.left=-(t.width/2),e.right=t.width/2,e.top=t.height/2,e.bottom=-(t.height/2)):e.aspect=t.width/t.height,e.updateProjectionMatrix())}let X=e=>null==e?void 0:e.isObject3D;function Y(e){return(e.eventObject||e.object).uuid+"/"+e.index+e.instanceId}function Z(e,t,r,n){let i=r.get(t);i&&(r.delete(t),0===r.size&&(e.delete(n),i.target.releasePointerCapture(n)))}let q=e=>!!(null!=e&&e.render),W=u.createContext(null);function $(){let e=u.useContext(W);if(!e)throw Error("R3F: Hooks can only be used within the Canvas component!");return e}function ee(e=e=>e,t){return $()(e,t)}function et(e,t=0){let r=$(),n=r.getState().internal.subscribe,i=T(e);return M(()=>n(i,t,r),[t,n,r]),null}let er=new WeakMap;function en(e,t){return function(r,...n){var i;let o;return"function"==typeof r&&(null==r||null==(i=r.prototype)?void 0:i.constructor)===r?(o=er.get(r))||(o=new r,er.set(r,o)):o=r,e&&e(o),Promise.all(n.map(e=>new Promise((r,n)=>o.load(e,e=>{X(null==e?void 0:e.scene)&&Object.assign(e,function(e){let t={nodes:{},materials:{},meshes:{}};return e&&e.traverse(e=>{e.name&&(t.nodes[e.name]=e),e.material&&!t.materials[e.material.name]&&(t.materials[e.material.name]=e.material),e.isMesh&&!t.meshes[e.name]&&(t.meshes[e.name]=e)}),t}(e.scene)),r(e)},t,t=>n(Error(`Could not load ${e}: ${null==t?void 0:t.message}`))))))}}function ei(e,t,r,n){let i=Array.isArray(t)?t:[t],o=b(en(r,n),[e,...i],!1,{equal:P.equ});return Array.isArray(t)?o:o[0]}ei.preload=function(e,t,r){let n,i=Array.isArray(t)?t:[t];b(en(r),[e,...i],!0,n)},ei.clear=function(e,t){var r=[e,...Array.isArray(t)?t:[t]];if(void 0===r||0===r.length)A.splice(0,A.length);else{let e=A.find(e=>_(r,e.keys,e.equal));e&&e.remove()}};let eo={},ea=/^three(?=[A-Z])/,es=e=>`${e[0].toUpperCase()}${e.slice(1)}`,el=0;function eu(e){if("function"==typeof e){let t=`${el++}`;return eo[t]=e,t}Object.assign(eo,e)}function ec(e,t){let r=es(e),n=eo[r];if("primitive"!==e&&!n)throw Error(`R3F: ${r} is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively`);if("primitive"===e&&!t.object)throw Error("R3F: Primitives without 'object' are invalid!");if(void 0!==t.args&&!Array.isArray(t.args))throw Error("R3F: The args prop must be an array!")}function eh(e){if(e.isHidden){var t;e.props.attach&&null!=(t=e.parent)&&t.object?U(e.parent,e):X(e.object)&&!1!==e.props.visible&&(e.object.visible=!0),e.isHidden=!1,V(e)}}function ef(e,t,r){let n=t.root.getState();if(e.parent||e.object===n.scene){if(!t.object){var i,o;let e=eo[es(t.type)];t.object=null!=(i=t.props.object)?i:new e(...null!=(o=t.props.args
114)?o:[]),t.object.__r3f=t}if(K(t.object,t.props),t.props.attach)U(e,t);else if(X(t.object)&&X(e.object)){let n=e.object.children.indexOf(null==r?void 0:r.object);if(r&&-1!==n){let r=e.object.children.indexOf(t.object);-1!==r?(e.object.children.splice(r,1),e.object.children.splice(r<n?n-1:n,0,t.object)):(t.object.parent=e.object,e.object.children.splice(n,0,t.object),t.object.dispatchEvent({type:"added"}),e.object.dispatchEvent({type:"childadded",child:t.object}))}else e.object.add(t.object)}for(let e of t.children)ef(t,e);V(t)}}function ed(e,t){t&&(t.parent=e,e.children.push(t),ef(e,t))}function ep(e,t,r){if(!t||!r)return;t.parent=e;let n=e.children.indexOf(r);-1!==n?e.children.splice(n,0,t):e.children.push(t),ef(e,t,r)}function em(e){if("function"==typeof e.dispose){let t=()=>{try{e.dispose()}catch{}};"undefined"!=typeof IS_REACT_ACT_ENVIRONMENT?t():(0,y.unstable_scheduleCallback)(y.unstable_IdlePriority,t)}}function eg(e,t,r){if(!t)return;t.parent=null;let n=e.children.indexOf(t);-1!==n&&e.children.splice(n,1),t.props.attach?k(e,t):X(t.object)&&X(e.object)&&(e.object.remove(t.object),function(e,t){let{internal:r}=e.getState();r.interaction=r.interaction.filter(e=>e!==t),r.initialHits=r.initialHits.filter(e=>e!==t),r.hovered.forEach((e,n)=>{(e.eventObject===t||e.object===t)&&r.hovered.delete(n)}),r.capturedMap.forEach((e,n)=>{Z(r.capturedMap,t,e,n)})}(C(t),t.object));let i=null!==t.props.dispose&&!1!==r;for(let e=t.children.length-1;e>=0;e--){let r=t.children[e];eg(t,r,i)}t.children.length=0,delete t.object.__r3f,i&&"primitive"!==t.type&&"Scene"!==t.object.type&&em(t.object),void 0===r&&V(t)}let ev=[],ey=()=>{},eA={},e_=0,eb=function(e){let t=v()(e);return t.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:u.version}),t}({isPrimaryRenderer:!1,warnsIfNotActing:!1,supportsMutation:!0,supportsPersistence:!1,supportsHydration:!1,createInstance:function(e,t,r){var n;return ec(e=es(e)in eo?e:e.replace(ea,""),t),"primitive"===e&&null!=(n=t.object)&&n.__r3f&&delete t.object.__r3f,H(t.object,r,e,t)},removeChild:eg,appendChild:ed,appendInitialChild:ed,insertBefore:ep,appendChildToContainer(e,t){let r=e.getState().scene.__r3f;t&&r&&ed(r,t)},removeChildFromContainer(e,t){let r=e.getState().scene.__r3f;t&&r&&eg(r,t)},insertInContainerBefore(e,t,r){let n=e.getState().scene.__r3f;t&&r&&n&&ep(n,t,r)},getRootHostContext:()=>eA,getChildHostContext:()=>eA,commitUpdate(e,t,r,n,i){var o,a,s;ec(t,n);let l=!1;if("primitive"===e.type&&r.object!==n.object||(null==(o=n.args)?void 0:o.length)!==(null==(a=r.args)?void 0:a.length)?l=!0:null!=(s=n.args)&&s.some((e,t)=>{var n;return e!==(null==(n=r.args)?void 0:n[t])})&&(l=!0),l)ev.push([e,{...n},i]);else{let t=function(e,t){let r={};for(let n in t)if(!N.includes(n)&&!P.equ(t[n],e.props[n]))for(let e in r[n]=t[n],t)e.startsWith(`${n}-`)&&(r[e]=t[e]);for(let n in e.props){if(N.includes(n)||t.hasOwnProperty(n))continue;let{root:i,key:o}=L(e.object,n);if(i.constructor&&0===i.constructor.length){let e=function(e){let t=j.get(e.constructor);try{t||(t=new e.constructor,j.set(e.constructor,t))}catch(e){}return t}(i);P.und(e)||(r[o]=e[o])}else r[o]=0}return r}(e,n);Object.keys(t).length&&(Object.assign(e.props,t),K(e.object,t))}(null===i.sibling||(4&i.flags)==0)&&function(){for(let[e]of ev){let t=e.parent;if(t)for(let r of(e.props.attach?k(t,e):X(e.object)&&X(t.object)&&t.object.remove(e.object),e.children))r.props.attach?k(e,r):X(r.object)&&X(e.object)&&e.object.remove(r.object);e.isHidden&&eh(e),e.object.__r3f&&delete e.object.__r3f,"primitive"!==e.type&&em(e.object)}for(let[n,i,o]of ev){n.props=i;let a=n.parent;if(a){let i=eo[es(n.type)];n.object=null!=(e=n.props.object)?e:new i(...null!=(t=n.props.args)?t:[]),n.object.__r3f=n;var e,t,r=n.object;for(let e of[o,o.alternate])if(null!==e)if("function"==typeof e.ref){null==e.refCleanup||e.refCleanup();let t=e.ref(r);"function"==typeof t&&(e.refCleanup=t)}else e.ref&&(e.ref.current=r);for(let e of(K(n.object,n.props),n.props.attach?U(a,n):X(n.object)&&X(a.object)&&a.object.add(n.object),n.children))e.props.attach?U(n,e):X(e.object)&&X(n.object)&&n.object.add(e.object);V(n)}}ev.length=0}()},finalizeInitialChildren:()=>!1,commitMount(){},getPublicInstance:e=>null==e?void 0:e.object,prepareForCommit:()=>null,preparePortalMount:e=>H(e.getState().scene,e,"",{}),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance:function(e){if(!e.isHidden){var t;e.props.attach&&null!=(t=e.parent)&&t.object?k(e.parent,e):X(e.object)&&(e.object.visible=!1),e.isHidden=!0,V(e)}},unhideInstance:eh,createTextInstance:ey,hideTextInstance:ey,unhideTextInstance:ey,scheduleTimeout:"function"==typeof setTimeout?setTimeout:void 0,cancelTimeout:"function"==typeof clearTimeout?clearTimeout:void 0,noTimeout:-1,getInstanceFromNode:()=>null,beforeActiveInstanceBlur(){},afterActiveInstanceBlur(){},detachDeletedInstance(){}
114,prepareScopeUpdate(){},getInstanceFromScope:()=>null,shouldAttemptEagerTransition:()=>!1,trackSchedulerEvent:()=>{},resolveEventType:()=>null,resolveEventTimeStamp:()=>-1.1,requestPostPaintCallback(){},maySuspendCommit:()=>!1,preloadInstance:()=>!0,startSuspendingCommit(){},suspendInstance(){},waitForCommitToBeReady:()=>null,NotPendingTransition:null,HostTransitionContext:u.createContext(null),setCurrentUpdatePriority(e){e_=e},getCurrentUpdatePriority:()=>e_,resolveUpdatePriority(){var e;if(0!==e_)return e_;switch("undefined"!=typeof window&&(null==(e=window.event)?void 0:e.type)){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return c.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return c.ContinuousEventPriority;default:return c.DefaultEventPriority}},resetFormInstance(){}}),eB=new Map,ex={objects:"shallow",strict:!1};function eC(e){let t,r,n=eB.get(e),i=null==n?void 0:n.fiber,o=null==n?void 0:n.store;n&&console.warn("R3F.createRoot should only be called once!");let a="function"==typeof reportError?reportError:console.error,s=o||((e,t)=>{let r=m((r,n)=>{let i,o=new l.Vector3,a=new l.Vector3,s=new l.Vector3;function c(e=n().camera,t=a,r=n().size){let{width:i,height:l,top:u,left:h}=r,f=i/l;t.isVector3?s.copy(t):s.set(...t);let d=e.getWorldPosition(o).distanceTo(s);if(e&&e.isOrthographicCamera)return{width:i/e.zoom,height:l/e.zoom,top:u,left:h,factor:1,distance:d,aspect:f};{let t=2*Math.tan(e.fov*Math.PI/180/2)*d,r=i/l*t;return{width:r,height:t,top:u,left:h,factor:i/r,distance:d,aspect:f}}}let h=e=>r(t=>({performance:{...t.performance,current:e}})),f=new l.Vector2;return{set:r,get:n,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},scene:null,xr:null,invalidate:(t=1)=>e(n(),t),advance:(e,r)=>t(e,r,n()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new l.Clock,pointer:f,mouse:f,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{let e=n();i&&clearTimeout(i),e.performance.current!==e.performance.min&&h(e.performance.min),i=setTimeout(()=>h(n().performance.max),e.performance.debounce)}},size:{width:0,height:0,top:0,left:0},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:c},setEvents:e=>r(t=>({...t,events:{...t.events,...e}})),setSize:(e,t,i=0,o=0)=>{let s=n().camera,l={width:e,height:t,top:i,left:o};r(e=>({size:l,viewport:{...e.viewport,...c(s,a,l)}}))},setDpr:e=>r(t=>{let r=R(e);return{viewport:{...t.viewport,dpr:r,initialDpr:t.viewport.initialDpr||r}}}),setFrameloop:(e="always")=>{let t=n().clock;t.stop(),t.elapsedTime=0,"never"!==e&&(t.start(),t.elapsedTime=0),r(()=>({frameloop:e}))},previousRoot:void 0,internal:{interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,lastEvent:u.createRef(),active:!1,frames:0,priority:0,subscribe:(e,t,r)=>{let i=n().internal;return i.priority=i.priority+ +(t>0),i.subscribers.push({ref:e,priority:t,store:r}),i.subscribers=i.subscribers.sort((e,t)=>e.priority-t.priority),()=>{let r=n().internal;null!=r&&r.subscribers&&(r.priority=r.priority-(t>0),r.subscribers=r.subscribers.filter(t=>t.ref!==e))}}}}}),n=r.getState(),i=n.size,o=n.viewport.dpr,a=n.camera;return r.subscribe(()=>{let{camera:e,size:t,viewport:n,gl:s,set:l}=r.getState();if(t.width!==i.width||t.height!==i.height||n.dpr!==o){i=t,o=n.dpr,Q(e,t),n.dpr>0&&s.setPixelRatio(n.dpr);let r="undefined"!=typeof HTMLCanvasElement&&s.domElement instanceof HTMLCanvasElement;s.setSize(t.width,t.height,r)}e!==a&&(a=e,l(t=>({viewport:{...t.viewport,...t.viewport.getCurrentViewport(e)}})))}),r.subscribe(t=>e(t)),r})(eU,ek),h=i||eb.createContainer(s,c.ConcurrentRoot,null,!1,null,"",a,a,a,null);n||eB.set(e,{fiber:h,store:s});let f=!1,d=null;return{async configure(n={}){var i,o;let a;d=new Promise(e=>a=e);let{gl:u,size:c,scene:h,events:p,onCreated:m,shadows:g=!1,linear:v=!1,flat:y=!1,legacy:A=!1,orthographic:_=!1,frameloop:b="always",dpr:B=[1,2],performance:x,raycaster:C,camera:w,onPointerMissed:E}
114=n,M=s.getState(),T=M.gl;if(!M.gl){let t={canvas:e,powerPreference:"high-performance",antialias:!0,alpha:!0},r="function"==typeof u?await u(t):u;T=q(r)?r:new l.WebGLRenderer({...t,...u}),M.set({gl:T})}let F=M.raycaster;F||M.set({raycaster:F=new l.Raycaster});let{params:S,...O}=C||{};if(P.equ(O,F,ex)||K(F,{...O}),P.equ(S,F.params,ex)||K(F,{params:{...F.params,...S}}),!M.camera||M.camera===r&&!P.equ(r,w,ex)){r=w;let e=null==w?void 0:w.isCamera,t=e?w:_?new l.OrthographicCamera(0,0,0,0,.1,1e3):new l.PerspectiveCamera(75,0,.1,1e3);!e&&(t.position.z=5,w&&(K(t,w),!t.manual&&("aspect"in w||"left"in w||"right"in w||"bottom"in w||"top"in w)&&(t.manual=!0,t.updateProjectionMatrix())),M.camera||null!=w&&w.rotation||t.lookAt(0,0,0)),M.set({camera:t}),F.camera=t}if(!M.scene){let e;null!=h&&h.isScene?H(e=h,s,"",{}):(H(e=new l.Scene,s,"",{}),h&&K(e,h)),M.set({scene:e})}p&&!M.events.handlers&&M.set({events:p(s)});let I=function(e,t){if(!t&&"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement&&e.parentElement){let{width:t,height:r,top:n,left:i}=e.parentElement.getBoundingClientRect();return{width:t,height:r,top:n,left:i}}return!t&&"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas?{width:e.width,height:e.height,top:0,left:0}:{width:0,height:0,top:0,left:0,...t}}(e,c);if(P.equ(I,M.size,ex)||M.setSize(I.width,I.height,I.top,I.left),B&&M.viewport.dpr!==R(B)&&M.setDpr(B),M.frameloop!==b&&M.setFrameloop(b),M.onPointerMissed||M.set({onPointerMissed:E}),x&&!P.equ(x,M.performance,ex)&&M.set(e=>({performance:{...e.performance,...x}})),!M.xr){let e=(e,t)=>{let r=s.getState();"never"!==r.frameloop&&ek(e,!0,r,t)},t=()=>{let t=s.getState();t.gl.xr.enabled=t.gl.xr.isPresenting,t.gl.xr.setAnimationLoop(t.gl.xr.isPresenting?e:null),t.gl.xr.isPresenting||eU(t)},r={connect(){let e=s.getState().gl;e.xr.addEventListener("sessionstart",t),e.xr.addEventListener("sessionend",t)},disconnect(){let e=s.getState().gl;e.xr.removeEventListener("sessionstart",t),e.xr.removeEventListener("sessionend",t)}};"function"==typeof(null==(i=T.xr)?void 0:i.addEventListener)&&r.connect(),M.set({xr:r})}if(T.shadowMap){let e=T.shadowMap.enabled,t=T.shadowMap.type;if(T.shadowMap.enabled=!!g,P.boo(g))T.shadowMap.type=l.PCFSoftShadowMap;else if(P.str(g)){let e={basic:l.BasicShadowMap,percentage:l.PCFShadowMap,soft:l.PCFSoftShadowMap,variance:l.VSMShadowMap};T.shadowMap.type=null!=(o=e[g])?o:l.PCFSoftShadowMap}else P.obj(g)&&Object.assign(T.shadowMap,g);(e!==T.shadowMap.enabled||t!==T.shadowMap.type)&&(T.shadowMap.needsUpdate=!0)}return l.ColorManagement.enabled=!A,f||(T.outputColorSpace=v?l.LinearSRGBColorSpace:l.SRGBColorSpace,T.toneMapping=y?l.NoToneMapping:l.ACESFilmicToneMapping),M.legacy!==A&&M.set(()=>({legacy:A})),M.linear!==v&&M.set(()=>({linear:v})),M.flat!==y&&M.set(()=>({flat:y})),!u||P.fun(u)||q(u)||P.equ(u,T,ex)||K(T,u),t=m,f=!0,a(),this},render(r){return f||d||this.configure(),d.then(()=>{eb.updateContainer((0,B.jsx)(ew,{store:s,children:r,onCreated:t,rootElement:e}),h,null,()=>void 0)}),s},unmount(){eE(e)}}}function ew({store:e,children:t,onCreated:r,rootElement:n}){return M(()=>{let t=e.getState();t.set(e=>({internal:{...e.internal,active:!0}})),r&&r(t),e.getState().events.connected||null==t.events.connect||t.events.connect(n)},[]),(0,B.jsx)(W.Provider,{value:e,children:t})}function eE(e,t){let r=eB.get(e),n=null==r?void 0:r.fiber;if(n){let i=null==r?void 0:r.store.getState();i&&(i.internal.active=!1),eb.updateContainer(null,n,null,()=>{i&&setTimeout(()=>{try{null==i.events.disconnect||i.events.disconnect(),null==(r=i.gl)||null==(n=r.renderLists)||null==n.dispose||n.dispose(),null==(o=i.gl)||null==o.forceContextLoss||o.forceContextLoss(),null!=(a=i.gl)&&a.xr&&i.xr.disconnect();var r,n,o,a,s=i.scene;for(let e in"Scene"!==s.type&&(null==s.dispose||s.dispose()),s){let t=s[e];(null==t?void 0:t.type)!=="Scene"&&(null==t||null==t.dispose||t.dispose())}eB.delete(e),t&&t(e)}catch(e){}},500)})}}function eM(e,t,r){return(0,B.jsx)(eT,{children:e,container:t,state:r})}function eT({state:e={},children:t,container:r}){let{events:n,size:i,...o}=e,a=$(),[s]=u.useState(()=>new l.Raycaster),[c]=u.useState(()=>new l.Vector2),h=T((e,t)=>
114{let o;if(t.camera&&i){let r=t.camera;o=e.viewport.getCurrentViewport(r,new l.Vector3,i),r!==e.camera&&Q(r,i)}return{...e,...t,scene:r,raycaster:s,pointer:c,mouse:c,previousRoot:a,events:{...e.events,...t.events,...n},size:{...e.size,...i},viewport:{...e.viewport,...o},setEvents:e=>t.set(t=>({...t,events:{...t.events,...e}}))}}),f=u.useMemo(()=>{let e=m((e,t)=>({...o,set:e,get:t})),t=t=>e.setState(e=>h.current(t,e));return t(a.getState()),a.subscribe(t),e},[a,r]);return(0,B.jsx)(B.Fragment,{children:eb.createPortal((0,B.jsx)(W.Provider,{value:f,children:t}),f,null)})}let eF=new Set,eS=new Set,eO=new Set,eR=e=>(function(e,t){let r={callback:e};return t.add(r),()=>void t.delete(r)})(e,eF);function eI(e,t){if(e.size)for(let{callback:r}of e.values())r(t)}function eP(e,t){switch(e){case"before":return eI(eF,t);case"after":return eI(eS,t);case"tail":return eI(eO,t)}}function eD(e,t,r){let o=t.clock.getDelta();"never"===t.frameloop&&"number"==typeof e&&(o=e-t.clock.elapsedTime,t.clock.oldTime=t.clock.elapsedTime,t.clock.elapsedTime=e),n=t.internal.subscribers;for(let e=0;e<n.length;e++)(i=n[e]).ref.current(i.store.getState(),o,r);return!t.internal.priority&&t.gl.render&&t.gl.render(t.scene,t.camera),t.internal.frames=Math.max(0,t.internal.frames-1),"always"===t.frameloop?1:t.internal.frames}let eH=!1,eL=!1;function eG(e){for(let r of(a=requestAnimationFrame(eG),eH=!0,o=0,eP("before",e),eL=!0,eB.values())){var t;(s=r.store.getState()).internal.active&&("always"===s.frameloop||s.internal.frames>0)&&!(null!=(t=s.gl.xr)&&t.isPresenting)&&(o+=eD(e,s))}if(eL=!1,eP("after",e),0===o)return eP("tail",e),eH=!1,cancelAnimationFrame(a)}function eU(e,t=1){var r;if(!e)return eB.forEach(e=>eU(e.store.getState(),t));(null==(r=e.gl.xr)||!r.isPresenting)&&e.internal.active&&"never"!==e.frameloop&&(t>1?e.internal.frames=Math.min(60,e.internal.frames+t):eL?e.internal.frames=2:e.internal.frames=1,eH||(eH=!0,requestAnimationFrame(eG)))}function ek(e,t=!0,r,n){if(t&&eP("before",e),r)eD(e,r,n);else for(let t of eB.values())eD(e,t.store.getState());t&&eP("after",e)}let eN={onClick:["click",!1],onContextMenu:["contextmenu",!1],onDoubleClick:["dblclick",!1],onWheel:["wheel",!0],onPointerDown:["pointerdown",!0],onPointerUp:["pointerup",!0],onPointerLeave:["pointerleave",!0],onPointerMove:["pointermove",!0],onPointerCancel:["pointercancel",!0],onLostPointerCapture:["lostpointercapture",!0]};function ej(e){let{handlePointer:t}=function(e){function t(e){return e.filter(e=>["Move","Over","Enter","Out","Leave"].some(t=>{var r;return null==(r=e.__r3f)?void 0:r.handlers["onPointer"+t]}))}function r(t){let{internal:r}=e.getState();for(let e of r.hovered.values())if(!t.length||!t.find(t=>t.object===e.object&&t.index===e.index&&t.instanceId===e.instanceId)){let n=e.eventObject.__r3f;if(r.hovered.delete(Y(e)),null!=n&&n.eventCount){let r=n.handlers,i={...e,intersections:t};null==r.onPointerOut||r.onPointerOut(i),null==r.onPointerLeave||r.onPointerLeave(i)}}}function n(e,t){for(let r=0;r<t.length;r++){let n=t[r].__r3f;null==n||null==n.handlers.onPointerMissed||n.handlers.onPointerMissed(e)}}return{handlePointer:function(i){switch(i){case"onPointerLeave":case"onPointerCancel":return()=>r([]);case"onLostPointerCapture":return t=>{let{internal:n}=e.getState();"pointerId"in t&&n.capturedMap.has(t.pointerId)&&requestAnimationFrame(()=>{n.capturedMap.has(t.pointerId)&&(n.capturedMap.delete(t.pointerId),r([]))})}}return function(o){let{onPointerMissed:a,internal:s}=e.getState();s.lastEvent.current=o;let u="onPointerMove"===i,c="onClick"===i||"onContextMenu"===i||"onDoubleClick"===i,h=function(t,r){let n=e.getState(),i=new Set,o=[],a=r?r(n.internal.interaction):n.internal.interaction;for(let e=0;e<a.length;e++){let t=I(a[e]);t&&(t.raycaster.camera=void 0)}n.previousRoot||null==n.events.compute||n.events.compute(t,n);let s=a.flatMap(function(e){let r=I(e);if(!r||!r.events.enabled||null===r.raycaster.camera)return[];if(void 0===r.raycaster.camera){var n;null==r.events.compute||r.events.compute(t,r,null==(n=r.previousRoot)?void 0:n.getState()),void 0===r.raycaster.camera&&(r.raycaster.camera=null)}return r.raycaster.camera?r.raycaster.intersectObject(e,!0):[]}).sort((e,t)=>
114{let r=I(e.object),n=I(t.object);return r&&n&&n.events.priority-r.events.priority||e.distance-t.distance}).filter(e=>{let t=Y(e);return!i.has(t)&&(i.add(t),!0)});for(let e of(n.events.filter&&(s=n.events.filter(s,n)),s)){let t=e.object;for(;t;){var l;null!=(l=t.__r3f)&&l.eventCount&&o.push({...e,eventObject:t}),t=t.parent}}if("pointerId"in t&&n.internal.capturedMap.has(t.pointerId))for(let e of n.internal.capturedMap.get(t.pointerId).values())i.has(Y(e.intersection))||o.push(e.intersection);return o}(o,u?t:void 0),f=c?function(t){let{internal:r}=e.getState(),n=t.offsetX-r.initialClick[0],i=t.offsetY-r.initialClick[1];return Math.round(Math.sqrt(n*n+i*i))}(o):0;"onPointerDown"===i&&(s.initialClick=[o.offsetX,o.offsetY],s.initialHits=h.map(e=>e.eventObject)),c&&!h.length&&f<=2&&(n(o,s.interaction),a&&a(o)),u&&r(h),!function(e,t,n,i){if(e.length){let o={stopped:!1};for(let a of e){let s=I(a.object);if(s||a.object.traverseAncestors(e=>{let t=I(e);if(t)return s=t,!1}),s){let{raycaster:u,pointer:c,camera:h,internal:f}=s,d=new l.Vector3(c.x,c.y,0).unproject(h),p=e=>{var t,r;return null!=(t=null==(r=f.capturedMap.get(e))?void 0:r.has(a.eventObject))&&t},m=e=>{let r={intersection:a,target:t.target};f.capturedMap.has(e)?f.capturedMap.get(e).set(a.eventObject,r):f.capturedMap.set(e,new Map([[a.eventObject,r]])),t.target.setPointerCapture(e)},g=e=>{let t=f.capturedMap.get(e);t&&Z(f.capturedMap,a.eventObject,t,e)},v={};for(let e in t){let r=t[e];"function"!=typeof r&&(v[e]=r)}let y={...a,...v,pointer:c,intersections:e,stopped:o.stopped,delta:n,unprojectedPoint:d,ray:u.ray,camera:h,stopPropagation(){let n="pointerId"in t&&f.capturedMap.get(t.pointerId);(!n||n.has(a.eventObject))&&(y.stopped=o.stopped=!0,f.hovered.size&&Array.from(f.hovered.values()).find(e=>e.eventObject===a.eventObject)&&r([...e.slice(0,e.indexOf(a)),a]))},target:{hasPointerCapture:p,setPointerCapture:m,releasePointerCapture:g},currentTarget:{hasPointerCapture:p,setPointerCapture:m,releasePointerCapture:g},nativeEvent:t};if(i(y),!0===o.stopped)break}}}}(h,o,f,function(e){let t=e.eventObject,r=t.__r3f;if(!(null!=r&&r.eventCount))return;let a=r.handlers;if(u){if(a.onPointerOver||a.onPointerEnter||a.onPointerOut||a.onPointerLeave){let t=Y(e),r=s.hovered.get(t);r?r.stopped&&e.stopPropagation():(s.hovered.set(t,e),null==a.onPointerOver||a.onPointerOver(e),null==a.onPointerEnter||a.onPointerEnter(e))}null==a.onPointerMove||a.onPointerMove(e)}else{let r=a[i];r?(!c||s.initialHits.includes(t))&&(n(o,s.interaction.filter(e=>!s.initialHits.includes(e))),r(e)):c&&s.initialHits.includes(t)&&n(o,s.interaction.filter(e=>!s.initialHits.includes(e)))}})}}}}(e);return{priority:1,enabled:!0,compute(e,t,r){t.pointer.set(e.offsetX/t.size.width*2-1,-(2*(e.offsetY/t.size.height))+1),t.raycaster.setFromCamera(t.pointer,t.camera)},connected:void 0,handlers:Object.keys(eN).reduce((e,r)=>({...e,[r]:t(r)}),{}),update:()=>{var t;let{events:r,internal:n}=e.getState();null!=(t=n.lastEvent)&&t.current&&r.handlers&&r.handlers.onPointerMove(n.lastEvent.current)},connect:t=>{let{set:r,events:n}=e.getState();if(null==n.disconnect||n.disconnect(),r(e=>({events:{...e.events,connected:t}})),n.handlers)for(let e in n.handlers){let r=n.handlers[e],[i,o]=eN[e];t.addEventListener(i,r,{passive:o})}},disconnect:()=>{let{set:t,events:r}=e.getState();if(r.connected){if(r.handlers)for(let e in r.handlers){let t=r.handlers[e],[n]=eN[e];r.connected.removeEventListener(n,t)}t(e=>({events:{...e.events,connected:void 0}}))}}}}},3411:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});var n=function(e){return"function"==typeof e?e:"string"==typeof e?function(t){return t[e]}:function(t){return e}}},3909:(e,t)=>{"use strict";function r(e,t){var r=e.length;for(e.push(t);0<r;){var n=r-1>>>1,i=e[n];if(0<o(i,t))e[n]=t,e[r]=i,r=n;else break}}function n(e){return 0===e.length?null:e[0]}function i(e){if(0===e.length)return null;var t=e[0],r=e.pop();if(r!==t){e[0]=r;for(var n=0,i=e.length,a=i>>>1;n<a;){var s=2*(n+1)-1,l=e[s],u=s+1,c=e[u];if(0>o(l,r))u<i&&0>o(c,l)?(e[n]=c,e[u]=r,n=u):(e[n]=l,e[s]=r,n=s);else if(u<i&&0>o(c,r))e[n]=c,e[u]=r,n=u;else break}}return t}function o(e,t){var r=e.sortIndex-t.sortIndex;return 0!==r?r:e.id-t.id}if(t.unstable_now=void 0,"object"==typeof performance&&"function"==typeof performance.now){var a,s=performance;t.unstable_now=function(){return s.now()}}else{var l=Date,u=l.now();t.unstable_now=function(){return l.now()-u}}var c=[],h=[],f=1,d=null,p=3,m=!1,g=!1,v=!1,y="function"==typeof setTimeout?setTimeout:null,A="function"==typeof clearTimeout?clearTimeout:null,_="undefined"!=typeof setImmediate?setImmediate:null;function b(e){for(var t=n(h);null!==t;){if(null===t.callback)i(h);else if(t.startTime<=e)i(h),t.sortIndex=t.expirationTime,r(c,t);else break;t=n(h)}}function B(e){if(v=!1,b(e),!g)if(null!==n(c))g=!0,O();else{var t=n(h);null!==t&&R(B,t.startTime-e)}}var x=!1,C=-1,w=5,E=-1;function M(){return!(t.unstable_now()-E<w)}function T(){if(x){var e=t.unstable_now();E=e;var r=!0;try{e:{g=!1,v&&(v=!1,A(C),C=-1),m=!0;var o=p;try{t:{for(b(e),d=n(c);null!==d&&!(d.expirationTime>e&&M());){var s=d.callback;if("function"==typeof s){d.callback=null,p=d.priorityLevel;var l=s(d.expirationTime<=e);if(e=t.unstable_now(),"function"==typeof l){d.callback=l,b(e),r=!0;break t}d===n(c)&&i(c),b(e)}else i(c);d=n(c)}if(null!==d)r=!0;else{var u=n(h);null!==u&&R(B,u.startTime-e),r=!1}}break e}finally{d=null,p=o,m=!1}}}finally{r?a():x=!1}}}if("function"==typeof _)a=function(){_(T)};else if("undefined"!=typeof MessageChannel){var F=new MessageChannel,S=F.port2;F.port1.onmessage=T,a=function(){S.postMessage(null)}}else a=function(){y(T,0)};function O(){x||(x=!0,a())}function R(e,r){C=y(function(){e(t.unstable_now())},r)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){g||m||(g=!0,O())},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):w=0<e?Math.floor(1e3/e):5},t.unstable_getCurrentPriorityLevel=function(){return p},t.unstable_getFirstCallbackNode=function(){return n(c)},t.unstable_next=function(e){switch(p){case 1:case 2:case 3:var t=3;break;default:t=p}
114var r=p;p=t;try{return e()}finally{p=r}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var r=p;p=e;try{return t()}finally{p=r}},t.unstable_scheduleCallback=function(e,i,o){var a=t.unstable_now();switch(o="object"==typeof o&&null!==o&&"number"==typeof(o=o.delay)&&0<o?a+o:a,e){case 1:var s=-1;break;case 2:s=250;break;case 5:s=0x3fffffff;break;case 4:s=1e4;break;default:s=5e3}return s=o+s,e={id:f++,callback:i,priorityLevel:e,startTime:o,expirationTime:s,sortIndex:-1},o>a?(e.sortIndex=o,r(h,e),null===n(c)&&e===n(h)&&(v?(A(C),C=-1):v=!0,R(B,o-a))):(e.sortIndex=s,r(c,e),g||m||(g=!0,O())),e},t.unstable_shouldYield=M,t.unstable_wrapCallback=function(e){var t=p;return function(){var r=p;p=t;try{return e.apply(this,arguments)}finally{p=r}}}},4098:e=>{"use strict";function t(e,t,c){c=c||2;var h,p,g,v,y,A,_,b=t&&t.length,B=b?t[0]*c:e.length,x=r(e,0,B,c,!0),C=[];if(!x||x.next===x.prev)return C;if(b&&(x=function(e,t,o,l){var u,c,h,p,m,g=[];for(u=0,c=t.length;u<c;u++)h=t[u]*l,p=u<c-1?t[u+1]*l:e.length,(m=r(e,h,p,l,!1))===m.next&&(m.steiner=!0),g.push(function(e){var t=e,r=e;do(t.x<r.x||t.x===r.x&&t.y<r.y)&&(r=t),t=t.next;while(t!==e);return r}(m));for(g.sort(i),u=0;u<g.length;u++)o=function(e,t){var r=function(e,t){var r,n,i,o=t,l=e.x,u=e.y,c=-1/0;do{if(u<=o.y&&u>=o.next.y&&o.next.y!==o.y){var h=o.x+(u-o.y)*(o.next.x-o.x)/(o.next.y-o.y);if(h<=l&&h>c&&(c=h,i=o.x<o.next.x?o:o.next,h===l))return i}o=o.next}while(o!==t);if(!i)return null;var d,p=i,m=i.x,g=i.y,v=1/0;o=i;do{l>=o.x&&o.x>=m&&l!==o.x&&a(u<g?l:c,u,m,g,u<g?c:l,u,o.x,o.y)&&(d=Math.abs(u-o.y)/(l-o.x),f(o,e)&&(d<v||d===v&&(o.x>i.x||o.x===i.x&&(r=i,n=o,0>s(r.prev,r,n.prev)&&0>s(n.next,r,r.next))))&&(i=o,v=d)),o=o.next}while(o!==p);return i}(e,t);if(!r)return t;var i=d(r,e);return n(i,i.next),n(r,r.next)}(g[u],o);return o}(e,t,x,c)),e.length>80*c){h=g=e[0],p=v=e[1];for(var w=c;w<B;w+=c)y=e[w],A=e[w+1],y<h&&(h=y),A<p&&(p=A),y>g&&(g=y),A>v&&(v=A);_=0!==(_=Math.max(g-h,v-p))?32767/_:0}return function e(t,r,i,c,h,p,g){if(t){!g&&p&&function(e,t,r,n){var i=e;do 0===i.z&&(i.z=o(i.x,i.y,t,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){var t,r,n,i,o,a,s,l,u=1;do{for(r=e,e=null,o=null,a=0;r;){for(a++,n=r,s=0,t=0;t<u&&(s++,n=n.nextZ);t++);for(l=u;s>0||l>0&&n;)0!==s&&(0===l||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--),o?o.nextZ=i:e=i,i.prevZ=o,o=i;r=n}o.nextZ=null,u*=2}while(a>1)}(i)}(t,c,h,p);for(var v,y,A=t;t.prev!==t.next;){if(v=t.prev,y=t.next,p?function(e,t,r,n){var i=e.prev,l=e.next;if(s(i,e,l)>=0)return!1;for(var u=i.x,c=e.x,h=l.x,f=i.y,d=e.y,p=l.y,m=u<c?u<h?u:h:c<h?c:h,g=f<d?f<p?f:p:d<p?d:p,v=u>c?u>h?u:h:c>h?c:h,y=f>d?f>p?f:p:d>p?d:p,A=o(m,g,t,r,n),_=o(v,y,t,r,n),b=e.prevZ,B=e.nextZ;b&&b.z>=A&&B&&B.z<=_;){if(b.x>=m&&b.x<=v&&b.y>=g&&b.y<=y&&b!==i&&b!==l&&a(u,f,c,d,h,p,b.x,b.y)&&s(b.prev,b,b.next)>=0||(b=b.prevZ,B.x>=m&&B.x<=v&&B.y>=g&&B.y<=y&&B!==i&&B!==l&&a(u,f,c,d,h,p,B.x,B.y)&&s(B.prev,B,B.next)>=0))return!1;B=B.nextZ}for(;b&&b.z>=A;){if(b.x>=m&&b.x<=v&&b.y>=g&&b.y<=y&&b!==i&&b!==l&&a(u,f,c,d,h,p,b.x,b.y)&&s(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;B&&B.z<=_;){if(B.x>=m&&B.x<=v&&B.y>=g&&B.y<=y&&B!==i&&B!==l&&a(u,f,c,d,h,p,B.x,B.y)&&s(B.prev,B,B.next)>=0)return!1;B=B.nextZ}return!0}(t,c,h,p):function(e){var t=e.prev,r=e.next;if(s(t,e,r)>=0)return!1;for(var n=t.x,i=e.x,o=r.x,l=t.y,u=e.y,c=r.y,h=n<i?n<o?n:o:i<o?i:o,f=l<u?l<c?l:c:u<c?u:c,d=n>i?n>o?n:o:i>o?i:o,p=l>u?l>c?l:c:u>c?u:c,m=r.next;m!==t;){if(m.x>=h&&m.x<=d&&m.y>=f&&m.y<=p&&a(n,l,i,u,o,c,m.x,m.y)&&s(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}(t)){r.push(v.i/i|0),r.push(t.i/i|0),r.push(y.i/i|0),m(t),t=y.next,A=y.next;continue}if((t=y)===A){g?1===g?e(t=function(e,t,r){var i=e;do{var o=i.prev,a=i.next.next;!l(o,a)&&u(o,i,i.next,a)&&f(o,a)&&f(a,o)&&(t.push(o.i/r|0),t.push(i.i/r|0),t.push(a.i/r|0),m(i),m(i.next),i=e=a),i=i.next}while(i!==e);return n(i)}(n(t),r,i),r,i,c,h,p,2):2===g&&function(t,r,i,o,a,c){var h=t;do{for(var p,m,g=h.next.next;g!==h.prev;){if(h.i!==g.i&&(p=h,m=g,p.next.i!==m.i&&p.prev.i!==m.i&&!function(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&u(r,r.next,e,t))return!0;r=r.next}
114while(r!==e);return!1}(p,m)&&(f(p,m)&&f(m,p)&&function(e,t){var r=e,n=!1,i=(e.x+t.x)/2,o=(e.y+t.y)/2;do r.y>o!=r.next.y>o&&r.next.y!==r.y&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next;while(r!==e);return n}(p,m)&&(s(p.prev,p,m.prev)||s(p,m.prev,m))||l(p,m)&&s(p.prev,p,p.next)>0&&s(m.prev,m,m.next)>0))){var v=d(h,g);h=n(h,h.next),v=n(v,v.next),e(h,r,i,o,a,c,0),e(v,r,i,o,a,c,0);return}g=g.next}h=h.next}while(h!==t)}(t,r,i,c,h,p):e(n(t),r,i,c,h,p,1);break}}}}(x,C,c,h,p,_,0),C}function r(e,t,r,n,i){var o,a;if(i===v(e,t,r,n)>0)for(o=t;o<r;o+=n)a=p(o,e[o],e[o+1],a);else for(o=r-n;o>=t;o-=n)a=p(o,e[o],e[o+1],a);return a&&l(a,a.next)&&(m(a),a=a.next),a}function n(e,t){if(!e)return e;t||(t=e);var r,n=e;do if(r=!1,!n.steiner&&(l(n,n.next)||0===s(n.prev,n,n.next))){if(m(n),(n=t=n.prev)===n.next)break;r=!0}else n=n.next;while(r||n!==t);return t}function i(e,t){return e.x-t.x}function o(e,t,r,n,i){return(e=((e=((e=((e=((e=(e-r)*i|0)|e<<8)&0xff00ff)|e<<4)&0xf0f0f0f)|e<<2)&0x33333333)|e<<1)&0x55555555)|(t=((t=((t=((t=((t=(t-n)*i|0)|t<<8)&0xff00ff)|t<<4)&0xf0f0f0f)|t<<2)&0x33333333)|t<<1)&0x55555555)<<1}function a(e,t,r,n,i,o,a,s){return(i-a)*(t-s)>=(e-a)*(o-s)&&(e-a)*(n-s)>=(r-a)*(t-s)&&(r-a)*(o-s)>=(i-a)*(n-s)}function s(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function l(e,t){return e.x===t.x&&e.y===t.y}function u(e,t,r,n){var i=h(s(e,t,r)),o=h(s(e,t,n)),a=h(s(r,n,e)),l=h(s(r,n,t));return!!(i!==o&&a!==l||0===i&&c(e,r,t)||0===o&&c(e,n,t)||0===a&&c(r,e,n)||0===l&&c(r,t,n))}function c(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function h(e){return e>0?1:e<0?-1:0}function f(e,t){return 0>s(e.prev,e,e.next)?s(e,t,e.next)>=0&&s(e,e.prev,t)>=0:0>s(e,t,e.prev)||0>s(e,e.next,t)}function d(e,t){var r=new g(e.i,e.x,e.y),n=new g(t.i,t.x,t.y),i=e.next,o=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function p(e,t,r,n){var i=new g(e,t,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function m(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function g(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function v(e,t,r,n){for(var i=0,o=t,a=r-n;o<r;o+=n)i+=(e[a]-e[o])*(e[o+1]+e[a+1]),a=o;return i}e.exports=t,e.exports.default=t,t.deviation=function(e,t,r,n){var i=t&&t.length,o=i?t[0]*r:e.length,a=Math.abs(v(e,0,o,r));if(i)for(var s=0,l=t.length;s<l;s++){var u=t[s]*r,c=s<l-1?t[s+1]*r:e.length;a-=Math.abs(v(e,u,c,r))}var h=0;for(s=0;s<n.length;s+=3){var f=n[s]*r,d=n[s+1]*r,p=n[s+2]*r;h+=Math.abs((e[f]-e[p])*(e[d+1]-e[f+1])-(e[f]-e[d])*(e[p+1]-e[f+1]))}return 0===a&&0===h?0:Math.abs((h-a)/a)},t.flatten=function(e){for(var t=e[0][0].length,r={vertices:[],holes:[],dimensions:t},n=0,i=0;i<e.length;i++){for(var o=0;o<e[i].length;o++)for(var a=0;a<t;a++)r.vertices.push(e[i][o][a]);i>0&&(n+=e[i-1].length,r.holes.push(n))}return r}},4153:(e,t,r)=>{"use strict";r.d(t,{a:()=>t3,$W:()=>tl,zh:()=>tq});var n,i,o,a=r(3354),s=r(23),l=Object.defineProperty,u={};((e,t)=>{for(var r in t)l(e,r,{get:t[r],enumerable:!0})})(u,{assign:()=>k,colors:()=>L,createStringInterpolator:()=>n,skipAnimation:()=>G,to:()=>i,willAdvance:()=>U});var c=E(),h=e=>B(e,c),f=E();h.write=e=>B(e,f);var d=E();h.onStart=e=>B(e,d);var p=E();h.onFrame=e=>B(e,p);var m=E();h.onFinish=e=>B(e,m);var g=[];h.setTimeout=(e,t)=>{let r=h.now()+t,n=()=>{let e=g.findIndex(e=>e.cancel==n);~e&&g.splice(e,1),_-=!!~e},i={time:r,handler:e,cancel:n};return g.splice(v(r),0,i),_+=1,x(),i};var v=e=>~(~g.findIndex(t=>t.time>e)||~g.length);h.cancel=e=>{d.delete(e),p.delete(e),m.delete(e),c.delete(e),f.delete(e)},h.sync=e=>{b=!0,h.batchedUpdates(e),b=!1},h.throttle=e=>{let t;function r(){try{e(...t)}finally{t=null}}function n(...e){t=e,h.onStart(r)}return n.handler=e,n.cancel=()=>{d.delete(r),t=null},n};var y="undefined"!=typeof window?window.requestAnimationFrame:()=>{};h.use=e=>y=e,h.now="undefined"!=typeof performance?()=>performance.now():Date.now,h.batchedUpdates=e=>e(),h.catch=console.error,h.frameLoop="always",h.advance=()=>{"demand"!==h.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):w()};var A=-1,_=0,b=!1;function B(e,t){b?(t.delete(e),e(0)):(t.add(e),x())}function x(){A<0&&(A=0,"demand"!==h.frameLoop&&y(C))}function C(){~A&&(y(C),h.batchedUpdates(w))}
114function w(){let e=A,t=v(A=h.now());if(t&&(M(g.splice(0,t),e=>e.handler()),_-=t),!_)return void(A=-1);d.flush(),c.flush(e?Math.min(64,A-e):16.667),p.flush(),f.flush(),m.flush()}function E(){let e=new Set,t=e;return{add(r){_+=+!(t!=e||e.has(r)),e.add(r)},delete:r=>(_-=t==e&&e.has(r)?1:0,e.delete(r)),flush(r){t.size&&(e=new Set,_-=t.size,M(t,t=>t(r)&&e.add(t)),_+=e.size,t=e)}}}function M(e,t){e.forEach(e=>{try{t(e)}catch(e){h.catch(e)}})}function T(){}var F={arr:Array.isArray,obj:e=>!!e&&"Object"===e.constructor.name,fun:e=>"function"==typeof e,str:e=>"string"==typeof e,num:e=>"number"==typeof e,und:e=>void 0===e};function S(e,t){if(F.arr(e)){if(!F.arr(t)||e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}return e===t}var O=(e,t)=>e.forEach(t);function R(e,t,r){if(F.arr(e)){for(let n=0;n<e.length;n++)t.call(r,e[n],`${n}`);return}for(let n in e)e.hasOwnProperty(n)&&t.call(r,e[n],n)}var I=e=>F.und(e)?[]:F.arr(e)?e:[e];function P(e,t){if(e.size){let r=Array.from(e);e.clear(),O(r,t)}}var D=(e,...t)=>P(e,e=>e(...t)),H=()=>"undefined"==typeof window||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),L=null,G=!1,U=T,k=e=>{e.to&&(i=e.to),e.now&&(h.now=e.now),void 0!==e.colors&&(L=e.colors),null!=e.skipAnimation&&(G=e.skipAnimation),e.createStringInterpolator&&(n=e.createStringInterpolator),e.requestAnimationFrame&&h.use(e.requestAnimationFrame),e.batchedUpdates&&(h.batchedUpdates=e.batchedUpdates),e.willAdvance&&(U=e.willAdvance),e.frameLoop&&(h.frameLoop=e.frameLoop)},N=new Set,j=[],J=[],z=0,K={get idle(){return!N.size&&!j.length},start(e){z>e.priority?(N.add(e),h.onStart(V)):(Q(e),h(Y))},advance:Y,sort(e){if(z)h.onFrame(()=>K.sort(e));else{let t=j.indexOf(e);~t&&(j.splice(t,1),X(e))}},clear(){j=[],N.clear()}};function V(){N.forEach(Q),N.clear(),h(Y)}function Q(e){j.includes(e)||X(e)}function X(e){j.splice(function(e,t){let r=e.findIndex(t);return r<0?e.length:r}(j,t=>t.priority>e.priority),0,e)}function Y(e){let t=J;for(let r=0;r<j.length;r++){let n=j[r];z=n.priority,!n.idle&&(U(n),n.advance(e),n.idle||t.push(n))}return z=0,(J=j).length=0,(j=t).length>0}var Z="[-+]?\\d*\\.?\\d+",q=Z+"%";function W(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}var $=RegExp("rgb"+W(Z,Z,Z)),ee=RegExp("rgba"+W(Z,Z,Z,Z)),et=RegExp("hsl"+W(Z,q,q)),er=RegExp("hsla"+W(Z,q,q,Z)),en=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ei=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,eo=/^#([0-9a-fA-F]{6})$/,ea=/^#([0-9a-fA-F]{8})$/;function es(e,t,r){return(r<0&&(r+=1),r>1&&(r-=1),r<1/6)?e+(t-e)*6*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function el(e,t,r){let n=r<.5?r*(1+t):r+t-r*t,i=2*r-n,o=es(i,n,e+1/3);return Math.round(255*o)<<24|Math.round(255*es(i,n,e))<<16|Math.round(255*es(i,n,e-1/3))<<8}function eu(e){let t=parseInt(e,10);return t<0?0:t>255?255:t}function ec(e){return(parseFloat(e)%360+360)%360/360}function eh(e){let t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function ef(e){let t=parseFloat(e);return t<0?0:t>100?1:t/100}function ed(e){let t,r="number"==typeof e?e>>>0===e&&e>=0&&e<=0xffffffff?e:null:(t=eo.exec(e))?parseInt(t[1]+"ff",16)>>>0:L&&void 0!==L[e]?L[e]:(t=$.exec(e))?(eu(t[1])<<24|eu(t[2])<<16|eu(t[3])<<8|255)>>>0:(t=ee.exec(e))?(eu(t[1])<<24|eu(t[2])<<16|eu(t[3])<<8|eh(t[4]))>>>0:(t=en.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=ea.exec(e))?parseInt(t[1],16)>>>0:(t=ei.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=et.exec(e))?(255|el(ec(t[1]),ef(t[2]),ef(t[3])))>>>0:(t=er.exec(e))?(el(ec(t[1]),ef(t[2]),ef(t[3]))|eh(t[4]))>>>0:null;if(null===r)return e;let n=(0xff000000&(r=r||0))>>>24,i=(0xff0000&r)>>>16,o=(65280&r)>>>8,a=(255&r)/255;return`rgba(${n}, ${i}, ${o}, ${a})`}var ep=(e,t,r)=>{if(F.fun(e))return e;if(F.arr(e))return ep({range:e,output:t,extrapolate:r});if(F.str(e.output[0]))return n(e);let i=e.output,o=e.range||[0,1],a=e.extrapolateLeft||e.extrapolate||"extend",s=e.extrapolateRight||e.extrapolate||"extend",l=e.easing||(e=>e);return t=>{let r=function(e,t){for(var r=1;r<t.length-1&&!(t[r]>=e);++r);return r-1}(t,o);return function(e,t,r,n,i,o,a,s,l){let u=l?l(e):e;if(u<t)if("identity"===a)return u;else"clamp"===a&&(u=t);if(u>r)if("identity"===s)return u;else"clamp"===s&&(u=r);return n===i?n:t===r?e<=t?n:i:(t===-1/0?u=-u:r===1/0?u-=t:u=(u-t)/(r-t),u=o(u),n===-1/0?u=-u:i===1/0?u+=n:u=u*(i-n)+n,u)}(t,o[r],o[r+1],i[r],i[r+1],l,a,s,e.map)}},em=Symbol.for("FluidValue.get"),eg=Symbol.for("FluidValue.observers"),ev=e=>!!(e&&e[em]),ey=e=>e&&e[em]?e[em]():e,eA=e=>e[eg]||null;function e_(e,t){let r=e[eg];
114r&&r.forEach(e=>{e.eventObserved?e.eventObserved(t):e(t)})}var eb=class{constructor(e){if(!e&&!(e=this.get))throw Error("Unknown getter");eB(this,e)}},eB=(e,t)=>ew(e,em,t);function ex(e,t){if(e[em]){let r=e[eg];r||ew(e,eg,r=new Set),!r.has(t)&&(r.add(t),e.observerAdded&&e.observerAdded(r.size,t))}return t}function eC(e,t){let r=e[eg];if(r&&r.has(t)){let n=r.size-1;n?r.delete(t):e[eg]=null,e.observerRemoved&&e.observerRemoved(n,t)}}var ew=(e,t,r)=>Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0}),eE=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,eM=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,eT=RegExp(`(${eE.source})(%|[a-z]+)`,"i"),eF=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,eS=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,eO=e=>{let[t,r]=eR(e);if(!t||H())return e;let n=window.getComputedStyle(document.documentElement).getPropertyValue(t);if(n)return n.trim();if(r&&r.startsWith("--")){let e=window.getComputedStyle(document.documentElement).getPropertyValue(r);if(e)return e}else if(r&&eS.test(r))return eO(r);else if(r)return r;return e},eR=e=>{let t=eS.exec(e);if(!t)return[,];let[,r,n]=t;return[r,n]},eI=(e,t,r,n,i)=>`rgba(${Math.round(t)}, ${Math.round(r)}, ${Math.round(n)}, ${i})`,eP=e=>{o||(o=L?RegExp(`(${Object.keys(L).join("|")})(?!\\w)`,"g"):/^\b$/);let t=e.output.map(e=>ey(e).replace(eS,eO).replace(eM,ed).replace(o,ed)),r=t.map(e=>e.match(eE).map(Number)),n=r[0].map((e,t)=>r.map(e=>{if(!(t in e))throw Error('The arity of each "output" value must be equal');return e[t]})).map(t=>ep({...e,output:t}));return e=>{let r=!eT.test(t[0])&&t.find(e=>eT.test(e))?.replace(eE,""),i=0;return t[0].replace(eE,()=>`${n[i++](e)}${r||""}`).replace(eF,eI)}},eD="react-spring: ",eH=e=>{let t=!1;if("function"!=typeof e)throw TypeError(`${eD}once requires a function parameter`);return(...r)=>{t||(e(...r),t=!0)}},eL=eH(console.warn),eG=eH(console.warn);function eU(e){return F.str(e)&&("#"==e[0]||/\d/.test(e)||!H()&&eS.test(e)||e in(L||{}))}var ek=H()?s.useEffect:s.useLayoutEffect;function eN(){let e=(0,s.useState)()[1],t=(()=>{let e=(0,s.useRef)(!1);return ek(()=>(e.current=!0,()=>{e.current=!1}),[]),e})();return()=>{t.current&&e(Math.random())}}var ej=e=>(0,s.useEffect)(e,eJ),eJ=[];function ez(e){let t=(0,s.useRef)();return(0,s.useEffect)(()=>{t.current=e}),t.current}var eK=Symbol.for("Animated:node"),eV=e=>e&&e[eK],eQ=(e,t)=>Object.defineProperty(e,eK,{value:t,writable:!0,configurable:!0}),eX=e=>e&&e[eK]&&e[eK].getPayload(),eY=class{constructor(){eQ(this,this)}getPayload(){return this.payload||[]}},eZ=class extends eY{constructor(e){super(),this._value=e,this.done=!0,this.durationProgress=0,F.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new eZ(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return F.num(e)&&(this.lastPosition=e,t&&(e=Math.round(e/t)*t,this.done&&(this.lastPosition=e))),this._value!==e&&(this._value=e,!0)}reset(){let{done:e}=this;this.done=!1,F.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}},eq=class extends eZ{constructor(e){super(0),this._string=null,this._toString=ep({output:[e,e]})}static create(e){return new eq(e)}getValue(){let e=this._string;return null==e?this._string=this._toString(this._value):e}setValue(e){if(F.str(e)){if(e==this._string)return!1;this._string=e,this._value=1}else{if(!super.setValue(e))return!1;this._string=null}return!0}reset(e){e&&(this._toString=ep({output:[this.getValue(),e]})),this._value=0,super.reset()}},eW={dependencies:null},e$=class extends eY{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){let t={};return R(this.source,(r,n)=>{r&&r[eK]===r?t[n]=r.getValue(e):ev(r)?t[n]=ey(r):e||(t[n]=r)}),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&O(this.payload,e=>e.reset())}_makePayload(e){if(e){let t=new Set;return R(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){eW.dependencies&&ev(e)&&eW.dependencies.add(e);let t=eX(e);t&&O(t,e=>this.add(e))}},e0=class extends e${constructor(e){super(e)}static create(e){return new e0(e)}getValue(){return this.source.map(e=>e.getValue())}setValue(e){let t=this.getPayload();return e.length==t.length?t.map((t,r)=>t.setValue(e[r])).some(Boolean):(super.setValue(e.map(e1)),!0)}};function e1(e){return(eU(e)?eq:eZ).create(e)}function e2(e){let t=eV(e);return t?t.constructor:F.arr(e)?e0:eU(e)?eq:eZ}var e3=(e,t)=>
114{let r=!F.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,s.forwardRef)((n,i)=>{let o=(0,s.useRef)(null),a=r&&(0,s.useCallback)(e=>{o.current=function(e,t){return e&&(F.fun(e)?e(t):e.current=t),t}(i,e)},[i]),[l,u]=function(e,t){let r=new Set;return eW.dependencies=r,e.style&&(e={...e,style:t.createAnimatedStyle(e.style)}),e=new e$(e),eW.dependencies=null,[e,r]}(n,t),c=eN(),f=()=>{let e=o.current;(!r||e)&&!1===(!!e&&t.applyAnimatedValues(e,l.getValue(!0)))&&c()},d=new e9(f,u),p=(0,s.useRef)();ek(()=>(p.current=d,O(u,e=>ex(e,d)),()=>{p.current&&(O(p.current.deps,e=>eC(e,p.current)),h.cancel(p.current.update))})),(0,s.useEffect)(f,[]),ej(()=>()=>{let e=p.current;O(e.deps,t=>eC(t,e))});let m=t.getComponentProps(l.getValue());return s.createElement(e,{...m,ref:a})})},e9=class{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&h.write(this.update)}},e8=Symbol.for("AnimatedComponent"),e5=e=>F.str(e)?e:e&&F.str(e.displayName)?e.displayName:F.fun(e)&&e.name||null;function e6(e,...t){return F.fun(e)?e(...t):e}var e4=(e,t)=>!0===e||!!(t&&e&&(F.fun(e)?e(t):I(e).includes(t))),e7=(e,t)=>F.obj(e)?t&&e[t]:e,te=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,tt=e=>e,tr=(e,t=tt)=>{let r=tn;e.default&&!0!==e.default&&(r=Object.keys(e=e.default));let n={};for(let i of r){let r=t(e[i],i);F.und(r)||(n[i]=r)}return n},tn=["config","onProps","onStart","onChange","onPause","onResume","onRest"],ti={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function to(e){let t=function(e){let t={},r=0;if(R(e,(e,n)=>{!ti[n]&&(t[n]=e,r++)}),r)return t}(e);if(t){let r={to:t};return R(e,(e,n)=>n in t||(r[n]=e)),r}return{...e}}function ta(e){return e=ey(e),F.arr(e)?e.map(ta):eU(e)?u.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function ts(e){return F.fun(e)||F.arr(e)&&F.obj(e[0])}var tl={default:{tension:170,friction:26},gentle:{tension:120,friction:14},wobbly:{tension:180,friction:12},stiff:{tension:210,friction:20},slow:{tension:280,friction:60},molasses:{tension:280,friction:120}},tu={...tl.default,mass:1,damping:1,easing:e=>e,clamp:!1},tc=class{constructor(){this.velocity=0,Object.assign(this,tu)}};function th(e,t){if(F.und(t.decay)){let r=!F.und(t.tension)||!F.und(t.friction);!r&&F.und(t.frequency)&&F.und(t.damping)&&F.und(t.mass)||(e.duration=void 0,e.decay=void 0),r&&(e.frequency=void 0)}else e.duration=void 0}var tf=[],td=class{constructor(){this.changed=!1,this.values=tf,this.toValues=null,this.fromValues=tf,this.config=new tc,this.immediate=!1}};function tp(e,{key:t,props:r,defaultProps:n,state:i,actions:o}){return new Promise((a,s)=>{let l,c,f=e4(r.cancel??n?.cancel,t);if(f)m();else{F.und(r.pause)||(i.paused=e4(r.pause,t));let e=n?.pause;!0!==e&&(e=i.paused||e4(e,t)),l=e6(r.delay||0,t),e?(i.resumeQueue.add(p),o.pause()):(o.resume(),p())}function d(){i.resumeQueue.add(p),i.timeouts.delete(c),c.cancel(),l=c.time-h.now()}function p(){l>0&&!u.skipAnimation?(i.delayed=!0,c=h.setTimeout(m,l),i.pauseQueue.add(d),i.timeouts.add(c)):m()}function m(){i.delayed&&(i.delayed=!1),i.pauseQueue.delete(d),i.timeouts.delete(c),e<=(i.cancelId||0)&&(f=!0);try{o.start({...r,callId:e,cancel:f},a)}catch(e){s(e)}}})}var tm=(e,t)=>1==t.length?t[0]:t.some(e=>e.cancelled)?ty(e.get()):t.every(e=>e.noop)?tg(e.get()):tv(e.get(),t.every(e=>e.finished)),tg=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),tv=(e,t,r=!1)=>({value:e,finished:t,cancelled:r}),ty=e=>({value:e,cancelled:!0,finished:!1});function tA(e,t,r,n){let{callId:i,parentId:o,onRest:a}=t,{asyncTo:s,promise:l}=r;return o||e!==s||t.reset?r.promise=(async()=>{let c,f,d;r.asyncId=i,r.asyncTo=e;let p=tr(t,(e,t)=>"onRest"===t?void 0:e),m=new Promise((e,t)=>(c=e,f=t)),g=e=>{let t=i<=(r.cancelId||0)&&ty(n)||i!==r.asyncId&&tv(n,!1);if(t)throw e.result=t,f(e),e},v=(e,t)=>{let o=new tb,a=new tB;return(async()=>{if(u.skipAnimation)throw t_(r),a.result=tv(n,!1),f(a),a;g(o);let s=F.obj(e)?{...e}:{...t,to:e};s.parentId=i,R(p,(e,t)=>{F.und(s[t])&&(s[t]=e)});let l=await n.start(s);return g(o),r.paused&&await new Promise(e=>{r.resumeQueue.add(e)}),l})()};if(u.skipAnimation)return t_(r),tv(n,!1);try{let t;t=F.arr(e)?(async e=>{for(let t of e)await v(t)})(e):Promise.resolve(e(v,n.stop.bind(n))),await Promise.all([t.then(c),m]),d=tv(n.get(),!0,!1)}catch(e){if(e instanceof tb)d=e.result;else if(e instanceof tB)d=e.result;else throw e}finally{i==r.asyncId&&(r.asyncId=o,r.asyncTo=o?s:void 0,r.promise=o?l:void 0)}return F.fun(a)&&h.batchedUpdates(()=>{a(d,n,n.item)}),d})():l}function t_(e,t){P(e.timeouts,e=>e.cancel()),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}
114var tb=class extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},tB=class extends Error{constructor(){super("SkipAnimationSignal")}},tx=1,tC=class extends eb{constructor(){super(...arguments),this.id=tx++,this._priority=0}get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){let e=eV(this);return e&&e.getValue()}to(...e){return u.to(this,e)}interpolate(...e){return eL(`${eD}The "interpolate" function is deprecated in v9 (use "to" instead)`),u.to(this,e)}toJSON(){return this.get()}observerAdded(e){1==e&&this._attach()}observerRemoved(e){0==e&&this._detach()}_attach(){}_detach(){}_onChange(e,t=!1){e_(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||K.sort(this),e_(this,{type:"priority",parent:this,priority:e})}},tw=Symbol.for("SpringPhase"),tE=e=>(1&e[tw])>0,tM=e=>(2&e[tw])>0,tT=e=>(4&e[tw])>0,tF=(e,t)=>t?e[tw]|=3:e[tw]&=-3,tS=(e,t)=>t?e[tw]|=4:e[tw]&=-5,tO=class extends tC{constructor(e,t){if(super(),this.animation=new td,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!F.und(e)||!F.und(t)){let r=F.obj(e)?{...e}:{...t,from:e};F.und(r.default)&&(r.default=!0),this.start(r)}}get idle(){return!(tM(this)||this._state.asyncTo)||tT(this)}get goal(){return ey(this.animation.to)}get velocity(){let e=eV(this);return e instanceof eZ?e.lastVelocity||0:e.getPayload().map(e=>e.lastVelocity||0)}get hasAnimated(){return tE(this)}get isAnimating(){return tM(this)}get isPaused(){return tT(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,r=!1,n=this.animation,{toValues:i}=n,{config:o}=n,a=eX(n.to);!a&&ev(n.to)&&(i=I(ey(n.to))),n.values.forEach((s,l)=>{if(s.done)return;let u=s.constructor==eq?1:a?a[l].lastPosition:i[l],c=n.immediate,h=u;if(!c){let t;if(h=s.lastPosition,o.tension<=0){s.done=!0;return}let r=s.elapsedTime+=e,i=n.fromValues[l],a=null!=s.v0?s.v0:s.v0=F.arr(o.velocity)?o.velocity[l]:o.velocity,f=o.precision||(i==u?.005:Math.min(1,.001*Math.abs(u-i)));if(F.und(o.duration))if(o.decay){let e=!0===o.decay?.998:o.decay,n=Math.exp(-(1-e)*r);h=i+a/(1-e)*(1-n),c=Math.abs(s.lastPosition-h)<=f,t=a*n}else{t=null==s.lastVelocity?a:s.lastVelocity;let r=o.restVelocity||f/10,n=o.clamp?0:o.bounce,l=!F.und(n),d=i==u?s.v0>0:i<u,p=Math.ceil(e/1);for(let e=0;e<p&&!(!(Math.abs(t)>r)&&(c=Math.abs(u-h)<=f));++e){l&&(h==u||h>u==d)&&(t=-t*n,h=u);let e=(-(1e-6*o.tension)*(h-u)+-(.001*o.friction)*t)/o.mass;t+=+e,h+=+t}}else{let n=1;o.duration>0&&(this._memoizedDuration!==o.duration&&(this._memoizedDuration=o.duration,s.durationProgress>0&&(s.elapsedTime=o.duration*s.durationProgress,r=s.elapsedTime+=e)),s.durationProgress=n=(n=(o.progress||0)+r/this._memoizedDuration)>1?1:n<0?0:n),t=((h=i+o.easing(n)*(u-i))-s.lastPosition)/e,c=1==n}s.lastVelocity=t,Number.isNaN(h)&&(console.warn("Got NaN while animating:",this),c=!0)}a&&!a[l].done&&(c=!1),c?s.done=!0:t=!1,s.setValue(h,o.round)&&(r=!0)});let s=eV(this),l=s.getValue();if(t){let e=ey(n.to);(l!==e||r)&&!o.decay?(s.setValue(e),this._onChange(e)):r&&o.decay&&this._onChange(l),this._stop()}else r&&this._onChange(l)}set(e){return h.batchedUpdates(()=>{this._stop(),this._focus(e),this._set(e)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(tM(this)){let{to:e,config:t}=this.animation;h.batchedUpdates(()=>{this._onStart(),t.decay||this._set(e,!1),this._stop()})}return this}update(e){return(this.queue||(this.queue=[])).push(e),this}start(e,t){let r;return F.und(e)?(r=this.queue||[],this.queue=[]):r=[F.obj(e)?e:{...t,to:e}],Promise.all(r.map(e=>this._update(e))).then(e=>tm(this,e))}stop(e){let{to:t}=this.animation;return this._focus(this.get()),t_(this._state,e&&this._lastCallId),h.batchedUpdates(()=>this._stop(t,e)),this}reset(){this._update({reset:!0})}eventObserved(e){"change"==e.type?this._start():"priority"==e.type&&(this.priority=e.priority+1)}_prepareNode(e){let t=this.key||"",{to:r,from:n}=e;(null==(r=F.obj(r)?r[t]:r)||ts(r))&&(r=void 0),null==(n=F.obj(n)?n[t]:n)&&(n=void 0);let i={to:r,from:n};return!tE(this)&&(e.reverse&&([r,n]=[n,r]),n=ey(n),F.und(n)?eV(this)||this._set(r):this._set(n)),i}_update({...e},t){let{key:r,defaultProps:n}=this;e.default&&Object.assign(n,tr(e,(e,t)=>/^on/.test(t)?e7(e,r):e)),tL(this,e,"onProps"),tG(this,"onProps",e,this);let i=this._prepareNode(e);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did
114you forget to pass your component to `animated(...)` before animating its props?");let o=this._state;return tp(++this._lastCallId,{key:r,props:e,defaultProps:n,state:o,actions:{pause:()=>{tT(this)||(tS(this,!0),D(o.pauseQueue),tG(this,"onPause",tv(this,tR(this,this.animation.to)),this))},resume:()=>{tT(this)&&(tS(this,!1),tM(this)&&this._resume(),D(o.resumeQueue),tG(this,"onResume",tv(this,tR(this,this.animation.to)),this))},start:this._merge.bind(this,i)}}).then(r=>{if(e.loop&&r.finished&&!(t&&r.noop)){let t=tI(e);if(t)return this._update(t,!0)}return r})}_merge(e,t,r){if(t.cancel)return this.stop(!0),r(ty(this));let n=!F.und(e.to),i=!F.und(e.from);if(n||i)if(!(t.callId>this._lastToId))return r(ty(this));else this._lastToId=t.callId;let{key:o,defaultProps:a,animation:s}=this,{to:l,from:u}=s,{to:c=l,from:f=u}=e;i&&!n&&(!t.default||F.und(c))&&(c=f),t.reverse&&([c,f]=[f,c]);let d=!S(f,u);d&&(s.from=f),f=ey(f);let p=!S(c,l);p&&this._focus(c);let m=ts(t.to),{config:g}=s,{decay:v,velocity:y}=g;(n||i)&&(g.velocity=0),t.config&&!m&&function(e,t,r){for(let n in r&&(th(r={...r},t),t={...r,...t}),th(e,t),Object.assign(e,t),tu)null==e[n]&&(e[n]=tu[n]);let{frequency:n,damping:i}=e,{mass:o}=e;F.und(n)||(n<.01&&(n=.01),i<0&&(i=0),e.tension=Math.pow(2*Math.PI/n,2)*o,e.friction=4*Math.PI*i*o/n)}(g,e6(t.config,o),t.config!==a.config?e6(a.config,o):void 0);let A=eV(this);if(!A||F.und(c))return r(tv(this,!0));let _=F.und(t.reset)?i&&!t.default:!F.und(f)&&e4(t.reset,o),b=_?f:this.get(),B=ta(c),x=F.num(B)||F.arr(B)||eU(B),C=!m&&(!x||e4(a.immediate||t.immediate,o));if(p){let e=e2(c);if(e!==A.constructor)if(C)A=this._set(B);else throw Error(`Cannot animate between ${A.constructor.name} and ${e.name}, as the "to" prop suggests`)}let w=A.constructor,E=ev(c),M=!1;if(!E){let e=_||!tE(this)&&d;(p||e)&&(E=!(M=S(ta(b),B))),(S(s.immediate,C)||C)&&S(g.decay,v)&&S(g.velocity,y)||(E=!0)}if(M&&tM(this)&&(s.changed&&!_?E=!0:E||this._stop(l)),!m&&((E||ev(l))&&(s.values=A.getPayload(),s.toValues=ev(c)?null:w==eq?[1]:I(B)),s.immediate!=C&&(s.immediate=C,C||_||this._set(l)),E)){let{onRest:e}=s;O(tH,e=>tL(this,t,e));let n=tv(this,tR(this,l));D(this._pendingCalls,n),this._pendingCalls.add(r),s.changed&&h.batchedUpdates(()=>{s.changed=!_,e?.(n,this),_?e6(a.onRest,n):s.onStart?.(n,this)})}_&&this._set(b),m?r(tA(t.to,t,this._state,this)):E?this._start():tM(this)&&!p?this._pendingCalls.add(r):r(tg(b))}_focus(e){let t=this.animation;e!==t.to&&(eA(this)&&this._detach(),t.to=e,eA(this)&&this._attach())}_attach(){let e=0,{to:t}=this.animation;ev(t)&&(ex(t,this),t instanceof tC&&(e=t.priority+1)),this.priority=e}_detach(){let{to:e}=this.animation;ev(e)&&eC(e,this)}_set(e,t=!0){let r=ey(e);if(!F.und(r)){let e=eV(this);if(!e||!S(r,e.getValue())){let n=e2(r);e&&e.constructor==n?e.setValue(r):eQ(this,n.create(r)),e&&h.batchedUpdates(()=>{this._onChange(r,t)})}}return eV(this)}_onStart(){let e=this.animation;e.changed||(e.changed=!0,tG(this,"onStart",tv(this,tR(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),e6(this.animation.onChange,e,this)),e6(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){let e=this.animation;eV(this).reset(ey(e.to)),e.immediate||(e.fromValues=e.values.map(e=>e.lastPosition)),!tM(this)&&(tF(this,!0),tT(this)||this._resume())}_resume(){u.skipAnimation?this.finish():K.start(this)}_stop(e,t){if(tM(this)){tF(this,!1);let r=this.animation;O(r.values,e=>{e.done=!0}),r.toValues&&(r.onChange=r.onPause=r.onResume=void 0),e_(this,{type:"idle",parent:this});let n=t?ty(this.get()):tv(this.get(),tR(this,e??r.to));D(this._pendingCalls,n),r.changed&&(r.changed=!1,tG(this,"onRest",n,this))}}};function tR(e,t){let r=ta(t);return S(ta(e.get()),r)}function tI(e,t=e.loop,r=e.to){let n=e6(t);if(n){let i=!0!==n&&to(n),o=(i||e).reverse,a=!i||i.reset;return tP({...e,loop:t,default:!1,pause:void 0,to:!o||ts(r)?r:void 0,from:a?e.from:void 0,reset:a,...i})}}function tP(e){let{to:t,from:r}=e=to(e),n=new Set;return F.obj(t)&&tD(t,n),F.obj(r)&&tD(r,n),e.keys=n.size?Array.from(n):null,e}function tD(e,t){R(e,(e,r)=>null!=e&&t.add(r))}var tH=["onStart","onRest","onChange","onPause","onResume"];function tL(e,t,r){e.animation[r]=t[r]!==te(t,r)?e7(t[r],e.key):void 0}function tG(e,t,...r){e.animation[t]?.(...r),e.defaultProps[t]?.(...r)}var tU=["onStart","onChange","onRest"],tk=1,tN=class{constructor(e,t){this.id=tk++,this.springs={},this.queue=[],this._lastAsyncId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),t&&(this._flush=t),e&&this.start({default:!0,...e})}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every(e=>e.idle&&!e.isDelayed&&!e.isPaused)}get item(){return this._item}set item(e){this._item=e}get(){let e={};return this.each((t,r)=>e[r]=t.get()),e}set(e){for(let t in e){let r=e[t];F.und(r)||this.springs[t].set(r)}}update(e){return e&&this.queue.push(tP(e)),this}start(e){let{queue:t}=this;return(e?t=I(e).map(tP):this.queue=[],this._flush)?this._flush(this,t):(tX(this,t),tj(this,t))}stop(e,t){if(!!e!==e&&(t=e),t){let r=this.springs;O(I(t),t=>r[t].stop(!!e))}else t_(this._state,this._lastAsyncId),this.each(t=>t.stop(!!e));return this}pause(e){if(F.und(e))this.start({pause:!0});else{let t=this.springs;O(I(e),e=>t[e].pause())}return this}resume(e){if(F.und(e))this.start({pause:!1});else{let t=this.springs;O(I(e),e=>t[e].resume())}return this}each(e){R(this.springs,e)}_onFrame(){let{onStart:e,onChange:t,onRest:r}=this._events,n=this._active.size>0,i=this._changed.size>0;(n&&!this._started||i&&!this._started)&&(this._started=!0,P(e,([e,t])=>{t.value=this.get(),e(t,this,this._item)}));let o=!n&&this._started,a=i||o&&r.size?this.get():null;i&&t.size&&P(t,([e,t])=>{t.value=a,e(t,this,this._item)}),o&&(this._started=!1,P(r,([e,t])=>{t.value=a,e(t,this,this._item)}))}eventObserved(e){if("change"==e.type)this._changed.add(e.parent),e.idle||this._active.add(e.parent);else{if("idle"!=e.type)return;this._active.delete(e.parent)}h.onFrame(this._onFrame)}};function tj(e,t){return Promise.all(t.map(t=>tJ(e,t))).then(t=>tm(e,t))}async function tJ(e,t,r){let{keys:n,to:i,from:o,loop:a,onRest:s,onResolve:l}=t,u=F.obj(t.default)&&t.default;a&&(t.loop=!1),!1===i&&(t.to=null),!1===o&&(t.from=null);let c=F.arr(i)||F.fun(i)?i:void 0;c?(t.to=void 0,t.onRest=void 0,u&&(u.onRest=void 0)):O(tU,r=>{let n=t[r];
114if(F.fun(n)){let i=e._events[r];t[r]=({finished:e,cancelled:t})=>{let r=i.get(n);r?(e||(r.finished=!1),t&&(r.cancelled=!0)):i.set(n,{value:null,finished:e||!1,cancelled:t||!1})},u&&(u[r]=t[r])}});let f=e._state;!f.paused===t.pause?(f.paused=t.pause,D(t.pause?f.pauseQueue:f.resumeQueue)):f.paused&&(t.pause=!0);let d=(n||Object.keys(e.springs)).map(r=>e.springs[r].start(t)),p=!0===t.cancel||!0===te(t,"cancel");(c||p&&f.asyncId)&&d.push(tp(++e._lastAsyncId,{props:t,state:f,actions:{pause:T,resume:T,start(t,r){p?(t_(f,e._lastAsyncId),r(ty(e))):(t.onRest=s,r(tA(c,t,f,e)))}}})),f.paused&&await new Promise(e=>{f.resumeQueue.add(e)});let m=tm(e,await Promise.all(d));if(a&&m.finished&&!(r&&m.noop)){let r=tI(t,a,i);if(r)return tX(e,[r]),tJ(e,r,!0)}return l&&h.batchedUpdates(()=>l(m,e,e.item)),m}function tz(e,t){let r={...e.springs};return t&&O(I(t),e=>{F.und(e.keys)&&(e=tP(e)),F.obj(e.to)||(e={...e,to:void 0}),tQ(r,e,e=>tV(e))}),tK(e,r),r}function tK(e,t){R(t,(t,r)=>{e.springs[r]||(e.springs[r]=t,ex(t,e))})}function tV(e,t){let r=new tO;return r.key=e,t&&ex(r,t),r}function tQ(e,t,r){t.keys&&O(t.keys,n=>{(e[n]||(e[n]=r(n)))._prepareNode(t)})}function tX(e,t){O(t,t=>{tQ(e.springs,t,t=>tV(t,e))})}var tY=({children:e,...t})=>{let r=(0,s.useContext)(tZ),n=t.pause||!!r.pause,i=t.immediate||!!r.immediate;t=function(e,t){let[r]=(0,s.useState)(()=>({inputs:t,result:e()})),n=(0,s.useRef)(),i=n.current,o=i;return o?t&&o.inputs&&function(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}(t,o.inputs)||(o={inputs:t,result:e()}):o=r,(0,s.useEffect)(()=>{n.current=o,i==r&&(r.inputs=r.result=void 0)},[o]),o.result}(()=>({pause:n,immediate:i}),[n,i]);let{Provider:o}=tZ;return s.createElement(o,{value:t},e)},tZ=function(e,t){return Object.assign(e,s.createContext(t)),e.Provider._context=e,e.Consumer._context=e,e}(tY,{});function tq(e,t){let r=F.fun(e),[[n],i]=function(e,t,r){let n=F.fun(t)&&t;n&&!r&&(r=[]);let i=(0,s.useMemo)(()=>n||3==arguments.length?(()=>{let e=[],t=function(t){eG(`${eD}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`);let n=[];return O(e,(e,i)=>{if(F.und(t))n.push(e.start());else{let o=r(t,e,i);o&&n.push(e.start(o))}}),n};t.current=e,t.add=function(t){e.includes(t)||e.push(t)},t.delete=function(t){let r=e.indexOf(t);~r&&e.splice(r,1)},t.pause=function(){return O(e,e=>e.pause(...arguments)),this},t.resume=function(){return O(e,e=>e.resume(...arguments)),this},t.set=function(t){O(e,(e,r)=>{let n=F.fun(t)?t(r,e):t;n&&e.set(n)})},t.start=function(t){let r=[];return O(e,(e,n)=>{if(F.und(t))r.push(e.start());else{let i=this._getProps(t,e,n);i&&r.push(e.start(i))}}),r},t.stop=function(){return O(e,e=>e.stop(...arguments)),this},t.update=function(t){return O(e,(e,r)=>e.update(this._getProps(t,e,r))),this};let r=function(e,t,r){return F.fun(e)?e(r,t):e};return t._getProps=r,t})():void 0,[]),o=(0,s.useRef)(0),a=eN(),l=(0,s.useMemo)(()=>({ctrls:[],queue:[],flush(e,t){let r=tz(e,t);return!(o.current>0)||l.queue.length||Object.keys(r).some(t=>!e.springs[t])?new Promise(n=>{tK(e,r),l.queue.push(()=>{n(tj(e,t))}),a()}):tj(e,t)}}),[]),u=(0,s.useRef)([...l.ctrls]),c=[],h=ez(e)||0;function f(e,r){for(let i=e;i<r;i++){let e=u.current[i]||(u.current[i]=new tN(null,l.flush)),r=n?n(i,e):t[i];r&&(c[i]=function(e){let t=tP(e);return F.und(t.default)&&(t.default=tr(t)),t}(r))}}(0,s.useMemo)(()=>{O(u.current.slice(e,h),e=>{e.ref?.delete(e),i?.delete(e),e.stop(!0)}),u.current.length=e,f(h,e)},[e]),(0,s.useMemo)(()=>{f(0,Math.min(h,e))},r);let d=u.current.map((e,t)=>tz(e,c[t])),p=(0,s.useContext)(tY),m=ez(p),g=p!==m&&function(e){for(let t in e)return!0;return!1}(p);ek(()=>{o.current++,l.ctrls=u.current;let{queue:e}=l;e.length&&(l.queue=[],O(e,e=>e())),O(u.current,(e,t)=>{i?.add(e),g&&e.start({default:p});let r=c[t];if(r){var n;(n=r.ref)&&e.ref!==n&&(e.ref?.delete(e),n.add(e),e.ref=n),e.ref?e.queue.push(r):e.start(r)}})}),ej(()=>()=>{O(l.ctrls,e=>e.stop(!0))});let v=d.map(e=>({...e}));return i?[v,i]:v}(1,r?e:[e],r?t||[]:t);return r||2==arguments.length?[n,i]:n}tY.Provider=tZ.Provider,tY.Consumer=tZ.Consumer;var tW=class extends tC{constructor(e,t){super(),this.source=e,this.idle=!0,this._active=new Set,this.calc=ep(...t);let r=this._get();eQ(this,e2(r).create(r))}advance(e){let t=this._get();S(t,this.get())||(eV(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&t0(this._active)&&t1(this)}_get(){let e=F.arr(this.source)?this.source.map(ey):I(ey(this.source));return this.calc(...e)}_start(){this.idle&&!t0(this._active)&&(this.idle=!1,O(eX(this),e=>{e.done=!1}),u.skipAnimation?(h.batchedUpdates(()=>this.advance()),t1(this)):K.start(this))}_attach(){let e=1;O(I(this.source),t=>{ev(t)&&ex(t,this),t instanceof tC&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))}),this.priority=e,this._start()}_detach(){O(I(this.source),e=>{ev(e)&&eC(e,this)}),this._active.clear(),t1(this)}eventObserved(e){"change"==e.type?e.idle?this.advance():(this._active.add(e.parent),this._start()):"idle"==e.type?this._active.delete(e.parent):"priority"==e.type&&(this.priority=I(this.source).reduce((e,t)=>
114Math.max(e,(t instanceof tC?t.priority:0)+1),0))}};function t$(e){return!1!==e.idle}function t0(e){return!e.size||Array.from(e).every(t$)}function t1(e){e.idle||(e.idle=!0,O(eX(e),e=>{e.done=!0}),e_(e,{type:"idle",parent:e}))}u.assign({createStringInterpolator:eP,to:(e,t)=>new tW(e,t)}),K.advance;var t2=["primitive"].concat(Object.keys(r(1698)).filter(e=>/^[A-Z]/.test(e)).map(e=>e[0].toLowerCase()+e.slice(1)));u.assign({createStringInterpolator:eP,colors:{transparent:0,aliceblue:0xf0f8ffff,antiquewhite:0xfaebd7ff,aqua:0xffffff,aquamarine:0x7fffd4ff,azure:0xf0ffffff,beige:0xf5f5dcff,bisque:0xffe4c4ff,black:255,blanchedalmond:0xffebcdff,blue:65535,blueviolet:0x8a2be2ff,brown:0xa52a2aff,burlywood:0xdeb887ff,burntsienna:0xea7e5dff,cadetblue:0x5f9ea0ff,chartreuse:0x7fff00ff,chocolate:0xd2691eff,coral:0xff7f50ff,cornflowerblue:0x6495edff,cornsilk:0xfff8dcff,crimson:0xdc143cff,cyan:0xffffff,darkblue:35839,darkcyan:9145343,darkgoldenrod:0xb8860bff,darkgray:0xa9a9a9ff,darkgreen:6553855,darkgrey:0xa9a9a9ff,darkkhaki:0xbdb76bff,darkmagenta:0x8b008bff,darkolivegreen:0x556b2fff,darkorange:0xff8c00ff,darkorchid:0x9932ccff,darkred:0x8b0000ff,darksalmon:0xe9967aff,darkseagreen:0x8fbc8fff,darkslateblue:0x483d8bff,darkslategray:0x2f4f4fff,darkslategrey:0x2f4f4fff,darkturquoise:0xced1ff,darkviolet:0x9400d3ff,deeppink:0xff1493ff,deepskyblue:0xbfffff,dimgray:0x696969ff,dimgrey:0x696969ff,dodgerblue:0x1e90ffff,firebrick:0xb22222ff,floralwhite:0xfffaf0ff,forestgreen:0x228b22ff,fuchsia:0xff00ffff,gainsboro:0xdcdcdcff,ghostwhite:0xf8f8ffff,gold:0xffd700ff,goldenrod:0xdaa520ff,gray:0x808080ff,green:8388863,greenyellow:0xadff2fff,grey:0x808080ff,honeydew:0xf0fff0ff,hotpink:0xff69b4ff,indianred:0xcd5c5cff,indigo:0x4b0082ff,ivory:0xfffff0ff,khaki:0xf0e68cff,lavender:0xe6e6faff,lavenderblush:0xfff0f5ff,lawngreen:0x7cfc00ff,lemonchiffon:0xfffacdff,lightblue:0xadd8e6ff,lightcoral:0xf08080ff,lightcyan:0xe0ffffff,lightgoldenrodyellow:0xfafad2ff,lightgray:0xd3d3d3ff,lightgreen:0x90ee90ff,lightgrey:0xd3d3d3ff,lightpink:0xffb6c1ff,lightsalmon:0xffa07aff,lightseagreen:0x20b2aaff,lightskyblue:0x87cefaff,lightslategray:0x778899ff,lightslategrey:0x778899ff,lightsteelblue:0xb0c4deff,lightyellow:0xffffe0ff,lime:0xff00ff,limegreen:0x32cd32ff,linen:0xfaf0e6ff,magenta:0xff00ffff,maroon:0x800000ff,mediumaquamarine:0x66cdaaff,mediumblue:52735,mediumorchid:0xba55d3ff,mediumpurple:0x9370dbff,mediumseagreen:0x3cb371ff,mediumslateblue:0x7b68eeff,mediumspringgreen:0xfa9aff,mediumturquoise:0x48d1ccff,mediumvioletred:0xc71585ff,midnightblue:0x191970ff,mintcream:0xf5fffaff,mistyrose:0xffe4e1ff,moccasin:0xffe4b5ff,navajowhite:0xffdeadff,navy:33023,oldlace:0xfdf5e6ff,olive:0x808000ff,olivedrab:0x6b8e23ff,orange:0xffa500ff,orangered:0xff4500ff,orchid:0xda70d6ff,palegoldenrod:0xeee8aaff,palegreen:0x98fb98ff,paleturquoise:0xafeeeeff,palevioletred:0xdb7093ff,papayawhip:0xffefd5ff,peachpuff:0xffdab9ff,peru:0xcd853fff,pink:0xffc0cbff,plum:0xdda0ddff,powderblue:0xb0e0e6ff,purple:0x800080ff,rebeccapurple:0x663399ff,red:0xff0000ff,rosybrown:0xbc8f8fff,royalblue:0x4169e1ff,saddlebrown:0x8b4513ff,salmon:0xfa8072ff,sandybrown:0xf4a460ff,seagreen:0x2e8b57ff,seashell:0xfff5eeff,sienna:0xa0522dff,silver:0xc0c0c0ff,skyblue:0x87ceebff,slateblue:0x6a5acdff,slategray:0x708090ff,slategrey:0x708090ff,snow:0xfffafaff,springgreen:0xff7fff,steelblue:0x4682b4ff,tan:0xd2b48cff,teal:8421631,thistle:0xd8bfd8ff,tomato:0xff6347ff,turquoise:0x40e0d0ff,violet:0xee82eeff,wheat:0xf5deb3ff,white:0xffffffff,whitesmoke:0xf5f5f5ff,yellow:0xffff00ff,yellowgreen:0x9acd32ff},frameLoop:"demand"}),(0,a.j)(()=>{h.advance()});var t3=((e,{applyAnimatedValues:t=()=>!1,createAnimatedStyle:r=e=>new e$(e),getComponentProps:n=e=>e}={})=>{let i={applyAnimatedValues:t,createAnimatedStyle:r,getComponentProps:n},o=e=>{let t=e5(e)||"Anonymous";return(e=F.str(e)?o[e]||(o[e]=e3(e,i)):e[e8]||(e[e8]=e3(e,i))).displayName=`Animated(${t})`,e};return R(e,(t,r)=>{F.arr(e)&&(r=e5(t)),o[r]=o(t)}),{animated:o}})(t2,{applyAnimatedValues:a.q}).animated},4159:(e,t)=>{"use strict";t.ConcurrentRoot=1,t.ContinuousEventPriority=8,t.DefaultEventPriority=32,t.DiscreteEventPriority=2},4631:(e,t,r)=>{"use strict";function n(e,t){return null==e||null==t?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function i(e,t){return null==e||null==t?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function o(e){let t,r,o;
114function s(e,n,i=0,o=e.length){if(i<o){if(0!==t(n,n))return o;do{let t=i+o>>>1;0>r(e[t],n)?i=t+1:o=t}while(i<o)}return i}return 2!==e.length?(t=n,r=(t,r)=>n(e(t),r),o=(t,r)=>e(t)-r):(t=e===n||e===i?e:a,r=e,o=e),{left:s,center:function(e,t,r=0,n=e.length){let i=s(e,t,r,n-1);return i>r&&o(e[i-1],t)>-o(e[i],t)?i-1:i},right:function(e,n,i=0,o=e.length){if(i<o){if(0!==t(n,n))return o;do{let t=i+o>>>1;0>=r(e[t],n)?i=t+1:o=t}while(i<o)}return i}}}function a(){return 0}r.d(t,{C:()=>y,Ay:()=>A,D_:()=>p});let s=o(n),l=s.right;s.left,o(function(e){return null===e?NaN:+e}).center;var u=r(7831),c=r(2623),h=r(114);function f(e){return+e}var d=[0,1];function p(e){return e}function m(e,t){var r;return(t-=e*=1)?function(r){return(r-e)/t}:(r=isNaN(t)?NaN:.5,function(){return r})}function g(e,t,r){var n=e[0],i=e[1],o=t[0],a=t[1];return i<n?(n=m(i,n),o=r(a,o)):(n=m(n,i),o=r(o,a)),function(e){return o(n(e))}}function v(e,t,r){var n=Math.min(e.length,t.length)-1,i=Array(n),o=Array(n),a=-1;for(e[n]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<n;)i[a]=m(e[a],e[a+1]),o[a]=r(t[a],t[a+1]);return function(t){var r=l(e,t,1,n)-1;return o[r](i[r](t))}}function y(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function A(){return(function(){var e,t,r,n,i,o,a=d,s=d,l=u.A,m=p;function y(){var e,t,r,l=Math.min(a.length,s.length);return m!==p&&(e=a[0],t=a[l-1],e>t&&(r=e,e=t,t=r),m=function(r){return Math.max(e,Math.min(t,r))}),n=l>2?v:g,i=o=null,A}function A(t){return null==t||isNaN(t*=1)?r:(i||(i=n(a.map(e),s,l)))(e(m(t)))}return A.invert=function(r){return m(t((o||(o=n(s,a.map(e),c.A)))(r)))},A.domain=function(e){return arguments.length?(a=Array.from(e,f),y()):a.slice()},A.range=function(e){return arguments.length?(s=Array.from(e),y()):s.slice()},A.rangeRound=function(e){return s=Array.from(e),l=h.A,y()},A.clamp=function(e){return arguments.length?(m=!!e||p,y()):m!==p},A.interpolate=function(e){return arguments.length?(l=e,y()):l},A.unknown=function(e){return arguments.length?(r=e,A):r},function(r,n){return e=r,t=n,y()}})()(p,p)}},4644:(e,t,r)=>{"use strict";function n(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}function i(e,t){switch(arguments.length){case 0:break;case 1:"function"==typeof e?this.interpolator(e):this.range(e);break;default:this.domain(e),"function"==typeof t?this.interpolator(t):this.range(t)}return this}r.d(t,{C:()=>n,K:()=>i})},4710:(e,t,r)=>{"use strict";function n(e){return"rgb("+Math.max(0,Math.min(255,Math.round(34.61+(e=Math.max(0,Math.min(1,e)))*(1172.33-e*(10793.56-e*(33300.12-e*(38394.49-14825.05*e)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+e*(557.33+e*(1225.33-e*(3574.96-e*(1073.77+707.56*e)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+e*(3211.1-e*(15327.97-e*(27814-e*(22569.18-6838.66*e)))))))+")"}r.d(t,{A:()=>n})},4743:(e,t,r)=>{"use strict";function n(e,t){if(e){if("string"==typeof e)return i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(e,t)}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function o(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}r.d(t,{A:()=>a});var a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=!(arguments.length>2)||void 0===arguments[2]||arguments[2],a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=(t instanceof Array?t.length?t:[void 0]:[t]).map(function(e){return{keyAccessor:e,isProp:!(e instanceof Function)}}),l=e.reduce(function(e,t){var n=e,i=t;
114return s.forEach(function(e,t){var a,l=e.keyAccessor;if(e.isProp){var u=i,c=u[l],h=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(u,[l].map(o));a=c,i=h}else a=l(i,t);t+1<s.length?(n.hasOwnProperty(a)||(n[a]={}),n=n[a]):r?(n.hasOwnProperty(a)||(n[a]=[]),n[a].push(i)):n[a]=i}),e},{});r instanceof Function&&function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;n===s.length?Object.keys(t).forEach(function(e){return t[e]=r(t[e])}):Object.values(t).forEach(function(t){return e(t,n+1)})}(l);var u=l;return a&&(u=[],!function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];r.length===s.length?u.push({keys:r,vals:t}):Object.entries(t).forEach(function(t){var o=function(e){if(Array.isArray(e))return e}(t)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,u=!1;try{o=(r=r.call(e)).next,!1;for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(t,2)||n(t,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),a=o[0];return e(o[1],[].concat(function(e){if(Array.isArray(e))return i(e)}(r)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||n(r)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),[a]))})}(l),t instanceof Array&&0===t.length&&1===u.length&&(u[0].keys=[])),u}},4792:(e,t,r)=>{"use strict";r.d(t,{A:()=>function e(){var t=(0,f.Ay)();return t.copy=function(){return(0,f.C)(t,e())},d.C.apply(t,arguments),C(t)},C:()=>C});let n=Math.sqrt(50),i=Math.sqrt(10),o=Math.sqrt(2);function a(e,t,r){let s,l,u,c=(t-e)/Math.max(0,r),h=Math.floor(Math.log10(c)),f=c/Math.pow(10,h),d=f>=n?10:f>=i?5:f>=o?2:1;return(h<0?(s=Math.round(e*(u=Math.pow(10,-h)/d)),l=Math.round(t*u),s/u<e&&++s,l/u>t&&--l,u=-u):(s=Math.round(e/(u=Math.pow(10,h)*d)),l=Math.round(t/u),s*u<e&&++s,l*u>t&&--l),l<s&&.5<=r&&r<2)?a(e,t,2*r):[s,l,u]}function s(e,t,r){return a(e*=1,t*=1,r*=1)[2]}var l,u,c,h,f=r(4631),d=r(4644),p=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function m(e){var t;if(!(t=p.exec(e)))throw Error("invalid format: "+e);return new g({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function g(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function v(e,t){if((r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var r,n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function y(e){return(e=v(Math.abs(e)))?e[1]:NaN}function A(e,t){var r=v(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+Array(i-n.length+2).join("0")}m.prototype=g.prototype,g.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};let _={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>
114e+"",d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>A(100*e,t),r:A,s:function(e,t){var r=v(e,t);if(!r)return e+"";var n=r[0],i=r[1],o=i-(l=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=n.length;return o===a?n:o>a?n+Array(o-a+1).join("0"):o>0?n.slice(0,o)+"."+n.slice(o):"0."+Array(1-o).join("0")+v(e,Math.max(0,t+o-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function b(e){return e}var B=Array.prototype.map,x=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"];function C(e){var t=e.domain;return e.ticks=function(e){var r=t();return function(e,t,r){if(t*=1,e*=1,!((r*=1)>0))return[];if(e===t)return[e];let n=t<e,[i,o,s]=n?a(t,e,r):a(e,t,r);if(!(o>=i))return[];let l=o-i+1,u=Array(l);if(n)if(s<0)for(let e=0;e<l;++e)u[e]=-((o-e)/s);else for(let e=0;e<l;++e)u[e]=(o-e)*s;else if(s<0)for(let e=0;e<l;++e)u[e]=-((i+e)/s);else for(let e=0;e<l;++e)u[e]=(i+e)*s;return u}(r[0],r[r.length-1],null==e?10:e)},e.tickFormat=function(e,r){var n=t();return function(e,t,r,n){var i,o,a=function(e,t,r){t*=1,e*=1,r*=1;let n=t<e,i=n?s(t,e,r):s(e,t,r);return(n?-1:1)*(i<0?-(1/i):i)}(e,t,r);switch((n=m(null==n?",f":n)).type){case"s":var l=Math.max(Math.abs(e),Math.abs(t));return null!=n.precision||isNaN(o=Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(y(l)/3)))-y(Math.abs(a))))||(n.precision=o),h(n,l);case"":case"e":case"g":case"p":case"r":null!=n.precision||isNaN(o=Math.max(0,y(Math.abs(Math.max(Math.abs(e),Math.abs(t)))-(i=Math.abs(i=a)))-y(i))+1)||(n.precision=o-("e"===n.type));break;case"f":case"%":null!=n.precision||isNaN(o=Math.max(0,-y(Math.abs(a))))||(n.precision=o-("%"===n.type)*2)}return c(n)}(n[0],n[n.length-1],null==e?10:e,r)},e.nice=function(r){null==r&&(r=10);var n,i,o=t(),a=0,l=o.length-1,u=o[a],c=o[l],h=10;for(c<u&&(i=u,u=c,c=i,i=a,a=l,l=i);h-- >0;){if((i=s(u,c,r))===n)return o[a]=u,o[l]=c,t(o);if(i>0)u=Math.floor(u/i)*i,c=Math.ceil(c/i)*i;else if(i<0)u=Math.ceil(u*i)/i,c=Math.floor(c*i)/i;else break;n=i}return e},e}c=(u=function(e){var t,r,n,i=void 0===e.grouping||void 0===e.thousands?b:(t=B.call(e.grouping,Number),r=e.thousands+"",function(e,n){for(var i=e.length,o=[],a=0,s=t[0],l=0;i>0&&s>0&&(l+s+1>n&&(s=Math.max(1,n-l)),o.push(e.substring(i-=s,i+s)),!((l+=s+1)>n));)s=t[a=(a+1)%t.length];return o.reverse().join(r)}),o=void 0===e.currency?"":e.currency[0]+"",a=void 0===e.currency?"":e.currency[1]+"",s=void 0===e.decimal?".":e.decimal+"",u=void 0===e.numerals?b:(n=B.call(e.numerals,String),function(e){return e.replace(/[0-9]/g,function(e){return n[+e]})}),c=void 0===e.percent?"%":e.percent+"",h=void 0===e.minus?"−":e.minus+"",f=void 0===e.nan?"NaN":e.nan+"";function d(e){var t=(e=m(e)).fill,r=e.align,n=e.sign,d=e.symbol,p=e.zero,g=e.width,v=e.comma,y=e.precision,A=e.trim,b=e.type;"n"===b?(v=!0,b="g"):_[b]||(void 0===y&&(y=12),A=!0,b="g"),(p||"0"===t&&"="===r)&&(p=!0,t="0",r="=");var B="$"===d?o:"#"===d&&/[boxX]/.test(b)?"0"+b.toLowerCase():"",C="$"===d?a:/[%p]/.test(b)?c:"",w=_[b],E=/[defgprs%]/.test(b);function M(e){var o,a,c,d=B,m=C;if("c"===b)m=w(e)+m,e="";else{var _=(e*=1)<0||1/e<0;
114if(e=isNaN(e)?f:w(Math.abs(e),y),A&&(e=function(e){r:for(var t,r=e.length,n=1,i=-1;n<r;++n)switch(e[n]){case".":i=t=n;break;case"0":0===i&&(i=n),t=n;break;default:if(!+e[n])break r;i>0&&(i=0)}return i>0?e.slice(0,i)+e.slice(t+1):e}(e)),_&&0==+e&&"+"!==n&&(_=!1),d=(_?"("===n?n:h:"-"===n||"("===n?"":n)+d,m=("s"===b?x[8+l/3]:"")+m+(_&&"("===n?")":""),E){for(o=-1,a=e.length;++o<a;)if(48>(c=e.charCodeAt(o))||c>57){m=(46===c?s+e.slice(o+1):e.slice(o))+m,e=e.slice(0,o);break}}}v&&!p&&(e=i(e,1/0));var M=d.length+e.length+m.length,T=M<g?Array(g-M+1).join(t):"";switch(v&&p&&(e=i(T+e,T.length?g-m.length:1/0),T=""),r){case"<":e=d+e+m+T;break;case"=":e=d+T+e+m;break;case"^":e=T.slice(0,M=T.length>>1)+d+e+m+T.slice(M);break;default:e=T+d+e+m}return u(e)}return y=void 0===y?6:/[gprs]/.test(b)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y)),M.toString=function(){return e+""},M}return{format:d,formatPrefix:function(e,t){var r=d(((e=m(e)).type="f",e)),n=3*Math.max(-8,Math.min(8,Math.floor(y(t)/3))),i=Math.pow(10,-n),o=x[8+n/3];return function(e){return r(i*e)+o}}}}({thousands:",",grouping:[3],currency:["$",""]})).format,h=u.formatPrefix},4896:(e,t,r)=>{"use strict";r.d(t,{N:()=>re});var n,i,o,a,s,l,u,c,h,f,d,p,m,g,v,y,A,_,b,B,x,C,w,E,M,T,F,S=r(1698);function O(e){return Array.from(function*(e){for(let t of e)yield*t}(e))}function R(e,t){let r,n;if(void 0===t)for(let t of e)null!=t&&(void 0===r?t>=t&&(r=n=t):(r>t&&(r=t),n<t&&(n=t)));else{let i=-1;for(let o of e)null!=(o=t(o,++i,e))&&(void 0===r?o>=o&&(r=n=o):(r>o&&(r=o),n<o&&(n=o)))}return[r,n]}var I=r(4098);let P=(3+8881784197001252e-31)*11102230246251565e-32;function D(e,t,r,n,i){let o,a,s,l,u=t[0],c=n[0],h=0,f=0;c>u==c>-u?(o=u,u=t[++h]):(o=c,c=n[++f]);let d=0;if(h<e&&f<r)for(c>u==c>-u?(a=u+o,s=o-(a-u),u=t[++h]):(a=c+o,s=o-(a-c),c=n[++f]),o=a,0!==s&&(i[d++]=s);h<e&&f<r;)c>u==c>-u?(l=(a=o+u)-o,s=o-(a-l)+(u-l),u=t[++h]):(l=(a=o+c)-o,s=o-(a-l)+(c-l),c=n[++f]),o=a,0!==s&&(i[d++]=s);for(;h<e;)l=(a=o+u)-o,s=o-(a-l)+(u-l),u=t[++h],o=a,0!==s&&(i[d++]=s);for(;f<r;)l=(a=o+c)-o,s=o-(a-l)+(c-l),c=n[++f],o=a,0!==s&&(i[d++]=s);return(0!==o||0===d)&&(i[d++]=o),d}function H(e){return new Float64Array(e)}let L=(3+17763568394002505e-31)*11102230246251565e-32,G=(2+13322676295501878e-31)*11102230246251565e-32,U=(9+7105427357601002e-30)*11102230246251565e-32*11102230246251565e-32,k=H(4),N=H(8),j=H(12),J=H(16),z=H(4);function K(e,t,r,n,i,o){let a=(t-o)*(r-i),s=(e-i)*(n-o),l=a-s,u=Math.abs(a+s);return Math.abs(l)>=L*u?l:-function(e,t,r,n,i,o,a){let s,l,u,c,h,f,d,p,m,g,v,y,A,_,b,B,x,C,w=e-i,E=r-i,M=t-o,T=n-o;_=w*T,d=(f=0x8000001*w)-(f-w),p=w-d,m=(f=0x8000001*T)-(f-T),b=p*(g=T-m)-(_-d*m-p*m-d*g),B=M*E,d=(f=0x8000001*M)-(f-M),p=M-d,m=(f=0x8000001*E)-(f-E),v=b-(x=p*(g=E-m)-(B-d*m-p*m-d*g)),h=b-v,k[0]=b-(v+h)+(h-x),h=(y=_+v)-_,v=(A=_-(y-h)+(v-h))-B,h=A-v,k[1]=A-(v+h)+(h-B),h=(C=y+v)-y,k[2]=y-(C-h)+(v-h),k[3]=C;let F=function(e,t){let r=t[0];for(let e=1;e<4;e++)r+=t[e];return r}(0,k),S=G*a;if(F>=S||-F>=S||(h=e-w,s=e-(w+h)+(h-i),h=r-E,u=r-(E+h)+(h-i),h=t-M,l=t-(M+h)+(h-o),h=n-T,c=n-(T+h)+(h-o),0===s&&0===l&&0===u&&0===c)||(S=U*a+P*Math.abs(F),(F+=w*c+T*s-(M*u+E*l))>=S||-F>=S))return F;_=s*T,d=(f=0x8000001*s)-(f-s),p=s-d,m=(f=0x8000001*T)-(f-T),b=p*(g=T-m)-(_-d*m-p*m-d*g),B=l*E,d=(f=0x8000001*l)-(f-l),p=l-d,m=(f=0x8000001*E)-(f-E),v=b-(x=p*(g=E-m)-(B-d*m-p*m-d*g)),h=b-v,z[0]=b-(v+h)+(h-x),h=(y=_+v)-_,v=(A=_-(y-h)+(v-h))-B,h=A-v,z[1]=A-(v+h)+(h-B),h=(C=y+v)-y,z[2]=y-(C-h)+(v-h),z[3]=C;let O=D(4,k,4,z,N);_=w*c,d=(f=0x8000001*w)-(f-w),p=w-d,m=(f=0x8000001*c)-(f-c),b=p*(g=c-m)-(_-d*m-p*m-d*g),B=M*u,d=(f=0x8000001*M)-(f-M),p=M-d,m=(f=0x8000001*u)-(f-u),v=b-(x=p*(g=u-m)-(B-d*m-p*m-d*g)),h=b-v,z[0]=b-(v+h)+(h-x),h=(y=_+v)-_,v=(A=_-(y-h)+(v-h))-B,h=A-v,z[1]=A-(v+h)+(h-B),h=(C=y+v)-y,z[2]=y-(C-h)+(v-h),z[3]=C;let R=D(O,N,4,z,j);_=s*c,d=(f=0x8000001*s)-(f-s),p=s-d,m=(f=0x8000001*c)-(f-c),b=p*(g=c-m)-(_-d*m-p*m-d*g),B=l*u,d=(f=0x8000001*l)-(f-l),p=l-d,m=(f=0x8000001*u)-(f-u),v=b-(x=p*(g=u-m)-(B-d*m-p*m-d*g)),h=b-v,z[0]=b-(v+h)+(h-x),h=(y=_+v)-_,v=(A=_-(y-h)+(v-h))-B,h=A-v,z[1]=A-(v+h)+(h-B),h=(C=y+v)-y,z[2]=y-(C-h)+(v-h),z[3]=C;let I=D(R,j,4,z,J);return J[I-1]}(e,t,r,n,i,o,u)}H(4),H(4),H(4),H(4),H(4),H(4),H(4),H(4),H(4),H(8),H(8),H(8),H(4),H(8),H(8),H(8),H(12),H(192),H(192),H(4),H(4),H(4),H(4),H(4),H(4),H(4),H(4),H(8),H(8),H(8),H(8),H(8),H(8),H(8),H(8),H(8),H(4),H(4),H(4),H(8),H(16),H(16),H(16),H(32),H(32),H(48),H(64),H(1152),H(1152),H(4),H(4),H(4),H(4),H(4),H(4),H(4),H(4),H(4),H(4),H(24),H(24),H(24),H(24),H(24),H(24),H(24),H(24),H(24),H(24),H(1152),H(1152),H(1152),H(1152),H(1152),H(2304),H(2304),H(3456),H(5760),H(8),H(8),H(8),H(16),H(24),H(48),H(48),H(96),H(192),H(384),H(384),H(384),H(768),H(96),H(96),H(96),H(1152);let V=new Uint32Array(512);class Q{static from(e,t=q,r=W){let n=e.length,i=new Float64Array(2*n);for(let o=0;o<n;o++){let n=e[o];i[2*o]=t(n),i[2*o+1]=r(n)}return new Q(i)}constructor(e){let t=e.length>>1;if(t>0&&"number"!=typeof e[0])throw Error("Expected coords to contain numbers.");this.coords=e;let r=Math.max(2*t-5,0);this._triangles=new Uint32Array(3*r),this._halfedges=new Int32Array(3*r),this._hashSize=Math.ceil(Math.sqrt(t)),this._hullPrev=new Uint32Array(t),this._hullNext=new Uint32Array(t),this._hullTri=new Uint32Array(t),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(t),this._dists=new Float64Array(t),this.update()}update(){let e,t,r,{coords:n,_hullPrev:i,_hullNext:o,_hullTri:a,_hullHash:s}=this,l=n.length>>1,u=1/0,c=1/0,h=-1/0,f=-1/0;for(let e=0;e<l;e++){let t=n[2*e],r=n[2*e+1];t<u&&(u=t),r<c&&(c=r),t>h&&(h=t),r>f&&(f=r),this._ids[e]=e}let d=(u+h)/2,p=(c+f)/2;for(let t=0,r=1/0;t<l;t++){let i=X(d,p,n[2*t],n[2*t+1]);i<r&&(e=t,r=i)}let m=n[2*e],g=n[2*e+1];for(let r=0,i=1/0;r<l;r++){if(r===e)continue;let o=X(m,g,n[2*r],n[2*r+1]);o<i&&o>0&&(t=r,i=o)}let v=n[2*t],y=n[2*t+1],A=1/0;for(let i=0;i<l;i++){if(i===e||i===t)continue;let o=function(e,t,r,n,i,o){let a=r-e,s=n-t,l=i-e,u=o-t,c=a*a+s*s,h=l*l+u*u,f=.5/(a*u-s*l),d=(u*c-s*h)*f,p=(a*h-l*c)*f;return d*d+p*p}(m,g,v,y,n[2*i],n[2*i+1]);o<A&&(r=i,A=o)}let _=n[2*r],b=n[2*r+1];if(A===1/0){for(let e=0;e<l;e++)this._dists[e]=n[2*e]-n[0]||n[2*e+1]-n[1];Y(this._ids,this._dists,0,l-1);let e=new Uint32Array(l),t=0;for(let r=0,n=-1/0;r<l;r++){let i=this._ids[r],o=this._dists[i];o>n&&(e[t++]=i,n=o)}this.hull=e.subarray(0,t),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(0>
114K(m,g,v,y,_,b)){let e=t,n=v,i=y;t=r,v=_,y=b,r=e,_=n,b=i}let B=function(e,t,r,n,i,o){let a=r-e,s=n-t,l=i-e,u=o-t,c=a*a+s*s,h=l*l+u*u,f=.5/(a*u-s*l);return{x:e+(u*c-s*h)*f,y:t+(a*h-l*c)*f}}(m,g,v,y,_,b);this._cx=B.x,this._cy=B.y;for(let e=0;e<l;e++)this._dists[e]=X(n[2*e],n[2*e+1],B.x,B.y);Y(this._ids,this._dists,0,l-1),this._hullStart=e;let x=3;o[e]=i[r]=t,o[t]=i[e]=r,o[r]=i[t]=e,a[e]=0,a[t]=1,a[r]=2,s.fill(-1),s[this._hashKey(m,g)]=e,s[this._hashKey(v,y)]=t,s[this._hashKey(_,b)]=r,this.trianglesLen=0,this._addTriangle(e,t,r,-1,-1,-1);for(let l=0,u,c;l<this._ids.length;l++){let h=this._ids[l],f=n[2*h],d=n[2*h+1];if(l>0&&2220446049250313e-31>=Math.abs(f-u)&&2220446049250313e-31>=Math.abs(d-c)||(u=f,c=d,h===e||h===t||h===r))continue;let p=0;for(let e=0,t=this._hashKey(f,d);e<this._hashSize&&(-1===(p=s[(t+e)%this._hashSize])||p===o[p]);e++);let m=p=i[p],g;for(;g=o[m],K(f,d,n[2*m],n[2*m+1],n[2*g],n[2*g+1])>=0;)if((m=g)===p){m=-1;break}if(-1===m)continue;let v=this._addTriangle(m,h,o[m],-1,-1,a[m]);a[h]=this._legalize(v+2),a[m]=v,x++;let y=o[m];for(;g=o[y],0>K(f,d,n[2*y],n[2*y+1],n[2*g],n[2*g+1]);)v=this._addTriangle(y,h,g,a[h],-1,a[y]),a[h]=this._legalize(v+2),o[y]=y,x--,y=g;if(m===p)for(;0>K(f,d,n[2*(g=i[m])],n[2*g+1],n[2*m],n[2*m+1]);)v=this._addTriangle(g,h,m,-1,a[m],a[g]),this._legalize(v+2),a[g]=v,o[m]=m,x--,m=g;this._hullStart=i[h]=m,o[m]=i[y]=h,o[h]=y,s[this._hashKey(f,d)]=h,s[this._hashKey(n[2*m],n[2*m+1])]=m}this.hull=new Uint32Array(x);for(let e=0,t=this._hullStart;e<x;e++)this.hull[e]=t,t=o[t];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(e,t){return Math.floor(function(e,t){let r=e/(Math.abs(e)+Math.abs(t));return(t>0?3-r:1+r)/4}(e-this._cx,t-this._cy)*this._hashSize)%this._hashSize}_legalize(e){let{_triangles:t,_halfedges:r,coords:n}=this,i=0,o=0;for(;;){let a=r[e],s=e-e%3;if(o=s+(e+2)%3,-1===a){if(0===i)break;e=V[--i];continue}let l=a-a%3,u=s+(e+1)%3,c=l+(a+2)%3,h=t[o],f=t[e],d=t[u],p=t[c];if(function(e,t,r,n,i,o,a,s){let l=e-a,u=t-s,c=r-a,h=n-s,f=i-a,d=o-s,p=c*c+h*h,m=f*f+d*d;return l*(h*m-p*d)-u*(c*m-p*f)+(l*l+u*u)*(c*d-h*f)<0}(n[2*h],n[2*h+1],n[2*f],n[2*f+1],n[2*d],n[2*d+1],n[2*p],n[2*p+1])){t[e]=p,t[a]=h;let n=r[c];if(-1===n){let t=this._hullStart;do{if(this._hullTri[t]===c){this._hullTri[t]=e;break}t=this._hullPrev[t]}while(t!==this._hullStart)}this._link(e,n),this._link(a,r[o]),this._link(o,c);let s=l+(a+1)%3;i<V.length&&(V[i++]=s)}else{if(0===i)break;e=V[--i]}}return o}_link(e,t){this._halfedges[e]=t,-1!==t&&(this._halfedges[t]=e)}_addTriangle(e,t,r,n,i,o){let a=this.trianglesLen;return this._triangles[a]=e,this._triangles[a+1]=t,this._triangles[a+2]=r,this._link(a,n),this._link(a+1,i),this._link(a+2,o),this.trianglesLen+=3,a}}function X(e,t,r,n){let i=e-r,o=t-n;return i*i+o*o}function Y(e,t,r,n){if(n-r<=20)for(let i=r+1;i<=n;i++){let n=e[i],o=t[n],a=i-1;for(;a>=r&&t[e[a]]>o;)e[a+1]=e[a--];e[a+1]=n}else{let i=r+n>>1,o=r+1,a=n;Z(e,i,o),t[e[r]]>t[e[n]]&&Z(e,r,n),t[e[o]]>t[e[n]]&&Z(e,o,n),t[e[r]]>t[e[o]]&&Z(e,r,o);let s=e[o],l=t[s];for(;;){do o++;while(t[e[o]]<l);do a--;while(t[e[a]]>l);if(a<o)break;Z(e,o,a)}e[r+1]=e[a],e[a]=s,n-o+1>=a-r?(Y(e,t,o,n),Y(e,t,r,a-1)):(Y(e,t,r,a-1),Y(e,t,o,n))}}function Z(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}function q(e){return e[0]}function W(e){return e[1]}function $(e,t,r){var n=!1;t[0][0]===t[t.length-1][0]&&t[0][1]===t[t.length-1][1]&&(t=t.slice(0,t.length-1));for(var i=0,o=t.length-1;i<t.length;o=i++){var a=t[i][0],s=t[i][1],l=t[o][0],u=t[o][1];if(e[1]*(a-l)+s*(l-e[0])+u*(e[0]-a)==0&&(a-e[0])*(l-e[0])<=0&&(s-e[1])*(u-e[1])<=0)return!r;s>e[1]!=u>e[1]&&e[0]<(l-a)*(e[1]-s)/(u-s)+a&&(n=!n)}return n}var ee,et,er,en,ei,eo=r(1708),ea=r(2493),es=r(2047),el=new eo.ph,eu=new eo.ph,ec={point:es.A,lineStart:es.A,lineEnd:es.A,polygonStart:function(){el=new eo.ph,ec.lineStart=eh,ec.lineEnd=ef},polygonEnd:function(){var e=+el;eu.add(e<0?ea.FA+e:e),this.lineStart=this.lineEnd=this.point=es.A},sphere:function(){eu.add(ea.FA)}};function eh(){ec.point=ed}function ef(){ep(ee,et)}function ed(e,t){ec.point=ep,ee=e,et=t,e*=ea.F2,t*=ea.F2,er=e,en=(0,ea.gn)(t=t/2+ea.gz),ei=(0,ea.F8)(t)}function ep(e,t){e*=ea.F2,t*=ea.F2,t=t/2+ea.gz;var r=e-er,n=r>=0?1:-1,i=n*r,o=(0,ea.gn)(t),a=(0,ea.F8)(t),s=ei*a,l=en*o+s*(0,ea.gn)(i),u=s*n*(0,ea.F8)(i);el.add((0,ea.FP)(u,l)),er=e,en=o,ei=a}function em(e){return[(0,ea.FP)(e[1],e[0]),(0,ea.qR)(e[2])]}function eg(e){var t=e[0],r=e[1],n=(0,ea.gn)(r);return[n*(0,ea.gn)(t),n*(0,ea.F8)(t),(0,ea.F8)(r)]}function ev(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function ey(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function eA(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function e_(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function eb(e){var t=(0,ea.RZ)(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}var eB=r(2439),ex={point:eC,lineStart:eE,lineEnd:eM,polygonStart:function(){ex.point=eT,ex.lineStart=eF,ex.lineEnd=eS,h=new eo.ph,ec.polygonStart()}
114,polygonEnd:function(){ec.polygonEnd(),ex.point=eC,ex.lineStart=eE,ex.lineEnd=eM,el<0?(n=-(o=180),i=-(a=90)):h>ea.Ni?a=90:h<-ea.Ni&&(i=-90),d[0]=n,d[1]=o},sphere:function(){n=-(o=180),i=-(a=90)}};function eC(e,t){f.push(d=[n=e,o=e]),t<i&&(i=t),t>a&&(a=t)}function ew(e,t){var r=eg([e*ea.F2,t*ea.F2]);if(c){var l=ey(c,r),u=ey([l[1],-l[0],0],l);eb(u),u=em(u);var h,p=e-s,m=p>0?1:-1,g=u[0]*ea.uj*m,v=(0,ea.tn)(p)>180;v^(m*s<g&&g<m*e)?(h=u[1]*ea.uj)>a&&(a=h):v^(m*s<(g=(g+360)%360-180)&&g<m*e)?(h=-u[1]*ea.uj)<i&&(i=h):(t<i&&(i=t),t>a&&(a=t)),v?e<s?eO(n,e)>eO(n,o)&&(o=e):eO(e,o)>eO(n,o)&&(n=e):o>=n?(e<n&&(n=e),e>o&&(o=e)):e>s?eO(n,e)>eO(n,o)&&(o=e):eO(e,o)>eO(n,o)&&(n=e)}else f.push(d=[n=e,o=e]);t<i&&(i=t),t>a&&(a=t),c=r,s=e}function eE(){ex.point=ew}function eM(){d[0]=n,d[1]=o,ex.point=eC,c=null}function eT(e,t){if(c){var r=e-s;h.add((0,ea.tn)(r)>180?r+(r>0?360:-360):r)}else l=e,u=t;ec.point(e,t),ew(e,t)}function eF(){ec.lineStart()}function eS(){eT(l,u),ec.lineEnd(),(0,ea.tn)(h)>ea.Ni&&(n=-(o=180)),d[0]=n,d[1]=o,c=null}function eO(e,t){return(t-=e)<0?t+360:t}function eR(e,t){return e[0]-t[0]}function eI(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}function eP(e){var t,r,s,l,u,c,h;if(a=o=-(n=i=1/0),f=[],(0,eB.A)(e,ex),r=f.length){for(f.sort(eR),t=1,u=[s=f[0]];t<r;++t)eI(s,(l=f[t])[0])||eI(s,l[1])?(eO(s[0],l[1])>eO(s[0],s[1])&&(s[1]=l[1]),eO(l[0],s[1])>eO(s[0],s[1])&&(s[0]=l[0])):u.push(s=l);for(c=-1/0,r=u.length-1,t=0,s=u[r];t<=r;s=l,++t)l=u[t],(h=eO(s[1],l[0]))>c&&(c=h,n=l[0],o=s[1])}return f=d=null,n===1/0||i===1/0?[[NaN,NaN],[NaN,NaN]]:[[n,i],[o,a]]}var eD=r(2042),eH=r(7134);function eL(e){return(0,ea.tn)(e[0])<=ea.pi?e[0]:(0,ea._S)(e[0])*(((0,ea.tn)(e[0])+ea.pi)%ea.FA-ea.pi)}function eG(e,t){var r=eL(t),n=t[1],i=(0,ea.F8)(n),o=[(0,ea.F8)(r),-(0,ea.gn)(r),0],a=0,s=0,l=new eo.ph;1===i?n=ea.TW+ea.Ni:-1===i&&(n=-ea.TW-ea.Ni);for(var u=0,c=e.length;u<c;++u)if(f=(h=e[u]).length)for(var h,f,d=h[f-1],p=eL(d),m=d[1]/2+ea.gz,g=(0,ea.F8)(m),v=(0,ea.gn)(m),y=0;y<f;++y,p=_,g=B,v=x,d=A){var A=h[y],_=eL(A),b=A[1]/2+ea.gz,B=(0,ea.F8)(b),x=(0,ea.gn)(b),C=_-p,w=C>=0?1:-1,E=w*C,M=E>ea.pi,T=g*B;if(l.add((0,ea.FP)(T*w*(0,ea.F8)(E),v*x+T*(0,ea.gn)(E))),a+=M?C+w*ea.FA:C,M^p>=r^_>=r){var F=ey(eg(d),eg(A));eb(F);var S=ey(o,F);eb(S);var O=(M^C>=0?-1:1)*(0,ea.qR)(S[2]);(n>O||n===O&&(F[0]||F[1]))&&(s+=M^C>=0?1:-1)}}return(a<-ea.Ni||a<ea.Ni&&l<-ea.$t)^1&s}var eU={Feature:function(e,t){return eN(e.geometry,t)},FeatureCollection:function(e,t){for(var r=e.features,n=-1,i=r.length;++n<i;)if(eN(r[n].geometry,t))return!0;return!1}},ek={Sphere:function(){return!0},Point:function(e,t){return ej(e.coordinates,t)},MultiPoint:function(e,t){for(var r=e.coordinates,n=-1,i=r.length;++n<i;)if(ej(r[n],t))return!0;return!1},LineString:function(e,t){return eJ(e.coordinates,t)},MultiLineString:function(e,t){for(var r=e.coordinates,n=-1,i=r.length;++n<i;)if(eJ(r[n],t))return!0;return!1},Polygon:function(e,t){return ez(e.coordinates,t)},MultiPolygon:function(e,t){for(var r=e.coordinates,n=-1,i=r.length;++n<i;)if(ez(r[n],t))return!0;return!1},GeometryCollection:function(e,t){for(var r=e.geometries,n=-1,i=r.length;++n<i;)if(eN(r[n],t))return!0;return!1}};function eN(e,t){return!!(e&&ek.hasOwnProperty(e.type))&&ek[e.type](e,t)}function ej(e,t){return 0===(0,eD.A)(e,t)}function eJ(e,t){for(var r,n,i,o=0,a=e.length;o<a;o++){if(0===(n=(0,eD.A)(e[o],t))||o>0&&(i=(0,eD.A)(e[o],e[o-1]))>0&&r<=i&&n<=i&&(r+n-i)*(1-Math.pow((r-n)/i,2))<ea.$t*i)return!0;r=n}return!1}function ez(e,t){return!!eG(e.map(eK),eV(t))}function eK(e){return(e=e.map(eV)).pop(),e}function eV(e){return[e[0]*ea.F2,e[1]*ea.F2]}var eQ={sphere:es.A,point:eX,lineStart:eZ,lineEnd:e$,polygonStart:function(){eQ.lineStart=e0,eQ.lineEnd=e1},polygonEnd:function(){eQ.lineStart=eZ,eQ.lineEnd=e$}};function eX(e,t){e*=ea.F2,t*=ea.F2;var r=(0,ea.gn)(t);eY(r*(0,ea.gn)(e),r*(0,ea.F8)(e),(0,ea.F8)(t))}function eY(e,t,r){++p,g+=(e-g)/p,v+=(t-v)/p,y+=(r-y)/p}function eZ(){eQ.point=eq}function eq(e,t){e*=ea.F2,t*=ea.F2;var r=(0,ea.gn)(t);M=r*(0,ea.gn)(e),T=r*(0,ea.F8)(e),F=(0,ea.F8)(t),eQ.point=eW,eY(M,T,F)}function eW(e,t){e*=ea.F2,t*=ea.F2;var r=(0,ea.gn)(t),n=r*(0,ea.gn)(e),i=r*(0,ea.F8)(e),o=(0,ea.F8)(t),a=(0,ea.FP)((0,ea.RZ)((a=T*o-F*i)*a+(a=F*n-M*o)*a+(a=M*i-T*n)*a),M*n+T*i+F*o);
114m+=a,A+=a*(M+(M=n)),_+=a*(T+(T=i)),b+=a*(F+(F=o)),eY(M,T,F)}function e$(){eQ.point=eX}function e0(){eQ.point=e2}function e1(){e3(w,E),eQ.point=eX}function e2(e,t){w=e,E=t,e*=ea.F2,t*=ea.F2,eQ.point=e3;var r=(0,ea.gn)(t);M=r*(0,ea.gn)(e),T=r*(0,ea.F8)(e),F=(0,ea.F8)(t),eY(M,T,F)}function e3(e,t){e*=ea.F2,t*=ea.F2;var r=(0,ea.gn)(t),n=r*(0,ea.gn)(e),i=r*(0,ea.F8)(e),o=(0,ea.F8)(t),a=T*o-F*i,s=F*n-M*o,l=M*i-T*n,u=(0,ea.dY)(a,s,l),c=(0,ea.qR)(u),h=u&&-c/u;B.add(h*a),x.add(h*s),C.add(h*l),m+=c,A+=c*(M+(M=n)),_+=c*(T+(T=i)),b+=c*(F+(F=o)),eY(M,T,F)}function e9(e){p=m=g=v=y=A=_=b=0,B=new eo.ph,x=new eo.ph,C=new eo.ph,(0,eB.A)(e,eQ);var t=+B,r=+x,n=+C,i=(0,ea.dY)(t,r,n);return i<ea.$t&&(t=A,r=_,n=b,m<ea.Ni&&(t=g,r=v,n=y),(i=(0,ea.dY)(t,r,n))<ea.$t)?[NaN,NaN]:[(0,ea.FP)(r,t)*ea.uj,(0,ea.qR)(n/i)*ea.uj]}class e8{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(e,t){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(e,t){this._+=`L${this._x1=+e},${this._y1=+t}`}arc(e,t,r){e*=1,t*=1,r*=1;let n=e+r,i=t;if(r<0)throw Error("negative radius");null===this._x1?this._+=`M${n},${i}`:(Math.abs(this._x1-n)>1e-6||Math.abs(this._y1-i)>1e-6)&&(this._+="L"+n+","+i),r&&(this._+=`A${r},${r},0,1,1,${e-r},${t}A${r},${r},0,1,1,${this._x1=n},${this._y1=i}`)}rect(e,t,r,n){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${+r}v${+n}h${-r}Z`}value(){return this._||null}}class e5{constructor(){this._=[]}moveTo(e,t){this._.push([e,t])}closePath(){this._.push(this._[0].slice())}lineTo(e,t){this._.push([e,t])}value(){return this._.length?this._:null}}class e6{constructor(e,[t,r,n,i]=[0,0,960,500]){if(!((n*=1)>=(t*=1))||!((i*=1)>=(r*=1)))throw Error("invalid bounds");this.delaunay=e,this._circumcenters=new Float64Array(2*e.points.length),this.vectors=new Float64Array(2*e.points.length),this.xmax=n,this.xmin=t,this.ymax=i,this.ymin=r,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){let e,t,{delaunay:{points:r,hull:n,triangles:i},vectors:o}=this,a=this.circumcenters=this._circumcenters.subarray(0,i.length/3*2);for(let o=0,s=0,l=i.length,u,c;o<l;o+=3,s+=2){let l=2*i[o],h=2*i[o+1],f=2*i[o+2],d=r[l],p=r[l+1],m=r[h],g=r[h+1],v=r[f],y=r[f+1],A=m-d,_=g-p,b=v-d,B=y-p,x=(A*B-_*b)*2;if(1e-9>Math.abs(x)){if(void 0===e){for(let i of(e=t=0,n))e+=r[2*i],t+=r[2*i+1];e/=n.length,t/=n.length}let i=1e9*Math.sign((e-d)*B-(t-p)*b);u=(d+v)/2-i*B,c=(p+y)/2+i*b}else{let e=1/x,t=A*A+_*_,r=b*b+B*B;u=d+(B*t-_*r)*e,c=p+(A*r-b*t)*e}a[s]=u,a[s+1]=c}let s=n[n.length-1],l,u=4*s,c,h=r[2*s],f,d=r[2*s+1];o.fill(0);for(let e=0;e<n.length;++e)s=n[e],l=u,c=h,f=d,u=4*s,h=r[2*s],d=r[2*s+1],o[l+2]=o[u]=f-d,o[l+3]=o[u+1]=h-c}render(e){let t=null==e?e=new e8:void 0,{delaunay:{halfedges:r,inedges:n,hull:i},circumcenters:o,vectors:a}=this;if(i.length<=1)return null;for(let t=0,n=r.length;t<n;++t){let n=r[t];if(n<t)continue;let i=2*Math.floor(t/3),a=2*Math.floor(n/3),s=o[i],l=o[i+1],u=o[a],c=o[a+1];this._renderSegment(s,l,u,c,e)}let s,l=i[i.length-1];for(let t=0;t<i.length;++t){s=l;let r=2*Math.floor(n[l=i[t]]/3),u=o[r],c=o[r+1],h=4*s,f=this._project(u,c,a[h+2],a[h+3]);f&&this._renderSegment(u,c,f[0],f[1],e)}return t&&t.value()}renderBounds(e){let t=null==e?e=new e8:void 0;return e.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),t&&t.value()}renderCell(e,t){let r=null==t?t=new e8:void 0,n=this._clip(e);if(null===n||!n.length)return;t.moveTo(n[0],n[1]);let i=n.length;for(;n[0]===n[i-2]&&n[1]===n[i-1]&&i>1;)i-=2;for(let e=2;e<i;e+=2)(n[e]!==n[e-2]||n[e+1]!==n[e-1])&&t.lineTo(n[e],n[e+1]);return t.closePath(),r&&r.value()}*cellPolygons(){let{delaunay:{points:e}}=this;for(let t=0,r=e.length/2;t<r;++t){let e=this.cellPolygon(t);e&&(e.index=t,yield e)}}cellPolygon(e){let t=new e5;return this.renderCell(e,t),t.value()}_renderSegment(e,t,r,n,i){let o,a=this._regioncode(e,t),s=this._regioncode(r,n);0===a&&0===s?(i.moveTo(e,t),i.lineTo(r,n)):(o=this._clipSegment(e,t,r,n,a,s))&&(i.moveTo(o[0],o[1]),i.lineTo(o[2],o[3]))}contains(e,t,r){return(t*=1)==t&&(r*=1)==r&&this.delaunay._step(e,t,r)===e}*neighbors(e){let t=this._clip(e);if(t)for(let r of this.delaunay.neighbors(e)){let e=this._clip(r);if(e){n:for(let n=0,i=t.length;n<i;n+=2)for(let o=0,a=e.length;o<a;o+=2)if(t[n]===e[o]&&t[n+1]===e[o+1]&&t[(n+2)%i]===e[(o+a-2)%a]&&t[(n+3)%i]===e[(o+a-1)%a]){yield r;break n}}}}_cell(e){let{circumcenters:t,delaunay:{inedges:r,halfedges:n,triangles:i}}=this,o=r[e];if(-1===o)return null;let a=[],s=o;do{let r=Math.floor(s/3);if(a.push(t[2*r],t[2*r+1]),i[s=s%3==2?s-2:s+1]!==e)break;s=n[s]}while(s!==o&&-1!==s);return a}_clip(e){if(0===e&&1===this.delaunay.hull.length)return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];let t=this._cell(e);if(null===t)return null;let{vectors:r}=this,n=4*e;return this._simplify(r[n]||r[n+1]?this._clipInfinite(e,t,r[n],r[n+1],r[n+2],r[n+3]):this._clipFinite(e,t))}_clipFinite(e,t){let r=t.length,n=null,i,o,a=t[r-2],s=t[r-1],l,u=this._regioncode(a,s),c,h=0;for(let f=0;f<r;f+=2)if(i=a,o=s,a=t[f],s=t[f+1],l=u,u=this._regioncode(a,s),0===l&&0===u)c=h,h=0,n?n.push(a,s):n=[a,s];else{let t,r,f,d,p;if(0===l){if(null===(t=this._clipSegment(i,o,a,s,l,u)))continue;[r,f,d,p]=t}else{if(null===(t=this._clipSegment(a,s,i,o,u,l)))continue;[d,p,r,f]=t,c=h,h=this._edgecode(r,f),c&&h&&this._edge(e,c,h,n,n.length),n?n.push(r,f):n=[r,f]}c=h,h=this._edgecode(d,p),c&&h&&this._edge(e,c,h,n,n.length),n?n.push(d,p):n=[d,p]}if(n)c=h,h=this._edgecode(n[0],n[1]),c&&h&&this._edge(e,c,h,n,n.length);else if(this.contains(e,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2))return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];return n}_clipSegment(e,t,r,n,i,o){let a=i<o;for(a&&([e,t,r,n,i,o]=[r,n,e,t,o,i]);;){if(0===i&&0===o)return a?[r,n,e,t]:[e,t,r,n];if(i&o)return null;let s,l,u=i||o;8&u?(s=e+(r-e)*(this.ymax-t)/(n-t),l=this.ymax):4&u?(s=e+(r-e)*(this.ymin-t)/(n-t),l=this.ymin):2&u?(l=t+(n-t)*(this.xmax-e)/(r-e),s=this.xmax):(l=t+(n-t)*(this.xmin-e)/(r-e),s=this.xmin),i?(e=s,t=l,i=this._regioncode(e,t)):(r=s,n=l,o=this._regioncode(r,n))}}_clipInfinite(e,t,r,n,i,o){let a=Array.from(t),s;
114if((s=this._project(a[0],a[1],r,n))&&a.unshift(s[0],s[1]),(s=this._project(a[a.length-2],a[a.length-1],i,o))&&a.push(s[0],s[1]),a=this._clipFinite(e,a))for(let t=0,r=a.length,n,i=this._edgecode(a[r-2],a[r-1]);t<r;t+=2)n=i,i=this._edgecode(a[t],a[t+1]),n&&i&&(t=this._edge(e,n,i,a,t),r=a.length);else this.contains(e,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)&&(a=[this.xmin,this.ymin,this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax]);return a}_edge(e,t,r,n,i){for(;t!==r;){let r,o;switch(t){case 5:t=4;continue;case 4:t=6,r=this.xmax,o=this.ymin;break;case 6:t=2;continue;case 2:t=10,r=this.xmax,o=this.ymax;break;case 10:t=8;continue;case 8:t=9,r=this.xmin,o=this.ymax;break;case 9:t=1;continue;case 1:t=5,r=this.xmin,o=this.ymin}(n[i]!==r||n[i+1]!==o)&&this.contains(e,r,o)&&(n.splice(i,0,r,o),i+=2)}return i}_project(e,t,r,n){let i=1/0,o,a,s;if(n<0){if(t<=this.ymin)return null;(o=(this.ymin-t)/n)<i&&(s=this.ymin,a=e+(i=o)*r)}else if(n>0){if(t>=this.ymax)return null;(o=(this.ymax-t)/n)<i&&(s=this.ymax,a=e+(i=o)*r)}if(r>0){if(e>=this.xmax)return null;(o=(this.xmax-e)/r)<i&&(a=this.xmax,s=t+(i=o)*n)}else if(r<0){if(e<=this.xmin)return null;(o=(this.xmin-e)/r)<i&&(a=this.xmin,s=t+(i=o)*n)}return[a,s]}_edgecode(e,t){return(e===this.xmin?1:2*(e===this.xmax))|(t===this.ymin?4:8*(t===this.ymax))}_regioncode(e,t){return(e<this.xmin?1:2*(e>this.xmax))|(t<this.ymin?4:8*(t>this.ymax))}_simplify(e){if(e&&e.length>4){for(let t=0;t<e.length;t+=2){let r=(t+2)%e.length,n=(t+4)%e.length;(e[t]===e[r]&&e[r]===e[n]||e[t+1]===e[r+1]&&e[r+1]===e[n+1])&&(e.splice(r,2),t-=2)}e.length||(e=null)}return e}}let e4=2*Math.PI,e7=Math.pow;function te(e){return e[0]}function tt(e){return e[1]}class tr{static from(e,t=te,r=tt,n){return new tr("length"in e?function(e,t,r,n){let i=e.length,o=new Float64Array(2*i);for(let a=0;a<i;++a){let i=e[a];o[2*a]=t.call(n,i,a,e),o[2*a+1]=r.call(n,i,a,e)}return o}(e,t,r,n):Float64Array.from(function*(e,t,r,n){let i=0;for(let o of e)yield t.call(n,o,i,e),yield r.call(n,o,i,e),++i}(e,t,r,n)))}constructor(e){this._delaunator=new Q(e),this.inedges=new Int32Array(e.length/2),this._hullIndex=new Int32Array(e.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){let e=this._delaunator,t=this.points;if(e.hull&&e.hull.length>2&&function(e){let{triangles:t,coords:r}=e;for(let e=0;e<t.length;e+=3){let n=2*t[e],i=2*t[e+1],o=2*t[e+2];if((r[o]-r[n])*(r[i+1]-r[n+1])-(r[i]-r[n])*(r[o+1]-r[n+1])>1e-10)return!1}return!0}(e)){this.collinear=Int32Array.from({length:t.length/2},(e,t)=>t).sort((e,r)=>t[2*e]-t[2*r]||t[2*e+1]-t[2*r+1]);let e=this.collinear[0],i=this.collinear[this.collinear.length-1],o=[t[2*e],t[2*e+1],t[2*i],t[2*i+1]],a=1e-8*Math.hypot(o[3]-o[1],o[2]-o[0]);for(let e=0,i=t.length/2;e<i;++e){var r,n;let i=(r=t[2*e],[r+Math.sin(r+(n=t[2*e+1]))*a,n+Math.cos(r-n)*a]);t[2*e]=i[0],t[2*e+1]=i[1]}this._delaunator=new Q(t)}else delete this.collinear;let i=this.halfedges=this._delaunator.halfedges,o=this.hull=this._delaunator.hull,a=this.triangles=this._delaunator.triangles,s=this.inedges.fill(-1),l=this._hullIndex.fill(-1);for(let e=0,t=i.length;e<t;++e){let t=a[e%3==2?e-2:e+1];(-1===i[e]||-1===s[t])&&(s[t]=e)}for(let e=0,t=o.length;e<t;++e)l[o[e]]=e;o.length<=2&&o.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=o[0],s[o[0]]=1,2===o.length&&(s[o[1]]=0,this.triangles[1]=o[1],this.triangles[2]=o[1]))}voronoi(e){return new e6(this,e)}*neighbors(e){let{inedges:t,hull:r,_hullIndex:n,halfedges:i,triangles:o,collinear:a}=this;if(a){let t=a.indexOf(e);t>0&&(yield a[t-1]),t<a.length-1&&(yield a[t+1]);return}let s=t[e];if(-1===s)return;let l=s,u=-1;do{if(yield u=o[l],o[l=l%3==2?l-2:l+1]!==e)return;if(-1===(l=i[l])){let t=r[(n[e]+1)%r.length];t!==u&&(yield t);return}}while(l!==s)}find(e,t,r=0){let n;if((e*=1)!=e||(t*=1)!=t)return -1;let i=r;for(;(n=this._step(r,e,t))>=0&&n!==r&&n!==i;)r=n;return n}_step(e,t,r){let{inedges:n,hull:i,_hullIndex:o,halfedges:a,triangles:s,points:l}=this;if(-1===n[e]||!l.length)return(e+1)%(l.length>>1);
114let u=e,c=e7(t-l[2*e],2)+e7(r-l[2*e+1],2),h=n[e],f=h;do{let n=s[f],h=e7(t-l[2*n],2)+e7(r-l[2*n+1],2);if(h<c&&(c=h,u=n),s[f=f%3==2?f-2:f+1]!==e)break;if(-1===(f=a[f])){if((f=i[(o[e]+1)%i.length])!==n&&e7(t-l[2*f],2)+e7(r-l[2*f+1],2)<c)return f;break}}while(f!==h);return u}render(e){let t=null==e?e=new e8:void 0,{points:r,halfedges:n,triangles:i}=this;for(let t=0,o=n.length;t<o;++t){let o=n[t];if(o<t)continue;let a=2*i[t],s=2*i[o];e.moveTo(r[a],r[a+1]),e.lineTo(r[s],r[s+1])}return this.renderHull(e),t&&t.value()}renderPoints(e,t){void 0!==t||e&&"function"==typeof e.moveTo||(t=e,e=null),t=void 0==t?2:+t;let r=null==e?e=new e8:void 0,{points:n}=this;for(let r=0,i=n.length;r<i;r+=2){let i=n[r],o=n[r+1];e.moveTo(i+t,o),e.arc(i,o,t,0,e4)}return r&&r.value()}renderHull(e){let t=null==e?e=new e8:void 0,{hull:r,points:n}=this,i=2*r[0],o=r.length;e.moveTo(n[i],n[i+1]);for(let t=1;t<o;++t){let i=2*r[t];e.lineTo(n[i],n[i+1])}return e.closePath(),t&&t.value()}hullPolygon(){let e=new e5;return this.renderHull(e),e.value()}renderTriangle(e,t){let r=null==t?t=new e8:void 0,{points:n,triangles:i}=this,o=2*i[e*=3],a=2*i[e+1],s=2*i[e+2];return t.moveTo(n[o],n[o+1]),t.lineTo(n[a],n[a+1]),t.lineTo(n[s],n[s+1]),t.closePath(),r&&r.value()}*trianglePolygons(){let{triangles:e}=this;for(let t=0,r=e.length/3;t<r;++t)yield this.trianglePolygon(t)}trianglePolygon(e){let t=new e5;return this.renderTriangle(e,t),t.value()}}function tn(e,t){function r(r,n){return t((r=e(r,n))[0],r[1])}return e.invert&&t.invert&&(r.invert=function(r,n){return(r=t.invert(r,n))&&e.invert(r[0],r[1])}),r}function ti(e,t){return(0,ea.tn)(e)>ea.pi&&(e-=Math.round(e/ea.FA)*ea.FA),[e,t]}function to(e,t,r){return(e%=ea.FA)?t||r?tn(ts(e),tl(t,r)):ts(e):t||r?tl(t,r):ti}function ta(e){return function(t,r){return t+=e,(0,ea.tn)(t)>ea.pi&&(t-=Math.round(t/ea.FA)*ea.FA),[t,r]}}function ts(e){var t=ta(e);return t.invert=ta(-e),t}function tl(e,t){var r=(0,ea.gn)(e),n=(0,ea.F8)(e),i=(0,ea.gn)(t),o=(0,ea.F8)(t);function a(e,t){var a=(0,ea.gn)(t),s=(0,ea.gn)(e)*a,l=(0,ea.F8)(e)*a,u=(0,ea.F8)(t),c=u*r+s*n;return[(0,ea.FP)(l*i-c*o,s*r-u*n),(0,ea.qR)(c*i+l*o)]}return a.invert=function(e,t){var a=(0,ea.gn)(t),s=(0,ea.gn)(e)*a,l=(0,ea.F8)(e)*a,u=(0,ea.F8)(t),c=u*i-l*o;return[(0,ea.FP)(l*i+u*o,s*r+c*n),(0,ea.qR)(c*r-s*n)]},a}function tu(){var e,t=[];return{point:function(t,r,n){e.push([t,r,n])},lineStart:function(){t.push(e=[])},lineEnd:es.A,rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))},result:function(){var r=t;return t=[],e=null,r}}}function tc(e,t){return(0,ea.tn)(e[0]-t[0])<ea.Ni&&(0,ea.tn)(e[1]-t[1])<ea.Ni}function th(e,t,r,n){this.x=e,this.z=t,this.o=r,this.e=n,this.v=!1,this.n=this.p=null}function tf(e,t,r,n,i){var o,a,s=[],l=[];if(e.forEach(function(e){if(!((t=e.length-1)<=0)){var t,r,n=e[0],a=e[t];if(tc(n,a)){if(!n[2]&&!a[2]){for(i.lineStart(),o=0;o<t;++o)i.point((n=e[o])[0],n[1]);i.lineEnd();return}a[0]+=2*ea.Ni}s.push(r=new th(n,e,null,!0)),l.push(r.o=new th(n,null,r,!1)),s.push(r=new th(a,e,null,!1)),l.push(r.o=new th(a,null,r,!0))}}),s.length){for(l.sort(t),td(s),td(l),o=0,a=l.length;o<a;++o)l[o].e=r=!r;for(var u,c,h=s[0];;){for(var f=h,d=!0;f.v;)if((f=f.n)===h)return;u=f.z,i.lineStart();do{if(f.v=f.o.v=!0,f.e){if(d)for(o=0,a=u.length;o<a;++o)i.point((c=u[o])[0],c[1]);else n(f.x,f.n.x,1,i);f=f.n}else{if(d)for(o=(u=f.p.z).length-1;o>=0;--o)i.point((c=u[o])[0],c[1]);else n(f.x,f.p.x,-1,i);f=f.p}u=(f=f.o).z,d=!d}while(!f.v);i.lineEnd()}}}function td(e){if(t=e.length){for(var t,r,n=0,i=e[0];++n<t;)i.n=r=e[n],r.p=i,i=r;i.n=r=e[0],r.p=i}}function tp(e,t,r,n){return function(i){var o,a,s,l=t(i),u=tu(),c=t(u),h=!1,f={point:d,lineStart:m,lineEnd:g,polygonStart:function(){f.point=v,f.lineStart=y,f.lineEnd=A,a=[],o=[]},polygonEnd:function(){f.point=d,f.lineStart=m,f.lineEnd=g,a=O(a);var e=eG(o,n);a.length?(h||(i.polygonStart(),h=!0),tf(a,tg,e,r,i)):e&&(h||(i.polygonStart(),h=!0),i.lineStart(),r(null,null,1,i),i.lineEnd()),h&&(i.polygonEnd(),h=!1),a=o=null},sphere:function(){i.polygonStart(),i.lineStart(),r(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function d(t,r){e(t,r)&&i.point(t,r)}function p(e,t){l.point(e,t)}function m(){f.point=p,l.lineStart()}function g(){f.point=d,l.lineEnd()}function v(e,t){s.push([e,t]),c.point(e,t)}function y(){c.lineStart(),s=[]}function A(){v(s[0][0],s[0][1]),c.lineEnd();var e,t,r,n,l=c.clean(),f=u.result(),d=f.length;if(s.pop(),o.push(s),s=null,d){if(1&l){if((t=(r=f[0]).length-1)>0){for(h||(i.polygonStart(),h=!0),i.lineStart(),e=0;e<t;++e)i.point((n=r[e])[0],n[1]);i.lineEnd()}return}d>
1141&&2&l&&f.push(f.pop().concat(f.shift())),a.push(f.filter(tm))}}return f}}function tm(e){return e.length>1}function tg(e,t){return((e=e.x)[0]<0?e[1]-ea.TW-ea.Ni:ea.TW-e[1])-((t=t.x)[0]<0?t[1]-ea.TW-ea.Ni:ea.TW-t[1])}ti.invert=ti;let tv=tp(function(){return!0},function(e){var t,r=NaN,n=NaN,i=NaN;return{lineStart:function(){e.lineStart(),t=1},point:function(o,a){var s,l,u,c,h,f,d,p=o>0?ea.pi:-ea.pi,m=(0,ea.tn)(o-r);(0,ea.tn)(m-ea.pi)<ea.Ni?(e.point(r,n=(n+a)/2>0?ea.TW:-ea.TW),e.point(i,n),e.lineEnd(),e.lineStart(),e.point(p,n),e.point(o,n),t=0):i!==p&&m>=ea.pi&&((0,ea.tn)(r-i)<ea.Ni&&(r-=i*ea.Ni),(0,ea.tn)(o-p)<ea.Ni&&(o-=p*ea.Ni),s=r,l=n,u=o,c=a,d=(0,ea.F8)(s-u),n=(0,ea.tn)(d)>ea.Ni?(0,ea.rY)(((0,ea.F8)(l)*(f=(0,ea.gn)(c))*(0,ea.F8)(u)-(0,ea.F8)(c)*(h=(0,ea.gn)(l))*(0,ea.F8)(s))/(h*f*d)):(l+c)/2,e.point(i,n),e.lineEnd(),e.lineStart(),e.point(p,n),t=0),e.point(r=o,n=a),i=p},lineEnd:function(){e.lineEnd(),r=n=NaN},clean:function(){return 2-t}}},function(e,t,r,n){var i;if(null==e)i=r*ea.TW,n.point(-ea.pi,i),n.point(0,i),n.point(ea.pi,i),n.point(ea.pi,0),n.point(ea.pi,-i),n.point(0,-i),n.point(-ea.pi,-i),n.point(-ea.pi,0),n.point(-ea.pi,i);else if((0,ea.tn)(e[0]-t[0])>ea.Ni){var o=e[0]<t[0]?ea.pi:-ea.pi;i=r*o/2,n.point(-o,i),n.point(0,i),n.point(o,i)}else n.point(t[0],t[1])},[-ea.pi,-ea.TW]);function ty(e,t){t=eg(t),t[0]-=e,eb(t);var r=(0,ea.HQ)(-t[1]);return((0>-t[2]?-r:r)+ea.FA-ea.Ni)%ea.FA}let tA=e=>e;function t_(e){return function(t){var r=new tb;for(var n in e)r[n]=e[n];return r.stream=t,r}}function tb(){}tb.prototype={constructor:tb,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var tB=1/0,tx=1/0,tC=-1/0,tw=tC,tE={point:function(e,t){e<tB&&(tB=e),e>tC&&(tC=e),t<tx&&(tx=t),t>tw&&(tw=t)},lineStart:es.A,lineEnd:es.A,polygonStart:es.A,polygonEnd:es.A,result:function(){var e=[[tB,tx],[tC,tw]];return tC=tw=-(tx=tB=1/0),e}};function tM(e,t,r){var n=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),null!=n&&e.clipExtent(null),(0,eB.A)(r,e.stream(tE)),t(tE.result()),null!=n&&e.clipExtent(n),e}function tT(e,t,r){return tM(e,function(r){var n=t[1][0]-t[0][0],i=t[1][1]-t[0][1],o=Math.min(n/(r[1][0]-r[0][0]),i/(r[1][1]-r[0][1])),a=+t[0][0]+(n-o*(r[1][0]+r[0][0]))/2,s=+t[0][1]+(i-o*(r[1][1]+r[0][1]))/2;e.scale(150*o).translate([a,s])},r)}var tF=(0,ea.gn)(30*ea.F2);function tS(e,t){var r;return+t?function(e,t){function r(n,i,o,a,s,l,u,c,h,f,d,p,m,g){var v=u-n,y=c-i,A=v*v+y*y;if(A>4*t&&m--){var _=a+f,b=s+d,B=l+p,x=(0,ea.RZ)(_*_+b*b+B*B),C=(0,ea.qR)(B/=x),w=(0,ea.tn)((0,ea.tn)(B)-1)<ea.Ni||(0,ea.tn)(o-h)<ea.Ni?(o+h)/2:(0,ea.FP)(b,_),E=e(w,C),M=E[0],T=E[1],F=M-n,S=T-i,O=y*F-v*S;(O*O/A>t||(0,ea.tn)((v*F+y*S)/A-.5)>.3||a*f+s*d+l*p<tF)&&(r(n,i,o,a,s,l,M,T,w,_/=x,b/=x,B,m,g),g.point(M,T),r(M,T,w,_,b,B,u,c,h,f,d,p,m,g))}}return function(t){var n,i,o,a,s,l,u,c,h,f,d,p,m={point:g,lineStart:v,lineEnd:A,polygonStart:function(){t.polygonStart(),m.lineStart=_},polygonEnd:function(){t.polygonEnd(),m.lineStart=v}};function g(r,n){r=e(r,n),t.point(r[0],r[1])}function v(){c=NaN,m.point=y,t.lineStart()}function y(n,i){var o=eg([n,i]),a=e(n,i);r(c,h,u,f,d,p,c=a[0],h=a[1],u=n,f=o[0],d=o[1],p=o[2],16,t),t.point(c,h)}function A(){m.point=g,t.lineEnd()}function _(){v(),m.point=b,m.lineEnd=B}function b(e,t){y(n=e,t),i=c,o=h,a=f,s=d,l=p,m.point=y}function B(){r(c,h,u,f,d,p,i,o,n,a,s,l,16,t),m.lineEnd=A,A()}return m}}(e,t):(r=e,t_({point:function(e,t){e=r(e,t),this.stream.point(e[0],e[1])}}))}var tO=t_({point:function(e,t){this.stream.point(e*ea.F2,t*ea.F2)}});function tR(e,t,r,n,i,o){if(!o){function a(o,a){return[t+e*(o*=n),r-e*(a*=i)]}return a.invert=function(o,a){return[(o-t)/e*n,(r-a)/e*i]},a}var s=(0,ea.gn)(o),l=(0,ea.F8)(o),u=s*e,c=l*e,h=s/e,f=l/e,d=(l*r-s*t)/e,p=(l*t+s*r)/e;function m(e,o){return[u*(e*=n)-c*(o*=i)+t,r-c*e-u*o]}return m.invert=function(e,t){return[n*(h*e-f*t+d),i*(p-f*e-h*t)]},m}function tI(e,t){var r=(0,ea.gn)(t),n=1+(0,ea.gn)(e)*r;return[r*(0,ea.F8)(e)/n,(0,ea.F8)(t)/n]}tI.invert=function(e,t){var r=(0,ea.RZ)(e*e+t*t),n=function(e){return 2*(0,ea.rY)(e)}(r),i=(0,ea.F8)(n),o=(0,ea.gn)(n);return[(0,ea.FP)(e*i,r*o),(0,ea.qR)(r&&t*i/r)]};let tP=Math.PI,tD=tP/2,tH=180/tP,tL=tP/180,tG=Math.atan2,tU=Math.cos,tk=Math.max,tN=Math.min,tj=Math.sin,tJ=Math.sign||function(e){return e>0?1:e<0?-1:0},tz=Math.sqrt;function tK(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function tV(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function tQ(e,t){return[e[0]+t[0],e[1]+t[1],e[2]+t[2]]}function tX(e){var t=tz(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);return[e[0]/t,e[1]/t,e[2]/t]}function tY(e){var t;
114return[tG(e[1],e[0])*tH,((t=tk(-1,tN(1,e[2])))>1?tD:t<-1?-tD:Math.asin(t))*tH]}function tZ(e){let t=e[0]*tL,r=e[1]*tL,n=tU(r);return[n*tU(t),n*tj(t),tj(r)]}function tq(e){return tK((e=e.map(e=>tZ(e)))[0],tV(e[2],e[1]))}function tW(e,t,r){e=tZ(e),t=tZ(t),r=tZ(r);let n=tJ(tK(tV(t,e),r));return tY(tX(tQ(e,t)).map(e=>n*e))}var t$=r(4792);function t0(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(t0=function(){return!!e})()}function t1(e){return(t1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function t2(e,t){return(t2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function t3(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,u=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,t)||t8(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function t9(e){return function(e){if(Array.isArray(e))return t5(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||t8(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function t8(e,t){if(e){if("string"==typeof e)return t5(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return t5(e,t)}}function t5(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function t6(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return r?(t&&eU.hasOwnProperty(t.type)?eU[t.type]:eN)(t,e):function(e,t,r){if(void 0===r&&(r={}),!e)throw Error("point is required");if(!t)throw Error("polygon is required");
114var n,i,o=function(e){if(!e)throw Error("coord is required");if(!Array.isArray(e)){if("Feature"===e.type&&null!==e.geometry&&"Point"===e.geometry.type)return e.geometry.coordinates;if("Point"===e.type)return e.coordinates}if(Array.isArray(e)&&e.length>=2&&!Array.isArray(e[0])&&!Array.isArray(e[1]))return e;throw Error("coord must be GeoJSON Point or an Array of numbers")}(e),a="Feature"===t.type?t.geometry:t,s=a.type,l=t.bbox,u=a.coordinates;if(l&&!1==(n=o,(i=l)[0]<=n[0]&&i[1]<=n[1]&&i[2]>=n[0]&&i[3]>=n[1]))return!1;"Polygon"===s&&(u=[u]);for(var c=!1,h=0;h<u.length&&!c;h++)if($(o,u[h][0],r.ignoreBoundary)){for(var f=!1,d=1;d<u[h].length&&!f;)$(o,u[h][d],!r.ignoreBoundary)&&(f=!0),d++;f||(c=!0)}return c}(e,t)}var t4=window.THREE?window.THREE:{BufferGeometry:S.BufferGeometry,Float32BufferAttribute:S.Float32BufferAttribute},t7=new t4.BufferGeometry().setAttribute?"setAttribute":"addAttribute",re=function(e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function t(e,r,n,i,o,a,s){if(!(this instanceof t))throw TypeError("Cannot call a class as a function");l=t1(l=t),(c=function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,t0()?Reflect.construct(l,[],t1(this).constructor):l.apply(this,u))).type="ConicPolygonBufferGeometry",c.parameters={polygonGeoJson:e,startHeight:r,endHeight:n,closedBottom:i,closedTop:o,includeSides:a,curvatureResolution:s},r=r||0,n=n||1,i=void 0===i||i,o=void 0===o||o,a=void 0===a||a;var l,u,c,h=function(e){var t,r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.resolution,o=void 0===i?1/0:i,a=(t=e,r=o,t.map(function(e){var t,n=[];return e.forEach(function(e){if(t){var i=180*(0,eD.A)(e,t)/Math.PI;if(i>r)for(var o=(0,eH.A)(t,e),a=1/Math.ceil(i/r),s=a;s<1;)n.push(o(s)),s+=a}n.push(t=e)}),n})),s=O(a),l=function(e,t){var r={type:"Polygon",coordinates:e},n=t3(eP(r),2),i=t3(n[0],2),o=i[0],a=i[1],s=t3(n[1],2),l=s[0],u=s[1];if(Math.min(Math.abs(l-o),Math.abs(u-a))<t)return[];var c=o>l||u>=89||a<=-89;return(function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.minLng,n=t.maxLng,i=t.minLat,o=t.maxLat,a=Math.round(Math.pow(360/e,2)/Math.PI),s=(1+Math.sqrt(5))/2,l=function(e){return a*(Math.cos((e+90)*Math.PI/180)+1)/2},u=[void 0!==o?Math.ceil(l(o)):0,void 0!==i?Math.floor(l(i)):a-1],c=void 0===r&&void 0===n?function(){return!0}:void 0===r?function(e){return e<=n}:void 0===n?function(e){return e>=r}:n>=r?function(e){return e>=r&&e<=n}:function(e){return e>=r||e<=n},h=[],f=u[0];f<=u[1];f++){var d=f/s*360%360-180;c(d)&&h.push([d,Math.acos(2*f/a-1)/Math.PI*180-90])}return h})(t,{minLng:o,maxLng:l,minLat:a,maxLat:u}).filter(function(e){return t6(e,r,c)})}(e,o),u=[].concat(t9(s),t9(l)),c={type:"Polygon",coordinates:e},h=t3(eP(c),2),f=t3(h[0],2),d=f[0],p=f[1],m=t3(h[1],2),g=m[0],v=m[1],y=d>g||v>=89||p<=-89,A=[];if(y){var _=(function(e){let t=function(e){if(t.delaunay=null,t._data=e,"object"==typeof t._data&&"FeatureCollection"===t._data.type&&(t._data=t._data.features),"object"==typeof t._data){let e=t._data.map(e=>[t._vx(e),t._vy(e),e]).filter(e=>isFinite(e[0]+e[1]));t.points=e.map(e=>[e[0],e[1]]),t.valid=e.map(e=>e[2]),t.delaunay=function(e){var t,r,n,i;let o=function(e){if(e.length<2)return{};let t=0;for(;isNaN(e[t][0]+e[t][1])&&t++<e.length;);let r=function(e){function t(t){return t=e(t[0]*ea.F2,t[1]*ea.F2),t[0]*=ea.uj,t[1]*=ea.uj,t}return e=to(e[0]*ea.F2,e[1]*ea.F2,e.length>2?e[2]*ea.F2:0),t.invert=function(t){return t=e.invert(t[0]*ea.F2,t[1]*ea.F2),t[0]*=ea.uj,t[1]*=ea.uj,t},t}(e[t]),n=(function(e){var t,r,n,i,o,a,s,l,u,c,h=150,f=480,d=250,p=0,m=0,g=0,v=0,y=0,A=0,_=1,b=1,B=null,x=tv,C=null,w=tA,E=.5;function M(e){return l(e[0]*ea.F2,e[1]*ea.F2)}function T(e){return(e=l.invert(e[0],e[1]))&&[e[0]*ea.uj,e[1]*ea.uj]}function F(){var e=tR(h,0,0,_,b,A).apply(null,t(p,m)),n=tR(h,f-e[0],d-e[1],_,b,A);return r=to(g,v,y),s=tn(t,n),l=tn(r,s),a=tS(s,E),S()}function S(){return u=c=null,M}return M.stream=function(e){var t;return u&&c===e?u:u=tO((t=r,t_({point:function(e,r){var n=t(e,r);return this.stream.point(n[0],n[1])}}))(x(a(w(c=e)))))},M.preclip=function(e){return arguments.length?(x=e,B=void 0,S()):x},M.postclip=function(e){return arguments.length?(w=e,C=n=i=o=null,S()):w},M.clipAngle=function(e){return arguments.length?(x=+e?function(e){var t=(0,ea.gn)(e),r=2*ea.F2,
114n=t>0,i=(0,ea.tn)(t)>ea.Ni;function o(e,r){return(0,ea.gn)(e)*(0,ea.gn)(r)>t}function a(e,r,n){var i=eg(e),o=eg(r),a=[1,0,0],s=ey(i,o),l=ev(s,s),u=s[0],c=l-u*u;if(!c)return!n&&e;var h=ey(a,s),f=e_(a,t*l/c);eA(f,e_(s,-t*u/c));var d=ev(f,h),p=ev(h,h),m=d*d-p*(ev(f,f)-1);if(!(m<0)){var g=(0,ea.RZ)(m),v=e_(h,(-d-g)/p);if(eA(v,f),v=em(v),!n)return v;var y,A=e[0],_=r[0],b=e[1],B=r[1];_<A&&(y=A,A=_,_=y);var x=_-A,C=(0,ea.tn)(x-ea.pi)<ea.Ni,w=C||x<ea.Ni;if(!C&&B<b&&(y=b,b=B,B=y),w?C?b+B>0^v[1]<((0,ea.tn)(v[0]-A)<ea.Ni?b:B):b<=v[1]&&v[1]<=B:x>ea.pi^(A<=v[0]&&v[0]<=_)){var E=e_(h,(-d+g)/p);return eA(E,f),[v,em(E)]}}}function s(t,r){var i=n?e:ea.pi-e,o=0;return t<-i?o|=1:t>i&&(o|=2),r<-i?o|=4:r>i&&(o|=8),o}return tp(o,function(e){var t,r,l,u,c;return{lineStart:function(){u=l=!1,c=1},point:function(h,f){var d,p,m=[h,f],g=o(h,f),v=n?g?0:s(h,f):g?s(h+(h<0?ea.pi:-ea.pi),f):0;!t&&(u=l=g)&&e.lineStart(),g!==l&&(!(p=a(t,m))||tc(t,p)||tc(m,p))&&(m[2]=1),g!==l?(c=0,g?(e.lineStart(),p=a(m,t),e.point(p[0],p[1])):(p=a(t,m),e.point(p[0],p[1],2),e.lineEnd()),t=p):i&&t&&n^g&&!(v&r)&&(d=a(m,t,!0))&&(c=0,n?(e.lineStart(),e.point(d[0][0],d[0][1]),e.point(d[1][0],d[1][1]),e.lineEnd()):(e.point(d[1][0],d[1][1]),e.lineEnd(),e.lineStart(),e.point(d[0][0],d[0][1],3))),!g||t&&tc(t,m)||e.point(m[0],m[1]),t=m,l=g,r=v},lineEnd:function(){l&&e.lineEnd(),t=null},clean:function(){return c|(u&&l)<<1}}},function(t,n,i,o){!function(e,t,r,n,i,o){if(r){var a=(0,ea.gn)(t),s=(0,ea.F8)(t),l=n*r;null==i?(i=t+n*ea.FA,o=t-l/2):(i=ty(a,i),o=ty(a,o),(n>0?i<o:i>o)&&(i+=n*ea.FA));for(var u,c=i;n>0?c>o:c<o;c-=l)u=em([a,-s*(0,ea.gn)(c),-s*(0,ea.F8)(c)]),e.point(u[0],u[1])}}(o,e,r,i,t,n)},n?[0,-e]:[-ea.pi,e-ea.pi])}(B=e*ea.F2):(B=null,tv),S()):B*ea.uj},M.clipExtent=function(e){return arguments.length?(w=null==e?(C=n=i=o=null,tA):function(e,t,r,n){function i(i,o){return e<=i&&i<=r&&t<=o&&o<=n}function o(i,o,s,u){var c=0,h=0;if(null==i||(c=a(i,s))!==(h=a(o,s))||0>l(i,o)^s>0)do u.point(0===c||3===c?e:r,c>1?n:t);while((c=(c+s+4)%4)!==h);else u.point(o[0],o[1])}function a(n,i){return(0,ea.tn)(n[0]-e)<ea.Ni?i>0?0:3:(0,ea.tn)(n[0]-r)<ea.Ni?i>0?2:1:(0,ea.tn)(n[1]-t)<ea.Ni?+(i>0):i>0?3:2}function s(e,t){return l(e.x,t.x)}function l(e,t){var r=a(e,1),n=a(t,1);return r!==n?r-n:0===r?t[1]-e[1]:1===r?e[0]-t[0]:2===r?e[1]-t[1]:t[0]-e[0]}return function(a){var l,u,c,h,f,d,p,m,g,v,y,A=a,_=tu(),b={point:B,lineStart:function(){b.point=x,u&&u.push(c=[]),v=!0,g=!1,p=m=NaN},lineEnd:function(){l&&(x(h,f),d&&g&&_.rejoin(),l.push(_.result())),b.point=B,g&&A.lineEnd()},polygonStart:function(){A=_,l=[],u=[],y=!0},polygonEnd:function(){var t=function(){for(var t=0,r=0,i=u.length;r<i;++r)for(var o,a,s=u[r],l=1,c=s.length,h=s[0],f=h[0],d=h[1];l<c;++l)o=f,a=d,f=(h=s[l])[0],d=h[1],a<=n?d>n&&(f-o)*(n-a)>(d-a)*(e-o)&&++t:d<=n&&(f-o)*(n-a)<(d-a)*(e-o)&&--t;return t}(),r=y&&t,i=(l=O(l)).length;(r||i)&&(a.polygonStart(),r&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),i&&tf(l,s,t,o,a),a.polygonEnd()),A=a,l=u=c=null}};function B(e,t){i(e,t)&&A.point(e,t)}function x(o,a){var s=i(o,a);if(u&&c.push([o,a]),v)h=o,f=a,d=s,v=!1,s&&(A.lineStart(),A.point(o,a));else if(s&&g)A.point(o,a);else{var l=[p=Math.max(-1e9,Math.min(1e9,p)),m=Math.max(-1e9,Math.min(1e9,m))],_=[o=Math.max(-1e9,Math.min(1e9,o)),a=Math.max(-1e9,Math.min(1e9,a))];!function(e,t,r,n,i,o){var a,s=e[0],l=e[1],u=t[0],c=t[1],h=0,f=1,d=u-s,p=c-l;if(a=r-s,!d&&a>0)return;if(a/=d,d<0){if(a<h)return;a<f&&(f=a)}else if(d>0){if(a>f)return;a>h&&(h=a)}if(a=i-s,d||!(a<0)){if(a/=d,d<0){if(a>f)return;a>h&&(h=a)}else if(d>0){if(a<h)return;a<f&&(f=a)}if(a=n-l,p||!(a>0)){if(a/=p,p<0){if(a<h)return;a<f&&(f=a)}else if(p>0){if(a>f)return;a>h&&(h=a)}if(a=o-l,p||!(a<0)){if(a/=p,p<0){if(a>f)return;a>h&&(h=a)}else if(p>0){if(a<h)return;a<f&&(f=a)}return h>0&&(e[0]=s+h*d,e[1]=l+h*p),f<1&&(t[0]=s+f*d,t[1]=l+f*p),!0}}}}(l,_,e,t,r,n)?s&&(A.lineStart(),A.point(o,a),y=!1):(g||(A.lineStart(),A.point(l[0],l[1])),A.point(_[0],_[1]),s||A.lineEnd(),y=!1)}p=o,m=a,g=s}return b}}(C=+e[0][0],n=+e[0][1],i=+e[1][0],o=+e[1][1]),S()):null==C?null:[[C,n],[i,o]]},M.scale=function(e){return arguments.length?(h=+e,F()):h},M.translate=function(e){return arguments.length?(f=+e[0],d=+e[1],F()):[f,d
114]},M.center=function(e){return arguments.length?(p=e[0]%360*ea.F2,m=e[1]%360*ea.F2,F()):[p*ea.uj,m*ea.uj]},M.rotate=function(e){return arguments.length?(g=e[0]%360*ea.F2,v=e[1]%360*ea.F2,y=e.length>2?e[2]%360*ea.F2:0,F()):[g*ea.uj,v*ea.uj,y*ea.uj]},M.angle=function(e){return arguments.length?(A=e%360*ea.F2,F()):A*ea.uj},M.reflectX=function(e){return arguments.length?(_=e?-1:1,F()):_<0},M.reflectY=function(e){return arguments.length?(b=e?-1:1,F()):b<0},M.precision=function(e){return arguments.length?(a=tS(s,E=e*e),S()):(0,ea.RZ)(E)},M.fitExtent=function(e,t){return tT(M,e,t)},M.fitSize=function(e,t){return tT(M,[[0,0],e],t)},M.fitWidth=function(e,t){return tM(M,function(t){var r=+e,n=r/(t[1][0]-t[0][0]),i=(r-n*(t[1][0]+t[0][0]))/2,o=-n*t[0][1];M.scale(150*n).translate([i,o])},t)},M.fitHeight=function(e,t){return tM(M,function(t){var r=+e,n=r/(t[1][1]-t[0][1]),i=-n*t[0][0],o=(r-n*(t[1][1]+t[0][1]))/2;M.scale(150*n).translate([i,o])},t)},function(){return t=e.apply(this,arguments),M.invert=t.invert&&T,F()}})(function(){return tI})().scale(250).clipAngle(142).translate([0,0]).scale(1).rotate(r.invert([180,0]));e=e.map(n);let i=[],o=1;for(let t=0,r=e.length;t<r;t++){let r=e[t][0]**2+e[t][1]**2;!isFinite(r)||r>1e32?i.push(t):r>o&&(o=r)}let a=1e6*tz(o);i.forEach(t=>e[t]=[a,0]),e.push([0,a]),e.push([-a,0]),e.push([0,-a]);let s=tr.from(e);s.projection=n;let{triangles:l,halfedges:u,inedges:c}=s,h=[];for(let r=0,n=u.length;r<n;r++)if(u[r]<0){let e=r%3==2?r-2:r+1,n=r%3==0?r+2:r-1,i=u[e],o=u[n];u[i]=o,u[o]=i,u[e]=u[n]=-1,l[r]=l[e]=l[n]=t,c[l[i]]=i%3==0?i+2:i-1,c[l[o]]=o%3==0?o+2:o-1,h.push(Math.min(r,e,n)),r+=2-r%3}else l[r]>e.length-3-1&&(l[r]=t);return s}(e),a=function(e){let{triangles:t}=e;if(!t)return[];let r=[];for(let e=0,n=t.length/3;e<n;e++){let n=t[3*e],i=t[3*e+1],o=t[3*e+2];n!==i&&i!==o&&r.push([n,o,i])}return r}(o),s=function(e,t){let r=new Set;return 2===t.length?[[0,1]]:(e.forEach(e=>{if(e[0]!==e[1]&&!(0>tq(e.map(e=>t[e]))))for(let t=0,n;t<3;t++)n=(t+1)%3,r.add(R([e[t],e[n]]).join("-"))}),Array.from(r,e=>e.split("-").map(Number)))}(a,e),l=function(e,t){let r=[];return e.forEach(e=>{for(let t=0;t<3;t++){let n=e[t],i=e[(t+1)%3];r[n]=r[n]||[],r[n].push(i)}}),0===e.length&&(2===t?(r[0]=[1],r[1]=[0]):1===t&&(r[0]=[])),r}(a,e.length),u=function(e,t){function r(e,t){let r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return r*r+n*n+i*i}return function(n,i,o){void 0===o&&(o=0);let a,s,l=o,u=tZ([n,i]);do a=o,o=null,s=r(u,tZ(t[a])),e[a].forEach(e=>{let n=r(u,tZ(t[e]));if(n<s){s=n,o=e,l=e;return}});while(null!==o);return l}}(l,e),{polygons:c,centers:h}=function(e,t,r){let n=[],i=e.slice();if(0===t.length){if(r.length<2)return{polygons:n,centers:i};if(2===r.length){let e=tZ(r[0]),t=tZ(r[1]),a=tX(tQ(e,t)),s=tX(tV(e,t)),l=tV(a,s),u=[a,tV(a,l),tV(tV(a,l),l),tV(tV(tV(a,l),l),l)].map(tY).map(o);return n.push(u),n.push(u.slice().reverse()),{polygons:n,centers:i}}}function o(e){let r=-1;return i.slice(t.length,1/0).forEach((n,i)=>{n[0]===e[0]&&n[1]===e[1]&&(r=i+t.length)}),r<0&&(r=i.length,i.push(e)),r}return t.forEach((e,t)=>{for(let r=0;r<3;r++){let i=e[r],o=e[(r+1)%3],a=e[(r+2)%3];n[i]=n[i]||[],n[i].push([o,a,t,[i,o,a]])}}),{polygons:n.map(e=>{let t=[e[0][2]],n=e[0][1];for(let r=1;r<e.length;r++)for(let r=0;r<e.length;r++)if(e[r][0]==n){n=e[r][1],t.push(e[r][2]);break}if(t.length>2)return t;if(2==t.length){let n=tW(r[e[0][3][0]],r[e[0][3][1]],i[t[0]]),a=tW(r[e[0][3][2]],r[e[0][3][0]],i[t[0]]),s=o(n),l=o(a);return[t[0],l,t[1],s]}}),centers:i}}((t=a,r=e,t.map(e=>{let t=e.map(e=>r[e]).map(tZ);return tY(tX(tQ(tQ(tV(t[1],t[0]),tV(t[2],t[1])),tV(t[0],t[2]))))})),a,e),f=function(e){let t=[];return e.forEach(e=>{if(!e)return;let r=e[e.length-1];for(let n of e)n>r&&t.push([r,n]),r=n}),t}(c),d=function(e,t){let r,n=new Set,i=[];e.map(e=>{if(!(tq(e.map(e=>t[e>t.length?0:e]))>1e-12))for(let t=0;t<3;t++){let r=[e[t],e[(t+1)%3]],i=`${r[0]}-${r[1]}`;n.has(i)?n.delete(i):n.add(`${r[1]}-${r[0]}`)}});let o=new Map;if(n.forEach(e=>{e=e.split("-").map(Number),o.set(e[0],e[1]),r=e[0]}),void 0===r)return i;let a=r;do{i.push(a);let e=o.get(a);o.set(a,-1),a=e}while(a>-1&&a!==r);return i}(a,e),p=(n=s,i=a,function(e){let t=new Map,r=new Map;
114return n.forEach((n,i)=>{let o=n.join("-");t.set(o,e[i]),r.set(o,!0)}),i.forEach(e=>{let n=0,i=-1;for(let r=0;r<3;r++){let o=R([e[r],e[(r+1)%3]]).join("-");t.get(o)>n&&(n=t.get(o),i=o)}r.set(i,!1)}),n.map(e=>r.get(e.join("-")))});return{delaunay:o,edges:s,triangles:a,centers:h,neighbors:l,polygons:c,mesh:f,hull:d,urquhart:p,find:u}}(t.points)}return t};return t._vx=function(e){return"object"==typeof e&&"type"in e?e9(e)[0]:0 in e?e[0]:void 0},t._vy=function(e){return"object"==typeof e&&"type"in e?e9(e)[1]:1 in e?e[1]:void 0},t.x=function(e){return e?(t._vx=e,t):t._vx},t.y=function(e){return e?(t._vy=e,t):t._vy},t.polygons=function(e){if(void 0!==e&&t(e),!t.delaunay)return!1;let r={type:"FeatureCollection",features:[]};return 0===t.valid.length||(t.delaunay.polygons.forEach((e,n)=>r.features.push({type:"Feature",geometry:e?{type:"Polygon",coordinates:[[...e,e[0]].map(e=>t.delaunay.centers[e])]}:null,properties:{site:t.valid[n],sitecoordinates:t.points[n],neighbours:t.delaunay.neighbors[n]}})),1===t.valid.length&&r.features.push({type:"Feature",geometry:{type:"Sphere"},properties:{site:t.valid[0],sitecoordinates:t.points[0],neighbours:[]}})),r},t.triangles=function(e){return void 0!==e&&t(e),!!t.delaunay&&{type:"FeatureCollection",features:t.delaunay.triangles.map((e,r)=>((e=e.map(e=>t.points[e])).center=t.delaunay.centers[r],e)).filter(e=>tq(e)>0).map(e=>({type:"Feature",properties:{circumcenter:e.center},geometry:{type:"Polygon",coordinates:[[...e,e[0]]]}}))}},t.links=function(e){if(void 0!==e&&t(e),!t.delaunay)return!1;let r=t.delaunay.edges.map(e=>(0,eD.A)(t.points[e[0]],t.points[e[1]])),n=t.delaunay.urquhart(r);return{type:"FeatureCollection",features:t.delaunay.edges.map((e,i)=>({type:"Feature",properties:{source:t.valid[e[0]],target:t.valid[e[1]],length:r[i],urquhart:!!n[i]},geometry:{type:"LineString",coordinates:[t.points[e[0]],t.points[e[1]]]}}))}},t.mesh=function(e){return void 0!==e&&t(e),!!t.delaunay&&{type:"MultiLineString",coordinates:t.delaunay.edges.map(e=>[t.points[e[0]],t.points[e[1]]])}},t.cellMesh=function(e){if(void 0!==e&&t(e),!t.delaunay)return!1;let{centers:r,polygons:n}=t.delaunay,i=[];for(let e of n)if(e)for(let t=e.length,n=e[t-1],o=e[0],a=0;a<t;n=o,o=e[++a])o>n&&i.push([r[n],r[o]]);return{type:"MultiLineString",coordinates:i}},t._found=void 0,t.find=function(e,r,n){if(t._found=t.delaunay.find(e,r,t._found),!n||(0,eD.A)([e,r],t.points[t._found])<n)return t._found},t.hull=function(e){void 0!==e&&t(e);let r=t.delaunay.hull,n=t.points;return 0===r.length?null:{type:"Polygon",coordinates:[[...r.map(e=>n[e]),n[r[0]]]]}},e?t(e):t})(u).triangles(),b=new Map(u.map(function(e,t){var r=t3(e,2),n=r[0],i=r[1];return["".concat(n,"-").concat(i),t]}));_.features.forEach(function(e){var t,r=e.geometry.coordinates[0].slice(0,3).reverse(),n=[];if(r.forEach(function(e){var t=t3(e,2),r=t[0],i=t[1],o="".concat(r,"-").concat(i);b.has(o)&&n.push(b.get(o))}),3===n.length){if(n.some(function(e){return e<s.length})&&!t6(e.properties.circumcenter,c,y))return;(t=A).push.apply(t,n)}})}else if(l.length){for(var B=Q.from(u),x=function(e){var t,r=[2,1,0].map(function(t){return B.triangles[e+t]}),n=r.map(function(e){return u[e]});if(r.some(function(e){return e<s.length})&&!t6([0,1].map(function(e){return function(e,t){let r=0,n=0;if(void 0===t)for(let t of e)null!=t&&(t*=1)>=t&&(++r,n+=t);else{let i=-1;for(let o of e)null!=(o=t(o,++i,e))&&(o*=1)>=o&&(++r,n+=o)}if(r)return n/r}(n,function(t){return t[e]})}),c,y))return 1;(t=A).push.apply(t,t9(r))},C=0,w=B.triangles.length;C<w;C+=3)if(x(C))continue}else{var E=I.flatten(a),M=E.vertices,T=E.holes;A=I(M,void 0===T?[]:T,2)}var F=(0,t$.A)(R(u,function(e){return e[0]}),[0,1]),S=(0,t$.A)(R(u,function(e){return e[1]}),[0,1]),P=u.map(function(e){var t=t3(e,2),r=t[0],n=t[1];return[F(r),S(n)]});return{contour:a,triangles:{points:u,indices:A,uvs:P}}}(e,{resolution:s=s||5}),f=h.contour,d=h.triangles,p=O(d.uvs),m=[],g=[],v=[],y=0,A=function(e){var t=Math.round(m.length/3),r=v.length;m=m.concat(e.vertices),g=g.concat(e.uvs),v=v.concat(t?e.indices.map(function(e){return e+t}):e.indices),c.addGroup(r,v.length-r,y++)};function _(e,t){var r=e.map(function(e){return e.map(function(e){var r=t3(e,2),n=r[0];return function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=(90-e)*Math.PI/180,i=(90-t)*Math.PI/180;return[r*Math.sin(n)*Math.cos(i),r*Math.cos(n),r*Math.sin(n)*Math.sin(i)]}(r[1],n,t)})});return I.flatten(r)}function b(e){var t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];return{indices:t?d.indices:d.indices.slice().reverse(),vertices:_([d.points],e).vertices,uvs:p}}return a&&A(function(){for(var e=_(f,r),t=e.vertices,i=e.holes,o=_(f,n).vertices,a=O([o,t]),s=Math.round(o.length/3),l=new Set(i),u=0,c=[],h=0;h<s;h++){var d=h+1;if(d===s)d=u;else if(l.has(d)){var p=d;d=u,u=p}c.push(h,h+s,d+s),c.push(d+s,d,h)}for(var m=[],g=1;g>=0;g--)for(var v=0;v<s;v+=1)m.push(v/(s-1),g);return{indices:c,vertices:a,uvs:m}}()),i&&A(b(r,!1)),o&&A(b(n,!0)),c.setIndex(v),c[t7]("position",new t4.Float32BufferAttribute(m,3)),c[t7]("uv",new t4.Float32BufferAttribute(g,2)),c.computeVertexNormals(),c}return t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&t2(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(t4.BufferGeometry)},5159:(e,t,r)=>{"use strict";function n(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function i(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function o(){}r.d(t,{Ay:()=>A,Qh:()=>B});var a="\\s*([+-]?\\d+)\\s*",s="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",l="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",u=/^#([0-9a-f]{3,8})$/,c=RegExp(`^rgb\\(${a},${a},${a}\\)$`),h=RegExp(`^rgb\\(${l},${l},${l}\\)$`),f=RegExp(`^rgba\\(${a},${a},${a},${s}\\)$`),d=RegExp(`^rgba\\(${l},${l},${l},${s}\\)$`),p=RegExp(`^hsl\\(${s},${l},${l}\\)$`),m=RegExp(`^hsla\\(${s},${l},${l},${s}\\)$`),g={aliceblue:0xf0f8ff,antiquewhite:0xfaebd7,aqua:65535,aquamarine:8388564,azure:0xf0ffff,beige:0xf5f5dc,bisque:0xffe4c4,black:0,blanchedalmond:0xffebcd,blue:255,blueviolet:9055202,brown:0xa52a2a,burlywood:0xdeb887,cadetblue:6266528,chartreuse:8388352,chocolate:0xd2691e,coral:0xff7f50,cornflowerblue:6591981,cornsilk:0xfff8dc,crimson:0xdc143c,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:0xb8860b,darkgray:0xa9a9a9,darkgreen:25600,darkgrey:0xa9a9a9,darkkhaki:0xbdb76b,darkmagenta:9109643,darkolivegreen:5597999,darkorange:0xff8c00,darkorchid:0x9932cc,darkred:9109504,darksalmon:0xe9967a,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:0xff1493,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:0xb22222,floralwhite:0xfffaf0,forestgreen:2263842,fuchsia:0xff00ff,gainsboro:0xdcdcdc,ghostwhite:0xf8f8ff,gold:0xffd700,goldenrod:0xdaa520,gray:8421504,green:32768,greenyellow:0xadff2f,grey:8421504,honeydew:0xf0fff0,hotpink:0xff69b4,indianred:0xcd5c5c,indigo:4915330,ivory:0xfffff0,khaki:0xf0e68c,lavender:0xe6e6fa,lavenderblush:0xfff0f5,lawngreen:8190976,lemonchiffon:0xfffacd,lightblue:0xadd8e6,lightcoral:0xf08080,lightcyan:0xe0ffff,lightgoldenrodyellow:0xfafad2,lightgray:0xd3d3d3,lightgreen:9498256,lightgrey:0xd3d3d3,lightpink:0xffb6c1,lightsalmon:0xffa07a,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:0xb0c4de,lightyellow:0xffffe0,lime:65280,limegreen:3329330,linen:0xfaf0e6,magenta:0xff00ff,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:0xba55d3,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:0xc71585,midnightblue:1644912,mintcream:0xf5fffa,mistyrose:0xffe4e1,moccasin:0xffe4b5,navajowhite:0xffdead,navy:128,oldlace:0xfdf5e6,olive:8421376,olivedrab:7048739,orange:0xffa500,orangered:0xff4500,orchid:0xda70d6,palegoldenrod:0xeee8aa,palegreen:0x98fb98,paleturquoise:0xafeeee,palevioletred:0xdb7093,papayawhip:0xffefd5,peachpuff:0xffdab9,peru:0xcd853f,pink:0xffc0cb,plum:0xdda0dd,powderblue:0xb0e0e6,purple:8388736,rebeccapurple:6697881,red:0xff0000,rosybrown:0xbc8f8f,royalblue:4286945,saddlebrown:9127187,salmon:0xfa8072,sandybrown:0xf4a460,seagreen:3050327,seashell:0xfff5ee,sienna:0xa0522d,silver:0xc0c0c0,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:0xfffafa,springgreen:65407,steelblue:4620980,tan:0xd2b48c,teal:32896,thistle:0xd8bfd8,tomato:0xff6347,turquoise:4251856,violet:0xee82ee,wheat:0xf5deb3,white:0xffffff,whitesmoke:0xf5f5f5,yellow:0xffff00,yellowgreen:0x9acd32};function v(){return this.rgb().formatHex()}function y(){return this.rgb().formatRgb()}function A(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=u.exec(e))?(r=t[1].length,t=parseInt(t[1],16),6===r?_(t):3===r?new x(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===r?b(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===r?b(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=c.exec(e))?new x(t[1],t[2],t[3],1):(t=h.exec(e))?new x(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=f.exec(e))?b(t[1],t[2],t[3],t[4]):(t=d.exec(e))?b(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=p.exec(e))?F(t[1],t[2]/100,t[3]/100,1):(t=m.exec(e))?F(t[1],t[2]/100,t[3]/100,t[4]):g.hasOwnProperty(e)?_(g[e]):"transparent"===e?new x(NaN,NaN,NaN,0):null}function _(e){return new x(e>>16&255,e>>8&255,255&e,1)}function b(e,t,r,n){return n<=0&&(e=t=r=NaN),new x(e,t,r,n)}function B(e,t,r,n){var i;return 1==arguments.length?((i=e)instanceof o||(i=A(i)),i)?new x((i=i.rgb()).r,i.g,i.b,i.opacity):new x:new x(e,t,r,null==n?1:n)}function x(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}function C(){return`#${T(this.r)}${T(this.g)}${T(this.b)}`}function w(){let e=E(this.opacity);return`${1===e?"rgb(":"rgba("}${M(this.r)}, ${M(this.g)}, ${M(this.b)}${1===e?")":`, ${e})`}`}function E(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function M(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function T(e){return((e=M(e))<16?"0":"")+e.toString(16)}function F(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new O(e,t,r,n)}function S(e){if(e instanceof O)return new O(e.h,e.s,e.l,e.opacity);if(e instanceof o||(e=A(e)),!e)return new O;if(e instanceof O)return e;var t=(e=e.rgb()).r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),a=Math.max(t,r,n),s=NaN,l=a-i,u=(a+i)/2;return l?(s=t===a?(r-n)/l+(r<n)*6:r===a?(n-t)/l+2:(t-r)/l+4,l/=u<.5?a+i:2-a-i,s*=60):l=u>0&&u<1?0:s,new O(s,l,u,e.opacity)}function O(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}function R(e){return(e=(e||0)%360)<0?e+360:e}function I(e){return Math.max(0,Math.min(1,e||0))}function P(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}n(o,A,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:v,formatHex:v,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return S(this).formatHsl()},formatRgb:y,toString:y}
114),n(x,B,i(o,{brighter(e){return e=null==e?1.4285714285714286:Math.pow(1.4285714285714286,e),new x(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new x(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new x(M(this.r),M(this.g),M(this.b),E(this.opacity))},displayable(){return -.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:C,formatHex:C,formatHex8:function(){return`#${T(this.r)}${T(this.g)}${T(this.b)}${T((isNaN(this.opacity)?1:this.opacity)*255)}`},formatRgb:w,toString:w})),n(O,function(e,t,r,n){return 1==arguments.length?S(e):new O(e,t,r,null==n?1:n)},i(o,{brighter(e){return e=null==e?1.4285714285714286:Math.pow(1.4285714285714286,e),new O(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new O(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new x(P(e>=240?e-240:e+120,i,n),P(e,i,n),P(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new O(R(this.h),I(this.s),I(this.l),E(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=E(this.opacity);return`${1===e?"hsl(":"hsla("}${R(this.h)}, ${100*I(this.s)}%, ${100*I(this.l)}%${1===e?")":`, ${e})`}`}}))},5558:(e,t,r)=>{"use strict";r.d(t,{GV:()=>c,Xk:()=>M,vK:()=>E});var n=r(1698);let i=window.THREE?window.THREE:{Box3:n.Box3,BufferGeometry:n.BufferGeometry,Float32BufferAttribute:n.Float32BufferAttribute,InstancedBufferGeometry:n.InstancedBufferGeometry,InstancedInterleavedBuffer:n.InstancedInterleavedBuffer,InterleavedBufferAttribute:n.InterleavedBufferAttribute,Sphere:n.Sphere,Vector3:n.Vector3,WireframeGeometry:n.WireframeGeometry};var o=new i.BufferGeometry().setAttribute?"setAttribute":"addAttribute";let a=new i.Box3,s=new i.Vector3;class l extends i.InstancedBufferGeometry{constructor(){super(),this.type="LineSegmentsGeometry",this.setIndex([0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5]),this[o]("position",new i.Float32BufferAttribute([-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],3)),this[o]("uv",new i.Float32BufferAttribute([-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],2))}applyMatrix4(e){let t=this.attributes.instanceStart,r=this.attributes.instanceEnd;return void 0!==t&&(t.applyMatrix4(e),r.applyMatrix4(e),t.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}setPositions(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));let r=new i.InstancedInterleavedBuffer(t,6,1);return this[o]("instanceStart",new i.InterleavedBufferAttribute(r,3,0)),this[o]("instanceEnd",new i.InterleavedBufferAttribute(r,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));let r=new i.InstancedInterleavedBuffer(t,6,1);return this[o]("instanceColorStart",new i.InterleavedBufferAttribute(r,3,0)),this[o]("instanceColorEnd",new i.InterleavedBufferAttribute(r,3,3)),this}fromWireframeGeometry(e){return this.setPositions(e.attributes.position.array),this}fromEdgesGeometry(e){return this.setPositions(e.attributes.position.array),this}fromMesh(e){return this.fromWireframeGeometry(new i.WireframeGeometry(e.geometry)),this}fromLineSegments(e){let t=e.geometry;return t.isGeometry?void console.error("LineSegmentsGeometry no longer supports Geometry. Use THREE.BufferGeometry instead."):(t.isBufferGeometry&&this.setPositions(t.attributes.position.array),this)}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new i.Box3);let e=this.attributes.instanceStart,t=this.attributes.instanceEnd;void 0!==e&&void 0!==t&&(this.boundingBox.setFromBufferAttribute(e),a.setFromBufferAttribute(t),this.boundingBox.union(a))}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new i.Sphere),null===this.boundingBox&&this.computeBoundingBox();let e=this.attributes.instanceStart,t=this.attributes.instanceEnd;if(void 0!==e&&void 0!==t){let r=this.boundingSphere.center;this.boundingBox.getCenter(r);let n=0;for(let i=0,o=e.count;i<o;i++)s.fromBufferAttribute(e,i),n=Math.max(n,r.distanceToSquared(s)),s.fromBufferAttribute(t,i),n=Math.max(n,r.distanceToSquared(s));this.boundingSphere.radius=Math.sqrt(n),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}applyMatrix(e){return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."),this.applyMatrix4(e)}}l.prototype.isLineSegmentsGeometry=!0;let u=window.THREE?window.THREE:{ShaderLib:n.ShaderLib,ShaderMaterial:n.ShaderMaterial,UniformsLib:n.UniformsLib,UniformsUtils:n.UniformsUtils,Vector2:n.Vector2};u.UniformsLib.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new u.Vector2(1,1)},dashScale:{value:1},dashSize:{value:1},dashOffset:{value:0},gapSize:{value:1}},u.ShaderLib.line={uniforms:u.UniformsUtils.merge([u.UniformsLib.common,u.UniformsLib.fog,u.UniformsLib.line]),vertexShader:` 115 #include <common> 116 #include <color_pars_vertex> 117 #include <fog_pars_vertex> 118 #include <logdepthbuf_pars_vertex> 119 #include <clipping_planes_pars_vertex> 120 121 uniform float linewidth; 122 uniform vec2 resolution; 123 124 attribute vec3 instanceStart; 125 attribute vec3 instanceEnd; 126 127 attribute vec3 instanceColorStart; 128 attribute vec3 instanceColorEnd; 129 130 varying vec2 vUv; 131 varying vec4 worldPos; 132 varying vec3 worldStart; 133 varying vec3 worldEnd; 134
135 #ifdef USE_DASH 136 137 uniform float dashScale; 138 attribute float instanceDistanceStart; 139 attribute float instanceDistanceEnd; 140 varying float vLineDistance; 141 142 #endif 143 144 void trimSegment( const in vec4 start, inout vec4 end ) { 145 146 // trim end segment so it terminates between the camera plane and the near plane 147 148 // conservative estimate of the near plane 149 float a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column 150 float b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column 151 float nearEstimate = - 0.5 * b / a; 152 153 float alpha = ( nearEstimate - start.z ) / ( end.z - start.z ); 154 155 end.xyz = mix( start.xyz, end.xyz, alpha ); 156 157 } 158 159 void main() { 160 161 #ifdef USE_COLOR 162 163 vColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd; 164 165 #endif 166 167 #ifdef USE_DASH 168 169 vLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd; 170 171 #endif 172 173 float aspect = resolution.x / resolution.y; 174 175 vUv = uv; 176 177 // camera space 178 vec4 start = modelViewMatrix * vec4( instanceStart, 1.0 ); 179 vec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 ); 180 181 worldStart = start.xyz; 182 worldEnd = end.xyz; 183 184 // special case for perspective projection, and segments that terminate either in, or behind, the camera plane 185 // clearly the gpu firmware has a way of addressing this issue when projecting into ndc space 186 // but we need to perform ndc-space calculations in the shader, so we must address this issue directly 187 // perhaps there is a more elegant solution -- WestLangley 188 189 bool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column 190 191 if ( perspective ) { 192 193 if ( start.z < 0.0 && end.z >= 0.0 ) { 194 195 trimSegment( start, end ); 196 197 } else if ( end.z < 0.0 && start.z >= 0.0 ) { 198 199 trimSegment( end, start ); 200 201 } 202 203 } 204 205 // clip space 206 vec4 clipStart = projectionMatrix * start; 207 vec4 clipEnd = projectionMatrix * end; 208 209 // ndc space 210 vec3 ndcStart = clipStart.xyz / clipStart.w; 211 vec3 ndcEnd = clipEnd.xyz / clipEnd.w; 212 213 // direction 214 vec2 dir = ndcEnd.xy - ndcStart.xy; 215 216 // account for clip-space aspect ratio 217 dir.x *= aspect; 218 dir = normalize( dir ); 219 220 #ifdef WORLD_UNITS 221 222 // get the offset direction as perpendicular to the view vector 223 vec3 worldDir = normalize( end.xyz - start.xyz ); 224 vec3 offset; 225 if ( position.y < 0.5 ) { 226 227 offset = normalize( cross( start.xyz, worldDir ) ); 228 229 } else { 230 231 offset = normalize( cross( end.xyz, worldDir ) ); 232 233 } 234 235 // sign flip 236 if ( position.x < 0.0 ) offset *= - 1.0; 237 238 float forwardOffset = dot( worldDir, vec3( 0.0, 0.0, 1.0 ) ); 239 240 // don't extend the line if we're rendering dashes because we 241 // won't be rendering the endcaps 242 #ifndef USE_DASH 243 244 // extend the line bounds to encompass endcaps 245 start.xyz += - worldDir * linewidth * 0.5; 246 end.xyz += worldDir * linewidth * 0.5; 247 248 // shift the position of the quad so it hugs the forward edge of the line 249 offset.xy -= dir * forwardOffset; 250 offset.z += 0.5; 251 252 #endif 253 254 // endcaps 255 if ( position.y > 1.0 || position.y < 0.0 ) { 256 257 offset.xy += dir * 2.0 * forwardOffset; 258 259 } 260 261 // adjust for linewidth 262 offset *= linewidth * 0.5; 263 264 // set the world position 265 worldPos = ( position.y < 0.5 ) ? start : end; 266 worldPos.xyz += offset; 267 268 // project the worldpos 269 vec4 clip = projectionMatrix * worldPos; 270 271 // shift the depth of the projected points so the line 272 // segements overlap neatly 273 vec3 clipPose = ( position.y < 0.5 ) ? ndcStart : ndcEnd; 274 clip.z = clipPose.z * clip.w; 275 276 #else 277 278 vec2 offset = vec2( dir.y, - dir.x ); 279 // undo aspect ratio adjustment 280 dir.x /= aspect; 281 offset.x /= aspect; 282 283 // sign flip 284 if ( position.x < 0.0 ) offset *= - 1.0; 285 286 // endcaps 287 if ( position.y < 0.0 ) { 288 289 offset += - dir; 290 291 } else if ( position.y > 1.0 ) { 292 293 offset += dir; 294 295 } 296 297 // adjust for linewidth 298 offset *= linewidth; 299 300 // adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ... 301 offset /= resolution.y; 302 303 // select end 304 vec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd; 305 306 // back to clip space 307 offset *= clip.w; 308 309 clip.xy += offset; 310 311 #endif 312 313 gl_Position = clip; 314 315 vec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation 316 317 #include <logdepthbuf_vertex> 318 #include <clipping_planes_vertex> 319 #include <fog_vertex> 320 321 } 322 `,fragmentShader:` 323 uniform vec3 diffuse; 324 uniform float opacity; 325 uniform float linewidth; 326 327 #ifdef USE_DASH 328 329 uniform float dashOffset; 330 uniform float dashSize; 331 uniform float gapSize; 332 333 #endif 334 335 varying float vLineDistance; 336 varying vec4 worldPos; 337 varying vec3 worldStart; 338 varying vec3 worldEnd; 339
340 #include <common> 341 #include <color_pars_fragment> 342 #include <fog_pars_fragment> 343 #include <logdepthbuf_pars_fragment> 344 #include <clipping_planes_pars_fragment> 345 346 varying vec2 vUv; 347 348 vec2 closestLineToLine(vec3 p1, vec3 p2, vec3 p3, vec3 p4) { 349 350 float mua; 351 float mub; 352 353 vec3 p13 = p1 - p3; 354 vec3 p43 = p4 - p3; 355 356 vec3 p21 = p2 - p1; 357 358 float d1343 = dot( p13, p43 ); 359 float d4321 = dot( p43, p21 ); 360 float d1321 = dot( p13, p21 ); 361 float d4343 = dot( p43, p43 ); 362 float d2121 = dot( p21, p21 ); 363 364 float denom = d2121 * d4343 - d4321 * d4321; 365 366 float numer = d1343 * d4321 - d1321 * d4343; 367 368 mua = numer / denom; 369 mua = clamp( mua, 0.0, 1.0 ); 370 mub = ( d1343 + d4321 * ( mua ) ) / d4343; 371 mub = clamp( mub, 0.0, 1.0 ); 372 373 return vec2( mua, mub ); 374 375 } 376 377 void main() { 378 379 #include <clipping_planes_fragment> 380 381 #ifdef USE_DASH 382 383 if ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps 384 385 if ( mod( vLineDistance + dashOffset, dashSize + gapSize ) > dashSize ) discard; // todo - FIX 386 387 #endif 388 389 float alpha = opacity; 390 391 #ifdef WORLD_UNITS 392 393 // Find the closest points on the view ray and the line segment
394 vec3 rayEnd = normalize( worldPos.xyz ) * 1e5; 395 vec3 lineDir = worldEnd - worldStart; 396 vec2 params = closestLineToLine( worldStart, worldEnd, vec3( 0.0, 0.0, 0.0 ), rayEnd ); 397 398 vec3 p1 = worldStart + lineDir * params.x; 399 vec3 p2 = rayEnd * params.y; 400 vec3 delta = p1 - p2; 401 float len = length( delta ); 402 float norm = len / linewidth; 403 404 #ifndef USE_DASH 405 406 #ifdef ALPHA_TO_COVERAGE 407 408 float dnorm = fwidth( norm ); 409 alpha = 1.0 - smoothstep( 0.5 - dnorm, 0.5 + dnorm, norm ); 410 411 #else 412 413 if ( norm > 0.5 ) { 414 415 discard; 416 417 } 418 419 #endif 420 421 #endif 422 423 #else 424 425 #ifdef ALPHA_TO_COVERAGE 426 427 // artifacts appear on some hardware if a derivative is taken within a conditional 428 float a = vUv.x; 429 float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0; 430 float len2 = a * a + b * b; 431 float dlen = fwidth( len2 ); 432 433 if ( abs( vUv.y ) > 1.0 ) { 434 435 alpha = 1.0 - smoothstep( 1.0 - dlen, 1.0 + dlen, len2 ); 436 437 } 438 439 #else 440 441 if ( abs( vUv.y ) > 1.0 ) { 442 443 float a = vUv.x; 444 float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0; 445 float len2 = a * a + b * b; 446 447 if ( len2 > 1.0 ) discard; 448 449 } 450 451 #endif 452 453 #endif 454 455 vec4 diffuseColor = vec4( diffuse, alpha ); 456 457 #include <logdepthbuf_fragment> 458 #include <color_fragment> 459 460 gl_FragColor = vec4( diffuseColor.rgb, alpha ); 461 462 #include <tonemapping_fragment> 463 #include <encodings_fragment> 464 #include <fog_fragment> 465 #include <premultiplied_alpha_fragment> 466 467 } 468 `};class c extends u.ShaderMaterial{constructor(e){super({type:"LineMaterial",uniforms:u.UniformsUtils.clone(u.ShaderLib.line.uniforms),vertexShader:u.ShaderLib.line.vertexShader,fragmentShader:u.ShaderLib.line.fragmentShader,clipping:!0}),Object.defineProperties(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(e){this.uniforms.diffuse.value=e}},worldUnits:{enumerable:!0,get:function(){return"WORLD_UNITS"in this.defines},set:function(e){!0===e?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(e){this.uniforms.linewidth.value=e}},dashed:{enumerable:!0,get:function(){return"USE_DASH"in this.defines},set(e){!!e!="USE_DASH"in this.defines&&(this.needsUpdate=!0),!0===e?this.defines.USE_DASH="":delete this.defines.USE_DASH}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(e){this.uniforms.dashScale.value=e}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(e){this.uniforms.dashSize.value=e}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(e){this.uniforms.dashOffset.value=e}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(e){this.uniforms.gapSize.value=e}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(e){this.uniforms.opacity.value=e}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(e){this.uniforms.resolution.value.copy(e)}},alphaToCoverage:{enumerable:!0,get:function(){return"ALPHA_TO_COVERAGE"in this.defines},set:function(e){!!e!="ALPHA_TO_COVERAGE"in this.defines&&(this.needsUpdate=!0),!0===e?(this.defines.ALPHA_TO_COVERAGE="",this.extensions.derivatives=!0):(delete this.defines.ALPHA_TO_COVERAGE,this.extensions.derivatives=!1)}}}),this.setValues(e)}}c.prototype.isLineMaterial=!0;let h=window.THREE?window.THREE:{Box3:n.Box3,BufferGeometry:n.BufferGeometry,InstancedInterleavedBuffer:n.InstancedInterleavedBuffer,InterleavedBufferAttribute:n.InterleavedBufferAttribute,Line3:n.Line3,MathUtils:n.MathUtils,Matrix4:n.Matrix4,Mesh:n.Mesh,Sphere:n.Sphere,Vector3:n.Vector3,Vector4:n.Vector4};var f=new h.BufferGeometry().setAttribute?"setAttribute":"addAttribute";let d=new h.Vector3,p=new h.Vector3,m=new h.Vector4,g=new h.Vector4,v=new h.Vector4,y=new h.Vector3,A=new h.Matrix4,_=new h.Line3,b=new h.Vector3,B=new h.Box3,x=new h.Sphere,C=new h.Vector4;class w extends h.Mesh{constructor(e=new l,t=new c({color:0xffffff*Math.random()})){super(e,t),this.type="LineSegments2"}computeLineDistances(){let e=this.geometry,t=e.attributes.instanceStart,r=e.attributes.instanceEnd,n=new Float32Array(2*t.count);for(let e=0,i=0,o=t.count;e<o;e++,i+=2)d.fromBufferAttribute(t,e),p.fromBufferAttribute(r,e),n[i]=0===i?0:n[i-1],n[i+1]=n[i]+d.distanceTo(p);let i=new h.InstancedInterleavedBuffer(n,2,1);return e[f]("instanceDistanceStart",new h.InterleavedBufferAttribute(i,1,0)),e[f]("instanceDistanceEnd",new h.InterleavedBufferAttribute(i,1,1)),this}raycast(e,t){null===e.camera&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.');let r=void 0!==e.params.Line2&&e.params.Line2.threshold||0,n=e.ray,i=e.camera,o=i.projectionMatrix,a=this.matrixWorld,s=this.geometry,l=this.material,u=l.resolution,c=l.linewidth+r,f=s.attributes.instanceStart,d=s.attributes.instanceEnd,p=-i.near,w=2*Math.max(c/u.width,c/u.height);null===s.boundingSphere&&s.computeBoundingSphere(),x.copy(s.boundingSphere).applyMatrix4(a);let E=Math.max(i.near,x.distanceToPoint(n.origin));C.set(0,0,-E,1).applyMatrix4(i.projectionMatrix),C.multiplyScalar(1/C.w),C.applyMatrix4(i.projectionMatrixInverse);let M=.5*Math.abs(w/C.w);if(x.radius+=M,!1===e.ray.intersectsSphere(x))return;null===s.boundingBox&&s.computeBoundingBox(),B.copy(s.boundingBox).applyMatrix4(a);let T=Math.max(i.near,B.distanceToPoint(n.origin));C.set(0,0,-T,1).applyMatrix4(i.projectionMatrix),C.multiplyScalar(1/C.w),C.applyMatrix4(i.projectionMatrixInverse);let F=.5*Math.abs(w/C.w);if(B.max.x+=F,B.max.y+=F,B.max.z+=F,B.min.x-=F,B.min.y-=F,B.min.z-=F,!1!==e.ray.intersectsBox(B)){n.at(1,v),v.w=1,v.applyMatrix4(i.matrixWorldInverse),v.applyMatrix4(o),v.multiplyScalar(1/v.w),v.x*=u.x/2,v.y*=u.y/2,v.z=0,y.copy(v),A.multiplyMatrices(i.matrixWorldInverse,a);for(let e=0,r=f.count;e<r;e++){if(m.fromBufferAttribute(f,e),g.fromBufferAttribute(d,e),m.w=1,g.w=1,m.applyMatrix4(A),g.applyM
468atrix4(A),m.z>p&&g.z>p)continue;if(m.z>p){let e=m.z-g.z,t=(m.z-p)/e;m.lerp(g,t)}else if(g.z>p){let e=g.z-m.z,t=(g.z-p)/e;g.lerp(m,t)}m.applyMatrix4(o),g.applyMatrix4(o),m.multiplyScalar(1/m.w),g.multiplyScalar(1/g.w),m.x*=u.x/2,m.y*=u.y/2,g.x*=u.x/2,g.y*=u.y/2,_.start.copy(m),_.start.z=0,_.end.copy(g),_.end.z=0;let r=_.closestPointToPointParameter(y,!0);_.at(r,b);let i=h.MathUtils.lerp(m.z,g.z,r),s=i>=-1&&i<=1,l=y.distanceTo(b)<.5*c;if(s&&l){_.start.fromBufferAttribute(f,e),_.end.fromBufferAttribute(d,e),_.start.applyMatrix4(a),_.end.applyMatrix4(a);let r=new h.Vector3,i=new h.Vector3;n.distanceSqToSegment(_.start,_.end,i,r),t.push({point:i,pointOnLine:r,distance:n.origin.distanceTo(i),object:this,face:null,faceIndex:e,uv:null,uv2:null})}}}}}w.prototype.LineSegments2=!0;class E extends l{constructor(){super(),this.type="LineGeometry"}setPositions(e){for(var t=e.length-3,r=new Float32Array(2*t),n=0;n<t;n+=3)r[2*n]=e[n],r[2*n+1]=e[n+1],r[2*n+2]=e[n+2],r[2*n+3]=e[n+3],r[2*n+4]=e[n+4],r[2*n+5]=e[n+5];return super.setPositions(r),this}setColors(e){for(var t=e.length-3,r=new Float32Array(2*t),n=0;n<t;n+=3)r[2*n]=e[n],r[2*n+1]=e[n+1],r[2*n+2]=e[n+2],r[2*n+3]=e[n+3],r[2*n+4]=e[n+4],r[2*n+5]=e[n+5];return super.setColors(r),this}fromLine(e){var t=e.geometry;return t.isGeometry?void console.error("THREE.LineGeometry no longer supports Geometry. Use THREE.BufferGeometry instead."):(t.isBufferGeometry&&this.setPositions(t.attributes.position.array),this)}}E.prototype.isLineGeometry=!0;class M extends w{constructor(e=new E,t=new c({color:0xffffff*Math.random()})){super(e,t),this.type="Line2"}}M.prototype.isLine2=!0},5880:(e,t,r)=>{"use strict";function n(e,t){t||(t=[]);var r,n=e?Math.min(t.length,e.length):0,i=t.slice();return function(o){for(r=0;r<n;++r)i[r]=e[r]*(1-o)+t[r]*o;return i}}function i(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}r.d(t,{A:()=>n,p:()=>i})},6048:(e,t,r)=>{"use strict";function n(e,t){let r=0;if(void 0===t)for(let t of e)(t*=1)&&(r+=t);else{let n=-1;for(let i of e)(i=+t(i,++n,e))&&(r+=i)}return r}r.d(t,{A:()=>n})},6321:(e,t,r)=>{"use strict";function n(e,t){let r;if(void 0===t)for(let t of e)null!=t&&(r<t||void 0===r&&t>=t)&&(r=t);else{let n=-1;for(let i of e)null!=(i=t(i,++n,e))&&(r<i||void 0===r&&i>=i)&&(r=i)}return r}r.d(t,{A:()=>n})},6486:(e,t,r)=>{"use strict";r.d(t,{_:()=>i});var n=r(1698);class i extends n.ExtrudeGeometry{constructor(e,t={}){let r=t.font;if(void 0===r)super();else{let n=r.generateShapes(e,t.size);void 0===t.depth&&void 0!==t.height&&console.warn("THREE.TextGeometry: .height is now depreciated. Please use .depth instead"),t.depth=void 0!==t.depth?t.depth:void 0!==t.height?t.height:50,void 0===t.bevelThickness&&(t.bevelThickness=10),void 0===t.bevelSize&&(t.bevelSize=8),void 0===t.bevelEnabled&&(t.bevelEnabled=!1),super(n,t)}this.type="TextGeometry"}}},6805:(e,t,r)=>{"use strict";let n,i;r.d(t,{E:()=>A});var o=r(7656),a=r(23),s=r(5425),l=r(1698),u=r(3354);let c=new l.Vector3,h=new l.Vector3,f=new l.Vector3,d=new l.Vector2;function p(e,t,r){let n=c.setFromMatrixPosition(e.matrixWorld);n.project(t);let i=r.width/2,o=r.height/2;return[n.x*i+i,-(n.y*o)+o]}let m=e=>1e-10>Math.abs(e)?0:e;function g(e,t,r=""){let n="matrix3d(";for(let r=0;16!==r;r++)n+=m(t[r]*e.elements[r])+(15!==r?",":")");return r+n}let v=(n=[1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1],e=>g(e,n)),y=(i=e=>[1/e,1/e,1/e,1,-1/e,-1/e,-1/e,-1,1/e,1/e,1/e,1,1,1,1,1],(e,t)=>g(e,i(t),"translate(-50%,-50%)")),A=a.forwardRef(({children:e,eps:t=.001,style:r,className:n,prepend:i,center:g,fullscreen:A,portal:_,distanceFactor:b,sprite:B=!1,transform:x=!1,occlude:C,onOcclude:w,castShadow:E,receiveShadow:M,material:T,geometry:F,zIndexRange:S=[0x1000037,0],calculatePosition:O=p,as:R="div",wrapperClass:I,pointerEvents:P="auto",...D},H)=>{let{gl:L,camera:G,scene:U,size:k,raycaster:N,events:j,viewport:J}=(0,u.A)(),[z]=a.useState(()=>document.createElement(R)),K=a.useRef(),V=a.useRef(null),Q=a.useRef(0),X=a.useRef([0,0]),Y=a.useRef(null),Z=a.useRef(null),q=(null==_?void 0:_.current)||j.connected||L.domElement.parentNode,W=a.useRef(null),$=a.useRef(!1),ee=a.useMemo(()=>C&&"blending"!==C||Array.isArray(C)&&C.length&&function(e){return e&&"object"==typeof e&&"current"in e}(C[0]),[C]);a.useLayoutEffect(()=>{let e=L.domElement;C&&"blending"===C?(e.style.zIndex=`${Math.floor(S[0]/2)}`,e.style.position="absolute",e.style.pointerEvents="none"):(e.style.zIndex=null,e.style.position=null,e.style.pointerEvents=null)},[C]),a.useLayoutEffect(()=>{if(V.current){let e=K.current=s.createRoot(z);if(U.updateMatrixWorld(),x)z.style.cssText="position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;";else{let e=O(V.current,G,k);z.style.cssText=`position:absolute;top:0;left:0;transform:translate3d(${e[0]}px,${e[1]}px,0);transform-origin:0 0;`}return q&&(i?q.prepend(z):q.appendChild(z)),()=>{q&&q.removeChild(z),e.unmount()}}},[q,x]),a.useLayoutEffect(()=>{I&&(z.className=I)},[I]);let et=a.useMemo(()=>x?{position:"absolute",top:0,left:0,width:k.width,height:k.height,transformStyle:"preserve-3d",pointerEvents:"none"}
468:{position:"absolute",transform:g?"translate3d(-50%,-50%,0)":"none",...A&&{top:-k.height/2,left:-k.width/2,width:k.width,height:k.height},...r},[r,g,A,k,x]),er=a.useMemo(()=>({position:"absolute",pointerEvents:P}),[P]);a.useLayoutEffect(()=>{var t,i;$.current=!1,x?null==(t=K.current)||t.render(a.createElement("div",{ref:Y,style:et},a.createElement("div",{ref:Z,style:er},a.createElement("div",{ref:H,className:n,style:r,children:e})))):null==(i=K.current)||i.render(a.createElement("div",{ref:H,style:et,className:n,children:e}))});let en=a.useRef(!0);(0,u.C)(e=>{if(V.current){G.updateMatrixWorld(),V.current.updateWorldMatrix(!0,!1);let e=x?X.current:O(V.current,G,k);if(x||Math.abs(Q.current-G.zoom)>t||Math.abs(X.current[0]-e[0])>t||Math.abs(X.current[1]-e[1])>t){let t=function(e,t){let r=c.setFromMatrixPosition(e.matrixWorld),n=h.setFromMatrixPosition(t.matrixWorld),i=r.sub(n),o=t.getWorldDirection(f);return i.angleTo(o)>Math.PI/2}(V.current,G),r=!1;ee&&(Array.isArray(C)?r=C.map(e=>e.current):"blending"!==C&&(r=[U]));let n=en.current;r?en.current=function(e,t,r,n){let i=c.setFromMatrixPosition(e.matrixWorld),o=i.clone();o.project(t),d.set(o.x,o.y),r.setFromCamera(d,t);let a=r.intersectObjects(n,!0);if(a.length){let e=a[0].distance;return i.distanceTo(r.ray.origin)<e}return!0}(V.current,G,N,r)&&!t:en.current=!t,n!==en.current&&(w?w(!en.current):z.style.display=en.current?"block":"none");let i=Math.floor(S[0]/2),o=C?ee?[S[0],i]:[i-1,0]:S;if(z.style.zIndex=`${function(e,t,r){if(t instanceof l.PerspectiveCamera||t instanceof l.OrthographicCamera){let n=c.setFromMatrixPosition(e.matrixWorld),i=h.setFromMatrixPosition(t.matrixWorld),o=n.distanceTo(i),a=(r[1]-r[0])/(t.far-t.near),s=r[1]-a*t.far;return Math.round(a*o+s)}}(V.current,G,o)}`,x){let[e,t]=[k.width/2,k.height/2],r=G.projectionMatrix.elements[5]*t,{isOrthographicCamera:n,top:i,left:o,bottom:a,right:s}=G,l=v(G.matrixWorldInverse),u=n?`scale(${r})translate(${m(-(s+o)/2)}px,${m((i+a)/2)}px)`:`translateZ(${r}px)`,c=V.current.matrixWorld;B&&((c=G.matrixWorldInverse.clone().transpose().copyPosition(c).scale(V.current.scale)).elements[3]=c.elements[7]=c.elements[11]=0,c.elements[15]=1),z.style.width=k.width+"px",z.style.height=k.height+"px",z.style.perspective=n?"":`${r}px`,Y.current&&Z.current&&(Y.current.style.transform=`${u}${l}translate(${e}px,${t}px)`,Z.current.style.transform=y(c,1/((b||10)/400)))}else{let t=void 0===b?1:function(e,t){if(t instanceof l.OrthographicCamera)return t.zoom;if(!(t instanceof l.PerspectiveCamera))return 1;{let r=c.setFromMatrixPosition(e.matrixWorld),n=h.setFromMatrixPosition(t.matrixWorld);return 1/(2*Math.tan(t.fov*Math.PI/180/2)*r.distanceTo(n))}}(V.current,G)*b;z.style.transform=`translate3d(${e[0]}px,${e[1]}px,0) scale(${t})`}X.current=e,Q.current=G.zoom}}if(!ee&&W.current&&!$.current)if(x){if(Y.current){let e=Y.current.children[0];if(null!=e&&e.clientWidth&&null!=e&&e.clientHeight){let{isOrthographicCamera:t}=G;if(t||F)D.scale&&(Array.isArray(D.scale)?D.scale instanceof l.Vector3?W.current.scale.copy(D.scale.clone().divideScalar(1)):W.current.scale.set(1/D.scale[0],1/D.scale[1],1/D.scale[2]):W.current.scale.setScalar(1/D.scale));else{let t=(b||10)/400,r=e.clientWidth*t,n=e.clientHeight*t;W.current.scale.set(r,n,1)}$.current=!0}}}else{let t=z.children[0];if(null!=t&&t.clientWidth&&null!=t&&t.clientHeight){let e=1/J.factor,r=t.clientWidth*e,n=t.clientHeight*e;W.current.scale.set(r,n,1),$.current=!0}W.current.lookAt(e.camera.position)}});let ei=a.useMemo(()=>({vertexShader:x?void 0:` 469 /* 470 This shader is from the THREE's SpriteMaterial. 471 We need to turn the backing plane into a Sprite 472 (make it always face the camera) if "transfrom" 473 is false. 474 */ 475 #include <common> 476 477 void main() { 478 vec2 center = vec2(0., 1.); 479 float rotation = 0.0; 480 481 // This is somewhat arbitrary, but it seems to work well 482 // Need to figure out how to derive this dynamically if it even matters 483 float size = 0.03; 484 485 vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); 486 vec2 scale; 487 scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); 488 scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); 489 490 bool isPerspective = isPerspectiveMatrix( projectionMatrix ); 491 if ( isPerspective ) scale *= - mvPosition.z; 492 493 vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale * size; 494 vec2 rotatedPosition; 495 rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; 496 rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; 497 mvPosition.xy += rotatedPosition; 498 499 gl_Position = projectionMatrix * mvPosition; 500 } 501 `,fragmentShader:` 502 void main() { 503 gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); 504 } 505 `}),[x]);return a.createElement("group",(0,o.A)({},D,{ref:V}),C&&!ee&&a.createElement("mesh",{castShadow:E,receiveShadow:M,ref:W},F||a.createElement("planeGeometry",null),T||a.createElement("shaderMaterial",{side:l.DoubleSide,vertexShader:ei.vertexShader,fragmentShader:ei.fragmentShader})))})},7022:(e,t,r)=>{"use strict";function n(e,t,r){e*=1,t*=1,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=0|Math.max(0,Math.ceil((t-e)/r)),o=Array(i);++n<i;)o[n]=e+n*r;return o}r.d(t,{q:()=>s});var i=r(2493);function o(e,t,r){var o=n(e,t-i.Ni,r).concat(t);return function(e){return o.map(function(t){return[e,t]})}}function a(e,t,r){var o=n(e,t-i.Ni,r).concat(t);return function(e){return o.map(function(t){return[t,e]})}}function s(){return(function(){var e,t,r,s,l,u,c,h,f,d,p,m,g=10,v=10,y=90,A=360,_=2.5;function b(){return{type:"MultiLineString",coordinates:B()}}function B(){return n((0,i.mk)(s/y)*y,r,y).map(p).concat(n((0,i.mk)(h/A)*A,c,A).map(m)).concat(n((0,i.mk)(t/g)*g,e,g).filter(function(e){return(0,i.tn
505)(e%y)>i.Ni}).map(f)).concat(n((0,i.mk)(u/v)*v,l,v).filter(function(e){return(0,i.tn)(e%A)>i.Ni}).map(d))}return b.lines=function(){return B().map(function(e){return{type:"LineString",coordinates:e}})},b.outline=function(){return{type:"Polygon",coordinates:[p(s).concat(m(c).slice(1),p(r).reverse().slice(1),m(h).reverse().slice(1))]}},b.extent=function(e){return arguments.length?b.extentMajor(e).extentMinor(e):b.extentMinor()},b.extentMajor=function(e){return arguments.length?(s=+e[0][0],r=+e[1][0],h=+e[0][1],c=+e[1][1],s>r&&(e=s,s=r,r=e),h>c&&(e=h,h=c,c=e),b.precision(_)):[[s,h],[r,c]]},b.extentMinor=function(r){return arguments.length?(t=+r[0][0],e=+r[1][0],u=+r[0][1],l=+r[1][1],t>e&&(r=t,t=e,e=r),u>l&&(r=u,u=l,l=r),b.precision(_)):[[t,u],[e,l]]},b.step=function(e){return arguments.length?b.stepMajor(e).stepMinor(e):b.stepMinor()},b.stepMajor=function(e){return arguments.length?(y=+e[0],A=+e[1],b):[y,A]},b.stepMinor=function(e){return arguments.length?(g=+e[0],v=+e[1],b):[g,v]},b.precision=function(n){return arguments.length?(_=+n,f=o(u,l,90),d=a(t,e,_),p=o(h,c,90),m=a(s,r,_),b):_},b.extentMajor([[-180,-90+i.Ni],[180,90-i.Ni]]).extentMinor([[-180,-80-i.Ni],[180,80+i.Ni]])})()()}},7134:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var n=r(2493);function i(e,t){var r=e[0]*n.F2,i=e[1]*n.F2,o=t[0]*n.F2,a=t[1]*n.F2,s=(0,n.gn)(i),l=(0,n.F8)(i),u=(0,n.gn)(a),c=(0,n.F8)(a),h=s*(0,n.gn)(r),f=s*(0,n.F8)(r),d=u*(0,n.gn)(o),p=u*(0,n.F8)(o),m=2*(0,n.qR)((0,n.RZ)((0,n.bo)(a-i)+s*u*(0,n.bo)(o-r))),g=(0,n.F8)(m),v=m?function(e){var t=(0,n.F8)(e*=m)/g,r=(0,n.F8)(m-e)/g,i=r*h+t*d,o=r*f+t*p;return[(0,n.FP)(o,i)*n.uj,(0,n.FP)(r*l+t*c,(0,n.RZ)(i*i+o*o))*n.uj]}:function(){return[r*n.uj,i*n.uj]};return v.distance=m,v}},7151:(e,t,r)=>{"use strict";r.d(t,{A:()=>R});let n=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)};var i="object"==typeof global&&global&&global.Object===Object&&global,o="object"==typeof self&&self&&self.Object===Object&&self,a=i||o||Function("return this")();let s=function(){return a.Date.now()};var l=/\s/;let u=function(e){for(var t=e.length;t--&&l.test(e.charAt(t)););return t};var c=/^\s+/,h=a.Symbol,f=Object.prototype,d=f.hasOwnProperty,p=f.toString,m=h?h.toStringTag:void 0;let g=function(e){var t=d.call(e,m),r=e[m];try{e[m]=void 0;var n=!0}catch(e){}var i=p.call(e);return n&&(t?e[m]=r:delete e[m]),i};var v=Object.prototype.toString,y=h?h.toStringTag:void 0;let A=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":y&&y in Object(e)?g(e):v.call(e)},_=function(e){return"symbol"==typeof e||null!=e&&"object"==typeof e&&"[object Symbol]"==A(e)};var b=0/0,B=/^[-+]0x[0-9a-f]+$/i,x=/^0b[01]+$/i,C=/^0o[0-7]+$/i,w=parseInt;let E=function(e){if("number"==typeof e)return e;if(_(e))return b;if(n(e)){var t,r="function"==typeof e.valueOf?e.valueOf():e;e=n(r)?r+"":r}if("string"!=typeof e)return 0===e?e:+e;e=(t=e)?t.slice(0,u(t)+1).replace(c,""):t;var i=x.test(e);return i||C.test(e)?w(e.slice(2),i?2:8):B.test(e)?b:+e};var M=Math.max,T=Math.min;let F=function(e,t,r){var i,o,a,l,u,c,h=0,f=!1,d=!1,p=!0;if("function"!=typeof e)throw TypeError("Expected a function");function m(t){var r=i,n=o;return i=o=void 0,h=t,l=e.apply(n,r)}function g(e){var r=e-c,n=e-h;return void 0===c||r>=t||r<0||d&&n>=a}function v(){var e,r,n,i=s();if(g(i))return y(i);u=setTimeout(v,(e=i-c,r=i-h,n=t-e,d?T(n,a-r):n))}function y(e){return(u=void 0,p&&i)?m(e):(i=o=void 0,l)}function A(){var e,r=s(),n=g(r);if(i=arguments,o=this,c=r,n){if(void 0===u)return h=e=c,u=setTimeout(v,t),f?m(e):l;if(d)return clearTimeout(u),u=setTimeout(v,t),m(c)}return void 0===u&&(u=setTimeout(v,t)),l}return t=E(t)||0,n(r)&&(f=!!r.leading,a=(d="maxWait"in r)?M(E(r.maxWait)||0,t):a,p="trailing"in r?!!r.trailing:p),A.cancel=function(){void 0!==u&&clearTimeout(u),h=0,i=c=o=u=void 0},A.flush=function(){return void 0===u?l:y(s())},A};function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var O=function(e,t,r){return Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t,r){var n=r.default,i=r.triggerUpdate,o=r.onChange;if(!(this instanceof e))throw TypeError("Cannot call a class as a function");this.name=t,this.defaultVal=void 0===n?null:n,this.triggerUpdate=void 0===i||i,this.onChange=void 0===o?function(e,t){}:o});function R(e){var t=e.stateInit,r=void 0===t?function(){return{}}:t,n=e.props,i=void 0===n?{}:n,o=e.methods,a=void 0===o?{}:o,s=e.aliases,l=void 0===s?{}:s,u=e.init,c=void 0===u?function(){}:u,h=e.update,f=void 0===h?function(){}:h,d=Object.keys(i).map(function(e){return new O(e,i[e])});return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Object.assign({},r instanceof Function?r(e):r,{initialised:!1}),n={};function i(t){return o(t,e),s(),i}var o=function(e,r){c.call(i,e,t,r),t.initialised=!0},s=F(function(){t.initialised&&(f.call(i,t,n),n={})},1);return d.forEach(function(e){var r,o,a,l,u,c,h,f;i[e.name]=(o=(r=e).name,l=void 0!==(a=r.triggerUpdate)&&a,c=void 0===(u=r.onChange)?function(e,t){}:u,f=void 0===(h=r.defaultVal)?null:h,function(e){var r=t[o];if(!arguments.length)return r;var a=void 0===e?f:e;return t[o]=a,c.call(i,a,t,r),n.hasOwnProperty(o)||(n[o]=r),l&&s(),i})}
505),Object.keys(a).forEach(function(e){i[e]=function(){for(var r,n=arguments.length,o=Array(n),s=0;s<n;s++)o[s]=arguments[s];return(r=a[e]).call.apply(r,[i,t].concat(o))}}),Object.entries(l).forEach(function(e){var t=function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,u=!1;try{o=(r=r.call(e)).next,!1;for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,2)||function(e,t){if(e){if("string"==typeof e)return S(e,2);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return S(e,t)}}(e,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),r=t[0],n=t[1];return i[r]=i[n]}),i.resetProps=function(){return d.forEach(function(e){i[e.name](e.defaultVal)}),i},i.resetProps(),t._rerender=s,i}}},7195:(e,t,r)=>{"use strict";function n(){}function i(e){return null==e?n:function(){return this.querySelector(e)}}function o(){return[]}function a(e){return null==e?o:function(){return this.querySelectorAll(e)}}function s(e){return function(){return this.matches(e)}}function l(e){return function(t){return t.matches(e)}}r.d(t,{q8L:()=>eZ,yen:()=>eY});var u,c=Array.prototype.find;function h(){return this.firstElementChild}var f=Array.prototype.filter;function d(){return Array.from(this.children)}function p(e){return Array(e.length)}function m(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}function g(e,t,r,n,i,o){for(var a,s=0,l=t.length,u=o.length;s<u;++s)(a=t[s])?(a.__data__=o[s],n[s]=a):r[s]=new m(e,o[s]);for(;s<l;++s)(a=t[s])&&(i[s]=a)}function v(e,t,r,n,i,o,a){var s,l,u,c=new Map,h=t.length,f=o.length,d=Array(h);for(s=0;s<h;++s)(l=t[s])&&(d[s]=u=a.call(l,l.__data__,s,t)+"",c.has(u)?i[s]=l:c.set(u,l));for(s=0;s<f;++s)u=a.call(e,o[s],s,o)+"",(l=c.get(u))?(n[s]=l,l.__data__=o[s],c.delete(u)):r[s]=new m(e,o[s]);for(s=0;s<h;++s)(l=t[s])&&c.get(d[s])===l&&(i[s]=l)}function y(e){return e.__data__}function A(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}m.prototype={constructor:m,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};var _="http://www.w3.org/1999/xhtml";let b={svg:"http://www.w3.org/2000/svg",xhtml:_,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function B(e){var t=e+="",r=t.indexOf(":");return r>=0&&"xmlns"!==(t=e.slice(0,r))&&(e=e.slice(r+1)),b.hasOwnProperty(t)?{space:b[t],local:e}:e}function x(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function C(e,t){return e.style.getPropertyValue(t)||x(e).getComputedStyle(e,null).getPropertyValue(t)}function w(e){return e.trim().split(/^|\s+/)}function E(e){return e.classList||new M(e)}function M(e){this._node=e,this._names=w(e.getAttribute("class")||"")}function T(e,t){for(var r=E(e),n=-1,i=t.length;++n<i;)r.add(t[n])}function F(e,t){for(var r=E(e),n=-1,i=t.length;++n<i;)r.remove(t[n])}function S(){this.textContent=""}function O(){this.innerHTML=""}function R(){this.nextSibling&&this.parentNode.appendChild(this)}function I(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function P(e){var t=B(e);return(t.local?function(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}:function(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===_&&t.documentElement.namespaceURI===_?t.createElement(e):t.createElementNS(r,e)}})(t)}function D(){return null}function H(){var e=this.parentNode;e&&e.removeChild(this)}function L(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function G(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function U(e){return function(){var t=this.__on;if(t){for(var r,n=0,i=-1,o=t.length;n<o;++n)(r=t[n],e.type&&r.type!==e.type||r.name!==e.name)?t[++i]=r:this.removeEventListener(r.type,r.listener,r.options);++i?t.length=i:delete this.__on}}}function k(e,t,r){return function(){var n,i=this.__on,o=function(e){t.call(this,e,this.__data__)};if(i){for(var a=0,s=i.length;a<s;++a)if((n=i[a]).type===e.type&&n.name===e.name){this.removeEventListener(n.type,n.listener,n.options),this.addEventListener(n.type,n.listener=o,n.options=r),n.value=t;return}}this.addEventListener(e.type,o,r),n={type:e.type,name:e.name,value:t,listener:o,options:r},i?i.push(n):this.__on=[n]}}function N(e,t,r){var n=x(e),i=n.CustomEvent;"function"==typeof i?i=new i(t,r):(i=n.document.createEvent("Event"),r?(i.initEvent(t,r.bubbles,r.cancelable),i.detail=r.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}M.prototype={add:function(e){0>this._names.indexOf(e)&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};var j=[null];function J(e,t){this._groups=e,this._parents=t}
505function z(){return new J([[document.documentElement]],j)}J.prototype=z.prototype={constructor:J,select:function(e){"function"!=typeof e&&(e=i(e));for(var t=this._groups,r=t.length,n=Array(r),o=0;o<r;++o)for(var a,s,l=t[o],u=l.length,c=n[o]=Array(u),h=0;h<u;++h)(a=l[h])&&(s=e.call(a,a.__data__,h,l))&&("__data__"in a&&(s.__data__=a.__data__),c[h]=s);return new J(n,this._parents)},selectAll:function(e){if("function"==typeof e){var t;t=e,e=function(){var e;return e=t.apply(this,arguments),null==e?[]:Array.isArray(e)?e:Array.from(e)}}else e=a(e);for(var r=this._groups,n=r.length,i=[],o=[],s=0;s<n;++s)for(var l,u=r[s],c=u.length,h=0;h<c;++h)(l=u[h])&&(i.push(e.call(l,l.__data__,h,u)),o.push(l));return new J(i,o)},selectChild:function(e){var t;return this.select(null==e?h:(t="function"==typeof e?e:l(e),function(){return c.call(this.children,t)}))},selectChildren:function(e){var t;return this.selectAll(null==e?d:(t="function"==typeof e?e:l(e),function(){return f.call(this.children,t)}))},filter:function(e){"function"!=typeof e&&(e=s(e));for(var t=this._groups,r=t.length,n=Array(r),i=0;i<r;++i)for(var o,a=t[i],l=a.length,u=n[i]=[],c=0;c<l;++c)(o=a[c])&&e.call(o,o.__data__,c,a)&&u.push(o);return new J(n,this._parents)},data:function(e,t){if(!arguments.length)return Array.from(this,y);var r=t?v:g,n=this._parents,i=this._groups;"function"!=typeof e&&(b=e,e=function(){return b});for(var o=i.length,a=Array(o),s=Array(o),l=Array(o),u=0;u<o;++u){var c=n[u],h=i[u],f=h.length,d="object"==typeof(_=e.call(c,c&&c.__data__,u,n))&&"length"in _?_:Array.from(_),p=d.length,m=s[u]=Array(p),A=a[u]=Array(p);r(c,h,m,A,l[u]=Array(f),d,t);for(var _,b,B,x,C=0,w=0;C<p;++C)if(B=m[C]){for(C>=w&&(w=C+1);!(x=A[w])&&++w<p;);B._next=x||null}}return(a=new J(a,n))._enter=s,a._exit=l,a},enter:function(){return new J(this._enter||this._groups.map(p),this._parents)},exit:function(){return new J(this._exit||this._groups.map(p),this._parents)},join:function(e,t,r){var n=this.enter(),i=this,o=this.exit();return"function"==typeof e?(n=e(n))&&(n=n.selection()):n=n.append(e+""),null!=t&&(i=t(i))&&(i=i.selection()),null==r?o.remove():r(o),n&&i?n.merge(i).order():i},merge:function(e){for(var t=e.selection?e.selection():e,r=this._groups,n=t._groups,i=r.length,o=n.length,a=Math.min(i,o),s=Array(i),l=0;l<a;++l)for(var u,c=r[l],h=n[l],f=c.length,d=s[l]=Array(f),p=0;p<f;++p)(u=c[p]||h[p])&&(d[p]=u);for(;l<i;++l)s[l]=r[l];return new J(s,this._parents)},selection:function(){return this},order:function(){for(var e=this._groups,t=-1,r=e.length;++t<r;)for(var n,i=e[t],o=i.length-1,a=i[o];--o>=0;)(n=i[o])&&(a&&4^n.compareDocumentPosition(a)&&a.parentNode.insertBefore(n,a),a=n);return this},sort:function(e){function t(t,r){return t&&r?e(t.__data__,r.__data__):!t-!r}e||(e=A);for(var r=this._groups,n=r.length,i=Array(n),o=0;o<n;++o){for(var a,s=r[o],l=s.length,u=i[o]=Array(l),c=0;c<l;++c)(a=s[c])&&(u[c]=a);u.sort(t)}return new J(i,this._parents).order()},call:function(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var n=e[t],i=0,o=n.length;i<o;++i){var a=n[i];if(a)return a}return null},size:function(){let e=0;for(let t of this)++e;return e},empty:function(){return!this.node()},each:function(e){for(var t=this._groups,r=0,n=t.length;r<n;++r)for(var i,o=t[r],a=0,s=o.length;a<s;++a)(i=o[a])&&e.call(i,i.__data__,a,o);return this},attr:function(e,t){var r=B(e);if(arguments.length<2){var n=this.node();return r.local?n.getAttributeNS(r.space,r.local):n.getAttribute(r)}return this.each((null==t?r.local?function(e){return function(){this.removeAttributeNS(e.space,e.local)}}:function(e){return function(){this.removeAttribute(e)}}:"function"==typeof t?r.local?function(e,t){return function(){var r=t.apply(this,arguments);null==r?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,r)}}:function(e,t){return function(){var r=t.apply(this,arguments);null==r?this.removeAttribute(e):this.setAttribute(e,r)}}:r.local?function(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}:function(e,t){return function(){this.setAttribute(e,t)}})(r,t))},style:function(e,t,r){return arguments.length>1?this.each((null==t?function(e){return function(){this.style.removeProperty(e)}}:"function"==typeof t?function(e,t,r){return function(){var n=t.apply(this,arguments);null==n?this.style.removeProperty(e):this.style.setProperty(e,n,r)}}:function(e,t,r){return function(){this.style.setProperty(e,t,r)}})(e,t,null==r?"":r)):C(this.node(),e)},property:function(e,t){return arguments.length>1?this.each((null==t?function(e){return function(){delete this[e]}}:"function"==typeof t?function(e,t){return function(){var r=t.apply(this,arguments);null==r?delete this[e]:this[e]=r}}:function(e,t){return function(){this[e]=t}})(e,t)):this.node()[e]},classed:function(e,t){var r=w(e+"");if(arguments.length<2){for(var n=E(this.node()),i=-1,o=r.length;++i<o;)if(!n.contains(r[i]))return!1;return!0}return this.each(("function"==typeof t?function(e,t){return function(){(t.apply(this,arguments)?T:F)(this,e)}}:t?function(e){return function(){T(this,e)}}:function(e){return function(){F(this,e)}})(r,t))},text:function(e){return arguments.length?this.each(null==e?S:("function"==typeof e?function(e){return function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}}:function(e){return function(){this.textContent=e}})(e)):this.node().textContent},html:function(e){return arguments.length?this.each(null==e?O:("function"==typeof e?function(e){return function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}}:function(e){return function(){this.innerHTML=e}})(e)):this.node().innerHTML},raise:function(){return this.each(R)},lower:function(){return this.each(I)},append:function(e){var t="function"==typeof e?e:P(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})},insert:function(e,t){var r="function"==typeof e?e:P(e),n=null==t?D:"function"==typeof t?t:i(t);return this.select(function(){return this.insertBefore(r.apply(this,arguments),n.apply(this,arguments)||null)})},remove:function(){return this.each(H)},clone:function(e){return this.select(e?G:L)},datum:function(e){return arguments.length?this.property("__data__",e):this.node().__data__},on:function(e,t,r){var n,i,o=(e+"").trim().split(/^|\s+/).map(function(e){var t="",r=e.indexOf(".");return r>=0&&(t=e.slice(r+1),e=e.slice(0,r)),{type:e,name:t}}),a=o.length;if(arguments.length<2){var s=this.node().__on;if(s){for(var l,u=0,c=s.length;u<c;++u)for(n=0,l=s[u];n<a;++n)if((i=o[n]).type===l.type&&i.name===l.name)return l.value}return}for(n=0,s=t?k:U;n<a;++n)this.each(s(o[n],t,r));return this},dispatch:function(e,t){return this.each(("function"==typeof t?function(e,t){return function(){return N(this,e,t.apply(this,arguments))}}:function(e,t){return function(){return N(this,e,t)}})(e,t))},[Symbol.iterator]:function*(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var n,i=e[t],o=0,a=i.length;o<a;++o)(n=i[o])&&(yield n)}};var K={value:()=>{}};function V(){for(var e,t=0,r=arguments.length,n={};t<r;++t){if(!(e=arguments[t]+"")||e in n||/[\s.]/.test(e))throw Error("illegal type: "+e);n[e]=[]}return new Q(n)}function Q(e){this._=e}function X(e,t,r){for(var n=0,i=e.length;n<i;++n)if(e[n].name===t){e[n]=K,e=e.slice(0,n).concat(e.slice(n+1));break}return null!=r&&e.push({name:t,value:r}),e}Q.prototype=V.prototype={constructor:Q,on:function(e,t){var r,n=this._,i=(e+"").trim().split(/^|\s+/).map(function(e){var t="",r=e.indexOf(".");if(r>=0&&(t=e.slice(r+1),e=e.slice(0,r)),e&&!n.hasOwnProperty(e))throw Error("unknown type: "+e);return{type:e,name:t}}),o=-1,a=i.length;if(arguments.length<2){for(;++o<a;)if((r=(e=i[o]).type)&&(r=function(e,t){for(var r,n=0,i=e.length;n<i;++n)if((r=e[n]).name===t)return r.value}(n[r],e.name)))return r;return}if(null!=t&&"function"!=typeof t)throw Error("invalid callback: "+t);for(;++o<a;)if(r=(e=i[o]).type)n[r]=X(n[r],e.name,t);else if(null==t)for(r in n)n[r]=X(n[r],e.name,null);return this},copy:function(){var e={},t=this._;for(var r in t)e[r]=t[r].slice();return new Q(e)},call:function(e,t){if((r=arguments.length-2)>0)for(var r,n,i=Array(r),o=0;o<r;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(e))throw Error("unknown type: "+e);for(n=this._[e],o=0,r=n.length;o<r;++o)n[o].value.apply(t,i)},apply:function(e,t,r){if(!this._.hasOwnProperty(e))throw Error("unknown type: "+e);for(var n=this._[e],i=0,o=n.length;i<o;++i)n[i].value.apply(t,r)}};var Y,Z,q=0,W=0,$=0,ee=0,et=0,er=0,en="object"==typeof performance&&performance.now?performance:Date,ei="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function eo(){return et||(ei(ea),et=en.now()+er)}function ea(){et=0}function es(){this._call=this._time=this._next=null}function el(e,t,r){var n=new es;return n.restart(e,t,r),n}function eu(){et=(ee=en.now())+er,q=W=0;try{eo(),++q;for(var e,t=Y;t;)(e=et-t._time)>=0&&t._call.call(void 0,e),t=t._next;--q}finally{q=0,function(){for(var e,t,r=Y,n=1/0;r;)r._call?(n>r._time&&(n=r._time),e=r,r=r._next):(t=r._next,r._next=null,r=e?e._next=t:Y=t);Z=e,eh(n)}(),et=0}}function ec(){var e=en.now(),t=e-ee;t>1e3&&(er-=t,ee=e)}function eh(e){!q&&(W&&(W=clearTimeout(W)),e-et>24?(e<1/0&&(W=setTimeout(eu,e-en.now()-er)),$&&($=clearInterval($))):($||(ee=en.now(),$=setInterval(ec,1e3)),q=1,ei(eu)))}function ef(e,t,r){var n=new es;return t=null==t?0:+t,n.restart(r=>{n.stop(),e(r+t)},t,r),n}es.prototype=el.prototype={constructor:es,restart:function(e,t,r){if("function"!=typeof e)throw TypeError("callback is not a function");r=(null==r?eo():+r)+(null==t?0:+t),this._next||Z===this||(Z?Z._next=this:Y=this,Z=this),this._call=e,this._time=r,eh()},stop:function(){this._call&&(this._call=null,this._time=1/0,eh())}};var ed=V("start","end","cancel","interrupt"),ep=[];function em(e,t,r,n,i,o){var a=e.__transition;if(a){if(r in a)return}else e.__transition={};!function(e,t,r){var n,i=e.__transition;function o(l){var u,c,h,f;if(1!==r.state)return s();for(u in i)if((f=i[u]).name===r.name){if(3===f.state)return ef(o);4===f.state?(f.state=6,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete i[u]):+u<t&&(f.state=6,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete i[u])}if(ef(function(){3===r.state&&(r.state=4,r.timer.restart(a,r.delay,r.time),a(l))}),r.state=2,r.on.call("start",e,e.__data__,r.index,r.group),2===r.state){for(u=0,r.state=3,n=Array(h=r.tween.length),c=-1;u<h;++u)(f=r.tween[u].value.call(e,e.__data__,r.index,r.group))&&(n[++c]=f);n.length=c+1}}function a(t){for(var i=t<r.duration?r.ease.call(null,t/r.duration):(r.timer.restart(s),r.state=5,1
505),o=-1,a=n.length;++o<a;)n[o].call(e,i);5===r.state&&(r.on.call("end",e,e.__data__,r.index,r.group),s())}function s(){for(var n in r.state=6,r.timer.stop(),delete i[t],i)return;delete e.__transition}i[t]=r,r.timer=el(function(e){r.state=1,r.timer.restart(o,r.delay,r.time),r.delay<=e&&o(e-r.delay)},0,r.time)}(e,r,{name:t,index:n,group:i,on:ed,tween:ep,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:0})}function eg(e,t){var r=ey(e,t);if(r.state>0)throw Error("too late; already scheduled");return r}function ev(e,t){var r=ey(e,t);if(r.state>3)throw Error("too late; already running");return r}function ey(e,t){var r=e.__transition;if(!r||!(r=r[t]))throw Error("transition not found");return r}var eA=r(2623),e_=180/Math.PI,eb={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function eB(e,t,r,n,i,o){var a,s,l;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(l=e*r+t*n)&&(r-=e*l,n-=t*l),(s=Math.sqrt(r*r+n*n))&&(r/=s,n/=s,l/=s),e*n<t*r&&(e=-e,t=-t,l=-l,a=-a),{translateX:i,translateY:o,rotate:Math.atan2(t,e)*e_,skewX:Math.atan(l)*e_,scaleX:a,scaleY:s}}function ex(e,t,r,n){function i(e){return e.length?e.pop()+" ":""}return function(o,a){var s,l,u,c,h=[],f=[];return o=e(o),a=e(a),!function(e,n,i,o,a,s){if(e!==i||n!==o){var l=a.push("translate(",null,t,null,r);s.push({i:l-4,x:(0,eA.A)(e,i)},{i:l-2,x:(0,eA.A)(n,o)})}else(i||o)&&a.push("translate("+i+t+o+r)}(o.translateX,o.translateY,a.translateX,a.translateY,h,f),s=o.rotate,l=a.rotate,s!==l?(s-l>180?l+=360:l-s>180&&(s+=360),f.push({i:h.push(i(h)+"rotate(",null,n)-2,x:(0,eA.A)(s,l)})):l&&h.push(i(h)+"rotate("+l+n),u=o.skewX,c=a.skewX,u!==c?f.push({i:h.push(i(h)+"skewX(",null,n)-2,x:(0,eA.A)(u,c)}):c&&h.push(i(h)+"skewX("+c+n),!function(e,t,r,n,o,a){if(e!==r||t!==n){var s=o.push(i(o)+"scale(",null,",",null,")");a.push({i:s-4,x:(0,eA.A)(e,r)},{i:s-2,x:(0,eA.A)(t,n)})}else(1!==r||1!==n)&&o.push(i(o)+"scale("+r+","+n+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,h,f),o=a=null,function(e){for(var t,r=-1,n=f.length;++r<n;)h[(t=f[r]).i]=t.x(e);return h.join("")}}}var eC=ex(function(e){let t=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?eb:eB(t.a,t.b,t.c,t.d,t.e,t.f)},"px, ","px)","deg)"),ew=ex(function(e){return null==e?eb:(u||(u=document.createElementNS("http://www.w3.org/2000/svg","g")),u.setAttribute("transform",e),e=u.transform.baseVal.consolidate())?eB((e=e.matrix).a,e.b,e.c,e.d,e.e,e.f):eb},", ",")",")");function eE(e,t,r){var n=e._id;return e.each(function(){var e=ev(this,n);(e.value||(e.value={}))[t]=r.apply(this,arguments)}),function(e){return ey(e,n).value[t]}}var eM=r(5159),eT=r(9656),eF=r(2575);function eS(e,t){var r;return("number"==typeof t?eA.A:t instanceof eM.Ay?eT.Ay:(r=(0,eM.Ay)(t))?(t=r,eT.Ay):eF.A)(e,t)}var eO=z.prototype.constructor;function eR(e){return function(){this.style.removeProperty(e)}}var eI=0;function eP(e,t,r,n){this._groups=e,this._parents=t,this._name=r,this._id=n}var eD=z.prototype;eP.prototype=(function(e){return z().transition(e)}).prototype={constructor:eP,select:function(e){var t=this._name,r=this._id;"function"!=typeof e&&(e=i(e));for(var n=this._groups,o=n.length,a=Array(o),s=0;s<o;++s)for(var l,u,c=n[s],h=c.length,f=a[s]=Array(h),d=0;d<h;++d)(l=c[d])&&(u=e.call(l,l.__data__,d,c))&&("__data__"in l&&(u.__data__=l.__data__),f[d]=u,em(f[d],t,r,d,f,ey(l,r)));return new eP(a,this._parents,t,r)},selectAll:function(e){var t=this._name,r=this._id;"function"!=typeof e&&(e=a(e));for(var n=this._groups,i=n.length,o=[],s=[],l=0;l<i;++l)for(var u,c=n[l],h=c.length,f=0;f<h;++f)if(u=c[f]){for(var d,p=e.call(u,u.__data__,f,c),m=ey(u,r),g=0,v=p.length;g<v;++g)(d=p[g])&&em(d,t,r,g,p,m);o.push(p),s.push(u)}return new eP(o,s,t,r)},selectChild:eD.selectChild,selectChildren:eD.selectChildren,filter:function(e){"function"!=typeof e&&(e=s(e));for(var t=this._groups,r=t.length,n=Array(r),i=0;i<r;++i)for(var o,a=t[i],l=a.length,u=n[i]=[],c=0;c<l;++c)(o=a[c])&&e.call(o,o.__data__,c,a)&&u.push(o);return new eP(n,this._parents,this._name,this._id)},merge:function(e){if(e._id!==this._id)throw Error();for(var t=this._groups,r=e._groups,n=t.length,i=r.length,o=Math.min(n,i),a=Array(n),s=0;s<o;++s)for(var l,u=t[s],c=r[s],h=u.length,f=a[s]=Array(h),d=0;d<h;++d)(l=u[d]||c[d])&&(f[d]=l);for(;s<n;++s)a[s]=t[s];return new eP(a,this._parents,this._name,this._id)},selection:function(){return new eO(this._groups,this._parents)}
505,transition:function(){for(var e=this._name,t=this._id,r=++eI,n=this._groups,i=n.length,o=0;o<i;++o)for(var a,s=n[o],l=s.length,u=0;u<l;++u)if(a=s[u]){var c=ey(a,t);em(a,e,r,u,s,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new eP(n,this._parents,e,r)},call:eD.call,nodes:eD.nodes,node:eD.node,size:eD.size,empty:eD.empty,each:eD.each,on:function(e,t){var r,n,i,o,a,s,l=this._id;return arguments.length<2?ey(this.node(),l).on.on(e):this.each((r=l,n=e,i=t,s=(n+"").trim().split(/^|\s+/).every(function(e){var t=e.indexOf(".");return t>=0&&(e=e.slice(0,t)),!e||"start"===e})?eg:ev,function(){var e=s(this,r),t=e.on;t!==o&&(a=(o=t).copy()).on(n,i),e.on=a}))},attr:function(e,t){var r=B(e),n="transform"===r?ew:eS;return this.attrTween(e,"function"==typeof t?(r.local?function(e,t,r){var n,i,o;return function(){var a,s,l=r(this);return null==l?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local))===(s=l+"")?null:a===n&&s===i?o:(i=s,o=t(n=a,l))}}:function(e,t,r){var n,i,o;return function(){var a,s,l=r(this);return null==l?void this.removeAttribute(e):(a=this.getAttribute(e))===(s=l+"")?null:a===n&&s===i?o:(i=s,o=t(n=a,l))}})(r,n,eE(this,"attr."+e,t)):null==t?(r.local?function(e){return function(){this.removeAttributeNS(e.space,e.local)}}:function(e){return function(){this.removeAttribute(e)}})(r):(r.local?function(e,t,r){var n,i,o=r+"";return function(){var a=this.getAttributeNS(e.space,e.local);return a===o?null:a===n?i:i=t(n=a,r)}}:function(e,t,r){var n,i,o=r+"";return function(){var a=this.getAttribute(e);return a===o?null:a===n?i:i=t(n=a,r)}})(r,n,t))},attrTween:function(e,t){var r="attr."+e;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==t)return this.tween(r,null);if("function"!=typeof t)throw Error();var n=B(e);return this.tween(r,(n.local?function(e,t){var r,n;function i(){var i=t.apply(this,arguments);return i!==n&&(r=(n=i)&&function(t){this.setAttributeNS(e.space,e.local,i.call(this,t))}),r}return i._value=t,i}:function(e,t){var r,n;function i(){var i=t.apply(this,arguments);return i!==n&&(r=(n=i)&&function(t){this.setAttribute(e,i.call(this,t))}),r}return i._value=t,i})(n,t))},style:function(e,t,r){var n,i,o,a,s,l,u,c,h,f,d,p,m,g,v,y,A,_,b,B,x,w="transform"==(e+="")?eC:eS;return null==t?this.styleTween(e,(n=e,function(){var e=C(this,n),t=(this.style.removeProperty(n),C(this,n));return e===t?null:e===i&&t===o?a:a=w(i=e,o=t)})).on("end.style."+e,eR(e)):"function"==typeof t?this.styleTween(e,(s=e,l=eE(this,"style."+e,t),function(){var e=C(this,s),t=l(this),r=t+"";return null==t&&(this.style.removeProperty(s),r=t=C(this,s)),e===r?null:e===u&&r===c?h:(c=r,h=w(u=e,t))})).each((f=this._id,A="end."+(y="style."+(d=e)),function(){var e=ev(this,f),t=e.on,r=null==e.value[y]?v||(v=eR(d)):void 0;(t!==p||g!==r)&&(m=(p=t).copy()).on(A,g=r),e.on=m})):this.styleTween(e,(_=e,x=t+"",function(){var e=C(this,_);return e===x?null:e===b?B:B=w(b=e,t)}),r).on("end.style."+e,null)},styleTween:function(e,t,r){var n="style."+(e+="");if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!=typeof t)throw Error();return this.tween(n,function(e,t,r){var n,i;function o(){var o=t.apply(this,arguments);return o!==i&&(n=(i=o)&&function(t){this.style.setProperty(e,o.call(this,t),r)}),n}return o._value=t,o}(e,t,null==r?"":r))},text:function(e){var t,r;return this.tween("text","function"==typeof e?(t=eE(this,"text",e),function(){var e=t(this);this.textContent=null==e?"":e}):(r=null==e?"":e+"",function(){this.textContent=r}))},textTween:function(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(null==e)return this.tween(t,null);if("function"!=typeof e)throw Error();return this.tween(t,function(e){var t,r;function n(){var n=e.apply(this,arguments);return n!==r&&(t=(r=n)&&function(e){this.textContent=n.call(this,e)}),t}return n._value=e,n}(e))},remove:function(){var e;return this.on("end.remove",(e=this._id,function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}))},tween:function(e,t){var r=this._id;if(e+="",arguments.length<2){for(var n,i=ey(this.node(),r).tween,o=0,a=i.length;o<a;++o)if((n=i[o]).name===e)return n.value;return null}return this.each((null==t?function(e,t){var r,n;return function(){var i=ev(this,e),o=i.tween;if(o!==r){n=r=o;for(var a=0,s=n.length;a<s;++a)if(n[a].name===t){(n=n.slice()).splice(a,1);break}}i.tween=n}}:function(e,t,r){var n,i;if("function"!=typeof r)throw Error();return function(){var o=ev(this,e),a=o.tween;if(a!==n){i=(n=a).slice();for(var s={name:t,value:r},l=0,u=i.length;l<u;++l)if(i[l].name===t){i[l]=s;break}l===u&&i.push(s)}o.tween=i}})(r,e,t))},delay:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?function(e,t){return function(){eg(this,e).delay=+t.apply(this,arguments)}}:function(e,t){return t*=1,function(){eg(this,e).delay=t}})(t,e)):ey(this.node(),t).delay},duration:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?function(e,t){return function(){ev(this,e).duration=+t.apply(this,arguments)}}:function(e,t){return t*=1,function(){ev(this,e).duration=t}})(t,e)):ey(this.node(),t).duration},ease:function(e){var t=this._id;return arguments.length?this.each(function(e,t){if("function"!=typeof t)throw Error();return function(){ev(this,e).ease=t}}(t,e)):ey(this.node(),t).ease},easeVarying:function(e){var t;if("function"!=typeof e)throw Error();return this.each((t=this._id,function(){var r=e.apply(this,arguments);if("function"!=typeof r)throw Error();ev(this,t).ease=r}))},end:function(){var e,t,r=this,n=r._id,i=r.size();return new Promise(function(o,a){var s={value:a},l={value:function(){0==--i&&o()}};r.each(function(){var r=ev(this,n),i=r.on;
505i!==e&&((t=(e=i).copy())._.cancel.push(s),t._.interrupt.push(s),t._.end.push(l)),r.on=t}),0===i&&o()})},[Symbol.iterator]:eD[Symbol.iterator]};var eH={time:null,delay:0,duration:250,ease:function(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}};z.prototype.interrupt=function(e){return this.each(function(){!function(e,t){var r,n,i,o=e.__transition,a=!0;if(o){for(i in t=null==t?null:t+"",o){if((r=o[i]).name!==t){a=!1;continue}n=r.state>2&&r.state<5,r.state=6,r.timer.stop(),r.on.call(n?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete o[i]}a&&delete e.__transition}}(this,e)})},z.prototype.transition=function(e){var t,r;e instanceof eP?(t=e._id,e=e._name):(t=++eI,(r=eH).time=eo(),e=null==e?null:e+"");for(var n=this._groups,i=n.length,o=0;o<i;++o)for(var a,s=n[o],l=s.length,u=0;u<l;++u)(a=s[u])&&em(a,e,t,u,s,r||function(e,t){for(var r;!(r=e.__transition)||!(r=r[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return r}(a,t));return new eP(n,this._parents,e,t)};let{abs:eL,max:eG,min:eU}=Math;function ek(e){return{type:e}}["w","e"].map(ek),["n","s"].map(ek),["n","w","e","s","nw","ne","sw","se"].map(ek);var eN=r(7831),ej=r(114),eJ=r(4631),ez=r(4644),eK=r(4792);function eV(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function eQ(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function eX(e){return e<0?-e*e:e*e}function eY(){return(function e(){var t,r,n,i=(r=(t=function(){var e,t,r,n,i,o=0,a=1,s=eJ.D_,l=!1;function u(t){return null==t||isNaN(t*=1)?i:s(0===r?.5:(t=(n(t)-e)*r,l?Math.max(0,Math.min(1,t)):t))}function c(e){return function(t){var r,n;return arguments.length?([r,n]=t,s=e(r,n),u):[s(0),s(1)]}}return u.domain=function(i){return arguments.length?([o,a]=i,e=n(o*=1),t=n(a*=1),r=e===t?0:1/(t-e),u):[o,a]},u.clamp=function(e){return arguments.length?(l=!!e,u):l},u.interpolator=function(e){return arguments.length?(s=e,u):s},u.range=c(eN.A),u.rangeRound=c(ej.A),u.unknown=function(e){return arguments.length?(i=e,u):i},function(i){return n=i,e=i(o),t=i(a),r=e===t?0:1/(t-e),u}}())(eJ.D_,eJ.D_),n=1,r.exponent=function(e){return arguments.length?1==(n=+e)?t(eJ.D_,eJ.D_):.5===n?t(eQ,eX):t(eV(n),eV(1/n)):n},(0,eK.C)(r));return i.copy=function(){return e().domain(i.domain()).interpolator(i.interpolator()).clamp(i.clamp()).unknown(i.unknown()).exponent(i.exponent())},ez.K.apply(i,arguments)}).apply(null,arguments).exponent(.5)}let eZ=(e=>(0,eT.Ik)(e[e.length-1]))([,,,].concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(function(e){for(var t=e.length/6|0,r=Array(t),n=0;n<t;)r[n]="#"+e.slice(6*n,6*++n);return r}));function eq(e,t,r){this.k=e,this.x=t,this.y=r}eq.prototype={constructor:eq,scale:function(e){return 1===e?this:new eq(this.k*e,this.x,this.y)},translate:function(e,t){return 0===e&0===t?this:new eq(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};new eq(1,0,0);eq.prototype},7390:(e,t,r)=>{"use strict";r.d(t,{_:()=>c});var n=r(7656),i=r(1698),o=r(23),a=r(3354),s=r(1155);let l=parseInt(i.REVISION.replace(/\D+/g,"")),u=function(e,t,r,n){let o=class extends i.ShaderMaterial{constructor(n={}){let o=Object.entries(e);super({uniforms:o.reduce((e,[t,r])=>{let n=i.UniformsUtils.clone({[t]:{value:r}});return{...e,...n}},{}),vertexShader:t,fragmentShader:r}),this.key="",o.forEach(([e])=>Object.defineProperty(this,e,{get:()=>this.uniforms[e].value,set:t=>this.uniforms[e].value=t})),Object.assign(this,n)}};return o.key=i.MathUtils.generateUUID(),o}({screenspace:!1,color:new i.Color("black"),opacity:1,thickness:.05,size:new i.Vector2},`#include <common> 506 #include <morphtarget_pars_vertex> 507 #include <skinning_pars_vertex> 508 uniform float thickness; 509 uniform float screenspace; 510 uniform vec2 size; 511 void main() { 512 #if defined (USE_SKINNING) 513 #include <beginnormal_vertex> 514 #include <morphnormal_vertex> 515 #include <skinbase_vertex> 516 #include <skinnormal_vertex> 517 #include <defaultnormal_vertex> 518 #endif 519 #include <begin_vertex> 520 #include <morphtarget_vertex> 521 #include <skinning_vertex> 522 #include <project_vertex> 523 vec4 tNormal = vec4(normal, 0.0); 524 vec4 tPosition = vec4(transformed, 1.0); 525 #ifdef USE_INSTANCING 526 tNormal = instanceMatrix * tNormal; 527 tPosition = instanceMatrix * tPosition; 528 #endif 529 if (screenspace == 0.0) { 530 vec3 newPosition = tPosition.xyz + tNormal.xyz * thickness; 531 gl_Position = projectionMatrix * modelViewMatrix * vec4(newPosition, 1.0
531); 532 } else { 533 vec4 clipPosition = projectionMatrix * modelViewMatrix * tPosition; 534 vec4 clipNormal = projectionMatrix * modelViewMatrix * tNormal; 535 vec2 offset = normalize(clipNormal.xy) * thickness / size * clipPosition.w * 2.0; 536 clipPosition.xy += offset; 537 gl_Position = clipPosition; 538 } 539 }`,`uniform vec3 color; 540 uniform float opacity; 541 void main(){ 542 gl_FragColor = vec4(color, opacity); 543 #include <tonemapping_fragment> 544 #include <${l>=154?"colorspace_fragment":"encodings_fragment"}> 545 }`);function c({color:e="black",opacity:t=1,transparent:r=!1,screenspace:l=!1,toneMapped:c=!0,polygonOffset:h=!1,polygonOffsetFactor:f=0,renderOrder:d=0,thickness:p=.05,angle:m=Math.PI,...g}){let v=o.useRef(),[y]=o.useState(()=>new u({side:i.BackSide})),{gl:A}=(0,a.A)(),_=A.getDrawingBufferSize(new i.Vector2);o.useMemo(()=>(0,a.e)({OutlinesMaterial:u}),[]);let b=o.useRef(0),B=o.useRef();return o.useLayoutEffect(()=>{let e=v.current;if(!e)return;let t=e.parent;if(t&&t.geometry&&(b.current!==m||B.current!==t.geometry)){var r;b.current=m,B.current=t.geometry;let n=null==(r=e.children)?void 0:r[0];n&&(m&&n.geometry.dispose(),e.remove(n)),t.skeleton?((n=new i.SkinnedMesh).material=y,n.bind(t.skeleton,t.bindMatrix)):t.isInstancedMesh?(n=new i.InstancedMesh(t.geometry,y,t.count)).instanceMatrix=t.instanceMatrix:(n=new i.Mesh).material=y,e.add(n),n.geometry=m?(0,s.pb)(t.geometry,m):t.geometry}}),o.useLayoutEffect(()=>{let n=v.current;if(!n)return;let i=n.children[0];i&&(i.renderOrder=d,(0,a.q)(i.material,{transparent:r,thickness:p,color:e,opacity:t,size:_,screenspace:l,toneMapped:c,polygonOffset:h,pol
545ygonOffsetFactor:f}))}),o.useEffect(()=>()=>{let e=v.current;if(!e)return;let t=e.children[0];t&&(m&&t.geometry.dispose(),e.remove(t))},[]),o.createElement("group",(0,n.A)({ref:v},g))}},7399:(e,t,r)=>{"use strict";let n,i,o,a,s,l,u,c,h,f,d,p,m,g,v,y,A,_,b,B,x,C,w;r.d(t,{a:()=>$});var E,M=r(7656),T=r(1698),F=r(23),S=r(3354);let O={LEFT:1,RIGHT:2,MIDDLE:4},R=Object.freeze({NONE:0,ROTATE:1,TRUCK:2,OFFSET:4,DOLLY:8,ZOOM:16,TOUCH_ROTATE:32,TOUCH_TRUCK:64,TOUCH_OFFSET:128,TOUCH_DOLLY:256,TOUCH_ZOOM:512,TOUCH_DOLLY_TRUCK:1024,TOUCH_DOLLY_OFFSET:2048,TOUCH_DOLLY_ROTATE:4096,TOUCH_ZOOM_TRUCK:8192,TOUCH_ZOOM_OFFSET:16384,TOUCH_ZOOM_ROTATE:32768}),I={NONE:0,IN:1,OUT:-1};function P(e){return e.isPerspectiveCamera}function D(e){return e.isOrthographicCamera}let H=2*Math.PI,L=Math.PI/2,G=Math.PI/180;function U(e,t,r){return Math.max(t,Math.min(r,e))}function k(e,t=1e-5){return Math.abs(e)<t}function N(e,t,r=1e-5){return k(e-t,r)}function j(e,t){return Math.round(e/t)*t}function J(e){return isFinite(e)?e:e<0?-Number.MAX_VALUE:Number.MAX_VALUE}function z(e){return Math.abs(e)<Number.MAX_VALUE?e:1/0*e}function K(e,t,r,n,i=1/0,o){let a=2/(n=Math.max(1e-4,n)),s=a*o,l=1/(1+s+.48*s*s+.235*s*s*s),u=e-t,c=t,h=i*n;t=e-(u=U(u,-h,h));let f=(r.value+a*u)*o;r.value=(r.value-a*f)*l;let d=t+(u+f)*l;return c-e>0==d>c&&(r.value=((d=c)-c)/o),d}function V(e,t,r,n,i=1/0,o,a){let s=2/(n=Math.max(1e-4,n)),l=s*o,u=1/(1+l+.48*l*l+.235*l*l*l),c=t.x,h=t.y,f=t.z,d=e.x-c,p=e.y-h,m=e.z-f,g=c,v=h,y=f,A=i*n,_=d*d+p*p+m*m;if(_>A*A){let e=Math.sqrt(_);d=d/e*A,p=p/e*A,m=m/e*A}c=e.x-d,h=e.y-p,f=e.z-m;let b=(r.x+s*d)*o,B=(r.y+s*p)*o,x=(r.z+s*m)*o;
545r.x=(r.x-s*b)*u,r.y=(r.y-s*B)*u,r.z=(r.z-s*x)*u,a.x=c+(d+b)*u,a.y=h+(p+B)*u,a.z=f+(m+x)*u;let C=g-e.x,w=v-e.y,E=y-e.z,M=a.x-g;return C*M+w*(a.y-v)+E*(a.z-y)>0&&(a.x=g,a.y=v,a.z=y,r.x=(a.x-g)/o,r.y=(a.y-v)/o,r.z=(a.z-y)/o),a}function Q(e,t){t.set(0,0),e.forEach(e=>{t.x+=e.clientX,t.y+=e.clientY}),t.x/=e.length,t.y/=e.length}function X(e,t){return!!D(e)&&(console.warn(`${t} is not supported in OrthographicCamera`),!0)}class Y{constructor(){this._listeners={}}addEventListener(e,t){let r=this._listeners;void 0===r[e]&&(r[e]=[]),-1===r[e].indexOf(t)&&r[e].push(t)}hasEventListener(e,t){let r=this._listeners;return void 0!==r[e]&&-1!==r[e].indexOf(t)}removeEventListener(e,t){let r=this._listeners[e];if(void 0!==r){let e=r.indexOf(t);-1!==e&&r.splice(e,1)}}removeAllEventListeners(e){if(!e){this._listeners={};return}Array.isArray(this._listeners[e])&&(this._listeners[e].length=0)}dispatchEvent(e){let t=this._listeners[e.type];if(void 0!==t){e.target=this;let r=t.slice(0);for(let t=0,n=r.length;t<n;t++)r[t].call(this,e)}}}let Z=1/8,q=/Mac/.test(null==(E=null==globalThis?void 0:globalThis.navigator)?void 0:E.platform);class W extends Y{static install(e){i=Object.freeze(new(n=e.THREE).Vector3(0,0,0)),o=Object.freeze(new n.Vector3(0,1,0)),a=Object.freeze(new n.Vector3(0,0,1)),s=new n.Vector2,l=new n.Vector3,u=new n.Vector3,c=new n.Vector3,h=new n.Vector3,f=new n.Vector3,d=new n.Vector3,p=new n.Vector3,m=new n.Vector3,g=new n.Vector3,v=new n.Spherical,y=new n.Spherical,A=new n.Box3,_=new n.Box3,b=new n.Sphere,B=new n.Quaternion,x=new n.Quaternion,C=new n.Matrix4,w=new n.Raycaster}static get ACTION(){return R}constructor(e,t){super(),this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.minDistance=Number.EPSILON,this.maxDistance=1/0,this.infinityDolly=!1,this.minZoom=.01,this.maxZoom=1/0,this.smoothTime=.25,this.draggingSmoothTime=.125,this.maxSpeed=1/0,this.azimuthRotateSpeed=1,this.polarRotateSpeed=1,this.dollySpeed=1,this.dollyDragInverted=!1,this.truckSpeed=2,this.dollyToCursor=!1,this.dragToOffset=!1,this.verticalDragToForward=!1,this.boundaryFriction=0,this.restThreshold=.01,this.colliderMeshes=[],this.cancel=()=>{},this._enabled=!0,this._state=R.NONE,this._viewport=null,this._changedDolly=0,this._changedZoom=0,this._hasRested=!0,this._boundaryEnclosesCamera=!1,this._needsUpdate=!0,this._updatedLastTime=!1,this._elementRect=new DOMRect,this._isDragging=!1,this._dragNeedsUpdate=!0,this._activePointers=[],this._lockedPointer=null,this._interactiveArea=new DOMRect(0,0,1,1),this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._isUserControllingOffset=!1,this._isUserControllingZoom=!1,this._lastDollyDirection=I.NONE,this._thetaVelocity={value:0},this._phiVelocity={value:0},this._radiusVelocity={value:0},this._targetVelocity=new n.Vector3,this._focalOffsetVelocity=new n.Vector3,this._zoomVelocity={value:0},this._truckInternal=(e,t,r)=>{let n,i;if(P(this._camera)){let r=l.copy(this._camera.position).sub(this._target),o=this._camera.getEffectiveFOV()*G,a=r.length()*Math.tan(.5*o);n=this.truckSpeed*e*a/this._elementRect.height,i=this.truckSpeed*t*a/this._elementRect.height}else{if(!D(this._camera))return;let r=this._camera;n=e*(r.right-r.left)/r.zoom/this._elementRect.width,i=t*(r.top-r.bottom)/r.zoom/this._elementRect.height}this.verticalDragToForward?(r?this.setFocalOffset(this._focalOffsetEnd.x+n,this._focalOffsetEnd.y,this._focalOffsetEnd.z,!0):this.truck(n,0,!0),this.forward(-i,!0)):r?this.setFocalOffset(this._focalOffsetEnd.x+n,this._focalOffsetEnd.y+i,this._focalOffsetEnd.z,!0):this.truck(n,i,!0)},this._rotateInternal=(e,t)=>{let r=H*this.azimuthRotateSpeed*e/this._elementRect.height,n=H*this.polarRotateSpeed*t/this._elementRect.height;this.rotate(r,n,!0)},this._dollyInternal=(e,t,r)=>{let n=Math.pow(.95,-e*this.dollySpeed),i=this._sphericalEnd.radius,o=this._sphericalEnd.radius*n,a=U(o,this.minDistance,this.maxDistance),s=a-o;this.infinityDolly&&this.dollyToCursor?this._dollyToNoClamp(o,!0):(this.infinityDolly&&!this.dollyToCursor&&this.dollyInFixed(s,!0),this._dollyToNoClamp(a,!0)),this.dollyToCursor&&(this._changedDolly+=(this.infinityDolly?o:a)-i,this._dollyControlCo
545ord.set(t,r)),this._lastDollyDirection=Math.sign(-e)},this._zoomInternal=(e,t,r)=>{let n=Math.pow(.95,e*this.dollySpeed),i=this._zoom,o=this._zoom*n;this.zoomTo(o,!0),this.dollyToCursor&&(this._changedZoom+=o-i,this._dollyControlCoord.set(t,r))},void 0===n&&console.error("camera-controls: `THREE` is undefined. You must first run `CameraControls.install( { THREE: THREE } )`. Check the docs for further information."),this._camera=e,this._yAxisUpSpace=new n.Quaternion().setFromUnitVectors(this._camera.up,o),this._yAxisUpSpaceInverse=this._yAxisUpSpace.clone().invert(),this._state=R.NONE,this._target=new n.Vector3,this._targetEnd=this._target.clone(),this._focalOffset=new n.Vector3,this._focalOffsetEnd=this._focalOffset.clone(),this._spherical=new n.Spherical().setFromVector3(l.copy(this._camera.position).applyQuaternion(this._yAxisUpSpace)),this._sphericalEnd=this._spherical.clone(),this._lastDistance=this._spherical.radius,this._zoom=this._camera.zoom,this._zoomEnd=this._zoom,this._lastZoom=this._zoom,this._nearPlaneCorners=[new n.Vector3,new n.Vector3,new n.Vector3,new n.Vector3],this._updateNearPlaneCorners(),this._boundary=new n.Box3(new n.Vector3(-1/0,-1/0,-1/0),new n.Vector3(1/0,1/0,1/0)),this._cameraUp0=this._camera.up.clone(),this._target0=this._target.clone(),this._position0=this._camera.position.clone(),this._zoom0=this._zoom,this._focalOffset0=this._focalOffset.clone(),this._dollyControlCoord=new n.Vector2,this.mouseButtons={left:R.ROTATE,middle:R.DOLLY,right:R.TRUCK,wheel:P(this._camera)?R.DOLLY:D(this._camera)?R.ZOOM:R.NONE},this.touches={one:R.TOUCH_ROTATE,two:P(this._camera)?R.TOUCH_DOLLY_TRUCK:D(this._camera)?R.TOUCH_ZOOM_TRUCK:R.NONE,three:R.TOUCH_TRUCK};let r=new n.Vector2,i=new n.Vector2,a=new n.Vector2,u=e=>{if(!this._enabled||!this._domElement)return;if(0!==this._interactiveArea.left||0!==this._interactiveArea.top||1!==this._interactiveArea.width||1!==this._interactiveArea.height){let t=this._domElement.getBoundingClientRect(),r=e.clientX/t.width,n=e.clientY/t.height;if(r<this._interactiveArea.left||r>this._interactiveArea.right||n<this._interactiveArea.top||n>this._interactiveArea.bottom)return}let t="mouse"!==e.pointerType?null:(e.buttons&O.LEFT)===O.LEFT?O.LEFT:(e.buttons&O.MIDDLE)===O.MIDDLE?O.MIDDLE:(e.buttons&O.RIGHT)===O.RIGHT?O.RIGHT:null;if(null!==t){let e=this._findPointerByMouseButton(t);e&&this._disposePointer(e)}if((e.buttons&O.LEFT)===O.LEFT&&this._lockedPointer)return;let r={pointerId:e.pointerId,clientX:e.clientX,clientY:e.clientY,deltaX:0,deltaY:0,mouseButton:t};this._activePointers.push(r),this._domElement.ownerDocument.removeEventListener("pointermove",c,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",h),this._domElement.ownerDocument.addEventListener("pointermove",c,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",h),this._isDragging=!0,m(e)},c=e=>{e.cancelable&&e.preventDefault();let t=e.pointerId,r=this._lockedPointer||this._findPointerById(t);if(r){if(r.clientX=e.clientX,r.clientY=e.clientY,r.deltaX=e.movementX,r.deltaY=e.movementY,this._state=0,"touch"===e.pointerType)switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three}else(!this._isDragging&&this._lockedPointer||this._isDragging&&(e.buttons&O.LEFT)===O.LEFT)&&(this._state=this._state|this.mouseButtons.left),this._isDragging&&(e.buttons&O.MIDDLE)===O.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),this._isDragging&&(e.buttons&O.RIGHT)===O.RIGHT&&(this._state=this._state|this.mouseButtons.right);g()}},h=e=>{let t=this._findPointerById(e.pointerId);if(!t||t!==this._lockedPointer){if(t&&this._disposePointer(t),"touch"===e.pointerType)switch(this._activePointers.length){case 0:this._state=R.NONE;break;case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three}else this._state=R.NONE;v()}},f=-1,d=e=>{if(!this._domElement||!this._enabled||this.mouseButtons.wheel===R.NONE)return;if(0!==this._interactiveArea.left||0!==this._interactiveArea.top||1!==this._interactiveArea.width||1!==this._interactiveArea.height){let t=this._domElement.getBoundingClientRect(),r=e.clientX/t.width,n=e.clientY/t.height;if(r<this._interactiveArea.left||r>
545this._interactiveArea.right||n<this._interactiveArea.top||n>this._interactiveArea.bottom)return}if(e.preventDefault(),this.dollyToCursor||this.mouseButtons.wheel===R.ROTATE||this.mouseButtons.wheel===R.TRUCK){let e=performance.now();f-e<1e3&&this._getClientRect(this._elementRect),f=e}let t=q?-1:-3,r=1===e.deltaMode?e.deltaY/t:e.deltaY/(10*t),n=this.dollyToCursor?(e.clientX-this._elementRect.x)/this._elementRect.width*2-1:0,i=this.dollyToCursor?-((e.clientY-this._elementRect.y)/this._elementRect.height*2)+1:0;switch(this.mouseButtons.wheel){case R.ROTATE:this._rotateInternal(e.deltaX,e.deltaY),this._isUserControllingRotate=!0;break;case R.TRUCK:this._truckInternal(e.deltaX,e.deltaY,!1),this._isUserControllingTruck=!0;break;case R.OFFSET:this._truckInternal(e.deltaX,e.deltaY,!0),this._isUserControllingOffset=!0;break;case R.DOLLY:this._dollyInternal(-r,n,i),this._isUserControllingDolly=!0;break;case R.ZOOM:this._zoomInternal(-r,n,i),this._isUserControllingZoom=!0}this.dispatchEvent({type:"control"})},p=e=>{if(this._domElement&&this._enabled){if(this.mouseButtons.right===W.ACTION.NONE){let t=e instanceof PointerEvent?e.pointerId:0,r=this._findPointerById(t);r&&this._disposePointer(r),this._domElement.ownerDocument.removeEventListener("pointermove",c,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",h);return}e.preventDefault()}},m=e=>{if(this._enabled){if(Q(this._activePointers,s),this._getClientRect(this._elementRect),r.copy(s),i.copy(s),this._activePointers.length>=2){let e=s.x-this._activePointers[1].clientX,t=s.y-this._activePointers[1].clientY,r=Math.sqrt(e*e+t*t);a.set(0,r);let n=(this._activePointers[0].clientX+this._activePointers[1].clientX)*.5,o=(this._activePointers[0].clientY+this._activePointers[1].clientY)*.5;i.set(n,o)}if(this._state=0,e)if("pointerType"in e&&"touch"===e.pointerType)switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three}else this._lockedPointer||(e.buttons&O.LEFT)!==O.LEFT||(this._state=this._state|this.mouseButtons.left),(e.buttons&O.MIDDLE)===O.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(e.buttons&O.RIGHT)===O.RIGHT&&(this._state=this._state|this.mouseButtons.right);else this._lockedPointer&&(this._state=this._state|this.mouseButtons.left);((this._state&R.ROTATE)===R.ROTATE||(this._state&R.TOUCH_ROTATE)===R.TOUCH_ROTATE||(this._state&R.TOUCH_DOLLY_ROTATE)===R.TOUCH_DOLLY_ROTATE||(this._state&R.TOUCH_ZOOM_ROTATE)===R.TOUCH_ZOOM_ROTATE)&&(this._sphericalEnd.theta=this._spherical.theta,this._sphericalEnd.phi=this._spherical.phi,this._thetaVelocity.value=0,this._phiVelocity.value=0),((this._state&R.TRUCK)===R.TRUCK||(this._state&R.TOUCH_TRUCK)===R.TOUCH_TRUCK||(this._state&R.TOUCH_DOLLY_TRUCK)===R.TOUCH_DOLLY_TRUCK||(this._state&R.TOUCH_ZOOM_TRUCK)===R.TOUCH_ZOOM_TRUCK)&&(this._targetEnd.copy(this._target),this._targetVelocity.set(0,0,0)),((this._state&R.DOLLY)===R.DOLLY||(this._state&R.TOUCH_DOLLY)===R.TOUCH_DOLLY||(this._state&R.TOUCH_DOLLY_TRUCK)===R.TOUCH_DOLLY_TRUCK||(this._state&R.TOUCH_DOLLY_OFFSET)===R.TOUCH_DOLLY_OFFSET||(this._state&R.TOUCH_DOLLY_ROTATE)===R.TOUCH_DOLLY_ROTATE)&&(this._sphericalEnd.radius=this._spherical.radius,this._radiusVelocity.value=0),((this._state&R.ZOOM)===R.ZOOM||(this._state&R.TOUCH_ZOOM)===R.TOUCH_ZOOM||(this._state&R.TOUCH_ZOOM_TRUCK)===R.TOUCH_ZOOM_TRUCK||(this._state&R.TOUCH_ZOOM_OFFSET)===R.TOUCH_ZOOM_OFFSET||(this._state&R.TOUCH_ZOOM_ROTATE)===R.TOUCH_ZOOM_ROTATE)&&(this._zoomEnd=this._zoom,this._zoomVelocity.value=0),((this._state&R.OFFSET)===R.OFFSET||(this._state&R.TOUCH_OFFSET)===R.TOUCH_OFFSET||(this._state&R.TOUCH_DOLLY_OFFSET)===R.TOUCH_DOLLY_OFFSET||(this._state&R.TOUCH_ZOOM_OFFSET)===R.TOUCH_ZOOM_OFFSET)&&(this._focalOffsetEnd.copy(this._focalOffset),this._focalOffsetVelocity.set(0,0,0)),this.dispatchEvent({type:"controlstart"})}},g=()=>{if(!this._enabled||!this._dragNeedsUpdate)return;this._dragNeedsUpdate=!1,Q(this._activePointers,s);let e=this._domElement&&this._domElement.ownerDocument.pointerLockElement===this._domElement?this._lockedPointer||this._activePointers[0]:null,t=e?-e.deltaX:i.x-s.x,n=e?-e.deltaY:i.y-s.y;if(i.copy(s),((this._state&R.ROTATE)===R.ROTATE||(this._state&R.TOUCH_ROTATE)===R.TOUCH_ROTATE||(this._state&R.TOUCH_DOLLY_ROTATE)===R.TOUCH_DOLLY_ROTATE||(this._state&R.TOUCH_ZOOM_ROTATE)===R.TOUCH_ZOOM_ROTATE)&&(this._rotateInternal(t,n),this._isUserControllingRotate=!0),(this._state&R.DOLLY)===R.DOLLY||(this._state&R.ZOOM)===R.ZOOM){let e=this.dollyToCursor?(r.x-this._elementRect.x)/this._elementRect.width*2-1:0,t=this.dollyToCursor?-((r.y-this._elementRect.y)/this._elementRect.height*2)+1:0,i=this.dollyDragInverted?-1:1;(this._state&R.DOLLY)===R.DOLLY?(this._dollyInternal(i*n*Z,e,t),this._isUserControllingDolly=!0):(this._zoomInternal(i*n*Z,e,t),this._isUserControllingZoom=!0)}if((this._state&R.TOUCH_DOLLY)===R.TOUCH_DOLLY||(this._state&R.TOUCH_ZOOM)===R.TOUCH_ZOOM||(this._state&R.TOUCH_DOLLY_TRUCK)===R.TOUCH_DOLLY_TRUCK||(this._state&R.TOUCH_ZOOM_TRUCK)===R.TOUCH_ZOOM_TRUCK||(this._state&R.TOUCH_DOLLY_OFFSET)===R.TOUCH_DOLLY_OFFSET||(this._state&R.TOUCH_ZOOM_OFFSET)===R.TOUCH_ZOOM_OFFSET||(this._state&R.TOUCH_DOLLY_ROTATE)===R.TOUCH_DOLLY_ROTATE||(this._state&R.TOUCH_ZOOM_ROTATE)===R.TOUCH_ZOOM_ROTATE){let e=s.x-this._activePointers[1].clientX,t=s.y-this._activePointers[1].clientY,r=Math.sqrt(e*e+t*t),n=a.y-r;a.set(0,r);let o=this.dollyToCursor?(i.x-this._elementRect.x)/this._elementRect.width*2-1:0,l=this.dollyToCursor?-((i.y-this._elementRect.y)/this._elementRect.height*2)+1:0;(this._state&R.TOUCH_DOLLY)===R.TOUCH_DOLLY||(this._state&R.TOUCH_DOLLY_ROTATE)===R.TOUCH_DOLLY_ROTATE||(this._state&R.TOUCH_DOLLY_TRUCK)===R.TOUCH_DOLLY_TRUCK||(this._state&R.TOUCH_DOLLY_OFFSET)===R.TOUCH_DOLLY_OFFSET?(this._dollyInternal(n*Z,o,l),this._isUserControllingDolly=!0):(this._zoomInternal(n*Z,o,l),this._isUserControllingZoom=!0)}((this._state&R.TRUCK)===R.TRUCK||(this._state&R.TOUCH_TRUCK)===R.TOUCH_TRUCK||(this._state&R.TOUCH_DOLLY_TRUCK)===R.TOUCH_DOLLY_TRUCK||(this._state&R.TOUCH_ZOOM_TRUCK)===R.TOUCH_ZOOM_TRUCK)&&(this._truckInternal(t,n,!1),this._isUserControllingTruck=!0),((this._state&R.OFFSET)===R.OFFSET||(this._state&R.TOUCH_OFFSET)===R.TOUCH_OFFSET||(this._state&R.TOUCH_DOLLY_OFFSET)===R.TOUCH_DOLLY_OFFSET||(this._state&R.TOUCH_ZOOM_OFFSET)===R.TOUCH_ZOOM_OFFSET)&&(this._truckInternal(t,n,!0),this._isUserControllingOffset=!0),this.dispatchEvent({type:"control"})},v=()=>{Q(this._activePointers,s),i.copy(s),this._dragNeedsUpdate=!1,(0===this._activePointers.length||1===this._activePointers.length&&this._activePointers[0]===this._lockedPointer)&&(this._isDragging=!1),0===this._activePointers.length&&this._domElement&&(this._domElement.ownerDocument.removeEventListener("pointermove",c,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",h),this.dispatchEvent({type:"controlend"}))};this.lockPointer=()=>{this._enabled&&this._domElement&&(this.cancel(),this._lockedPointer={pointerId:-1,clientX:0,clientY:0,deltaX:0,deltaY:0,mouseButton:null},this._activePointers.push(this._lockedPointer),this._domElement.ownerDocument.removeEventListener("pointermove",c,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",h),this._domElement.requestPointerLock(),this._domElement.ownerDocument.addEventListener("pointerlockchange",y),this._domElement.ownerDocument.addEventListener("pointerlockerror",A),this._domElement.ownerDocument.addEventListener("pointermove",c,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",h),m())},this.unlockPointer=()=>{var e,t,r;null!==this._lockedPointer&&(this._disposePointer(this._lockedPointer),this._lockedPointer=null),null==(e=this._domElement)||e.ownerDocument.exitPointerLock(),null==(t=this._domElement)||t.ownerDocument.removeEventListener("pointerlockchange",y),null==(r=this._domElement)||r.ownerDocument.removeEventListener("pointerlockerror",A),this.cancel()};let y=()=>{this._domElement&&this._domElement.ownerDocument.pointerLockElement===this._domElement||this.unlockPointer()},A=()=>{this.unlockPointer()};this._addAllEventListeners=e=>{this._domElement=e,this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none",this._domElement.addEventListener("pointerdown",u),this._domElement.addEventListener("pointercancel",h),this._domElement.addEventListener("wheel",d,{passive:!1}),this._domElement.addEventListener("contextmenu",p)},this._removeAllEventListeners=()=>{this._domElement&&(this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect="",this._domElement.removeEventListener("pointerdown",u),this._domElement.removeEventListener("pointercancel",h),this._domElement.removeEventListener("wheel",d,{passive:!1}),this._domElement.removeEventListener("contextmenu",p),this._domElement.ownerDocument.removeEventListener("pointermove",c,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",h),this._domElement.ownerDocument.removeEventListener("pointerlockchange",y),this._domElement.ownerDocument.removeEventListener("pointerlockerror",A))},this.cancel=()=>{this._state!==R.NONE&&(this._state=R.NONE,this._activePointers.length=0,v())},t&&this.connect(t),this.update(0)}get camera(){return this._camera}set camera(e){this._camera=e,this.updateCameraUp(),this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this._domElement&&(e?(this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none"):(this.cancel(),this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect=""))}get active(){return!this._hasRested}get currentAction(){return this._state}
vendor: 7,367 bytes, line 545
545get distance(){return this._spherical.radius}set distance(e){(this._spherical.radius!==e||this._sphericalEnd.radius!==e)&&(this._spherical.radius=e,this._sphericalEnd.radius=e,this._needsUpdate=!0)}get azimuthAngle(){return this._spherical.theta}set azimuthAngle(e){(this._spherical.theta!==e||this._sphericalEnd.theta!==e)&&(this._spherical.theta=e,this._sphericalEnd.theta=e,this._needsUpdate=!0)}get polarAngle(){return this._spherical.phi}set polarAngle(e){(this._spherical.phi!==e||this._sphericalEnd.phi!==e)&&(this._spherical.phi=e,this._sphericalEnd.phi=e,this._needsUpdate=!0)}get boundaryEnclosesCamera(){return this._boundaryEnclosesCamera}set boundaryEnclosesCamera(e){this._boundaryEnclosesCamera=e,this._needsUpdate=!0}set interactiveArea(e){this._interactiveArea.width=U(e.width,0,1),this._interactiveArea.height=U(e.height,0,1),this._interactiveArea.x=U(e.x,0,1-this._interactiveArea.width),this._interactiveArea.y=U(e.y,0,1-this._interactiveArea.height)}addEventListener(e,t){super.addEventListener(e,t)}removeEventListener(e,t){super.removeEventListener(e,t)}rotate(e,t,r=!1){return this.rotateTo(this._sphericalEnd.theta+e,this._sphericalEnd.phi+t,r)}rotateAzimuthTo(e,t=!1){return this.rotateTo(e,this._sphericalEnd.phi,t)}rotatePolarTo(e,t=!1){return this.rotateTo(this._sphericalEnd.theta,e,t)}rotateTo(e,t,r=!1){this._isUserControllingRotate=!1;let n=U(e,this.minAzimuthAngle,this.maxAzimuthAngle),i=U(t,this.minPolarAngle,this.maxPolarAngle);this._sphericalEnd.theta=n,this._sphericalEnd.phi=i,this._sphericalEnd.makeSafe(),this._needsUpdate=!0,r||(this._spherical.theta=this._sphericalEnd.theta,this._spherical.phi=this._sphericalEnd.phi);let o=!r||N(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&N(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold);return this._createOnRestPromise(o)}dolly(e,t=!1){return this.dollyTo(this._sphericalEnd.radius-e,t)}dollyTo(e,t=!1){return this._isUserControllingDolly=!1,this._lastDollyDirection=I.NONE,this._changedDolly=0,this._dollyToNoClamp(U(e,this.minDistance,this.maxDistance),t)}_dollyToNoClamp(e,t=!1){let r=this._sphericalEnd.radius;if(this.colliderMeshes.length>=1){let t=this._collisionTest(),n=N(t,this._spherical.radius);if(!(r>e)&&n)return Promise.resolve();this._sphericalEnd.radius=Math.min(e,t)}else this._sphericalEnd.radius=e;this._needsUpdate=!0,t||(this._spherical.radius=this._sphericalEnd.radius);let n=!t||N(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(n)}dollyInFixed(e,t=!1){this._targetEnd.add(this._getCameraDirection(h).multiplyScalar(e)),t||this._target.copy(this._targetEnd);let r=!t||N(this._target.x,this._targetEnd.x,this.restThreshold)&&N(this._target.y,this._targetEnd.y,this.restThreshold)&&N(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(r)}zoom(e,t=!1){return this.zoomTo(this._zoomEnd+e,t)}zoomTo(e,t=!1){this._isUserControllingZoom=!1,this._zoomEnd=U(e,this.minZoom,this.maxZoom),this._needsUpdate=!0,t||(this._zoom=this._zoomEnd);let r=!t||N(this._zoom,this._zoomEnd,this.restThreshold);return this._changedZoom=0,this._createOnRestPromise(r)}pan(e,t,r=!1){return console.warn("`pan` has been renamed to `truck`"),this.truck(e,t,r)}truck(e,t,r=!1){this._camera.updateMatrix(),f.setFromMatrixColumn(this._camera.matrix,0),d.setFromMatrixColumn(this._camera.matrix,1),f.multiplyScalar(e),d.multiplyScalar(-t);let n=l.copy(f).add(d),i=u.copy(this._targetEnd).add(n);return this.moveTo(i.x,i.y,i.z,r)}forward(e,t=!1){l.setFromMatrixColumn(this._camera.matrix,0),l.crossVectors(this._camera.up,l),l.multiplyScalar(e);let r=u.copy(this._targetEnd).add(l);return this.moveTo(r.x,r.y,r.z,t)}elevate(e,t=!1){return l.copy(this._camera.up).multiplyScalar(e),this.moveTo(this._targetEnd.x+l.x,this._targetEnd.y+l.y,this._targetEnd.z+l.z,t)}moveTo(e,t,r,n=!1){this._isUserControllingTruck=!1;let i=l.set(e,t,r).sub(this._targetEnd);this._encloseToBoundary(this._targetEnd,i,this.boundaryFriction),this._needsUpdate=!0,n||this._target.copy(this._targetEnd);let o=!n||N(this._target.x,this._targetEnd.x,this.restThreshold)&&N(this._target.y,this._targetEnd.y,this.restThreshold)&&N(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(o)}lookInDirectionOf(e,t,r,n=!1){let i=l.set(e,t,r).sub(this._targetEnd).normalize().multiplyScalar(-this._sphericalEnd.radius).add(this._targetEnd);return this.setPosition(i.x,i.y,i.z,n)}fitToBox(e,t,{cover:r=!1,paddingLeft:n=0,paddingRight:i=0,paddingBottom:s=0,paddingTop:c=0}={}){let h=[],f=e.isBox3?A.copy(e):A.setFromObject(e);f.isEmpty()&&(console.warn("camera-controls: fitTo() cannot be used with an empty box. Aborting"),Promise.resolve());let d=j(this._sphericalEnd.theta,L),p=j(this._sphericalEnd.phi,L);h.push(this.rotateTo(d,p,t));let m=l.setFromSpherical(this._sphericalEnd).normalize(),g=B.setFromUnitVectors(m,a),v=N(Math.abs(m.y),1);v&&g.multiply(x.setFromAxisAngle(o,d)),g.multiply(this._yAxisUpSpaceInverse);let y=_.makeEmpty();u.copy(f.min).applyQuaternion(g),y.expandByPoint(u),u.copy(f.min).setX(f.max.x).applyQuaternion(g),y.expandByPoint(u),u.copy(f.min).setY(f.max.y).applyQuaternion(g),y.expandByPoint(u),u.copy(f.max).setZ(f.min.z).applyQuaternion(g),y.expandByPoint(u),u.copy(f.min).setZ(f.max.z).applyQuaternion(g),y.expandByPoint(u),u.copy(f.max).setY(f.min.y).applyQuaternion(g),y.expandByPoint(u),u.copy(f.max).setX(f.min.x).applyQuaternion(g),y.expandByPoint(u),u.copy(f.max).applyQuaternion(g),y.expandByPoint(u),y.min.x-=n,y.min.y-=s,y.max.x+=i,y.max.y+=c,g.setFromUnitVectors(a,m),v&&g.premultiply(x.invert()),g.premultiply(this._yAxisUpSpace);let b=y.getSize(l),C=y.getCenter(u).applyQuaternion(g);if(P(this._camera)){let e=this.getDistanceToFitBox(b.x,b.y,b.z,r);h.push(this.moveTo(C.x,C.y,C.z,t)),h.push(this.dollyTo(e,t)),h.push(this.setFocalOffset(0,0,0,t))}else if(D(this._camera)){let e=this._camera,n=e.right-e.left,i=e.top-e.bottom,o=r?Math.max(n/b.x,i/b.y):Math.min(n/b.x,i/b.y);h.push(this.moveTo(C.x,C.y,C.z,t)),h.push(this.zoomTo(o,t)),h.push(this.setFocalOffset(0,0,0,t))}return Promise.all(h)}fitToSphere(e,t){let r=[],n="isObject3D"in e?W.createBoundingSphere(e,b):b.copy(e);if(r.push(this.moveTo(n.center.x,n.center.y,n.center.z,t)),P(this._camera)){let e=this.getDistanceToFitSphere(n.radius);r.push(this.dollyTo(e,t))}else if(D(this._camera)){let e=this._camera.right-this._camera.left,i=this._camera.top-this._camera.bottom,o=2*n.radius,a=Math.min(e/o,i/o);r.push(this.zoomTo(a,t))}return r.push(this.setFocalOffset(0,0,0,t)),Promise.all(r)}setLookAt(e,t,r,n,i,o,a=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=I.NONE,this._changedDolly=0;let s=u.set(n,i,o),c=l.set(e,t,r);this._targetEnd.copy(s),this._sphericalEnd.setFromVector3(c.sub(s).applyQuaternion(this._yAxisUpSpace)),this.normalizeRotations(),this._needsUpdate=!0,a||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));let h=!a||N(this._target.x,this._targetEnd.x,this.restThreshold)&&N(this._target.y,this._targetEnd.y,this.restThreshold)&&N(this._target.z,this._targetEnd.z,this.restThreshold)&&N(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&N(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&N(this._spherical.radiu
545s,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(h)}lerpLookAt(e,t,r,n,i,o,a,s,h,f,d,p,m,g=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=I.NONE,this._changedDolly=0;let A=l.set(n,i,o),_=u.set(e,t,r);v.setFromVector3(_.sub(A).applyQuaternion(this._yAxisUpSpace));let b=c.set(f,d,p),B=u.set(a,s,h);y.setFromVector3(B.sub(b).applyQuaternion(this._yAxisUpSpace)),this._targetEnd.copy(A.lerp(b,m));let x=y.theta-v.theta,C=y.phi-v.phi,w=y.radius-v.radius;this._sphericalEnd.set(v.radius+w*m,v.phi+C*m,v.theta+x*m),this.normalizeRotations(),this._needsUpdate=!0,g||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));let E=!g||N(this._target.x,this._targetEnd.x,this.restThreshold)&&N(this._target.y,this._targetEnd.y,this.restThreshold)&&N(this._target.z,this._targetEnd.z,this.restThreshold)&&N(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&N(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&N(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(E)}setPosition(e,t,r,n=!1){return this.setLookAt(e,t,r,this._targetEnd.x,this._targetEnd.y,this._targetEnd.z,n)}setTarget(e,t,r,n=!1){let i=this.getPosition(l),o=this.setLookAt(i.x,i.y,i.z,e,t,r,n);return this._sphericalEnd.phi=U(this._sphericalEnd.phi,this.minPolarAngle,this.maxPolarAngle),o}setFocalOffset(e,t,r,n=!1){this._isUserControllingOffset=!1,this._focalOffsetEnd.set(e,t,r),this._needsUpdate=!0,n||this._focalOffset.copy(this._focalOffsetEnd);let i=!n||N(this._focalOffset.x,this._focalOffsetEnd.x,this.restThreshold)&&N(this._focalOffset.y,this._focalOffsetEnd.y,this.restThreshold)&&N(this._focalOffset.z,this._focalOffsetEnd.z,this.restThreshold);return this._createOnRestPromise(i)}setOrbitPoint(e,t,r){this._camera.updateMatrixWorld(),f.setFromMatrixColumn(this._camera.matrixWorldInverse,0),d.setFromMatrixColumn(this._camera.matrixWorldInverse,1),p.setFromMatrixColumn(this._camera.matrixWorldInverse,2);let n=l.set(e,t,r),i=n.distanceTo(this._camera.position),o=n.sub(this._camera.position);f.multiplyScalar(o.x),d.multiplyScalar(o.y),p.multiplyScalar(o.z),l.copy(f).add(d).add(p),l.z=l.z+i,this.dollyTo(i,!1),this.setFocalOffset(-l.x,l.y,-l.z,!1),this.moveTo(e,t,r,!1)}setBoundary(e){if(!e){this._boundary.min.set(-1/0,-1/0,-1/0),this._boundary.max.set(1/0,1/0,1/0),this._needsUpdate=!0;return}this._boundary.copy(e),this._boundary.clampPoint(this._targetEnd,this._targetEnd),this._needsUpdate=!0}setViewport(e,t,r,i){if(null===e){this._viewport=null;return}this._viewport=this._viewport||new n.Vector4,"number"==typeof e?this._viewport.set(e,t,r,i):this._viewport.copy(e)}getDistanceToFitBox(e,t,r,n=!1){if(X(this._camera,"getDistanceToFitBox"))return this._spherical.radius;let i=e/t,o=this._camera.getEffectiveFOV()*G,a=this._camera.aspect;return .5*((n?i>a:i<a)?t:e/a)/Math.tan(.5*o)+.5*r}getDistanceToFitSphere(e){if(X(this._camera,"getDistanceToFitSphere"))return this._spherical.radius;let t=this._camera.getEffectiveFOV()*G,r=2*Math.atan(Math.tan(.5*t)*this._camera.aspect);return e/Math.sin(.5*(1<this._camera.aspect?t:r))}getTarget(e,t=!0){return(e&&e.isVector3?e:new n.Vector3).copy(t?this._targetEnd:this._target)}getPosition(e,t=!0){return(e&&e.isVector3?e:new n.Vector3).setFromSpherical(t?this._sphericalEnd:this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(t?this._targetEnd:this._target)}getSpherical(e,t=!0){return(e||new n.Spherical).copy(t?this._sphericalEnd:this._spherical)}getFocalOffset(e,t=!0){return(e&&e.isVector3?e:new n.Vector3).copy(t?this._focalOffsetEnd:this._focalOffset)}normalizeRotations(){this._sphericalEnd.theta=this._sphericalEnd.theta%H,this._sphericalEnd.theta<0&&(this._sphericalEnd.theta+=H),this._spherical.theta+=H*Math.round((this._sphericalEnd.theta-this._spherical.theta)/H)}reset(e=!1){if(!N(this._camera.up.x,this._cameraUp0.x)||!N(this._camera.up.y,this._cameraUp0.y)||!N(this._camera.up.z,this._cameraUp0.z)){this._camera.up.copy(this._cameraUp0);let e=this.getPosition(l);this.updateCameraUp(),this.setPosition(e.x,e.y,e.z)}return Promise.all([this.setLookAt(this._position0.x,this._position0.y,this._position0.z,this._target0.x,this._target0.y,this._target0.z,e),this.setFocalOffset(this._focalOffset0.x,this._focalOffset0.y,this._focalOffset0.z,e),this.zoomTo(this._zoom0,e)]
vendor: 4,101 bytes, line 545
545)}saveState(){this._cameraUp0.copy(this._camera.up),this.getTarget(this._target0),this.getPosition(this._position0),this._zoom0=this._zoom,this._focalOffset0.copy(this._focalOffset)}updateCameraUp(){this._yAxisUpSpace.setFromUnitVectors(this._camera.up,o),this._yAxisUpSpaceInverse.copy(this._yAxisUpSpace).invert()}applyCameraUp(){let e=l.subVectors(this._target,this._camera.position).normalize(),t=u.crossVectors(e,this._camera.up);this._camera.up.crossVectors(t,e).normalize(),this._camera.updateMatrixWorld();let r=this.getPosition(l);this.updateCameraUp(),this.setPosition(r.x,r.y,r.z)}update(e){let t=this._sphericalEnd.theta-this._spherical.theta,r=this._sphericalEnd.phi-this._spherical.phi,n=this._sphericalEnd.radius-this._spherical.radius,i=m.subVectors(this._targetEnd,this._target),o=g.subVectors(this._focalOffsetEnd,this._focalOffset),a=this._zoomEnd-this._zoom;if(k(t))this._thetaVelocity.value=0,this._spherical.theta=this._sphericalEnd.theta;else{let t=this._isUserControllingRotate?this.draggingSmoothTime:this.smoothTime;this._spherical.theta=K(this._spherical.theta,this._sphericalEnd.theta,this._thetaVelocity,t,1/0,e),this._needsUpdate=!0}if(k(r))this._phiVelocity.value=0,this._spherical.phi=this._sphericalEnd.phi;else{let t=this._isUserControllingRotate?this.draggingSmoothTime:this.smoothTime;this._spherical.phi=K(this._spherical.phi,this._sphericalEnd.phi,this._phiVelocity,t,1/0,e),this._needsUpdate=!0}if(k(n))this._radiusVelocity.value=0,this._spherical.radius=this._sphericalEnd.radius;else{let t=this._isUserControllingDolly?this.draggingSmoothTime:this.smoothTime;this._spherical.radius=K(this._spherical.radius,this._sphericalEnd.radius,this._radiusVelocity,t,this.maxSpeed,e),this._needsUpdate=!0}if(k(i.x)&&k(i.y)&&k(i.z))this._targetVelocity.set(0,0,0),this._target.copy(this._targetEnd);else{let t=this._isUserControllingTruck?this.draggingSmoothTime:this.smoothTime;V(this._target,this._targetEnd,this._targetVelocity,t,this.maxSpeed,e,this._target),this._needsUpdate=!0}if(k(o.x)&&k(o.y)&&k(o.z))this._focalOffsetVelocity.set(0,0,0),this._focalOffset.copy(this._focalOffsetEnd);else{let t=this._isUserControllingOffset?this.draggingSmoothTime:this.smoothTime;V(this._focalOffset,this._focalOffsetEnd,this._focalOffsetVelocity,t,this.maxSpeed,e,this._focalOffset),this._needsUpdate=!0}if(k(a))this._zoomVelocity.value=0,this._zoom=this._zoomEnd;else{let t=this._isUserControllingZoom?this.draggingSmoothTime:this.smoothTime;this._zoom=K(this._zoom,this._zoomEnd,this._zoomVelocity,t,1/0,e)}if(this.dollyToCursor){if(P(this._camera)&&0!==this._changedDolly){let e=this._spherical.radius-this._lastDistance,t=this._camera,r=this._getCameraDirection(h),n=l.copy(r).cross(t.up).normalize();0===n.lengthSq()&&(n.x=1);let i=u.crossVectors(n,r),o=this._sphericalEnd.radius*Math.tan(t.getEffectiveFOV()*G*.5),a=(this._sphericalEnd.radius-e-this._sphericalEnd.radius)/this._sphericalEnd.radius,s=c.copy(this._targetEnd).add(n.multiplyScalar(this._dollyControlCoord.x*o*t.aspect)).add(i.multiplyScalar(this._dollyControlCoord.y*o)),f=l.copy(this._targetEnd).lerp(s,a),d=this._lastDollyDirection===I.IN&&this._spherical.radius<=this.minDistance,p=this._lastDollyDirection===I.OUT&&this.maxDistance<=this._spherical.radius;if(this.infinityDolly&&(d||p)){this._sphericalEnd.radius-=e,this._spherical.radius-=e;let t=u.copy(r).multiplyScalar(-e);f.add(t)}this._boundary.clampPoint(f,f);let m=u.subVectors(f,this._targetEnd);this._targetEnd.copy(f),this._target.add(m),this._changedDolly-=e,k(this._changedDolly)&&(this._changedDolly=0)}else if(D(this._camera)&&0!==this._changedZoom){let e=this._zoom-this._lastZoom,t=this._camera,r=l.set(this._dollyControlCoord.x,this._dollyControlCoord.y,(t.near+t.far)/(t.near-t.far)).unproject(t),n=u.set(0,0,-1).applyQuaternion(t.quaternion),i=c.copy(r).add(n.multiplyScalar(-r.dot(t.up))),o=-(this._zoom-e-this._zoom)/this._zoom,a=this._getCameraDirection(h),s=this._targetEnd.dot(a),f=l.copy(this._targetEnd).lerp(i,o),d=f.dot(a),p=a.multiplyScalar(d-s);f.sub(p),this._boundary.clampPoint(f,f);let m=u.subVectors(f,this._targetEnd);
545this._targetEnd.copy(f),this._target.add(m),this._changedZoom-=e,k(this._changedZoom)&&(this._changedZoom=0)}}this._camera.zoom!==this._zoom&&(this._camera.zoom=this._zoom,this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0),this._dragNeedsUpdate=!0;let s=this._collisionTest();this._spherical.radius=Math.min(this._spherical.radius,s),this._spherical.makeSafe(),this._camera.position.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(this._target),this._camera.lookAt(this._target),k(this._focalOffset.x)&&k(this._focalOffset.y)&&k(this._focalOffset.z)||(this._camera.updateMatrixWorld(),f.setFromMatrixColumn(this._camera.matrix,0),d.setFromMatrixColumn(this._camera.matrix,1),p.setFromMatrixColumn(this._camera.matrix,2),f.multiplyScalar(this._focalOffset.x),d.multiplyScalar(-this._focalOffset.y),p.multiplyScalar(this._focalOffset.z),l.copy(f).add(d).add(p),this._camera.position.add(l)),this._boundaryEnclosesCamera&&this._encloseToBoundary(this._camera.position.copy(this._target),l.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse),1);let v=this._needsUpdate;return v&&!this._updatedLastTime?(this._hasRested=!1,this.dispatchEvent({type:"wake"}),this.dispatchEvent({type:"update"})):v?(this.dispatchEvent({type:"update"}),k(t,this.restThreshold)&&k(r,this.restThreshold)&&k(n,this.restThreshold)&&k(i.x,this.restThreshold)&&k(i.y,this.restThreshold)&&k(i.z,this.restThreshold)&&k(o.x,this.restThreshold)&&k(o.y,this.restThreshold)&&k(o.z,this.restThreshold)&&k(a,this.restThreshold)&&!this._hasRested&&(this._hasRested=!0,this.dispatchEvent({type:"rest"}))):!v&&this._updatedLastTime&&this.dispatchEvent({type:"sleep"}),this._lastDistance=this._spherical.radius,this._lastZoom=this._zoom,this._updatedLastTime=v,this._needsUpdate=!1,v}toJSON(){return JSON.stringify({enabled:this._enabled,minDistance:this.minDistance,maxDistance:J(this.maxDistance),minZoom:this.minZoom,maxZoom:J(this.maxZoom),minPolarAngle:this.minPolarAngle,maxPolarAngle:J(this.maxPolarAngle),minAzimuthAngle:J(this.minAzimuthAngle),maxAzimuthAngle:J(this.maxAzimuthAngle),smoothTime:this.smoothTime,draggingSmoothTime:this.draggingSmoothTime,dollySpeed:this.dollySpeed,truckSpeed:this.truckSpeed,dollyToCursor:this.dollyToCursor,verticalDragToForward:this.verticalDragToForward,target:this._targetEnd.toArray(),position:l.setFromSpherical(this._sphericalEnd).add(this._targetEnd).toArray(),zoom:this._zoomEnd,focalOffset:this._focalOffsetEnd.toArray(),target0:this._target0.toArray(),position0:this._position0.toArray(),zoom0:this._zoom0,focalOffset0:this._focalOffset0.toArray()})}fromJSON(e,t=!1){let r=JSON.parse(e);this.enabled=r.enabled,this.minDistance=r.minDistance,this.maxDistance=z(r.maxDistance),this.minZoom=r.minZoom,this.maxZoom=z(r.maxZoom),this.minPolarAngle=r.minPolarAngle,this.maxPolarAngle=z(r.maxPolarAngle),this.minAzimuthAngle=z(r.minAzimuthAngle),this.maxAzimuthAngle=z(r.maxAzimuthAngle),this.smoothTime=r.smoothTime,this.draggingSmoothTime=r.draggingSmoothTime,this.dollySpeed=r.dollySpeed,this.truckSpeed=r.truckSpeed,this.dollyToCursor=r.dollyToCursor,this.verticalDragToForward=r.verticalDragToForward,this._target0.fromArray(r.target0),this._position0.fromArray(r.position0),this._zoom0=r.zoom0,this._focalOffset0.fromArray(r.focalOffset0),this.moveTo(r.target[0],r.target[1],r.target[2],t),v.setFromVector3(l.fromArray(r.position).sub(this._targetEnd).applyQuaternion(this._yAxisUpSpace)),this.rotateTo(v.theta,v.phi,t),this.dollyTo(v.radius,t),this.zoomTo(r.zoom,t),this.setFocalOffset(r.focalOffset[0],r.focalOffset[1],r.focalOffset[2],t),this._needsUpdate=!0}connect(e){if(this._domElement)return void console.warn("camera-controls is already connected.");e.setAttribute("data-camera-controls-version","2.8.5"),this._addAllEventListeners(e),this._getClientRect(this._elementRect)}disconnect(){this.cancel(),this._removeAllEventListeners(),this._domElement&&(this._domElement.removeAttribute("data-camera-controls-version"),this._domElement=void 0)}dispose(){this.removeAllEventListeners(),this.disconnect()}_getTargetDirection(e){return e.setFromSpherical(this._spherical).divideScalar(this._spherical.radiu
545s).applyQuaternion(this._yAxisUpSpaceInverse)}_getCameraDirection(e){return this._getTargetDirection(e).negate()}_findPointerById(e){return this._activePointers.find(t=>t.pointerId===e)}_findPointerByMouseButton(e){return this._activePointers.find(t=>t.mouseButton===e)}_disposePointer(e){this._activePointers.splice(this._activePointers.indexOf(e),1)}_encloseToBoundary(e,t,r){let n=t.lengthSq();if(0===n)return e;let i=u.copy(t).add(e),o=this._boundary.clampPoint(i,c).sub(i),a=o.lengthSq();if(0===a)return e.add(t);{if(a===n)return e;if(0===r)return e.add(t).add(o);let i=1+r*a/t.dot(o);return e.add(u.copy(t).multiplyScalar(i)).add(o.multiplyScalar(1-r))}}_updateNearPlaneCorners(){if(P(this._camera)){let e=this._camera,t=e.near,r=Math.tan(.5*(e.getEffectiveFOV()*G))*t,n=r*e.aspect;this._nearPlaneCorners[0].set(-n,-r,0),this._nearPlaneCorners[1].set(n,-r,0),this._nearPlaneCorners[2].set(n,r,0),this._nearPlaneCorners[3].set(-n,r,0)}else if(D(this._camera)){let e=this._camera,t=1/e.zoom,r=e.left*t,n=e.right*t,i=e.top*t,o=e.bottom*t;this._nearPlaneCorners[0].set(r,i,0),this._nearPlaneCorners[1].set(n,i,0),this._nearPlaneCorners[2].set(n,o,0),this._nearPlaneCorners[3].set(r,o,0)}}_collisionTest(){let e=1/0;if(!(this.colliderMeshes.length>=1)||X(this._camera,"_collisionTest"))return e;let t=this._getTargetDirection(h);C.lookAt(i,t,this._camera.up);for(let r=0;r<4;r++){let n=u.copy(this._nearPlaneCorners[r]);n.applyMatrix4(C);let i=c.addVectors(this._target,n);w.set(i,t),w.far=this._spherical.radius+1;let o=w.intersectObjects(this.colliderMeshes);0!==o.length&&o[0].distance<e&&(e=o[0].distance)}return e}_getClientRect(e){if(!this._domElement)return;let t=this._domElement.getBoundingClientRect();return e.x=t.left,e.y=t.top,this._viewport?(e.x+=this._viewport.x,e.y+=t.height-this._viewport.w-this._viewport.y,e.width=this._viewport.z,e.height=this._viewport.w):(e.width=t.width,e.height=t.height),e}_createOnRestPromise(e){return e?Promise.resolve():(this._hasRested=!1,this.dispatchEvent({type:"transitionstart"}),new Promise(e=>{let t=()=>{this.removeEventListener("rest",t),e()};this.addEventListener("rest",t)}))}_addAllEventListeners(e){}_removeAllEventListeners(){}get dampingFactor(){return console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead."),0}set dampingFactor(e){console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead.")}get draggingDampingFactor(){return console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead."),0}set draggingDampingFactor(e){console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead.")}static createBoundingSphere(e,t=new n.Sphere){let r=t.center;A.makeEmpty(),e.traverseVisible(e=>{e.isMesh&&A.expandByObject(e)}),A.getCenter(r);let i=0;return e.traverseVisible(e=>{if(!e.isMesh)return;let t=e.geometry.clone();t.applyMatrix4(e.matrixWorld);let n=t.attributes.position;for(let e=0,t=n.count;e<t;e++)l.fromBufferAttribute(n,e),i=Math.max(i,r.distanceToSquared(l))}),t.radius=Math.sqrt(i),t}}let $=(0,F.forwardRef)((e,t)=>{(0,F.useMemo)(()=>{let e={Box3:T.Box3,MathUtils:{clamp:T.MathUtils.clamp},Matrix4:T.Matrix4,Quaternion:T.Quaternion,Raycaster:T.Raycaster,Sphere:T.Sphere,Spherical:T.Spherical,Vector2:T.Vector2,Vector3:T.Vector3,Vector4:T.Vector4};W.install({THREE:e}),(0,S.e)({CameraControlsImpl:W})},[]);let{camera:r,domElement:n,makeDefault:i,onStart:o,onEnd:a,onChange:s,regress:l,...u}=e,c=(0,S.A)(e=>e.camera),h=(0,S.A)(e=>e.gl),f=(0,S.A)(e=>e.invalidate),d=(0,S.A)(e=>e.events),p=(0,S.A)(e=>e.setEvents),m=(0,S.A)(e=>e.set),g=(0,S.A)(e=>e.get),v=(0,S.A)(e=>e.performance),y=r||c,A=n||d.connected||h.domElement,_=(0,F.useMemo)(()=>new W(y),[y]);return(0,S.C)((e,t)=>{_.enabled&&_.update(t)},-1),(0,F.useEffect)(()=>(_.connect(A),()=>void _.disconnect()),[A,_]),(0,F.useEffect)(()=>{let e=e=>{f(),l&&v.regress(),s&&s(e)},t=e=>{o&&o(e)},r=e=>{a&&a(e)};return _.addEventListener("update",e),_.addEventListener("controlstart",t),_.addEventListener("controlend",r),_.addEventListener("control",e),_.addEventListener("transitionstart",e),_.addEventListener("wake",e),()=>{_.removeEventListener("update",e),_.removeEventListener("controlstart",t),_.removeEventListener("controlend",r),_.removeEventListener("control",e),_.removeEventListener("transitionstart",e),_.removeEventListener("wake",e)}},[_,o,a,f,p,l,s]),(0,F.useEffect)(()=>
545{if(i){let e=g().controls;return m({controls:_}),()=>m({controls:e})}},[i,_]),F.createElement("primitive",(0,M.A)({ref:t,object:_},u))})},7656:(e,t,r)=>{"use strict";function n(){return(n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(null,arguments)}r.d(t,{A:()=>n})},7678:(e,t,r)=>{"use strict";e.exports=r(4159)},7831:(e,t,r)=>{"use strict";r.d(t,{A:()=>function e(t,r){var c,h=typeof r;return null==r||"boolean"===h?(0,l.A)(r):("number"===h?a.A:"string"===h?(c=(0,n.Ay)(r))?(r=c,i.Ay):s.A:r instanceof n.Ay?i.Ay:r instanceof Date?function(e,t){var r=new Date;return e*=1,t*=1,function(n){return r.setTime(e*(1-n)+t*n),r}}:(0,u.p)(r)?u.A:Array.isArray(r)?o.$:"function"!=typeof r.valueOf&&"function"!=typeof r.toString||isNaN(r)?function(t,r){var n,i={},o={};for(n in(null===t||"object"!=typeof t)&&(t={}),(null===r||"object"!=typeof r)&&(r={}),r)n in t?i[n]=e(t[n],r[n]):o[n]=r[n];return function(e){for(n in i)o[n]=i[n](e);return o}}:a.A)(t,r)}});var n=r(5159),i=r(9656),o=r(2363),a=r(2623),s=r(2575),l=r(8822),u=r(5880)},8303:(e,t,r)=>{"use strict";r.d(t,{K:()=>i});var n=r(1698);n.Loader;class i{constructor(e){this.isFont=!0,this.type="Font",this.data=e}generateShapes(e,t=100){let r=[],i=function(e,t,r){let i=Array.from(e),o=t/r.resolution,a=(r.boun
545dingBox.yMax-r.boundingBox.yMin+r.underlineThickness)*o,s=[],l=0,u=0;for(let e=0;e<i.length;e++){let t=i[e];if("\n"===t)l=0,u-=a;else{let e=function(e,t,r,i,o){let a,s,l,u,c,h,f,d,p=o.glyphs[e]||o.glyphs["?"];if(!p)return void console.error('THREE.Font: character "'+e+'" does not exists in font family '+o.familyName+".");let m=new n.ShapePath;if(p.o){let e=p._cachedOutline||(p._cachedOutline=p.o.split(" "));for(let n=0,o=e.length;n<o;)switch(e[n++]){case"m":a=e[n++]*t+r,s=e[n++]*t+i,m.moveTo(a,s);break;case"l":a=e[n++]*t+r,s=e[n++]*t+i,m.lineTo(a,s);break;case"q":l=e[n++]*t+r,u=e[n++]*t+i,c=e[n++]*t+r,h=e[n++]*t+i,m.quadraticCurveTo(c,h,l,u);break;case"b":l=e[n++]*t+r,u=e[n++]*t+i,c=e[n++]*t+r,h=e[n++]*t+i,f=e[n++]*t+r,d=e[n++]*t+i,m.bezierCurveTo(c,h,f,d,l,u)}}return{offsetX:p.ha*t,path:m}}(t,o,l,u,r);l+=e.offsetX,s.push(e.path)}}return s}(e,t,this.data);for(let e=0,t=i.length;e<t;e++)r.push(...i[e].toShapes());return r}}},8449:(e,t,r)=>{"use strict";r.d(t,{A:()=>h});var n=r(4743);function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function o(e,t,r){var n;return(t="symbol"==typeof(n=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?n:String(n))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,u=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,t)||l(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||l(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){if(e){if("string"==typeof e)return u(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return u(e,t)}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var c=["createObj","updateObj","exitObj","objBindAttr","dataBindAttr"];function h(e,t,r,l,u){var h,f,d,p,m,g,v,y,A,_,b,B,x=u.createObj,C=void 0===x?function(e){return{}}:x,w=u.updateObj,E=void 0===w?function(e,t){}:w,M=u.exitObj,T=void 0===M?function(e){}:M,F=u.objBindAttr,S=void 0===F?"__obj":F,O=u.dataBindAttr,R=void 0===O?"__data":O,I=(p=void 0===(d=(f=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach(function(t){o(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({objBindAttr:S,dataBindAttr:R},function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(u,c))).objBindAttr)?"__obj":d,g=void 0===(m=f.dataBindAttr)?"__data":m,v=f.idAccessor,y=f.purge,A=function(e){return e.hasOwnProperty(g)},_=t.filter(function(e){return!A(e)}),b=t.filter(A).map(function(e){return e[g]}),(B=void 0!==y&&y?{enter:e,exit:b,update:[]}:function(e,t,r){var i={enter:[],update:[],exit:[]};if(r){var o=(0,n.A)(e,r,!1),l=(0,n.A)(t,r,!1);Object.entries(Object.assign({}
545,o,l)).forEach(function(e){var t=a(e,2),r=t[0],n=t[1],s=o.hasOwnProperty(r)?l.hasOwnProperty(r)?"update":"exit":"enter";i[s].push("update"===s?[o[r],l[r]]:n)})}else{var u=new Set(e),c=new Set(t);new Set([].concat(s(u),s(c))).forEach(function(e){var t=u.has(e)?c.has(e)?"update":"exit":"enter";i[t].push("update"===t?[e,e]:e)})}return i}(b,e,v)).update=B.update.map(function(e){var t=a(e,2),r=t[0],n=t[1];return r!==n&&(n[p]=r[p],n[p][g]=n),n}),B.exit=B.exit.concat(_.map(function(e){return o({},p,e)})),B),P=I.enter,D=I.update;I.exit.forEach(function(e){var t=e[S];delete e[S],T(t),l(t)});var H=(h=[],P.forEach(function(e){var t=C(e);t&&(t[R]=e,e[S]=t,h.push(t))}),h);[].concat(s(P),s(D)).forEach(function(e){var t=e[S];t&&(t[R]=e,E(t,e))}),H.forEach(r)}},8524:(e,t,r)=>{"use strict";r.d(t,{GS:()=>n,K:()=>u,yo:()=>c});var n=Object.freeze({Linear:Object.freeze({None:function(e){return e},In:function(e){return e},Out:function(e){return e},InOut:function(e){return e}}),Quadratic:Object.freeze({In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}}),Cubic:Object.freeze({In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}}),Quartic:Object.freeze({In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}}),Quintic:Object.freeze({In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}}),Sinusoidal:Object.freeze({In:function(e){return 1-Math.sin((1-e)*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return .5*(1-Math.sin(Math.PI*(.5-e)))}}),Exponential:Object.freeze({In:function(e){return 0===e?0:Math.pow(1024,e-1)},Out:function(e){return 1===e?1:1-Math.pow(2,-10*e)},InOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)}}),Circular:Object.freeze({In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}}),Elastic:Object.freeze({In:function(e){return 0===e?0:1===e?1:-Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI)},Out:function(e){return 0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin((e-.1)*5*Math.PI)+1},InOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?-.5*Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin((e-1.1)*5*Math.PI)+1}}),Back:Object.freeze({In:function(e){return 1===e?1:e*e*(2.70158*e-1.70158)},Out:function(e){return 0===e?0:--e*e*(2.70158*e+1.70158)+1},InOut:function(e){return(e*=2)<1?e*e*(3.5949095*e-2.5949095)*.5:.5*((e-=2)*e*(3.5949095*e+2.5949095)+2)}}),Bounce:Object.freeze({In:function(e){return 1-n.Bounce.Out(1-e)},Out:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},InOut:function(e){return e<.5?.5*n.Bounce.In(2*e):.5*n.Bounce.Out(2*e-1)+.5}}),generatePow:function(e){return void 0===e&&(e=4),e=(e=e<Number.EPSILON?Number.EPSILON:e)>1e4?1e4:e,{In:function(t){return Math.pow(t,e)},Out:function(t){return 1-Math.pow(1-t,e)},InOut:function(t){return t<.5?Math.pow(2*t,e)/2:(1-Math.pow(2-2*t,e))/2+.5}}}}),i=function(){return performance.now()},o=function(){function e(){this._tweens={},this._tweensAddedDuringUpdate={}}return e.prototype.getAll=function(){var e=this;return Object.keys(this._tweens).map(function(t){return e._tweens[t]})},e.prototype.removeAll=function(){this._tweens={}},e.prototype.add=function(e){this._tweens[e.getId()]=e,this._tweensAddedDuringUpdate[e.getId()]=e},e.prototype.remove=function(e){delete this._tweens[e.getId()],delete this._tweensAddedDuringUpdate[e.getId()]},e.prototype.update=function(e,t){void 0===e&&(e=i()),void 0===t&&(t=!1);var r=Object.keys(this._tweens);if(0===r.length)return!1;for(;r.length>0;){this._tweensAddedDuringUpdate={};for(var n=0;n<r.length;n++){var o=this._tweens[r[n]],a=!t;o&&!1===o.update(e,a)&&!t&&delete this._tweens[r[n]]}r=Object.keys(this._tweensAddedDuringUpdate)}return!0},e}(),a={Linear:function(e,t){var r=e.length-1,n=r*t,i=Math.floor(n),o=a.Utils.Linear;return t<0?o(e[0],e[1],n):t>1?o(e[r],e[r-1],r-n):o(e[i],e[i+1>r?r:i+1],n-i)},Bezier:function(e,t){for(var r=0,n=e.length-1,i=Math.pow,o=a.Utils.Bernstein,s=0;s<=n;s++)r+=i(1-t,n-s)*i(t,s)*e[s]*o(n,s);return r},CatmullRom:function(e,t){var r=e.length-1,n=r*t,i=Math.floor(n),o=a.Utils.CatmullRom;return e[0]===e[r]?(t<0&&(i=Math.floor(n=r*(1+t))),o(e[(i-1+r)%r],e[i],e[(i+1)%r],e[(i+2)%r],n-i)):t<0?e[0]-(o(e[0],e[0],e[1],e[1],-n)-e[0]):t>1?e[r]-(o(e[r],e[r],e[r-1],e[r-1],n-r)-e[r]):o(e[i?i-1:0],e[i],e[r<i+1?r:i+1],e[r<i+2?r:i+2],n-i)},Utils:{Linear:function(e,t,r){return(t-e)*r+e},Bernstein:function(e,t){var r=a.Utils.Factorial;return r(e)/r(t)/r(e-t)},Factorial:function(){var e=[1];return function(t){var r=1;if(e[t])return e[t];for(var n=t;n>1;n--)r*=n;return e[t]=r,r}}(),CatmullRom:function(e,t,r,n,i){var o=(r-e)*.5,a=(n-t)*.5,s=i*i;return i*s*(2*t-2*r+o+a)+(-3*t+3*r-2*o-a)*s+o*i+t}}},s=function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e}(),l=new o,u=function(){function e(e,t){void 0===t&&(t=l),this._object=e,this._group=t,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=n.Linear.None,this._interpolationFunction=a.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=s.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1}return e.prototype.getId=function(){return this._id},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isPaused=function(){return this._isPaused},e.prototype.getDuration=function(){return this._duration},e.prototype.to=function(e,t){if(void 0===t&&(t=1e3),this._isPlaying)throw Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=e,this._propertiesAreSetUp=!1,this._duration=t<0?0:t,this},e.prototype.duration=function(e){return void 0===e&&(e=1e3),this._duration=e<0?0:e,this},e.prototype.dynamic=function(e){return void 0===e&&(e=!1),this._isDynamic=e,this},e.prototype.start=function(e,t){if(void 0===e&&(e=i()),void 0===t&&(t=!1),this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed)for(var r in this._reversed=!1,this._valuesStartRepeat)this._swapEndStartRepeatValues(r),this._valuesStart[r]=this._valuesStartRepeat[r];if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=e,this._startTime+=this._delayTime,!this._propertiesAreSetUp||t){if(this._propertiesAreSetUp=!0,!this._isDynamic){var n={};for(var o in this._valuesEnd)n[o]=this._valuesEnd[o];this._valuesEnd=n}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,t)}return this},e.prototype.startFromCurrentValues=function(e){return this.start(e,!0)},e.prototype._setupProperties=function(e,t,r,n,i){for(var o in r){var a=e[o],s=Array.isArray(a),l=s?"array":typeof a,u=!s&&Array.isArray(r[o]);if("undefined"!==l&&"function"!==l){if(u){var c=r[o];if(0===c.length)continue;for(var h=[a],f=0,d=c.length;f<d;f+=1){var p=this._handleRelativeValue(a,c[f]);if(isNaN(p)){u=!1,console.warn("Found invalid interpolation list. Skipping.");break}h.push(p)}u&&(r[o]=h)}if(("object"===l||s)&&a&&!u){for(var m in t[o]=s?[]:{},a)t[o][m]=a[m];n[o]=s?[]:{};var c=r[o];if(!this._isDynamic){var g={};for(var m in c)g[m]=c[m];r[o]=c=g}this._setupProperties(a,t[o],c,n[o],i)}else(void 0===t[o]||i)&&(t[o]=a),s||(t[o]*=1),u?n[o]=r[o].slice().reverse():n[o]=t[o
545]||0}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying&&(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object)),this},e.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},e.prototype.pause=function(e){return void 0===e&&(e=i()),this._isPaused||!this._isPlaying||(this._isPaused=!0,this._pauseStart=e,this._group&&this._group.remove(this)),this},e.prototype.resume=function(e){return void 0===e&&(e=i()),this._isPaused&&this._isPlaying&&(this._isPaused=!1,this._startTime+=e-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this)),this},e.prototype.stopChainedTweens=function(){for(var e=0,t=this._chainedTweens.length;e<t;e++)this._chainedTweens[e].stop();return this},e.prototype.group=function(e){return void 0===e&&(e=l),this._group=e,this},e.prototype.delay=function(e){return void 0===e&&(e=0),this._delayTime=e,this},e.prototype.repeat=function(e){return void 0===e&&(e=0),this._initialRepeat=e,this._repeat=e,this},e.prototype.repeatDelay=function(e){return this._repeatDelayTime=e,this},e.prototype.yoyo=function(e){return void 0===e&&(e=!1),this._yoyo=e,this},e.prototype.easing=function(e){return void 0===e&&(e=n.Linear.None),this._easingFunction=e,this},e.prototype.interpolation=function(e){return void 0===e&&(e=a.Linear),this._interpolationFunction=e,this},e.prototype.chain=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this._chainedTweens=e,this},e.prototype.onStart=function(e){return this._onStartCallback=e,this},e.prototype.onEveryStart=function(e){return this._onEveryStartCallback=e,this},e.prototype.onUpdate=function(e){return this._onUpdateCallback=e,this},e.prototype.onRepeat=function(e){return this._onRepeatCallback=e,this},e.prototype.onComplete=function(e){return this._onCompleteCallback=e,this},e.prototype.onStop=function(e){return this._onStopCallback=e,this},e.prototype.update=function(e,t){if(void 0===e&&(e=i()),void 0===t&&(t=!0),this._isPaused)return!0;var r,n=this._startTime+this._duration;if(!this._goToEnd&&!this._isPlaying){if(e>n)return!1;t&&this.start(e,!0)}if(this._goToEnd=!1,e<this._startTime)return!0;!1===this._onStartCallbackFired&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),!1===this._onEveryStartCallbackFired&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var o=e-this._startTime,a=this._duration+(null!=(r=this._repeatDelayTime)?r:this._delayTime),s=this._duration+this._repeat*a,l=this._calculateElapsedPortion(o,a,s),u=this._easingFunction(l),c=this._calculateCompletionStatus(o,a);if("repeat"===c&&this._processRepetition(o,a),this._updateProperties(this._object,this._valuesStart,this._valuesEnd,u),"about-to-repeat"===c&&this._processRepetition(o,a),this._onUpdateCallback&&this._onUpdateCallback(this._object,l),"repeat"===c||"about-to-repeat"===c)this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1;else if("completed"===c){this._isPlaying=!1,this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var h=0,f=this._chainedTweens.length;h<f;h++)this._chainedTweens[h].start(this._startTime+this._duration,!1)}return"completed"!==c},e.prototype._calculateElapsedPortion=function(e,t,r){if(0===this._duration||e>r)return 1;var n=Math.min(e%t/this._duration,1);return 0===n&&0!==e&&e%this._duration==0?1:n},e.prototype._calculateCompletionStatus=function(e,t){return 0!==this._duration&&e<this._duration?"playing":this._repeat<=0?"completed":e===this._duration?"about-to-repeat":"repeat"},e.prototype._processRepetition=function(e,t){var r=Math.min(Math.trunc((e-this._duration)/t)+1,this._repeat);for(var n in isFinite(this._repeat)&&(this._repeat-=r),this._valuesStartRepeat){var i=this._valuesEnd[n];this._yoyo||"string"!=typeof i||(this._valuesStartRepeat[n]=this._valuesStartRepeat[n]+parseFloat(i)),this._yoyo&&this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n]}this._yoyo&&(this._reversed=!this._reversed),this._startTime+=t*r},e.prototype._updateProperties=function(e,t,r,n){for(var i in r)if(void 0!==t[i]){var o=t[i]||0,a=r[i],s=Array.isArray(e[i]),l=Array.isArray(a);!s&&l?e[i]=this._interpolationFunction(a,n):"object"==typeof a&&a?this._updateProperties(e[i],o,a,n):"number"==typeof(a=this._handleRelativeValue(o,a))&&(e[i]=o+(a-o)*n)}},e.prototype._handleRelativeValue=function(e,t){return"string"!=typeof t?t:"+"===t.charAt(0)||"-"===t.charAt(0)?e+parseFloat(t):parseFloat(t)},e.prototype._swapEndStartRepeatValues=function(e){var t=this._valuesStartRepeat[e],r=this._valuesEnd[e];"string"==typeof r?this._valuesStartRepeat[e]=this._valuesStartRepeat[e]+parseFloat(r):this._valuesStartRepeat[e]=this._valuesEnd[e],this._valuesEnd[e]=t},e}();s.nextId,l.getAll.bind(l),l.removeAll.bind(l),l.add.bind(l),l.remove.bind(l);var c=l.update.bind(l)},8822:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=e=>()=>e},8860:e=>{e.exports=function(e,t,r,n){var i=0,o=0,a=(n=n||{}).step||1,s=n.maxTimeMS||8,l=n.probeElements||5e3;setTimeout(function n(){var u=Math.min(e.length,i+l),c=i,h=new Date;for(c=i;c<u;c+=a)t(e[c],c,e);c<e.length?(o+=new Date-h,l=Math.round((i=c)*s/o),setTimeout(n,0)):r(e)},0)}},8896:(e,t,r)=>{"use strict";e.exports=r(314)},9292:(e,t,r)=>{"use strict";let n;r.d(t,{p:()=>eu}),r(23);var i=r(1698);let o=new WeakMap;class a extends i.Loader{constructor(e){super(e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,r,n){let o=new i.FileLoader(this.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,e=>{let r={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};
545this.decodeGeometry(e,r).then(t).catch(n)},r,n)}decodeDracoFile(e,t,r,n){let i={attributeIDs:r||this.defaultAttributeIDs,attributeTypes:n||this.defaultAttributeTypes,useUniqueIDs:!!r};this.decodeGeometry(e,i).then(t)}decodeGeometry(e,t){let r;for(let e in t.attributeTypes){let r=t.attributeTypes[e];void 0!==r.BYTES_PER_ELEMENT&&(t.attributeTypes[e]=r.name)}let n=JSON.stringify(t);if(o.has(e)){let t=o.get(e);if(t.key===n)return t.promise;if(0===e.byteLength)throw Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let i=this.workerNextTaskID++,a=e.byteLength,s=this._getWorker(i,a).then(n=>(r=n,new Promise((n,o)=>{r._callbacks[i]={resolve:n,reject:o},r.postMessage({type:"decode",id:i,taskConfig:t,buffer:e},[e])}))).then(e=>this._createGeometry(e.geometry));return s.catch(()=>!0).then(()=>{r&&i&&this._releaseTask(r,i)}),o.set(e,{key:n,promise:s}),s}_createGeometry(e){let t=new i.BufferGeometry;e.index&&t.setIndex(new i.BufferAttribute(e.index.array,1));for(let r=0;r<e.attributes.length;r++){let n=e.attributes[r],o=n.name,a=n.array,s=n.itemSize;t.setAttribute(o,new i.BufferAttribute(a,s))}return t}_loadLibrary(e,t){let r=new i.FileLoader(this.manager);return r.setPath(this.decoderPath),r.setResponseType(t),r.setWithCredentials(this.withCredentials),new Promise((t,n)=>{r.load(e,t,void 0,n)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;let e="object"!=typeof WebAssembly||"js"===this.decoderConfig.type,t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(t=>{let r=t[0];e||(this.decoderConfig.wasmBinary=t[1]);let n=s.toString(),i=["/* draco decoder */",r,"\n/* worker */",n.substring(n.indexOf("{")+1,n.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([i]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.length<this.workerLimit){let e=new Worker(this.workerSourceURL);e._callbacks={},e._taskCosts={},e._taskLoad=0,e.postMessage({type:"init",decoderConfig:this.decoderConfig}),e.onmessage=function(t){let r=t.data;switch(r.type){case"decode":e._callbacks[r.id].resolve(r);break;case"error":e._callbacks[r.id].reject(r);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+r.type+'"')}},this.workerPool.push(e)}else this.workerPool.sort(function(e,t){return e._taskLoad>t._taskLoad?-1:1});let r=this.workerPool[this.workerPool.length-1];return r._taskCosts[e]=t,r._taskLoad+=t,r})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this}}function s(){let e,t;onmessage=function(r){let n=r.data;switch(n.type){case"init":e=n.decoderConfig,t=new Promise(function(t){e.onModuleLoaded=function(e){t({draco:e})},DracoDecoderModule(e)});break;case"decode":let i=n.buffer,o=n.taskConfig;t.then(e=>{let t=e.draco,r=new t.Decoder,a=new t.DecoderBuffer;a.Init(new Int8Array(i),i.byteLength);try{let e=function(e,t,r,n){let i,o,a=n.attributeIDs,s=n.attributeTypes,l=t.GetEncodedGeometryType(r);if(l===e.TRIANGULAR_MESH)i=new e.Mesh,o=t.DecodeBufferToMesh(r,i);else if(l===e.POINT_CLOUD)i=new e.PointCloud,o=t.DecodeBufferToPointCloud(r,i);else throw Error("THREE.DRACOLoader: Unexpected geometry type.");if(!o.ok()||0===i.ptr)throw Error("THREE.DRACOLoader: Decoding failed: "+o.error_msg());let u={index:null,attributes:[]};for(let r in a){let o,l,c=self[s[r]];if(n.useUniqueIDs)l=a[r],o=t.GetAttributeByUniqueId(i,l);else{if(-1===(l=t.GetAttributeId(i,e[a[r]])))continue;o=t.GetAttribute(i,l)}u.attributes.push(function(e,t,r,n,i,o){let a=o.num_components(),s=r.num_points()*a,l=s*i.BYTES_PER_ELEMENT,u=function(e,t){switch(t){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32}}(e,i),c=e._malloc(l);t.GetAttributeDataArrayForAllPoints(r,o,u,l,c);let h=new i(e.HEAPF32.buffer,c,s).slice();return e._free(c),{name:n,array:h,itemSize:a}}(e,t,i,r,c,o))}return l===e.TRIANGULAR_MESH&&(u.index=function(e,t,r){let n=3*r.num_faces(),i=4*n,o=e._malloc(i);t.GetTrianglesUInt32Array(r,i,o);let a=new Uint32Array(e.HEAPF32.buffer,o,n).slice();return e._free(o),{array:a,itemSize:1}}(e,t,i)),e.destroy(i),u}(t,r,a,o),i=e.attributes.map(e=>e.array.buffer);e.index&&i.push(e.index.array.buffer),self.postMessage({type:"decode",id:n.id,geometry:e},i)}catch(e){console.error(e),self.postMessage({type:"error",id:n.id,error:e.message})}finally{t.destroy(a),t.destroy(r)}})}}}var l=r(1155);let u=parseInt(i.REVISION.replace(/\D+/g,""));function c(e){if("undefined"!=typeof TextDecoder)return new TextDecoder().decode(e);let t="";for(let r=0,n=e.length;r<n;r++)t+=String.fromCharCode(e[r]);try{return decodeURIComponent(escape(t))}catch(e){return t}}let h="srgb",f="srgb-linear";class d extends i.Loader{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(e){return new A(e)}),this.register(function(e){return new _(e)}),this.register(function(e){return new F(e)}),this.register(function(e){return new S(e)}),this.register(function(e){return new O(e)}),this.register(function(e){return new B(e)}),this.register(function(e){return new x(e)}),this.register(function(e){return new C(e)}),this.register(function(e){return new w(e)}),this.register(function(e){return new y(e)}),this.register(function(e){return new E(e)}),this.register(function(e){return new b(e)}),this.register(function(e){return new T(e)}),this.register(function(e){return new M(e)}),this.register(function(e){return new g(e)}),this.register(function(e){return new R(e)}),this.register(function(e){return new I(e)})}load(e,t,r,n){let o,a=this;if(""!==this.resourcePath)o=this.resourcePath;else if(""!==this.path){let t=i.LoaderUtils.extractUrlBase(e);o=i.LoaderUtils.resolveURL(t,this.path)}else o=i.LoaderUtils.extractUrlBase(e);this.manager.itemStart(e);let s=function(t){n?n(t):console.error(t),a.manager.itemError(e),a.manager.itemEnd(e)},l=new i.FileLoader(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,function(r){try{a.parse(r,o,function(r){t(r),a.manager.itemEnd(e)},s)}catch(e){s(e)}},r,s)}setDRACOLoader(e){return this.dracoLoader=e,this}setDDSLoader(){throw Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return -1===this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.push(e),this}unregister(e){return -1!==this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,r,n){let i,o={},a={};if("string"==typeof e)i=JSON.parse(e);else if(e instanceof ArrayBuffer)if(c(new Uint8Array(e.slice(0,4)))===P){try{o[m.KHR_BINARY_GLTF]=new H(e)}catch(e){n&&n(e);return}i=JSON.parse(o[m.KHR_BINARY_GLTF].content)}else i=JSON.parse(c(new Uint8Array(e)));else i=e;if(void 0===i.asset||i.asset.version[0]<2){n&&n(Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}let s=new en(i,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});s.fileLoader.setRequestHeader(this.requestHeader);for(let e=0;e<this.pluginCallbacks.length;e++){let t=this.pluginCallbacks[e](s);t.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),a[t.name]=t,o[t.name]=!0}if(i.extensionsUsed)for(let e=0;e<i.extensionsUsed.length;++e){let t=i.extensionsUsed[e],r=i.extensionsRequired||[];switch(t){case m.KHR_MATERIALS_UNLIT:o[t]=new v;break;case m.KHR_DRACO_MESH_COMPRESSION:o[t]=new L(i,this.dracoLoader);break;case m.KHR_TEXTURE_TRANSFORM:o[t]=new G;break;case m.KHR_MESH_QUANTIZATION:o[t]=new U;break;default:r.indexOf(t)>=0&&void 0===a[t]&&console.warn('THREE.GLTFLoader: Unknown extension "'+t+'".')}}s.setExtensions(o),s.setPlugins(a),s.parse(r,n)}parseAsync(e,t){let r=this;return new Promise(function(n,i){r.parse(e,t,n,i)})}}function p(){let e={};return{get:function(t){return e[t]},add:function(t,r){e[t]=r},remove:function(t){delete e[t]},removeAll:function(){e={}}}}let m={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class g{constructor(e){this.parser=e,this.name=m.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){let e=this.parser,t=this.parser.json.nodes||[];for(let r=0,n=t.length;r<n;r++){let n=t[r];n.extensions&&n.extensions[this.name]&&void 0!==n.extensions[this.name].light&&e._addNodeRef(this.cache,n.extensions[this.name].light)}}_loadLight(e){let t,r=this.parser,n="light:"+e,o=r.cache.get(n);if(o)return o;let a=r.json,s=((a.extensions&&a.extensions[this.name]||{}).lights||[])[e],l=new i.Color(0xffffff);void 0!==s.color&&l.setRGB(s.color[0],s.color[1],s.color[2],f);let u=void 0!==s.range?s.range:0;switch(s.type){case"directional":(t=new i.DirectionalLight(l)).target.position.set(0,0,-1),t.add(t.target);break;case"point":(t=new i.PointLight(l)).distance=u;break;case"spot":(t=new i.SpotLight(l)).distance=u,s.spot=s.spot||{},s.spot.innerConeAngle=void 0!==s.spot.innerConeAngle?s.spot.innerConeAngle:0,s.spot.outerConeAngle=void 0!==s.spot.outerConeAngle?s.spot.outerConeAngle:Math.PI/4,t.angle=s.spot.outerConeAngle,t.penumbra=1-s.spot.innerConeAngle/s.spot.outerConeAngle,t.target.position.set(0,0,-1),t.add(t.target);break;default:throw Error("THREE.GLTFLoader: Unexpected light type: "+s.type)}return t.position.set(0,0,0),t.decay=2,$(t,s),void 0!==s.intensity&&(t.intensity=s.intensity),t.name=r.createUniqueName(s.name||"light_"+e),o=Prom
545ise.resolve(t),r.cache.add(n,o),o}getDependency(e,t){if("light"===e)return this._loadLight(t)}createNodeAttachment(e){let t=this,r=this.parser,n=r.json.nodes[e],i=(n.extensions&&n.extensions[this.name]||{}).light;return void 0===i?null:this._loadLight(i).then(function(e){return r._getNodeRef(t.cache,i,e)})}}class v{constructor(){this.name=m.KHR_MATERIALS_UNLIT}getMaterialType(){return i.MeshBasicMaterial}extendParams(e,t,r){let n=[];e.color=new i.Color(1,1,1),e.opacity=1;let o=t.pbrMetallicRoughness;if(o){if(Array.isArray(o.baseColorFactor)){let t=o.baseColorFactor;e.color.setRGB(t[0],t[1],t[2],f),e.opacity=t[3]}void 0!==o.baseColorTexture&&n.push(r.assignTexture(e,"map",o.baseColorTexture,h))}return Promise.all(n)}}class y{constructor(e){this.parser=e,this.name=m.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){let r=this.parser.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();let n=r.extensions[this.name].emissiveStrength;return void 0!==n&&(t.emissiveIntensity=n),Promise.resolve()}}class A{constructor(e){this.parser=e,this.name=m.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?i.MeshPhysicalMaterial:null}extendMaterialParams(e,t){let r=this.parser,n=r.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();let o=[],a=n.extensions[this.name];if(void 0!==a.clearcoatFactor&&(t.clearcoat=a.clearcoatFactor),void 0!==a.clearcoatTexture&&o.push(r.assignTexture(t,"clearcoatMap",a.clearcoatTexture)),void 0!==a.clearcoatRoughnessFactor&&(t.clearcoatRoughness=a.clearcoatRoughnessFactor),void 0!==a.clearcoatRoughnessTexture&&o.push(r.assignTexture(t,"clearcoatRoughnessMap",a.clearcoatRoughnessTexture)),void 0!==a.clearcoatNormalTexture&&(o.push(r.assignTexture(t,"clearcoatNormalMap",a.clearcoatNormalTexture)),void 0!==a.clearcoatNormalTexture.scale)){let e=a.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new i.Vector2(e,e)}return Promise.all(o)}}class _{constructor(e){this.parser=e,this.name=m.KHR_MATERIALS_DISPERSION}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?i.MeshPhysicalMaterial:null}extendMaterialParams(e,t){let r=this.parser.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();let n=r.extensions[this.name];return t.dispersion=void 0!==n.dispersion?n.dispersion:0,Promise.resolve()}}class b{constructor(e){this.parser=e,this.name=m.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?i.MeshPhysicalMaterial:null}extendMaterialParams(e,t){let r=this.parser,n=r.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();let i=[],o=n.extensions[this.name];return void 0!==o.iridescenceFactor&&(t.iridescence=o.iridescenceFactor),void 0!==o.iridescenceTexture&&i.push(r.assignTexture(t,"iridescenceMap",o.iridescenceTexture)),void 0!==o.iridescenceIor&&(t.iridescenceIOR=o.iridescenceIor),void 0===t.iridescenceThicknessRange&&(t.iridescenceThicknessRange=[100,400]),void 0!==o.iridescenceThicknessMinimum&&(t.iridescenceThicknessRange[0]=o.iridescenceThicknessMinimum),void 0!==o.iridescenceThicknessMaximum&&(t.iridescenceThicknessRange[1]=o.iridescenceThicknessMaximum),void 0!==o.iridescenceThicknessTexture&&i.push(r.assignTexture(t,"iridescenceThicknessMap",o.iridescenceThicknessTexture)),Promise.all(i)}}class B{constructor(e){this.parser=e,this.name=m.KHR_MATERIALS_SHEEN}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?i.MeshPhysicalMaterial:null}extendMaterialParams(e,t){let r=this.parser,n=r.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();let o=[];t.sheenColor=new i.Color(0,0,0),t.sheenRoughness=0,t.sheen=1;let a=n.extensions[this.name];if(void 0!==a.sheenColorFactor){let e=a.sheenColorFactor;t.sheenColor.setRGB(e[0],e[1],e[2],f)}return void 0!==a.sheenRoughnessFactor&&(t.sheenRoughness=a.sheenRoughnessFactor),void 0!==a.sheenColorTexture&&o.push(r.assignTexture(t,"sheenColorMap",a.sheenColorTexture,h)),void 0!==a.sheenRoughnessTexture&&o.push(r.assignTexture(t,"sheenRoughnessMap",a.sheenRoughnessTexture)),Promise.all(o)}}class x{constructor(e){this.parser=e,this.name=m.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?i.MeshPhysicalMaterial:null}extendMaterialParams(e,t){let r=this.parser,n=r.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();let i=[],o=n.extensions[this.name];return void 0!==o.transmissionFactor&&(t.transmission=o.transmissionFactor),void 0!==o.transmissionTexture&&i.push(r.assignTexture(t,"transmissionMap",o.transmissionTexture)),Promise.all(i)}}class C{constructor(e){this.parser=e,this.name=m.KHR_MATERIALS_VOLUME}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?i.MeshPhysicalMaterial:null}extendMaterialParams(e,t){let r=this.parser,n=r.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();let o=[],a=n.extensions[this.name];t.thickness=void 0!==a.thicknessFactor?a.thicknessFactor:0,void 0!==a.thicknessTexture&&o.push(r.assignTexture(t,"thicknessMap",a.thicknessTexture)),t.attenuationDistance=a.attenuationDistance||1/0;let s=a.attenuationColor||[1,1,1];return t.attenuationColor=new i.Color().setRGB(s[0],s[1],s[2],f),Promise.all(o)}}class w{constructor(e){this.parser=e,this.name=m.KHR_MATERIALS_IOR}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?i.MeshPhysicalMaterial:null}extendMaterialParams(e,t){let r=this.parser.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();let n=r.extensions[this.name];return t.ior=void 0!==n.ior?n.ior:1.5,Promise.resolve()}}class E{constructor(e){this.parser=e,this.name=m.KHR_MATERIALS_SPECULAR}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?i.MeshPhysicalMaterial:null}extendMaterialParams(e,t){let r=this.parser,n=r.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();let o=[],a=n.extensions[this.name];t.specularIntensity=void 0!==a.specularFactor?a.specularFactor:1,void 0!==a.specularTexture&&o.push(r.assignTexture(t,"specularIntensityMap",a.specularTexture));let s=a.specularColorFactor||[1,1,1];return t.specularColor=new i.Color().setRGB(s[0],s[1],s[2],f),void 0!==a.specularColorTexture&&o.push(r.assignTexture(t,"specularColorMap",a.specularColorTexture,h)),Promise.all(o)}}class M{constructor(e){this.parser=e,this.name=m.EXT_MATERIALS_BUMP}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?i.MeshPhysicalMaterial:null}extendMaterialParams(e,t){let r=this.parser,n=r.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();let i=[],o=n.extensions[this.name];return t.bumpScale=void 0!==o.bumpFactor?o.bumpFactor:1,void 0!==o.bumpTexture&&i.push(r.assignTexture(t,"bumpMap",o.bumpTexture)),Promise.all(i)}}class T{constructor(e){this.parser=e,this.name=m.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?i.MeshPhysicalMaterial:null}extendMaterialParams(e,t){let r=this.parser,n=r.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();let i=[],o=n.extensions[this.name];return void 0!==o.anisotropyStrength&&(t.anisotropy=o.anisotropyStrength),void 0!==o.anisotropyRotation&&(t.anisotropyRotation=o.anisotropyRotation),void 0!==o.anisotropyTexture&&i.push(r.assignTexture(t,"anisotropyMap",o.anisotropyTexture)),Promise.all(i)}}class F{constructor(e){this.parser=e,this.name=m.KHR_TEXTURE_BASISU}loadTexture(e){let t=this.parser,r=t.json,n=r.textures[e];if(!n.extensions||!n.extensions[this.name])return null;let i=n.extensions[this.name],o=t.options.ktx2Loader;if(!o)if(!(r.extensionsRequired&&r.extensionsRequired.indexOf(this.name)>=0))return null;else throw Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return t.loadTextureImage(e,i.source,o)}}class S{constructor(e){this.parser=e,this.name=m.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){let t=this.name,r=this.parser,n=r.json,i=n.textures[e];if(!i.extensions||!i.extensions[t])return null;let o=i.extensions[t],a=n.images[o.source],s=r.textureLoader;if(a.uri){let e=r.options.manager.getHandler(a.uri);null!==e&&(s=e)}return this.detectSupport().then(function(i){if(i)return r.loadTextureImage(e,o.source,s);if(n.extensionsRequired&&n.extensionsRequired.indexOf(t)>=0)throw Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return r.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){let t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(1===t.height)}})),this.isSupported}}class O{constructor(e){this.parser=e,this.name=m.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){let t=this.name,r=this.parser,n=r.json,i=n.textures[e];if(!i.extensions||!i.extensions[t])return null;let o=i.extensions[t],a=n.images[o.source],s=r.textureLoader;if(a.uri){let e=r.options.manager.getHandler(a.uri);null!==e&&(s=e)}return this.detectSupport().then(function(i){if(i)return r.loadTextureImage(e,o.source,s);if(n.extensionsRequired&&n.extensionsRequired.indexOf(t)>=0)throw Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return r.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){let t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdj
545FDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(1===t.height)}})),this.isSupported}}class R{constructor(e){this.name=m.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){let t=this.parser.json,r=t.bufferViews[e];if(!r.extensions||!r.extensions[this.name])return null;{let e=r.extensions[this.name],n=this.parser.getDependency("buffer",e.buffer),i=this.parser.options.meshoptDecoder;if(!i||!i.supported)if(!(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0))return null;else throw Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return n.then(function(t){let r=e.byteOffset||0,n=e.byteLength||0,o=e.count,a=e.byteStride,s=new Uint8Array(t,r,n);return i.decodeGltfBufferAsync?i.decodeGltfBufferAsync(o,a,s,e.mode,e.filter).then(function(e){return e.buffer}):i.ready.then(function(){let t=new ArrayBuffer(o*a);return i.decodeGltfBuffer(new Uint8Array(t),o,a,s,e.mode,e.filter),t})})}}}class I{constructor(e){this.name=m.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){let t=this.parser.json,r=t.nodes[e];if(!r.extensions||!r.extensions[this.name]||void 0===r.mesh)return null;for(let e of t.meshes[r.mesh].primitives)if(e.mode!==J.TRIANGLES&&e.mode!==J.TRIANGLE_STRIP&&e.mode!==J.TRIANGLE_FAN&&void 0!==e.mode)return null;let n=r.extensions[this.name].attributes,o=[],a={};for(let e in n)o.push(this.parser.getDependency("accessor",n[e]).then(t=>(a[e]=t,a[e])));return o.length<1?null:(o.push(this.parser.createNodeMesh(e)),Promise.all(o).then(e=>{let t=e.pop(),r=t.isGroup?t.children:[t],n=e[0].count,o=[];for(let e of r){let t=new i.Matrix4,r=new i.Vector3,s=new i.Quaternion,l=new i.Vector3(1,1,1),u=new i.InstancedMesh(e.geometry,e.material,n);for(let e=0;e<n;e++)a.TRANSLATION&&r.fromBufferAttribute(a.TRANSLATION,e),a.ROTATION&&s.fromBufferAttribute(a.ROTATION,e),a.SCALE&&l.fromBufferAttribute(a.SCALE,e),u.setMatrixAt(e,t.compose(r,s,l));for(let t in a)if("_COLOR_0"===t){let e=a[t];u.instanceColor=new i.InstancedBufferAttribute(e.array,e.itemSize,e.normalized)}else"TRANSLATION"!==t&&"ROTATION"!==t&&"SCALE"!==t&&e.geometry.setAttribute(t,a[t]);i.Object3D.prototype.copy.call(u,e),this.parser.assignFinalMaterial(u),o.push(u)}return t.isGroup?(t.clear(),t.add(...o),t):o[0]}))}}let P="glTF",D={JSON:0x4e4f534a,BIN:5130562};class H{constructor(e){this.name=m.KHR_BINARY_GLTF,this.content=null,this.body=null;let t=new DataView(e,0,12);if(this.header={magic:c(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==P)throw Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw Error("THREE.GLTFLoader: Legacy binary file detected.");let r=this.header.length-12,n=new DataView(e,12),i=0;for(;i<r;){let t=n.getUint32(i,!0);i+=4;let r=n.getUint32(i,!0);if(i+=4,r===D.JSON){let r=new Uint8Array(e,12+i,t);this.content=c(r)}else if(r===D.BIN){let r=12+i;this.body=e.slice(r,r+t)}i+=t}if(null===this.content)throw Error("THREE.GLTFLoader: JSON content not found.")}}class L{constructor(e,t){if(!t)throw Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=m.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){let r=this.json,n=this.dracoLoader,i=e.extensions[this.name].bufferView,o=e.extensions[this.name].attributes,a={},s={},l={};for(let e in o)a[X[e]||e.toLowerCase()]=o[e];for(let t in e.attributes){let n=X[t]||t.toLowerCase();if(void 0!==o[t]){let i=r.accessors[e.attributes[t]],o=z[i.componentType];l[n]=o.name,s[n]=!0===i.normalized}}return t.getDependency("bufferView",i).then(function(e){return new Promise(function(t,r){n.decodeDracoFile(e,function(e){for(let t in e.attributes){let r=e.attributes[t],n=s[t];void 0!==n&&(r.normalized=n)}t(e)},a,l,f,r)})})}}class G{constructor(){this.name=m.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return(void 0===t.texCoord||t.texCoord===e.channel)&&void 0===t.offset&&void 0===t.rotation&&void 0===t.scale||(e=e.clone(),void 0!==t.texCoord&&(e.channel=t.texCoord),void 0!==t.offset&&e.offset.fromArray(t.offset),void 0!==t.rotation&&(e.rotation=t.rotation),void 0!==t.scale&&e.repeat.fromArray(t.scale),e.needsUpdate=!0),e}}class U{constructor(){this.name=m.KHR_MESH_QUANTIZATION}}
545class k extends i.Interpolant{constructor(e,t,r,n){super(e,t,r,n)}copySampleValue_(e){let t=this.resultBuffer,r=this.sampleValues,n=this.valueSize,i=e*n*3+n;for(let e=0;e!==n;e++)t[e]=r[i+e];return t}interpolate_(e,t,r,n){let i=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=2*a,l=3*a,u=n-t,c=(r-t)/u,h=c*c,f=h*c,d=e*l,p=d-l,m=-2*f+3*h,g=f-h,v=1-m,y=g-h+c;for(let e=0;e!==a;e++){let t=o[p+e+a],r=o[p+e+s]*u,n=o[d+e+a],l=o[d+e]*u;i[e]=v*t+y*r+m*n+g*l}return i}}let N=new i.Quaternion;class j extends k{interpolate_(e,t,r,n){let i=super.interpolate_(e,t,r,n);return N.fromArray(i).normalize().toArray(i),i}}let J={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},z={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},K={9728:i.NearestFilter,9729:i.LinearFilter,9984:i.NearestMipmapNearestFilter,9985:i.LinearMipmapNearestFilter,9986:i.NearestMipmapLinearFilter,9987:i.LinearMipmapLinearFilter},V={33071:i.ClampToEdgeWrapping,33648:i.MirroredRepeatWrapping,10497:i.RepeatWrapping},Q={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},X={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",...u>=152?{TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3"}:{TEXCOORD_0:"uv",TEXCOORD_1:"uv2"},COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},Y={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},Z={CUBICSPLINE:void 0,LINEAR:i.InterpolateLinear,STEP:i.InterpolateDiscrete},q={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function W(e,t,r){for(let n in r.extensions)void 0===e[n]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[n]=r.extensions[n])}function $(e,t){void 0!==t.extras&&("object"==typeof t.extras?Object.assign(e.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function ee(e){let t="",r=Object.keys(e).sort();for(let n=0,i=r.length;n<i;n++)t+=r[n]+":"+e[r[n]]+";";return t}function et(e){switch(e){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}let er=new i.Matrix4;class en{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new p,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let r=!1,n=!1,o=-1;"undefined"!=typeof navigator&&void 0!==navigator.userAgent&&(r=!0===/^((?!chrome|android).)*safari/i.test(navigator.userAgent),o=(n=navigator.userAgent.indexOf("Firefox")>-1)?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),"undefined"==typeof createImageBitmap||r||n&&o<98?this.textureLoader=new i.TextureLoader(this.options.manager):this.textureLoader=new i.ImageBitmapLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new i.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){let r=this,n=this.json,i=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(e){return e._markDefs&&e._markDefs()}),Promise.all(this._invokeAll(function(e){return e.beforeRoot&&e.beforeRoot()})).then(function(){return Promise.all([r.getDependencies("scene"),r.getDependencies("animation"),r.getDependencies("camera")])}).then(function(t){let o={scene:t[0][n.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:n.asset,parser:r,userData:{}};return W(i,o,n),$(o,n),Promise.all(r._invokeAll(function(e){return e.afterRoot&&e.afterRoot(o)}
545)).then(function(){for(let e of o.scenes)e.updateMatrixWorld();e(o)})}).catch(t)}_markDefs(){let e=this.json.nodes||[],t=this.json.skins||[],r=this.json.meshes||[];for(let r=0,n=t.length;r<n;r++){let n=t[r].joints;for(let t=0,r=n.length;t<r;t++)e[n[t]].isBone=!0}for(let t=0,n=e.length;t<n;t++){let n=e[t];void 0!==n.mesh&&(this._addNodeRef(this.meshCache,n.mesh),void 0!==n.skin&&(r[n.mesh].isSkinnedMesh=!0)),void 0!==n.camera&&this._addNodeRef(this.cameraCache,n.camera)}}_addNodeRef(e,t){void 0!==t&&(void 0===e.refs[t]&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,r){if(e.refs[t]<=1)return r;let n=r.clone(),i=(e,t)=>{let r=this.associations.get(e);for(let[n,o]of(null!=r&&this.associations.set(t,r),e.children.entries()))i(o,t.children[n])};return i(r,n),n.name+="_instance_"+e.uses[t]++,n}_invokeOne(e){let t=Object.values(this.plugins);t.push(this);for(let r=0;r<t.length;r++){let n=e(t[r]);if(n)return n}return null}_invokeAll(e){let t=Object.values(this.plugins);t.unshift(this);let r=[];for(let n=0;n<t.length;n++){let i=e(t[n]);i&&r.push(i)}return r}getDependency(e,t){let r=e+":"+t,n=this.cache.get(r);if(!n){switch(e){case"scene":n=this.loadScene(t);break;case"node":n=this._invokeOne(function(e){return e.loadNode&&e.loadNode(t)});break;case"mesh":n=this._invokeOne(function(e){return e.loadMesh&&e.loadMesh(t)});break;case"accessor":n=this.loadAccessor(t);break;case"bufferView":n=this._invokeOne(function(e){return e.loadBufferView&&e.loadBufferView(t)});break;case"buffer":n=this.loadBuffer(t);break;case"material":n=this._invokeOne(function(e){return e.loadMaterial&&e.loadMaterial(t)});break;case"texture":n=this._invokeOne(function(e){return e.loadTexture&&e.loadTexture(t)});break;case"skin":n=this.loadSkin(t);break;case"animation":n=this._invokeOne(function(e){return e.loadAnimation&&e.loadAnimation(t)});break;case"camera":n=this.loadCamera(t);break;default:if(!(n=this._invokeOne(function(r){return r!=this&&r.getDependency&&r.getDependency(e,t)})))throw Error("Unknown type: "+e)}this.cache.add(r,n)}return n}getDependencies(e){let t=this.cache.get(e);if(!t){let r=this;t=Promise.all((this.json[e+("mesh"===e?"es":"s")]||[]).map(function(t,n){return r.getDependency(e,n)})),this.cache.add(e,t)}return t}loadBuffer(e){let t=this.json.buffers[e],r=this.fileLoader;if(t.type&&"arraybuffer"!==t.type)throw Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(void 0===t.uri&&0===e)return Promise.resolve(this.extensions[m.KHR_BINARY_GLTF].body);let n=this.options;return new Promise(function(e,o){r.load(i.LoaderUtils.resolveURL(t.uri,n.path),e,void 0,function(){o(Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))})})}loadBufferView(e){let t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then(function(e){let r=t.byteLength||0,n=t.byteOffset||0;return e.slice(n,n+r)})}loadAccessor(e){let t=this,r=this.json,n=this.json.accessors[e];if(void 0===n.bufferView&&void 0===n.sparse){let e=Q[n.type],t=z[n.componentType],r=!0===n.normalized,o=new t(n.count*e);return Promise.resolve(new i.BufferAttribute(o,e,r))}let o=[];return void 0!==n.bufferView?o.push(this.getDependency("bufferView",n.bufferView)):o.push(null),void 0!==n.sparse&&(o.push(this.getDependency("bufferView",n.sparse.indices.bufferView)),o.push(this.getDependency("bufferView",n.sparse.values.bufferView))),Promise.all(o).then(function(e){let o,a,s=e[0],l=Q[n.type],u=z[n.componentType],c=u.BYTES_PER_ELEMENT,h=c*l,f=n.byteOffset||0,d=void 0!==n.bufferView?r.bufferViews[n.bufferView].byteStride:void 0,p=!0===n.normalized;if(d&&d!==h){let e=Math.floor(f/d),r="InterleavedBuffer:"+n.bufferView+":"+n.componentType+":"+e+":"+n.count,h=t.cache.get(r);h||(o=new u(s,e*d,n.count*d/c),h=new i.InterleavedBuffer(o,d/c),t.cache.add(r,h)),a=new i.InterleavedBufferAttribute(h,l,f%d/c,p)}else o=null===s?new u(n.count*l):new u(s,f,n.count*l),a=new i.BufferAttribute(o,l,p);if(void 0!==n.sparse){let t=Q.SCALAR,r=z[n.sparse.indices.componentType],o=n.sparse.indices.byteOffset||0,c=n.sparse.values.byteOffset||0,h=new r(e[1],o,n.sparse.count*t),f=new u(e[2],c,n.sparse.count*l);null!==s&&(a=new i.BufferAttribute(a.array.slice(),a.itemSize,a.normalized));for(let e=0,t=h.length;e<t;e++){let t=h[e];if(a.setX(t,f[e*l]),l>=2&&a.setY(t,f[e*l+1]),l>=3&&a.setZ(t,f[e*l+2]),l>=4&&a.setW(t,f[e*l+3]),l>=5)throw Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return a})}loadTexture(e){let t=this.json,r=this.options,n=t.textures[e].source,i=t.images[n],o=this.textureLoader;if(i.uri){let e=r.manager.getHandler(i.uri);null!==e&&(o=e)}return this.loadTextureImage(e,n,o)}loadTextureImage(e,t,r){let n=this,o=this.json,a=o.textures[e],s=o.images[t],l=(s.uri||s.bufferView)+":"+a.sampler;if(this.textureCache[l])return this.textureCache[l];let u=this.loadImageSource(t,r).then(function(t){t.flipY=!1,t.name=a.name||s.name||"",""===t.name&&"string"==typeof s.uri&&!1===s.uri.startsWith("data:image/")&&(t.name=s.uri);let r=(o.samplers||{})[a.sampler]||{};return t.magFilter=K[r.magFilter]||i.LinearFilter,t.minFilter=K[r.minFilter]||i.LinearMipmapLinearFilter,t.wrapS=V[r.wrapS]||i.RepeatWrapping,t.wrapT=V[r.wrapT]||i.RepeatWrapping,n.associations.set(t,{textures:e}),t}).catch(function(){return null});return this.textureCache[l]=u,u}loadImageSource(e,t){let r=this.json,n=this.options;if(void 0!==this.sourceCache[e])return this.sourceCache[e].then(e=>e.clone());let o=r.images[e],a=self.URL||self.webkitURL,s=o.uri||"",l=!1;if(void 0!==o.bufferView)s=this.getDependency("bufferView",o.bufferView).then(function(e){l=!0;let t=new Blob([e],{type:o.mimeType});return s=a.createObjectURL(t)});else if(void 0===o.uri)throw Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");let u=Promise.resolve(s).then(function(e){return new Promise(function(r,o){let a=r;!0===t.isImageBitmapLoader&&(a=function(e){let t=new i.Texture(e);t.needsUpdate=!0,r(t)}),t.load(i.LoaderUtils.resolveURL(e,n.path),a,void 0,o)})}).then(function(e){var t;return!0===l&&a.revokeObjectURL(s),$(e,o),e.userData.mimeType=o.mimeType||((t=o.uri).search(/\.jpe?g($|\?)/i)>
5450||0===t.search(/^data\:image\/jpeg/)?"image/jpeg":t.search(/\.webp($|\?)/i)>0||0===t.search(/^data\:image\/webp/)?"image/webp":"image/png"),e}).catch(function(e){throw console.error("THREE.GLTFLoader: Couldn't load texture",s),e});return this.sourceCache[e]=u,u}assignTexture(e,t,r,n){let i=this;return this.getDependency("texture",r.index).then(function(o){if(!o)return null;if(void 0!==r.texCoord&&r.texCoord>0&&((o=o.clone()).channel=r.texCoord),i.extensions[m.KHR_TEXTURE_TRANSFORM]){let e=void 0!==r.extensions?r.extensions[m.KHR_TEXTURE_TRANSFORM]:void 0;if(e){let t=i.associations.get(o);o=i.extensions[m.KHR_TEXTURE_TRANSFORM].extendTexture(o,e),i.associations.set(o,t)}}return void 0!==n&&("number"==typeof n&&(n=3001===n?h:f),"colorSpace"in o?o.colorSpace=n:o.encoding=n===h?3001:3e3),e[t]=o,o})}assignFinalMaterial(e){let t=e.geometry,r=e.material,n=void 0===t.attributes.tangent,o=void 0!==t.attributes.color,a=void 0===t.attributes.normal;if(e.isPoints){let e="PointsMaterial:"+r.uuid,t=this.cache.get(e);t||(t=new i.PointsMaterial,i.Material.prototype.copy.call(t,r),t.color.copy(r.color),t.map=r.map,t.sizeAttenuation=!1,this.cache.add(e,t)),r=t}else if(e.isLine){let e="LineBasicMaterial:"+r.uuid,t=this.cache.get(e);t||(t=new i.LineBasicMaterial,i.Material.prototype.copy.call(t,r),t.color.copy(r.color),t.map=r.map,this.cache.add(e,t)),r=t}if(n||o||a){let e="ClonedMaterial:"+r.uuid+":";n&&(e+="derivative-tangents:"),o&&(e+="vertex-colors:"),a&&(e+="flat-shading:");let t=this.cache.get(e);t||(t=r.clone(),o&&(t.vertexColors=!0),a&&(t.flatShading=!0),n&&(t.normalScale&&(t.normalScale.y*=-1),t.clearcoatNormalScale&&(t.clearcoatNormalScale.y*=-1)),this.cache.add(e,t),this.associations.set(t,this.associations.get(r))),r=t}e.material=r}getMaterialType(){return i.MeshStandardMaterial}loadMaterial(e){let t,r=this,n=this.json,o=this.extensions,a=n.materials[e],s={},l=a.extensions||{},u=[];if(l[m.KHR_MATERIALS_UNLIT]){let e=o[m.KHR_MATERIALS_UNLIT];t=e.getMaterialType(),u.push(e.extendParams(s,a,r))}else{let n=a.pbrMetallicRoughness||{};if(s.color=new i.Color(1,1,1),s.opacity=1,Array.isArray(n.baseColorFactor)){let e=n.baseColorFactor;s.color.setRGB(e[0],e[1],e[2],f),s.opacity=e[3]}void 0!==n.baseColorTexture&&u.push(r.assignTexture(s,"map",n.baseColorTexture,h)),s.metalness=void 0!==n.metallicFactor?n.metallicFactor:1,s.roughness=void 0!==n.roughnessFactor?n.roughnessFactor:1,void 0!==n.metallicRoughnessTexture&&(u.push(r.assignTexture(s,"metalnessMap",n.metallicRoughnessTexture)),u.push(r.assignTexture(s,"roughnessMap",n.metallicRoughnessTexture))),t=this._invokeOne(function(t){return t.getMaterialType&&t.getMaterialType(e)}),u.push(Promise.all(this._invokeAll(function(t){return t.extendMaterialParams&&t.extendMaterialParams(e,s)})))}!0===a.doubleSided&&(s.side=i.DoubleSide);let c=a.alphaMode||q.OPAQUE;if(c===q.BLEND?(s.transparent=!0,s.depthWrite=!1):(s.transparent=!1,c===q.MASK&&(s.alphaTest=void 0!==a.alphaCutoff?a.alphaCutoff:.5)),void 0!==a.normalTexture&&t!==i.MeshBasicMaterial&&(u.push(r.assignTexture(s,"normalMap",a.normalTexture)),s.normalScale=new i.Vector2(1,1),void 0!==a.normalTexture.scale)){let e=a.normalTexture.scale;s.normalScale.set(e,e)}if(void 0!==a.occlusionTexture&&t!==i.MeshBasicMaterial&&(u.push(r.assignTexture(s,"aoMap",a.occlusionTexture)),void 0!==a.occlusionTexture.strength&&(s.aoMapIntensity=a.occlusionTexture.strength)),void 0!==a.emissiveFactor&&t!==i.MeshBasicMaterial){let e=a.emissiveFactor;s.emissive=new i.Color().setRGB(e[0],e[1],e[2],f)}return void 0!==a.emissiveTexture&&t!==i.MeshBasicMaterial&&u.push(r.assignTexture(s,"emissiveMap",a.emissiveTexture,h)),Promise.all(u).then(function(){let n=new t(s);return a.name&&(n.name=a.name),$(n,a),r.associations.set(n,{materials:e}),a.extensions&&W(o,n,a),n})}createUniqueName(e){let t=i.PropertyBinding.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){let t=this,r=this.extensions,n=this.primitiveCache,o=[];for(let a=0,s=e.length;a<s;a++){let s=e[a],l=function(e){let t,r=e.extensions&&e.extensions[m.KHR_DRACO_MESH_COMPRESSION];if(t=r?"draco:"+r.bufferView+":"+r.indices+":"+ee(r.attributes):e.indices+":"+ee(e.attributes)+":"+e.mode,void 0!==e.targets)for(let r=0,n=e.targets.length;r<n;r++)t+=":"+ee(e.targets[r]);return t}(s),u=n[l];if(u)o.push(u.promise);else{let e;e=s.extensions&&s.extensions[m.KHR_DRACO_MESH_COMPRESSION]?function(e){return r[m.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,t).then(function(r){return ei(r,e,t)})}(s):ei(new i.BufferGeometry,s,t),n[l]={primitive:s,promise:e},o.push(e)}}return Promise.all(o)}loadMesh(e){let t=this,r=this.json,n=this.extensions,o=r.meshes[e],a=o.primitives,s=[];for(let e=0,t=a.length;e<t;e++){var u;let t=void 0===a[e].material?(void 0===(u=this.cache).DefaultMaterial&&(u.DefaultMaterial=new i.MeshStandardMaterial({color:0xffffff,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:i.FrontSide})),u.DefaultMaterial):this.getDependency("material",a[e].material);s.push(t)}return s.push(t.loadGeometries(a)),Promise.all(s).then(function(r){let s=r.slice(0,r.length-1),u=r[r.length-1],c=[];for(let r=0,h=u.length;r<h;r++){let h,f=u[r],d=a[r],p=s[r];if(d.mode===J.TRIANGLES||d.mode===J.TRIANGLE_STRIP||d.mode===J.TRIANGLE_FAN||void 0===d.mode)!0===(h=!0===o.isSkinnedMesh?new i.SkinnedMesh(f,p):new i.Mesh(f,p)).isSkinnedMesh&&h.normalizeSkinWeights(),d.mode===J.TRIANGLE_STRIP?h.geometry=(0,l._c)(h.geometry,i.TriangleStripDrawMode):d.mode===J.TRIANGLE_FAN&&(h.geometry=(0,l._c)(h.geometry,i.TriangleFanDrawMode));else if(d.mode===J.LINES)h=new i.LineSegments(f,p);else if(d.mode===J.LINE_STRIP)h=new i.Line(f,p);else if(d.mode===J.LINE_LOOP)h=new i.LineLoop(f,p);else if(d.mode===J.POINTS)h=new i.Points(f,p);else throw Error("THREE.GLTFLoader: Primitive mode unsupported: "+d.mode);Object.keys(h.geometry.morphAttributes).length>0&&function(e,t){if(e.updateMorphTargets(),void 0!==t.weights)for(let r=0,n=t.weights.length;r<n;r++)e.morphTargetInfluences[r]=t.weights[r];if(t.extras&&Array.isArray(t.extras.targetNames)){let r=t.extras.targetNames;if(e.morphTargetInfluences.length===r.length){e.morphTargetDictionary={};for(let t=0,n=r.length;t<n;t++)e.morphTargetDictionary[r[t]]=t}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}(h,o),h.name=t.createUniqueName(o.name||"mesh_"+e),$(h,o),d.extensions&&W(n,h,d),t.assignFinalMaterial(h),c.push(h)}for(let r=0,n=c.length;r<n;r++)t.associations.set(c[r],{meshes:e,primitives:r});if(1===c.length)return o.extensions&&W(n,c[0],o),c[0];let h=new i.Group;o.extensions&&W(n,h,o),t.associations.set(h,{meshes:e});for(let e=0,t=c.length;e<t;e++)h.add(c[e]);return h})}loadCamera(e){let t,r=this.json.cameras[e],n=r[r.type];return n?("perspective"===r.type?t=new i.PerspectiveCamera(i.MathUtils.radToDeg(n.yfov),n.aspectRatio||1,n.znear||1,n.zfar||2e6):"orthographic"===r.type&&(t=new i.Orthogra
545phicCamera(-n.xmag,n.xmag,n.ymag,-n.ymag,n.znear,n.zfar)),r.name&&(t.name=this.createUniqueName(r.name)),$(t,r),Promise.resolve(t)):void console.warn("THREE.GLTFLoader: Missing camera parameters.")}loadSkin(e){let t=this.json.skins[e],r=[];for(let e=0,n=t.joints.length;e<n;e++)r.push(this._loadNodeShallow(t.joints[e]));return void 0!==t.inverseBindMatrices?r.push(this.getDependency("accessor",t.inverseBindMatrices)):r.push(null),Promise.all(r).then(function(e){let r=e.pop(),n=[],o=[];for(let a=0,s=e.length;a<s;a++){let s=e[a];if(s){n.push(s);let e=new i.Matrix4;null!==r&&e.fromArray(r.array,16*a),o.push(e)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[a])}return new i.Skeleton(n,o)})}loadAnimation(e){let t=this.json,r=this,n=t.animations[e],o=n.name?n.name:"animation_"+e,a=[],s=[],l=[],u=[],c=[];for(let e=0,t=n.channels.length;e<t;e++){let t=n.channels[e],r=n.samplers[t.sampler],i=t.target,o=i.node,h=void 0!==n.parameters?n.parameters[r.input]:r.input,f=void 0!==n.parameters?n.parameters[r.output]:r.output;void 0!==i.node&&(a.push(this.getDependency("node",o)),s.push(this.getDependency("accessor",h)),l.push(this.getDependency("accessor",f)),u.push(r),c.push(i))}return Promise.all([Promise.all(a),Promise.all(s),Promise.all(l),Promise.all(u),Promise.all(c)]).then(function(e){let t=e[0],n=e[1],a=e[2],s=e[3],l=e[4],u=[];for(let e=0,i=t.length;e<i;e++){let i=t[e],o=n[e],c=a[e],h=s[e],f=l[e];if(void 0===i)continue;i.updateMatrix&&i.updateMatrix();let d=r._createAnimationTracks(i,o,c,h,f);if(d)for(let e=0;e<d.length;e++)u.push(d[e])}return new i.AnimationClip(o,void 0,u)})}createNodeMesh(e){let t=this.json,r=this,n=t.nodes[e];return void 0===n.mesh?null:r.getDependency("mesh",n.mesh).then(function(e){let t=r._getNodeRef(r.meshCache,n.mesh,e);return void 0!==n.weights&&t.traverse(function(e){if(e.isMesh)for(let t=0,r=n.weights.length;t<r;t++)e.morphTargetInfluences[t]=n.weights[t]}),t})}loadNode(e){let t=this.json.nodes[e],r=this._loadNodeShallow(e),n=[],i=t.children||[];for(let e=0,t=i.length;e<t;e++)n.push(this.getDependency("node",i[e]));let o=void 0===t.skin?Promise.resolve(null):this.getDependency("skin",t.skin);return Promise.all([r,Promise.all(n),o]).then(function(e){let t=e[0],r=e[1],n=e[2];null!==n&&t.traverse(function(e){e.isSkinnedMesh&&e.bind(n,er)});for(let e=0,n=r.length;e<n;e++)t.add(r[e]);return t})}_loadNodeShallow(e){let t=this.json,r=this.extensions,n=this;if(void 0!==this.nodeCache[e])return this.nodeCache[e];let o=t.nodes[e],a=o.name?n.createUniqueName(o.name):"",s=[],l=n._invokeOne(function(t){return t.createNodeMesh&&t.createNodeMesh(e)});return l&&s.push(l),void 0!==o.camera&&s.push(n.getDependency("camera",o.camera).then(function(e){return n._getNodeRef(n.cameraCache,o.camera,e)})),n._invokeAll(function(t){return t.createNodeAttachment&&t.createNodeAttachment(e)}).forEach(function(e){s.push(e)}),this.nodeCache[e]=Promise.all(s).then(function(t){let s;if((s=!0===o.isBone?new i.Bone:t.length>1?new i.Group:1===t.length?t[0]:new i.Object3D)!==t[0])for(let e=0,r=t.length;e<r;e++)s.add(t[e]);if(o.name&&(s.userData.name=o.name,s.name=a),$(s,o),o.extensions&&W(r,s,o),void 0!==o.matrix){let e=new i.Matrix4;e.fromArray(o.matrix),s.applyMatrix4(e)}else void 0!==o.translation&&s.position.fromArray(o.translation),void 0!==o.rotation&&s.quaternion.fromArray(o.rotation),void 0!==o.scale&&s.scale.fromArray(o.scale);return n.associations.has(s)||n.associations.set(s,{}),n.associations.get(s).nodes=e,s}),this.nodeCache[e]}loadScene(e){let t=this.extensions,r=this.json.scenes[e],n=this,o=new i.Group;r.name&&(o.name=n.createUniqueName(r.name)),$(o,r),r.extensions&&W(t,o,r);let a=r.nodes||[],s=[];for(let e=0,t=a.length;e<t;e++)s.push(n.getDependency("node",a[e]));return Promise.all(s).then(function(e){for(let t=0,r=e.length;t<r;t++)o.add(e[t]);return n.associations=(e=>{let t=new Map;for(let[e,r]of n.associations)(e instanceof i.Material||e instanceof i.Texture)&&t.set(e,r);return e.traverse(e=>{let r=n.associations.get(e);null!=r&&t.set(e,r)}),t})(o),o})}_createAnimationTracks(e,t,r,n,o){let a,s=[],l=e.name?e.name:e.uuid,u=[];switch(Y[o.path]===Y.weights?e.traverse(function(e){e.morphTargetInfluences&&u.push(e.name?e.name:e.uuid)}):u.push(l),Y[o.path]){case Y.weights:a=i.NumberKeyframeTrack;break;case Y.rotation:a=i.QuaternionKeyframeTrack;break;case Y.position:case Y.scale:a=i.VectorKeyframeTrack;break;default:a=1===r.itemSize?i.NumberKeyframeTrack:i.VectorKeyframeTrack}let c=void 0!==n.interpolation?Z[n.interpolation]:i.InterpolateLinear,h=this._getArrayFromAccessor(r);for(let e=0,r=u.length;e<r;e++){let r=new a(u[e]+"."+Y[o.path],t.array,h,c);
545"CUBICSPLINE"===n.interpolation&&this._createCubicSplineTrackInterpolant(r),s.push(r)}return s}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){let e=et(t.constructor),r=new Float32Array(t.length);for(let n=0,i=t.length;n<i;n++)r[n]=t[n]*e;t=r}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(e){return new(this instanceof i.QuaternionKeyframeTrack?j:k)(this.times,this.values,this.getValueSize()/3,e)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function ei(e,t,r){let n=t.attributes,o=[];for(let t in n){let i=X[t]||t.toLowerCase();i in e.attributes||o.push(function(t,n){return r.getDependency("accessor",t).then(function(t){e.setAttribute(n,t)})}(n[t],i))}if(void 0!==t.indices&&!e.index){let n=r.getDependency("accessor",t.indices).then(function(t){e.setIndex(t)});o.push(n)}return $(e,t),!function(e,t,r){let n=t.attributes,o=new i.Box3;if(void 0===n.POSITION)return;{let e=r.json.accessors[n.POSITION],t=e.min,a=e.max;if(void 0===t||void 0===a)return console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");if(o.set(new i.Vector3(t[0],t[1],t[2]),new i.Vector3(a[0],a[1],a[2])),e.normalized){let t=et(z[e.componentType]);o.min.multiplyScalar(t),o.max.multiplyScalar(t)}}let a=t.targets;if(void 0!==a){let e=new i.Vector3,t=new i.Vector3;for(let n=0,i=a.length;n<i;n++){let i=a[n];if(void 0!==i.POSITION){let n=r.json.accessors[i.POSITION],o=n.min,a=n.max;if(void 0!==o&&void 0!==a){if(t.setX(Math.max(Math.abs(o[0]),Math.abs(a[0]))),t.setY(Math.max(Math.abs(o[1]),Math.abs(a[1]))),t.setZ(Math.max(Math.abs(o[2]),Math.abs(a[2]))),n.normalized){let e=et(z[n.componentType]);t.multiplyScalar(e)}e.max(t)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}o.expandByVector(e)}e.boundingBox=o;let s=new i.Sphere;o.getCenter(s.center),s.radius=o.min.distanceTo(o.max)/2,e.boundingSphere=s}(e,t,r),Promise.all(o).then(function(){return void 0!==t.targets?function(e,t,r){let n=!1,i=!1,o=!1;for(let e=0,r=t.length;e<r;e++){let r=t[e];if(void 0!==r.POSITION&&(n=!0),void 0!==r.NORMAL&&(i=!0),void 0!==r.COLOR_0&&(o=!0),n&&i&&o)break}if(!n&&!i&&!o)return Promise.resolve(e);let a=[],s=[],l=[];for(let u=0,c=t.length;u<c;u++){let c=t[u];if(n){let t=void 0!==c.POSITION?r.getDependency("accessor",c.POSITION):e.attributes.position;a.push(t)}if(i){let t=void 0!==c.NORMAL?r.getDependency("accessor",c.NORMAL):e.attributes.normal;s.push(t)}if(o){let t=void 0!==c.COLOR_0?r.getDependency("accessor",c.COLOR_0):e.attributes.color;l.push(t)}}return Promise.all([Promise.all(a),Promise.all(s),Promise.all(l)]).then(function(t){let r=t[0],a=t[1],s=t[2];return n&&(e.morphAttributes.position=r),i&&(e.morphAttributes.normal=a),o&&(e.morphAttributes.color=s),e.morphTargetsRelative=!0,e})}(e,t.targets,r):e})}var eo=r(3354);let ea=null,es="https://www.gstatic.com/draco/versioned/decoders/1.5.5/";function el(e,t,r){return i=>{r&&r(i),e&&(ea||(ea=new a),ea.setDecoderPath("string"==typeof e?e:es),i.setDRACOLoader(ea)),t&&i.setMeshoptDecoder((()=>{let e;if(n)return n;let t=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),r=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]);if("object"!=typeof WebAssembly)return{supported:!1};let i="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCEJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCIJAYAmJHY2BBAI2BFHmCKrHPAPCE6HPy86BBAKCLJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCKJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCOJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCNJAYAmJHY2BBAI2BGHmCKrHPAPCE6HPy86BBAKCVJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCcJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCMJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCSJAYAmJHm2BBAI2BEHICKrHYAYCE6HYy86BBAKCQJAmAYJHm2BBAICIrCEZHYAYCE6HYy86BBAKCfJAmAYJHm2BBAICGrCEZHYAYCE6HYy86BBAKCbJAmAYJHK2BBAICEZHIAICE6HIy86BBAKAIJRISGMAKAI2BNAI2BBHmCIrHYAYCb6HYy86BBAKCFJAICNJAYJHY2BBAmCbZHmAmCb6Hmy86BBAKCGJAYAmJHm2BBAI2BFHYCIrHPAPCb6HPy86BBAKCEJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCIJAmAYJHm2BBAI2BGHYCIrHPAPCb6HPy86BBAKCLJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCKJAmAYJHm2BBAI2BEHYCIrHPAPCb6HPy86BBAKCOJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCNJAmAYJHm2BBAI2BIHYCIrHPAPCb6HPy86BBAKCVJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCcJAmAYJHm2BBAI2BLHYCIrHPAPCb6HPy86BBAKCMJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCSJAmAYJHm2BBAI2BKHYCIrHPAPCb6HPy86BBAKCQJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCfJAmAYJHm2BBAI2BOHICIrHYAYCb6HYy86BBAKCbJAmAYJHK2BBAICbZHIAICb6HIy86BBAKAIJRISFMAKAI8pBB83BBAKCNJAICNJ8pBB83BBAICTJRIMAtCGJRtAECTJHEAS9JQBMMGXAIQBCBRISEMGXAM9FQBANAbJ2BBRtCBRKAfREEXAEANCU/CBJAKJ2BBHTCFrCBATCFZl9zAtJHt86BBAEAGJREAKCFJHKAM9HQBMMAfCFJRfAIRTAbCFJHbAG9HQBMMABAcAG9sJANCUGJAMAG9sTkUUUBpANANCUGJAMCaJAG9sJAGTkUUUBpMAMCBAIyAcJRcAIQBMC9+RKSFMCBC99AOAIlAGCAAGCA9Ly6yRKMALCU/EBJ8kUUUUBAKM+OmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUFT+JUUUBpALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9
545LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM+lLKFaF99GaG99FaG99GXGXAGCI9HQBAF9FQFEXGXGX9DBBB8/9DBBB+/ABCGJHG1BB+yAB1BBHE+yHI+L+TABCFJHL1BBHK+yHO+L+THN9DBBBB9gHVyAN9DBB/+hANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE86BBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG86BBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG86BBABCIJRBAFCaJHFQBSGMMAF9FQBEXGXGX9DBBB8/9DBBB+/ABCIJHG8uFB+yAB8uFBHE+yHI+L+TABCGJHL8uFBHK+yHO+L+THN9DBBBB9gHVyAN9DB/+g6ANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE87FBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG87FBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG87FBABCNJRBAFCaJHFQBMMM/SEIEaE99EaF99GXAF9FQBCBREABRIEXGXGX9D/zI818/AICKJ8uFBHLCEq+y+VHKAI8uFB+y+UHO9DB/+g6+U9DBBB8/9DBBB+/AO9DBBBB9gy+SHN+L9DBBB9P9d9FQBAN+oRVSFMCUUUU94RVMAICIJ8uFBRcAICGJ8uFBRMABALCFJCEZAEqCFWJAV87FBGXGXAKAM+y+UHN9DB/+g6+U9DBBB8/9DBBB+/AN9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRMSFMCUUUU94RMMABALCGJCEZAEqCFWJAM87FBGXGXAKAc+y+UHK9DB/+g6+U9DBBB8/9DBBB+/AK9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRcSFMCUUUU94RcMABALCaJCEZAEqCFWJAc87FBGXGX9DBBU8/AOAO+U+TANAN+U+TAKAK+U+THO9DBBBBAO9DBBBB9gy+R9DB/+g6+U9DBBB8/+SHO+L9DBBB9P9d9FQBAO+oRcSFMCUUUU94RcMABALCEZAEqCFWJAc87FBAICNJRIAECIJREAFCaJHFQBMMM9JBGXAGCGrAF9sHF9FQBEXABAB8oGBHGCNWCN91+yAGCi91CnWCUUU/8EJ+++U84GBABCIJRBAFCaJHFQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEM/lFFFaGXGXAFABqCEZ9FQBABRESFMGXGXAGCT9PQBABRESFMABREEXAEAF8oGBjGBAECIJAFCIJ8oGBjGBAECNJAFCNJ8oGBjGBAECSJAFCSJ8oGBjGBAECTJREAFCTJRFAGC9wJHGCb9LQBMMAGCI9JQBEXAEAF8oGBjGBAFCIJRFAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF2BB86BBAECFJREAFCFJRFAGCaJHGQBMMABMoFFGaGXGXABCEZ9FQBABRESFMAFCgFZC+BwsN9sRIGXGXAGCT9PQBABRESFMABREEXAEAIjGBAECSJAIjGBAECNJAIjGBAECIJAIjGBAECTJREAGC9wJHGCb9LQBMMAGCI9JQBEXAEAIjGBAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF86BBAECFJREAGCaJHGQBMMABMMMFBCUNMIT9kBB";
545WebAssembly.validate(t)&&(i="B9h9z9tFBBBFiI9gBB9gLaaaaaFa9gEaaaB9gFaFaEMcBBFBFFGGGEILF9wFFFLEFBFKNFaFCx/aFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBG8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBIy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBKi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBOn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBNI9z9iqlBVc+N9IcIBTEM9+FLa8jUUUUBCTlRBCBRFEXCBRGCBREEXABCNJAGJAECUaAFAGrCFZHIy86BBAEAIJREAGCFJHGCN9HQBMAFCx+YUUBJAE86BBAFCEWCxkUUBJAB8pEN83EBAFCFJHFCUG9HQBMMk8lLbaE97F9+FaL978jUUUUBCU/KBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAG/8cBBCUoBAG9uC/wgBZHKCUGAKCUG9JyRNAECFJRKCBRVGXEXAVAF9PQFANAFAVlAVANJAF9JyRcGXGXAG9FQBAcCbJHIC9wZHMCE9sRSAMCFWRQAICIrCEJCGrRfCBRbEXAKRTCBRtGXEXGXAOATlAf9PQBCBRKSLMALCU/CBJAtAM9sJRmATAfJRKCBREGXAMCoB9JQBAOAKlC/gB9JQBCBRIEXAmAIJREGXGXGXGXGXATAICKrJ2BBHYCEZfIBFGEBMAECBDtDMIBSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMIBAKCTJRKMGXGXGXGXGXAYCGrCEZfIBFGEBMAECBDtDMITSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMITAKCTJRKMGXGXGXGXGXAYCIrCEZfIBFGEBMAECBDtDMIASEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMIAAKCTJRKMGXGXGXGXGXAYCKrfIBFGEBMAECBDtDMI8wSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCIJAeDeBJAYCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCNJAeDeBJAYCx+YUUBJ2BBJRKSFMAEAKDBBBDMI8wAKCTJRKMAICoBJREAICUFJAM9LQFAERIAOAKlC/fB9LQBMMGXAEAM9PQBAECErRIEXGXAOAKlCi9PQBCBRKSOMAmAEJRYGXGXGXGXGXATAECKrJ2BBAICKZrCEZfIBFGEBMAYCBDtDMIBSEMAYAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAYAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAYAKDBBBDMIBAKCTJRKMAICGJRIAECTJHEAM9JQBMMG
545XAK9FQBAKRTAtCFJHtCI6QGSFMMCBRKSEMGXAM9FQBALCUGJAbJREALAbJDBGBReCBRYEXAEALCU/CBJAYJHIDBIBHdCFD9tAdCFDbHPD9OD9hD9RHdAIAMJDBIBH8ZCFD9tA8ZAPD9OD9hD9RH8ZDQBTFtGmEYIPLdKeOnHpAIAQJDBIBHyCFD9tAyAPD9OD9hD9RHyAIASJDBIBH8cCFD9tA8cAPD9OD9hD9RH8cDQBTFtGmEYIPLdKeOnH8dDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGEAeD9uHeDyBjGBAEAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeApA8dDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeAdA8ZDQNiV8ZcpMyS8cQ8df8eb8fHdAyA8cDQNiV8ZcpMyS8cQ8df8eb8fH8ZDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeAdA8ZDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJREAYCTJHYAM9JQBMMAbCIJHbAG9JQBMMABAVAG9sJALCUGJAcAG9s/8cBBALALCUGJAcCaJAG9sJAG/8cBBMAcCBAKyAVJRVAKQBMC9+RKSFMCBC99AOAKlAGCAAGCA9Ly6yRKMALCU/KBJ8kUUUUBAKMNBT+BUUUBM+KmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUF/8MBALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM/dLEK97FaF97GXGXAGCI9HQBAF9FQFCBRGEXABABDBBBHECiD+rFCiD+sFD/6FHIAECND+rFCiD+sFD/6FAID/gFAECTD+rFCiD+sFD/6FHLD/gFD/kFD/lFHKCBDtD+2FHOAICUUUU94DtHND9OD9RD/kFHI9DBB/+hDYAIAID/mFAKAKD/mFALAOALAND9OD9RD/kFHIAID/mFD/kFD/kFD/jFD/nFHLD/mF9DBBX9LDYHOD/kFCgFDtD9OAECUUU94DtD9OD9QAIALD/mFAOD/kFCND+rFCU/+EDtD9OD9QAKALD/mFAOD/kFCTD+rFCUU/8ODtD9OD9QDMBBABCTJRBAGCIJHGAF9JQBSGMMAF9FQBCBRGEXABCTJHVAVDBBBHECBDtHOCUU98D8cFCUU98D8cEHND9OABDBBBHKAEDQILKOSQfbPden8c8d8e8fCggFDtD9OD/6FAKAEDQBFGENVcMTtmYi8ZpyHECTD+sFD/6FHID/gFAECTD+rFCTD+sFD/6FHLD/gFD/kFD/lFHE9DB/+g6DYALAEAOD+2FHOALCUUUU94DtHcD9OD9RD/kFHLALD/mFAEAED/mFAIAOAIAcD9OD9RD/kFHEAED/mFD/kFD/kFD/jFD/nFHID/mF9DBBX9LDYHOD/kFCTD+rFALAID/mFAOD/kFCggEDtD9OD9QHLAEAID/mFAOD/kFCaDbCBDnGCBDnECBDnKCBDnOCBDncCBDnMCBDnfCBDnbD9OHEDQNVi8ZcMpySQ8c8dfb8e8fD9QDMBBABAKAND9OALAEDQBFTtGEmYILPdKOenD9QDMBBABCAJRBAGCIJHGAF9JQBMMM/hEIGaF97FaL978jUUUUBCTlREGXAF9FQBCBRIEXAEABDBBBHLABCTJHKDBBBHODQILKOSQfbPden8c8d8e8fHNCTD+sFHVCID+rFDMIBAB9DBBU8/DY9D/zI818/DYAVCEDtD9QD/6FD/nFHVALAODQBFGENVcMTtmYi8ZpyHLCTD+rFCTD+sFD/6FD/mFHOAOD/mFAVALCTD+sFD/6FD/mFHcAcD/mFAVANCTD+rFCTD+sFD/6FD/mFHNAND/mFD/kFD/kFD/lFCBDtD+4FD/jF9DB/+g6DYHVD/mF9DBBX9LDYHLD/kFCggEDtHMD9OAcAVD/mFALD/kFCTD+rFD9QHcANAVD/mFALD/kFCTD+rFAOAVD/mFALD/kFAMD9OD9QHVDQBFTtGEmYILPdKOenHLD8dBAEDBIBDyB+t+J83EBABCNJALD8dFAEDBIBDyF+t+J83EBAKAcAVDQNVi8ZcMpySQ8c8dfb8e8fHVD8dBAEDBIBDyG+t+J83EBABCiJAVD8dFAEDBIBDyE+t+J83EBABCAJRBAICIJHIAF9JQBMMM9jFF97GXAGCGrAF9sHG9FQBCBRFEXABABDBBBHECND+rFCND+sFD/6FAECiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBABCTJRBAFCIJHFAG9JQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB");let o=WebAssembly.instantiate(function(e){let t=new Uint8Array(e.length);for(let r=0;r<e.length;++r){let n=e.charCodeAt(r);t[r]=n>96?n-71:n>64?n-65:n>47?n+4:n>46?63:62}let n=0;for(let i=0;i<e.length;++i)t[n++]=t[i]<60?r[t[i]]:(t[i]-60)*64+t[++i];return t.buffer.slice(0,n)}(i),{}).then(t=>{(e=t.instance).exports.__wasm_call_ctors()});function a(t,r,n,i,o,a){let s=e.exports.sbrk,l=n+3&-4,u=s(l*i),c=s(o.length),h=new Uint8Array(e.exports.memory.buffer);h.set(o,c);let f=t(u,n,i,c,o.length);if(0===f&&a&&a(u,l,i),r.set(h.subarray(u,u+n*i)),s(u-s(0)),0!==f)throw Error(`Malformed buffer data: ${f}`)}let s={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},l={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};return n={ready:o,supported:!0,decodeVertexBuffer(t,r,n,i,o){a(e.exports.meshopt_decodeVertexBuffer,t,r,n,i,e.exports[s[o]])},decodeIndexBuffer(t,r,n,i){a(e.exports.meshopt_decodeIndexBuffer,t,r,n,i)},decodeIndexSequence(t,r,n,i){a(e.exports.meshopt_decodeIndexSequence,t,r,n,i)},decodeGltfBuffer(t,r,n,i,o,u){a(e.exports[l[o]],t,r,n,i,e.exports[s[u]])}}})())}}function eu(e,t=!0,r=!0,n){return(0,eo.F)(d,e,el(t,r,n))}eu.preload=(e,t=!0,r=!0,n)=>eo.F.preload(d,e,el(t,r,n)),eu.clear=e=>eo.F.clear(d,e),eu.setDecoderPath=e=>{es=e}},9457:(e,t,r)=>{"use strict";r.d(t,{v:()=>i});var n=r(1698);class i extends n.Object3D{constructor(e=document.createElement("div")){super(),this.isCSS2DObject=!0,this.element=e,this.element.style.position="absolute",this.element.style.userSelect="none",this.element.setAttribute("draggable",!1),this.center=new n.Vector2(.5,.5),this.addEventListener("removed",function(){this.traverse(function(e){e.element instanceof Element&&null!==e.element.parentNode&&e.element.parentNode.removeChild(e.element)})})}copy(e,t){return super.copy(e,t),this.element=e.element.cloneNode(!0),this.center=e.center,this}}
545new n.Vector3,new n.Matrix4,new n.Matrix4,new n.Vector3,new n.Vector3},9656:(e,t,r)=>{"use strict";r.d(t,{Ay:()=>s,Ik:()=>u});var n=r(5159);function i(e,t,r,n,i){var o=e*e,a=o*e;return((1-3*e+3*o-a)*t+(4-6*o+3*a)*r+(1+3*e+3*o-3*a)*n+a*i)/6}var o=r(8822);function a(e,t){var r=t-e;return r?function(t){return e+t*r}:(0,o.A)(isNaN(e)?t:e)}let s=function e(t){var r,i=1==(r=+t)?a:function(e,t){var n,i,a;return t-e?(n=e,i=t,n=Math.pow(n,a=r),i=Math.pow(i,a)-n,a=1/a,function(e){return Math.pow(n+e*i,a)}):(0,o.A)(isNaN(e)?t:e)};function s(e,t){var r=i((e=(0,n.Qh)(e)).r,(t=(0,n.Qh)(t)).r),o=i(e.g,t.g),s=i(e.b,t.b),l=a(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=o(t),e.b=s(t),e.opacity=l(t),e+""}}return s.gamma=e,s}(1);function l(e){return function(t){var r,i,o=t.length,a=Array(o),s=Array(o),l=Array(o);for(r=0;r<o;++r)i=(0,n.Qh)(t[r]),a[r]=i.r||0,s[r]=i.g||0,l[r]=i.b||0;return a=e(a),s=e(s),l=e(l),i.opacity=1,function(e){return i.r=a(e),i.g=s(e),i.b=l(e),i+""}}}var u=l(function(e){var t=e.length-1;return function(r){var n=r<=0?r=0:r>=1?(r=1,t-1):Math.floor(r*t),o=e[n],a=e[n+1],s=n>0?e[n-1]:2*o-a,l=n<t-1?e[n+2]:2*a-o;return i((r-n/t)*t,s,o,a,l)}});l(function(e){var t=e.length;return function(r){var n=Math.floor(((r%=1)<0?++r:r)*t),o=e[(n+t-1)%t],a=e[n%t],s=e[(n+1)%t],l=e[(n+2)%t];return i((r-n/t)*t,o,a,s,l)}})}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.