vendor: 9,063 bytes, lines 1-39
1/******/ (() => { // webpackBootstrap 2/******/ "use strict"; 3/******/ var __webpack_modules__ = ({ 4 5/***/ 315 6() { 7 8 9/** 10 * The code below uses open source software. Please visit the URL below for an overview of the licenses: 11 * http://js.api.here.com/v3/3.1.61.0/HERE_NOTICE 12 */ 13 14(function(){/* 15 16 Copyright The Closure Library Authors. 17 SPDX-License-Identifier: Apache-2.0 18*/ 19var m,ba=[];function ca(a){return function(){return ba[a].apply(this,arguments)}}function da(a,b){return ba[a]=b}function ea(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}}function fa(a){var b="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return b?b.call(a):{next:ea(a)}}function ha(a){for(var b,c=[];!(b=a.next()).done;)c.push(b.value);return c} 20function ia(a){a=["object"==typeof globalThis&&globalThis,a,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var b=0;b<a.length;++b){var c=a[b];if(c&&c.Math==Math)return c}throw Error("Cannot find global object");}var ja=ia(this),ka="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(a==Array.prototype||a==Object.prototype)return a;a[b]=c.value;return a}; 21function la(a,b){if(b)a:{var c=ja;a=a.split(".");for(var d=0;d<a.length-1;d++){var e=a[d];if(!(e in c))break a;c=c[e]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&null!=b&&ka(c,a,{configurable:!0,writable:!0,value:b})}} 22la("Symbol",function(a){function b(f){if(this instanceof b)throw new TypeError("Symbol is not a constructor");return new c(d+(f||"")+"_"+e++,f)}function c(f,g){this.Sx=f;ka(this,"description",{configurable:!0,writable:!0,value:g})}if(a)return a;c.prototype.toString=function(){return this.Sx};var d="jscomp_symbol_"+(1E9*Math.random()>>>0)+"_",e=0;return b}); 23la("Symbol.iterator",function(a){if(a)return a;a=Symbol("Symbol.iterator");for(var b="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),c=0;c<b.length;c++){var d=ja[b[c]];"function"===typeof d&&"function"!=typeof d.prototype[a]&&ka(d.prototype,a,{configurable:!0,writable:!0,value:function(){return ma(ea(this))}})}return a});function ma(a){a={next:a};a[Symbol.iterator]=function(){return this};return a} 24la("globalThis",function(a){return a||ja});function na(a,b){a instanceof String&&(a+="");var c=0,d=!1,e={next:function(){if(!d&&c<a.length){var f=c++;return{value:b(f,a[f]),done:!1}}d=!0;return{done:!0,value:void 0}}};e[Symbol.iterator]=function(){return e};return e}la("Array.prototype.keys",function(a){return a?a:function(){return na(this,function(b){return b})}}); 25function oa(a,b,c){a instanceof String&&(a=String(a));for(var d=a.length,e=0;e<d;e++){var f=a[e];if(b.call(c,f,e,a))return{Hu:e,Ix:f}}return{Hu:-1,Ix:void 0}}la("Array.prototype.find",function(a){return a?a:function(b,c){return oa(this,b,c).Ix}});var pa; 26if("function"==typeof Object.setPrototypeOf)pa=Object.setPrototypeOf;else{var qa;a:{var ra={a:!0},sa={};try{sa.__proto__=ra;qa=sa.a;break a}catch(a){}qa=!1}pa=qa?function(a,b){a.__proto__=b;if(a.__proto__!==b)throw new TypeError(a+" is not extensible");return a}:null}var ta=pa;la("Object.setPrototypeOf",function(a){return a||ta});la("Array.prototype.entries",function(a){return a?a:function(){return na(this,function(b,c){return[b,c]})}}); 27la("Promise",function(a){function b(g){this.s=0;this.rf=void 0;this.Uh=[];this.Yu=!1;var h=this.ap();try{g(h.resolve,h.reject)}catch(k){h.reject(k)}}function c(){this.Ie=null}function d(g){return g instanceof b?g:new b(function(h){h(g)})}if(a)return a;c.prototype.ft=function(g){if(null==this.Ie){this.Ie=[];var h=this;this.gt(function(){h.cz()})}this.Ie.push(g)};var e=ja.setTimeout;c.prototype.gt=function(g){e(g,0)};c.prototype.cz=function(){for(;this.Ie&&this.Ie.length;){var g=this.Ie;this.Ie=[]; 28for(var h=0;h<g.length;++h){var k=g[h];g[h]=null;try{k()}catch(l){this.py(l)}}}this.Ie=null};c.prototype.py=function(g){this.gt(function(){throw g;})};b.prototype.ap=function(){function g(l){return function(n){k||(k=!0,l.call(h,n))}}var h=this,k=!1;return{resolve:g(this.SC),reject:g(this.zr)}};b.prototype.SC=function(g){if(g===this)this.zr(new TypeError("A Promise cannot resolve to itself"));else if(g instanceof b)this.hD(g);else{a:switch(typeof g){case "object":var h=null!=g;break a;case "function":h= 29!0;break a;default:h=!1}h?this.RC(g):this.au(g)}};b.prototype.RC=function(g){var h=void 0;try{h=g.then}catch(k){this.zr(k);return}"function"==typeof h?this.iD(h,g):this.au(g)};b.prototype.zr=function(g){this.bx(2,g)};b.prototype.au=function(g){this.bx(1,g)};b.prototype.bx=function(g,h){if(0!=this.s)throw Error("Cannot settle("+g+", "+h+"): Promise already settled in state"+this.s);this.s=g;this.rf=h;2===this.s&&this.VC();this.ez()};b.prototype.VC=function(){var g=this;e(function(){if(g.QB()){var h= 30ja.console;"undefined"!==typeof h&&h.error(g.rf)}},1)};b.prototype.QB=function(){if(this.Yu)return!1;var g=ja.CustomEvent,h=ja.Event,k=ja.dispatchEvent;if("undefined"===typeof k)return!0;"function"===typeof g?g=new g("unhandledrejection",{cancelable:!0}):"function"===typeof h?g=new h("unhandledrejection",{cancelable:!0}):(g=ja.document.createEvent("CustomEvent"),g.initCustomEvent("unhandledrejection",!1,!0,g));g.promise=this;g.reason=this.rf;return k(g)};b.prototype.ez=function(){if(null!=this.Uh){for(var g= 310;g<this.Uh.length;++g)f.ft(this.Uh[g]);this.Uh=null}};var f=new c;b.prototype.hD=function(g){var h=this.ap();g.Jl(h.resolve,h.reject)};b.prototype.iD=function(g,h){var k=this.ap();try{g.call(h,k.resolve,k.reject)}catch(l){k.reject(l)}};b.prototype.then=function(g,h){function k(q,r){return"function"==typeof q?function(v){try{l(q(v))}catch(w){n(w)}}:r}var l,n,p=new b(function(q,r){l=q;n=r});this.Jl(k(g,l),k(h,n));return p};b.prototype.catch=function(g){return this.then(void 0,g)};b.prototype.Jl=function(g, 32h){function k(){switch(l.s){case 1:g(l.rf);break;case 2:h(l.rf);break;default:throw Error("Unexpected state: "+l.s);}}var l=this;null==this.Uh?f.ft(k):this.Uh.push(k);this.Yu=!0};b.resolve=d;b.reject=function(g){return new b(function(h,k){k(g)})};b.race=function(g){return new b(function(h,k){for(var l=fa(g),n=l.next();!n.done;n=l.next())d(n.value).Jl(h,k)})};b.all=function(g){var h=fa(g),k=h.next();return k.done?d([]):new b(function(l,n){function p(v){return function(w){q[v]=w;r--;0==r&&l(q)}}var q= 33[],r=0;do q.push(void 0),r++,d(k.value).Jl(p(q.length-1),n),k=h.next();while(!k.done)})};return b});la("Object.values",function(a){return a?a:function(b){var c=[],d;for(d in b)Object.prototype.hasOwnProperty.call(b,d)&&c.push(b[d]);return c}});la("Object.is",function(a){return a?a:function(b,c){return b===c?0!==b||1/b===1/c:b!==b&&c!==c}}); 34la("Array.prototype.includes",function(a){return a?a:function(b,c){var d=this;d instanceof String&&(d=String(d));var e=d.length;c=c||0;for(0>c&&(c=Math.max(c+e,0));c<e;c++){var f=d[c];if(f===b||Object.is(f,b))return!0}return!1}}); 35la("String.prototype.includes",function(a){return a?a:function(b,c){if(null==this)throw new TypeError("The 'this' value for String.prototype.includes must not be null or undefined");if(b instanceof RegExp)throw new TypeError("First argument to String.prototype.includes must not be a regular expression");return-1!==(this+"").indexOf(b,c||0)}});la("Object.entries",function(a){return a?a:function(b){var c=[],d;for(d in b)Object.prototype.hasOwnProperty.call(b,d)&&c.push([d,b[d]]);return c}}); 36var ua="function"==typeof Object.assign?Object.assign:function(a,b){for(var c=1;c<arguments.length;c++){var d=arguments[c];if(d)for(var e in d)Object.prototype.hasOwnProperty.call(d,e)&&(a[e]=d[e])}return a};la("Object.assign",function(a){return a||ua});la("Array.prototype.fill",function(a){return a?a:function(b,c,d){var e=this.length||0;0>c&&(c=Math.max(0,e+c));if(null==d||d>e)d=e;d=Number(d);0>d&&(d=Math.max(0,e+d));for(c=Number(c||0);c<d;c++)this[c]=b;return this}}); 37function va(a){return a?a:Array.prototype.fill}la("Int8Array.prototype.fill",va);la("Uint8Array.prototype.fill",va);la("Uint8ClampedArray.prototype.fill",va);la("Int16Array.prototype.fill",va);la("Uint16Array.prototype.fill",va);la("Int32Array.prototype.fill",va);la("Uint32Array.prototype.fill",va);la("Float32Array.prototype.fill",va);la("Float64Array.prototype.fill",va);la("Math.log2",function(a){return a?a:function(b){return Math.log(b)/Math.LN2}}); 38la("Array.prototype.findIndex",function(a){return a?a:function(b,c){return oa(this,b,c).Hu}});var wa=this||self;function xa(a,b,c,d){a=a.split(".");d=d||wa;a[0]in d||"undefined"==typeof d.execScript||d.execScript("var "+a[0]);for(var e;a.length&&(e=a.shift());)if(a.length||void 0===b)d=d[e]&&d[e]!==Object.prototype[e]?d[e]:d[e]={};else if(!c&&ya(b)&&ya(d[e]))for(var f in b)b.hasOwnProperty(f)&&(d[e][f]=b[f]);else d[e]=b}function za(){} 39function Aa(a){var b=typeof a;return"object"!=b?b:a?Array.isArray(a)?"array":b:"null"}function Ca(a){var b=Aa(a);return"array"==b||"object"==b&&"number"==typeof a.length}function ya(a){var b=typeof a;return"object"==b&&null!=a||"function"==b}
39function Da(a){return Object.prototype.hasOwnProperty.call(a,Ea)&&a[Ea]||(a[Ea]=++Fa)}var Ea="closure_uid_"+(1E9*Math.random()>>>0),Fa=0;function Ga(a,b,c){return a.call.apply(a.bind,arguments)} 40function Ha(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var e=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(e,d);return a.apply(b,e)}}return function(){return a.apply(b,arguments)}}function Ia(a,b,c){Ia=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?Ga:Ha;return Ia.apply(null,arguments)} 41function Ja(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var d=c.slice();d.push.apply(d,arguments);return a.apply(this,d)}}function t(a,b){xa(a,b,!0,void 0)}function u(a,b){function c(){}c.prototype=b.prototype;a.g=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.WD=function(d,e,f){for(var g=Array(arguments.length-2),h=2;h<arguments.length;h++)g[h-2]=arguments[h];return b.prototype[e].apply(d,g)}};var Ka,Ma,Na;function Oa(){}t("H.util.ICharStream",Oa);Oa.prototype.next=function(){};Oa.prototype.yi=function(){};Oa.prototype.mh=function(){};Oa.prototype.eb=function(){};function Qa(a){this.Lu=String(a);this.kw=0;this.Ec=[];this.Yf=!1}t("H.util.CharStream",Qa);Qa.prototype.next=function(){var a=this.Lu.charCodeAt(this.kw++);a=isNaN(a)?-1:a;this.Yf&&this.Ec.push(a);return a};Qa.prototype.yi=function(){this.Yf=!0;this.Ec=[]};Qa.prototype.mh=function(){var a=this.Ec.slice();this.Yf=!1;this.Ec=[];return a};Qa.prototype.eb=function(){var a=this.Lu.charCodeAt(this.kw+0);return isNaN(a)?-1:a};function Ra(a,b){for(var c in a)if(b.call(void 0,a[c],c,a))return!0;return!1}function Sa(a){for(var b in a)return!1;return!0}function Ta(a){var b={},c;for(c in a)b[c]=a[c];return b}var Va="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function Wa(a,b){for(var c,d,e=1;e<arguments.length;e++){d=arguments[e];for(c in d)a[c]=d[c];for(var f=0;f<Va.length;f++)c=Va[f],Object.prototype.hasOwnProperty.call(d,c)&&(a[c]=d[c])}};function Xa(a,b){if(Error.captureStackTrace)Error.captureStackTrace(this,Xa);else{var c=Error().stack;c&&(this.stack=c)}a&&(this.message=String(a));b&&(this.YD=b)}u(Xa,Error);Xa.prototype.name="CustomError";var Ya=Array.prototype.indexOf?function(a,b){return Array.prototype.indexOf.call(a,b,void 0)}:function(a,b){if("string"===typeof a)return"string"!==typeof b||1!=b.length?-1:a.indexOf(b,0);for(var c=0;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1};function Za(){return Object.create(x,void 0)}var z=Ia,$a=String,ab=globalThis.Object.freeze||function(a){return a};function bb(a){for(var b=Object.keys(a),c=b.length,d;c--;)d=a[b[c]],ya(d)&&bb(d);return ab(a)}function cb(a){var b=Aa(a);if("object"==b||"array"==b){if(db(a.clone))return a.clone();b="array"==b?[]:{};for(var c in a)a.hasOwnProperty(c)&&(b[c]=cb(a[c]));return b}return a}var A=[].pop(),x=/x/.exec(""),eb="prototype constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "); 42function B(a,b,c,d,e){if(!(b=a instanceof b)&&c)throw new C(c,d,fb(e)?e:a);return b}function gb(a,b){if(!0===(B(a,b)&&a.constructor===b))throw new TypeError("Illegal constructor "+hb(b));}function db(a){return"function"==Aa(a)}function ib(a,b,c,d,e){if(!(b=jb(a)===b)&&c)throw new C(c,d,fb(e)?e:a);return b}function kb(a,b,c,d){return ib(a,"Array",b,c,d)}t("H.lang.isArray",kb);function fb(a){return a!==A}function lb(a){return"string"===typeof a}t("H.lang.isString",lb); 43var mb=parseInt,nb=parseFloat,D=isNaN;function ob(a){return a===+a}t("H.lang.isNumber",ob);t("H.lang.isInteger",Number.isInteger?Number.isInteger:function(a){return"number"===typeof a&&0===a%1});function pb(a){return!D(+a)}function jb(a){var b=Object[eb[0]][eb[6]].call(a).match(/^\[object (\w+)\]$/);return b?b[1]:typeof a}var qb=[];function rb(a){0>qb.indexOf(a)&&qb.push(a)}rb(qb); 44function hb(a,b,c,d){var e="",f=2>arguments.length,g;f&&(b={H:globalThis.H},c="",d=qb.slice());sb(b,!0,function(h,k){try{if(g=h[k],k=tb(h,g),!(ya(g)&&g.window===g&&g.self===g||ya(g)&&0<g.nodeType&&db(g.cloneNode))&&ya(g)){if(g===a)return e=c+"."+k,!0;if(0>d.indexOf(g)&&(d.push(g),e=hb(a,g,c+"."+k,d)))return!0}}catch(l){}});f&&(e=e?e.substr(1).replace("."+eb[0]+".","#"):"~"+(db(a)?ub(a)+"()":jb(a)));return e} 45function tb(a,b){var c=[];sb(a,!1,function(d,e){d[e]===b&&c.push(e)});return c.sort(wb)[0]}function wb(a,b){return b.length-a.length}var xb=Object[eb[0]][eb[2]];
45function sb(a,b,c){var d;if(a){for(e in a)if((!b||xb.call(a,e))&&c(a,e,!0))return;for(d=eb.length;d--;){var e=eb[d];if((!b||xb.call(a,e))&&c(a,e,!1))break}}}function ub(a){return(a=/^\s*function ([^\( ]+)/.exec(a))?a[1]:"anonymous"}function yb(a,b,c){c[b]="#"+b}var zb=!!globalThis.__karma__; 46function Ab(){throw Error("unimplemented method");}function C(a,b,c){var d=arguments.length,e;b=b!==A?+b:b;b!==A&&((e=/^.*?\(([^\)]+)/.exec((""+a).replace(/(\/\*([\s\S]*?)\*\/)|(\/\/(.*)$)/gm,"")))?(e=e[1].replace(/\s+/g,""),e=$a(e).split(","!==A?",":" ")):e=[],e.forEach(yb),e=e[b]||"#"+b);var f=a?hb(a):"";d=2<d?$a(c):"";if(e||d)f+=" (Argument "+(e||"")+(d?" "+d:"")+")";d=Error(f);Object.setPrototypeOf(d,C.prototype);return d}u(C,Error);t("H.lang.InvalidArgumentError",C);C.prototype.name="InvalidArgumentError"; 47function Bb(a,b){var c=[];a&&c.push(hb(a));1<arguments.length&&c.push(""+b);c=Error(c.join(" "));Object.setPrototypeOf(c,Bb.prototype);return c}u(Bb,Error);t("H.lang.IllegalOperationError",Bb);Bb.prototype.name="IllegalOperationError";function Cb(a,b,c){var d=[],e=arguments.length;a&&d.push(hb(a));1<e&&(e=2<e&&kb(c)?" out of ["+c[0]+"..."+c[1]+"]":"",d.push("("+b+e+")"));d=Error(d.join(" "));Object.setPrototypeOf(d,Cb.prototype);return d}u(Cb,Error);t("H.lang.OutOfRangeError",Cb);Cb.prototype.name="OutOfRangeError";var Db=Math,Eb=Db.min,Fb=Db.max,Gb=Db.round,Hb=Db.floor,Ib=Db.ceil,Jb=Db.abs,Kb=Db.log,Lb=Db.sqrt,Mb=Db.pow,Nb=Db.exp,Ob=Db.sin,Pb=Db.asin,Qb=Db.cos,Rb=Db.tan,Sb=Db.atan,Tb=Db.atan2,Ub=Db.LN2,Vb=Db.PI,Wb=Vb/2,Xb=Vb/4,Yb=2*Vb,Zb=3*Vb,$b=Vb/180,ac=180/Vb,bc=1/0,cc=Mb(-2,53),dc=dc||function(a){return Kb(a)/Ub};function ec(a,b){var c;return 0>(c=a%b)===0>b?c:c+b}function fc(a,b,c){b-=c=c||0;a-=c;return a-Hb(a/b)*b+c}t("H.math.normalize",fc);function gc(a,b,c){return(a-=0)>c?c:a<b?b:a} 48t("H.math.clamp",gc);function hc(a,b,c,d){(d-=0)||(d=0);return b<c?a>=b-d&&a<=c+d:a>=c-d&&a<=b+d}var kc={NONE:0,VERTEX:1,EDGE:2,SURFACE:3};t("H.math.CoverType",kc); 49function lc(a,b,c,d,e,f){var g=c.length,h=g,k=c[0],l=0,n=0,p=0;d=d/2||0;var q=f||2;f=q*(e?0:1)+1;for(var r=q-2;1!=l&&h>f;){h-=r;var v=c[--h];q=c[--h];var w=c[h?h-r-1:(g+(h-r-1))%g];var y=c[h?h-r-2:(g+(h-r-2))%g];if(q>=a-d&&q<=a+d&&v>=b-d&&v<=b+d||y>=a-d&&y<=a+d&&w>=b-d&&w<=b+d)l=1;else if(!l&&q===a)y===a&&(v<b&&w>b||v>b&&w<b)||(k<=a&&y>a||k>=a&&y<a)&&(v>=b?++n:++p),l=hc(b,v,w,d)&&Lb(Mb((a-y)*(v-w)-(b-w)*(q-y),2)/(Mb(q-y,2)+Mb(v-w,2)))<=d?2:0;else if(!l&&hc(a,q,y,d)){if(q<a&&y>a||q>a&&y<a)k=v+(a-q)/ 50(y-q)*(w-v),n+=k>b,p+=k<b;l=hc(b,v,w,d)&&Lb(Mb((a-y)*(v-w)-(b-w)*(q-y),2)/(Mb(q-y,2)+Mb(v-w,2)))<=d?2:0}k=q}!l&&e&&0!==p&&0!==n%2&&(l=3);return l}function mc(a,b){return lc(a.x,a.y,b,0,!0)!==kc.NONE}t("H.math.isPointInsidePolygon",mc);function nc(a){for(var b=a.length,c=new Float64Array(2*b),d=b&&fb(a[0].x);b--;){var e=a[b],f=b<<1;c[f]=d?e.x:e[0];c[f+1]=d?e.y:e[1]}return c}t("H.math.flatten",nc);function oc(a,b,c){var d=gc(+a,-90,90);if(b&&D(d))throw new C(b,c,a);return d}function pc(a,b,c){var d=+a;if(-180>d||180<d)d=ec(d+180,360)-180;if(b&&D(d))throw new C(b,c,a);return d}function qc(a,b,c){var d;if(a!==A&&D(d=+a)&&b)throw new C(b,c,a);return d}function rc(a,b){return 0>a!==0>b&&180<Jb(b-a)}t("H.geo.isDBC",rc);function sc(){gb(this,sc)}t("H.geo.AbstractGeometry",sc);sc.prototype.getBoundingBox=sc.prototype.C;sc.prototype.equals=sc.prototype.da;sc.prototype.ac="";sc.prototype.Kc="";sc.prototype.toString=function(){return this.yf([this.ac.toUpperCase()," "]).join("")};sc.prototype.toString=sc.prototype.toString;sc.prototype.ze=function(){return{type:this.Kc,coordinates:this.xf()}};sc.prototype.toGeoJSON=sc.prototype.ze;sc.prototype.P=function(){return{type:this.ac,coordinates:this.Rd(),boundingBox:this.C().P()}}; 51sc.prototype.forWorkerMessage=sc.prototype.P;function tc(a,b,c){this.lat=oc(a,tc,0);this.lng=pc(b,tc,1);c!==A&&(this.alt=qc(c,tc,2))}u(tc,sc);t("H.geo.Point",tc);tc.prototype.da=function(a){return this===a||!!a&&this.lat===a.lat&&this.lng===a.lng&&(this.alt||0)===(a.alt||0)};tc.prototype.equals=tc.prototype.da;tc.prototype.kb=function(a){if(this===a||this.lat===a.lat&&this.lng===a.lng)a=0;else{var b=this.lat*$b;var c=a.lat*$b;a=1.274200158E7*Pb(Eb(1,Lb(Mb(Ob((b-c)/2),2)+Qb(b)*Qb(c)*Mb(Ob((this.lng*$b-a.lng*$b)/2),2))))}return a}; 52tc.prototype.distance=tc.prototype.kb; 53tc.prototype.mo=function(a,b,c){var d;if(c){if(d=b/6371000.79){b=a*$b;a=$b*this.lat;var e=Ob(a);c=Ob(d);var f=Qb(d);d=$b*this.lng;var g=Qb(a);a=Pb(g*Qb(b)*c+e*f);b=Tb(Ob(b)*g*c,f-e*Ob(a));b=(d+b+Vb)%(2*Vb)-Vb;b*=ac;e=new tc(a*ac,(b+540)%360-180)}return e||this}a=(a%360+360)%360;if(0===(a+90)%180)return a=this.lng+b/(6371000.79*Yb*Qb(this.lat*$b))*(270===a?-360:360),new tc(this.lat,(a+540)%360-180);if(b/=6371000.79)a*=$b,e=this.lat*$b,c=this.lng*$b,d=e+b*Qb(a),f=d-e,g=Kb(Rb(d/2+Xb)/Rb(e/2+Xb)),g=D(f/ 54g)?Qb(e):f/g,a=b*Ob(a)/g,Jb(d)>Wb&&(d=0<d?Vb-d:-(Vb+d)),d=new tc(d*ac,((c+a+Zb+(Jb(e+f)>Wb?Vb:0))%Yb-Vb)*ac);return d||this};tc.prototype.walk=tc.prototype.mo;tc.prototype.C=function(){return new E(this.lat,this.lng,this.lat,this.lng)};tc.prototype.getBoundingBox=tc.prototype.C;function uc(a,b,c){var d=ya(a)&&!(D(a.lat=oc(a.lat))||D(a.lng=pc(a.lng))||a.alt!==A&&D(a.alt=qc(a.alt)));if(!d&&b)throw new C(b,c,a);return d}tc.validate=uc; 55function vc(a){if(!a)throw new C(vc,0,a);return new tc(a.lat,a.lng,a.alt)}tc.fromIPoint=vc;m=tc.prototype;m.ac="Point";m.yf=function(a){a.push("(",this.lng," ",this.lat,")");return a};m.Kc="Point";m.xf=function(){return[this.lng,this.lat,this.alt||0]};m.Rd=function(){return[this.lat,this.lng,this.alt||0]};var wc=[62,-1,-1,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-1,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,63,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],xc="undefined"!==typeof BigInt?BigInt:Number; 56function yc(a){var b=xc(0),c=xc(0),d=[];a.split("").forEach(function(e){e=xc(wc[e.charCodeAt(0)-45]);b|=(e&xc(31))<<c;(e&xc(32))===xc(0)?(d.push(b),b=xc(0),c=xc(0)):c+=xc(5)});if(0<c)throw Error("Invalid encoding");return d}function zc(a){a&xc(1)&&(a=~a);a>>=xc(1);return+a.toString()} 57function Ac(a){var b=void 0===a.precision?5:a.precision,c=void 0===a.hl?0:a.hl,d=void 0===a.il?0:a.il;a=a.kr;var e=Math.pow(10,b),f=Math.pow(10,d);if(0>b||15<b)throw Error("precision out of range. Should be between 0 and 15");if(0>d||15<d)throw Error("thirdDimPrecision out of range. Should be between 0 and 15");if(0>c||7<c||4===c||5===c)throw Error("thirdDim should be between 0, 1, 2, 3, 6 or 7");b=Bc(1)+Bc(d<<7|c<<4|b);var g=[],h=xc(0),k=xc(0),l=xc(0);a.forEach(function(n){var p=xc(Math.round(n[0]* 58e));g.push(Dc(p-h));h=p;p=xc(Math.round(n[1]*e));g.push(Dc(p-k));k=p;c&&(n=xc(Math.round(n[2]*f)),g.push(Dc(n-l)),l=n)});return[].concat(b instanceof Array?b:ha(fa(b)),g instanceof Array?g:ha(fa(g))).join("")}function Bc(a){var b="";for(a=xc(a);31<a;)b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"[a&xc(31)|xc(32)],a>>=xc(5);return b+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"[a]}function Dc(a){a=xc(a);var b=0>a;a<<=xc(1);b&&(a=~a);return Bc(a)} 59function Ec(a){return Ac({kr:a.polyline,precision:a.precision,hl:a.thirdDim,il:a.thirdDimPrecision})}t("H.util.flexiblePolyline.encode",Ec); 60function Fc(a){a=yc(a);if(1!==+a[0].toString())throw Error("Invalid format version");var b=+a[1].toString();b={precision:b&15,hl:b>>4&7,il:b>>7&15};for(var c=Math.pow(10,b.precision),d=Math.pow(10,b.il),e=b.hl,f=0,g=0,h=0,k=[],l=2;l<a.length;){var n=zc(a[l+1])/c;f+=zc(a[l])/c;g+=n;
60e?(h+=zc(a[l+2])/d,k.push([f,g,h]),l+=3):(k.push([f,g]),l+=2)}if(l!==a.length)throw Error("Invalid encoding. Premature ending reached");a=Object.assign({},b,{kr:k});return{polyline:a.kr,precision:a.precision,thirdDim:a.hl, 61thirdDimPrecision:a.il}}t("H.util.flexiblePolyline.decode",Fc);function Gc(a,b,c,d,e,f){gb(this,Gc);this.Ph=a||10;this.xj=null;this.Yi=d||0;this.Zi=e||0;this.Bk=b||1;this.Ck=c||1;this.Mx=!!f;this.flush()}function Hc(a){var b=a.xj;if(a.Mx&&!b){var c=a.head;if(c.entries||c[0]||c[1]||c[2]||c[3])b=[c],b=Ic([b,b,b,b],[c[6],c[7],c[4],c[5]]),a.xj=b}return b} 62function Ic(a,b){var c,d,e,f,g=0;for(c=3;0<=c;c--){var h=c+4;var k=0<c%3;var l=[];var n=b[c];var p=a[c];for(d=p.length;d--;){var q=p[d];if(e=q.entries)for(f=e.length;f--;){var r=e[f].Of(c);if(k?r>n:r<n)n=r}for(f=4;f--;)(e=q[f])&&(k?e[h]>n:e[h]<n)&&l.push(e)}g+=l.length;b[c]=n;a[c]=l}g&&(b=Ic(a,b));return b}function Jc(a,b,c){var d,e;if(a.Mx&&(d=a.xj))for(e=3;0<=e;e--){var f=b.Of(e);if(e%3?f>=d[e]:f<=d[e])if(c)d[e]=f;else{a.xj=null;break}}}m=Gc.prototype; 63m.remove=function(a){var b,c,d,e=!1;a&&(b=a.node)&&b.nl===this&&(c=b.entries)&&0<=(d=c.indexOf(a))&&(c.splice(d,1),this.Ll(b),Jc(this,a,!1),e=!0);return e};m.flush=function(){var a=new Lc(A,NaN,this.Yi-this.Bk,this.Zi-this.Ck,this.Yi+this.Bk,this.Zi+this.Ck);a.nl=this;this.head=this.root=a;this.xj=null};m.ld=function(a){var b=this.head,c;if(a){var d=a;if(d!==b)for(b=d;d=d.parent;)if(d.entries||1<d.hb)b=d}else for(;!b.entries&&2>(c=b.hb);)if(c)b=d;else break;this.head=b}; 64m.ob=function(a,b,c,d,e,f){var g=[],h=this.head,k=this.root;a<=h[5]&&b<=h[6]&&(e?c>=h[7]:c>h[7])&&(f?d>=h[4]:d>h[4])&&Mc(this,h,g,a,b,c,d,f||d>=k[6],e||c>=k[5]);return g}; 65function Mc(a,b,c,d,e,f,g,h,k){var l=b.entries,n=b[7],p=b[4],q=b[5],r=b[6],v=b[8],w=b[9],y;if(l){var F=l.length;if(e>p||d>n||g<r||f<q)for(;F--;){n=l[F];p=n.Of(3);q=n.Of(0);r=n.Of(1);var G=n.Of(2);G>=e&&r>=d&&(q<g||h&&q==g)&&(p<f||k&&p==f)&&c.push(n)}else for(;F--;)c.push(l[F])}if(f>v||k&&f==v)e<w&&(y=b[1])&&Mc(a,y,c,d,e,f,g,h,k),(g>w||h&&g==w)&&(y=b[3])&&Mc(a,y,c,d,e,f,g,h,k);d<v&&(e<w&&(y=b[0])&&Mc(a,y,c,d,e,f,g,h,k),(g>w||h&&g==w)&&(y=b[2])&&Mc(a,y,c,d,e,f,g,h,k))}m.Ae=ca(1);var Nc=0; 66function Lc(a,b,c,d,e,f){this.Co=b;a&&(this.parent=a,this.nl=a.nl,b&1?(c=a[8],e=a[5]):(c=a[7],e=a[8]),b&2?(d=a[9],f=a[6]):(d=a[4],f=a[9]));this[7]=c;this[5]=e;this[8]=(c+e)/2;this[4]=d;this[6]=f;this[9]=(d+f)/2}m=Lc.prototype;m.hb=0;m.th=function(a){return this[a]||(++this.hb,this[a]=new Lc(this,a))};m.removeChild=function(a){var b=a.Co;this[b]===a&&(delete this[b],delete a.parent,--this.hb)};m.Ae=ca(0);m.Qg=function(a){(this.entries||(this.entries=[])).push(a);a.node=this}; 67function Oc(a,b,c,d,e){var f=a[5],g=a[6];return a[7]<=b&&a[4]<=c&&(f>d||f===d&&f===a.nl.root[5])&&(g>e||g===e&&g===a.nl.root[6])};function Pc(a,b,c,d,e,f){Pc.g.constructor.apply(this,arguments)}u(Pc,Gc);Pc.prototype.Ll=function(a){for(var b,c,d=this.head;a;){if(!(b=a.entries)||!b.length)if(b&&delete a.entries,!a.hb&&(c=a.parent)){c.removeChild(a);d===a&&(d=c);a=c;continue}break}this.head!==d&&(this.head=d,this.ld())};function Qc(a,b,c,d,e){if(Oc(a.root,b,c,d,e))return a.Vb(a.root,b,c,d,e,a.Ph);throw Error("Coordinates out of bounds");} 68Pc.prototype.Ou=function(a,b,c,d){if(a>c){var e=a;a=c;c=e}b>d&&(e=b,b=d,d=e);return Qc(this,a,b,c,d)};Pc.prototype.Zd=function(a,b){return Qc(this,a,b,a,b)};Pc.prototype.Vb=function(a,b,c,d,e,f){var g=a[8],h=a[9],k=0,l=0;f&&(d<g||(k=+(b>=g)))&&(e<h||(l=+(c>=h)))?b=this.Vb(a.th(k|l<<1),b,c,d,e,f-1):(a.Qg(b=new Rc(b,c,d,e)),Jc(this,b,!0),this.ld(a));return b};function Rc(a,b,c,d){this.id=Nc++;this[0]=b;this[1]=c;this[2]=d;this[3]=a}Rc.prototype.Of=function(a){return this[a]};function E(a,b,c,d){Sc(this,oc(a,E,0),pc(b,E,1),oc(c,E,2),pc(d,E,3))}u(E,sc);t("H.geo.Rect",E);E.prototype.ac="Polygon";E.prototype.yf=function(a){var b=this.fa,c=this.W,d=this.ga,e=this.ca;a.push("(","(",c," ",b,",",e," ",b,",",e," ",d,",",c," ",d,",",c," ",b,")",")");return a};E.prototype.da=function(a){var b=this===a;!b&&B(a,E)&&(b=this.fa===a.fa&&this.W===a.W&&this.ga===a.ga&&this.ca===a.ca);return b};E.prototype.equals=E.prototype.da; 69E.prototype.clone=function(){return new E(this.fa,this.W,this.ga,this.ca)};E.prototype.clone=E.prototype.clone;function Sc(a,b,c,d,e){a.W=c;a.ca=e;b<d&&(c=b,b=d,d=c);a.fa=b;a.ga=d;a.ll=a.Ri=a.Ef=null;return a}E.prototype.Oc=function(){this.ll||(this.ll=new tc(this.fa,this.W));return this.ll};E.prototype.getTopLeft=E.prototype.Oc;E.prototype.Mc=function(){this.Ri||(this.Ri=new tc(this.ga,this.ca));return this.Ri};E.prototype.getBottomRight=E.prototype.Mc;E.prototype.KA=function(){return this.fa}; 70E.prototype.getTop=E.prototype.KA;E.prototype.yz=function(){return this.ga};E.prototype.getBottom=E.prototype.yz;E.prototype.eA=function(){return this.W};E.prototype.getLeft=E.prototype.eA;E.prototype.AA=function(){return this.ca};E.prototype.getRight=E.prototype.AA;E.prototype.wb=function(){this.Ef||(this.Ef=new tc(this.ga+(this.fa-this.ga)/2,Tc(this.W,this.oc())));return this.Ef};E.prototype.getCenter=E.prototype.wb;E.prototype.oc=function(){return Uc(this.W,this.ca)};E.prototype.getWidth=E.prototype.oc; 71E.prototype.yh=function(){return this.fa-this.ga};E.prototype.getHeight=E.prototype.yh;E.prototype.qc=function(){return this.W>this.ca};E.prototype.isCDB=E.prototype.qc;
71E.prototype.Im=function(){return!this.oc()&&!this.yh()};E.prototype.isEmpty=E.prototype.Im;E.prototype.C=function(){return new E(this.fa,this.W,this.ga,this.ca)};E.prototype.getBoundingBox=E.prototype.C; 72E.prototype.Pl=function(a,b,c){var d=this.wb();c||(a=oc(a,this.Pl,0),b=pc(b,this.Pl,1));b=this.df(a,b,c);a=b.wb();return a.lat===d.lat&&a.lng===d.lng&&this.yh()===b.yh()&&this.oc()===b.oc()};E.prototype.containsLatLng=E.prototype.Pl;E.prototype.Gf=function(a,b){b||uc(a,this.Gf,0);return this.Pl(a.lat,a.lng,b)};E.prototype.containsPoint=E.prototype.Gf; 73E.prototype.Vo=function(a,b){var c=this.wb();if(!b&&!B(a,E))throw new C(this.Vo,0,a);b=this.zd(a,b);a=b.wb();return a.lat===c.lat&&a.lng===c.lng&&this.yh()===b.yh()&&this.oc()===b.oc()};E.prototype.containsRect=E.prototype.Vo;E.prototype.df=function(a,b,c,d){if(!c){if(D(a=oc(a)))throw new C(this.df,0,a);if(D(b=pc(b)))throw new C(this.df,1,b);}return Vc(this.fa,this.W,this.ga,this.ca,a,b,a,b,d)};E.prototype.mergeLatLng=E.prototype.df; 74E.prototype.zv=function(a,b,c){b||uc(a,this.zv,0);return this.df(a.lat,a.lng,b,c)};E.prototype.mergePoint=E.prototype.zv;E.prototype.zd=function(a,b,c){if(!b&&!B(a,E))throw new C(this.zd,0,a);return Vc(this.fa,this.W,this.ga,this.ca,a.fa,a.W,a.ga,a.ca,c)};E.prototype.mergeRect=E.prototype.zd;E.prototype.de=function(a,b,c,d,e,f){e||(a=oc(a,this.de,0),b=pc(b,this.de,1),c=oc(c,this.de,2),d=pc(d,this.de,3));return Vc(this.fa,this.W,this.ga,this.ca,a,b,c,d,f)};E.prototype.mergeTopLeftBottomRight=E.prototype.de; 75E.prototype.Wf=function(a,b){var c=this.W<=this.ca,d=a.W<=a.ca,e=this.W<a.ca,f=a.W<this.ca;if(!b&&!B(a,E))throw new C(this.Wf,0,a);return this.ga<=a.fa&&a.ga<=this.fa&&(!c&&(!d||e||f)||!d&&(e||f)||e&&f)};E.prototype.intersects=E.prototype.Wf;function Uc(a,b){a=b-a;return a+(0>a?360:0)}function Tc(a,b){a+=b/2;return a-(180<a?360:0)} 76function Vc(a,b,c,d,e,f,g,h,k){c=Eb(c,g);a=Fb(a,e);e=Uc(b,d);var l=Tc(b,e);g=Uc(f,h);var n=Tc(f,g)-l;n+=0>n-1E-6?360:0;if(180>n-1E-6){l=b;var p=h}else n=360-n,l=f,p=d;n=n+e/2+g/2;360<=n+5E-7?(l=-180,p=180):n-5E-7<e?(l=b,p=d):n-5E-7<g&&(l=f,p=h);return k?Sc(k,a,l,c,p):new E(a,l,c,p)}E.merge=Vc;function Wc(a,b,c){c||(uc(a,Wc,0),uc(b,Wc,1));return new E(a.lat,a.lng,b.lat,b.lng)}E.fromPoints=Wc; 77function Xc(a,b){var c=1,d=a.length,e=null;if(!Ca(a))throw new C(Xc,0,a);if(0<d){var f=a[0];for(e=Wc(f,f,b);c<d;c++)f=a[c],e.df(f.lat,f.lng,b,e)}return e}E.coverPoints=Xc;function Yc(a,b){var c=3,d=a.length,e;if(!(b||a&&null!=a.length))throw new C(Yc,0,a);if(0<d)for(e=new E(a[0],a[1],a[0],a[1]);c<d;c+=3)e.df(a[c],a[c+1],b,e);return e}E.coverLatLngAlts=Yc; 78function Zc(a,b){var c=1,d=a.length,e;if(b&&(!a||null==a.length))throw new C(Zc,0,a);if(0<d)for(e=new E(a[0].fa,a[0].W,a[0].ga,a[0].ca);c<d;c++)e.zd(a[c],b,e);return e}E.coverRects=Zc; 79E.prototype.Jw=function(a,b){var c=this.W,d=this.fa,e=this.ca,f=this.ga,g=this.wb().lng;uc(a,this.Jw,0);var h=a.lat-f-(d-f)/2;var k=a.lng-g;k=180<k||-180>k?-(g+a.lng):k;a=c+(0>k?2*k:0);a=-180>a?360+a:a;e+=0<k?2*k:0;e=180<e?e-360:e;d=0<h?d+2*h:d;90<=d&&(d=90);f=0>h?f+2*h:f;-90>=f&&(f=-90);return b?Sc(b,d,a,f,e):new E(d,a,f,e)};E.prototype.resizeToCenter=E.prototype.Jw;E.prototype.Kc="Polygon"; 80E.prototype.xf=function(){return[[this.W,this.fa,0],[this.ca,this.fa,0],[this.ca,this.ga,0],[this.W,this.ga,0],[this.W,this.fa,0]]};E.prototype.P=function(){return this.Rd()};E.prototype.Rd=function(){return[this.fa,this.W,this.ga,this.ca]};function $c(a){this.Be=new Pc(+a||10,180,90,0,0,!0);this.Kl=[];this.kq=!1;this.Df=this.Mg=this.J=null}t("H.geo.QuadTree",$c);m=$c.prototype;m.jc=0;m.qc=function(){return this.kq}; 81m.C=function(){var a,b;if(!this.J){var c=[];!this.Mg&&(a=Hc(this.Be))&&(this.Mg=new E(-a[0],a[3],-a[2],a[1]));(b=this.Mg)&&c.push(b);var d,e,f;if(!this.Df&&(f=(e=this.Kl).length)){a=90;var g=360;var h=-90;for(d=0;f--;){var k=e[f];a=Eb(a,k[0]);g=Eb(g,k[3]);h=Fb(h,k[2]);d=Fb(d,k[1])}this.Df=new E(-a,g,-h,d-360)}(b=this.Df)&&c.push(b);if(b=c[0])c[1]&&(b=b.zd(c[1],!0)),this.J=b}return this.J}; 82m.Vb=function(a,b,c,d,e){e?(e=new Rc(d,-a,b+360,-c),this.Kl.push(e),this.kq=!0,this.Df&&this.Df.de(a,b,c,d,!0,this.Df)):(e=Qc(this.Be,b,-a,d,-c),this.Mg&&this.Mg.de(a,b,c,d,!0,this.Mg));++this.jc;this.J=null;return e};m.Zd=function(a){var b=a.lng;a=a.lat;return this.Vb(a,b,a,b,!1)};m.Mu=function(a){var b=a.Oc(),c=a.Mc();return(a=a.qc())?this.Vb(b.lat,c.lng,c.lat,b.lng,a):this.Vb(b.lat,b.lng,c.lat,c.lng,a)};$c.prototype.insertBoundingBox=$c.prototype.Mu;
83$c.prototype.Ou=function(a,b,c,d){if(b<d)var e=b;else e=d,d=b;a<c?b=c:(b=a,a=c);return this.Vb(b,e,a,d,180<d-e)};$c.prototype.remove=function(a){var b;if(a.node){var c=this.Be.remove(a);this.Mg=null}else if(a=(b=this.Kl).indexOf(a),c=0<=a)b.splice(a,1),this.kq=0<b.length,this.Df=null;c&&(--this.jc,this.J=null);return c};$c.prototype.remove=$c.prototype.remove; 84function ad(a,b,c,d,e,f,g){a=a.Kl;var h=a.length,k=[],l;if(h){var n=c+360;for(l=e+360;h--;){var p=a[h];bd(p,b,c,d,e,f,g)?k.push(p):bd(p,b,n,d,l,f,g)&&k.push(p)}}return k}function bd(a,b,c,d,e,f,g){var h=a[3],k=a[0],l=a[1];a=a[2];return(f?k<=d:k<d)&&(g?h<=e:h<e)&&a>=b&&l>=c}function cd(a,b){var c,d,e;if(c=b.length){var f=a.length;for(d={};f--;)d[a[f].id]=1;for(;c--;)(e=b[c]).id in d||a.push(e)}} 85$c.prototype.Fm=function(a,b,c){var d=this.Be,e=a.Oc(),f=a.Mc(),g=-e.lat;e=e.lng;var h=-f.lat;f=f.lng;!b&&g===h||!c&&e===f?a=[]:a.qc()?(a=d.ob(-180,g,f,h,c,b),cd(a,d.ob(e,g,180,h,!1,b)),cd(a,ad(this,g,f,h,e+360,b,c))):(a=d.ob(e,g,f,h,c,b),cd(a,ad(this,g,e,h,f,b,c)));return a};$c.prototype.intersectBoundingBox=$c.prototype.Fm;function dd(a){a&&"function"==typeof a.l&&a.l()};function ed(){0!=fd&&(gd[Da(this)]=this);this.jh=this.jh;this.fe=this.fe}var fd=0,gd={};ed.prototype.jh=!1;ed.prototype.l=function(){if(!this.jh&&(this.jh=!0,this.disposeInternal(),0!=fd)){var a=Da(this);if(0!=fd&&this.fe&&0<this.fe.length)throw Error(this+" did not empty its onDisposeCallbacks queue. This probably means it overrode dispose() or disposeInternal() without calling the superclass' method.");delete gd[a]}}; 86ed.prototype.bc=function(a,b){this.jh?void 0!==b?a.call(b):a():(this.fe||(this.fe=[]),this.fe.push(void 0!==b?Ia(a,b):a))};ed.prototype.disposeInternal=function(){if(this.fe)for(;this.fe.length;)this.fe.shift()()};function hd(a,b){return-1!=a.indexOf(b)};var id;a:{var jd=wa.navigator;if(jd){var kd=jd.userAgent;if(kd){id=kd;break a}}id=""};function ld(a){ld[" "](a);return a}ld[" "]=za;var md=hd(id,"Gecko")&&!(hd(id.toLowerCase(),"webkit")&&!hd(id,"Edge"))&&!(hd(id,"Trident")||hd(id,"MSIE"))&&!hd(id,"Edge"),nd=hd(id.toLowerCase(),"webkit")&&!hd(id,"Edge");var od=function(){if(!wa.addEventListener||!Object.defineProperty)return!1;var a=!1,b=Object.defineProperty({},"passive",{get:function(){a=!0}});try{wa.addEventListener("test",za,b),wa.removeEventListener("test",za,b)}catch(c){}return a}();function pd(a,b){this.type=a;this.currentTarget=this.target=b;this.defaultPrevented=this.yk=!1}pd.prototype.stopPropagation=function(){this.yk=!0};pd.prototype.preventDefault=function(){this.defaultPrevented=!0};function qd(a,b){pd.call(this,a?a.type:"");this.relatedTarget=this.currentTarget=this.target=null;this.button=this.screenY=this.screenX=this.clientY=this.clientX=this.offsetY=this.offsetX=0;this.key="";this.charCode=this.keyCode=0;this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1;this.state=null;this.pointerId=0;this.pointerType="";this.uj=null;a&&this.Em(a,b)}u(qd,pd);var rd={2:"touch",3:"pen",4:"mouse"}; 87qd.prototype.Em=function(a,b){var c=this.type=a.type,d=a.changedTouches&&a.changedTouches.length?a.changedTouches[0]:null;this.target=a.target||a.srcElement;this.currentTarget=b;if(b=a.relatedTarget){if(md){a:{try{ld(b.nodeName);var e=!0;break a}catch(f){}e=!1}e||(b=null)}}else"mouseover"==c?b=a.fromElement:"mouseout"==c&&(b=a.toElement);this.relatedTarget=b;d?(this.clientX=void 0!==d.clientX?d.clientX:d.pageX,this.clientY=void 0!==d.clientY?d.clientY:d.pageY,this.screenX=d.screenX||0,this.screenY= 88d.screenY||0):(this.offsetX=nd||void 0!==a.offsetX?a.offsetX:a.layerX,this.offsetY=nd||void 0!==a.offsetY?a.offsetY:a.layerY,this.clientX=void 0!==a.clientX?a.clientX:a.pageX,this.clientY=void 0!==a.clientY?a.clientY:a.pageY,this.screenX=a.screenX||0,this.screenY=a.screenY||0);this.button=a.button;this.keyCode=a.keyCode||0;this.key=a.key||"";this.charCode=a.charCode||("keypress"==c?a.keyCode:0);this.ctrlKey=a.ctrlKey;this.altKey=a.altKey;this.shiftKey=a.shiftKey;this.metaKey=a.metaKey;this.pointerId= 89a.pointerId||0;this.pointerType="string"===typeof a.pointerType?a.pointerType:rd[a.pointerType]||"";this.state=a.state;this.uj=a;a.defaultPrevented&&qd.g.preventDefault.call(this)};qd.prototype.stopPropagation=function(){qd.g.stopPropagation.call(this);this.uj.stopPropagation?this.uj.stopPropagation():this.uj.cancelBubble=!0};qd.prototype.preventDefault=function(){qd.g.preventDefault.call(this);var a=this.uj;a.preventDefault?a.preventDefault():a.returnValue=!1};var sd="closure_listenable_"+(1E6*Math.random()|0);function td(a){return!(!a||!a[sd])};var ud=0;function vd(a,b,c,d,e){this.listener=a;this.proxy=null;this.src=b;this.type=c;this.capture=!!d;this.vm=e;this.key=++ud;this.ii=this.Il=!1}function wd(a){a.ii=!0;a.listener=null;a.proxy=null;a.src=null;a.vm=null};function xd(a){this.src=a;this.pb={};this.ol=0}m=xd.prototype;m.add=function(a,b,c,d,e){var f=a.toString();a=this.pb[f];a||(a=this.pb[f]=[],this.ol++);var g=yd(a,b,d,e);-1<g?(b=a[g],c||(b.Il=!1)):(b=new vd(b,this.src,f,!!d,e),b.Il=c,a.push(b));return b};m.remove=function(a,b,c,d){a=a.toString();if(!(a in this.pb))return!1;var e=this.pb[a];b=yd(e,b,c,d);return-1<b?(wd(e[b]),Array.prototype.splice.call(e,b,1),0==e.length&&(delete this.pb[a],this.ol--),!0):!1}; 90function zd(a,b){var c=b.type;if(!(c in a.pb))return!1;var d=a.pb[c],e=Ya(d,b),f;(f=0<=e)&&Array.prototype.splice.call(d,e,1);f&&(wd(b),0==a.pb[c].length&&(delete a.pb[c],a.ol--));return f}m.ia=function(a){a=a&&a.toString();var b=0,c;for(c in this.pb)if(!a||c==a){for(var d=this.pb[c],e=0;e<d.length;e++)++b,wd(d[e]);delete this.pb[c];this.ol--}return b};m.Jp=function(a,b,c,d){a=this.pb[a.toString()];var e=-1;a&&(e=yd(a,b,c,d));return-1<e?a[e]:null}; 91m.bq=function(a,b){var c=void 0!==a,d=c?a.toString():"",e=void 0!==b;return Ra(this.pb,function(f){for(var g=0;g<f.length;++g)if(!(c&&f[g].type!=d||e&&f[g].capture!=b))return!0;return!1})};function yd(a,b,c,d){for(var e=0;e<a.length;++e){var f=a[e];if(!f.ii&&f.listener==b&&f.capture==!!c&&f.vm==d)return e}return-1};var Ad="closure_lm_"+(1E6*Math.random()|0),Bd={},Cd=0;function Dd(a,b,c,d,e){if(d&&d.once)return Ed(a,b,c,d,e);if(Array.isArray(b)){for(var f=0;f<b.length;f++)Dd(a,b[f],c,d,e);return null}c=Fd(c);return td(a)?a.rd.add(String(b),c,!1,ya(d)?!!d.capture:!!d,e):Gd(a,b,c,!1,d,e)} 92function Gd(a,b,c,d,e,f){if(!b)throw Error("Invalid event type");var g=ya(e)?!!e.capture:!!e,h=Hd(a);h||(a[Ad]=h=new xd(a));c=h.add(b,c,d,g,f);if(c.proxy)return c;d=Id();c.proxy=d;d.src=a;d.listener=c;
92if(a.addEventListener)od||(e=g),void 0===e&&(e=!1),a.addEventListener(b.toString(),d,e);else if(a.attachEvent)a.attachEvent(Jd(b.toString()),d);else if(a.addListener&&a.removeListener)a.addListener(d);else throw Error("addEventListener and attachEvent are unavailable.");Cd++;return c} 93function Id(){function a(c){return b.call(a.src,a.listener,c)}var b=Kd;return a}function Ed(a,b,c,d,e){if(Array.isArray(b)){for(var f=0;f<b.length;f++)Ed(a,b[f],c,d,e);return null}c=Fd(c);return td(a)?a.rd.add(String(b),c,!0,ya(d)?!!d.capture:!!d,e):Gd(a,b,c,!0,d,e)} 94function Ld(a,b,c,d,e){if(Array.isArray(b)){for(var f=0;f<b.length;f++)Ld(a,b[f],c,d,e);return null}d=ya(d)?!!d.capture:!!d;c=Fd(c);if(td(a))return a.rd.remove(String(b),c,d,e);if(!a)return!1;if(a=Hd(a))if(b=a.Jp(b,c,d,e))return Md(b);return!1} 95function Md(a){if("number"===typeof a||!a||a.ii)return!1;var b=a.src;if(td(b))return zd(b.rd,a);var c=a.type,d=a.proxy;b.removeEventListener?b.removeEventListener(c,d,a.capture):b.detachEvent?b.detachEvent(Jd(c),d):b.addListener&&b.removeListener&&b.removeListener(d);Cd--;(c=Hd(b))?(zd(c,a),0==c.ol&&(c.src=null,b[Ad]=null)):wd(a);return!0}function Jd(a){return a in Bd?Bd[a]:Bd[a]="on"+a}function Nd(a,b){var c=a.listener,d=a.vm||a.src;a.Il&&Md(a);return c.call(d,b)} 96function Kd(a,b){return a.ii?!0:Nd(a,new qd(b,this))}function Hd(a){a=a[Ad];return a instanceof xd?a:null}var Od="__closure_events_fn_"+(1E9*Math.random()>>>0);function Fd(a){if("function"===typeof a)return a;a[Od]||(a[Od]=function(b){return a.handleEvent(b)});return a[Od]};t("H.util.Event",pd);pd.prototype.stopPropagation=pd.prototype.stopPropagation;pd.prototype.stopPropagation=pd.prototype.stopPropagation;pd.prototype.CAPTURING_PHASE=1;pd.prototype.CAPTURING_PHASE=pd.prototype.CAPTURING_PHASE;pd.prototype.AT_TARGET=2;pd.prototype.AT_TARGET=pd.prototype.AT_TARGET;pd.prototype.BUBBLING_PHASE=3;pd.prototype.BUBBLING_PHASE=pd.prototype.BUBBLING_PHASE;pd.prototype.eventPhase=0;pd.prototype.eventPhase=pd.prototype.eventPhase;function Pd(a,b,c){Pd.g.constructor.call(this,a,c);this.message=b}u(Pd,pd);t("H.util.ErrorEvent",Pd);function Qd(a,b,c){Qd.g.constructor.call(this,a,c);this.data=b}u(Qd,pd);t("H.util.DataEvent",Qd);function Rd(a){wa.setTimeout(function(){throw a;},0)};function Sd(){var a=document;var b="IFRAME";"application/xhtml+xml"===a.contentType&&(b=b.toLowerCase());return a.createElement(b)};var Td; 97function Ud(){var a=wa.MessageChannel;"undefined"===typeof a&&"undefined"!==typeof window&&window.postMessage&&window.addEventListener&&!hd(id,"Presto")&&(a=function(){var e=Sd();e.style.display="none";document.documentElement.appendChild(e);var f=e.contentWindow;e=f.document;e.open();e.close();var g="callImmediate"+Math.random(),h="file:"==f.location.protocol?"*":f.location.protocol+"//"+f.location.host;e=Ia(function(k){if(("*"==h||k.origin==h)&&k.data==g)this.port1.onmessage()},this);f.addEventListener("message",e, 98!1);this.port1={};this.port2={postMessage:function(){f.postMessage(g,h)}}});if("undefined"!==typeof a&&!hd(id,"Trident")&&!hd(id,"MSIE")){var b=new a,c={},d=c;b.port1.onmessage=function(){if(void 0!==c.next){c=c.next;var e=c.lt;c.lt=null;e()}};return function(e){d.next={lt:e};d=d.next;b.port2.postMessage(0)}}return function(e){wa.setTimeout(e,0)}};function Vd(a,b){this.sB=100;this.Ky=a;this.Ag=b;this.an=0;this.zm=null}Vd.prototype.get=function(){if(0<this.an){this.an--;var a=this.zm;this.zm=a.next;a.next=null}else a=this.Ky();return a};Vd.prototype.put=function(a){this.Ag(a);this.an<this.sB&&(this.an++,a.next=this.zm,this.zm=a)};function Wd(){this.no=this.Gi=null}Wd.prototype.add=function(a,b){var c=Xd.get();c.set(a,b);this.no?this.no.next=c:this.Gi=c;this.no=c};Wd.prototype.remove=function(){var a=null;this.Gi&&(a=this.Gi,this.Gi=this.Gi.next,this.Gi||(this.no=null),a.next=null);return a};var Xd=new Vd(function(){return new Yd},function(a){return a.reset()});function Yd(){this.next=this.scope=this.tp=null}Yd.prototype.set=function(a,b){this.tp=a;this.scope=b;this.next=null}; 99Yd.prototype.reset=function(){this.next=this.scope=this.tp=null};function Zd(a,b){$d||ae();be||($d(),be=!0);ce.add(a,b)}var $d;function ae(){if(wa.Promise&&wa.Promise.resolve){var a=wa.Promise.resolve(void 0);$d=function(){a.then(de)}}else $d=function(){var b=de;"function"!==typeof wa.setImmediate||wa.Window&&wa.Window.prototype&&!hd(id,"Edge")&&wa.Window.prototype.setImmediate==wa.setImmediate?(Td||(Td=Ud()),Td(b)):wa.setImmediate(b)}}var be=!1,ce=new Wd;function de(){for(var a;a=ce.remove();){try{a.tp.call(a.scope)}catch(b){Rd(b)}Xd.put(a)}be=!1};function ee(a){this.s=fe;this.rf=void 0;this.Yg=this.Le=this.pg=null;this.tm=this.op=!1;if(a!=za)try{var b=this;a.call(void 0,function(c){ge(b,he,c)},function(c){ge(b,ie,c)})}catch(c){ge(this,ie,c)}}var fe=0,he=2,ie=3;function je(){this.next=this.context=this.Th=this.nk=this.Ff=null;this.Cl=!1}je.prototype.reset=function(){this.context=this.Th=this.nk=this.Ff=null;this.Cl=!1};var ke=new Vd(function(){return new je},function(a){a.reset()}); 100function le(a,b,c){var d=ke.get();d.nk=a;d.Th=b;d.context=c;return d}
100function me(a){if(a instanceof ee)return a;var b=new ee(za);ge(b,he,a);return b}function ne(a){return new ee(function(b,c){c(a)})}function oe(){var a,b,c=new ee(function(d,e){a=d;b=e});return new pe(c,a,b)}ee.prototype.then=function(a,b,c){return qe(this,"function"===typeof a?a:null,"function"===typeof b?b:null,c)};ee.prototype.$goog_Thenable=!0; 101ee.prototype.cancel=function(a){if(this.s==fe){var b=new re(a);Zd(function(){se(this,b)},this)}};function se(a,b){if(a.s==fe)if(a.pg){var c=a.pg;if(c.Le){for(var d=0,e=null,f=null,g=c.Le;g&&(g.Cl||(d++,g.Ff==a&&(e=g),!(e&&1<d)));g=g.next)e||(f=g);e&&(c.s==fe&&1==d?se(c,b):(f?(d=f,d.next==c.Yg&&(c.Yg=d),d.next=d.next.next):te(c),ue(c,e,ie,b)))}a.pg=null}else ge(a,ie,b)}function ve(a,b){a.Le||a.s!=he&&a.s!=ie||we(a);a.Yg?a.Yg.next=b:a.Le=b;a.Yg=b} 102function qe(a,b,c,d){var e=le(null,null,null);e.Ff=new ee(function(f,g){e.nk=b?function(h){try{var k=b.call(d,h);f(k)}catch(l){g(l)}}:f;e.Th=c?function(h){try{var k=c.call(d,h);void 0===k&&h instanceof re?g(h):f(k)}catch(l){g(l)}}:g});e.Ff.pg=a;ve(a,e);return e.Ff}ee.prototype.GD=function(a){this.s=fe;ge(this,he,a)};ee.prototype.HD=function(a){this.s=fe;ge(this,ie,a)}; 103function ge(a,b,c){if(a.s==fe){a===c&&(b=ie,c=new TypeError("Promise cannot resolve to itself"));a.s=1;a:{var d=c,e=a.GD,f=a.HD;if(d instanceof ee){ve(d,le(e||za,f||null,a));var g=!0}else{if(d)try{var h=!!d.$goog_Thenable}catch(l){h=!1}else h=!1;if(h)d.then(e,f,a),g=!0;else{if(ya(d))try{var k=d.then;if("function"===typeof k){xe(d,k,e,f,a);g=!0;break a}}catch(l){f.call(a,l);g=!0;break a}g=!1}}}g||(a.rf=c,a.s=b,a.pg=null,we(a),b!=ie||c instanceof re||ye(a,c))}} 104function xe(a,b,c,d,e){function f(k){h||(h=!0,d.call(e,k))}function g(k){h||(h=!0,c.call(e,k))}var h=!1;try{b.call(a,g,f)}catch(k){f(k)}}function we(a){a.op||(a.op=!0,Zd(a.dz,a))}function te(a){var b=null;a.Le&&(b=a.Le,a.Le=b.next,b.next=null);a.Le||(a.Yg=null);return b}ee.prototype.dz=function(){for(var a;a=te(this);)ue(this,a,this.s,this.rf);this.op=!1}; 105function ue(a,b,c,d){if(c==ie&&b.Th&&!b.Cl)for(;a&&a.tm;a=a.pg)a.tm=!1;if(b.Ff)b.Ff.pg=null,ze(b,c,d);else try{b.Cl?b.nk.call(b.context):ze(b,c,d)}catch(e){Ae.call(null,e)}ke.put(b)}function ze(a,b,c){b==he?a.nk.call(a.context,c):a.Th&&a.Th.call(a.context,c)}function ye(a,b){a.tm=!0;Zd(function(){a.tm&&Ae.call(null,b)})}var Ae=Rd;function re(a){Xa.call(this,a)}u(re,Xa);re.prototype.name="cancel";function pe(a,b,c){this.promise=a;this.resolve=b;this.reject=c};function Be(){}t("H.util.ICancelable",Be);Be.prototype.cancel=function(){};Be.prototype.cancel=Be.prototype.cancel;function Ce(a,b,c){this.type=a;this.data=b;this.Er=oe();this.resolve=z(this.resolve,this);this.reject=z(this.reject,this);this.priority=De;c!==A&&(this.priority=c);this.Fp().add(this)}var De=1,Ee={QD:0,TD:De,OD:2};m=Ce.prototype;m.then=function(a,b,c){return this.Er.promise.then(a,b,c)};m.resolve=function(a){this.state=3;this.Er.resolve(a)};m.reject=function(a){this.state=5;this.Er.reject(a)};m.state=0;m.cancel=function(){3>this.state&&(this.Wi(),this.Fp().remove(this),this.state=4)}; 106Ce.prototype.cancel=Ce.prototype.cancel;function Fe(a){var b;this.ug={};for(b in Ee)this.ug[Ee[b]]=[];this.Ik=a;this.Ik.addEventListener("allocatable",z(this.St,this))}t("H.util.JobManager",Fe);var Ge=Object.keys(Ee).map(function(a){return Ee[a]}).sort().reverse();Fe.prototype.add=function(a){B(a,Ce,this.add,0);this.ug[a.priority].push(a);this.St()};Fe.prototype.contains=function(a){return-1<this.ug[a.priority].indexOf(a)}; 107Fe.prototype.remove=function(a){var b=a.priority,c=this.ug[b].indexOf(a);if(-1<c)return this.ug[b].splice(c,1),!0;a.Ds&&this.Ik.$l(a.Ds);return!1};Fe.prototype.St=function(){Ge.forEach(function(a){this.ug[a]=this.ug[a].filter(function(b){var c;if((c=this.Ik.Eo(b))!==x){var d=z(this.Ik.$l,this.Ik,c,b);b.Ds=c;b.then(d,d);b.state=b.Rt(c)?1:5}else return!0},this)},this)};function I(){ed.call(this);this.rd=new xd(this);this.iy=this;this.er=null}u(I,ed);I.prototype[sd]=!0;m=I.prototype;m.Jb=function(){return this.er};m.ea=function(a){this.er=a};m.addEventListener=function(a,b,c,d){Dd(this,a,b,c,d)};m.removeEventListener=function(a,b,c,d){Ld(this,a,b,c,d)}; 108m.dispatchEvent=function(a){var b,c=this.Jb();if(c)for(b=[];c;c=c.Jb())b.push(c);c=this.iy;var d=a.type||a;
108if("string"===typeof a)a=new pd(a,c);else if(a instanceof pd)a.target=a.target||c;else{var e=a;a=new pd(d,c);Wa(a,e)}e=!0;if(b)for(var f=b.length-1;!a.yk&&0<=f;f--){var g=a.currentTarget=b[f];e=g.Lf(d,!0,a)&&e}a.yk||(g=a.currentTarget=c,e=g.Lf(d,!0,a)&&e,a.yk||(e=g.Lf(d,!1,a)&&e));if(b)for(f=0;!a.yk&&f<b.length;f++)g=a.currentTarget=b[f],e=g.Lf(d,!1,a)&&e;return e}; 109m.disposeInternal=function(){I.g.disposeInternal.call(this);this.rd&&this.rd.ia(void 0);this.er=null};m.Lf=function(a,b,c){a=this.rd.pb[String(a)];if(!a)return!0;a=a.concat();for(var d=!0,e=0;e<a.length;++e){var f=a[e];if(f&&!f.ii&&f.capture==b){var g=f.listener,h=f.vm||f.src;f.Il&&zd(this.rd,f);d=!1!==g.call(h,c)&&d}}return d&&!c.defaultPrevented};m.Jp=function(a,b,c,d){return this.rd.Jp(String(a),b,c,d)};m.bq=function(a,b){return this.rd.bq(void 0!==a?String(a):void 0,b)};t("H.util.EventTarget",I);I.prototype.ea=I.prototype.ea;I.prototype.setParentEventTarget=I.prototype.ea;I.prototype.Jb=I.prototype.Jb;I.prototype.getParentEventTarget=I.prototype.Jb;I.prototype.addEventListener=I.prototype.addEventListener;I.prototype.addEventListener=I.prototype.addEventListener;I.prototype.removeEventListener=I.prototype.removeEventListener;I.prototype.removeEventListener=I.prototype.removeEventListener;I.prototype.dispatchEvent=I.prototype.dispatchEvent; 110I.prototype.dispatchEvent=I.prototype.dispatchEvent;I.prototype.l=I.prototype.l;I.prototype.dispose=I.prototype.l;I.prototype.bc=I.prototype.bc;I.prototype.addOnDisposeCallback=I.prototype.bc;I.prototype.iz=I.prototype.Lf; 111I.prototype.Lf=function(a,b,c){var d,e,f=!0;var g=c[c.currentTarget===c.target?"AT_TARGET":b?"CAPTURING_PHASE":(d=!0,"BUBBLING_PHASE")];if(!d||"pointerenter"!==(e=c.type)&&"pointerleave"!==e)c.eventPhase=g,f=I.prototype.iz.apply(this,arguments),d&&this.Jb&&null===this.Jb()&&delete c.eventPhase;return f};I.prototype.Yw=function(a){for(var b,c=this;c&&(b=c.Jb())&&b!==a;)c=b;b||c.ea(a)};I.prototype.setRootParentEventTarget=I.prototype.Yw;function He(a){a=a||{};var b=a.callback;this.Wb=a.label;db(b)&&(this.callback=b);this.ub=!!a.disabled;He.g.constructor.call(this)}u(He,I);t("H.util.ContextItem",He);He.prototype.Gp=function(){return this.Wb};He.prototype.getLabel=He.prototype.Gp;He.prototype.xe=function(a){this.Wb!==a&&(this.Wb=a,this.dispatchEvent("update"));return this};He.prototype.setLabel=He.prototype.xe;He.prototype.mq=function(){return this.ub};He.prototype.isDisabled=He.prototype.mq; 112He.prototype.wa=function(a){a!==this.ub&&(this.ub=a,this.dispatchEvent("update"));return this};He.prototype.setDisabled=He.prototype.wa;var Ie=new He;He.SEPARATOR=Ie;function Je(a){if(globalThis.document){var b=document.createElement("canvas");b.width=b.height=1;return b.getContext("2d",{aE:a})}return null}function Ke(){return window.devicePixelRatio||1}t("H.util.getPixelRatio",Ke);var Le=/^rgba\(([^,]+),([^,]+),([^,]+),([^)]+)\)$/; 113function Me(a){var b=Ne[a],c=globalThis.RegExp;b||(globalThis.Uint8ClampedArray||(globalThis.Uint8ClampedArray=function(d){return d instanceof Number?Array(d):d.map(function(e){return gc(Gb(e),0,255)})}),"none"===a?b=new Uint8ClampedArray([0,0,0,0]):(Oe.fillStyle="black",Oe.fillStyle=a,Le.test(Oe.fillStyle)?b=new
113Uint8ClampedArray([c.$1,c.$2,c.$3,255*c.$4]):(Oe.clearRect(0,0,1,1),Oe.fillRect(0,0,1,1),b=Oe.getImageData(0,0,1,1).data)),Ne[a]=b);return b}function Pe(a){return"none"!==a&&0<Me(a)[3]} 114var Ne=Za(),Qe=!!globalThis.VBArray;t("H.util.eval",function(a){return eval(a)});function Re(a,b){return a!==A?a:b}function Se(a){return/^<svg/.test(a)?"data:image/svg+xml;charset=utf-8,"+encodeURIComponent(a):a}t("H.util.provide",function(a){var b=wa.$jscomp;if(b&&("function"!=typeof b.Ez?0:b.Ez()))throw Error("goog.provide cannot be used within a module.");xa(a,void 0,void 0)});function Te(a){this.Ad=0<+a?Db.round(a):0} 115Te.prototype.next=function(a){if(9007199254740992===this.Ad)throw new Cb(a,this.Ad,[0,9007199254740991]);return this.Ad++};var Ue=new Te,Ve=z(Ue.next,Ue);function We(){return!0}function Xe(){return!1}function Ye(){}var Ze=ab([]),$e=ab({});function af(a){return"CANVAS"===a.tagName?[a]:a.getElementsByTagName("CANVAS")}function bf(a,b,c){var d;b=a.ownerDocument===b?a.cloneNode(!0):b.importNode(a,!0);if(c)for(a=af(a),c=af(b),d=c.length;d--;)c[d].getContext("2d").drawImage(a[d],0,0);return b} 116var Oe=Je(!0),cf=Je(!1);function df(a){var b=a.complete,c=0<a.naturalWidth;if(b&&!c&&Qe)try{cf.drawImage(a,0,0),c=!0}catch(d){}return b&&c}var ef=globalThis.BlobBuilder||globalThis.WebKitBlobBuilder||globalThis.MozBlobBuilder;function ff(a,b){b=b||"";if(ef){var c=new ef;c.append(a);a=c.getBlob(b)}else a=new Blob([a],{type:b});return a}var gf=globalThis.navigator;Ma=/Edge\/\d+/.test(gf.appVersion);Na=/(A|a)ndroid/.test(gf.appVersion);function J(a){J.g.constructor.call(this);a&&hf(a,J,0);this.S=a||[];this.jd=jf(this,0,this.S.length)}u(J,sc);t("H.geo.LineString",J);function jf(a,b,c){a=a.S;var d=0;b=Fb(b,0);c=Eb(c,a.length);c-=2;for(b+=1;b<c;)d+=rc(a[b],a[b+=3]);return d}J.prototype.tr=function(a,b,c){kf(this,a,b,c,this.tr)};J.prototype.pushLatLngAlt=J.prototype.tr;function kf(a,b,c,d,e){var f=a.S.length;b=oc(b,e);c=pc(c,e);a.S.push(oc(b,e),pc(c,e),d===A?0:qc(d,e));f&&(a.jd+=rc(a.S[f-2],c));delete a.J;delete a.ur} 117J.prototype.Yk=function(a,b,c){c&&hf(c,this.Yk,2);void 0===b&&(b=this.S.length);b&&(this.jd-=jf(this,a-3,a+b+3));var d=c?this.S.splice.apply(this.S,[a,b].concat(c)):this.S.splice(a,b);c&&(this.jd+=jf(this,a-3,a+c.length+3));b&&!c&&(this.jd+=jf(this,a-3,a-3));delete this.J;delete this.ur;return d};J.prototype.spliceLatLngAlts=J.prototype.Yk;J.prototype.Nu=function(a,b,c,d){this.Yk(a,0,[b,c,d])};J.prototype.insertLatLngAlt=J.prototype.Nu;J.prototype.Aw=function(a){this.Yk(a,3)}; 118J.prototype.removeLatLngAlt=J.prototype.Aw;J.prototype.tg=function(a){kf(this,a.lat,a.lng,a.alt,this.tg)};J.prototype.pushPoint=J.prototype.tg;J.prototype.Zd=function(a,b){this.Nu(3*a,b.lat,b.lng,b.alt)};J.prototype.insertPoint=J.prototype.Zd;J.prototype.Ek=function(a){this.Aw(3*a)};J.prototype.removePoint=J.prototype.Ek;J.prototype.wj=function(a,b){var c=this.S,d=3*a;a=c[d];var e=c[d+1];c=c[d+2];b&&(b.lat=a,b.lng=e,b.alt=c);return b||new tc(a,e,c)};J.prototype.extractPoint=J.prototype.wj; 119J.prototype.$y=function(a,b,c){var d=this.S;b=b||0;c=Re(c,d.length/3);for(var e=3*b;b<c;)a(d[e++],d[e++],d[e++],b++)};J.prototype.eachLatLngAlt=J.prototype.$y;J.isDBC=rc;J.prototype.Cp=function(a){var b=this.jd;a&&(a=this.S,b+=rc(a[a.length-2],a[1]));return b};J.prototype.getDBCs=J.prototype.Cp;J.prototype.Mj=function(){return this.S.length/3};J.prototype.getPointCount=J.prototype.Mj;J.prototype.bA=function(){return this.S};J.prototype.getLatLngAltArray=J.prototype.bA;J.prototype.J=x; 120J.prototype.C=function(){var a;if(!(a=this.J)){a=this.S;var b=a.length,c=3,d,e,f=x;if(3<=b){var g=d=a[0];var h=e=a[1];for(f=new E(g,h,d,e);c<b;c+=3){g=a[c-3];h=a[c-2];d=a[c];e=a[c+1];if(h>e&&180<e-h||h<e&&-180>h-e||e<h&&180>Jb(e-h)){var k=h;h=e;e=k}g<d&&(k=g,g=d,d=k);Vc(f.fa,f.W,f.ga,f.ca,g,h,d,e,f)}}a=this.J=f}return a};J.prototype.getBoundingBox=J.prototype.C;J.prototype.WA=function(){return this.J!==x};J.prototype.hasBoundingBox=J.prototype.WA; 121function hf(a,b,c){for(var d=a.length,e=!(d%3),f;e&&d;)e=!(D(a[--d]=qc((f=a[d])===A?0:f))||D(a[--d]=pc(a[d]))||D(a[--d]=oc(a[d])));if(!e&&b)throw new C(b,c,a);}function lf(a){var b=new J,c=0,d=a.length;if(d%2)throw new C(lf,0,a);for(;c<d;)kf(b,a[c++],a[c++],0,lf);return b}J.fromLatLngArray=lf;J.prototype.da=function(a){var b=this===a,c;if(!b&&(b=B(a,J))){var d=this.S;a=a.S;for(b=(c=d.length)===a.length;b&&c--;)b=d[c]==a[c]}return b};J.prototype.equals=J.prototype.da; 122function mf(a,b){return a.to-b.to} 123function nf(a,b){var c=a.S,d=-2,e=[],f;var g=a.ur;if(!g){g=a.ur=new $c;var h=0;var k=a.S;var l=k.length;for(f=0;f<l;f+=3){var n=k[f];var p=k[f+1];if(f){var q=g.Ou(q,r,n,p);q.to=h++}q=n;var r=p}}g=g.Fm(b).sort(mf);k=g.length;for(b=0;b<k;b++){h=g[b];h=h.to;l=3*h;if(h>d+1){var v=[c[l],c[l+1]];e.push(v)}d=h;
123v.push(c[l+3],c[l+4])}if(a.jd){c=[];d=e.length;for(b=0;b<d;b++)if(v=e[b],g=v.length){k=[];for(a=0;a<g;a+=2)h=v[a],l=v[a+1],k.push(h,l),f=v[a-1],a&&rc(l,f)&&(c.push(k),k=[],f+=0>f?360:-360,k.push(v[a- 1242],f,h,l));c.push(k)}e=c}return e}m=J.prototype;m.ac="LineString";m.yf=function(a,b){var c=this.S,d=c.length,e;if(d){a.push("(");for(e=0;e<d;e+=3)e&&a.push(","),a.push(c[e+1]," ",c[e]);b&&(c[0]!==c[d-3]||c[1]!==c[d-2])&&a.push(",",c[1]," ",c[0]);a.push(")")}else a.push("EMPTY");return a};m.Kc="LineString";m.xf=function(){var a=[],b=this.S,c=b.length,d;for(d=0;d<c;d+=3)a.push([b[d+1],b[d],b[d+2]]);return a}; 125m.Rd=function(){var a=this.S,b;if(this.C().qc()){a=a.slice();var c=1;for(b=a.length;c<b;c+=3)0>a[c]&&(a[c]+=360)}return a};m.AD=function(a){a=void 0===a?5:a;for(var b=this.S,c=b.length,d=[],e=0;e<c;e+=3)d.push([b[e],b[e+1],b[e+2]]);return Ec({polyline:d,precision:a,thirdDim:2,thirdDimPrecision:a})};J.prototype.toFlexiblePolyline=J.prototype.AD; 126function of(a){var b=Fc(a);a=b.polyline;var c=b.thirdDim;b=2===c||3===c;c=0===c;if(!a)throw new C(of,0,"data");if(b||c){c=a.length;var d=Array(3*c);for(var e=0,f=0;e<c;e++){var g=a[e];d[f++]=g[0];d[f++]=g[1];d[f++]=b?g[2]:0}}if(!d)throw new C(of,0,"only ABSENT, ALTITUDE or ELEVATION are supported as type of the 3rd dimension");return new J(d)}J.fromFlexiblePolyline=of;function K(a,b){this.x=+a;this.y=+b}t("H.math.Point",K);K.prototype.set=K;K.prototype.set=K.prototype.set;K.prototype.clone=function(a){a?(a.x=this.x,a.y=this.y):a=new K(this.x,this.y);return a};K.prototype.clone=K.prototype.clone;K.prototype.add=function(a){this.x+=a.x;this.y+=a.y;return this};K.prototype.add=K.prototype.add;K.prototype.sub=function(a){this.x-=a.x;this.y-=a.y;return this};K.prototype.sub=K.prototype.sub;K.prototype.scale=function(a,b){this.x*=a;this.y*=void 0===b?a:b;return this}; 127K.prototype.scale=K.prototype.scale;K.prototype.round=function(){this.x=Gb(this.x);this.y=Gb(this.y);return this};K.prototype.round=K.prototype.round;K.prototype.floor=function(){this.x=Hb(this.x);this.y=Hb(this.y);return this};K.prototype.floor=K.prototype.floor;K.prototype.ceil=function(){this.x=Ib(this.x);this.y=Ib(this.y);return this};K.prototype.ceil=K.prototype.ceil;K.prototype.da=function(a){return!(!a||this.x!==a.x||this.y!==a.y)};K.prototype.equals=K.prototype.da; 128K.prototype.ou=function(a,b){var c=b.x-a.x,d=b.y-a.y;var e=a;if(c||d)e=((this.x-a.x)*c+(this.y-a.y)*d)/(c*c+d*d),e=0>=e?a:1<=e?b:new K(a.x+e*c,a.y+e*d);return e};K.prototype.getNearest=K.prototype.ou;K.prototype.kb=function(a){return Lb(Mb(this.x-a.x,2)+Mb(this.y-a.y,2))};K.prototype.distance=K.prototype.kb;function pf(a){if(!a)throw Error("invalid argument");return a instanceof K?a:new K(a.x,a.y)}K.fromIPoint=pf;function qf(a,b,c,d,e,f){var g,h,k=a.length,l,n;if(k)for(g=[];k--;){var p=a[k];var q=p.length;var r=0;for(l=1;l<q;l++)if(n=rf(p[l-1],p[l],c,b,d,e)){var v=n[0];var w=n[1];r&&r.da(v)?h.push(w):g.push(h=n);r=w;f&&(l=q,k=0)}}else g=a;return g}t("H.math.clipping.clipStrips",qf); 129function rf(a,b,c,d,e,f){var g=a.x;a=-a.y;var h=b.x;b=-b.y;c=-c;f=-f;if(g>h){if(h>e||g<d)return;var k=g;var l=a;g=h;a=b;h=k;b=l;k=1}else if(g>e||h<d)return;if(a>b){if(b>c||a<f)return;var n=1;a=-a;b=-b;l=f;f=-c;c=-l}else if(a>c||b<f)return;if(g<d){if((a+=(d-g)*(b-a)/(h-g))>c)return;g=d}if(a<f){if((g+=(f-a)*(h-g)/(b-a))>e)return;a=f}h>e&&(b=a+(e-g)*(b-a)/(h-g),h=e);b>c&&(h=g+(c-a)*(h-g)/(b-a),b=c);n&&(a=-a,b=-b);return k?[new K(h,-b),new K(g,-a)]:[new K(g,-a),new K(h,-b)]} 130function sf(a,b,c){a=tf(a,!0);b=tf(b,!1);var d,e;var f={};var g=d=1;switch(~~(1*(c||0))){case 1:g=d=0;break;case 2:d=0;g=1;break;case 3:d=1,g=0}c=d;var h=g;if(b&&a){b.kj=new uf(b.x,b.y,null,vf(b));a.kj=new uf(a.x,a.y,null,vf(a));for(g=b;g.next;g=g.next)if(!g.ob)for(d=a;d.next;d=d.next)if(!d.ob){var k=wf(g.next);var l=wf(d.next);if(e=xf(g,k,d,l,f)){e=f.my;var n=f.ny;var p=f.KD;var q=f.LD;e=new uf(p,q,null,null,null,null,!0,0,0,e);yf(e,g,k);k=new uf(p,q,null,null,null,null,!0,0,0,n);yf(k,d,l);e.Mq= 131k;k.Mq=e}}f=mc(b,zf(a));c&&(f=!f);for(g=b;g;g=g.next)g.ob&&(g.nq=f,f=!f);f=mc(a,zf(b));h&&(f=!f);for(d=a;d.next;d=d.next)d.ob&&(d.nq=f,f=!f);Af(b);for(Af(a);(a=Bf(b))!=b;){for(c=null;!a.ko;a=a.Mq){for(f=a.nq;;){c=new uf(a.x,a.y,c);c.artificial=a.ob||a.Vu;a.ko=1;a=f?a.next:a.Dd;if(!a)break;if(a.ob){a.ko=1;break}}if(!a)break}c.Nq=r||null;var r=c}return r}}t("H.math.clipping.clipPolygon",sf); 132function uf(a,b,c,d,e,f,g,h,k,l){this.x=a;this.y=b;this.next=c||null;this.Dd=d||null;this.Nq=e||null;this.Mq=f||null;this.ob=!!g;this.nq=!!h;this.ko=k||0;this.alpha=l||0;d&&(d.next=this);c&&(c.Dd=this);this.Vu=!1;this.kj=null}function wf(a){for(;a&&a.ob;)a=a.next;return a}function vf(a){if(a)for(;a.next;)a=a.next;return a}function Bf(a){var b=a;if(b){do b=b.next;while(b!=a&&(!b.ob||b.ob&&b.ko))}return b}function Af(a){var b=vf(a);b.Dd.next=a;a.Dd=b.Dd} 133function xf(a,b,c,d,e,f){var g,h=b.x-a.x,k=b.y-a.y;var l=d.x-c.x;var n=d.y-c.y;var p=h*n-k*l;if(!p)return 0;l=((c.x-a.x)*n-(c.y-a.y)*l)/p;p=(k*(c.x-a.x)-h*(c.y-a.y))/p;if(0>l||1<l||0>p||1<p)return 0;
1330===l?g=a:1===l?g=b:0===p?g=c:1===p&&(g=d);if(g&&!f)return g.x+=2.480549651603763E-5,g.y+=7.321997314118067E-5,g.kj&&(g.kj.x=g.x,g.kj.y=g.y),xf(a,b,c,d,e);e.KD=a.x+l*h;e.LD=a.y+l*k;e.my=l;e.ny=p;return 1}function zf(a){for(var b=[];a;)b.push(a.x,a.y),a=a.next;return b} 134function yf(a,b,c){for(b=b.next;b!==c&&b.alpha<=a.alpha;)b=b.next;a.next=b;a.Dd=b.Dd;a.next.Dd=a;a.Dd.next=a}function tf(a,b){for(var c,d=null,e=0,f=a.length;e<f;e++){c=new uf(a[e].x,a[e].y,d);c.Vu=b;if(c.next=d)d.Dd=c;d=c}return d};function L(a,b){var c;L.g.constructor.call(this);B(a,J,L,0);if(b!==A&&kb(b,L,1)){for(c=0;c<b.length;c++)B(b[c],J,L,1,"index "+c);this.cb=b}else this.cb=[];this.Fb=a;this.Tj=[]}u(L,sc);t("H.geo.Polygon",L);function Cf(a){var b=L,c=J,d=a.fa,e=a.W,f=a.ga,g=a.ca;e=[d,e,A,d,g,A,f,g,A,f,e,A];180<=a.oc()&&(e.splice(9,0,f,a=a.wb().lng,A),e.splice(3,0,d,a,A));return new b(new c(e))}L.fromRect=Cf;var Df={NORTH:90,SOUTH:-90};L.Direction=Df;L.prototype.kf=Df.NORTH; 135L.prototype.Xw=function(a){this.kf!==a&&(this.J=x,this.Tj.length=0,this.kf=a);return this};L.prototype.setPoleCovering=L.prototype.Xw;L.prototype.sA=function(){return this.kf};L.prototype.getPoleCovering=L.prototype.sA;L.prototype.Oz=function(){return this.Fb};L.prototype.getExterior=L.prototype.Oz;L.prototype.Uw=function(a){if(!B(a,J))throw new C(this.Uw,0,a);this.Fb=a;this.J=x};L.prototype.setExterior=L.prototype.Uw;L.prototype.Zz=function(){return this.cb};L.prototype.getInteriors=L.prototype.Zz; 136L.prototype.fo=function(a,b,c){var d=arguments.length,e;for(e=2;e<d;e++)B(arguments[e],J,this.fo,e);var f=this.cb.splice.apply(this.cb,arguments);for(e=2;e<d;e++)arguments[e]=A;this.Tj.splice.apply(this.Tj,arguments);return f};L.prototype.spliceInteriors=L.prototype.fo;L.prototype.EC=function(a){return this.fo(a,1)[0]};L.prototype.removeInteriorAt=L.prototype.EC;L.prototype.DC=function(a){a=this.cb.indexOf(a);return 0>a?A:this.fo(a,1)[0]};L.prototype.removeInterior=L.prototype.DC; 137L.prototype.ww=function(a){if(!B(a,J))throw new C(this.ww,0,a);this.cb.push(a)};L.prototype.pushInterior=L.prototype.ww;L.prototype.C=function(){var a=this.J;a||(this.J=a=Ef(this.Fb,this.kf));return a};L.prototype.getBoundingBox=L.prototype.C;m=L.prototype;m.du=function(a){var b=this.cb.length;if(0>a||a>=b)throw new Cb(this.du,a,[0,b-1]);(b=this.Tj[a])||(this.Tj[a]=b=Ef(this.cb[a],this.kf));return b}; 138function Ef(a,b){var c,d,e;if(e=a.C())(c=a.Cp(!0))&&(d=a.Mj())&&(e=e.zd(Xc([a.wj(0),a.wj(d-1)],!0),!0)),360===e.oc()&&1===c%2&&(e=e.df(b,0));return e}m.ac="Polygon";m.yf=function(a){var b=this.cb,c=b.length,d;if(this.Fb.Mj()){a.push("(");this.Fb.yf(a,!0);for(d=0;d<c;d++)b[d].Mj()&&(a.push(","),b[d].yf(a,!0));a.push(")")}else a.push("EMPTY");return a};m.Kc="Polygon"; 139m.xf=function(){var a,b=[],c=this.cb,d=this.Fb.xf();d[0].toString()!==d[d.length-1].toString()&&d.push(d[0]);b.push(d);for(a=0;a<c.length;a++)d=c[a].xf(),d[0].toString()!==d[d.length-1].toString()&&d.push(d[0]),b.push(d);return b};m.P=function(){var a=L.g.P.call(this);this.C().qc()&&(a.type="Multi"+a.type);return a};m.Rd=function(){var a=[],b=this.cb,c=b.length;for(a.push(this.Fb.Rd());c--;)a[c+1]=b[c].Rd();return this.C().qc()?[a]:a}; 140m.da=function(a){var b=!1;if(B(a,L)){var c=a.cb,d=this.cb.length;b=c.length;var e=0;for(b=this.Fb.da(a.Fb)&&d===b;b&&e<d;)b=b&&this.cb[e].da(c[e]),e++}return b};L.prototype.equals=L.prototype.da;function Ff(a,b,c,d){var e=a.cb,f=Gf.bind(null,b,c);return lc(b,c,a.Fb.S,0,!0,3)!==kc.NONE?void 0===d||d?!e.some(f):!0:!1}function Gf(a,b,c){return lc(a,b,c.S,0,!0,3)===kc.SURFACE} 141function Hf(a,b){b=b.S;a=a.Fb.S;var c,d,e=b.length-3,f=a.length-3,g={};for(c=0;c<e;c+=3){var h=b[c];var k=b[c+1];var l=b[c+3];var n=b[c+4];for(d=0;d<f;d+=3){var p=a[d];var q=a[d+1];var r=a[d+3];var v=a[d+4];if(xf(new uf(k,h),new uf(n,l),new uf(q,p),new uf(v,r),g,!0))return!0}}return!1} 142function If(a,b){var c=b.Fb,d=b.cb,e=d.length,f=c.S,g=f.length,h=a.Fb.S,k=h.length;if(Hf(a,c))return!0;for(c=0;c<g;c+=3)if(Ff(a,f[c],f[c+1]))return!0;for(c=0;c<k;c+=3)if(Ff(b,h[c],h[c+1]))return!0;for(c=0;c<e;c++)if(Hf(a,d[c]))return!0;return!1};function Jf(a){gb(this,Jf);Jf.g.constructor.call(this);this.ha=Kf(this,a,this.constructor,0)}u(Jf,sc);t("H.geo.MultiGeometry",Jf);Jf.prototype.splice=function(a,b,c){a=[a];b!==A&&a.push(b);c&&(b=Kf(this,c,this.splice,2),a=a.concat(b));this.J=x;return this.ha.splice.apply(this.ha,a)};Jf.prototype.splice=Jf.prototype.splice;Jf.prototype.Ed=function(a){var b=this.ha.length;if(!(0<=a&&a<b))throw new Cb(this.Ed,a,[0,b-1]);this.J=x;return this.ha.splice(a,1)[0]};Jf.prototype.removeAt=Jf.prototype.Ed; 143Jf.prototype.remove=function(a){a=this.ha.indexOf(a);if(0<=a){var b=this.ha.splice(a,1)[0];this.J=x}return b||x};Jf.prototype.remove=Jf.prototype.remove;Jf.prototype.Uz=function(){return this.ha};Jf.prototype.getGeometries=Jf.prototype.Uz;Jf.prototype.push=function(a){var b=Kf(this,[a],this.push,0)[0];this.J&&(this.J=this.J.zd(a.C()));this.ha.push(b)};Jf.prototype.push=Jf.prototype.push; 144Jf.prototype.C=function(){var a;if(!(a=this.J)){a=x;var b,c;if(this.ha.length)for(a=this.ha[0].C(),c=1;c<this.ha.length;c++)if(b=this.ha[c].C())a=a?a.zd(b):b}return this.J=a};Jf.prototype.getBoundingBox=Jf.prototype.C;Jf.prototype.J=x;function Kf(a,b,c,d){var e,f=[];if(!kb(b))throw new C(c,d);for(e=0;e<b.length;e++)if(a.tq(b[e]))f.push(a.pw(b[e]));else throw new C(c,d);return f}Jf.prototype.pw=function(a){return a}; 145Jf.prototype.da=function(a){var b=this===a,c;if(!b&&(b=B(a,this.constructor))){var d=this.ha;a=a.ha;for(b=(c=d.length)===a.length;b&&c--;)b=d[c].da(a[c])}return b};Jf.prototype.equals=Jf.prototype.da;Jf.prototype.yf=function(a){var b=this.ha,c=b.length,d,e,f=!1;if(c){a.push("(");for(d=0;d<c;d++)(e=0<d&&f)&&a.push(","),b[d].yf(a),"EMPTY"===a[a.length-1]?a.splice(-1-+e,1+ +e):f=!0;f?a.push(")"):a.splice(-1,1,"EMPTY")}else a.push("EMPTY");return a}; 146Jf.prototype.Rd=function(){for(var a=[],b=this.ha,c=b.length;c--;)a[c]=b[c].Rd();return a};Jf.prototype.P=function(){var a=Jf.g.P.call(this);a.type=this.ac;return a};Jf.prototype.xf=function(){for(var a=[],b=this.ha,c=b.length;c--;)a[c]=b[c].xf();return a};
146function Lf(a){Lf.g.constructor.call(this,a)}u(Lf,Jf);t("H.geo.MultiLineString",Lf);Lf.prototype.tq=function(a){return B(a,J)};Lf.prototype.ac="Multi"+J.prototype.ac;Lf.prototype.Kc="Multi"+J.prototype.Kc;function Mf(a){Mf.g.constructor.call(this,a)}u(Mf,Jf);t("H.geo.MultiPolygon",Mf);Mf.prototype.tq=function(a){return B(a,L)};Mf.prototype.ac="Multi"+L.prototype.ac;Mf.prototype.Kc="Multi"+L.prototype.Kc;function Nf(a){Nf.g.constructor.call(this,a)}u(Nf,Jf);t("H.geo.MultiPoint",Nf);Nf.prototype.tq=function(a){return uc(a)};Nf.prototype.pw=function(a){return B(a,tc)?a:vc(a)};Nf.prototype.ac="Multi"+tc.prototype.ac;Nf.prototype.Kc="Multi"+tc.prototype.Kc;function Of(a,b,c){var d,e=6;if(b){for(d=' expected close to: "'+b;e--;)b=a.nt.next(),-1!==b&&(d+=String.fromCharCode(b));d+='"'}throw new C(Pf,0,"- Malformed WKT: "+(d?c+d:"unexpected end of stream"));}function Qf(a,b){var c=a.next();b=b?")":"(";c!==b&&Of(a,c,'"'+b+'"')}function Rf(a){return","===a.eb()?(a.next(),!0):!1}function Sf(a,b,c,d,e){var f,g,h=2+b+c;for(g=1;g<=h;g++)(c=a.next())?(f=+c)!==f?Of(a,c,"number"):1===g?d[e+1]=f:2===g?d[e+0]=f:3===g&&(d[e+2]=f):Of(a,c);b||(d[e+2]=0)}var Tf=[]; 147function Uf(a,b,c,d){d||Qf(a,0);Sf(a,b,c,Tf,0);d||Qf(a,1);return new tc(Tf[0],Tf[1],b?Tf[2]:A)}function Vf(a,b,c){var d=[];Qf(a,0);do Sf(a,b,c,d,d.length);while(Rf(a));Qf(a,1);return new J(d)}function Wf(a,b,c){Qf(a,0);var d=Vf(a,b,c);if(Rf(a)){var e=[];do e.push(Vf(a,b,c));while(Rf(a))}Qf(a,1);return new L(d,e)} 148var Xf=[],Yf=[Wf],Zf=[Uf],$f={POINT:Zf,LINESTRING:[Vf],POLYGON:Yf,MULTIPOINT:[Uf,Nf],MULTILINESTRING:[Vf,Lf],MULTIPOLYGON:[Wf,Mf],GEOMETRY:Xf,GEOMETRYCOLLECTION:Xf,CIRCULARSTRING:Xf,COMPOUNDCURVE:Xf,CURVEPOLYGON:Xf,MULTICURVE:Xf,MULTISURFACE:Xf,CURVE:Xf,SURFACE:Xf,POLYHEDRALSURFACE:Xf,TIN:Xf,TRIANGLE:Xf},ag={Z:1,M:2,ZM:3}; 149function Pf(a){a=new bg(a);var b;var c=a.next();(b=$f[c.toUpperCase()])||Of(a,c,"type name");if(b!==Xf){c=a.eb();c=ag[c.toUpperCase()];var d=c&1;var e=c>>1;d|e&&a.next();c=a.eb();if("EMPTY"===c)if(a.next(),d=b[1])var f=new d([]);else b!==Zf&&(f=new J([]),b===Yf&&(f=new L(f)));else if("("===c){f=b[0];b=b[1];if(b){var g=[];Qf(a,0);if(f===Uf){var h="("!==a.eb();do g.push(f(a,d,e,h));while(Rf(a))}else{do g.push(f(a,d,e));while(Rf(a))}Qf(a,1);d=new b(g)}else d=f(a,d,e);f=d}else Of(a,c,'"Z", "M", "ZM", "(" or "EMPTY"'); 150a.next()&&Of(a,c,"end of stream")}return f||x}function bg(a){this.nt=a}bg.prototype.eb=function(){var a=this.ew;if(a===A){for(a=this.nt;a.eb()===cg;)a.next();if(dg[a.eb()])a=a.next(),a=a===eg?"":String.fromCharCode(a);else{a.yi();do a.next();while(!dg[a.eb()]);a=String.fromCharCode.apply(null,a.mh())}this.ew=a}return a};bg.prototype.next=function(){var a=this.eb();""!==a&&delete this.ew;return a}; 151var cg=32,eg=-1,fg={VD:cg,PD:40,UD:41,MD:44,ND:eg},dg=Object.keys(fg).reduce(function(a,b){a[fg[b]]=!0;return a},Za());t("H.util.wkt.toGeometry",function(a){return Pf(new Qa(a))});function gg(a,b){b=b||{};"status"in b&&(this.status=+b.status);"statusText"in b&&(this.statusText=b.statusText);this.ok=200<=this.status&&300>this.status;this.Uu=!1;a?"string"===typeof a?this.Ko=a:(b=globalThis.ArrayBuffer)&&b.prototype.isPrototypeOf(a)?this.Cf=a:b&&a.buffer?this.Cf=a.buffer:globalThis.Blob.prototype.isPrototypeOf(a)&&(this.Fl=a):this.Ko=""}t("H.net.Response",gg);gg.prototype.type="default";gg.prototype.type=gg.prototype.type;gg.prototype.status=200;gg.prototype.status=gg.prototype.status; 152gg.prototype.statusText="OK";gg.prototype.statusText=gg.prototype.statusText;function hg(a){if(a.Uu)return ne(new TypeError("Already read"));a.Uu=!0}gg.error=function(){gg.mp||(gg.mp=new gg(null,{status:0,statusText:""}),gg.mp.type="error");return gg.mp};gg.error=gg.error; 153gg.prototype.text=function(){var a=hg(this);if(!a)if(this.Ko)a=me(this.Ko);else if(this.Cf){a=new Uint8Array(this.Cf);var b=a.length,c=Array(b),d;for(d=0;d<b;d++)c[d]=String.fromCharCode(a[d]);a=me(c.join(""))}else a=this.Fl?ig(this.Fl):ne("Unsupported response body");return a};gg.prototype.json=function(){return this.text().then(globalThis.JSON.parse)}; 154gg.prototype.blob=function(){var a,b=hg(this);b||(this.Fl?a=this.Fl:this.Cf&&(a=new Blob([this.Cf],{type:"application/octet-stream"})));return b||me(a)};gg.prototype.arrayBuffer=function(){return this.Cf?hg(this)||me(this.Cf.slice(0)):this.blob().then(gg.ty
154)};gg.ty=function(a){var b=new FileReader;b.readAsArrayBuffer(a);return new ee(function(c,d){b.onload=function(){c(b.result)};b.onerror=function(){d(b.error)}})}; 155function ig(a){var b=new FileReader;b.readAsText(a);return new ee(function(c,d){b.onload=function(){c(b.result)};b.onerror=function(){d(b.error)}})}!zb&&globalThis.Response&&globalThis.Response.error&&(gg=globalThis.Response,rb(gg.prototype));function jg(a,b,c){function d(){var n=z(l.Wh,l),p=+k.timeout||0;kg?(lg(l,"timeout",n),e.timeout=p):p&&(l.Nx=setTimeout(function(){e.abort();l.Wh({type:"timeout"})},p));lg(l,"error",n);lg(l,"load",n);e.send(k.data)}var e,f,g,h=c&&c.headers||{},k={},l=this;if(!db(b))throw new C(jg,1,"function required");a+="";Wa(h,mg.headers,h);Wa(k,mg,c||{});k.headers=h;this.kt=b;this.I=e=new XMLHttpRequest;b=k.method;try{e.open(b,a,!0);for(f in h)h.hasOwnProperty(f)&&(g=h[f])&&e.setRequestHeader(f,g);e.withCredentials= 156!!k.withCredentials;d()}catch(n){this.Wh({type:"cors"})}}t("H.net.Xhr",jg);var mg={method:"GET",headers:{},data:null},ng="withCredentials"in new XMLHttpRequest,kg="timeout"in new XMLHttpRequest;function lg(a,b,c){ng?a.I.addEventListener(b,c):a.I["on"+b]=c}function og(a,b,c){ng?a.I.removeEventListener(b,c):a.I["on"+b]=null}jg.prototype.abort=function(){this.I&&(this.I.abort(),this.I&&this.Wh({type:"abort"}))};jg.prototype.abort=jg.prototype.abort; 157jg.prototype.Wh=function(a){var b=a.type;a=this.I;var c;this.Nx&&clearTimeout(this.Nx);"load"===b?a instanceof XMLHttpRequest&&200!==a.status&&(c="network"):c=4===a.readyState&&0===a.status&&"error"==b?"cors":"error"!=b?b:"network";b=this.Wh;og(this,"timeout",b);og(this,"error",b);og(this,"load",b);a=0===a.status||c&&"network"!==c?gg.error():new gg(a.responseText||null,a);c=this.kt;delete this.Wh;delete this.kt;delete this.I;c(a)};function pg(){var a=pg.rv;a||(a=this,pg.rv=a,rb(pg.rv),I.call(a),this.Ag());return a}u(pg,I);m=pg.prototype;m.disposeInternal=function(){pg.g.disposeInternal.call(this);this.Ag()};m.Ag=function(){this.AB=10;this.BB=6;this.ki=Za();this.Cr=Za();this.Hr=0};m.Eo=function(a){a=a.type;var b=this.ki[a]||0;if(this.Hr<this.AB&&b<this.BB){var c=++this.pB;this.Hr++;this.ki[a]=b+1;this.Cr[c+""]=a;return c}return x}; 158m.$l=function(a){var b=this.Cr[a];if(!fb(b)||!this.ki[b])throw new Bb(this.$l,"Unknown requestId");this.Hr--;this.ki[b]--;this.ki[b]||delete this.ki[b];delete this.Cr[a];this.dispatchEvent("allocatable")};m.pB=-1;function qg(a,b,c,d){if(!rg[a])throw new C(qg,0,"Mime type is not supported");this.HB=a;a=d?Ta(d):{};"crossOrigin"in a||(a.crossOrigin="anonymous");this.Fa=a;sg.href=b.toString();Ce.call(this,sg.protocol+"//"+sg.hostname,b,c)}u(qg,Ce);qg.prototype.Rt=function(){this.br=rg[this.HB].call(this);return!0};qg.prototype.Wi=function(){this.br&&(this.br.abort(),delete this.br)}; 159var rg={"application/json":function(){var a=this,b=tg(this.Fa),c=b.headers;b.headers=c=c?Ta(c):{};c.Accept="application/json";return new jg(this.data,function(d){200<=d.status&&300>d.status?a.resolve(d.json()):a.reject(d)},b)},"text/plain":function(){var a=this;return new jg(this.data,function(b){200<=b.status&&300>b.status?a.resolve(b.text()):a.reject(b)},tg(this.Fa))},image:function(){var a=globalThis.document.createElement("img"),b=this,c=this.data;a.onload=z(this.resolve,this,a);a.onerror=function(){b.reject(gg.error())}; 160a.crossOrigin=this.Fa.crossOrigin;a.src=c;return{abort:function(){a.onerror=a.onload=null;Qe&&df(a)||a.removeAttribute("src")}}}}; 161(function(){try{var a=new XMLHttpRequest;a.open("get","/",!0)}catch(b){a={}}"response"in a&&(rg.arraybuffer=function(){var b=new XMLHttpRequest,c=this,d=this.Fa,e=d.headers,f;b.open("GET",this.data);ug(b,d);b.responseType="arraybuffer";if(e)for(f in e)b.setRequestHeader(f,e[f]);b.onerror=b.ontimeout=function(){c.reject(gg.error())};b.onload=function(){c.resolve(new gg(b.response))};b.send();return b})})();var vg=new Fe(new pg);qg.prototype.Fp=function(){return vg};var sg=globalThis.document.createElement("a"); 162function tg(a){var b=Ta(a);delete b.crossOrigin;ug(b,a);return b}function ug(a,b){a.withCredentials="use-credentials"===b.crossOrigin};var wg;function xg(a,b){if(globalThis.URL)return(new globalThis.URL(a,b)).toString();if(!a||!yg(a))return a;
162if(!b||yg(b))throw new TypeError("Failed to construct 'URL': Invalid base URL");wg||(wg=document.createElement("a"),rb(wg));var c=wg;c.href=b;"/"!==a[0]?a=c.href.replace(/\/[^\/]*$/,"/")+a:((b=c.origin)||(b=c.protocol+"//"+c.host),a=b+a);return a}function yg(a){var b=!1;"string"===typeof a&&(b=!(-1<a.search(/^(http|https|data|blob):/)||"//"===a.substr(0,2)));return b};function zg(a,b){zg.g.constructor.call(this);if(b&&yg(b))throw new C(zg,1,"Base URL must be absolute");this.s=Ag.INIT;this.Ia=null;this.md=b}u(zg,I);t("H.map.render.Style",zg);zg.prototype.load=zg.prototype.load;zg.prototype.getState=function(){return this.s};zg.prototype.getState=zg.prototype.getState;zg.prototype.F=function(a){this.s=a};zg.prototype.setState=zg.prototype.F;zg.prototype.Lc=function(){return this.md};zg.prototype.getBaseUrl=zg.prototype.Lc;zg.prototype.Sd=function(){return cb(this.Ia)}; 163zg.prototype.getConfig=zg.prototype.Sd;zg.prototype.Cz=function(){return this.Ia};zg.prototype.getConfigReference=zg.prototype.Cz;zg.prototype.Eg=function(a){this.Ia=a};zg.prototype.setConfig=zg.prototype.Eg;zg.prototype.Ic=function(a){this.Ia=null;this.F(Ag.ERROR);this.bq(Bg)?this.dispatchEvent(new Pd(Bg,a,this)):console.error(a)};zg.prototype.dispatchError=zg.prototype.Ic;zg.prototype.disposeInternal=function(){zg.g.disposeInternal.call(this);this.Ia=null}; 164var Bg="error",Cg={Af:"change",Js:Bg},Ag={ERROR:-1,INIT:0,LOADING:1,READY:2};zg.State=Ag;function Dg(a,b){var c,d=arguments.length,e,f;for(c=1;c<d;c++)if((e=arguments[c])&&e!==a&&e!==g){var g=e;for(f in e){var h=e[f];a[f]!==h&&(Eg(h)?Eg(a[f])?a[f]=Dg(a[f],h):a[f]=cb(h):void 0!==h&&(a[f]=cb(h)))}}return a}t("H.util.webgl.mergeObjects",Dg);var Fg=Za();function Gg(a,b,c){var d=c[a];return b&&d in b&&0>eb.indexOf(d)?(b=b[d],++a<c.length?Gg(a,b,c):b):Fg} 165var Hg=Gg.bind(null,0),Ig={polygons:1,lines:1,"pattern-lines":1,points:1,text:1,raster:1,custom_icons:1,overlays:1},Jg={data:1,draw:1,enabled:1,filter:1,properties:1},Kg=Object.keys(Jg);function Lg(a,b,c,d,e,f){var g=d[a],h=c[g];if(++a<d.length){var k=b[g]||{};for(c=Kg.length;c--;){var l=Kg[c];if("draw"!==l||!f){var n=h[l];n!==A&&(k[l]=cb(n))}}Lg(a,k,h,d,e,f)}else e?k=cb(h):(k=h,delete c[g]);b[g]=b[g]?Dg(b[g],k):k}var Mg=Lg.bind(null,0);function Ng(a,b){a in Ig&&(b[a]=1)} 166function Og(a,b,c){var d,e,f;for(d in a)if(Jg[d]){if("draw"===d){var g=a[d];for(e in g){var h=g[e];(f=h.style)?(h.style=b+f,Ng(f,c)):(delete g[e],g[b+e]=h,Ng(e,c))}}}else Og(a[d],b,c)} 167function Pg(a,b){var c={},d,e,f,g;b+="_";a=Dg({},a);if(d=a.styles)for(e in d){var h=d[e];delete d[e];d[b+e]=h;if(f=h.mix)for(lb(f)&&(f=[f]),g=f.length;g--;)Ng(f[g],c),f[g]=b+f[g];if(g=h.base)f||(f=h.mix=[]),f.unshift(b+g),delete h.base,Ng(g,c);Ng(e,c)}else d=a.styles={};if(h=a.layers)for(e in h)f=h[e],delete h[e],(g=f.data)&&!g.layer&&(g.layer=e),h[b+e]=f,Og(f,b,c);for(e in c)d[b+e]={base:e};return a} 168function Qg(a,b){var c=a.sources,d=Object.keys(c)[0],e=Dg(c[d],{uid:b});c=a.layers;var f;a.sources={};a.sources[b]=e;for(f in c)a=c[f],a.data?a.data.source===d&&(a.data.source=b):a.data={source:b}}function Rg(a,b){var c;var d=a.textures;a=a.fonts;for(c in d){var e=d[c];e.url&&(e.url=xg(e.url,b))}for(c in a)if(e=a[c],kb(e))for(d=0;d<e.length;d++){var f=e[d];f.url=f.url&&xg(f.url,b)}else f=e,f.url=f.url&&xg(f.url,b)}function Sg(a,b){return"function(){return "+("feature."+a+(b||""))+";}"} 169function Tg(a){return Sg("style."+a,void 0)}function Ug(a,b,c,d){a={base:a,blend:b,blend_order:c};d&&(a.clean_depth=!!d);return a}function Vg(a){var b={};b["translucent-"+(a?"extruded-":"")+"polygons"]={color:Tg("fillColor"),order:1,interactive:!0,extrude:a};return b}function Wg(a,b,c,d){a={data:{source:a,layer:b}};c&&(a.draw=c);d&&(a.filter=d);return a}function Eg(a){return ya(a)&&!kb(a)};function Xg(a,b){Xg.g.constructor.call(this,a,b);if(lb(a))Yg.test(a)&&-1===a.indexOf("import:")?(this.yc=a,b||(this.bB=yg(this.yc)?A:this.yc)):this.po=a;else if(ya(a))this.Eg(cb(a));else throw new C(Xg,0,"invalid style configuration");}u(Xg,zg);t("H.map.render.webgl.Style",Xg); 170Xg.prototype.load=function(){var a=this,b=this.Lc();this.yc?(this.F(Ag.LOADING),(new qg("text/plain",this.yc)).then(function(c){var d={};return Zg(c,b,!1,(d[b]=!0,d))}).then(function(c){return a.Eg(c)},function(c){return a.Ic(c.message)}),delete this.yc):this.po&&(this.F(Ag.LOADING),Zg(this.po,b).then(function(c){return a.Eg(c)},function(c){return a.Ic(c.message)}),delete this.po)};Xg.prototype.load=Xg.prototype.load; 171Xg.prototype.Ww=function(a,b,c){var d;$g(this);a=ah(this,a,this.Ww,c);for(c=0;c<a.length;c++){var e=a[c].yb.draw;for(d in e){var f=e[d];Eg(f)&&(f.interactive=!!b)}}bh(this)};Xg.prototype.setInteractive=Xg.prototype.Ww; 172Xg.prototype.setProperty=function(a,b,c){var d,e=a.split("."),f=0,g=e.length;$g(this);if(!fb(b))throw new C(this.setProperty,1,"value");if(d=ch(this.Ia,e)){if(!(d.parent instanceof Object)||d.parent instanceof Array)if(c)e.pop(),e=ch(this.Ia,e),d.parent=e.parent[e.En]={};else throw new C(this.setProperty,0,a+" property is not primitive type");d.parent[d.En]=b}else{for(d=this.Ia;f!==g-1;)d[e[f]]={},d=d[e[f++]];d[e[f]]=b}dh(this)&&bh(this)};Xg.prototype.setProperty=Xg.prototype.setProperty; 173Xg.prototype.Op=function(a){$g(this);return(a=ch(this.Ia,a.split(".")))?cb(a.node):void 0};Xg.prototype.getProperty=Xg.prototype.Op;Xg.prototype.removeProperty=function(a){$g(this);(a=ch(this.Ia,a.split(".")))&&a.parent&&a.parent.hasOwnProperty(a.En)&&(delete a.parent[a.En],dh(this)&&bh(this))};Xg.prototype.removeProperty=Xg.prototype.removeProperty; 174Xg.prototype.vj=function(a,b,c){var d;$g(this);var e=this.Ia;var f=e.layers;var g=ah(this,a,this.vj,!1);a=g.length;for(d={};a--;)Mg(d,f,g[a].id,!!b,!!c);c={};g=Object.keys(e);for(a=g.length;a--;){var h=g[a];var k=e[h];c[h]=k===f?d:cb(k)}b||bh(this);return c};Xg.prototype.extractConfig=Xg.prototype.vj;Xg.prototype.fk=function(a){$g(this);if(!ya(a))throw new C(this.fk,0,"config");this.Eg(Dg(this.Ia,a))};Xg.prototype.mergeConfig=Xg.prototype.fk;Xg.prototype.Yb=ca(2);
175Xg.prototype.toString=function(){return this.getState()===Ag.READY?globalThis.H.gl.yaml.dump(this.Ia,{lineWidth:120}):""};Xg.prototype.disposeInternal=function(){Xg.g.disposeInternal.call(this);delete this.po;delete this.yc};function dh(a){var b=a.Ia,c;if(ya(b)){var d;if(d=a.ts){b=b&&b.sources;d=!1;for(var e in b)if(b[e].type===a.ts){d=!0;break}d=!(b?d:1)}d&&(c="invalid source, the only valid type is "+a.ts)}else c="invalid style configuration";c&&a.Ic(c);return!c} 176function bh(a){a.dispatchEvent(new pd("change",a))}function $g(a){if(a.getState()!==Ag.READY)throw new Bb(a.fk,"style is not ready yet");} 177function ah(a,b,c,d){var e=[],f=kb(b)?b:[b],g,h;void 0===d&&(d=!0);for(f=f.sort().reverse();g=f.pop();){b=String(g).split(".");a:{var k=a.Ia;for(var l=b.length;l--&&!Jg[b[l]];);if(k&&0>l&&(k=Hg(k.layers,b),Eg(k)))break a;k=Fg}if(k===Fg)throw new C(c,0,'Unresolvable layer ID "'+g+'"');e.push({id:b,yb:k});if(d)for(h in k)!Jg[h]&&Eg(k[h])&&f.push(g+"."+h)}return e}function ch(a,b){var c=0,d;for(d=b.length;c!==d;){var e=b[c++];var f=a;a=f[e];if(!a)break}return c===d?{node:a,parent:f,En:e}:void 0} 178var Yg=/^(http[s]?)?.*\.ya?ml/i; 179function Zg(a,b,c,d){c=void 0===c?!1:c;d=void 0===d?{}:d;try{var e=globalThis.H.gl.yaml.load(a,{json:!0})}catch(f){return Promise.reject(f)}return e&&(a=e["import"],lb(a)&&(a=[a]),c&&b&&eh(e,b),delete e["import"],kb(a)&&a.length)?(c=a.reduce(function(f,g){var h=b?xg(g,b):g;d[h]||(d[h]=!0,f.push((new qg("text/plain",h)).then(function(k){return Zg(k,h,!0,d)})));return f},[]),Promise.all(c).then(function(f){var g={};f.forEach(function(h){return h&&Dg(g,h)});Dg(g,e);return g})):Promise.resolve(e)} 180function eh(a,b){function c(g){g.url&&(g.url=xg(g.url,b))}var d=a&&a.fonts;if(d)for(var e in d)kb(d[e])?d[e].forEach(c):c(d[e]);if(a=a&&a.textures)for(var f in a)c(a[f])}Xg.normalize=eh;Xg.prototype.Eg=function(a){Xg.g.Eg.call(this,a);dh(this)&&(this.F(Ag.READY),bh(this))};Xg.prototype.Sd=function(){return Xg.g.Sd.call(this)};Xg.prototype.getConfig=Xg.prototype.Sd;Xg.prototype.Lc=function(){return this.bB||Xg.g.Lc.call(this)};Xg.prototype.getBaseUrl=Xg.prototype.Lc;t("H.map.Style",Xg);Xg.State=Ag;var fh={PENDING:0,ACTIVE:1,DONE:2};t("H.map.render.RenderState",fh);function gh(){}t("H.map.provider.Invalidations",gh);gh.MARK_INITIAL=cc;gh.prototype.update=function(a,b){b!==hh.NONE&&(this.Md=a,b&hh.SPATIAL&&(this.fx=a),b&hh.VISUAL&&(this.Kx=a),b&hh.ADD&&(this.$s=a),b&hh.REMOVE&&(this.Bw=a),b&hh.Z_ORDER&&(this.Ox=a),b&hh.VOLATILITY&&(this.Lx=a))};gh.prototype.update=gh.prototype.update;gh.prototype.iA=function(){return this.Md};gh.prototype.getMark=gh.prototype.iA;gh.prototype.Md=cc;gh.prototype.eB=function(a){return this.Md>a};gh.prototype.isAny=gh.prototype.eB; 181gh.prototype.Kx=cc;gh.prototype.Kh=function(a){return this.Kx>a};gh.prototype.isVisual=gh.prototype.Kh;gh.prototype.fx=cc;gh.prototype.sq=function(a){return this.fx>a};gh.prototype.isSpatial=gh.prototype.sq;gh.prototype.$s=cc;gh.prototype.Su=function(a){return this.$s>a};gh.prototype.isAdd=gh.prototype.Su;gh.prototype.Bw=cc;gh.prototype.Km=function(a){return this.Bw>a};gh.prototype.isRemove=gh.prototype.Km;gh.prototype.Ox=cc;gh.prototype.uq=function(a){return this.Ox>a};gh.prototype.isZOrder=gh.prototype.uq; 182gh.prototype.Lx=cc;gh.prototype.jB=function(a){return this.Lx>a};gh.prototype.isVolatility=gh.prototype.jB;var hh={NONE:0,VISUAL:1,SPATIAL:2,ADD:4,REMOVE:8,Z_ORDER:16,VOLATILITY:32};gh.Flag=hh;function ih(a,b,c){this.paths=this.Tc=a;b!==A&&(this.interiorsIndex=this.Uj=b);c!==A&&(this.outlinesIndex=this.sn=c)}ih.prototype.Uj=bc;ih.prototype.interiorsIndex=ih.prototype.Uj;ih.prototype.sn=bc;ih.prototype.outlinesIndex=ih.prototype.sn;var jh=bb(new ih([])),kh=ab([]);function lh(a,b,c,d){this.left=+a;this.top=+b;this.right=+c;this.bottom=+d}t("H.math.Rect",lh);lh.prototype.set=lh;lh.prototype.set=lh.prototype.set;lh.prototype.Oc=function(){return this.ll||(this.ll=new K(this.left,this.top))};lh.prototype.getTopLeft=lh.prototype.Oc;lh.prototype.Mc=function(){return this.Ri||(this.Ri=new K(this.right,this.bottom))};lh.prototype.getBottomRight=lh.prototype.Mc;lh.prototype.Ql=function(a,b){return this.left<=a&&this.right>=a&&this.top<=b&&this.bottom>=b}; 183lh.prototype.containsXY=lh.prototype.Ql;function mh(a,b){return new lh(a.x,a.y,b.x,b.y)}lh.fromPoints=mh;lh.prototype.clone=function(){return new lh(this.left,this.top,this.right,this.bottom)};lh.prototype.clone=lh.prototype.clone;function nh(a){var b;if(a){var c=B(a,nh);for(b in a)if(b in this){var d=a[b];d!==this[b]&&("fillColor"===b||0<(d=+d))&&(this[b]=d)}a=c?a.Pc:!!(Pe(this.fillColor)&&this.width&&this.width);a||(this.Pc=a)}ab(this)}t("H.map.ArrowStyle",nh);nh.prototype.Pc=!0;nh.prototype.fillColor="rgba(255,255,255,.75)";nh.prototype.width=1.2;nh.prototype.length=1.6;nh.prototype.frequency=5;nh.prototype.eu=function(){return new nh(this)}; 184nh.prototype.da=function(a){var b=this===a;!b&&a&&(b=a.width===this.width&&a.fillColor===this.fillColor&&a.length===this.length&&a.frequency===this.frequency);return b};nh.prototype.equals=nh.prototype.da;function M(a){var b;if(a){var c=oh;for(b=B(a,M);c--;){var d=ph[c];if(a.hasOwnProperty(d)){var e=a[d];if(b)this[d]=e;else{if((e=qh[c](e))===rh)throw new C(M,0,d+": "+a[d]);e!==this[d]&&e!==A&&(this[d]=e)}}}c=b?a.Xj:this.lineWidth&&Pe(this.strokeColor);c||(this.Xj=c);c=b?a.Pc:Pe(this.fillColor);c||(this.Pc=c);c=b?a.Vj:"none"!==this.strokeColor&&this.lineWidth;c||(this.Vj=c)}ab(this)}t("H.map.SpatialStyle",M);M.prototype.Pc=!0;M.prototype.Xj=!0;M.prototype.Vj=!0;var ph="strokeColor fillColor lineWidth lineCap lineJoin miterLimit lineDash lineDashOffset lineDashImage lineHeadCap lineTailCap".split(" "); 185M.prototype.strokeColor="rgba(0,85,170,.6)";M.prototype.strokeColor=M.prototype.strokeColor;M.prototype.fillColor="rgba(0,85,170,.4)";M.prototype.fillColor=M.prototype.fillColor;M.prototype.lineWidth=2;M.prototype.lineWidth=M.prototype.lineWidth;M.prototype.lineCap="round";M.prototype.lineCap=M.prototype.lineCap;M.prototype.lineJoin="miter";M.prototype.lineJoin=M.prototype.lineJoin;M.prototype.miterLimit=1;M.prototype.miterLimit=M.prototype.miterLimit;M.prototype.tB=Ze;M.prototype.lineDash=M.prototype.tB; 186M.prototype.lineDashOffset=0;M.prototype.lineDashOffset=M.prototype.lineDashOffset;M.prototype.uB=A;M.prototype.lineDashImage=M.prototype.uB;M.prototype.vB=A;M.prototype.lineHeadCap=M.prototype.vB;M.prototype.wB=A;M.prototype.lineTailCap=M.prototype.wB;var oh=ph.length;M.prototype.da=function(a){var b=this===a;if(!b&&a){for(b=0;b<oh;b++){var c=ph[b];if(this[c]!==a[c])break}b=b===oh}return b};M.prototype.equals=M.prototype.da;
186M.prototype.fu=function(a){if(a){var b={};Wa(b,this,a)}else b=this;return new M(b)}; 187M.prototype.getCopy=M.prototype.fu; 188var rh=ab({}),qh=[function(a){return a?$a(a):rh},function(a){return a?$a(a):rh},function(a){return 0<=a&&100>=a?+a:rh},function(a){a=$a(a);return"butt"===a||"square"===a||"round"===a||"arrow-head"===a||"arrow-tail"===a?a:rh},function(a){return"round"===a||"bevel"===a||"miter"===a?a:rh},function(a){return 0<a&&100>=a?+a:rh},function(a){return a&&a.every&&a.every(pb)?a:rh},function(a){return D(+a)?rh:+a},function(a){return a===A||a instanceof HTMLImageElement||a instanceof HTMLCanvasElement||Object.values(sh).includes(a)? 189a:rh},function(a){return fb(a)?qh[3](a):A},function(a){return fb(a)?qh[3](a):A}],th=new Image;th.src="data:image/svg+xml;base64,"+btoa('<svg width="128" height="128" viewBox="0 0 128 128" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg"><g id="arrow"><path style="fill:#ff0000" d="M 0,0 32,64 2,128 128,64 Z"/></g></svg> ');var uh=new Image;uh.src="data:image/svg+xml;base64,"+btoa('<svg width="128" height="128" viewBox="0 0 128 128" xmlns="http://www.w3.org/2000/svg"><circle style="fill:#ffffff" cx="64" cy="64" r="64" /></svg>'); 190var sh={ARROW:th,CIRCLE:uh};M.DashImage=sh;M.MAX_LINE_WIDTH=100;var vh=new M;M.DEFAULT_STYLE=vh;var wh="fillColor strokeColor lineWidth lineCap lineJoin miterLimit lineDashOffset lineDash lineTailCap lineHeadCap".split(" ");M.prototype.P=function(){for(var a={},b=wh.length,c;b--;)c=wh[b],a[c]=this[c];return a};M.prototype.forWorkerMessage=M.prototype.P;function xh(a){xh.g.constructor.call(this);void 0!==a&&(this.data=a)}u(xh,I);t("H.map.Feature",xh);xh.prototype.getData=function(){return this.data};xh.prototype.getData=xh.prototype.getData;xh.prototype.disposeInternal=function(){xh.g.disposeInternal.call(this);delete this.data};function N(a){gb(this,N);N.g.constructor.call(this,a?a.data:A);this.Rj=yh.next();if(a){var b="min";ob(a[b])&&(this.zb=a[b]);b="max";ob(a[b])&&(this.Qc=a[b]);b="visibility";b in a&&(this.Ld=!!a[b]);b="volatility";b in a&&(this.lo=!!a[b]);b="zIndex";b in a&&(this.Hi=+a[b]||0);b="provider";b in a&&!B(a[b],P)&&(this.D=a[b],this.ra(hh.ADD))}}u(N,xh);t("H.map.Object",N);var yh=new Te(1),zh={ANY:31,OVERLAY:1,SPATIAL:2,MARKER:4,DOM_MARKER:8,GROUP:16};N.Type=zh;N.prototype.xb=function(){return this.Rj}; 191N.prototype.getId=N.prototype.xb;N.prototype.Zr=function(a){if(!ob(a)&&!lb(a))throw new C(this.Zr,0,"id must be a number or a string");this.gi=a;return this};N.prototype.setRemoteId=N.prototype.Zr;N.prototype.zA=function(){return this.gi};N.prototype.getRemoteId=N.prototype.zA;N.prototype.zb=-1/0;N.prototype.Qc=1/0;N.prototype.lu=function(a){var b=this.Qc;if(a)for(a=this;a=a.Na;)b=Eb(b,a.Qc);return b};N.prototype.getMax=N.prototype.lu; 192N.prototype.nu=function(a){var b=this.zb;if(a)for(a=this;a=a.Na;)b=Fb(b,a.zb);return b};N.prototype.getMin=N.prototype.nu;N.prototype.Ld=!0;N.prototype.Zb=function(a){var b=this.Ld;(a=!!a)!==b&&(this.Ld=a,this.invalidate(hh.VISUAL));return this};N.prototype.setVisibility=N.prototype.Zb;N.prototype.Wd=function(a){for(var b=this,c;(c=b.Ld)&&a&&(b=b.Na););return c};N.prototype.getVisibility=N.prototype.Wd;N.prototype.lo=!1;N.prototype.sm=function(a){for(var b=this,c;!(c=b.lo)&&a&&(b=b.Na););return c}; 193N.prototype.getVolatility=N.prototype.sm;N.prototype.$w=function(a){var b=this.lo;b!==!!a&&(this.lo=!b,this.invalidate(hh.VOLATILITY));return this};N.prototype.setVolatility=N.prototype.$w;N.prototype.Hi=A;N.prototype.wu=function(){return this.Hi};N.prototype.getZIndex=N.prototype.wu;N.prototype.ui=function(a){a!==this.Hi&&(this.Hk(),this.Hi=a,this.invalidate(hh.Z_ORDER));return this};N.prototype.setZIndex=N.prototype.ui;N.prototype.qo=A; 194N.prototype.We=function(){var a=this.qo,b,c;if(!a){var d=+((b=this.Hi)!==A);(a=this.Na)?(a=a.We().slice(),a[0]|=d):a=[d];a.push(b||0,0>(c=this.ds)?this.Rj:c);this.qo=a}return a};N.prototype.getZInfo=N.prototype.We;N.prototype.Hk=function(){this.qo=A};function Ah(a,b,c){var d,e;if(!c||a[0]|b[0]){var f=a.length;var g=b.length;var h=Eb(f,g);var k=1;for(e=1+ +c;k<h;k+=e)if(d=a[k]-b[k])return d}return c?0:f-g}N.compareZInfo=Ah;function Bh(a,b){return a.qt(b)}N.compareZOrder=Bh; 195N.prototype.qt=function(a){return this.ro-a.ro||Ah(this.We(),a.We(),!1)};N.prototype.compareZOrder=N.prototype.qt;m=N.prototype;m.previousSibling=x;m.nextSibling=x;m.ds=-1;m.Na=x;m.nA=function(){return this.Na};N.prototype.getParentGroup=N.prototype.nA;N.prototype.sd=function(){for(var a=this,b;b=a.Na;)a=b;return a};N.prototype.getRootGroup=N.prototype.sd;N.prototype.contains=function(a){return this===a};N.prototype.contains=N.prototype.contains;
196N.prototype.ea=function(a){if(this.Na)throw new Bb(this.ea,"Not allowed for a child of a group");N.g.ea.call(this,a)};N.prototype.setParentEventTarget=N.prototype.ea;N.prototype.draggable=N.prototype.draggable=!1;N.prototype.D=x;N.prototype.Pp=function(){return this.D};N.prototype.getProvider=N.prototype.Pp; 197N.prototype.ti=function(a,b){var c=this.D,d;if(d=c!==a){if(b&&(c&&!B(c,P)||a&&!B(a,P)))throw new Bb(b,"Only LocalObjectProvider allows an object transfers");b=this.type!==zh.GROUP;c&&(this.invalidate(hh.REMOVE),b&&c.Oa(this));if(this.D=a)b&&a.Y(this),this.Xf=x,this.invalidate(hh.ADD)}return d};N.prototype.Xf=x;N.prototype.Nc=function(){return this.Xf||(this.Xf=new gh)};N.prototype.getInvalidations=N.prototype.Nc;N.prototype.ra=function(a){var b=this.D,c;(c=!!b)&&b.invalidateObject(this,a);return c}; 198N.prototype.invalidate=N.prototype.ra;N.prototype.disposeInternal=function(){this.Na&&this.Na.Oa(this);N.g.disposeInternal.call(this)};N.prototype.setData=function(a){this.data=a;return this};N.prototype.setData=N.prototype.setData; 199N.prototype.ze=function(a){if(a&&!db(a))throw new C(N.prototype.ze,0,"opt_callback must be a function");a=Ch(this,a?a(this.data):this.data,!!a);a=db(this.V)?{type:"Feature",properties:a,geometry:this.V().ze()}:{type:"FeatureCollection",features:Ze};this.gi&&(a.id=this.gi);return a};N.prototype.toGeoJSON=N.prototype.ze; 200function Ch(a,b,c){if(null===b||b===A)return null;if(0<=Object.keys(b).length&&"[object Object]"!==Object.prototype.toString.call(b))throw Error(Dh(a,c));try{return JSON.stringify(b),b}catch(d){throw Error(Dh(a,c));}}function Dh(a,b){return"Object Remote-Id: "+a.gi+" - "+(b?"The value returned by the callback is not a valid JSON object and cannot be set as Feature properties.":"The given object data is not a valid JSON object and cannot be set as Feature properties.")} 201N.prototype.P=function(){return{id:this.Rj,properties:{min:this.nu(),max:this.lu(),zIdx:this.Hi,sIdx:this.ds,parent:this.Na?this.Na.xb():0,visible:this.Wd(),"volatile":this.sm()},type:"Feature"}};N.prototype.forWorkerMessage=N.prototype.P;function Eh(a,b){var c;Eh.g.constructor.call(this,b);b&&this.Cb(b.style);a&&(this.Xe=!0);b&&(c=b.arrows)&&this.Rw(c)}u(Eh,N);t("H.map.Spatial",Eh);Eh.prototype.type=zh.SPATIAL;Eh.prototype.ro=0;Eh.prototype.style=vh;Eh.prototype.K=function(){return this.style};Eh.prototype.getStyle=Eh.prototype.K;Eh.prototype.Cb=function(a){var b=!0;a?this.style=B(a,M)?a:new M(a):this.style?delete this.style:b=!1;b&&this.invalidate(hh.VISUAL);return this};Eh.prototype.setStyle=Eh.prototype.Cb; 202Eh.prototype.vz=function(){return this.Tg};Eh.prototype.getArrows=Eh.prototype.vz;Eh.prototype.Rw=function(a){var b=this.Tg,c=!1;!a&&b?(delete this.Tg,c=!0):!a||b&&b.da(a)||(this.Tg=new nh(a),c=!0);c&&"none"!==this.style.strokeColor&&this.ra(1);return this};Eh.prototype.setArrows=Eh.prototype.Rw;function Fh(a,b){var c=!1,d=!1,e;if(b.length){for(c=0;c<b.length;c++)if(b[c]!==jh){d=!0;break}b=a.style;c=d?b.Xj||b.Pc&&a.Xe||(e=a.Tg||!1)&&b.Vj&&e.Pc:b.Pc}return c&&a.Wd(!0)}Eh.prototype.Xe=!1; 203Eh.prototype.fB=function(){return this.Xe};Eh.prototype.isClosed=Eh.prototype.fB;Eh.prototype.getGeometriesForTile=Eh.prototype.xh;Eh.prototype.Hp=function(){return A};Eh.prototype.getLabels=Eh.prototype.Hp;function Gh(a,b){Gh.g.constructor.call(this,a,b)}u(Gh,Eh);t("H.map.GeoShape",Gh);Gh.prototype.getBoundingBox=Gh.prototype.C;function Hh(a,b,c,d){var e=[],f=b.length,g;for(g=0;g<f;g++){var h=b[g];if(h.length){var k=e,l=k.push,n=void 0,p=a,q=c,r=d,v=[],w=h.length,y=0;p.Ft=0;for(n=n||0;y<w;)v.push(Ih(p,h[y++],h[y++],n,r));q&&v.push(Ih(p,h[0],h[1],n,r));l.call(k,v)}}return e}function Ih(a,b,c,d,e){var f=a.Ft;f&&180<Jb(f-c)&&(c+=0>f?-360:360);a.Ft=c;return e.wq(b,c+d)} 204function Jh(a,b,c){for(var d=b,e,f=a.length+b,g,h;d--;){b=a[d];g=b.length;for(e=Array(g);g--;)h=b[g],e[g]=new K(h.x+c,h.y);a[--f]=e}};function Kh(a,b){var c=b&&(+b.extrusion||+b.extrude)||0,d=b&&+b.elevation||0,e=0;Kh.g.constructor.call(this,!0,b);0<d&&(e+=d,this.Jf=d);0<c&&(e+=c,this.nh=c);if(2047<e)throw new Cb(Kh,e,[0,2047]);B(a,J)?this.X(new L(a)):this.X(a)}u(Kh,Gh);t("H.map.Polygon",Kh);var Lh=new L(new J([0,0,0,0,0,0,0,0,0]));Kh.prototype.nh=0;Kh.prototype.Jf=0;Kh.prototype.Hb=Lh;Kh.MAX_EXTRUDE_HEIGHT=2047; 205Kh.prototype.Pr=function(a){var b=+a;if(b!==a)throw new C(this.Pr,0,a);if(0>b||2047<this.Jf+b)throw new Cb(this.Pr,this.Jf+b,[0,2047]);this.nh=b;this.ra(hh.SPATIAL)};Kh.prototype.setExtrusion=Kh.prototype.Pr;Kh.prototype.Pz=function(){return this.nh};Kh.prototype.getExtrusion=Kh.prototype.Pz;Kh.prototype.Or=function(a){var b=+a;if(b!==a)throw new C(this.Or,0,a);if(0>b||2047<this.nh+b)throw new Cb(this.Or,this.nh+b,[0,2047]);this.Jf=b;this.ra(hh.SPATIAL)};Kh.prototype.setElevation=Kh.prototype.Or; 206Kh.prototype.Kz=function(){return this.Jf};Kh.prototype.getElevation=Kh.prototype.Kz;Kh.prototype.V=function(){return this.Hb};Kh.prototype.getGeometry=Kh.prototype.V;
206Kh.prototype.X=function(a){if(B(a,L))var b=!1;else B(a,Mf,this.X,0),b=!0;this.Vf=b;b=this.Hb;this.Hb=a;b!==Lh&&this.ra(hh.SPATIAL);return this};Kh.prototype.setGeometry=Kh.prototype.X;Kh.prototype.C=function(){return this.V().C()};Kh.prototype.getBoundingBox=Kh.prototype.C; 207Kh.prototype.xh=function(a){var b,c=this.V(),d,e;if(this.Vf){c=c.ha;var f=0;for(e=c.length;f<e;f++)if(d=Mh(this,c[f],a,c[f].kf))b||(b=[]),b.push(d)}else d=this.kf,d===A&&(d=this.Vf?Df.NORTH:this.V().kf),(d=Mh(this,c,a,d))&&(b=[d]);return b};Kh.prototype.getGeometriesForTile=Kh.prototype.xh; 208function Mh(a,b,c,d){var e,f,g=0,h=!0;if(e=Nh(a,b.Fb,c,d,b.C())){var k=new ih(e);var l=b.cb;if(f=l.length)for(k.Uj=k.Tc.length;g<f;g++)if(e=Nh(a,l[g],c,d,b.du(g)))k.Tc=k.Tc.concat(e);f=k.Tc.length;for(g=0;g<f;g++)if(k.Tc[g]!==kh){h=!1;break}h&&(k=g%2?jh:A)}return k} 209function Nh(a,b,c,d,e){var f=c.Pj(),g=e,h=g.oc();var k=[[]];var l=b.S;var n=[],p=l.length,q,r=!1;for(q=0;q<p;q+=3){var v=l[q];var w=l[q+1];r||180!=Jb(w)||(n.push(v),n.push(w),n.push(v),n.push(-w),r=!0);n.push(v);n.push(w)}l=n;360>h&&-180==g.W&&(g=new E(g.fa,180,g.ga,g.ca));360>h&&180==g.ca&&(g=new E(g.fa,g.W,g.ga,-180));if(g.qc()){h=l;v=h.length;l=-1;for(n=0;n<v-2;n+=2)if(rc(h[n+1],h[n+3])){l=n+2;break}-1===l&&rc(h[v-1],h[1])&&(l=v);-1!==l&&(p=h[l-2],n=h[l-1],q=h[l%v],r=h[(l+1)%v],180!==Jb(p)&&180!== 210Jb(q)&&(w=Jb(q-p),v=Jb(r-n),v+=180<v?-360:0,r=Jb(180-r),r+=180<r?-360:0,v&&r&&(w/=Jb(v)/Jb(r),p=q+(q>p?-w:w),n=0<n?180:-180,h.splice(l,0,p,n,p,-n))));l=h}k[0]=Oh([].concat(l),g.W);360>g.oc()&&g.Gf(new tc(g.fa,180))&&(l=Oh([].concat(l),g.ca),k.push(l));g=c.pm();a=Hh(a,k,!0,g);if(360===e.oc()&&1===b.Cp(!0)%2){b=a;a=c.Pj();b[0][1].x>b[0][b[0].length-1].x&&(b[0]=b[0].reverse());l=[];h=b[0].length-1;for(k=0;k<h;k++)n=b[0][k],l[k]=new K(n.x-2*g.w,n.y),l[k+h]=new K(n.x-g.w,n.y),l[k+2*h]=new K(n.x,n.y),l[k+ 2113*h]=new K(n.x+g.w,n.y),l[k+4*h]=new K(n.x+2*g.w,n.y);b[0]=l;k=g.wq(d,0);k.y=2*a[d===Df.NORTH?"top":"bottom"];d=k.clone();k.x=b[0][b[0].length-1].x+1;d.x=b[0][0].x-1;b[0].push(k,d);a=b}d=f.left;b=f.top;k=f.right;f=f.bottom;if(qf(a,d,b,k,f,!0).length){if(!c.nm().Vo(e)){c=a;e=[new K(d,b),new K(k,b),new K(k,f),new K(d,f)];f=[];for(a=c.length;a--;)if(d=sf(e,c[a]))for(b=Ph(d),f.push(b);d.Nq;)d=d.Nq,b=Ph(d),f.push(b);a=f}}else c=Qh(d,b,a[0]),a[1]&&(c=c!==Qh(d,b,a[1])),a=c?[kh]:A;return a} 212function Qh(a,b,c){var d,e,f;var g=d=c[0].x;var h=e=c[0].y;var k=1;for(f=c.length;k<f;k++){var l=c[k].x;var n=c[k].y;l>d?d=l:l<g&&(g=l);n>e?e=n:n<h&&(h=n)}return g<=a&&a<=d&&h<=b&&b<=e&&mc({x:a,y:b},nc(c.concat(c[0])))}function Ph(a){var b=[],c=a;do{var d=Gb(100*(c.nC?c.nC:c.x))/100;var e=Gb(100*(c.oC?c.oC:c.y))/100;if(!f||.01<Lb(Mb(f.x-d,2)+Mb(f.y-e,2))){var f=new K(d,e);b.push(f)}c=c.next}while(c&&c!==a);return b}Kh.prototype.Si=x; 213function Oh(a,b){var c,d=Number.POSITIVE_INFINITY,e=-1,f=a.length;for(c=0;c<f;c+=2){var g=Jb(a[c+1]-b);g+=180<g?360-g:g;g<d&&(d=g,e=c)}return 0<c?(b=a.splice(e,a.length-e),b.concat(a)):a} 214Kh.prototype.P=function(){var a=Kh.g.P.call(this),b=this.V(),c=this.Vf?b.ha:[b],d,e=a.properties;var f=a.geometry=b.P();e.style=this.K().P();e.height=this.nh+this.Jf;e.min_height=this.Jf;if(this.C().qc()&&(f.type="MultiPolygon",this.Vf)){var g=[];c.forEach(function(h,k){d=f.coordinates[k];h.C().qc()?g=g.concat(d):g.push(d)});f.coordinates=g}return a};Kh.prototype.forWorkerMessage=Kh.prototype.P;function Rh(a,b,c){Rh.g.constructor.call(this,Lh,c);this.Zn(a);this.Yr(b);c&&this.lw in c&&this.Xr(c[this.lw])}u(Rh,Kh);t("H.map.Circle",Rh);Rh.prototype.Zn=function(a){(a=vc(a)).da(this.Ef)||(this.Ef=a,Sh(this))};Rh.prototype.setCenter=Rh.prototype.Zn;Rh.prototype.wb=function(){return this.Ef};Rh.prototype.getCenter=Rh.prototype.wb;Rh.prototype.Yr=function(a){if(D(a=gc(a,0,6371000.79*Vb/2)))throw new C(this.Yr,0,a);this.wr!==a&&(this.wr=a,Sh(this))};Rh.prototype.setRadius=Rh.prototype.Yr; 215Rh.prototype.yA=function(){return this.wr};Rh.prototype.getRadius=Rh.prototype.yA;Rh.prototype.zn=60;Rh.prototype.Xr=function(a){if(!ob(a))throw new C(this.Xr,0,a);this.zn!==(a=gc(Gb(a),4,360))&&(this.zn=a,Sh(this))};Rh.prototype.setPrecision=Rh.prototype.Xr;Rh.prototype.lw="precision";Rh.prototype.vA=function(){return this.zn};Rh.prototype.getPrecision=Rh.prototype.vA;Rh.prototype.X=function(){return this};Rh.prototype.setGeometry=Rh.prototype.X; 216Rh.prototype.V=function(){this.Hb===Lh&&Rh.g.X.call(this,Th(this));return this.Hb};Rh.prototype.getGeometry=Rh.prototype.V;function Sh(a){a.Hb!==x&&Rh.g.X.call(a,Th(a))}function Th(a){var b=a.Ef,c=b.lat,d=a.wr,e=0,f=new J;if(90===Jb(c))for(c=b.mo(0,d,!0).lat;360>e;e+=120)f.tr(c,e-180,A);else for(a=a.zn,a=360/a;360>e;e+=a)f.tg(b.mo(e,d,!0));b=new L(f);0>c&&b.Xw(Df.SOUTH);return b};function Uh(a,b,c,d){if(!a||!b||!c)throw new C(Uh,A,"Must specify name, version and revision parameter");this.name=a;this.version=b;this.revision=c;d&&Wa(this,d)}t("H.util.BuildInfo",Uh);Uh.prototype.toString=function(){var a,b=[];for(a in this)lb(this[a])&&b.push(this[a]);return b.join(";")};var Vh={};function Wh(a,b,c,d){if(!a)throw new C(Wh,1,"Must specify a name parameter");return Vh[a]||(Vh[a]=new Uh(a,b,c,d))}Uh.get=Wh;function Xh(a,b){this.w=+a;this.h=+b}t("H.math.Size",Xh);function Yh(a,b,c,d,e){b&&(this.gf=b);fb(c)&&(this.Ho=!!c);this.Ho&&d&&(this.Io=new Xh(d.w,d.h));fb(e)&&(this.Gk={crossOrigin:e});switch(Zh[jb(a)]){case 2:this.gb=a;$h(this,1);break;case 1:if(df(a)){this.gb=a;ai(this);$h(this,1);break}a=a.src;case 0:if(a){a=Se(a);this.Cm=new qg("image",a,A,this.Gk);this.Cm.then(z(this.aC,this),z(this.$B,this));break}default:throw $h(this,-1),new C(Yh,0,"No image data");}}Yh.prototype.s=0;Yh.prototype.getState=function(){return this.s}; 217function $h(a,b){a.s=b;delete a.Cm;a.gf&&a.gf(b,a)}Yh.prototype.Ho=!0;function ai(a){if(a.Ho){var b=a.gb,c=bi(a),d=c&&c.w||+b.width,e=c&&c.h||+b.height,f=Ke();if(B(b,globalThis.HTMLCanvasElement))c=b;else{c=b.ownerDocument.createElement("canvas");
217c.width=Ib(d*f);c.height=Ib(e*f);var g=c.getContext("2d");g.scale(f,f);g.drawImage(b,0,0,d,e);Ma&&(g.clearRect(0,0,d,e),g.drawImage(b,0,0,d,e))}a.gb=c}}Yh.prototype.getData=function(){return this.gb||x};var Zh={String:0,HTMLImageElement:1,HTMLCanvasElement:2}; 218m=Yh.prototype;m.Io=x;m.mc=function(){return 1===this.s?bi(this):x};function bi(a){var b=a.Io,c;if(!b){var d=a.gb;b=d.naturalWidth||d.width;if(0===b&&Qe&&1===Zh[jb(d)]){var e=!0;if(c=d.parentNode)var f=d.nextSibling;document.body.appendChild(d)}a.Io=b=new Xh(d.naturalWidth||d.width,d.naturalHeight||d.height);e&&(c?c.insertBefore(d,f):document.body.removeChild(d))}return b}m.aC=function(a){this.gb=a;ai(this);$h(this,1)};m.$B=function(){$h(this,-1)};m.cancel=function(){this.Cm&&this.Cm.cancel()};function ci(a,b,c){var d="anonymous",e=1;this.Wg=z(this.Wg,this);N.call(this,c);this.X(a);c&&(a="crossOrigin",a in c&&(d=c[a]),a="opacity",a in c&&(e=c[a]));this.Tw(b,d);this.Fd(e)}u(ci,N);t("H.map.Overlay",ci);ci.prototype.type=zh.OVERLAY;ci.prototype.C=function(){return this.J};ci.prototype.getBoundingBox=ci.prototype.C;ci.prototype.si=function(a){B(a,E,this.si,0,a);return this.X(a)};ci.prototype.setBoundingBox=ci.prototype.si;ci.prototype.V=function(){return this.J}; 219ci.prototype.getGeometry=ci.prototype.V;ci.prototype.X=function(a){var b=this.J,c=!b;B(a,E,this.X,0,a);if(c||!b.da(a))this.J=a,c||this.ra(hh.SPATIAL);return this};ci.prototype.setGeometry=ci.prototype.X;ci.prototype.Te=function(){return this.gb.getData()};ci.prototype.getBitmap=ci.prototype.Te;ci.prototype.Tw=function(a,b){var c=this.gb;c&&1!==c.getState()&&c.cancel();this.gb=new Yh(a,this.Wg,!0,A,b);return this};ci.prototype.setBitmap=ci.prototype.Tw; 220ci.prototype.Wg=function(a,b){this.gb=b;1===a&&this.ra(hh.VISUAL)};ci.prototype.Ve=function(){return this.Sc};ci.prototype.getOpacity=ci.prototype.Ve;ci.prototype.Fd=function(a){var b=this.Sc,c=2>b;a-=0;if(0<=a&&1>=a)a!==b&&(this.Sc=a,c&&this.ra(hh.VISUAL));else throw new C(this.Fd,0);return this};ci.prototype.setOpacity=ci.prototype.Fd;ci.prototype.P=function(){var a=ci.g.P.call(this);a.geometry=Cf(this.J).P();a.properties.overlay=!0;return a};ci.prototype.forWorkerMessage=ci.prototype.P;var di={PROVIDES_BY_VIEWPORT:1,PROVIDES_RASTERS:2,PROVIDES_SPATIALS:4,PROVIDES_OVERLAYS:8,PROVIDES_MARKERS:16,PROVIDES_DOM_MARKERS:32,PROVIDES_GEOJSON:64,PRO
220VIDES_OMV:128,CROP_LINES_BY_TILE:256,CROP_POLYGONS_BY_TILE:512,HAS_VOLATILE_DATA:1024};t("H.map.provider.Capabilities",di);di.PROVIDES_WEBGL_RENDERABLE_OBJECTS=di.PROVIDES_SPATIALS|di.PROVIDES_OVERLAYS|di.PROVIDES_MARKERS;function ei(a){this.Ba=a} 221ei.prototype.Ke=function(){var a={};this.Ba&di.PROVIDES_RASTERS&&(a={"translucent-raster":Ug("raster","inlay",1)});if(this.Ba&di.PROVIDES_WEBGL_RENDERABLE_OBJECTS){var b=!!(this.Ba&di.CROP_LINES_BY_TILE),c={"translucent-polygons":Ug("polygons","inlay",2),"translucent-extruded-polygons":Ug("polygons","translucent",3),"translucent-pattern-lines":Ug("pattern-lines","translucent",4),"translucent-overlays":Ug("overlays","inlay",5),markers:Ug("custom_icons","overlay",6,!1)};c["translucent-polygons"].crop_by_tile=!!(this.Ba& 222di.CROP_POLYGONS_BY_TILE);c["translucent-pattern-lines"].crop_by_tile=b;c.markers.suppress_fade=!0;c.markers.stick=!0;Wa(a,c)}return a};function fi(a,b,c,d,e){this.Ba=a;this.uid=b;this.Dv=c;this.Kq=d;this.tileSize=e}fi.prototype.Ke=function(){var a={};a[this.uid]=this.Ba&di.PROVIDES_BY_VIEWPORT?gi(this,"ObjectSource",!1,{progressiveUpdate:!0,has_volatile_data:!!(this.Ba&di.HAS_VOLATILE_DATA)}):this.Ba&di.PROVIDES_RASTERS?gi(this,"RemoteRasterTileSource",!0,{url:""}):gi(this,"ObjectTileSource",!0,{tile_size:this.tileSize});return a};function gi(a,b,c,d){a={type:b,uid:a.uid,tiled:c,max_zoom:a.Kq};d&&Wa(a,d);return a};function hi(a,b,c){this.Ba=a;this.uid=b;this.opacity=c;this.$m=this.Ba&di.PROVIDES_BY_VIEWPORT?"function(){return sources[$source].isInMinMaxRange(feature, $zoom) && feature.ref.effectiveVisibility;}":A;this.bg={}} 223hi.prototype.Ke=function(){this.Ba&di.PROVIDES_RASTERS&&(this.bg["tile_layer_"+this.uid]=Wg(this.uid,"_default",{"translucent-raster":{color:[1,1,1,this.opacity],order:0}}));if(this.Ba&di.PROVIDES_SPATIALS){var a={"translucent-pattern-lines":{color:Tg("strokeColor"),width:Tg("lineWidth * $meters_per_pixel"),join:Tg("lineJoin"),cap:Tg("lineCap"),tail_cap:Tg("lineTailCap"),head_cap:Tg("lineHeadCap"),miter_limit:Tg("miterLimit"),order:"function() { return 2 + feature.effectiveZIdx / 2; }",interactive:!0, 224dash:Tg("lineDash"),extrude:!0,dash_phase:Tg("lineDashOffset")}};var b=this.bg,c="polygon_layer_"+this.uid;var d=Wg(this.uid,"polygons",void 0,this.$m);d.flat={filter:"function(){return !feature.height && !feature.min_height;}",draw:Vg(!1)};d.extruded={filter:"function(){return feature.height || feature.min_height;}",draw:Vg(!0)};b[c]=d;this.bg["outline_layer_"+this.uid]=Wg(this.uid,"outlines",a,this.$m);this.bg["polyline_layer_"+this.uid]=Wg(this.uid,"polylines",a,this.$m)}this.Ba&di.PROVIDES_OVERLAYS&& 225(this.bg["overlay_layer_"+this.uid]=Wg(this.uid,"overlays",{"translucent-overlays":{color:[1,1,1,this.opacity],order:8190,interactive:!0}}));this.Ba&di.PROVIDES_MARKERS&&(this.bg["marker_layer_"+this.uid]=Wg(this.uid,"markers",{markers:{sprite:Sg("icon.id"),offset:Sg("icon.offset"),collide:!1,priority:8191,elevate_by_altitude:!0,interactive:!0,stick:{color:Sg("icon.stick_color"),height:Sg("icon.stick_height")}}},this.$m));return this.bg};function ii(a,b,c,d,e,f){this.Ba=a;this.uid=b;this.Dv=c;this.Kq=d;this.opacity=e;this.tileSize=f}ii.prototype.Ke=function(){if(this.Ba&di.PROVIDES_DOM_MARKERS&&!(this.Ba&di.PROVIDES_MARKERS))return{};var a=new fi(this.Ba,this.uid,this.Dv,this.Kq,this.tileSize);var b=new ei(this.Ba);var c=new hi(this.Ba,this.uid,this.opacity);a=a.Ke();b=b.Ke();c=c.Ke();return{sources:a,styles:b,layers:c}};function ji(a,b,c){ji.g.constructor.call(this,a);this.oldValue=c;this.newValue=b}u(ji,pd);t("H.util.ChangeEvent",ji);t("H.util.constants.DEFAULT_MIN_ZOOM_LEVEL",0);t("H.util.constants.DEFAULT_MAX_ZOOM_LEVEL",22);var ki={FEATURE:1,SOURCE:2,PROVIDER:3};t("H.map.provider.PickingMode",ki);function Q(a){var b=""+Ve(),c;Q.g.constructor.call(this);a=a||{};this.min=a.min||0;this.max=a.max||22;if(c=a.uri){if(/_/.test(c))throw new C(Q,0,"uri "+c);}else c=b;this.uri=c||b;this.uid=b;a.getCopyrights&&ib(a.getCopyrights,"Function",Q)&&(this.getCopyrights=a.getCopyrights);this.Eb=this.Eb.bind(this);this.lq=!0;this.vb=a.engineType||li;if(this.vb===mi.HARP&&!H.map.render.harp)throw new C(Q,0,"HARP engine is not supported, module not found");}u(Q,I);t("H.map.provider.Provider",Q);m=Q.prototype; 226m.j={Li:"configchange",Aa:"update"};m.jb=function(a,b){this.dispatchEvent(new Qd(this.j.Aa,b,a))};m.Eb=function(a){a=new ji(this.j.Li,a&&a.newValue,a&&a.oldValue);this.dispatchEvent(a)};m.disposeInternal=function(){I.prototype.disposeInternal.call(this);this.Ya&&(this.Ya.removeEventListener("change",this.Eb),this.Ya.l(),delete this.Ya)};m.U=function(){return null};Q.prototype.getCopyrights=Q.prototype.U; 227Q.prototype.getCapabilities=function(){var a=0;this.qr()&&(a|=di.PROVIDES_BY_VIEWPORT);this.providesRasters()&&(a|=di.PROVIDES_RASTERS);this.providesSpatials()&&(a|=di.PROVIDES_SPATIALS);this.providesOverlays()&&(a|=di.PROVIDES_OVERLAYS);this.providesMarkers()&&(a|=di.PROVIDES_MARKERS);this.providesDomMarkers()&&(a|=di.PROVIDES_DOM_MARKERS);this.providesGeoJSON()&&(a|=di.PROVIDES_GEOJSON);this.providesOMV()&&(a|=di.PROVIDES_OMV);return a};Q.prototype.getCapabilities=Q.prototype.getCapabilities; 228Q.prototype.qr=Xe;Q.prototype.zk=Xe;Q.prototype.providesRasters=Q.prototype.zk;Q.prototype.ne=Xe;Q.prototype.providesSpatials=Q.prototype.ne;Q.prototype.sr=Xe;Q.prototype.providesOverlays=Q.prototype.sr;Q.prototype.Wc=Xe;Q.prototype.providesMarkers=Q.prototype.Wc;Q.prototype.Vc=Xe;Q.prototype.providesDomMarkers=Q.prototype.Vc;Q.prototype.rr=Xe;Q.prototype.providesGeoJSON=Q.prototype.rr;Q.prototype.Xc=Xe;Q.prototype.providesOMV=Q.prototype.Xc;Q.prototype.Mz=function(){return this.vb}; 229Q.prototype.getEngineType=Q.prototype.Mz;Q.prototype.$C=function(a){this.vb=a};Q.prototype.setEngineType=Q.prototype.$C;Q.prototype.xk=Ye;Q.prototype.preprocessData=Q.prototype.xk;Q.prototype.Sc=1;Q.prototype.Fg=function(a){a=gc(a,0,1);D(a)&&(a=1);this.Sc!==a&&(this.Sc=a,this.lq&&ni(this),this.Eb(),this.jb())};Q.prototype.mA=function(){return this.Sc};Q.prototype.getOpacityInternal=Q.prototype.mA; 230Q.prototype.Xa=function(a,b){var c=this;
230if(this.vb===mi.WEBGL&&!B(a,Xg)||this.vb===mi.HARP&&!B(a,H.map.render.harp.Style))throw a=Object.entries(mi).find(function(d){return d[1]===c.vb}),new C(this.Xa,0,"Invalid style for engineType "+a);this.Ya&&(this.Ya.removeEventListener("change",this.Eb),this.Ya.removeEventListener(Bg,this.Eb),this.Ya.l());this.Ya=a;this.Ya.addEventListener("change",this.Eb);this.Ya.addEventListener(Bg,this.Eb);b||this.Eb();this.lq=!1};Q.prototype.setStyleInternal=Q.prototype.Xa; 231Q.prototype.mb=function(){this.Ya||ni(this);return this.Ya};Q.prototype.getStyleInternal=Q.prototype.mb;function ni(a){if(a.vb===mi.WEBGL){var b=new ii(a.getCapabilities(),a.uid,a.min,a.max,a.Sc,a.tileSize);a.Ya=new Xg(b.Ke())}else a.vb===mi.HARP&&H.map.render.harp&&(a.Ya=new H.map.render.harp.Style({}));a.lq=!0} 232Q.prototype.ru=function(){var a=this.getCapabilities(),b=ki.FEATURE;a&di.PROVIDES_BY_VIEWPORT?b=ki.SOURCE:a&di.PROVIDES_RASTERS?b=null:a&di.PROVIDES_WEBGL_RENDERABLE_OBJECTS&&(b=ki.PROVIDER);return b};Q.prototype.getPickingMode=Q.prototype.ru;Q.prototype.Rz=function(){return!1};Q.prototype.getFeatureProxy=Q.prototype.Rz;function oi(){}function pi(a){return Eb(1,Fb(0,.5-Kb(Rb(Xb+Wb*a/180))/Vb/2))}oi.prototype.Sm=function(a,b,c){c?(c.x=b/360+.5,c.y=pi(a)):c=new K(b/360+.5,pi(a));return c};oi.prototype.latLngToPoint=oi.prototype.Sm;oi.prototype.Se=function(a,b){return this.Sm(a.lat,a.lng,b)};oi.prototype.geoToPoint=oi.prototype.Se;function qi(a){return 0>=a?90:1<=a?-90:ac*(2*Sb(Nb(Vb*(1-2*a)))-Wb)} 233oi.prototype.Za=function(a,b,c){c?(c.lat=qi(b),c.lng=360*(1===a?1:ec(a,1))-180):c=new tc(qi(b),360*(1===a?1:ec(a,1))-180);return c};oi.prototype.xyToGeo=oi.prototype.Za;oi.prototype.wn=function(a,b){return this.Za(a.x,a.y,b)};oi.prototype.pointToGeo=oi.prototype.wn;var ri=new oi;t("H.geo.mercator",ri);function si(a,b){this.projection=a||ri;this.Ii=0;this.jl=this.exp=Kb(b||256)/Ub;ti(this);this.y=this.x=0}t("H.geo.PixelProjection",si);var ui=Jb(24)+Jb(-8);si.prototype.Dn=ri;si.prototype.projection=si.prototype.Dn;si.prototype.x=0;si.prototype.x=si.prototype.x;si.prototype.y=0;si.prototype.y=si.prototype.y;si.prototype.w=Mb(2,ui);si.prototype.w=si.prototype.w;si.prototype.UA=Mb(2,ui);si.prototype.h=si.prototype.UA; 234si.prototype.Va=function(a){if(D(a))throw new C(this.Va,0,a);var b=this.x/this.w;var c=this.y/this.h;this.Ii=a;this.jl=this.exp+a;ti(this);this.x=b*this.w;this.y=c*this.h};si.prototype.rescale=si.prototype.Va;function ti(a){a.jl>ui&&(a.jl=ui);a.w=Mb(2,a.jl);a.h=Mb(2,a.jl)}si.prototype.xu=function(){return this.Ii||0};si.prototype.getZoomScale=si.prototype.xu;si.prototype.Gb=function(a,b){a=this.projection.Sm(a.lat,a.lng,b);a.x=a.x*this.w-this.x;a.y=a.y*this.h-this.y;return a}; 235si.prototype.geoToPixel=si.prototype.Gb;si.prototype.sk=function(a,b){return this.projection.Za((a.x+this.x)/this.w,(a.y+this.y)/this.h,b)};si.prototype.pixelToGeo=si.prototype.sk;si.prototype.Za=function(a,b,c){return this.projection.Za((a+this.x)/this.w,(b+this.y)/this.h,c)};si.prototype.xyToGeo=si.prototype.Za;si.prototype.wq=function(a,b,c){a=this.projection.Sm(a,b,c);a.x=a.x*this.w-this.x;a.y=a.y*this.h-this.y;return a};si.prototype.latLngToPixel=si.prototype.wq; 236si.prototype.bi=function(a){return new K(a.x*this.w-this.x,a.y*this.h-this.y)};si.prototype.pointToPixel=si.prototype.bi;function vi(a){a=a||{};vi.g.constructor.call(this);this.min=0;this.max=22;this.Ny=this.dark=!!a.dark;a.min&&this.Tr(a.min);a.max&&this.Rr(a.max);this.pixelProjection=new si(a.projection,a.minWorldSize);a.provider&&(this.D=a.provider,this.jb=z(this.jb,this),this.D.addEventListener(Q.prototype.j.Aa,this.jb,!1,this),this.Eb=z(this.Eb,this),this.D.addEventListener(Q.prototype.j.Li,this.Eb,!1,this))}u(vi,I);t("H.map.layer.Layer",vi);vi.prototype.min=0;vi.prototype.min=vi.prototype.min; 237vi.prototype.max=22;vi.prototype.max=vi.prototype.max;vi.prototype.j={Aa:"update",Li:"configchange",Qs:"minchange",Ps:"maxchange"};vi.prototype.Pp=function(){return this.D};vi.prototype.getProvider=vi.prototype.Pp;vi.prototype.iB=function(a){return this.min<=a&&a<=this.max};vi.prototype.isValid=vi.prototype.iB;
238function wi(a,b,c){var d=a[b],e="min"===b,f=e?a.Tr:a.Rr;if(c!==d)if(e?c<=a.max:c>=a.min)a[b]=c,a.jb(),a.Eb(),a.dispatchEvent(new ji(e?a.j.Qs:a.j.Ps,c,d));else throw new C(f,0,"Invalid condition min <= max");return a}vi.prototype.Tr=function(a){return wi(this,"min",+a)};vi.prototype.setMin=vi.prototype.Tr;vi.prototype.Rr=function(a){return wi(this,"max",+a)};vi.prototype.setMax=vi.prototype.Rr;vi.prototype.jb=function(){this.dispatchEvent(this.j.Aa)}; 239vi.prototype.Eb=function(a){a=new ji(this.j.Li,a&&a.newValue,a&&a.oldValue);this.dispatchEvent(a)};vi.prototype.disposeInternal=function(){vi.g.disposeInternal.call(this)};vi.prototype.U=function(){return null};vi.prototype.getCopyrights=vi.prototype.U;function xi(a,b){xi.g.constructor.call(this,b);ib(a,"Function",xi,0,"invalid render callback");this.Ar=a}u(xi,vi);t("H.map.layer.DomLayer",xi);xi.prototype.L=function(a,b){return this.Ar(a,b)};t("H.util.Disposable",ed);ed.prototype.bc=ed.prototype.bc;ed.prototype.addOnDisposeCallback=ed.prototype.bc;t("H.util.dispose",dd);ed.prototype.l=ed.prototype.l;ed.prototype.dispose=ed.prototype.l;ed.prototype.disposeInternal=ed.prototype.disposeInternal;ed.prototype.disposeInternal=ed.prototype.disposeInternal;function yi(a,b,c,d){yi.g.constructor.call(this);this.nd=a;this.ja=d;this.element=a.appendChild(this.createElement(a.ownerDocument));this.Uk(b,c)}u(yi,ed);yi.prototype.B=function(){return this.element};yi.prototype.Uk=function(a,b){this.size?(this.size.w=a,this.size.h=b):this.size=new Xh(a,b);this.Zw(this.element,this.element.style,a,b,this.ja)};yi.prototype.setSize=yi.prototype.Uk;m=yi.prototype;m.mc=function(){return this.size};m.lb=function(){return this.ja};m.$u=!0; 240m.Zb=function(a){a!==this.$u&&(this.element.style.display=a?"block":"none",this.$u=a)};m.opacity=1;m.Fd=function(a){this.opacity!==a&&(this.Fg(a),this.opacity=a)};m.Ve=function(){return this.opacity};m.ui=function(a){this.element.style.zIndex=a};yi.prototype.setZIndex=yi.prototype.ui;yi.prototype.wu=function(){return+this.element.style.zIndex};yi.prototype.Re=function(){};yi.prototype.clear=function(){}; 241yi.prototype.disposeInternal=function(){this.clear();this.nd.removeChild(this.element);this.Uk(0,0);delete this.element;delete this.nd;yi.g.disposeInternal.call(this)};yi.prototype.disposeInternal=yi.prototype.disposeInternal;yi.prototype.yw=0;yi.prototype.Sn=function(){++this.yw};yi.prototype.release=function(){--this.yw||this.l()};function zi(a,b){var c=b||{},d=c.contextType;c=c.contextAttributes;zi.g.constructor.call(this,b);ib(a,"Function",zi,0,"invalid render callback");if(d){if(-1===Ai.indexOf(d))throw new C(zi,1,"invalid context type");this.ij=d}c&&(this.hj=c);this.Ar=a}u(zi,vi);t("H.map.layer.CanvasLayer",zi);var Ai=["2d","webgl","webgl2","experimental-webgl"];m=zi.prototype;m.ij="2d";m.uh=function(){return this.ij};m.getContextAttributes=function(){return this.hj}; 242m.L=function(a,b){this.Sl&&this.Sl.canvas===a||(this.Sl=a.getContext(this.ij,this.hj));return this.Ar(this.Sl,b)};m.disposeInternal=function(){zi.g.disposeInternal.call(this);delete this.Sl};function Bi(a,b){Bi.g.constructor.call(this,!1,b);this.X(a)}u(Bi,Gh);t("H.map.Polyline",Bi);Bi.prototype.C=function(){return this.Hb.C()};Bi.prototype.getBoundingBox=Bi.prototype.C;Bi.prototype.X=function(a){var b=this.X,c,d;if(B(a,Lf)){var e=a.ha;if(c=e.length)for(d=0;d<c;d++)Ci(e[d],b);else throw new C(b,0);}else Ci(a,b);this.Vf=!!e;this.Hb=a;this.ra(hh.SPATIAL);return this};Bi.prototype.setGeometry=Bi.prototype.X;Bi.prototype.V=function(){return this.Hb};Bi.prototype.getGeometry=Bi.prototype.V; 243Bi.prototype.clip=function(a){var b=this.Hb;return nf(this.Vf?b.ha[0]:b,a)};Bi.prototype.clip=Bi.prototype.clip;Bi.prototype.xh=function(a){var b=this.Hb;var c,d=[];if(this.Vf)for(b=b.ha,c=b.length;c--;)Di(this,b[c],a,d);else Di(this,b,a,d);return d.length?d:A};Bi.prototype.getGeometriesForTile=Bi.prototype.xh;function Ci(a,b){if(!B(a,J)||2>a.Mj())throw new C(b,0);} 244function Di(a,b,c,d){var e=nf(b,c.nm());if(e.length&&(b=c.pm(),a=Hh(a,e,!1,b),e=a.length)){var f=c.Pj();b=b.w;c.x||Jh(a,e,-b);c.x===(1<<c.z)-1&&Jh(a,e,b);c=qf(a,f.left,f.top,f.right,f.bottom,!1);c.length&&d.push(new ih(c))}}Bi.prototype.P=function(){var a=Bi.g.P.call(this),b=a.properties;a.geometry=this.V().P();b.style=this.K().P();b.height=0;return a};Bi.prototype.forWorkerMessage=Bi.prototype.P;function Ei(a,b){if(!B(a,Element)){Fi.innerHTML=a;a=Fi.firstElementChild;if(!a)throw new C(Ei,0,"No element data");Fi.removeChild(a);var c=!0;Fi.innerHTML=""}this.Uo=0!==af(a).length;
244this.Nt=c?a:bf(a,globalThis.document,this.Uo);b&&(c="onAttach",c in b&&ib(a=b[c],"Function",Ei,1,c)&&(this.Oq=a),c="onDetach",c in b&&ib(a=b[c],"Function",Ei,1,c)&&(this.Sq=a))}t("H.map.DomIcon",Ei);var Fi=document.createElement("DIV");Ei.prototype.Oq=null;Ei.prototype.Sq=null; 245Ei.prototype.eu=function(a){return bf(this.Nt,a,this.Uo)};Ei.prototype.Uo=!1;function Gi(a,b){var c;var d=a;var e=b||[];if(a!==Hi.NONE){b=c=e.length;if(-1===Ii.indexOf(d))throw new C(Gi,0,a);if(!e)throw new C(Gi,1,e);for(;c--;)if(D(e[c]))throw new C(Gi,1,e);d===Hi.RECT&&3<b&&(e=[e[0],e[1],e[2],e[1],e[2],e[3],e[0],e[3]],d=Hi.POLYGON);if(d===Hi.CIRCLE&&2<b&&(a=e[2],0<a)){d=e[0];var f=e[1];c=Eb(2*Ib(a),40);var g=360/c;for(e=[];c--;){var h=g*c*$b;e.push(d+Ob(h)*a,f+Qb(h)*a)}d=Hi.POLYGON}if(d!==Hi.POLYGON||!b||e.length%2)throw new C(Gi,1,e);this.jw=e}}t("H.map.HitArea",Gi); 246var Hi={NONE:0,RECT:1,CIRCLE:2,POLYGON:3};Gi.ShapeType=Hi;var Ii=[Hi.RECT,Hi.CIRCLE,Hi.POLYGON];Gi.prototype.Bm=function(a,b,c){return this.jw?lc(a,b,this.jw,c,!0):kc.NONE};Gi.prototype.hitTest=Gi.prototype.Bm;function Ji(a,b){var c;gb(this,Ji);Ji.g.constructor.call(this,b);this.X(a);b&&"icon"in b&&(c=b.icon);this.we(c||this.Dp())}u(Ji,N);t("H.map.AbstractMarker",Ji);Ji.prototype.V=function(){return this.hm};Ji.prototype.getGeometry=Ji.prototype.V;Ji.prototype.X=function(a){var b=this.hm;B(a,tc)||B(a,Nf)?this.hm=a:(uc(a,this.X,0),this.hm=vc(a));b&&this.ra(hh.SPATIAL);return this};Ji.prototype.setGeometry=Ji.prototype.X;Ji.prototype.C=function(){return this.hm.C()};Ji.prototype.kc=function(){return this.icon}; 247Ji.prototype.getIcon=Ji.prototype.kc;Ji.prototype.we=function(a){var b=this.icon,c=!b;if(b!==a){if(!this.Zu(a)){if(c)throw new C(this.constructor,1,a);throw new C(this.we,0,a);}this.icon=a;c||this.ra(hh.VISUAL)}return this};Ji.prototype.setIcon=Ji.prototype.we;Ji.prototype.Dp=function(){var a=this.Py;a||(a=this.constructor.prototype.Py=this.tt(Ki));return a}; 248var Ki={svg:'<svg xmlns="http://www.w3.org/2000/svg" width="38" height="47" viewBox="0 0 38 47"><g fill="none"><path fill="#0F1621" fill-opacity=".4" d="M15 46c0 .317 1.79.574 4 .574s4-.257 4-.574c0-.317-1.79-.574-4-.574s-4 .257-4 .574z"></path><path fill="#01b6b2" d="M33.25 31.652A19.015 19.015 0 0 0 38 19.06C38 8.549 29.478 0 19 0S0 8.55 0 19.059c0 4.823 1.795 9.233 4.75 12.593L18.975 46 33.25 31.652z"></path><path fill="#6A6D74" fill-opacity=".5" d="M26.862 37.5l4.714-4.77c3.822-3.576 5.924-8.411 5.924-13.62C37.5 8.847 29.2.5 19 .5S.5 8.848.5 19.11c0 5.209 2.102 10.044 5.919 13.614l4.719 4.776h15.724zM19 0c10.493 0 19 8.525 19 19.041 0 5.507-2.348 10.454-6.079 13.932L19 46 6.079 32.973C2.348 29.495 0 24.548 0 19.04 0 8.525 8.507 0 19 0z"></path></g></svg>',size:new Xh(38, 24947),anchor:new K(19,45),hitArea:new Gi(Hi.POLYGON,[19,46,2,27,0,18,5,6,19,0,32,5,38,15,36,27,19,47])};Ji.prototype.P=function(){var a=Ji.g.P.call(this),b=this.kc(),c=b.mc(),d=b.Db;a.geometry=this.V().P();c&&(b=a.properties.icon={id:b.uid},b.size={w:c.w,h:c.h},b.offset=[c.w/2-(d?d.x:0),c.h/2-(d?d.y:0)]);return a};Ji.prototype.forWorkerMessage=Ji.prototype.P;function Li(a,b){Li.g.constructor.call(this,a,b)}u(Li,Ji);t("H.map.DomMarker",Li);Li.prototype.type=zh.DOM_MARKER;Li.prototype.ro=2;Li.prototype.tt=function(a){var b=new Ei(a.svg,a);a=a.anchor;b.Nt.style.margin=-a.y+"px 0 0 -"+a.x+"px";return b};Li.prototype.Zu=function(a){return B(a,Ei)};function Mi(a,b){Mi.g.constructor.call(this,Lh,b);this.si(a)}u(Mi,Kh);t("H.map.Rect",Mi);Mi.prototype.si=function(a){if(!B(a,E))throw new C(this.si,0,a);a.da(this.Si)||(this.Si=this.J=a,this.Hb!==x&&Mi.g.X.call(this,Cf(a)))};Mi.prototype.setBoundingBox=Mi.prototype.si;Mi.prototype.C=function(){return this.J};Mi.prototype.getBoundingBox=Mi.prototype.C;Mi.prototype.X=function(){return this};Mi.prototype.setGeometry=Mi.prototype.X; 250Mi.prototype.V=function(){this.Hb===Lh&&Mi.g.X.call(this,Cf(this.Si));return this.Hb};Mi.prototype.getGeometry=Mi.prototype.V;function Ni(a,b,c,d){Ni.g.constructor.call(this,a,b,c);this.modifiers=d}u(Ni,ji);t("H.map.ChangeEvent",Ni);var Oi={SIZE:1,POSITION:2,HEADING:4,TILT:8,INCLINE:16,ZOOM:32,BOUNDS:64};Ni.Type=Oi;Ni.prototype.ey=Oi.SIZE;Ni.prototype.SIZE=Ni.prototype.ey;Ni.prototype.Ss=Oi.POSITION;Ni.prototype.POSITION=Ni.prototype.Ss;Ni.prototype.Ks=Oi.HEADING;Ni.prototype.HEADING=Ni.prototype.Ks;Ni.prototype.Vs=Oi.TILT;Ni.prototype.TILT=Ni.prototype.Vs;Ni.prototype.Ls=Oi.INCLINE;Ni.prototype.INCLINE=Ni.prototype.Ls; 251Ni.prototype.Ws=Oi.ZOOM;Ni.prototype.ZOOM=Ni.prototype.Ws;Ni.prototype.Es=Oi.BOUNDS;Ni.prototype.BOUNDS=Ni.prototype.Es;function Pi(a,b){db(a)&&(this.Vv=a);ob(b)&&(this.ml=b)}t("H.util.Request",Pi);Pi.State={PENDING:0,PROCESSING:1,COMPLETE:2,CANCELLED:3,ERROR:4};var Qi=[0,1,2,3,4];Pi.prototype.s=0;Pi.prototype.getState=function(){return this.s};Pi.prototype.getState=Pi.prototype.getState;
251Pi.prototype.F=function(a){if(0>Qi.indexOf(a))throw new C(this.F,0,a);if(this.s!==a||1===a&&1<this.ml)this.s=a,this.Vv&&this.Vv(this)};Pi.prototype.ml=1;Pi.prototype.LA=function(){return this.ml};Pi.prototype.getTotal=Pi.prototype.LA; 252Pi.prototype.Bn=0;Pi.prototype.wA=function(){return this.Bn};Pi.prototype.getProcessed=Pi.prototype.wA;Pi.prototype.Vt=0;Pi.prototype.Qz=function(){return this.Vt};Pi.prototype.getFailed=Pi.prototype.Qz;function Ri(a,b){a.Bn<a.ml&&(fb(b)||(b=2),0===b||1===b||0!==a.s&&1!==a.s||(a.Bn++,2!==b&&a.Vt++,a.F(a.Bn<a.ml?1:2)))}Pi.prototype.Wi=function(){};Pi.prototype.cancel=function(){3!==this.s&&(this.Wi(),this.F(3))};Pi.prototype.cancel=Pi.prototype.cancel;function Si(a,b,c,d,e,f){var g;for(g=[];d<=e;d++){var h=g.concat,k=a;var l=c;var n=Hb(d);k.pixelProjection.Va(n);var p=k.Bj(l);l=k.Fh(p,n);n=Ti(k,l,p.left>p.right,n);g=h.call(g,n)}a=g.length;Pi.call(this,f,a);this.lx=c=[];this.Zq=z(this.Zq,this);this.Yq=z(this.Yq,this);for(this.F(1);a--;)f=g[a],c.push(Ui(b,f[0],f[1],f[2],this.Zq,this.Yq))}u(Si,Pi);Si.prototype.Zq=function(){Ri(this,2)};Si.prototype.Yq=function(){Ri(this,4)}; 253Si.prototype.Wi=function(){for(var a=this.lx,b=a.length;b--;)a[b].cancel();delete this.lx};function Vi(a,b){b=b||{};var c;if(!B(a,Element))throw new C(Vi,0,a);var d=a.ownerDocument.createElement("div");this.G=a;Vi.g.constructor.call(this);this.padding=new lh(0,0,0,0);this.center=new K(0,0);this.margin=0;this.element=d;d.style.zIndex=0;d.style.height=d.style.width="100%";d.style.direction="ltr";d.style.position="relative"===a.style.position?"absolute":"relative";this.resize();a.appendChild(d);(c=b.padding)!==A&&this.Vr(c.top,c.right,c.bottom,c.left);this.Qr((c=b.margin)!==A?c:0)}u(Vi,I); 254t("H.map.ViewPort",Vi);Vi.prototype.j={Aa:"update",Oi:"sync"};Vi.prototype.Qr=function(a){if(this.margin!==+a){if(D(this.margin=+a))throw new C(this.Qr,0,a);this.De();this.dispatchEvent(this.j.Aa)}};Vi.prototype.setMargin=Vi.prototype.Qr;Vi.prototype.Vr=function(a,b,c,d){var e=this.padding;if(e.top!==a||e.right!==b||e.bottom!==c||e.left!==d){if(D(a+b+c+d))throw new C(this.Vr);e.top=a;e.right=b;e.bottom=c;e.left=d;this.De();this.dispatchEvent(this.j.Aa)}};Vi.prototype.setPadding=Vi.prototype.Vr; 255Vi.prototype.De=function(){var a=this.padding;this.center.set((this.width+a.left-a.right)/2<<0,(this.height+a.top-a.bottom)/2<<0)};Vi.prototype.resize=function(){var a=this.G.offsetWidth,b=this.G.offsetHeight;if(this.width!==a||this.height!==b)this.SB=new Xh(this.width,this.height),this.width=a,this.height=b,this.De(),this.dispatchEvent(this.j.Aa)};Vi.prototype.resize=Vi.prototype.resize;Vi.prototype.rb=function(a){this.dispatchEvent(new Ni(this.j.Oi,this.SB,a,Oi.SIZE))}; 256Vi.prototype.synchronize=Vi.prototype.rb;Vi.prototype.disposeInternal=function(){this.G.removeChild(this.element);delete this.G;delete this.element;Vi.g.disposeInternal.call(this)};Vi.prototype.Jd=Ab;Vi.prototype.startInteraction=Vi.prototype.Jd;Vi.prototype.wd=Ab;Vi.prototype.interaction=Vi.prototype.wd;Vi.prototype.ic=Ab;Vi.prototype.endInteraction=Vi.prototype.ic;function Wi(a,b){b=b||{};if(!a)throw new C(Wi,0,a);this.tileSize=a.tileSize;this.ux={};vi.call(this,{min:void 0!==b.min?b.min:a.min,max:void 0!==b.max?b.max:a.max,minWorldSize:this.tileSize,projection:b.Dn,dark:b.dark,provider:a})}u(Wi,vi);t("H.map.layer.BaseTileLayer",Wi);Wi.prototype.Bj=function(a,b){var c=this.pixelProjection;if(!B(a,E))throw new C(this.Bj,0,a);if(!D(b)){var d=c.xu();c.Va(b)}a=mh(c.Gb(a.Oc()),c.Gb(a.Mc()));!D(d)&&c.Va(d);return a};Wi.prototype.geoRectToRect=Wi.prototype.Bj; 257Wi.prototype.Fh=function(a,b){var c=Mb(2,Hb(b)),d=this.tileSize;if(!B(a,lh))throw new C(this.Fh,0,a);if(D(b=+b))throw new C(this.Fh,1,b);b=Hb(a.left/d);b===c&&--b;var e=Hb(a.right/d);e===c&&--e;return new lh(b,gc(Hb(a.top/d),0,c-1),e,gc(Hb(a.bottom/d),0,c-1))};Wi.prototype.getTileBounds=Wi.prototype.Fh;Wi.prototype.Pa=function(a,b,c,d){return this.D.requestTile(a,b,c,d)};Wi.prototype.requestTile=Wi.prototype.Pa;Wi.prototype.Nd=function(a,b,c){this.D.cancelTile(a,b,c)};Wi.prototype.cancelTile=Wi.prototype.Nd; 258Wi.prototype.U=function(a,b){return this.D.getCopyrights?this.D.getCopyrights(a,b):null};Wi.prototype.getCopyrights=Wi.prototype.U;function Ti(a,b,c,d,e){d=Hb(d);var f=Mb(2,d),g=b.left,h=b.top,k=b.right;c=k+(c?f+(k===b.left?0:1):1);var l=b.bottom,n=[];if(e){var p=g+(1+k-g)/2+e.x/a.tileSize-.5;var q=h+(1+l-h)/2+e.y/a.tileSize-.5}for(;g<c;){for(h=b.top;h<=l;)a=g%f,n.push([a,h,d,e?Jb(p-g)+Jb(q-h):0]),h++;g++}return n} 259Wi.prototype.Oj=function(a,b,c,d,e,f){var g,h=[],k,l=this.D;f=null!=f?f:"__default__";var n=l.requestTile;if(!B(a,lh))throw new C(this.Oj,0,a);if(D(c=+c))throw new C(this.Oj,1,c);d||(g={});b=Ti(this,a,b,c,e);if(a=b.length)for(d||b.sort(Xi),c=a;c--;)e=b[c],d||(g[l.Vd.apply(l,e)]=!0),e[3]=+d,(k=n.apply(l,e))&&h.push(k);if(!d){d=g;var p;g=this.ux[f]||{};for(p in g)g.hasOwnProperty(p)&&g[p]&&!d[p]&&this.D.cancelTileByKey(p);this.ux[f]=d}return{total:a,tiles:h}};Wi.prototype.getProviderTiles=Wi.prototype.Oj; 260function Xi(a,b){return b[3]-a[3]};function Yi(){}t("H.util.ICapturable",Yi);Yi.prototype.capture=function(){};Yi.prototype.capture=Yi.prototype.capture;function Zi(a,b){var c=a.B(),d=c.ownerDocument;Zi.g.constructor.call(this);this.v=a;this.G=c=c.appendChild($i(d,"DIV","position:absolute;bottom:0;right:0;left:0px;z-index:1;direction:ltr;pointer-events:none;height:40px-webkit-touch-callout: none;-webkit-user-select:none;-khtml-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select:none;",null,"H_imprint"));this.Gl=$i(d,"DIV","margin: 0 0 16px 16px;display:inline-block;",'<svg height="40" viewBox="0 0 47 40" width="47" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><path d="m45.2054149 8.82876345.6003191.40637037-.2240425.6914074-.4490426 1.38570368c-.1024468.3148889-.6998936 1.9596297-2.43 3.5918519l-.017234.0163704c-.188617.1887407-.3801064.3659259-.5467021.5084444l-.4605319.4285185-.486383.4516296-.1407447-.0702963c-.7257447.4583704-1.4926596.7886667-2.2796809.9831852l.5840426.5864445-.6769149.6817778-2.052766 2.0636296-.169468.1704444-.019149.0192593-2.3821276 2.3958518c-.4902128.8493334-1.1202128 1.6331852-1.8497873 2.3111112-.6031915.6047407-1.2504255 1.1054814-1.935 1.4954814l-.4777659.4805186-4.3247873 4.3506666-.
2600296808.0298519-.0315958.0269629-2.1532978 1.8171111-.2661702.2253334h-.3485107-3.8948936l-3.968617 3.9914815-1.3547873 1.3616296-.6769148.6808148-.6769149-.6808148-1.3538298-1.3616296-4.80925535-4.837926-3.2687234-3.2875555-1.63436171-1.6437778h2.3112766 4.62255319 2.67223407l-4.71063832-4.7368148-.6769149-.6808148.6769149-.6808148 4.93851062-4.9650371.6769149-.6798518.6769149.6808148 2.7296809 2.7454074c.9363829-.8820741 2.1485106-1.4685185 3.4037234-1.6562963.278617-1.4694815 1.0187234-2.834963 2.168617-3.9885926.5696808-.572 1.1843617-1.0438519 1.8335106-1.4107407l.2901064-.2917778 4.3094681-4.31985187c.5830851-1.0582963 1.4256383-1.78918519 2.0364893-2.12718519l.4471277-.24748148c.3829787-.7617037.9047872-1.47622222 1.5539362-2.12622222 1.510851-1.51666667 3.3165957-2.31881482 5.22-2.31881482.0871276 0 .1752127.00192593.2594681.00577778 1.9484042.06933334 3.8441489.97933334 5.4775532 2.62792593.1512765.15022222.3303191.34859259.5361702.5797037l.0526595.05874074c.1120213.12518519.2345745.26192593.370532.40733334l1.2657446 1.36066666.6328724.67985185-.6548936.65866667-.2508511.25325926zm-27.9288192 22.17414815h-9.57446804l4.78723404 4.8148148zm23.1864894-21.70422223c-.9220213 1.38666663-2.5180851 3.63037033-4.1984042 1.94133333l4.2510638-4.27651851c-.3810638-.41022222-.6711702-.754-.8923404-.97740741-2.2921277-2.31207407-4.8743617-2.34192593-6.8984043-.312-1.3528723 1.35681481-1.7071277 2.91007407-1.313617 4.38533332l-1.332766-1.52629628c-.385851.21474074-2.0182979 1.65918518-.7937234 3.84703708l-1.5252127-1.274963-2.0240426 2.0299259 2.7344681 2.7502222c-2.1121277-1.6861481-4.3889362-1.5205185-6.2157447.312-1.9560638 1.9615556-1.8181915 4.3381482-.3532979 6.293926l-.295851-.2946667c-1.9321277-1.9432593-4.0318085-1.2576296-5.0706383-.2128148-.8023405.8079259-1.2944681 1.9191852-1.0924468 2.6905185l-4.195532-4.2187407-2.22893613 2.2408148 8.25893613 8.3065185h4.4339362l-2.9767021-2.9938519c-.5893908-.6029568-.9604155-1.0987731-1.1531529-1.5232627-.3182349-.7008886-.1504161-1.2073234.3230465-1.680515.7334043-.7318519 1.583617-.2763704 3.0829787 1.2277777l2.9412766 2.9562963 2.2164894-2.2292592-2.7909575-2.8060741c2.0125532 1.5291852 4.4224468 1.612 6.5728724-.545037 1.3567021-1.2653334 1.7425532-2.4565185 1.7425532-2.4565185l-1.6755319-1.1314815c-.9229788 1.3866666-2.5152128 3.6361481-4.195532 1.9461481l4.2606383-4.2851852 2.655 2.6712593 2.3160639-2.3294074-3.3223405-3.3424445c-1.5520212-1.5609629-.6328723-3.0275555.0124469-3.5793333.3025531.6442222.7448936 1.2624445 1.3078723 1.8296296 2.1485106 2.1676297 4.9260638 2.6038519 7.3685106.1550371 1.3567022-1.2643704 1.7425532-2.4565185 1.7425532-2.4565185zm-3.6564894-1.35537321-2.0211702 2.03377777c-.9890425-1.18251851-.9392553-1.81422222-.3245744-2.43051851.7439361-.7462963 1.4993617-.43044445 2.3457446.39674074zm-12.4879787 12.56088884c-.9890425-1.1825185-.9411702-1.819037-.3284042-2.4353333.7448936-.7462963 1.5003191-.4304444 2.3467021.3967408z" fill="#0f1621" fill-opacity=".7"/><path d="m17.2765957 31.0029116-4.787234 4.8148148-4.78723404-4.8148148zm23.1864894-21.70422223 1.6755319 1.13148153s-.385851 1.1921481-1.7425532 2.4565185c-2.4424468 2.4488148-5.22 2.0125926-7.3685106-.1550371-.5629787-.5671851-1.0053192-1.1854074-1.3078723-1.8296296-.6453192.5517778-1.5644681 2.0183704-.0124469 3.5793333l3.3223405 3.3424445-2.3160639 2.3294074-2.655-2.6712593-4.2606383 4.2851852c1.6803192 1.69 3.2725532-.5594815 4.195532-1.9461481l1.6755319 1.1314815s-.3858511 1.1911851-1.7425532 2.4565185c-2.1504256 2.157037-4.5603192 2.0742222-6.5728724.545037l2.7909575 2.8060741-2.2164894 2.2292592-2.9412766-2.9562963c-1.4993617-1.5041481-2.3495744-1.9596296-3.0829787-1.2277777-.4734626.4731916-.6412814.9796264-.3230465 1.680515.1927374.4244896.5637621.9203059 1.1531529 1.5232627l2.9767021 2.9938519h-4.4339362l-8.25893613-8.3065185 2.22893613-2.2408148 4.195532 4.2187407c-.2020213-.7713333.2901063-1.8825926 1.0924468-2.6905185 1.0388298-1.0448148 3.1385106-1.7304445 5.0706383.2128148l.295851.2946667c-1.4648936-1.9557778-1.6027659-4.3323704.3532979-6.293926 1.8268085-1.8325185 4.103617-1.9981481 6.2157447-.312l-2.7344681-2.7502222 2.0240426-2.0299259 1.5252127 1.274963c-1.2245745-2.1878519.4078724-3.63229634.7937234-3.84703708l1.332766 1.52629628c-.3935107-1.47525925-.0392553-3.02851851 1.313617-4.38533332 2.0240426-2.02992593 4.6062766-2.00007407 6.8984043.312.2211702.22340741.5112766.56718519.8923404.97740741l-4.2510638 4.27651851c1.6803191 1.689037 3.2763829-.5546667 4.1984042-1.94133333zm-16.1444681 11.20551563 2.0182979-2.0385925c-.846383-.8271852-1.6018085-1.1430371-2.3467021-.3967408-.612766.6162963-.6606383 1.2528148.3284042 2.4353333zm12.4879787-12.56088884c-.8463829-.82718519-1.6018085-1.14303704-2.3457446-.39674074-.6146809.61629629-.6644681 1.248.3245744 2.43051851z" fill="#fff" fill-opacity=".3"/></g></svg>', 261"H_logo");c.appendChild(this.Gl);c=c.appendChild($i(d,"DIV","right:0;bottom:0;position:absolute;background-color:rgba(255,255,255,.8);color:#0F1621;padding:2px 16px",null,"H_copyright"));this.ho=c.appendChild($i(d,"A","color:inherit; margin:0px 8px; text-decoration:none; pointer-events:all;","Terms of use"));this.ho.target="_blank";this.ho.tabIndex=1;this.Ul=c.appendChild($i(d,"SPAN","margin:0px 8px"));this.dg=c.appendChild($i(d,"SPAN"));this.dv=Ta(aj);this.Ur(b);this.Di=z(this.Di,this); 262this.ge=z(this.ge,this);this.v.addEventListener(this.v.j.Os,this.Di);this.v.O.addEventListener("add",this.ge);this.v.O.addEventListener("remove",this.ge);this.v.O.addEventListener("set",this.ge);this.ge()}var bj;u(Zi,ed);t("H.map.Imprint",Zi);var aj={font:'11px "Lucida Grande", Arial, Helvetica, sans-serif',href:"https://legal.here.com/{LN}/terms/serviceterms/{CN}",invert:!1,reportHref:"https://wego.here.com/",locale:"en-US",mark:""}; 263Zi.prototype.Ur=function(a){var b,c=this.Gl.firstElementChild.firstElementChild.children;a||(this.dv=Ta(aj));var d=this.dv;for(b in d)a&&b in a&&(d[b]=a[b]);a=(this.oq=a=d.invert)?cj:dj;c[0].style.fill=a.cx;c[0].style.fillOpacity=""+a.dx;c[1].style.fill=a.qx;c[1].style.fillOpacity=""+a.rx;a=d.locale;ej[a]||(a="en-US",d.locale=a);this.ho.innerHTML=ej[a];a=a.split("-");this.ho.href=d.href.replace("{LN}",a[0]).replace("{CN}",a[1].toLowerCase());d.mark?(this.dg.innerHTML=d.mark,this.dg.style.margin="0px 8px"): 264(this.dg.innerHTML="",this.dg.style.margin="0px");this.G.style.font=d.font};Zi.prototype.setOptions=Zi.prototype.Ur;function $i(a,b,c,d,e){a=a.createElement(b);c&&(a.style.cssText=c);d&&(a.innerHTML=d);e&&(a.className=e);return a}Zi.prototype.B=function(){return this.G};Zi.prototype.Di=function(){this.Ul.innerHTML=this.Gs+" "+this.U()};Zi.prototype.ge=function(){this.Di();setTimeout(this.Di,5E3)}; 265var dj={qx:"#0F1621",rx:.3,cx:"#fff",dx:.6},cj={qx:"#fff",rx:1,cx:"#0F1621",dx:.7},fj="1987–"+Fb(2015,(new Date).getFullYear())+" HERE";Zi.prototype.U=function(){var a=this.v,b=a.Ub(),c=a.xa.Ib().bounds;a=a.O;var d=a.aa.length,e={},f=0,g,h,k,l=[fj];if(c)for(;f<d;f++)if(h=a.get(f).getCopyrights(c.C(),b))for(g=0;g<h.length;g++)e[k=h[g].label]||(l.push(k),e[k]=1);return l.join(", ")};Zi.prototype.getCopyrights=Zi.prototype.U;Zi.prototype.K=function(){return this.G.style};Zi.prototype.Gs=String.fromCharCode(169); 266Zi.prototype.disposeInternal=function(){this.v.removeEventListener(this.v.j.Os,this.Di);this.v.O.removeEventListener("add",this.ge);this.v.O.removeEventListener("remove",this.ge);this.v.O.removeEventListener("set",this.ge);if(this.G.parentNode){var a=this.G;a.parentNode.removeChild(a)}};Zi.prototype.disposeInternal=Zi.prototype.disposeInternal; 267Zi.prototype.capture=function(a,b,c,d){var e=a.getContext("2d"),f=window.getComputedStyle(this.Ul.parentElement),g=2*mb(f.paddingLeft,10),h=(this.Ul.offsetWidth+2*g)*b,k=this.Ul.offsetHeight*b,l=0!==this.dg.innerHTML.length?this.dg.offsetWidth*b:0,n=nb(f.getPropertyValue("font-size")),p=this.G.ownerDocument,q=+a.width,r=+a.height,v=16*b,w=this.Gl.childNodes[0].getBoundingClientRect(),y=w.width*b,F=w.height*b,G=Ye;db(d)&&(G=function(){d("capture_error")});e.fillStyle=f.backgroundColor;e.fillRect(q- 268h-l,r-k,h+l,k);h=this.dg.innerHTML;h=this.Gs+" "+function(O){O=$i(p,"div",null,O);return O.textContent||O.innerText||""}(this.U())+(h?" "+h:"");e.font=n*b+"px "+f.getPropertyValue("font-family");e.fillStyle=f.getPropertyValue("color");e.textBaseline="bottom";e.textAlign="right";e.fillText(h,q-g*b,r);gj(this,e.font,function(O){(new qg("image",O)).then(function(V){e.drawImage(V,v,r-(F+v),y,F);c(a)},G)},G)};Zi.prototype.capture=Zi.prototype.capture; 269function gj(a,b,c,d){hj(z(function(e){e?this.oq?c("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAeCAYAAABe3VzdAAADNklEQVRYR82XW6hVVRSGv7+rmJfSMKSnSkMEfY7EogcJC7tilGRopBAiSaI+SBARQSCIIqgFISih2YW0oAgLCsKXojA0RB+81VugZEFZv/yHuWTt7d7Hfc4+6+h4OWefNfcc3xlj/v+YS1zjoab5bE8DZgGngB8keSg5GwO0PQ54F3i2BnQIWCLpx14hGwG0fT3wOfBwB5DzwOOSDvQC2RTgM8Ae4D/gaeA3YDdwN5AWvyxp+6gD2r4OmAq8AbwInAMmA/OAT4CbgBWStvYClzUjWkHbrwHLgF8LVHJ8DDxah7P9JHCil7M40oA/A7OBC8ANtSqlrQOVs30/8CWQat8r6cxg1RwRQNvPA88Bk4D7gJzBV4A5teSp5MlS4VuA/ZIeu1Kr+wa0/QTwIRDlRhT5eTswBvi2CKOd42AULilndNAYCcA7gK+BmbVMiyXtsh3Qt4FFBTgW8w6wXtLfV4LrSyS2FwAvAWOBX+JtwF0laUDmS/oun23fDNwJnJb0Ty9g1ZphVdB2qrK2LdFfBbb685/AIxXkUKDqa4cMaDs2kjalRe8Fola57J3qRQSJviGHA3gMuAdYI2lDUfDOArQLWAd8VTuTOW9vjUoFy6TIGYpS9wKfAjuK5wVuSfn91iKcvZJeHy5ci0hsZwzNk5Qh3xIFbLyks7aPAtPLgv+L4VZwDwLvA6uKz6XdfcVAi22PBz4q4+lVSRurXW2vKYKIZfwEHCmmXC35HngAyITYD0ys2t8XWflyBfhmvKm24QCk7aVFCPVc7WMszzKucknI+NoHPCUppt13VICZm2nNwjoksByY0SXL72Vi3FieZ97mgrpyqF432H9xScW2O0H+W6oSE/4D2FYuA9kzlUzVTwO3Ad9IOtx3ydo2aLGZLpABm5KW2Z4AfAbMLfsEcpGkKLqRuMwHu0CukrSpCCrvGlF6hBEVL5MUw24kOhp1B8gc+FTqgxpkFLuzSbjk6jpJOkC2tDPeKCkVbDRkO67fDTTC2VK7vgfyBUlfNEpV2zyAK4HNXRLmZfshScdHC6g9T+WDGU2XpkdZdNXhWs6g7dXAhm
269sJ7jKR2M77bG4kV7Wt9TZfBLgYEC7PSpcIAAAAAElFTkSuQmCC"):c("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAeCAYAAABe3VzdAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAOxAAADsQBlSsOGwAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAIMSURBVFiFzdZPiE1RGADwXzPTTPIMQoodVpbKgpoUG5qExUi8DSVJQv4slJJsbNjYWFhNETWLUUosRDRLUVLCYhIiojFojHkW997uvefNGIuZc99Xp/fOO6/Or++c75xDi0d7hDlWYQNqeB9hvv+OGq6jUWjPsKZKVBbtuKOMy9p3bKqOlsROCWYc27AWr9PfJnCgKlgbluNqivmGDmzBrxR3sCocnMEw7sqXdEAzboeK9uLTFPVbed8VcesxglFJtqNEHbcxlIL68ChADuCSpEgauBULt11SDI3C5yJJdrLCCNsQumMBl+J5AKinY4slBfNTfsRcxJwYsK0YxD3J0r1RPut6Cv/twgp0xoDBBc3LNhr0RwJktNifAn7gsnLmsuxVinyVTn4i7dcLoH4sU96Tp2Pi2uSVehN75Gdev+QO7pIXztmZnLwTvf+AzU+/v5Rn50+A24gP2IW5M4mbJ7+ejgVjJ/EpHXuCa8p77nGK68FX5eWfsTgfTJoh92qu1vAaa+CtPJuDZuEh3CHZUyHyxSSYrL3DWKE/gStm8aybDDkmKYperJM/BrJMnsJuHMLq2YJNh/wsX7JuPAyQfTFg0yGPFMZreCCv4n2xgTQjxyXP+CxquK8iXBYhMlzOtliQBVg4RVuCG/iSto/YHAuWxWFTHyXDWBkbNFkc1cK4LI5rYVwW57QY7i/pZeJv8QQJRQAAAABJRU5ErkJggg=="): 270(e=this.Gl.cloneNode(!0),e.firstChild.setAttribute("style","font:"+b),c(Se(e.innerHTML)))},a),d)}Zi.prototype.oq=!1; 271function hj(a,b){var c="data:image/svg+xml;charset=utf-8,"+encodeURIComponent('<svg height="40" viewBox="0 0 47 40" width="47" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><path d="m45.2054149 8.82876345.6003191.40637037-.2240425.6914074-.4490426 1.38570368c-.1024468.3148889-.6998936 1.9596297-2.43 3.5918519l-.017234.0163704c-.188617.1887407-.3801064.3659259-.5467021.5084444l-.4605319.4285185-.486383.4516296-.1407447-.0702963c-.7257447.4583704-1.4926596.7886667-2.2796809.9831852l.5840426.5864445-.6769149.6817778-2.052766 2.0636296-.169468.1704444-.019149.0192593-2.3821276 2.3958518c-.4902128.8493334-1.1202128 1.6331852-1.8497873 2.3111112-.6031915.6047407-1.2504255 1.1054814-1.935 1.4954814l-.4777659.4805186-4.3247873 4.3506666-.0296808.0298519-.0315958.0269629-2.1532978 1.8171111-.2661702.2253334h-.3485107-3.8948936l-3.968617 3.9914815-1.3547873 1.3616296-.6769148.6808148-.6769149-.6808148-1.3538298-1.3616296-4.80925535-4.837926-3.2687234-3.2875555-1.63436171-1.6437778h2.3112766 4.62255319 2.67223407l-4.71063832-4.7368148-.6769149-.6808148.6769149-.6808148 4.93851062-4.9650371.6769149-.6798518.6769149.6808148 2.7296809 2.7454074c.9363829-.8820741 2.1485106-1.4685185 3.4037234-1.6562963.278617-1.4694815 1.0187234-2.834963 2.168617-3.9885926.5696808-.572 1.1843617-1.0438519 1.8335106-1.4107407l.2901064-.2917778 4.3094681-4.31985187c.5830851-1.0582963 1.4256383-1.78918519 2.0364893-2.12718519l.4471277-.24748148c.3829787-.7617037.9047872-1.47622222 1.5539362-2.12622222 1.510851-1.51666667 3.3165957-2.31881482 5.22-2.31881482.0871276 0 .1752127.00192593.2594681.00577778 1.9484042.06933334 3.8441489.97933334 5.4775532 2.62792593.1512765.15022222.3303191.34859259.5361702.5797037l.0526595.05874074c.1120213.12518519.2345745.26192593.370532.40733334l1.2657446 1.36066666.6328724.67985185-.6548936.65866667-.2508511.25325926zm-27.9288192 22.17414815h-9.57446804l4.78723404 4.8148148zm23.1864894-21.70422223c-.9220213 1.38666663-2.5180851 3.63037033-4.1984042 1.94133333l4.2510638-4.27651851c-.3810638-.41022222-.6711702-.754-.8923404-.97740741-2.2921277-2.31207407-4.8743617-2.34192593-6.8984043-.312-1.3528723 1.35681481-1.7071277 2.91007407-1.313617 4.38533332l-1.332766-1.52629628c-.385851.21474074-2.0182979 1.65918518-.7937234 3.84703708l-1.5252127-1.274963-2.0240426 2.0299259 2.7344681 2.7502222c-2.1121277-1.6861481-4.3889362-1.5205185-6.2157447.312-1.9560638 1.9615556-1.8181915 4.3381482-.3532979 6.293926l-.295851-.2946667c-1.9321277-1.9432593-4.0318085-1.2576296-5.0706383-.2128148-.8023405.8079259-1.2944681 1.9191852-1.0924468 2.6905185l-4.195532-4.2187407-2.22893613 2.2408148 8.25893613 8.3065185h4.4339362l-2.9767021-2.9938519c-.5893908-.6029568-.9604155-1.0987731-1.1531529-1.5232627-.3182349-.7008886-.1504161-1.2073234.3230465-1.680515.7334043-.7318519 1.583617-.2763704 3.0829787 1.2277777l2.9412766 2.9562963 2.2164894-2.2292592-2.7909575-2.8060741c2.0125532 1.5291852 4.4224468 1.612 6.5728724-.545037 1.3567021-1.2653334 1.7425532-2.4565185 1.7425532-2.4565185l-1.6755319-1.1314815c-.9229788 1.3866666-2.5152128 3.6361481-4.195532 1.9461481l4.2606383-4.2851852 2.655 2.6712593 2.3160639-2.3294074-3.3223405-3.3424445c-1.5520212-1.5609629-.6328723-3.0275555.0124469-3.5793333.3025531.6442222.7448936 1.2624445 1.3078723 1.8296296 2.1485106 2.1676297 4.9260638 2.6038519 7.3685106.1550371 1.3567022-1.2643704 1.7425532-2.4565185 1.7425532-2.4565185zm-3.6564894-1.35537321-2.0211702 2.03377777c-.9890425-1.18251851-.9392553-1.81422222-.3245744-2.43051851.7439361-.7462963 1.4993617-.43044445 2.3457446.39674074zm-12.4879787 12.56088884c-.9890425-1.1825185-.9411702-1.819037-.3284042-2.4353333.7448936-.7462963 1.5003191-.4304444 2.3467021.3967408z" fill="#0f1621" fill-opacity=".7"/><path d="m17.2765957 31.0029116-4.787234 4.8148148-4.78723404-4.8148148zm23.1864894-21.70422223 1.6755319 1.13148153s-.385851 1.1921481-1.7425532 2.4565185c-2.4424468 2.4488148-5.22 2.0125926-7.3685106-.1550371-.5629787-.5671851-1.0053192-1.1854074-1.3078723-1.8296296-.6453192.5517778-1.5644681 2.0183704-.0124469 3.5793333l3.3223405 3.3424445-2.3160639 2.3294074-2.655-2.6712593-4.2606383 4.2851852c1.6803192 1.69 3.2725532-.5594815 4.195532-1.9461481l1.6755319 1.1314815s-.3858511 1.1911851-1.7425532 2.4565185c-2.1504256 2.157037-4.5603192 2.0742222-6.5728724.545037l2.7909575 2.8060741-2.2164894 2.2292592-2.9412766-2.9562963c-1.4993617-1.5041481-2.3495744-1.9596296-3.0829787-1.2277777-.4734626.4731916-.6412814.9796264-.3230465 1.680515.1927374.4244896.5637621.9203059 1.1531529 1.5232627l2.9767021 2.9938519h-4.4339362l-8.25893613-8.3065185 2.22893613-2.2408148 4.195532 4.2187407c-.2020213-.7713333.2901063-1.8825926 1.0924468-2.6905185 1.0388298-1.0448148 3.1385106-1.7304445 5.0706383.2128148l.295851.2946667c-1.4648936-1.9557778-1.6027659-4.3323704.3532979-6.293926 1.8268085-1.8325185 4.103617-1.9981481 6.2157447-.312l-2.7344681-2.7502222 2.0240426-2.0299259 1.5252127 1.274963c-1.2245745-2.1878519.4078724-3.63229634.7937234-3.84703708l1.332766 1.52629628c-.3935107-1.47525925-.0392553-3.02851851 1.313617-4.38533332 2.0240426-2.02992593 4.6062766-2.00007407 6.8984043.312.2211702.22340741.5112766.56718519.8923404.97740741l-4.2510638 4.27651851c1.6803191 1.689037 3.2763829-.5546667 4.1984042-1.94133333zm-16.1444681 11.20551563 2.0182979-2.0385925c-.846383-.8271852-1.6018085-1.1430371-2.3467021-.3967408-.612766.6162963-.6606383 1.2528148.3284042 2.4353333zm12.4879787-12.56088884c-.8463829-.82718519-1.6018085-1.14303704-2.3457446-.39674074-.6146809.61629629-.6644681 1.248.3245744 2.43051851z" fill="#fff" fill-opacity=".3"/></g></svg>'),d= 272bj;fb(d)?a(d):(new qg("image",c)).then(function(e){Oe.drawImage(e,0,0);try{Oe.getImageData(0,0,1,1),d=!1}catch(f){d=18===f.code}finally{bj=d,a(d)}},b)}Zi.prototype.jy=function(a,b){ej[a]=b};Zi.prototype.addL11NString=Zi.prototype.jy; 273var ej={"de-DE":"Nutzungsbedingungen","en-US":"Terms of use","en-GB":"Terms of use","es-ES":"Condiciones de uso","fi-FI":"Palveluehdot","fr-FR":"Conditions d'utilisation","it-IT":"Condizioni di utilizzo","nl-NL":"Dienstvoorwaarden","pl-PL":"Warunki \u015bwiadczenia us\u0142ugi","pt-BR":"Termos de servi\u00e7o","pt-PT":"Termos do servi\u00e7o","ru-RU":"\u0423\u0441\u043b\u043e\u0432\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f","tr-TR":"Servis Ko\u015fullar\u0131", 274"zh-CN":"\u4f7f\u7528\u6761\u6b3e"};function ij(a){return a}t("H.util.animation.ease.LINEAR",ij);t("H.util.animation.ease.EASE_IN_QUAD",function(a){return a*a});function jj(a){return-a*(a-2)}t("H.util.animation.ease.EASE_OUT_QUAD",jj);
274t("H.util.animation.ease.EASE_IN_OUT_QUINT",function(a){a*=2;return 1>a?Mb(a,5)/2:(a-=2,Mb(a,5)/2+1)});function kj(a){return 1-Math.sqrt(1-a*a)}function lj(a){return Lb(2*a-a*a)}t("H.util.animation.ease.EASE_OUT_CIRC",lj);function mj(a){return 1-Math.cos(a*Math.PI/2)} 275function nj(a){return Math.sin(a*Math.PI/2)};function oj(a,b){this.cg={tilt:pj(a.tilt,b.tilt),heading:pj(a.heading,b.heading),zoom:b.zoom-a.zoom};var c=this.bp=vc(a.position),d=b.position;a=d.lat*$b;var e=c.lat*$b;c=d.lng*$b-c.lng*$b;a=Math.atan2(Ob(c)*Qb(a),Qb(e)*Ob(a)-Ob(e)*Qb(a)*Qb(c));this.sy=(0<=a?a:Yb+a)*ac;this.kh=this.bp.kb(b.position);b=this.cg.zoom;this.Fv=0===b?qj:Object.assign({},qj,{zoom:0>b?lj:kj,position:0>b?mj:nj});this.hv=Object.assign({},{tilt:0,heading:0,zoom:0})} 276function pj(a,b){a=b-a;return-180<a&&180>=a?a:180<a?a-360:a+360}var qj={tilt:ij,heading:ij,zoom:ij,position:ij};function rj(a){this.yb=a}u(rj,ed);rj.prototype.Tb=function(){return this.yb};rj.prototype.getLayer=rj.prototype.Tb;rj.prototype.GA=function(){return this.Pb};rj.prototype.getSurface=rj.prototype.GA;rj.prototype.tf=function(a){var b=this.Pb;a!==b&&(this.Pb=a,a.Sn(),b&&b.release())};rj.prototype.setSurface=rj.prototype.tf;rj.prototype.disposeInternal=function(){this.Pb.release()};rj.prototype.disposeInternal=rj.prototype.disposeInternal;rj.prototype.Eh=function(){};rj.prototype.render=rj.prototype.L;function sj(a,b){sj.g.constructor.call(this,a);this.Qd=!(!b||!b.Qd);this.Hq={}}u(sj,rj);sj.prototype.tf=function(a){sj.g.tf.call(this,a);this.qC=a.nd.ownerDocument};sj.prototype.setSurface=sj.prototype.tf;var tj=function(a,b){b=b.V();return B(b,Jf)?b.ha:(a[0]=b,a)}.bind(null,[]); 277sj.prototype.L=function(a,b,c,d,e,f,g){var h=this.yb,k,l,n,p;this.wC=b=this.Hq;this.Hq=c={};if(d>=h.min&&d<=h.max){var q=this.Xt(a,d,e,f);var r=q.markers;if(a=r.length){d=[];e=this.Pb;for(f=0;f<a;f++){h=r[f];var v=tj(h);for(k=v.length;k--;)if(l=g(v[k]))(p=b[n=h.xb()+"_"+k])?delete b[n]:p={vv:h},c[n]=p,d.push([p,h,h.kc(),e,l.x,l.y])}d.sort(uj);a=d.length;for(f=0;f<a;f++)this.Fw.apply(this,d[f])}}return!q||q.requested&&q.requested===q.total||!q.requested&&r.length===q.total?fh.DONE:fh.PENDING}; 278sj.prototype.render=sj.prototype.L;function uj(a,b){var c=a[1].We(),d=b[1].We();return Ah(c,d,!0)||a[5]-b[5]||Ah(c,d,!1)}sj.prototype.Ma=function(){};sj.prototype.getObjectsAt=sj.prototype.Ma;function vj(a,b){vj.g.constructor.apply(this,arguments);this.Gq=0;this.Sh=[];this.sp=z(this.sp,this)}u(vj,sj);t("H.map.render.dom.MarkerRenderer",vj);vj.prototype.Xt=function(){return this.yb.pe.apply(this.yb,arguments)};vj.prototype.L=function(a,b,c,d,e,f,g){this.sp();this.OB=0;var h=vj.g.L.apply(this,arguments);var k=this.Pb,l=this.wC,n;for(n in l)wj(this,k,l[n]);return 0===this.Sh.length&&h?fh.DONE:fh.PENDING};vj.prototype.render=vj.prototype.L; 279vj.prototype.tf=function(a){vj.g.tf.call(this,a);this.oa=a.lb()};vj.prototype.setSurface=vj.prototype.tf;vj.prototype.sp=function(){for(var a=this.Sh.length,b,c,d;a--;)d=this.Sh[a],b=d.uo,c=b.kc(),c.Oq(d,c,b);this.Sh.length=0}; 280vj.prototype.Fw=function(a,b,c,d,e,f){var g;var h=d.lb();var k=b.Nc();e*=h;f*=h;this.Qd||(e=Gb(e),f=Gb(f));a.detail&&(k.Kh(a.cB)?wj(this,d,a):g=a.detail);g||(a.detail=g=c.eu(this.qC),this.Gq++,db(c.Oq)&&this.Sh.push(g));a.cB=k.Md;g.style.zIndex=this.OB++;g.uo=b;d.Re(g,e,f,0,0)};var xj,yj="pointer-events",zj;if(Qe){var Aj;Qe&&Ka!==x&&(Ka=(Aj=/(MSIE\s+|rv:)([^\);]+)(\)|;)/.exec(navigator.userAgent))?+Aj[2]:x);zj=Ka;9===zj?yj="display":10===zj&&(yj="visibility")}xj=yj; 281vj.prototype.Ma=function(a,b,c){var d=this.oa,e=Ze,f,g,h,k,l;if(this.Gq){a/=d;b/=d;d=this.Pb.nd.getRootNode();var n=d.documentElement;var p=this.Pb.B();var q=p.getBoundingClientRect();a+=q.left;for(b+=q.top;(g=h=d.elementFromPoint(a,b))&&g!==p&&g!==n&&g!==d.host&&h!==r;){for(;(k=g.parentNode)&&(!db(k.contains)||!k.contains(p));)g=k;if(k===p&&(g!==h||"svg"!==g.nodeName)&&0>e.indexOf(l=g.uo)&&(e===Ze&&(e=[]),e.push(l),c))break;f||(f=[]);var r=g.style;f.push({xt:r.getPropertyValue(xj),YA:r.getPropertyPriority(xj), 282style:r});r.setProperty(xj,"visibility"===xj?"hidden":"none","important");r=h}if(f)for(b=f.length;b--;)a=f[b],a.style.removeProperty(xj),lb(a.xt)&&a.style.setProperty(xj,a.xt,a.YA)}return e};vj.prototype.getObjectsAt=vj.prototype.Ma;vj.prototype.Eh=function(){return"dom"};function wj(a,b,c){b.clear(b=c.detail);delete b.uo;a.Gq--;c=(a=c.vv).kc();c.Sq&&c.Sq(b,c,a)}vj.prototype.disposeInternal=function(){this.Sh.length=0;var a=this.Pb,b=this.Hq,c;for(c in b)wj(this,a,b[c]);this.Pb.l();vj.g.disposeInternal.call(this)}; 283vj.prototype.disposeInternal=vj.prototype.disposeInternal;function Bj(){Bj.g.constructor.call(this);this.Pn={};this.ji={position:new tc(0,0),zoom:0,heading:180,incline:0,tilt:0,bounds:new L(lf([90,-180,90,0,90,180,-90,180,-90,-180]))};this.zu=!1}u(Bj,I);t("H.map.ViewModel",Bj);Bj.prototype.j={Aa:"update",Oi:"sync"}; 284Bj.prototype.ad=function(a,b,c){if(!a)throw new C(this.ad,0,a);var d=a[Cj];if(fb(d)&&!uc(d))throw new C(this.ad,0,Cj);var e=a[Dj];if((d=fb(e))&&D(+e))throw new C(this.ad,0,Dj);var f=a[Ej];if((e=fb(f))&&!B(f,sc))throw new C(this.ad,0,Ej);a=Object.assign({},a);f=Fj(a,this.Pn,this.ji);Gj(this,this.Pn,a);this.zu||Gj(this,this.ji,a);this.dispatchEvent(new Hj(this.Pn,f,!!c&&!d&&e,b));return this};Bj.prototype.setLookAtData=Bj.prototype.ad; 285Bj.prototype.Ib=function(){var a={};a[Cj]=vc(this.ji[Cj]);Gj(this,a,this.ji,!0);return a};Bj.prototype.getLookAtData=Bj.prototype.Ib;var Cj="position",Dj="zoom",Ej="bounds",Ij={Ss:Cj,Ws:Dj,Ks:"heading",Vs:"tilt",Ls:"incline",Es:Ej},Jj=Object.keys(Ij).map(function(a){return Ij[a]}); 286function Gj(a,b,c,d){a.Hv={};a.Gv={};a.qv=[];for(var e=a.eC,f=a.dC,g=Jj.length,h,k,l;g--;)if(h=Jj[g],l=c[h],k=b[h],null==k||!d)if(null!=l){if(fb(e)&&e.call(a,h,k,l),b[h]="position"!==h||l&&!D(l.lat)&&!D(l.lng)?l:vc(l),fb(f)){switch(h){case "position":k=l&&k&&(l.lat!==k.lat||l.lng!==k.lng);break;case "bounds":k=l&&k&&!l.da(k);break;default:k=l!==k}k&&f.call(a,h)}}else delete b[h]}Bj.prototype.eC=function(a,b,c){this.Hv[a]=b;this.Gv[a]=c};Bj.prototype.dC=function(a){this.qv.push(Kj[a])}; 287var Kj=Jj.reduce(function(a,b){a[b]=Oi[b.toUpperCase()];return a},{});function Fj(a,b,c){var d=0;
287["tilt","incline","heading",Dj].forEach(function(e){D(a[e])?a[e]=D(b[e])?c[e]:b[e]:d|=Kj[e]});[Cj,Ej].forEach(function(e){a[e]?d|=Kj[e]:a[e]=b[e]||c[e]});return d}Bj.prototype.rb=function(a){var b={},c={};this.zu=!0;Gj(this,this.ji,a);this.Pn={};b.lookAt=this.Gv;c.lookAt=this.Hv;a=this.qv;a=a.length?a.reduce(Lj):0;this.dispatchEvent(new Ni(this.j.Oi,b,c,a))};Bj.prototype.synchronize=Bj.prototype.rb; 288function Lj(a,b){return a|b}Bj.prototype.Vk=function(a,b){if(D(a=+a))throw new C(this.Vk,0,Dj);this.ad({zoom:a},b)};Bj.prototype.Ub=function(){return this.ji.zoom};Bj.prototype.Id=Ab;Bj.prototype.startControl=Bj.prototype.Id;Bj.prototype.control=Ab;Bj.prototype.control=Bj.prototype.control;Bj.prototype.hc=Ab;Bj.prototype.endControl=Bj.prototype.hc; 289function Hj(a,b,c,d){Hj.g.constructor.call(this,Bj.prototype.j.Aa,a,null,b);this.Pu=this.integerZoom=!!c;this.animate=this.animate=ob(d)&&0<d&&Infinity>d?d:!!d}u(Hj,Ni);function Mj(){this.aa=[];Mj.g.constructor.call(this)}u(Mj,I);t("H.util.OList",Mj);function Nj(a,b,c){a=a.aa.length;if(c)var d=a;else if(D(d=0>(d=+b)?Fb(0,a+d):Eb(a,d)))throw new Cb(Mj,b,[0,a-1]);return d}Mj.prototype.Bo=function(a,b){this.aa.splice(b,0,a);this.dispatchEvent(new Oj(this,this.j.Ki,b,a,null,null))};Mj.prototype.add=function(a,b){this.Bo(a,Nj(this,b,D(b)))};Mj.prototype.add=Mj.prototype.add; 290Mj.prototype.pf=function(a){var b=this.aa.splice(a,1)[0];this.dispatchEvent(new Oj(this,this.j.Mi,a,null,b,null));return b};Mj.prototype.Ed=function(a){this.get(a);return this.pf(a)};Mj.prototype.removeAt=Mj.prototype.Ed;Mj.prototype.remove=function(a){a=this.indexOf(a);return 0<=a?(this.pf(a),!0):!1};Mj.prototype.remove=Mj.prototype.remove; 291Mj.prototype.set=function(a,b){if(0!==this.aa.length||0!==a){this.get(a);a=Nj(this,a,!1);var c=this.aa[a]}this.aa[a]=b;this.dispatchEvent(new Oj(this,this.j.Ni,a,b,c,null));return c};Mj.prototype.set=Mj.prototype.set;Mj.prototype.indexOf=function(a){return this.aa.indexOf(a)};Mj.prototype.indexOf=Mj.prototype.indexOf;Mj.prototype.get=function(a){var b=Nj(this,a,!1),c=this.aa;if(b>=c.length)throw new Cb(this.get,a,[0,c.length-1]);return c[b]};Mj.prototype.get=Mj.prototype.get;Mj.prototype.fA=function(){return this.aa.length}; 292Mj.prototype.getLength=Mj.prototype.fA;Mj.prototype.Ta=function(){return[].concat(this.aa)};Mj.prototype.asArray=Mj.prototype.Ta;Mj.prototype.flush=function(){for(var a=this.aa.length;a--;)this.pf(a)};Mj.prototype.flush=Mj.prototype.flush;Mj.prototype.disposeInternal=function(){this.flush();Mj.g.disposeInternal.call(this)};Mj.prototype.j={Ki:"add",Mi:"remove",Ni:"set",SD:"move"};function Oj(a,b,c,d,e,f){Oj.g.constructor.call(this,b,a);this.idx=c;this.added=d;this.removed=e;this.moved=f}u(Oj,pd); 293Mj.Event=Oj;function Pj(a){var b;Pj.g.constructor.call(this);this.dispatchEvent=z(this.dispatchEvent,this);if(a){var c=a.length;for(b=0;b<c;b++)this.add(a[b])}}u(Pj,Mj);t("H.map.DataModel",Pj);function Qj(a,b){var c=b.getProvider&&b.getProvider();c&&(Rj[c.uid]=c);b.ea(a)}function Sj(a){var b=a.getProvider&&a.getProvider();b&&delete Rj[b.uid];a.ea(null)}Pj.prototype.add=function(a,b){B(a,vi,this.add,0);Qj(this,a);Pj.g.add.call(this,a,b)};Pj.prototype.add=Pj.prototype.add; 294Pj.prototype.set=function(a,b){B(b,vi,this.set,0);Qj(this,b);(a=Pj.g.set.call(this,a,b))&&Sj(a);return a};Pj.prototype.set=Pj.prototype.set;Pj.prototype.Ed=function(a){var b;(b=Pj.g.Ed.call(this,a))&&Sj(b);return b};Pj.prototype.removeAt=Pj.prototype.Ed;Pj.prototype.remove=function(a){var b;(b=Pj.g.remove.call(this,a))&&Sj(a);return b};Pj.prototype.remove=Pj.prototype.remove;Pj.prototype.flush=function(){for(var a=this.aa.length;a--;)this.Ed(a);Pj.g.flush.call(this)};Pj.prototype.flush=Pj.prototype.flush; 295var Rj={};rb(Rj);function Tj(a,b,c){if(a=Rj[a])return B(a[b],Function,Tj,1,"invalid method"),a[b].apply(a,c)}Pj.invoke=Tj;t("H.util.events.listenOnce",Ed);t("H.util.events.dispatchEvent",function(a,b){return a.dispatchEvent(b)});t("H.util.events.fireListeners",function(a,b,c,d){if(td(a))c=a.Lf(b,c,d);else{var e=!0;if(a=Hd(a))if(b=a.pb[b.toString()])for(b=b.concat(),a=0;a<b.length;a++){var f=b[a];f&&f.capture==c&&!f.ii&&(f=Nd(f,d),e=e&&!1!==f)}c=e}return c});t("H.util.events.listen",Dd);t("H.util.events.unlisten",Ld);var Uj=Nd; 296Nd=function(a,b){var c,d,e=!0;var f=b[b.currentTarget===b.target?"AT_TARGET":a.capture?"CAPTURING_PHASE":(c=!0,"BUBBLING_PHASE")];if(!c||"pointerenter"!==(d=b.type)&&"pointerleave"!==d)b.eventPhase=f,e=Uj(a,b),c&&a.src&&a.src.Jb&&null===a.src.Jb()&&delete b.eventPhase;return e};function Vj(a,b,c,d){var e=new lh(0,0,0,0);Vj.g.constructor.call(this);if(!a)throw new C(Vj,0,a);if(!b)throw new C(Vj,1,b);if(!c)throw new C(Vj,2,c);if("object"!==typeof d)throw new C(Vj,3,d+" is not an object");
296if("number"!==typeof d.pixelRatio)throw new C(Vj,3,d.pixelRatio+" is not a number");this.ja=d.pixelRatio;this.zoom=0;this.Ab=Kb(this.ja)/Ub;this.pixelProjection=new si;this.rl={1:e.clone(),2:e.clone(),4:e.clone()};this.yd=new K(.5,.5);this.za=a;Wj(this,this.ja);this.Jd=z(this.Jd,this);this.wd= 297z(this.wd,this);this.ic=z(this.ic,this);a.startInteraction=this.Jd;a.interaction=this.wd;a.endInteraction=this.ic;a.addEventListener(a.j.Aa,this.ng,!1,this);this.getCapabilities=this.getCapabilities;this.capture=this.capture;this.zoomAt=this.Ng;this.relaunch=this.ba;this.dispose=this.l;this.screenToGeo=this.Wa;this.geoToScreen=this.La;this.screenToLookAtData=this.Un;this.Ee=b;this.Id=z(this.Id,this);this.control=z(this.control,this);this.hc=z(this.hc,this);b.startControl=this.Id;b.control=this.control; 298b.endControl=this.hc;b.addEventListener(b.j.Aa,this.ar,!1,this);this.ib=c;this.gn=z(this.gn,this);this.jg=z(this.jg,this);this.kg=z(this.kg,this);this.fn=z(this.fn,this);c.addEventListener(vi.prototype.j.Aa,this.gn,!1,this);c.addEventListener(c.j.Ki,this.jg,!1,this);c.addEventListener(c.j.Mi,this.kg,!1,this);c.addEventListener(c.j.Ni,this.fn,!1,this)}u(Vj,I);t("H.map.render.RenderEngine",Vj);Vj.prototype.Ng=function(){}; 299function Wj(a,b){var c=a.za,d=c.width,e=c.height,f=c.padding,g=f.top,h=f.left,k=f.bottom;f=f.right;c=c.margin;var l=-(d+h-f)/2<<0,n=-(e+g-k)/2<<0;d+=l;e+=n;a=a.rl;a[1].set((l-c)*b,(n-c)*b,(d+c)*b,(e+c)*b);a[2].set(l*b,n*b,d*b,e*b);a[4].set((l+h)*b,(n+g)*b,(d-f)*b,(e-k)*b)}Vj.prototype.ng=function(){Wj(this,this.ja)}; 300Vj.prototype.disposeInternal=function(){var a=this.za,b=this.Ee,c=this.ib;a.removeEventListener(a.j.Aa,this.ng,!1,this);a.startInteraction===this.Jd&&(a.startInteraction=Vi.prototype.Jd);a.interaction===this.wd&&(a.interaction=Vi.prototype.wd);a.endInteraction===this.ic&&(a.endInteraction=Vi.prototype.ic);b.removeEventListener(b.j.Aa,this.ar,!1,this);b.startControl===this.Id&&(b.startControl=Bj.prototype.Id);b.control===this.control&&(b.control=Bj.prototype.control);b.endControl===this.hc&&(b.endControl= 301Bj.prototype.hc);c.removeEventListener(vi.prototype.j.Aa,this.gn,!1,this);c.removeEventListener(c.j.Ki,this.jg,!1,this);c.removeEventListener(c.j.Mi,this.kg,!1,this);c.removeEventListener(c.j.Ni,this.fn,!1,this)};Vj.prototype.Mr=function(a){this.Fo=a};Vj.prototype.setAnimationCallback=Vj.prototype.Mr;Vj.prototype.Dr=function(){this.Fo=void 0};Vj.prototype.resetAnimationCallback=Vj.prototype.Dr;Vj.prototype.control=function(){};Vj.prototype.capture=function(){return ne(Error("not implemented"))}; 302function Xj(a,b){a.style.transition="opacity 1.5s";Ed(a,"transitionend",b,!1);a.style.opacity=0}var Yj={ZOOM:1,HEADING:2,TILT:4,INCLINE:8,COORD:16};Vj.InteractionModifiers=Yj;m=Vj.prototype;m.j={Us:"render"};m.gn=function(a){this.Pv(a);this.ba()};m.jg=function(a){this.pk(a.idx,a.added)};m.kg=function(a){this.Uq(a.idx,a.removed,a.type===this.ib.j.Ni)};m.fn=function(a){a.removed&&this.kg(a);this.jg(a)};m.Pv=Ye;m.pk=function(a,b){this.hq(a,b);0===a&&this.Ac();B(b,vi)&&Zj(this,b,!0);this.li();this.ba()}; 303m.Ac=function(){var a=this.ib.Ta();if(0<a.length){var b=a[0].max;this.zq=a[0].min;this.yq=b}else a=this.getCapabilities().lookAt.zoom,b=a.max,this.zq=a.min,this.yq=b;a=ak(this,this.zoom);a!==this.zoom&&(this.zoom=a,this.pixelProjection.Va(a),this.rb())};m.rb=function(a){this.vf=this.Ib();a&&(this.vf.position=a);this.vf.zoom=this.zoom-this.Ab;this.vf.position.alt=0};m.vx=0;m.heading=180; 304m.Ib=function(){return bk(this,{position:this.pixelProjection.projection.wn(this.yd),zoom:this.zoom,tilt:this.vx,heading:this.heading})};function bk(a,b){b.tilt=ck(a,b.tilt);b.heading=dk(a,b.heading);b.incline=a.getCapabilities().lookAt.incline.min;return b}function ak(a,b){var c=a.getCapabilities().lookAt.zoom;return gc(b,Fb(c.min,a.zq),Eb(c.max,a.yq))}function ck(a,b){a=a.getCapabilities().lookAt.tilt;return gc(b,a.min,a.max)} 305function dk(a,b){a=a.getCapabilities().lookAt.heading;return gc((b%360+360)%360,a.min,a.max)}function Zj(a,b,c){c=c?b.addEventListener:b.removeEventListener;c.call(b,b.j.Qs,a.Vq,!1,a);c.call(b,b.j.Ps,a.Vq,!1,a)}m.hq=Ye;m.Uq=Ye;m.aD=function(a,b){this.ff={before:a,after:b}};Vj.prototype.setOnRenderCallbacks=Vj.prototype.aD;var ek={P2D:0,WEBGL:1,HARP:2};Vj.EngineType=ek;var fk={lookAt:{zoom:{min:-8,max:24},tilt:{min:0,max:85},incline:{min:0,max:0},heading:{min:0,max:360}},interaction:{ZOOM:Yj.ZOOM,COORD:Yj.COORD},capture:!0};t("H.map.render.webgl.capabilities",fk);function gk(a,b){if(D(this.xo=+a))throw new C(gk,0,a);this.eo=this.rj=0;b&&this.Vw(b)}t("H.util.kinetics.KineticMove",gk);gk.prototype.Vw=function(a){this.eo=a;this.rj=this.gu();return this};gk.prototype.setInitialSpeed=gk.prototype.Vw;gk.prototype.gu=function(){return Math.abs(this.eo/this.xo)};gk.prototype.getDuration=gk.prototype.gu;gk.prototype.Hj=function(a){return this.eo+this.xo*a};gk.prototype.getCurrentSpeed=gk.prototype.Hj;gk.prototype.Fz=function(a){return this.eo*a+this.xo*a*a/2}; 306gk.prototype.getCurrentPath=gk.prototype.Fz;function hk(a,b,c,d,e,f){var g=e||"2d";hk.g.constructor.apply(this,arguments);this.Zl=this.element.getContext(g,f);this.Cu="2d"===g;this.ij=g;this.hj=f}u(hk,yi);m=hk.prototype;m.createElement=function(a){a=a.createElement("canvas");var b=a.style;b.position="absolute";b.top=b.left="0";return a};m.Zw=function(a,b,c,d,e){a.width=Fb(c,1);a.height=Fb(d,1);b.width=Gb(c/e)+"px";b.height=Gb(d/e)+"px"};m.Fg=function(a){this.Zl.globalAlpha=a};m.Re=function(a,b,c,d,e){this.Cu&&this.Zl.drawImage(a,b,c,d,e)}; 307m.getContextAttributes=function(){return this.hj};m.uh=function(){return this.ij};m.clear=function(a){var b,c;this.Cu&&(a?this.Zl.clearRect(b=a.left,c=a.top,a.right-b,a.bottom-c):this.element.width=this.size.w)};m.disposeInternal=function(){var a=this.element;a.width=a.height=0;delete this.Zl;hk.g.disposeInternal.call(this)};hk.prototype.disposeInternal=hk.prototype.disposeInternal;function ik(a){var b="dom";ik.g.constructor.call(this,a);B(this.yb,zi)&&(b="2d"===a.uh()?"2d":"webgl");this.tD=b}u(ik,rj);ik.prototype.L=function(a,b,c,d,e,f,g,h){g=this.yb;var k=this.Pb,l=!(B(k,hk)&&"2d"===k.uh());if(d>=g.min&&d<=g.max)return l&&k.Zb(!0),g.L(k.B(),{boundingBox:a,zoom:d,screenCenter:b,priorityCenter:f,projection:c,cacheOnly:e,size:k.mc(),pixelRatio:k.lb(),cameraMatrix:h});l&&k.Zb(!1);return fh.DONE};ik.prototype.Eh=function(){return this.tD};function jk(){}t("H.util.ICache",jk);jk.prototype.add=function(){};jk.prototype.add=jk.prototype.add;jk.prototype.get=function(){};jk.prototype.get=jk.prototype.get;jk.prototype.cm=function(){};jk.prototype.drop=jk.prototype.cm;jk.prototype.forEach=function(){};jk.prototype.forEach=jk.prototype.forEach;jk.prototype.ia=function(){};jk.prototype.removeAll=jk.prototype.ia;jk.prototype.fi=function(){};jk.prototype.registerOnDrop=jk.prototype.fi;jk.prototype.gp=function(){}; 308jk.prototype.deRegisterOnDrop=jk.prototype.gp;function kk(a,b,c){this.mk=[];b&&this.fi(b);if(c&&!db(c))throw new C(kk,2,c);this.Oe=0;this.filter=c;this.aa={};this.ak=this.ph=null;this.Sr(a)}
308t("H.util.Cache",kk);kk.prototype.add=function(a,b,c){var d,e;c=+c;if(!ob(c)||0>c)throw new C(this.add,2,c);a=String(a);if(e=this.filter?this.filter(a,b,c):!0)(d=this.aa[a])?(d.data!==b&&lk(this,d),this.Oe+=c-d.size,d.size=c,d.data=b,mk(this,d)):this.aa[a]=nk(this,{id:a,data:b,size:c,Ad:null,mf:null},this.ph),ok(this);return e};kk.prototype.add=kk.prototype.add; 309kk.prototype.fi=function(a){if(!db(a))throw new C(this.fi,0,a);this.mk.push(a)};kk.prototype.registerOnDrop=kk.prototype.fi;kk.prototype.gp=function(a){this.mk=this.mk.filter(function(b){return b!==a})};kk.prototype.deRegisterOnDrop=kk.prototype.gp;kk.prototype.get=function(a,b){return(a=b?this.aa[a]:mk(this,this.aa[a]))&&a.data};kk.prototype.get=kk.prototype.get;kk.prototype.cm=function(a){var b;(b=this.aa[a])&&this.pf(b,!0)};kk.prototype.drop=kk.prototype.cm; 310kk.prototype.forEach=function(a,b,c){var d;for(d in this.aa){var e=this.aa[d];(c?c(d,e.data,e.size):1)&&a.call(b,d,e.data,e.size)}};kk.prototype.forEach=kk.prototype.forEach;kk.prototype.ia=function(a){var b;for(b in this.aa){var c=this.aa[b];(a?a(b,c.data,c.size):1)&&this.pf(this.aa[b],!0)}};kk.prototype.removeAll=kk.prototype.ia;kk.prototype.Sr=function(a){if(!(0<+a))throw new C(kk.prototype.Sr,0,a);this.xv=+a;ok(this);return this};kk.prototype.setMaxSize=kk.prototype.Sr;kk.prototype.jA=function(){return this.xv}; 311kk.prototype.getMaxSize=kk.prototype.jA;kk.prototype.Gz=function(){return this.Oe};kk.prototype.getCurrentSize=kk.prototype.Gz;function mk(a,b){b&&(a.ph=nk(a,b,a.ph));return b}function ok(a){for(;a.Oe>a.xv&&a.ak;)a.pf(a.ak,!0)}function nk(a,b,c){if(c!==b){(b.Ad||b.mf)&&a.pf(b,!1);if(b.Ad=c)b.mf=c.mf,c.mf=b;b.mf||(a.ph=b);b.Ad||(a.ak=b);a.Oe+=b.size}return b} 312kk.prototype.pf=function(a,b){var c=a.mf,d=a.Ad;if(c||d||a==this.ph&&a==this.ak)c?c.Ad=d:this.ph=d,d?d.mf=c:this.ak=c,this.Oe-=a.size,b&&(delete this.aa[a.id],lk(this,a));a.Ad=a.mf=null;return a};function lk(a,b){for(var c=a.mk.length;c--;)a.mk[c].call(a,b.id,b.data,b.size)};var pk,qk=function(){function a(){}for(var b=globalThis,c,d,e,f=$a("o ms moz webkit ").split(void 0!==A?void 0:" "),g=5;g--&&!c;)c=f[g],c=(d=b[c+(c?"R":"r")+"equestAnimationFrame"])&&!D(d.call(window,a))&&(e=b[c+(c?"C":"c")+"ancelAnimationFrame"]);pk=c?function(h){return d.call(b,h)}:function(h){return b.setTimeout(h,25)};return c?function(h){return e.call(b,h)}:function(h){return b.clearTimeout(h)}}(),rk=globalThis.performance&&globalThis.performance.now?function(){return globalThis.performance.now()}: 313function(){return globalThis.Date.now()};function sk(a,b,c,d,e){if(!db(a.Mr)||!db(a.Dr))throw new C(sk,0,a);this.bt=a;if(!db(this.ED=b))throw new C(sk,1,b);if(D(this.rj=+c))throw new C(sk,2,c);if(!db(this.Iv=d)&&null!=d)throw new C(sk,3,d);if(!db(this.Mt=e)&&null!=e)throw new C(sk,4,e);this.id=(new Te).next();this.R=!1}t("H.util.animation.Animation",sk); 314sk.prototype.start=function(){var a=this;this.$k=rk();this.R=!0;var b=this.$k;this.bt.Mr(function(){if(a.R){var c=rk(),d=c-a.$k,e=d/a.rj,f=!1;1<=e&&(e=1,f=!0);a.ED(a.Mt?a.Mt(e):e,d,c-b,c);b=c;f&&a.stop()}else a.stop()})};sk.prototype.start=sk.prototype.start;sk.prototype.stop=function(a){this.R=!1;this.bt.Dr();a||this.Iv&&this.Iv(this)};sk.prototype.stop=sk.prototype.stop;sk.prototype.Lm=function(){return this.R};sk.prototype.isRunning=sk.prototype.Lm;function tk(){I.call(this);this.reset()}u(tk,I);tk.prototype.start=function(a,b){this.R&&this.reset();D(a-b)||(this.Ug=+a,this.Vg=+b);this.R=!0};tk.prototype.reset=function(){this.R=!1;this.Ug=this.Vg=A;this.Ro=new uk(0,0,0,0,0,0)};tk.prototype.Lm=function(){return this.R};tk.prototype.j={wo:"animationupdate"};function vk(a){vk.g.constructor.call(this,tk.prototype.j.wo);this.mt=a}u(vk,pd); 315tk.prototype.set=function(a,b,c,d,e,f){var g=this.Ro;this.R&&(a=new uk(a/1E3,b/1E3,c/1E3,d/1E3,e/1E3,f/1E3),g.da(a)||(this.Ro=a,this.dispatchEvent(new vk(wk(this)))))};function wk(a){return globalThis.Object.create(a.Ro)}tk.prototype.nc=function(){return wk(this).nc()};tk.prototype.Nf=function(){var a=wk(this),b=this.nc()||1;return new uk(a.Lb/b,a.Mb/b,a.Nb/b,a.mi,a.ni,a.Jk)};tk.prototype.disposeInternal=function(){this.reset();tk.g.disposeInternal.call(this)}; 316function uk(a,b,c,d,e,f){this.Lb=a;this.Mb=b;this.Nb=c;this.mi=d;this.ni=e;this.Jk=f}uk.prototype.nc=function(){return Lb(this.Lb*this.Lb+this.Mb*this.Mb+this.Nb*this.Nb)}
316;uk.prototype.Nf=function(){var a=this.nc()||1;return new uk(this.Lb/a,this.Mb/a,this.Nb/a,this.mi,this.ni,this.Jk)};uk.prototype.da=function(a){var b=a===this;!b&&(b=B(a,uk))&&(b=this.Lb===a.Lb&&this.Mb===a.Mb&&this.Nb===a.Nb&&this.mi===a.mi&&this.ni===a.ni&&this.Jk===a.Jk);return b};function xk(a){var b=yk[a];if(!b)if(a in zk)b=yk[a]=a;else{b=Ak.length;var c="",d=a.substr(0,1).toUpperCase()+a.substr(1),e="",f=!1;Bk&&(e=Bk+d,f=e in zk);for(;b--&&!f;)c=Ak[b],e=c+d,f=e in zk;f&&(Bk=c);if(b=f?e:null)yk[a]=b;else throw Error("Could not find any variant of CSS property ["+a+"]");}return b}t("H.dom.cssPrefixer.prefix",xk);var Ak=["O","Ms","ms","Moz","Webkit"],yk={},Bk="",zk=document.createElement("span").style;function Ck(a,b,c,d){Ck.g.constructor.apply(this,arguments)}u(Ck,yi);t("H.map.render.dom.Surface",Ck);m=Ck.prototype;m.uh=function(){return"dom"};m.createElement=function(a){a=a.createElement("DIV");a.style.position="absolute";a.style.pointerEvents="none";return a};m.Zw=function(a,b,c,d){b.width=c+"px";b.height=d+"px"};m.Fg=function(a){this.element.style.opacity=a}; 317m.Re=function(a,b,c){var d=this.ja,e=a.style;e[xk("transform")]="matrix(1,0,0,1,"+b/d+","+c/d+")";a.parentNode!==this.element&&(e.position="absolute",this.element.appendChild(a),this.element.style.pointerEvents="auto","auto"===getComputedStyle(a).pointerEvents&&(a.style.pointerEvents="all"),this.element.style.pointerEvents="none")};m.clear=function(a){a?this.element.removeChild(a):this.element.innerHTML=""};function Dk(a,b){this.Ey=a;this.oa=b} 318function Ek(a,b,c){var d=[],e={nd:a.Ey,width:b.w,height:b.h,ja:a.oa};for(a=0;a<c.length;a++){b=c[a];var f=b.Eh();var g={};Wa(g,e);var h=b.Pb;switch(f){case "2d":B(b.Tb(),zi)&&(g.Wo=b.Tb().getContextAttributes());if(f=n&&"2d"===n.uh()){f=g.Wo;var k=n.hj;f=k===f?!0:k&&!f?!k.alpha&&!k.willReadFrequently:f&&!k?!f.alpha&&!f.willReadFrequently:!f.alpha===!f.alpha&&!k.willReadFrequently===!f.willReadFrequently}if(f)var l=!1;else if(h&&!l){var n=h;l=!1}else n=new hk(g.nd,g.width,g.height,g.ja,"2d",g.Wo), 319l=!0;break;case "dom":n=h||new Ck(g.nd,g.width,g.height,g.ja);l=!h;break;default:n=h||new hk(g.nd,g.width,g.height,g.ja,b.Tb().uh(),g.Wo),l=!h}d[d.length-1]!==n&&(n.ui(d.length),d.push(n));b.tf(n)}return d};function Fk(a){gb(this,Fk);Fk.g.constructor.call(this,a);if(a&&"tileSize"in a){var b=Kb(+a.tileSize)/Ub;if(isNaN(b)||b%1||0>b||30<b)throw new C(Fk,0,"tileSize: "+a.tileSize);this.tileSize=+a.tileSize}}u(Fk,Q);t("H.map.provider.TileProvider",Fk);function Gk(a,b){return dc(a)-8-Gb(dc(b))}Fk.getZoomLevelOffset=Gk;Fk.prototype.requestTile=Fk.prototype.Pa;Fk.prototype.cancelTile=Fk.prototype.Nd;Fk.prototype.cancelTileByKey=Fk.prototype.Xi;Fk.prototype.createTileInternal=Fk.prototype.pd; 320Fk.prototype.Vd=function(a,b,c){return this.uri.concat("_",a,"_",b,"_",c)};Fk.prototype.getTileKey=Fk.prototype.Vd;Fk.prototype.tileSize=256;Fk.prototype.tileSize=Fk.prototype.tileSize;function Hk(a,b,c,d){this.key="";this.x=a;this.y=b;this.z=c;this.data=d;this.valid=!0}t("H.map.provider.Tile",Hk);function R(a){gb(this,R);R.g.constructor.call(this,a);this.qD=new Ik;this.cc=z(this.cc,this);this.jt=Jk;this.createTileInternal=this.pd.bind(this)}u(R,Fk);t("H.map.provider.RemoteTileProvider",R);R.prototype.Nz=function(){return 1};R.prototype.getEntryWeight=R.prototype.Nz;var Jk,Kk=screen.width,Lk=screen.height,Mk=Ke();Mk=Fb(Mk,1);var Nk=Ib(Kk*Mk*Lk*Mk/1E6);Jk=new kk(Mb(2,Fb(8,Eb(12,7+Nk))));var Ok={},Pk={};R.prototype.Sb=function(){return this.jt};R.prototype.getCache=R.prototype.Sb; 321R.prototype.Yn=ca(3);R.prototype.cc=function(a){var b=this.uri;return!a.indexOf(b)&&"_"===a.charAt(b.length)};R.prototype.cacheFilter=R.prototype.cc;R.prototype.dB=function(a,b){b.valid=!1};R.prototype.reload=function(a){var b=this.getCache();a?b.ia(this.cc):b.forEach(this.dB,this,this.cc);Qk(this);this.jb(this,{isReload:!0})};R.prototype.reload=R.prototype.reload;R.prototype.Vi=function(){return!1};R.prototype.MAX_STORE_TIME=Infinity;R.prototype.td=function(){return this.qD}; 322R.prototype.qw=function(a,b){b(a)};function Ui(a,b,c,d,e,f){d=~~d;return a.requestInternal(b,c,d,function(g,h){a.td().put(a.Vd(b,c,d),{raw:h&&h.raw||g,timestamp:globalThis.Date.now()},e,f)},f,0)}R.prototype.requestInternal=R.prototype.o; 323R.prototype.Pa=function(a,b,c,d){var e=this;var f=this.getCache();if(D(a=+a))throw new C(this.Pa,0,a);if(D(b=+b))throw new C(this.Pa,0,b);if(D(c=+c))throw new C(this.Pa,0,c);c=~~c;var g=this.getTileKey(a,b,c);f=f.get(g);f&&f.valid||d||Ok[g]||(f=A,this.requestTileAsPromise(a,b,c,d).then(function(h){e.jb(h)},Ye));return f};R.prototype.requestTile=R.prototype.Pa; 324R.prototype.Iw=function(a,b,c,d){var e=this,f=this.getCache(),g=this.getTileKey(a,b,c),h,k,l=this.td();if(Pk[g])return Pk[g];Pk[g]=h=new ee(function(n,p){function q(r){var v=0,w;var y=function(F,G){w=e.createTileInternal(a,b,c,F,G);w.key=g;f.add(g,w,1);n(w);Rk(g)};r&&(v=globalThis.Date.now()-r.timestamp);r&&v<e.MAX_STORE_TIME?e.qw(r.raw,y):(0<v&&l.remove(g),(w=f.get(g))&&w.valid||d?n(w||null):Ok[g]=e.requestInternal(a,b,c,y,p))}k=l.get(g,q,q)});Ok[g]||(Ok[g]=k);h.then(function(){Rk(g)},function(){Rk(g)}); 325return h};R.prototype.requestTileAsPromise=R.prototype.Iw;R.prototype.Hw=function(a,b){var c=this,d=a.id,e=a.tile.coords;return new ee(function(f,g){c.Iw(e.x,e.y,e.z,b).then(function(h){var k=x;h=h.bb?h.bb():h.data;for(var l=h.length,n;l--;)if(n=h[l],n.xb()===d){k=n;break}f(k)},g)})};R.prototype.requestObjectAsPromise=R.prototype.Hw;function Rk(a){delete Ok[a];delete Pk[a]}function Qk(a){for(var b in Ok)a.cc(b)&&a.cancelTileByKey(b)}var Sk={cancel:Ye}; 326R.prototype.pd=function(a,b,c,d){return new Hk(a,b,c,d)};R.prototype.createTileInternal=R.prototype.pd;R.prototype.Xi=function(a){var b=Ok[a];b&&(b.cancel(),Rk(a))};R.prototype.cancelTileByKey=R.prototype.Xi;R.prototype.Nd=function(a,b,c){this.cancelTileByKey(this.getTileKey(a,b,c))};R.prototype.cancelTile=R.prototype.Nd;
326R.prototype.disposeInternal=function(){R.g.disposeInternal.call(this);this.getCache().ia(this.cc);Qk(this)};function Ik(){}R.NullStorage=Ik;Ik.prototype.get=function(a,b){b();return Sk}; 327Ik.prototype.get=Ik.prototype.get;Ik.prototype.put=function(a,b,c){c&&c()};Ik.prototype.put=Ik.prototype.put;Ik.prototype.clear=function(a){a&&a()};Ik.prototype.clear=Ik.prototype.clear;Ik.prototype.remove=function(a,b){b&&b()};Ik.prototype.remove=Ik.prototype.remove;function Tk(a){Tk.g.constructor.call(this,a);a&&(this.Gk={crossOrigin:a.crossOrigin||"anonymous",headers:a.headers||{}},this.Vp=a.getURL);if(Uk(this)){var b=a&&a.style&&a.style instanceof H.map.render.harp.Style?a.style:new H.map.render.harp.Style({styles:[{technique:"raster",attr:{gamma:1,brightness:1}}]});this.Xa(b)}if(!db(this.Vp))throw new C(Tk,0,"getURL");this.Fg(a.opacity);this.zl=globalThis.URL||globalThis.webkitURL;a=this.Gk.crossOrigin;if(!(a="anonymous"===a||"use-credentials"===a)){a=this.Vp(0, 3280,0);b=window.location;var c=document.createElement("a");c.href=a;a=c.hostname===b.hostname&&c.port===b.port&&c.protocol===b.protocol}(this.ex=a&&!!rg.arraybuffer&&!!this.zl)&&this.Sb().fi(z(this.ke,this))}u(Tk,R);t("H.map.provider.ImageTileProvider",Tk);function Uk(a){return!!H.map.render.harp&&a.vb===mi.HARP}Tk.prototype.Fd=function(a){this.Fg(a)};Tk.prototype.setOpacity=Tk.prototype.Fd;Tk.prototype.Ve=function(){return this.Sc};Tk.prototype.getOpacity=Tk.prototype.Ve;Tk.prototype.zk=We; 329Tk.prototype.providesRasters=Tk.prototype.zk; 330Tk.prototype.o=function(a,b,c,d,e,f){var g=this,h=this.Vp(a,b,c),k;a=Sk;if(h){var l=globalThis.setTimeout(function(){g.ex?(k=new qg("arraybuffer",h,f,g.Gk),k.then(function(n){return n.blob()}).then(function(n){var p=new Image;p.onload=z(d,null,p,{raw:n});p.onerror=z(e,null,"bad url");try{p.src=g.zl.createObjectURL(n)}catch(q){}},e)):(k=new qg("image",h,f,g.Gk),k.then(d,e))},150);a={cancel:function(){k?k.cancel():globalThis.clearTimeout(l)}}}else d(null);return a};Tk.prototype.requestInternal=Tk.prototype.o; 331Tk.prototype.qw=function(a,b){var c=new Image;c.onload=function(){b(this)};c.src=this.zl.createObjectURL(a)};Tk.prototype.ke=function(a,b){(a=b.data)&&a instanceof HTMLImageElement&&this.zl.revokeObjectURL(a.src)};Tk.prototype.K=function(){return this.mb()};Tk.prototype.getStyle=Tk.prototype.K;Tk.prototype.Cb=function(a){Uk(this)&&a instanceof H.map.render.harp.Style&&this.Xa(a)};Tk.prototype.setStyle=Tk.prototype.Cb;function Vk(a,b,c,d){a-=c;b-=d;return a*a+b*b}function Wk(a,b,c){return Xk(a,b*b,c||0,0,a.length-1)}t("H.math.simplifyDP",Wk); 332function Xk(a,b,c,d,e){var f=0,g=d,h=a[d].x,k=a[d].y,l=a[e].x,n=a[e].y,p=d+1,q=Vk(h,k,l,n);if(q)for(;p<e;){var r=a[p++];var v=r.x;r=r.y;var w=((v-h)*(l-h)+(r-k)*(n-k))/q;v=0>w?Vk(v,r,h,k):1<w?Vk(v,r,l,n):Vk(v,r,h+w*(l-h),k+w*(n-k));v>f&&(f=v,g=p-1)}else for(;p<e;)r=a[p++],v=r.x,r=r.y,v=Vk(v,r,h,k),v>f&&(f=v,g=p-1);f>=b||0<c&&g-d?(--c,1<g-d?(d=Xk(a,b,c,d,g),d.splice(d.length-1,1)):d=[a[d]],d=1<e-g?d.concat(Xk(a,b,c,g,e)):d.concat(a.slice(g,e+1))):d=[a[d],a[e]];return d};function Yk(a,b,c,d,e,f,g,h){Yk.g.constructor.call(this,b,c,d,null);this.key=a;this.Bd=h;this.gd=e;this.oa=f;this.di={};this.zL=g;this.Vm=Ib(M.MAX_LINE_WIDTH/2*this.oa+1)}u(Yk,Hk);t("H.map.provider.SpatialTile",Yk);Yk.prototype.zg=cc;Yk.prototype.xr=cc;Yk.prototype.qf=cc;function Zk(a){return a.Bd.getInvalidations(zh.SPATIAL)} 333function $k(a){var b=Zk(a),c=b.Md,d=a.zg,e=d===c,f;if(!(e||b.Su(d)||b.sq(d))){e=a.Ig;var g=a.di;if(b.Km(d))for(f=e.length;f--;){var h=e[f];if(h.Nc().Km(d)){e.splice(f,1);var k=k||al(a,h.xb())}}if(b.uq(d)){for(f=e.length;f--;)if(h=e[f],h.Nc().uq(d)){var l=1;if((h=g[h.xb()])&&h.wm){k=1;break}}l&&e.sort(bl)}if(!k&&b.Kh(d))for(f=e.length;f--;)if(e[f].Nc().Kh(d)){var n=1;break}a.xr!==d||n||(a.xr=c,a.qf!==d||k||(a.qf=c));a.zg=c;e=!0}return e} 334Yk.prototype.Ih=function(){var a=Zk(this),b=a.Md,c=this.qf,d=c===b;d||(this.Bd.vw&&!a.Kh(c)?d=!0:$k(this)&&(d=this.qf===b));return d};Yk.prototype.isCanvasValid=Yk.prototype.Ih;Object.defineProperty(Yk.prototype,"valid",{get:function(){return this.Ih()},set:Ye,configurable:!0});function cl(a,b){this.gm=a;this.wm=b}function al(a,b){a=a.di;var c=a[b];if(c)return delete a[b],c.wm}Yk.prototype.Ig=Ze; 335function dl(a){var b=Zk(a),c=a.zg,d=a.Ig,e;if(!$k(a)){for(e=d.length;e--;){var f=d[e];var g=f.Nc();(g.Km(c)||g.sq(c))&&al(a,f.xb())}a.Ig=a.Bd.requestSpatialsByTile(a,!1,!1).sort(bl);a.zg=b.Md}}function bl(a,b){return Ah(a.We(),b.We(),!1)}Yk.prototype.bb=function(){return this.Ig};Yk.prototype.getObjects=Yk.prototype.bb;Yk.prototype.IA=function(){return this.gd};Yk.prototype.getTileSize=Yk.prototype.IA;var el={}; 336Yk.prototype.Pj=function(){var a=this.gd+"_"+this.oa,b=el[a];if(!b){b=-this.Vm;var c=this.gd-b;
336b=el[a]=new lh(b,b,c,c)}return b};Yk.prototype.getPxClipRect=Yk.prototype.Pj;Yk.prototype.nm=function(){var a=this.oz;if(!a){var b=this.pm();a=0;var c=this.gd;this.z&&(c-=a+=this.Pj().top);a=this.oz=Wc(b.sk(new K(a,a)),b.sk(new K(c,c)))}return a};Yk.prototype.getGeoClipRect=Yk.prototype.nm; 337Yk.prototype.pm=function(){var a=this.zC;if(!a){var b=this.gd;a=this.zC=new si(A,b);a.Va(this.z);a.x=this.x*b;a.y=this.y*b}return a};Yk.prototype.getPxProj=Yk.prototype.pm;Yk.prototype.lb=function(){return this.oa};Yk.prototype.getPixelRatio=Yk.prototype.lb;Yk.prototype.Hn=function(){var a=this.data;a&&(this.data=null,this.qf=cc);return a};Yk.prototype.releaseCanvas=Yk.prototype.Hn;Yk.prototype.In=function(){this.di={};delete this.Ig;this.zg=cc};Yk.prototype.releaseData=Yk.prototype.In; 338Yk.prototype.L=function(a){var b=a.getContext("2d"),c,d,e,f,g=0;dl(this);if(this.qf<this.zg){var h=this.Ig;if(c=h.length){a.width=a.height=this.gd;b.clearRect(0,0,this.gd,this.gd);var k=this.di;for(d=0;d<c;d++){var l=h[d];var n=l.xb();if(f=(e=k[n])?e.gm:l.getGeometriesForTile(this)){if(e)l.Nc().Kh(this.qf)&&(e.wm=Fh(l,f)),e=e.wm;else{e=Fh(l,f);var p;var q=f;for(var r=l.Xe?2:0,v=q.length;v--;){var w=q[v];if(w!==jh){var y=w.Tc;for(p=y.length;p--;)w=y[p],4<w.length&&(y[p]=Wk(w,.6,r))}}this.di[n]=new cl(f, 339e)}if(e){b.save();q=l.Xe?this.GC:this.HC;for(n=0;n<f.length;n++)q.call(this,l,f[n],l.K(),b);if(f=l.getLabels(this))for(l=b,n=f.length;n--;)for(r=f[n],q=r.size,l.font=q+"px "+r.font,l.fillStyle=r.color,l.textAlign="center",l.translate(r.x,r.y),l.rotate(r.angle),q=r.lineHeight||1.375*q,v=r.lines,r=v.length;r--;)l.fillText(v[r],0,r*q);b.restore()}g|=+e}}}this.data=g?a:null;this.xr=this.qf=this.zg}else this.data&&(g=1);return 0<g};Yk.prototype.render=Yk.prototype.L;Yk.prototype.data=null; 340Yk.prototype.HC=function(a,b,c,d){var e;c.Xj&&(fl(d,c,this.oa),gl(b,d,!1,!0,!1,this.gd,this.Vm));c.Vj&&(e=a.Tg)&&e.Pc&&(hl(d,e),il(this,d,b,e,c.lineWidth))}; 341Yk.prototype.GC=function(a,b,c,d){var e=c.Pc,f=c.Xj,g,h=this.gd,k=this.Vm;if(b===jh)e&&(hl(d,c),d.fillRect(0,0,h,h));else{f&&fl(d,c,this.oa);if(c.Vj&&(g=a.Tg)){var l=c.lineWidth;g.Pc||(g=null)}a=b.sn;if(a===bc){if(f||e)hl(d,c),gl(b,d,!0,f,e,h,this.Vm);g&&(hl(d,g),il(this,d,b,g,l,0))}else e&&(hl(d,c),gl(b,d,!0,!1,e,h,k,0,a)),f&&gl(b,d,!1,f,!1,h,k,a),g&&(hl(d,g),il(this,d,b,g,l,a))}}; 342function gl(a,b,c,d,e,f,g,h,k){var l=a.Tc,n=-g;g=f+g;h=h||0;k===A&&(k=l.length);if(e&&a===jh)b.fillRect(0,0,f,f);else if(k>h){b.beginPath();for(f=h;f<k;f++){var p=l[f];var q=p.length;if(p===kh)b.moveTo(n,n),b.lineTo(n,g),b.lineTo(g,g),b.lineTo(g,n);else{var r=p[0];b.moveTo(r.x,r.y);for(h=1;h<q;h++)r=p[h],b.lineTo(r.x,r.y)}c&&b.closePath()}c&&e&&b.fill(a.Uj!==bc?"evenodd":"nonzero");d&&b.stroke()}} 343function fl(a,b,c){var d;a.strokeStyle=b.strokeColor;a.lineWidth=b.lineWidth*c;a.lineCap=b.lineCap;a.lineJoin=b.lineJoin;a.miterLimit=b.miterLimit;a.setLineDash&&(d=b.lineDash)!==Ze&&(a.setLineDash(d),a.lineDashOffset=b.lineDashOffset)}function hl(a,b){a.fillStyle=b.fillColor} 344function il(a,b,c,d,e,f){var g=e*d.width/2;e=e*d.length/2;var h=e/2;d=2*e*d.frequency;var k=Lb(Mb(e,2)+Mb(g,2));a=a.gd-k;a=new lh(k,k,a,a);c=c.Tc;var l,n,p,q,r,v,w,y=Vb/2;f=f||0;for(k=c.length;k-- >f;){var F=0;var G=c[k];if(n=l=G.length){var O=G;n=O.length;for(p=0;--n;)p+=O[n].kb(O[n-1]);n=(O=p)>=d}if(n)for(n=Eb(Hb(O/d),1E3),n=O/(n+1),p=n/2;--l;){for(q=(r=G[l]).kb(v=G[l-1]);p<=F+q;){var V=r.x+(v.x-r.x)*(w=(p-F)/q);w=r.y+(v.y-r.y)*w;a.Ql(V,w)&&(b.save(),b.translate(V,w),b.rotate(-Sb((v.y-r.y)/(r.x- 345v.x))+(r.x<v.x?y:-y)),b.beginPath(),b.moveTo(-g,-e),b.lineTo(0,e),b.lineTo(g,-e),b.lineTo(0,-h),b.closePath(),b.fill(),b.restore());p+=n}F+=q}}}var jl=[]; 346Yk.prototype.Ma=function(a,b,c){for(var d=this.Ig,e=d.length,f,g,h,k,l,n,p=Ze,q,r=this.oa;e--;)if(g=d[e],g.Wd(!0)&&(h=this.di[g.xb()])&&(k=h.gm)){f=g.K();n="none"!==f.fillColor&&g.Xe;q="none"===f.strokeColor?0:f.lineWidth*r;for(f=k.length;f--;){l=k[f];var v;if(!(v=n&&l===jh)&&(v=n||q)){var w;v=a;var y=b,F=n,G=q,O=l.Uj,V=l.sn,Ua=V!==bc,aa=l.Tc,vb=aa.length,Ba=0,Pa=0,ic=!1;for(l=0;l<vb;l++){var jc=aa[l];var La=l>=V;var Cc=!La&&l>=O;if(jc===kh&&F)Cc?Ba++:Pa++;else{var Kc=jc.length;jl.length=2*Kc;for(w= 3470;w<Kc;w++){var zp=jc[w];jl[2*w]=zp.x;jl[2*w+1]=zp.y}w=F&&!La;La=Ua&&!La?0:G;
347if(w||La)if(La=lc(v,y,jl,La,w),La===kc.EDGE||La===kc.VERTEX){ic=!0;break}else if(La===kc.SURFACE)if(Cc)Ba++;else if(Pa++,O===bc)break}}v=ic||0<Pa&&!(Ba%2)}if(v){p===Ze&&(p=[]);p.push(g);break}}if(c&&p.length)break}return p};function kl(a,b){var c=this;if(!db(b))throw new C(kl,1,b);if(!db(a.next||db(a.cycle)))throw new C(kl,2,'Argument "mode" must implement H.util.AsyncQueue.Mode');this.Ak=[];this.sw=[];this.LB=a;this.process=b;this.xC=function(){ll(c)};this.nr=null;this.Mw=function(){c.nr||(c.nr=globalThis.setTimeout(c.xC,1))}}t("H.util.AsyncQueue",kl);kl.prototype.push=function(a,b){if(!db(b))throw new C(this.push,1,b);a=ml(new nl,a,this.Mw,b);this.Ak.push(a);this.Mw();return a};kl.prototype.push=kl.prototype.push; 348kl.prototype.An=function(){ll(this)};function ll(a){var b=a.sw,c=0,d=a.LB;d.yt();for(a.nr=null;c<b.length;){var e=b[c];e.Wu?b.splice(c,1):c++}for(;e=d.next(a.Ak,a.sw);)e.cancelled?e.done(null,"cancelled"):(b.push(e),a.process(e,e.data))}function nl(){ml(this,null,null,null)}kl.Task=nl;function ml(a,b,c,d){a.data=b;a.cancelled=!1;a.Wu=!1;a.VB=c;a.WB=d;a.Qo=null;return a}nl.prototype.done=function(a,b){this.Wu=!0;this.VB();this.WB(this,a,b)};nl.prototype.done=nl.prototype.done; 349nl.prototype.cancel=function(){this.Qo&&this.Qo();this.cancelled=!0};nl.prototype.cancel=nl.prototype.cancel;nl.prototype.ZC=function(a){this.Qo=a;return this};nl.prototype.setCancelFn=nl.prototype.ZC;function ol(){}kl.Mode=ol;ol.prototype.next=function(){};ol.prototype.yt=function(){};function pl(a,b){pl.g.constructor.call(this,new ql(a),b)}u(pl,kl);t("H.util.SequentialQueue",pl);function ql(a){if(isNaN(a)||0>a)throw new C(pl,1,'Argument "maxTime" must be a positive number');this.EB=a;this.$k=rk()}ql.prototype.next=function(a){return a.length&&rk()-this.$k<this.EB?a=a.shift():null};ql.prototype.yt=function(){this.$k=rk()};function rl(a,b){var c;rl.g.constructor.call(this,b);this.uw=a;this.oa=a=b.pixelRatio;this.tileSize=c=1<<Gb(dc((b.tileSize||256)*a));this.vs=Gk(c,a);this.ke=z(this.ke,this);this.Qq=z(this.Qq,this);this.sg=z(this.sg,this);this.mg=z(this.mg,this);this.he=z(this.he,this);this.uw.addEventListener(Q.prototype.j.Aa,this.he,!1,this);this.Zg=[];this.wf=new kk(b.tileCacheSize||256,this.ke);this.cp=new kk(b.dataCacheSize||512,this.Qq);this.Mn=new pl(20,this.sg);this.qg={};this.gv=rk()}u(rl,Fk); 350rl.prototype.he=function(a){a=a.target;a.type===zh.SPATIAL&&this.jb(a)};rl.prototype.Pa=function(a,b,c,d){var e=this.getTileKey(a,b,c),f;if(f=this.wf.get(e,d)){if(d||f.Ih())return f;d||this.wf.cm(e)}if((f=this.cp.get(e,d))&&(d||$k(f)))return a=this.Zg.pop()||document.createElement("canvas"),f.L(a)||this.Zg.push(a),this.wf.add(e,f,1),f;d||((f=this.qg[e])?f.count++:(f=this.Mn.push([e,a,b,c],this.mg),f.count=1,this.qg[e]=f))};rl.prototype.requestTile=rl.prototype.Pa;rl.prototype.pd=function(){}; 351rl.prototype.createTileInternal=rl.prototype.pd;rl.prototype.An=function(){var a=rk();33<a-this.gv&&(this.Mn.An(),this.gv=a)};rl.prototype.Nd=function(a,b,c){this.Xi(this.getTileKey(a,b,c))};rl.prototype.cancelTile=rl.prototype.Nd;rl.prototype.Xi=function(a){var b;if(b=this.qg[a])b.count--,b.count||(b.cancel(),delete this.qg[a])};rl.prototype.cancelTileByKey=rl.prototype.Xi;m=rl.prototype; 352m.sg=function(a,b){var c=b[0],d=b[1],e=b[2],f=b[3];c=this.wf.get(c)||new Yk(c,d,e,f,this.tileSize,this.oa,f+this.vs,this.uw);d=c.data||this.Zg.pop()||document.createElement("canvas");c.L(d)||this.Zg.push(d);b.push(c);a.done(c)};m.mg=function(a,b){a=a.data[0];b&&this.wf.add(a,b,1);delete this.qg[a];this.jb()};m.ke=function(a,b){b.data&&this.Zg.push(b.Hn());this.cp.add(a,b,1)};m.Qq=function(a,b){b.In()}; 353m.disposeInternal=function(){for(var a in this.qg)this.qg[a].cancel();this.wf.ia();this.cp.ia();this.Zg.length=0;rl.g.disposeInternal.call(this)};function sl(a,b){Wi.call(this,a,b)}u(sl,Wi);t("H.map.layer.TileLayer",sl);sl.prototype.yg=function(a,b,c,d,e){if(!B(a,E))throw new C(this.yg,0,a);if(D(b=+b))throw new C(this.yg,1,b);b=Hb(b);this.pixelProjection.Va(b);a=this.Bj(a);var f=this.Fh(a,b);return this.Oj(f,a.left>a.right,b,c,d,e)};sl.prototype.requestTiles=sl.prototype.yg;function tl(a,b){b=b?Ta(b):{};b.tileSize=b.tileSize||256;b.pixelRatio=b.pixelRatio||Ke();b.max=24;this.Hg=new rl(a,b);this.wi=new sl(this.Hg);b.minWorldSize=this.Hg.tileSize;b.provider=a;tl.g.constructor.call(this,b);this.tileSize=this.wi.tileSize;this.ln=z(this.ln,this);this.Hg.addEventListener(this.Hg.j.Aa,this.ln);a.addEventListener(a.j.Aa,this.ln)}u(tl,vi);t("H.map.layer.ObjectLayer",tl);tl.prototype.ln=function(a){a.currentTarget!==this.Hg&&a.target.type===zh.SPATIAL||this.jb()}; 354var ul={markers:Ze,total:0};tl.prototype.qe=function(a,b,c){var d=this.D,e;return d.providesMarkers()&&(e=d.requestMarkers(a,b,!0,c)).length?{markers:e,total:e.length}:ul};tl.prototype.requestMarkers=tl.prototype.qe;tl.prototype.pe=function(a,b,c){var d=this.D,e;
354return d.providesDomMarkers()&&(e=d.requestDomMarkers(a,b,!0,c)).length?{markers:e,total:e.length}:ul};tl.prototype.requestDomMarkers=tl.prototype.pe;var vl={tiles:Ze,total:0}; 355tl.prototype.yg=function(a,b,c,d){if(this.D.providesSpatials()){var e=this.wi.yg(a,b,c,d);c||(this.Hg.An(),e=this.wi.yg(a,b,!0,d))}else e=vl;return e};tl.prototype.requestTiles=tl.prototype.yg;tl.prototype.Pa=function(a,b,c,d){return this.wi.Pa(a,b,c,d)};tl.prototype.requestTile=tl.prototype.Pa;tl.prototype.Nd=function(a,b,c){this.wi.Nd(a,b,c)};tl.prototype.cancelTile=tl.prototype.Nd;var wl={overlays:Ze,total:0}; 356tl.prototype.xg=function(a,b,c){var d=this.D,e=wl;d.providesOverlays&&d.providesOverlays()&&(a=d.requestOverlays(a,b,!0,c),b=a.length)&&(e={overlays:a,total:b});return e};tl.prototype.requestOverlays=tl.prototype.xg;tl.prototype.disposeInternal=function(){this.Hg.l();this.wi.l();this.D.dispose();tl.g.disposeInternal.call(this)};function xl(a){var b,c=this,d=globalThis.H.gl;xl.g.constructor.call(this);this.m=b=d.Scene.create(globalThis.URL.createObjectURL(ff(JSON.stringify(yl))),{viewport:a.viewport,container:a.nd,disableRenderLoop:!0,devicePixelRatio:a.devicePixelRatio,logLevel:"error"});a.cC&&b.subscribe({load:a.cC});b.subscribe({view_complete:function(){c.Jr=!0;a.Rv()}});var e=b.requestRedraw;b.requestRedraw=function(){e.apply(b);a.Rv()};this.Kr=z(this.Kr,this);this.Kn=z(this.Kn,this);this.rs=0;this.Rh={};this.Hd={}} 357u(xl,ed);m=xl.prototype;m.Jr=!1;function zl(a){a=a.m.sources;var b;for(b in a){var c=a[b];if(c.hasPendingCommands&&c.hasPendingCommands())return!0}return globalThis.H.gl.Task.hasPendingTasks()}m.L=function(){var a=globalThis.H.gl.Task;this.m.immediateRedraw();a.setState({user_moving_view:this.m.view.user_input_active});a.processAll();return this.Jr&&!this.m.dirty&&!this.m.building&&!zl(this)&&!Object.keys(this.Hd).length};function Al(a){a.Jr=!1;a.m.resetViewComplete()} 358function Bl(a){return a.m.view} 359function Cl(a,b){function c(){var e=b.Ta(),f={},g={},h,k,l,n=++a.rs,p,q;Dg(g,yl);for(k=0;k<e.length;k++){var r=e[k];if(h=r.D){var v=h.mb();if(v.getState()===Ag.READY){var w=v.Sd();if(!Sa(w)){delete w.cameras;delete w.camera;f[k]=w=Pg(w,k);!B(r,tl)&&w.sources&&Qg(w,h.uid);for(l in w.sources){var y=w.sources[l];y.max_zoom=Eb(h.max,fk.lookAt.zoom.max);y.max_display_zoom=r.max;y.min_display_zoom=r.min;if(q=h.tileSize)2<=d&&256<q&&h instanceof Tk&&(q/=2),y.tile_size=q}(p=v.Lc())&&Rg(w,p);Dg(g,w)}}}}Dg(g.layers.skybox.draw.skybox.color, 360g.scene.sky);a.m.config=g;return a.m.updateConfig().then(function(){var F={},G,O;if(n!==a.rs)return!1;a.rs=0;for(O in f){r=e[+O];var V=f[O].sources;for(G in V)if(V=a.m.sources[G])F[G]=V,V.initialize&&r.getProvider()&&V.initialize(r.getProvider(),a.Kr,a.m.getWorkers().length,V.tiled?A:a.m.tile_manager.getWorkerForTile(x,V))}for(G in a.Rh)!F[G]&&a.Rh[G].dispose&&a.Rh[G].dispose();a.Rh=F;return!0})}var d=a.m.pixelRatio();a.m.initialized?c():a.m.load(x,{blocking:!1}).then(c)} 361m.Kr=function(a,b,c){var d=this,e=this.m.sources[a],f=c&&c.isReload;b?!0!==this.Hd[a]&&(this.Hd[a]||(this.Hd[a]={tx:{},it:[]}),B(b,Hk)?this.Hd[a].tx[b.x+"/"+b.y+"/"+b.z]=!0:(b=b.boundingBox,this.Hd[a].it.push(new E(b[0],b[1],b[2],b[3])))):this.Hd[a]=!0;e&&e.has_volatile_data?Dl(this,f):(globalThis.clearTimeout(this.Cw),this.Cw=globalThis.setTimeout(function(){return Dl(d,f)},100))}; 362m.Kn=function(a){var b=!1,c=this.Hd[a.source.name],d=globalThis.H.gl;if(c)if(!0===c)b=!0;else{var e=d.Tile.coord(d.Geo.wrapTile(a.coords));b=!!c.tx[e.key];if(!b){var f=d.Geo.getTileBoundingBox(e,a.source.tile_size,M.MAX_LINE_WIDTH/2);f=Wc(f.getTopLeft(),f.getBottomRight());b=c.it.some(function(g){return g.Wf(f,!0)||f.Gf(g.wb(),!0)})}}return b};function Dl(a,b){var c=a.m.tile_manager;c.removeTiles(a.Kn);c.updateTilesForView();b&&c.removeCachedTiles(a.Kn);Al(a);a.Hd={}}m.Sd=function(){return this.m.config}; 363function El(a,b,c,d){a.m.getFeatureAt(b,c,d);a.m.update()}function Fl(a){return a.m.screenshot(void 0).then(function(b){return new ee(function(c,d){new Yh(URL.createObjectURL(b.blob),function(e,f){1===e?c(f.getData()):d()},!1)})})}m.lb=function(){return this.m.pixelRatio()};m.disposeInternal=function(){var a=this.Rh;xl.g.disposeInternal.call(this);this.m.destroy();this.Hd={};
363a&&Object.keys(a).forEach(function(b){a[b].dispose()});globalThis.clearTimeout(this.Cw);delete this.Rh;delete this.m}; 364xl.prototype.disposeInternal=xl.prototype.disposeInternal;var yl={scene:{background:{color:"#FFFFFF"},sky:{zenith:"#347BC0",horizon:"#EDF2F9",fog:"#FFFFFF"}},lights:{default_light:{type:"directional",name:"default_light",visible:!0}},camera:{type:"perspective"},styles:{},fonts:{},sources:{skybox:{type:"SkyBox"}},layers:{skybox:{data:{source:"skybox"},draw:{skybox:{color:{}}}}},global:{}};function Gl(a,b){if(D(this.x=+a))throw new C(Gl,0,a);if(D(this.y=+b))throw new C(Gl,1,b);}m=Gl.prototype;m.add=function(a){return new Gl(this.x+a.x,this.y+a.y)};m.Lt=function(a){if(!B(a,Gl))throw new C(this.Lt,0,a);a=this.multiply(a);return a.x+a.y};m.multiply=function(a){if(!B(a,Gl))throw new C(this.multiply,0,a);return new Gl(this.x*a.x,this.y*a.y)};m.Va=function(a){return new Gl(this.x*a,this.y*a)};function Hl(a){return Lb(a.Lt(a))} 365m.normalize=function(){var a=Hl(this);return 0!==a?new Gl(this.x/a,this.y/a):this};function Il(a){a=a||$e;this.JB=fb(a.IB)?a.IB:3;this.yv=fb(a.DB)?a.DB:300;this.Jx=fb(a.ID)?a.ID:3;this.yD=fb(a.xD)?a.xD:50;this.ei=[];this.clear()}t("H.map.render.InteractionUtils",Il);Il.prototype.gB=function(){return this.Jh};Il.prototype.isGestureDetected=Il.prototype.gB;Il.prototype.start=function(a,b){var c=Yj.HEADING,d=Yj.TILT;this.R&&this.clear();this.ik=a;this.Jm=!!b;this.R=!0;this.Jh=!(a&(c|d))||a===c||a===d};Il.prototype.start=Il.prototype.start; 366Il.prototype.store=function(a,b,c,d,e){var f=!1;if(this.R){a=new Jl(a,b,c,d,e);f=a.Tu;this.Vn=this.af;this.af=a;if(this.yj){if(this.ym=!0,f){b=this.ik;var g=this.Jh;if(!g&&this.ym){e=Yj.HEADING;var h=Yj.TILT;c=Yj.COORD;d=Yj.ZOOM;var k=b&(c|h)?this.Ah(!0):Kl;var l=b&d?this.jm(!0):1;var n=b&e?Jb(this.Bp(!0)):0;var p=Jb(k.x);var q=Jb(k.y);k=10<p||10<q;p=10<q&&q>3*p;l=.8>l||1.2<l;n=7<n;b&h&&(n||l||k&&!p?Ll(this,h):p&&(Ll(this,~h>>>0),g=!0));!g&&b&e&&b&(c|d)&&(l||k?(Ll(this,e),g=!0):n&&(Ll(this,h),g=!0)); 367this.Jh=g}}}else this.yj=a,f||(this.Jh=!0);this.Jm&&this.ei.push(a)}return f};Il.prototype.store=Il.prototype.store;Il.prototype.clear=function(){this.ei.length=0;this.R=this.Jm=this.ym=this.Jh=!1;this.yj=this.Vn=this.af=void 0};Il.prototype.clear=Il.prototype.clear;Il.prototype.ae=function(a){return 0<(this.ik&a)};Il.prototype.isModifierEnabled=Il.prototype.ae;function Ll(a,b){a.ik^=a.ik&b}Il.prototype.Lm=function(){return this.R};Il.prototype.isRunning=Il.prototype.Lm;var Kl=ab(new Gl(0,0)); 368Il.prototype.Nf=function(){var a;if(this.Jm){var b=this.ei;var c=b.length;var d=0;for(a=new Gl(0,0);--c&&d<this.Jx;)a=a.add(Ml(b[c-1],b[c])),d++}else a=this.Ah();return a.normalize()};Il.prototype.getDirection=Il.prototype.Nf;Il.prototype.nc=function(a){a=a||rk();var b,c;if(this.Jm){var d=this.ei;var e=this.ei.length;var f=this.ei[e-1];for(c=b=0;--e&&b<this.Jx;)c+=Hl(Ml(d[e],d[e-1])),b++;d=c/b}else f=this.af,d=Hl(this.Ah());return d=d>=this.JB&&a-f.timestamp<=this.yD?d>this.yv?this.yv:d:0}; 369Il.prototype.getSpeed=Il.prototype.nc;Il.prototype.im=function(){return this.af?Nl(this.af):A};Il.prototype.getBifocalCenter=Il.prototype.im;Il.prototype.Ah=function(a){return(a=a?this.yj:this.Vn)?Ml(a,this.af):new Gl(0,0)};Il.prototype.getMoveVector=Il.prototype.Ah;Il.prototype.jm=function(a){var b=1;if(this.ym){var c=this.af;a=a?this.yj:this.Vn;if(a=Ol(a))if(c=Ol(c))b=c/a}return b};Il.prototype.getBifocalScaling=Il.prototype.jm; 370Il.prototype.Bp=function(a){if(this.ym){var b=a?this.yj:this.Vn,c=this.af;a=b.rg;var d=c.rg,e=0;a&&d&&(b=b.le,c=c.le,e-=Tb(d.y-c.y,d.x-c.x)*ac-Tb(a.y-b.y,a.x-b.x)*ac);a=e}else a=0;return a};Il.prototype.getBifocalRotation=Il.prototype.Bp;function Jl(a,b,c,d,e){this.le=new K(a,b);c!==A&&(this.rg=new K(c,d),this.Tu=!0);this.timestamp=e!==A?e:rk()}Jl.prototype.Tu=!1;function Nl(a){var b=a.le;return(a=a.rg)?new K(b.x-(b.x-a.x)/2,b.y-(b.y-a.y)/2):A} 371function Pl(a,b){var c=a.le;return(a=a.rg)&&a.kb(b)<c.kb(b)?a:c}function Ml(a,b){var c=a.rg,d=b.rg;d&&c?(b=Nl(b),a=Nl(a)):c?(b=b.le,a=Pl(a,b)):d?(a=a.le,b=Pl(b,a)):(b=b.le,a=a.le);return new Gl(b.x-a.x,b.y-a.y)}function Ol(a){var b=a.rg;return b?a.le.kb(b):0};function S(a,b,c,d){var e;S.g.constructor.call(this,a,b,c,d);this.qp=new kk(this.by);this.Xb=new K(0,0);
371if(e=d.renderBaseBackground)this.Ew=e.lower,this.Dw=e.higher;this.tj=!!d.enableSubpixelRendering;this.Kg=Ql;this.na=new Il;this.T=d=new tk;this.gg=z(this.gg,this);d.addEventListener(d.j.wo,this.gg);d=a.element;this.rc=a=d.ownerDocument.createElement("div");a.style.position="absolute";a.style.width=a.style.height="100%";a.style.zIndex=0;d.insertBefore(a,d.firstChild);this.cl=new Dk(this.rc,this.ja); 372this.Um=b.Ib().position;b=globalThis.H.gl;if(!b)throw new Bb(S,'"H-webgl" module is missing');this.m=new xl({viewport:this.za,nd:this.rc,devicePixelRatio:this.ja,Rv:z(this.ba,this)});b.WorkerBroker.addTarget("model",Pj);this.gq();this.Tq=z(this.Tq,this);this.wg=z(this.wg,this);this.La=z(this.La,this);c.addEventListener(vi.prototype.j.Li,this.Tq);this.s=Rl;this.zoom=ak(this,this.Ee.Ub());this.Ac();this.ng()}u(S,Vj);t("H.map.render.webgl.RenderEngine",S);S.prototype.by=100; 373S.prototype.Ib=function(){var a=this.Um;return bk(this,{position:{qB:a.qB,xB:a.xB},zoom:this.zoom,tilt:this.vx,heading:this.heading})};S.prototype.Tq=function(a){a=(a=a.target.D)&&a.mb();(a&&a.getState())===Ag.INIT?a.load():(Al(this.m),Cl(this.m,this.ib),this.ba())};S.prototype.type=ek.WEBGL;var Rl=2;S.prototype.getState=function(){return this.s};S.prototype.getState=S.prototype.getState;S.prototype.Ej=function(a,b){a=b-a;var c=Mb(2,8+this.zoom);return a<c/2?a:a-c*b/Jb(b)}; 374function Sl(a,b,c){function d(h){return e[h]+pj(e[h],b[h])/2}if(!(c&Oi.POSITION||c&Oi.BOUNDS))return null;var e=Bl(a.m).getLookAtData();c=e.position;var f=b.position,g=b.bounds;if(Ff(e.bounds,f.lat,f.lng,!1)||g&&Ff(g,c.lat,c.lng,!1))return null;c=Tl(a,{tilt:d("tilt"),heading:d("heading"),incline:0,bounds:Xc([c,f])});c.zoom=ak(a,c.zoom-.5);delete c.bounds;return c}S.prototype.mr=!1;function Ul(a,b,c,d){a=a.getCapabilities().lookAt[d];return Jb("zoom"===d?c[d]-b[d]:pj(b[d],c[d]))/(a.max-a.min)||0} 375function Vl(a,b,c){a=Fb(8*Ul(a,b,c,"zoom"),Ul(a,b,c,"heading"),Ul(a,b,c,"tilt")/2);return gc(3E3*a,300,4E3)} 376S.prototype.ar=function(a){var b=this,c=a.newValue,d=a.modifiers,e=Bl(this.m);this.Jg();this.Xb.set(0,0);var f=this.Do(c);Jj.forEach(function(n){d&a[n.toUpperCase()]||delete f[n]});if(a.animate){c=Bl(this.m).getLookAtData();var g=Tl(this,f,a.Pu);e=Sl(this,g,d);var h=1;ob(a.animate)&&(h=1/a.animate);var k=function(){return b.mr=!1};delete g.bounds;this.mr=!0;if(e){c=Vl(this,c,e);var l=Vl(this,e,g);Wl(this,e,c*h,function(){return Wl(b,g,l*h,k)})}else e=Vl(this,c,g),Wl(this,g,e*h,k)}else(c=a.Pu)?f=Tl(this, 377f,c):Xl(f),e.setLookAtData(f);Yl(this);Al(this.m);this.ba()};function Tl(a,b,c){Xl(b);a=Bl(a.m).getBestLookAtData(b);c&&(a.zoom<<=0);return a}function Xl(a){var b=a.bounds;!b||b instanceof L||(a.bounds=Cf(b.C()))}function Zl(a,b,c){Bl(a.m).setLookAtData(b);Al(a.m);Yl(a);a.ba();c&&setTimeout(c,0)} 378function Wl(a,b,c,d){var e=Bl(a.m).getLookAtData(),f=new oj(e,b);0!==f.cg.tilt+f.cg.heading+f.cg.zoom+f.kh?a.cd(function(g){for(var h in f.cg)if(0!==f.cg[h]){var k=f.Fv[h](g);e[h]+=f.cg[h]*(k-f.hv[h]);f.hv[h]=k}0!==f.kh&&(e.position=f.bp.mo(f.sy,f.kh*f.Fv.position(g),!0));return Zl(a,e)},c,function(){return Zl(a,b,d)}):Zl(a,b,d)}S.prototype.Wn=function(){};S.prototype.setAnimationDuration=S.prototype.Wn;S.prototype.zp=function(){};S.prototype.getAnimationDuration=S.prototype.zp;S.prototype.Xn=function(){}; 379S.prototype.setAnimationEase=S.prototype.Xn;S.prototype.Ap=function(){};S.prototype.getAnimationEase=S.prototype.Ap;S.prototype.Qn=function(){};S.prototype.resetAnimationDefaults=S.prototype.Qn;function $l(a,b){a.qp.ia(function(c,d){return d.Jb()===b})}m=S.prototype;m.Pv=function(a){$l(this,a.target.D);Al(this.m);this.ba()};m.pk=function(a,b){S.g.pk.call(this,a,b);am(b)&&(Al(this.m),(a=(a=b.D)&&a.mb())&&a.getState()===Ag.INIT&&a.load())}; 380m.Uq=function(a,b,c){var d;this.$j=rk();$l(this,b.D);if(b.requestDomMarkers||B(b,zi)||B(b,xi)){var e=this.re.ka;for(d=e.length;d--;){var f=e[d];if(f.Tb()===b){e.splice(d,1);f.l();break}}}am(b)&&Cl(this.m,this.ib);this.bf=this.ib.Ta();0===a&&(Zj(this,b,!1),this.Ac());Ek(this.cl,this.Tf(),this.Qf());this.li();c||this.ba()};function am(a){return!(B(a,xi)||B(a,zi))}m.gq=function(){var a=this.ib.Ta(),b=0,c=a.length;this.re={Qe:[],ka:[]};for(this.bf=a;b<c;b++){var d=a[b];this.pk(b,d);Zj(this,d,!0)}this.Ac()}; 381m.Vq=function(){this.Ac()};
381m.Ac=function(){S.g.Ac.call(this);var a=this.getCapabilities().lookAt.zoom;Bl(this.m).setZoomConstraints(Fb(a.min,this.zq),Eb(a.max,this.yq))};m.hq=function(a,b){var c;if(b){a={Qd:this.tj,Ab:this.Ab};b.L?B(b,zi)?c=new ik(b):B(b,xi)&&(c=new ik(b)):b.requestDomMarkers&&(c=new vj(b,a));if(c){this.re.ka.push(c);var d=this.ib.Ta();this.re.ka.sort(function(e,f){return d.indexOf(e.yb)-d.indexOf(f.yb)});Ek(this.cl,this.Tf(),this.Qf())}am(b)&&Cl(this.m,this.ib)}this.bf=this.ib.Ta()}; 382m.Qf=function(){return this.re.ka.filter(fb)};m.Po=function(){return this.s===Rl};m.Do=function(a){var b=a.position;return bk(this,{zoom:ak(this,a.zoom),position:new tc(b.lat,b.lng),tilt:a.tilt,heading:a.heading,bounds:a.bounds})};function Yl(a){var b=Bl(a.m).getLookAtData();a.zoom=b.zoom;a.Um=b.position}m.Fs=4.007501668557849E7;function bm(a,b){b=Bl(a.m).geoToMeters(b);return new K(b.x/a.Fs+.5,1-(b.y/a.Fs+.5))}function cm(a,b){return b.sub(bm(a,a.Um)).scale(Mb(2,8+a.zoom))}m.La=function(a){return Bl(this.m).geoToPixel(a)}; 383S.prototype.geoToScreen=S.prototype.La;S.prototype.Wa=function(a,b){return Bl(this.m).xyToGeo(a,b)};S.prototype.screenToGeo=S.prototype.Wa;S.prototype.Un=function(a,b){a=this.Wa(a,b);b=this.Ee.Ib();b.position=a;return b}; 384function dm(a,b,c,d,e,f,g,h){var k,l,n=0,p;var q=function(){0===--n&&f(e)};if(h&&h.features)for(n=l=h.features.length,p=0;p<l;p++){var r=h.features[p];var v=r.id;if(k=a.m.m.sources[r.source_name]){var w=k.provider;var y=w.ru();if(y===ki.SOURCE){var F=r.source_layer;if("overlays"===F)em(a,b,c,d,e,k,r.properties.overlays_config);else if(k=k.getMapObjectById(v))if("markers"!==F)e.push(k);else if(fm(a,b,c,k))e.push(k);else if(d&&!g){var G=!0;El(a.m,{x:b,y:c},{radius:3.5,top_most_only:!1},function(O){dm(a, 385b,c,d,e,f,!0,O)})}n--}else y===ki.FEATURE?(F=r.tile.coords,G=w.getFeatureProxy(r.properties,F,function(O){O&&(O.Yw(w),e.push(O));q()}),G||(k=a.qp.get(v),k||(k=new xh(r),k.ea(w),a.qp.add(v,k,1)),e.push(k),n--)):y===ki.PROVIDER&&(G=!0,w.Hw(r,!1).then(function(O){O&&(O instanceof Ji?fm(this,b,c,O):1)&&e.push(O);q()},function(){q()},a))}}y&&(G||0!==n)||f(e)} 386function em(a,b,c,d,e,f,g){var h;a=a.Wa(b,c);for(b=g.length;b--&&(!(h=f.getMapObjectById(g[b].id))||0<=e.indexOf(h)||!h.V().Gf(a)||(e.push(h),!d)););}function fm(a,b,c,d){var e=d.kc(),f=e.Am,g,h=!f;if(f)if(e=e.Db,b+=e.x,c+=e.y,e=d.V(),B(e,Nf))for(d=e.ha,g=d.length;g--&&!h;)e=a.La(d[g]),h=f.Bm(b-e.x,c-e.y,0)!==kc.NONE;else e=a.La(e),h=f.Bm(b-e.x,c-e.y,0)!==kc.NONE;return h} 387S.prototype.Ma=function(a,b,c,d){var e=this,f=[];f=this.Mp(f,this.re.ka,a*this.ja,b*this.ja,c);c&&f.length?d(f):this.m.m.initialized?El(this.m,{x:a,y:b},{radius:3.5,top_most_only:c},function(g){dm(e,a,b,c,f,d,!1,g)}):d(f)};S.prototype.getObjectsAt=S.prototype.Ma;m=S.prototype;m.Mp=function(a,b,c,d,e){for(var f=b.length,g;f--&&!((g=b[f])&&g.Ma&&(a=a.concat(g.Ma(c,d,e)),a.length&&e)););return a};m.ye=x;m.Tf=function(){var a=this.rl[2];return{w:a.right-a.left,h:a.bottom-a.top}}; 388m.ng=function(){var a=this.re.ka.length;Wj(this,this.ja);this.Xb.set(0,0);var b=this.Tf();var c=b.w;var d=b.h;for(this.m.m.handleViewportUpdate();a--;){b=this.re.ka[a].Pb;var e=b.mc();e.w===c&&e.h===d||b.Uk(c,d)}this.ye=new Xh(c,d);Al(this.m);this.ba()};m.getCapabilities=function(){return fk};S.prototype.getCapabilities=S.prototype.getCapabilities;m=S.prototype; 389m.Lk=function(){this.ta&&this.ta.R||(zl(this.m)||rk()-this.$j<this.Kg)&&!this.oe?this.rh||(this.rh=pk(this.wg)):(this.oe&&(this.li(),this.pj()),this.s=Rl)};m.rh=0;m.li=function(){this.re.Qe.length=0}; 390m.wg=function(){this.rh=0;this.ff&&this.ff.before();var a=Bl(this.m);var b=a.getLookAtData(!1);var c=a.getLookAtData(!0);a=this.za.center.clone();c=c.bounds.C();var d=this.zoom;var e=this.Xb;var f=this.bf;var g=f.length;for(this.Kg=Ql;g--;){var h=f[g];B(h,vi)&&h.D&&h.D.xk(c,d)}this.oe=this.m.L();this.Ee.rb(b);this.oe=this.Ln(c,a,d,!1,e,this.re)&&this.oe;this.ye&&(this.za.rb(this.ye),this.ye=x);this.ta&&this.ta.R&&this.Fo();this.ff&&this.ff.after();this.Lk()}; 391m.Ln=function(a,b,c,d,e,f){var g=f.ka.length,h=!0,k;for(k=0;k<g;k++){var l=f.ka[k];var n=f.Qe;if(l){var p=l.L(a,b,void 0,c,d,e,this.La,this.m.m.getCameraMatrix());p===fh.ACTIVE&&(this.Kg=Infinity);p!==fh.DONE||n[k]||(this.pj(l.Tb()),n[k]=!0);n[k]||(h=!1)}}return h};m.pj=function(a){this.mr||setTimeout(z(this.dispatchEvent,this,{type:this.j.Us,target:a||this}),1)}; 392m.disposeInternal=function(){var a=this.ib.Ta()[0],b=this.za;qk(this.rh);this.dd(!0);a&&Zj(this,a,!1);
392this.Qf().forEach(function(c){c.l()});b.element&&b.element.removeChild(this.rc);delete this.rc;this.s=3;this.m.l();S.g.disposeInternal.call(this)};m.ba=function(){this.$j=rk();this.Po()&&(this.oe=!1,this.s=1,this.Lk())};m.Bc=function(a,b){this.Sg(a,b);this.Xb.set(0,0);Al(this.m);this.ba()};m.Sg=function(a,b){Bl(this.m).applyPxOffset([a,b]);Yl(this)}; 393m.Ng=function(a,b,c){a=ak(this,ak(this,a));this.sb(a,b,c)};S.prototype.zoomAt=S.prototype.Ng;S.prototype.sb=function(a,b,c){Bl(this.m).setLookAtData({zoom:a},ob(b)&&ob(b)?[b,c]:A);Yl(this);Al(this.m);this.ba()};S.prototype.Jg=function(){this.dd(!0);this.T.R&&this.hc(!0);this.na.R&&this.ic(!0)};S.prototype.Rk=function(a){if(a){var b={};b.wk=a.power;b.sj=a.ease;b.duration=a.duration;this.ua=b}}; 394S.prototype.Jd=function(a,b){var c=!!(b||a&(Yj.HEADING|Yj.TILT));this.Jg();this.Rk(b);this.na.start(a,c);Bl(this.m).setPanning(!0)};S.prototype.startInteraction=S.prototype.Jd; 395S.prototype.wd=function(a,b,c,d,e){var f=this.na;var g=!1;if(f.R){var h=Bl(this.m);var k=h.getLookAtData();var l=this.za.center;l=[l.x,l.y];b=f.store(a,b,c,d,e);c=f.im();a=f.Ah();d=this.na.jm();e=this.na.Bp();f.Jh&&(f.ae(Yj.TILT)&&(h.setLookAtData({tilt:ck(this,k.tilt+a.y/this.za.height*-180)},l),g=!0),b&&1!==d&&f.ae(Yj.ZOOM)&&(g=f.im(),this.sb(ak(this,Kb(Mb(2,this.zoom)*d)/Ub),g.x,g.y),g=!0),f.ae(Yj.COORD)&&0<Hl(a)&&(this.Bc(-a.x,-a.y),g=!0),f.ae(Yj.HEADING)&&(b?h.setLookAtData({heading:k.heading+ 396dk(this,e)},[c.x,c.y]):a.x&&h.setLookAtData({heading:dk(this,k.heading+a.x/this.za.width*360)},l),g=!0),g&&(Al(this.m),this.ba()))}};S.prototype.interaction=S.prototype.wd; 397S.prototype.ic=function(a){var b=this;if(this.na.R&&!a){if(this.ua){a=this.na.nc();var c=this.na.Nf();var d=this.ua.duration;var e=(this.ua.wk||1)*a;var f=new gk(-e/(0<d?d:1),e);!D(c.x)&&!D(c.y)&&0<e&&b.na.ae(Yj.COORD)&&this.cd(function(g){e=f.Hj(g*d);D(e)||b.Bc(Gb(-c.x*e),Gb(-c.y*e))},d,void 0,this.ua.sj)}delete this.ua;this.na.clear()}Bl(this.m).setPanning(!1);this.ba()};S.prototype.endInteraction=S.prototype.ic;S.prototype.Id=function(a,b,c){this.Jg();this.T.start(b,c);this.Rk(a);Bl(this.m).setPanning(!0)}; 398S.prototype.startControl=S.prototype.Id;S.prototype.control=function(a,b,c,d,e,f){for(var g=0,h;g<arguments.length;g++)if(h=+arguments[g],h!==h)throw new C(this.control,g,h);this.T.R&&this.T.set(a,b,c,d,e,f)};S.prototype.control=S.prototype.control; 399S.prototype.hc=function(a,b){var c=this,d;if(this.T.R){this.dd(!0);var e=rk();var f=e-this.jj;if(1<=f){var g=wk(this.T);this.Qi(g,f)}if(!this.ua||a||b)"function"===typeof b&&(a=Bl(this.m),a=a.getLookAtData(),b(a),this.Go(a));else{b=this.T.nc();var h=this.T.Nf();var k=this.ua.duration;var l=(this.ua.wk||1)*b;var n=new gk(-l/(0<k?k:1),l);!D(h.Lb)&&!D(h.Mb)&&0<l&&this.cd(function(p,q,r,v){e&&(r=v-e,e=0);l=n.Hj(p*k)*r;D(l)||((d=h.Nb*l)&&c.sb(ak(c,c.zoom+d),c.T.Ug,c.T.Vg),c.Bc(Gb(h.Lb*l),Gb(h.Mb*l)))}, 400k,void 0,this.ua.sj)}this.T.reset();Bl(this.m).setPanning(!1);this.ba()}};S.prototype.endControl=S.prototype.hc;m=S.prototype; 401m.Go=function(a){var b=this,c=cm(this,bm(this,a.position)),d=c.y;c=c.x;var e=a.zoom,f=cm(this,bm(this,this.Um));a=f.y;var g=f.x;f=this.zoom;var h=this.T.nc(),k=this.T.Ug,l=this.T.Vg,n=0;c=this.Ej(g,c);c-=g;d-=a;f=e-f;a=Lb(c*c+d*d+f*f);if(0!==h&&0!==a){var p=c/a;var q=d/a;var r=f/a;var v=h*h/(2*a);this.cd(function(w,y){var F;if(1!==w){w=h*y-v*y*y/2;y=w-n;if(F=r*y)F=ak(b,b.zoom+F),b.sb(F,k,l);b.Bc(Gb(p*y),Gb(q*y));n=w}else b.sb(ak(b,e),k,l),b.ba()},2*a/h)}}; 402m.gg=function(a){var b=this,c=a.mt;this.Xb.set(0,0);c.Lb||c.Mb||c.Nb||c.mi||c.ni||c.Jk?(this.jj=rk(),this.cd(function(d,e,f,g){b.jj=g;b.Qi(c,f)},bc),this.ba()):this.dd(!0)};m.Qi=function(a,b){b=b||0;var c=this.T,d=Bl(this.m),e=d.getLookAtData();a.Nb&&this.sb(ak(this,e.zoom+a.Nb*b),c.Ug,c.Vg);d.setLookAtData({heading:dk(this,e.heading+a.ni*b),tilt:ck(this,e.tilt+a.mi*b)});Yl(this);this.Bc(a.Lb*b,a.Mb*b)};m.cd=function(a,b,c,d){this.ta&&this.ta.R&&this.ta.stop(!0);this.ta=new sk(this,a,b,c,d);this.ta.start()}; 403m.dd=function(a){this.ta&&this.ta.R&&this.ta.stop(a)};m.kp=function(){};S.prototype.enter=S.prototype.kp;S.prototype.pp=function(a){Xj(this.rc,a)};S.prototype.exit=S.prototype.pp;S.prototype.capture=function(a,b,c,d){var e=this;return Fl(e.m).then(function(f){var g=e.rc.ownerDocument.createElement("canvas"),h=e.ja,k=g.getContext("2d"),l=e.m.lb()/h,n=(c-a)*h;h*=d-b;g.width=n;g.height=h;k.drawImage(f,a*l,b*l,n*l,h*l,0,0,n,h);return g})};S.prototype.pz=function(a){return Bl(this.m).geoToMeters(a)}; 404S.prototype.geoToMeters=S.prototype.pz;S.prototype.GB=function(a){return Bl(this.m).metersToGeo(a)};S.prototype.metersToGeo=S.prototype.GB;var Ql=5E3;function gm(){this.constructor=this.constructor;if(!lb("STATIC_DB"))throw new C(this.constructor,0);this.Ku=hm();if(!this.Ku)throw new Bb(this.constructor,"This browser does not support IndexedDB");this.NB="STATIC_DB";this.hf=[];this.Xh=[];this.$q=z(this.$q,this)}var im,jm;m=gm.prototype;m.put=function(a,b,c,d){if(!lb(a)&&!ob(a))throw new C(this.put,0);if(!km(b))throw new C(this.put,1);lm(this,function(e){mm(e.put(b,a),c,d)},d)}; 405m.get=function(a,b,c){var d;if(!lb(a)&&!ob(a))throw new C(this.get,0);if(!db(b))throw new C(this.get,1);lm(this,function(e){d=e.get(a);mm(d,b,c)},c);return{cancel:function(){d&&(d.onsuccess=Ye)}}};m.remove=function(a,b,c){if(!lb(a)&&!ob(a))throw new C(this.remove,0);lm(this,function(d){mm(d["delete"](a),b,c)},c)};m.clear=function(a,b){lm(this,function(c){mm(c.clear(),a,b)},b)};m.yl="data";m.Ux=500;m.$q=function(){var a=this.og.result;a.objectStoreNames.contains(this.yl)||a.createObjectStore(this.yl)}; 406function nm(a,b,c){if(a.og)a.hf?(a.hf.push(b),c&&a.Xh.push(c)):a.pn?c&&c(a.pn):b(a.og.result);else{a.og=a.Ku.open("H_"+a.NB,1);a.og.onupgradeneeded=a.$q;var d=a.og.onerror=function(){clearTimeout(a.Wv);a.pn=this.error;
406a.Xh.forEach(function(e){e(a.pn)});delete a.hf;delete a.Xh};a.Wv=setTimeout(function(){d.call({error:Error("DbOpenTimeoutError")})},a.Ux);a.og.onsuccess=function(){clearTimeout(a.Wv);a.hf?(a.hf.forEach(function(e){e(this.result)},this),delete a.hf,delete a.Xh):(delete a.og,delete a.pn, 407a.hf=[],a.Xh=[])};a.hf.push(b);c&&a.Xh.push(c)}}function lm(a,b,c){nm(a,function(d){d=d.transaction([a.yl],"readwrite");b(d.objectStore(a.yl))},c)}function mm(a,b,c){b&&(a.onsuccess=function(){b(this.result)});c&&(a.onerror=function(){c(this.error)})}function km(a){var b=Object.prototype.toString.call(a);return"[object Blob]"===b||"[object ArrayBuffer]"===b||lb(a)||ya(a)}function om(){im||(im=new gm);return im}t("H.util.IndexedDBStorage.getInstance",om); 408function hm(){return globalThis.indexedDB||globalThis.webkitIndexedDB||globalThis.mozIndexedDB||globalThis.msIndexedDB}function pm(){var a="";if(!fb(jm))if("file:"===window.location.protocol&&-1<navigator.userAgent.toLowerCase().indexOf("firefox")&&128<=window.location.href.length)jm=!1;else{try{var b=hm();a="H_TEST_DB";var c=b&&b.open(a,1)}catch(d){}jm=!!c&&null===c.onupgradeneeded;c&&b.deleteDatabase&&b.deleteDatabase(a)}return jm}t("H.util.IndexedDBStorage.isSupported",pm);function T(a){var b={};this.Fu=b.previousSibling=b.nextSibling=b;this.jD=new Te;T.g.constructor.call(this,a);a&&"objects"in a&&this.kd(a.objects)}u(T,N);t("H.map.Group",T);T.prototype.type=zh.GROUP;T.prototype.ti=function(a,b){this.lr=!0;a=T.g.ti.call(this,a,b);this.lr=!1;a&&this.forEach(qm,!0);return a};T.prototype.setProvider=T.prototype.ti;function qm(a,b,c){a.ti(c.D)}T.prototype.contains=function(a){var b=this===a;if(!b&&this.ah&&B(a,N))for(;!b&&a;)a===this?b=!0:a=a.Na;return b}; 409T.prototype.contains=T.prototype.contains;T.prototype.Hk=function(){this.qo=A;this.forEach(rm,!0)};T.prototype.resetZInfo=T.prototype.Hk;function rm(a){a.Hk()}T.prototype.lr=!1;T.prototype.ra=function(a){var b=T.g.ra.call(this,a);b&&!this.lr&&(this.Zt=a,this.forEach(sm,!0),delete this.Zt);return b};T.prototype.invalidate=T.prototype.ra;function sm(a,b,c){a.ra(c.Zt)} 410T.prototype.forEach=function(a,b,c){var d;if(this.ah){var e=this.Fu;var f=e.nextSibling;for(d=0;f!==e;){var g=f.nextSibling;a.call(c,f,d++,this);b&&B(f,T)&&f.forEach(a,b,c);f=g}}};T.prototype.forEach=T.prototype.forEach;T.prototype.bb=function(a){var b=[];this.forEach(tm,a,b);return b};T.prototype.getObjects=T.prototype.bb;T.prototype.C=function(){var a=null;this.ah&&this.forEach(function(b){b.C&&(b=b.C())&&(a=a?a.zd(b):b)});return a};T.prototype.getBoundingBox=T.prototype.C; 411function tm(a){this.push(a)}T.prototype.ah=0;T.prototype.Az=function(){return this.ah};T.prototype.getChildCount=T.prototype.Az; 412T.prototype.Y=function(a){var b=this.Fu,c=b.previousSibling;B(a,N,this.Y,0);if(a.contains(this))throw new Bb(this.Y,"The new object contains the parent group");var d=a.sm(!0);var e=a.Na;if(e!==this){if(e){e=a.previousSibling;var f=a.nextSibling;e.nextSibling=f;f.previousSibling=e}a.Na=this;N.g.ea.call(a,this);c.nextSibling=a;a.previousSibling=c;a.nextSibling=b;b.previousSibling=a;this.ah++}a.ds=this.jD.next();a.Hk();b=a.ti(this.D,this.Y);a.sm(!0)!==d&&a.ra(hh.VOLATILITY);b||a.ra(hh.Z_ORDER);return a}; 413T.prototype.addObject=T.prototype.Y;T.prototype.kd=function(a){var b;kb(a,this.kd,0);var c=a.length;for(b=0;b<c;b++)this.Y(a[b])};T.prototype.addObjects=T.prototype.kd;T.prototype.Oa=function(a){if(!a||a.Na!==this)throw new Bb(this.Oa,"object not found");var b=a.previousSibling,c=a.nextSibling;b.nextSibling=c;c.previousSibling=b;a.Na=null;N.g.ea.call(a,null);delete a.previousSibling;delete a.nextSibling;B(a.D,P)&&a.ti(null,this.Oa);this.ah--;return a};T.prototype.removeObject=T.prototype.Oa; 414T.prototype.vg=function(a){var b;kb(a,this.vg,0);var c=a.length;for(b=0;b<c;b++)this.Oa(a[b])};T.prototype.removeObjects=T.prototype.vg;T.prototype.ia=function(){var a=this.bb();this.vg(a)};T.prototype.removeAll=T.prototype.ia; 415T.prototype.ze=function(a){for(var b=this.bb(),c=0,d=b.length,e=[],f,g,h;c<d;c++)h=b[c],h instanceof T?(f=a?a(h.getData()):h.getData(),g=Ch(this,f,!!a),f={type:"Feature"},f.properties=g,h.gi&&(f.id=h.gi),f.geometry={},f.geometry.type="GeometryCollection",f.geometry.geometries=um(this,h.bb()),e.push(f)):e.push(h.ze(a));return{type:"FeatureCollection",features:e}};T.prototype.toGeoJSON=T.prototype.ze; 416function um(a,b){for(var c=0,d=b.length,e,f=[];c<d;c++)e=b[c],e=e instanceof T?{type:"GeometryCollection",geometries:um(a,e.bb())}:e instanceof Ji||e instanceof ci||e instanceof Bi||e instanceof Kh?e.V().ze():{type:"FeatureCollection",features:Ze},f.push(e);return f}T.prototype.P=function(){var a=T.g.P.call(this);a.type="Group";return a};T.prototype.forWorkerMessage=T.prototype.P;function vm(a,b,c,d,e,f){vm.g.constructor.call(this,isNaN(a)?15:a,b,c,d,e,f)}u(vm,Gc);vm.prototype.Ll=function(a){for(var b,c,d=this.head,e=a;e;){if(a=e.entries)if(b=a.length){if(2>b&&(c=e.parent)&&1===c.hb){c.removeChild(e);d===e&&(d=c);c.entries=a;e=a[0].node=c;continue}}else if(delete e.entries,c=e.parent)if(c.removeChild(e),d===e&&(d=c),1===c.hb){e=c.hb?c[0]||c[1]||c[2]||c[3]:null;continue}break}this.head!==d&&(this.head=d,this.ld())}; 417vm.prototype.Zd=function(a,b){if(Oc(this.root,a,b,a,b))return this.Vb(this.root,a,b,this.Ph);throw Error("Coordinates out of bounds");};vm.prototype.Vb=function(a,b,c,d){var e=a.entries;if(d)if(a.hb)e=this.Sj(a,b,c,d);else if(e){e=e[0];var f=a.th(+(e[1]>=a[8])|+(e[0]>=a[9])<<1);f.entries=a.entries;delete a.entries;e.node=f;this.ld(f);e=this.Sj(a,b,c,d)}else a.Qg(e=new wm(b,c)),this.ld(a),Jc(this,e,!0);else e||this.ld(a),a.Qg(e=new wm(b,c)),Jc(this,e,!0);return e}; 418vm.prototype.Sj=function(a,b,c,d){return this.Vb(a.th(+(b>=a[8])|+(c>=a[9])<<1),b,c,d-1)};function wm(a,b){this.id=Nc++;this[0]=b;this[1]=a}wm.prototype.Of=function(a){return this[a%2]};function xm(){this.Be=new vm(10,180,90,0,0,!0)}m=xm.prototype;m.jc=0;m.J=null;m.C=function(){var a=this.J,b;!a&&(b=Hc(this.Be))&&(this.J=a=new E(-b[0],b[3],-b[2],b[1]));return a};m.Zd=function(a){++this.jc;this.J=null;return this.Be.Zd(a.lng,-a.lat)};
418m.remove=function(a){if(a=this.Be.remove(a))--this.jc,this.J=null;return a};m.Fm=function(a,b,c){var d=this.Be,e=a.Oc(),f=a.Mc(),g=-e.lat;e=e.lng;var h=-f.lat;f=f.lng;return a.qc()?d.ob(-180,g,f,h,c,b).concat(d.ob(e,g,180,h,c,b)):d.ob(e,g,f,h,c,b)};function ym(a){var b;gb(this,ym);ym.g.constructor.call(this,a);this.Xf=a=[];for(b in zh)a[zh[b]]=new gh}u(ym,Q);t("H.map.provider.ObjectProvider",ym);ym.prototype.qr=We;ym.prototype.providesByViewport=ym.prototype.qr;ym.prototype.Nc=function(a){return this.Xf[a||zh.ANY]};ym.prototype.getInvalidations=ym.prototype.Nc;ym.prototype.Hh=function(a,b){if(b!==hh.NONE){var c=this.Xf[zh.ANY];var d=c.Md+1;c.update(d,b);c=this.Xf[a.type];c.update(d,b);a.Nc().update(d,b);this.jb(a)}}; 419ym.prototype.invalidateObject=ym.prototype.Hh;ym.prototype.requestOverlays=ym.prototype.xg;ym.prototype.requestSpatials=ym.prototype.Nn;ym.prototype.requestSpatialsByTile=ym.prototype.On;ym.prototype.vw=!1;ym.prototype.requestMarkers=ym.prototype.qe;ym.prototype.requestDomMarkers=ym.prototype.pe;function zm(a,b){var c,d="anonymous";this.uid=Am.next();zm.g.constructor.call(this);if(b){var e="size";if(e in b){var f=b[e];if(!f||isNaN(f.w)||isNaN(f.h))throw new C(zm,1,e);this.co=new Xh(f.w,f.h)}e="anchor";if(e in b){f=b[e];if(!f||isNaN(f.x)||isNaN(f.y))throw new C(zm,1,e);this.Db=new K(f.x,f.y)}e="hitArea";e in b&&(f=b[e],B(f,Gi,zm,1),this.Am=b[e]);e="asCanvas";e in b&&(c=b[e]);e="crossOrigin";e in b&&(d=b[e]);f=b.stickHeight;f===+f&&0<f&&(this.nD=f);e="stickColor";f=b[e];e in b&&lb(f)&&(this.mD= 420f)}a=new Yh(a,z(this.Wg,this),c,this.co,d);b=this.s=a.getState();0!==b?this.Wg(b,a):this.El=a}u(zm,I);t("H.map.Icon",zm);var Am=new Te;zm.State={ERROR:-1,LOADING:0,READY:1};zm.prototype.getState=function(){return this.s};zm.prototype.getState=zm.prototype.getState;zm.prototype.Wg=function(a,b){this.gb=b.getData();if(1===a){var c=this.co;c||(c=this.co=b.mc());this.Db||(this.Db=new K(c.w/2|0,c.h))}this.El&&(this.s=a,delete this.El,this.dispatchEvent("statechange"))};zm.prototype.gb=x; 421zm.prototype.Te=function(){return this.gb};zm.prototype.getBitmap=zm.prototype.Te;zm.prototype.mc=function(){return this.co||x};zm.prototype.getSize=zm.prototype.mc;zm.prototype.Db=x;zm.prototype.yp=function(){return this.Db};zm.prototype.getAnchor=zm.prototype.yp;zm.prototype.Am=x;zm.prototype.Vz=function(){return this.Am};zm.prototype.getHitArea=zm.prototype.Vz; 422zm.prototype.disposeInternal=function(){zm.g.disposeInternal.call(this);this.gb?(this.gb.removeAttribute("src"),delete this.gb):(this.El.cancel(),delete this.El)};function P(a){a=a||{};P.g.constructor.call(this,a);this.Bg=a=new T({min:a.min,max:a.max});a.D=this;a.ea(this);a.ra(hh.ADD);this.rk=new $c;this.xi=new $c;this.ek=new xm;this.jk=new $c;this.bm=new xm;this.Zm=new $c}u(P,ym);t("H.map.provider.LocalObjectProvider",P);P.prototype.getCapabilities=function(){return di.PROVIDES_BY_VIEWPORT|di.PROVIDES_WEBGL_RENDERABLE_OBJECTS|di.PROVIDES_DOM_MARKERS|di.CROP_LINES_BY_TILE}; 423P.prototype.mb=function(){if(!this.Ui&&(this.Ui=P.g.mb.call(this),this.Ui instanceof Xg)){var a=new ii(this.getCapabilities()|di.HAS_VOLATILE_DATA,this.uid+"_vol",this.min,this.max,this.Sc,this.tileSize);this.Ui.fk(a.Ke())}return this.Ui};P.prototype.getStyleInternal=P.prototype.mb;P.prototype.Xa=function(a,b){P.g.Xa.call(this,a,b);this.Ui=null};P.prototype.setStyleInternal=P.prototype.Xa;P.prototype.sd=function(){return this.Bg};P.prototype.getRootGroup=P.prototype.sd; 424P.prototype.Hh=function(a,b){b&hh.SPATIAL&&this.Y(a);P.g.Hh.call(this,a,b)};P.prototype.invalidateObject=P.prototype.Hh;P.prototype.Y=function(a){var b;B(a,N,this.Y,0);if(a.D!==this)throw new Bb(this.Y,"foreign object");this.Oa(a);var c=a.type;if(c===zh.MARKER)if((b=a.V())instanceof tc){var d=!0;c=this.ek}else c=this.jk;else c===zh.DOM_MARKER?(b=a.V())instanceof tc?(d=!0,c=this.bm):c=this.Zm:c=c===zh.OVERLAY?this.rk:this.xi;d=d?c.Zd(b):c.Mu(a.C());d.Cs=a;a.As=d}; 425P.prototype.Oa=function(a){var b;if(a)if(a.D!==this){if(B(a,N))throw new Bb(this.Oa,"foreign object");}else if(b=a.As){var c=a.type;c===zh.MARKER?this.ek.remove(b)||this.jk.remove(b):c===zh.DOM_MARKER?this.bm.remove(b)||this.Zm.remove(b):c===zh.OVERLAY?this.rk.remove(b):this.xi.remove(b);delete b.Cs;delete a.As}};P.prototype.removeObject=P.prototype.Oa; 426function Bm(a,b,c,d,e,f,g){g=g||[];if(b.jc)for(a=b!==a.ek&&b!==a.jk,e=!e,b=b.Fm(c,f,f),c=b.length,f=0;f<c;f++){var h=b[f].Cs;var k;if(k=void 0!==d){for(var l=Hb(d),n=h;(k=n.zb<=l&&n.Qc>=l)&&(n=n.Na););k=!k}k||!e&&!h.Wd(!0)||(a||1===h.kc().getState())&&g.push(h)}return g}P.prototype.sr=function(){return 0<this.rk.jc};P.prototype.providesOverlays=P.prototype.sr;P.prototype.xg=function(a,b,c){return Bm(this,this.rk,a,b,c,!1).filter(function(d){return d.Te()})};P.prototype.requestOverlays=P.prototype.xg; 427P.prototype.ne=function(){return 0<this.xi.jc};P.prototype.providesSpatials=P.prototype.ne;P.prototype.Nn=function(a,b,c){return Bm(this,this.xi,a,b,c,!1)};P.prototype.requestSpatials=P.prototype.Nn;P.prototype.On=function(a,b){return Bm(this,this.xi,a.nm(),a.zL,b,!1)};P.prototype.requestSpatialsByTile=P.prototype.On;P.prototype.Wc=function(){return 0<this.ek.jc+this.jk.jc};P.prototype.providesMarkers=P.prototype.Wc;P.prototype.qe=function(a,b,c){return Cm(this,a,b,c,!1)}; 428P.prototype.requestMarkers=P.prototype.qe;function Cm(a,b,c,d,e){var f=Bm(a,a.ek,b,c,d,e);Bm(a,a.jk,b,c,d,e,f);return f}P.prototype.Vc=function(){return 0<this.bm.jc+this.Zm.jc};P.prototype.providesDomMarkers=P.prototype.Vc;P.prototype.pe=function(a,b,c){return Dm(this,a,b,c,!1)};
428P.prototype.requestDomMarkers=P.prototype.pe;function Dm(a,b,c,d,e){var f=Bm(a,a.bm,b,c,d,e);Bm(a,a.Zm,b,c,d,e,f);return f} 429function Em(a,b,c){var d=c.V(),e,f=Fm.bind(null,a);a=Gm.bind(null,a);B(c,Bi)?e=B(d,J)?f(d):d.ha.some(f):B(c,Kh)?e=B(d,L)?a(d):d.ha.some(a):B(c,ci)&&(e=a(Cf(d)));e&&b.push(c)}function Fm(a,b){a:{var c=b.S;var d=Hf(a,b);if(!d){b=b.S.length;for(var e=0;e<b;e+=3)if(Ff(a,c[e],c[e+1])){a=!0;break a}}a=d}return a}function Gm(a,b){return If(a,b)} 430function Hm(a,b,c){for(var d=a.length;d--;){var e=a[d],f=e.V();if(B(f,Nf)){f=f.ha;for(var g=f.length,h;g--;)if(h=f[g],Ff(b,h.lat,h.lng)){c.push(e);break}}else Ff(b,f.lat,f.lng)&&c.push(e)}} 431P.prototype.bb=function(a,b,c,d,e){var f=this,g=a.C(),h=[],k=me(),l=1;if(g)for(;l&zh.ANY;){if(l&d)switch(l){case zh.MARKER:k=k.then(function(){return Cm(f,g,c,b,!0)}).then(function(n){return Hm(n,a,h)});break;case zh.DOM_MARKER:k=k.then(function(){return Dm(f,g,c,b,!0)}).then(function(n){return Hm(n,a,h)});break;case zh.SPATIAL:k=k.then(function(){return Bm(f,f.xi,g,c,b,!0)}).then(function(n){n.forEach(Em.bind(null,a,h))});break;case zh.OVERLAY:k=k.then(function(){return Bm(f,f.rk,g,c,b,!0)}).then(function(n){n.forEach(Em.bind(null, 432a,h))})}l<<=1}k.then(function(){return e(h)})};P.prototype.Pf=function(a,b,c){c=c||$e;var d=c.zoom,e=c.visiblesOnly;c=c.types;var f=zh.ANY;B(a,L,this.Pf,0,"area");ib(b,"Function",this.Pf,1,"callback");ib(d,"Number",this.Pf,2,"options");this.bb(a,fb(e)?!!e:!0,d,fb(c)?c&f:f,b)};P.prototype.getObjectsWithin=P.prototype.Pf;P.prototype.disposeInternal=function(){P.g.disposeInternal.call(this);this.Bg.ia()};function U(a,b,c){var d={};if(!(a instanceof HTMLElement))throw new C(U,0);U.g.constructor.call(this);this.Fa=Im(c,U);this.xa=c=new Bj;this.Fq=!1;c.addEventListener(c.j.Oi,this.Sv,!1,this);if(!B(a,Element))throw new C(U,0,a);c=this.G=a.ownerDocument.createElement("div");var e=c.style;e.position="relative";e.height=c.style.width="100%";e.overflow="hidden";e.webkitTapHighlightColor="transparent";"transparent"!==e.webkitTapHighlightColor&&(e.webkitTapHighlightColor="rgba(0,0,0,0)");a.appendChild(c); 433this.sa=new Vi(this.G,this.Fa);this.sa.addEventListener(this.sa.j.Oi,this.Sv,!1,this);a=this.O=new Pj(this.Fa.layers);a.addEventListener(a.j.Ni,this.Rq,!1,this);a.addEventListener(a.j.Ki,this.Rq,!1,this);a.addEventListener(a.j.Mi,this.Rq,!1,this);!this.qb&&Jm(this);this.pa=null;this.O.add(b,0);this.Ca=this.Yo(null!=this.Fa.engineType?this.Fa.engineType:li,this.Fa);this.jp=z(this.jp,this);b=this.Fa.imprint;if(b!==A&&"object"!==typeof b)throw new C(U,1,"imprint");this.Yd=null===b?b:new Zi(this,b);b= 434this.Fa.autoColor;this.ht=b===A||!!b;Km(this);(b=this.Fa.zoom)&&(d.zoom=b);(b=this.Fa.bounds)&&(d.bounds=b);(b=this.Fa.center)&&(d.position=b);this.xa.ad(d)}u(U,I);t("H.Map",U);U.prototype.draggable=U.prototype.draggable=!1;function Im(a,b){if(a){var c=a.pixelRatio;if(c===A)a.pixelRatio=Ke();else if(!(0<c))throw new C(b,0,"pixelRatio: "+c);}else a={},a.pixelRatio=Ke();a.renderBaseBackground||(a.renderBaseBackground={lower:3,higher:2});return a}U.prototype.dy=333; 435U.prototype.disposeInternal=function(){this.ht=!1;this.Yd&&this.Yd.l();this.Ca.dispose();this.xa.l();this.sa.l();this.qb.l();this.sc.l();this.O.l();var a=this.G;a.parentNode.removeChild(a);delete this.G;I.prototype.disposeInternal.call(this)};U.prototype.B=function(){return this.G};U.prototype.getElement=U.prototype.B;U.prototype.lb=function(){return this.Fa.pixelRatio};U.prototype.getPixelRatio=U.prototype.lb;function Km(a){a.Yd&&a.ht&&a.Yd.Ur({invert:a.pa&&a.pa.Ny})} 436U.prototype.Rq=function(a){var b=a.added,c=a.removed;b&&b.D&&b.D.ea(this);c&&c.D&&c.D.ea(null);c===this.qb&&(delete this.qb,delete this.sc);c===this.pa&&(this.pa=null);0===a.idx&&(this.dispatchEvent(new ji(this.j.xl,this.pa=a.type!==this.O.j.Mi?b:0<this.O.aa.length?this.O.get(0):x,a.type!==this.O.j.Ki?c:1<this.O.aa.length?this.O.get(1):x)),Km(this))}; 437U.prototype.Sv=function(a){a.modifiers&&(this.Fq||(Lm(this,"start"),this.Fq=!0),Lm(this,"",a),this.uv&&globalThis.clearTimeout(this.uv),this.uv=globalThis.setTimeout(this.jp,this.dy))};function Lm(a,b,c){a.dispatchEvent(c?new Ni(a.j.Ns,c.newValue,c.oldValue,c.modifiers):a.j.Ns+b)}U.prototype.jp=function(){Lm(this,"end");this.Fq=!1};U.prototype.Zn=function(a,b){this.Ca.getCapabilities().lookAt&&this.xa.ad({position:a},!!b);return this};U.prototype.setCenter=U.prototype.Zn; 438U.prototype.wb=function(){var a=this.xa.Ib();return a?a.position:x};U.prototype.getCenter=U.prototype.wb;U.prototype.Vk=function(a,b){this.xa.Vk(a,!!b);return this};U.prototype.setZoom=U.prototype.Vk;U.prototype.Ub=function(){return this.xa.Ub()};U.prototype.getZoom=U.prototype.Ub;U.prototype.Ng=function(a,b,c){this.Ca.zoomAt(a,b,c)};U.prototype.zoomAt=U.prototype.Ng;U.prototype.QA=function(){return this.sa};U.prototype.getViewPort=U.prototype.QA;U.prototype.PA=function(){return this.xa}; 439U.prototype.getViewModel=U.prototype.PA;U.prototype.dA=function(){return this.O};U.prototype.getLayers=U.prototype.dA;U.prototype.Yz=function(){return this.Yd};
439U.prototype.getImprint=U.prototype.Yz; 440U.prototype.capture=function(a,b,c,d,e,f){function g(G,O){q?G.cancel():(w.save(),O.capture(v,n,function(V){w.restore();G.done(V)},function(V){G.done(null,V);h(null)}))}function h(G){q||(q=!0,a(G))}var k=this.Ca,l=k.getCapabilities(),n=this.Fa.pixelRatio,p=this.sa,q=!1,r=this,v,w;if(!db(a))throw new C(this.capture,0,a);c=c||0;d=d||0;e=e||p.width;f=f||p.height;var y=Fb(0,Eb(c,e));var F=Fb(0,Eb(d,f));c=Eb(p.width,Fb(c,e));d=Eb(p.height,Fb(d,f));l.capture?k.capture(y,F,c,d).then(function(G){var O=r.Yd, 441V=b||[];v=G;w=v.getContext("2d");v.style.width=v.width/n+"px";v.style.height=v.height/n+"px";var Ua=new pl(10,g);V=V.concat(O).filter(function(aa){return db(aa&&aa.capture)});V.length?(G=V.pop(),V.forEach(function(aa){Ua.push(aa,Ye)}),Ua.push(G,z(h,r,v)),Ua.An()):h(v)},function(){h(x)}):a(null)};U.prototype.capture=U.prototype.capture;U.prototype.Lz=function(){return this.Ca};U.prototype.getEngine=U.prototype.Lz; 442U.prototype.Yo=function(a,b){b=b?Im(b,this.Yo):this.Fa;Km(this);if(a===mi.P2D)return new globalThis.H.map.render.p2d.RenderEngine(this.sa,this.xa,this.O,b);if(a===mi.WEBGL)return new S(this.sa,this.xa,this.O,b);if(a===mi.HARP)return new globalThis.H.map.render.harp.RenderEngine(this.sa,this.xa,this.O,b);throw new C(this.Yo,0,a);}; 443U.prototype.al=function(a,b,c,d,e){b=fb(b)?B(b,E,this.al,1,b)&&b:this.xa.Ib().bounds.C();e=e||this.pa;if(!B(e,Wi))throw new C(this.al,4);var f=e.D,g=this.lb(),h=e.tileSize;2<=g&&256<h&&f instanceof Tk&&(h/=2);g=this.Ub();h=Math.log2(h)-8;c=fb(c)?+c:g;d=fb(d)?+d:g;if(!(c<=d))throw new C(this.al,A,"!(min <= max)");g=f.min;var k=f.max,l=this.Ca.type===mi.WEBGL?Hb:Gb;c=gc(l(c)-h,g,k);d=gc(l(d)-h,g,k);if(!(f&&B(f,R)&&pm()&&f.Vi()))throw new Bb(this.al,"Storing is not supported");return new Si(e,f,b,c, 444d,a)};U.prototype.storeContent=U.prototype.al;function Mm(a){Pi.call(this,a)}u(Mm,Pi);Mm.prototype.mC=function(){Ri(this,2)};Mm.prototype.lC=function(){Ri(this,4)};U.prototype.By=function(a){a=new Mm(a);om().clear(z(a.mC,a),z(a.lC,a));return a};U.prototype.clearContent=U.prototype.By;U.prototype.Bl=function(a,b){var c=this.O,d=c.indexOf(a),e=b!==+b;b=e?c.aa.length-1:b;0>d?c.add(a,b):d-b&&(c.Ed(d),c.add(a,e?b-1:b));return this};U.prototype.addLayer=U.prototype.Bl; 445U.prototype.hi=function(a){var b=this.O.indexOf(a);a!==this.pa&&a!==this.qb&&-1!==b&&this.O.Ed(b);return this};U.prototype.removeLayer=U.prototype.hi;U.prototype.Dg=function(a){this.pa!==a&&(this.O.aa.length&&this.O.get(0)!==this.qb?this.O.set(0,a):this.O.add(a,0),this.pa=a);return this};U.prototype.setBaseLayer=U.prototype.Dg;U.prototype.xz=function(){return this.pa};U.prototype.getBaseLayer=U.prototype.xz; 446U.prototype.La=function(a){if(!uc(a))throw new C(this.La,0,a);return(a=this.Ca.geoToScreen(a))?pf(a):x};U.prototype.geoToScreen=U.prototype.La;U.prototype.Wa=function(a,b){var c;if(c=+D(a)||2*+D(b))throw new C(this.Wa,c-1,arguments[c-1]);return(c=this.Ca.screenToGeo(a,b))?vc(c):x};U.prototype.screenToGeo=U.prototype.Wa;U.prototype.Un=function(a,b){return this.Ca.screenToLookAtData(a,b)};U.prototype.screenToLookAtData=U.prototype.Un; 447U.prototype.Y=function(a){if(!B(a,N))throw new C(this.Y,0,a);!this.qb&&Jm(this);this.sc.sd().Y(a);return a};U.prototype.addObject=U.prototype.Y;U.prototype.Oa=function(a){if(!B(a,N))throw new C(this.Oa,0,a);!this.qb&&Jm(this);this.sc.sd().Oa(a);return a};U.prototype.removeObject=U.prototype.Oa;U.prototype.bb=function(a){!this.qb&&Jm(this);return this.sc.sd().bb(a)};U.prototype.getObjects=U.prototype.bb; 448U.prototype.kd=function(a){var b;kb(a,this.kd,0,a);!this.qb&&Jm(this);var c=a.length;for(b=0;b<c;b++)this.Y(a[b]);return this};U.prototype.addObjects=U.prototype.kd;U.prototype.vg=function(a){var b;kb(a,this.vg,0,a);!this.qb&&Jm(this);var c=a.length;for(b=0;b<c;b++)this.Oa(a[b]);return this};U.prototype.removeObjects=U.prototype.vg;U.prototype.Bh=function(a,b,c){var d;if(d=+D(a)||2*+D(b))throw new C(this.Bh,d-1,arguments[d-1]);this.Ca.getObjectsAt(a,b,!0,function(e){c(e[0])})}; 449U.prototype.getObjectAt=U.prototype.Bh;U.prototype.Ma=function(a,b,c,d){var e;if(e=+D(a)||2*+D(b))throw new C(this.Bh,e-1,arguments[e-1]);this.Ca.getObjectsAt(a,b,!1,c,!!d)};U.prototype.getObjectsAt=U.prototype.Ma;U.prototype.Pf=function(a,b,c){c=c||{};var d=c.zoom;c.zoom=fb(d)?d:this.xa.Ub();this.sc.Pf(a,b,c)};U.prototype.getObjectsWithin=U.prototype.Pf;function Jm(a){a.sc=new P({max:24,engineType:a.Fa.engineType});a.qb=new tl(a.sc,a.Fa);a.O.add(a.qb)} 450var Nm=ek.HARP,mi={P2D:ek.P2D,WEBGL:ek.WEBGL,HARP:Nm};U.EngineType=mi;U.prototype.j={RD:"mapviewchangestart",Ns:"mapviewchange",Os:"mapviewchangeend",xl:"baselayerchange"};
450function Om(){Om.g.constructor.call(this);this.hd=Pm(this);this.Cn=Za();this.nn=z(this.nn,this);this.hd.addEventListener("message",this.nn);this.el={}}u(Om,I);Om.prototype.disposeInternal=function(){this.hd.terminate()};Om.prototype.rw=function(a){var b=a.type,c=!!this.Cn[b],d=a.data,e=Qm++,f=d&&d.DD?d.DD:A,g=!0;c?(this.el[e]=a,Rm(this,b,e,d&&d.message,f)):(a.reject(new C(this.rw,0,"processor_not_found")),g=!1);return g}; 451Om.prototype.nn=function(a){a=a.data;var b=this.el[a.taskId],c=a.taskId,d=a.data,e=this;if(2===a.type)(new qg("arraybuffer",d)).then(function(f){return f.arrayBuffer()}).then(function(f){e.hd.postMessage(["3",c,[f]],[f])},function(){e.hd.postMessage(["3",c,[null,"ERROR"]])});else{if(b){switch(a.type){case 1:b.resolve(d);break;case 0:b.reject(d)}delete this.el[c]}this.dispatchEvent(new pd(this.j.IDLE))}};var Qm=0;function Sm(a,b,c){var d=Qm++,e;a.el[d]=e=oe();Rm(a,b,d,c);return e.promise} 452function Rm(a,b,c,d,e){d===A||Ca(d)||(d=[d]);try{a.hd.postMessage([b,c,d],e)}catch(f){a=a.el[c],a.reject(f.message)}}Om.prototype.j={IDLE:"idle",Js:"error"};Om.prototype.ky=function(a,b){var c=this.bz||(this.bz=new pd(this.j.Js));c.data=b;delete this.Cn[a];this.dispatchEvent(c)};Om.prototype.importScripts=function(a){Sm(this,"0",a)}; 453function Pm(a){var b=globalThis.H.__bootstrap__;b=db(b)?(""+b).replace(/^[^{]+{((.|[\r\n])+?)}\s*$/,"$1"):""+b;if(globalThis.Worker&&globalThis.URL)try{var c=new globalThis.Worker(globalThis.URL.createObjectURL(ff(b,"application/javascript")))}catch(d){}c||(a=new Tm(a),function(){eval("var self = arguments[0];"+b)}(a),c=new Um(a));return c}function Um(a){I.call(this);this.hd=a}u(Um,I);Um.prototype.postMessage=function(a){globalThis.setTimeout(z(this.vC,this,a),0)}; 454Um.prototype.vC=function(a){var b=new pd("message");b.data=a;this.hd.dispatchEvent(b)};Um.prototype.terminate=function(){this.hd.l();this.l()};function Tm(a){I.call(this);this.hd=a;this.addEventListener=z(this.addEventListener,this);this.removeEventListener=z(this.removeEventListener,this);this.postMessage=z(this.postMessage,this);this.eval=z(eval,this)}u(Tm,I);Tm.prototype.postMessage=function(a){var b=new pd("message");b.data=a;globalThis.setTimeout(z(this.hd.nn,this.hd,b),0)};function Vm(){var a=Wm;a||(a=Wm=this,I.call(a),this.Ag());return a}var Wm;u(Vm,I);m=Vm.prototype;m.disposeInternal=function(){Vm.g.disposeInternal.call(this);this.Ag()};m.Ag=function(){var a=this.oo,b;if(a)for(b=a.length;b--;)a[b].l();this.oo=[];rb(this.oo);this.Dm={};this.tw=Za()}; 455m.Eo=function(a){var b;a=a.type;if(b=this.tw[a]){var c=this.oo;var d=c[0];d||(d=c[0]=new Om,this.bc(Ja(dd,d)),Sa(this.Dm)||d.importScripts(globalThis.Object.keys(this.Dm)));c=d;c.Cn[a]||(c.Cn[a]=b,Sm(c,"1",[a,db(b)?b+"":b]).then(Ye,z(c.ky,c,a)))}else throw new Bb(this.Eo,'Unknown type "'+a+'"');return d};m.$l=function(){};m.registerProcessor=function(a,b){var c=this.tw,d=c[a];if(d){if(b!==d)throw new Bb(this.registerProcessor,'Type "'+a+'" is already registered');}else c[a]=b}; 456m.importScripts=function(a){[].concat(a).forEach(function(b){this.Dm[b]||(this.Dm[b]=!0,this.oo.forEach(function(c){c.importScripts(b)}))},this)};function Xm(a,b,c){Ce.call(this,a,b,c)}var Ym;u(Xm,Ce);Xm.prototype.Fp=function(){Ym||(Ym=new Fe(new Vm));return Ym};Xm.prototype.Wi=function(){};Xm.prototype.Rt=function(a){return a.rw(this)};function Zm(a,b){Zm.g.constructor.call(this,a,b)}u(Zm,Wi);t("H.map.layer.MarkerTileLayer",Zm);var $m={markers:[],total:0,requested:0};function an(a,b,c,d,e){var f=Hb(c);a.pixelProjection.Va(f);b=a.Fh(a.Bj(b),f);c=a.Oj(b,b.left>b.right,~~c,d,e);a=c.tiles;c=c.total;d=a.length;e=[];var g;for(g=0;g<d;g++)for(b=a[g],f=b.data.length;f--;)e.push(b.data[f]);return{markers:e,total:a.length,requested:c}}Zm.prototype.qe=function(a,b,c,d){return this.D.providesDomMarkers()?$m:an(this,a,b,c,d)}; 457Zm.prototype.requestMarkers=Zm.prototype.qe;Zm.prototype.pe=function(a,b,c,d){return this.D.providesDomMarkers()?an(this,a,b,c,d):$m};Zm.prototype.requestDomMarkers=Zm.prototype.pe;function bn(a,b){bn.g.constructor.call(this,a,b)}u(bn,Ji);t("H.map.Marker",bn);bn.prototype.type=zh.MARKER;bn.prototype.ro=1;
457bn.prototype.ra=function(a){if(a!==hh.VISUAL||1===this.nw||1===this.icon.getState())var b=bn.g.ra.call(this,a);return b||!1};bn.prototype.invalidate=bn.prototype.ra;m=bn.prototype;m.nw=0;m.Zu=function(a){return B(a,zm)};m.qq=!1;m.Ov=function(){this.ra(hh.VISUAL)}; 458m.we=function(a){var b=this.icon;this.qq&&(b.removeEventListener("statechange",this.Ov,!1,this),delete this.qq);b&&(this.nw=b.getState());bn.g.we.call(this,a);0===a.getState()&&(this.qq=!0,Ed(a,"statechange",this.Ov,!1,this));return this};bn.prototype.setIcon=bn.prototype.we;bn.prototype.tt=function(a){return new zm(a.svg,a)};bn.prototype.P=function(){var a=this.getIcon(),b=a.nD||0,c=bn.g.forWorkerMessage.call(this),d=c.properties.icon;d&&0<b&&Wa(d,{stick_color:a.mD,stick_height:b});return c}; 459bn.prototype.forWorkerMessage=bn.prototype.P;t("H.buildInfo",function(){return Wh("H-core","1.61.0","3b08619",{region:"row"})});var li=mi.WEBGL,cn,dn="maps".concat("js-"),en,fn,gn,hn,jn;en=globalThis.document.querySelector('script[src*="'+dn+'"]');if(!en)for(fn=globalThis.document.getElementsByTagName("script"),hn=new RegExp("^.*"+dn),jn=0,gn=fn.length;jn<gn;jn++)if(hn.test(fn[jn].src)){en=fn[jn];break}cn=en?en.src.replace(/\/[^\/]*$/,"/"):"";t("H.getScriptPath",function(){return cn}); 460function kn(){var a=decodeURIComponent(cn);if(a){a="/"===a[a.length-1]?a.substring(0,a.length-1):a;var b=globalThis.document,c="";b?(b=b.createElement("a"),b.href=a,c=b.href):/[\w]+:\/\//.test(a)&&(c=a);a=new URL(c);a.pathname+="/"===a.pathname[a.pathname.length-1]?"styles":"/styles";a=a.toString()}else a="https://js.api.here.com/v3/3.1.61.0/styles";return a}t("H.getStylePath",kn); 461 462function ln(a){var b=a.ownerDocument;b=b.documentElement||b.body.parentNode||b.body;try{var c=a.getBoundingClientRect()}catch(d){c={top:0,right:0,bottom:0,left:0,height:0,width:0}}return{x:c.left+("number"===typeof window.pageXOffset?window.pageXOffset:b.scrollLeft),y:c.top+("number"===typeof window.pageYOffset?window.pageYOffset:b.scrollTop)}};function mn(a,b,c,d,e,f,g){mn.g.constructor.call(this,a);this.pointers=b;this.changedPointers=c;this.targetPointers=d;this.currentPointer=e;this.originalEvent=g;this.target=f}u(mn,pd);t("H.mapevents.Event",mn);function nn(a,b){b=void 0===b?{}:b;var c;nn.g.constructor.call(this);if(-1!==on.indexOf(a))throw new C(nn,0,"events are already used");this.v=c=a.v;this.sv=a;on.push(a);c.draggable=!0;this.ua=b.kinetics||{duration:600,ease:jj};this.MB=b.modifierKey||"Alt";this.enable(b.enabled);this.Fi=c.sa;this.sl=this.Fi.element;this.Rm=0;c.addEventListener("dragstart",this.Cd,!1,this);c.addEventListener("drag",this.ig,!1,this);c.addEventListener("dragend",this.ef,!0,this);c.addEventListener("wheel",this.Uv,!1, 463this);c.addEventListener("dbltap",this.Mv,!1,this);c.addEventListener("pointermove",this.ie,!1,this);Dd(this.sl,"contextmenu",this.bn,!1,this);a.bc(this.l,this)}u(nn,ed);t("H.mapevents.Behavior",nn);var on=[];rb(on);nn.prototype.Rb=0;var pn={PANNING:1,PINCH_ZOOM:2,WHEEL_ZOOM:4,DBL_TAP_ZOOM:8,FRACTIONAL_ZOOM:16,TILT:32,HEADING:64};nn.Feature=pn;var qn=pn.PANNING,rn=pn.PINCH_ZOOM,sn=pn.WHEEL_ZOOM,tn=pn.DBL_TAP_ZOOM,un=pn.FRACTIONAL_ZOOM,vn=pn.TILT,wn=pn.HEADING,xn=qn|rn|sn|tn|un|vn|wn; 464nn.DRAGGING=qn;nn.WHEELZOOM=sn;nn.DBLTAPZOOM=tn;nn.FRACTIONALZOOM=un;function yn(a,b){if(a!==+a||a%1||0>a||2147483647<a)throw new C(b,0,"integer in range [0...0x7FFFFFFF] required");}nn.prototype.disable=function(a){var b=this.Rb;a!==A?(yn(a,this.disable),b^=b&a):b=0;this.Fi.endInteraction(!0);this.Rb=b;this.v.draggable=0<(b&(qn|vn|wn|rn))};nn.prototype.disable=nn.prototype.disable; 465nn.prototype.enable=function(a){var b=this.Rb;a!==A?(yn(a,this.enable),b|=a&xn):b=xn;this.Rb=b;this.v.draggable=0<(b&(qn|vn|wn|rn))};nn.prototype.enable=nn.prototype.enable;nn.prototype.isEnabled=function(a){yn(a,this.isEnabled);return a===(this.Rb&a)};nn.prototype.isEnabled=nn.prototype.isEnabled; 466function zn(a,b,c){var d="touch"===b.currentPointer.type,e=0,f;if(f=!d){f=a.MB;var g=b.originalEvent;f=g.getModifierState?g.getModifierState(f):!!g[f.replace(/^Control$/,"ctrl").toLowerCase()+"Key"]}f?e|=vn|wn:(e|=qn,d&&(b=b.pointers,2===b.length&&(e|=rn|wn,c?55>Jb(b[0].viewportY-b[1].viewportY)&&(e|=vn):a.iq&Yj.TILT&&(e|=vn))));e&=a.Rb;return(e&vn?Yj.TILT:0)|(e&wn?Yj.HEADING:0)|(e&rn?Yj.ZOOM:0)|(e&qn?Yj.COORD:0)} 467function An(a){var b=a.pointers;a=b[0];b=b[1];a=[a.viewportX,a.viewportY];b&&a.push(b.viewportX,b.viewportY);return a}m=nn.prototype;m.iq=0;m.Cd=function(a){var b=zn(this,a,!0);if(this.iq=b){var c=this.Fi;a=An(a);c.startInteraction(b,this.ua);c.interaction.apply(c,a);if(this.Rb&sn&&!(this.Rb&un)&&(b=a[0],c=a[1],this.Rm)){a=this.v.Ub();var d=(0>this.Rm?Ib:Hb)(a);a!==d&&(this.Rm=0,this.Ii(a,d,b,c))}}}; 468m.ig=function(a){var b=zn(this,a,!1);if(b!==this.iq)"pointerout"!==a.originalEvent.type&&"pointerover"!==a.originalEvent.type&&(this.ef(a),this.Cd(a));else if(b){b=this.Fi;var c=An(a);b.interaction.apply(b,c);a.originalEvent.preventDefault()}};m.ef=function(a){zn(this,a,!1)&&this.Fi.endInteraction(!this.ua)}; 469m.Ii=function(a,b,c,d){var e=this.v.xa;if(isNaN(+a))throw Error("start zoom needs to be a number");if(isNaN(+b))throw Error("to zoom needs to be a number");0!==+b-+a&&(e.startControl(null,c,d),e.control(0,0,6,0,0,0),e.endControl(!0,function(f){f.zoom=b}))};
469m.Uv=function(a){if(!a.defaultPrevented&&this.Rb&sn){var b=a.delta;var c=this.v.Ub();var d=this.v;var e=d.Ca.type;d=this.Rb&un?c-b:(0>-b?Ib:Hb)(c)-b;if(e===mi.P2D||e===mi.WEBGL||e===mi.HARP)this.Ii(c,d,a.viewportX,a.viewportY),this.Rm=b;a.preventDefault()}}; 470m.ie=function(){};m.Mv=function(a){var b=a.currentPointer,c=this.v.Ub(),d=a.currentPointer.type,e=this.v.Ca.type;(e===mi.P2D||e===mi.WEBGL||e===mi.HARP)&&this.Rb&tn&&(a="mouse"===d?0===a.originalEvent.button?-1:1:0<a.pointers.length?1:-1,a=this.Rb&un?c-a:(0>-a?Ib:Hb)(c)-a,this.Ii(c,a,b.viewportX,b.viewportY))};m.bn=function(a){return this.Rb&tn?(a.preventDefault(),!1):!0}; 471m.l=function(){var a=this.v;a&&(a.draggable=!1,a.removeEventListener("dragstart",this.Cd,!1,this),a.removeEventListener("drag",this.ig,!1,this),a.removeEventListener("dragend",this.ef,!0,this),a.removeEventListener("wheel",this.Uv,!1,this),a.removeEventListener("dbltap",this.Mv,!1,this),a.removeEventListener("pointermove",this.ie,!1,this),delete this.v);this.sl&&(this.sl.style.msTouchAction="",Ld(this.sl,"contextmenu",this.bn,!1,this),delete this.sl);delete this.Fi;delete this.ua;on.splice(on.indexOf(this.sv), 4721);delete this.sv;ed.prototype.l.call(this)};nn.prototype.dispose=nn.prototype.l;function Bn(a,b,c,d,e){Bn.g.constructor.call(this,"wheel");this.delta=a;this.viewportX=b;this.viewportY=c;this.target=d;this.originalEvent=e}u(Bn,pd);t("H.mapevents.WheelEvent",Bn);function Cn(a,b,c,d,e,f){if(isNaN(a))throw Error("x needs to be a number");if(isNaN(b))throw Error("y needs to be a number");if(isNaN(c))throw Error("pointer must have an id");this.viewportX=a;this.viewportY=b;this.target=null;this.id=c;this.type=d;this.dragTarget=null;this.button=fb(e)?e:-1;this.buttons=fb(f)?f:0;this.Pm=this.button}t("H.mapevents.Pointer",Cn); 473function Dn(a,b,c){if(isNaN(b))throw Error("x needs to be a number");if(isNaN(c))throw Error("y needs to be a number");a.viewportX=b;a.viewportY=c}Cn.prototype.aA=function(){return this.Pm};Cn.prototype.getLastChangedButton=Cn.prototype.aA;function En(a,b){a.Pm=b;a.buttons|=Fn[+b]||0}function Gn(a,b){a.Pm=b;a.buttons&=~(Fn[+b]||0)}var Fn=[1,4,2],Hn={NONE:-1,LEFT:0,MIDDLE:1,RIGHT:2};Cn.Button=Hn;function In(a){this.Ea=a instanceof Array?a.slice(0):[]}m=In.prototype;m.clear=function(){this.Ea.splice(0,this.Ea.length)};m.length=function(){return this.Ea.length};m.item=function(a){return this.Ea[a]||null};m.indexOf=function(a){for(var b=this.Ea.length;b--;)if(this.Ea[b].id===a)return b;return-1};function Jn(a,b){b=a.indexOf(b);return-1!==b?a.Ea[b]:null}m.remove=function(a){a=this.indexOf(a);return-1!==a?this.Ea.splice(a,1)[0]:null}; 474function Kn(a,b){for(var c=a.Ea.length,d=[];c--;)a.Ea[c].type!==b&&d.push(a.Ea[c]);a.Ea=d}function Ln(a,b){for(var c=a.Ea.length;c--;)if(a.Ea[c].dragTarget===b)return!0;return!1}m.push=function(a){if(a instanceof Cn)return this.Ea.push(a);throw Error("list needs a pointer");};m.Ta=function(){return this.Ea};m.clone=function(){return new In(this.Ea)};function Mn(a,b,c){c=c||{};if(!(a instanceof U))throw Error("events: map instance required");if(!(b instanceof Array))throw Error("events: map array required");ed.call(this);this.fp=c.fp||300;this.zt=c.zt||50;this.ox=c.ox||50;this.px=c.px||500;this.Dq=c.Dq||900;this.Cq=c.Cq||8;this.map=a;this.za=this.map.sa;this.element=this.za.element;this.np=b;this.pointers=new In;this.changedPointers=new In;this.$f={};this.Ka=null;this.em=!0;this.Nk={};this.sf={};this.bk=null;this.mj=z(this.mj,this);this.Qt={pointerdown:this.Vy, 475pointermove:this.Wy,pointerup:this.Xy,pointercancel:this.Uy};Nn(this)}u(Mn,ed);function Nn(a,b){var c,d=a.np.length;for(c=0;c<d;c++){var e=a.np[c];var f=e.listener;"function"===typeof f&&(b?(e.target||a.element).removeEventListener(e.$a,f):(e.target||a.element).addEventListener(e.$a,f))}} 476function On(a,b,c){var d;if("function"===typeof a.Qt[b]){"pointermove"!==b&&(a.em=!0);var e=0;for(d=a.changedPointers.length();e<d;e++){var f=a.changedPointers.item(e);a.element.contains(c.composedPath()[0])?Pn(a,f,a.It.bind(a,c,b,f)):a.It(c,b,f,null)}}a.changedPointers.clear()}m=Mn.prototype;m.It=function(a,b,c,d){Qn(c.id,this.Nk);this.Qt[b].call(this,c,d,a)}; 477function Pn(a,b,c){if(a.Ka===b)c(b.target);else{var d=a.za;var e=b.viewportX;b=b.viewportY;if(0>e||0>b||e>=d.width||b>=d.height)c(x);else{var f=a.map;f.Bh(e,b,function(g){c(g||f)})}}} 478m.Xy=function(a,b,c){var d=a.id;a.target=b;Rn(this,a,c);Sn(this,b,"pointerup",c,a);"mouse"!==a.type&&Sn(this,b,"pointerleave",c,a);b=this.$f[a.id];var e={x:a.viewportX,y:a.viewportY},f=c.timeStamp,g=a.target,h=this.bk;b&&b.target===g&&b.vk.kb(e)<this.ox&&f-b.ps<this.px?(Sn(this,g,"tap",c,a),h&&h.target===g&&f-h.ps<this.fp?h.vk.kb({x:a.viewportX,y:a.viewportY})<this.zt&&(Sn(this,g,"dbltap",c,a),this.bk=null):this.bk={target:g,vk:new K(a.viewportX,a.viewportY),ps:c.timeStamp}):this.bk=null;this.$f= 479{};Qn(d,this.sf)};function Rn(a,b,c){b===a.Ka&&(Sn(a,b.dragTarget,"dragend",c,b),a.Ka=null,Qn(b.id,a.Nk));b.dragTarget=null}m.mj=function(a,b){var c=this;Sn(this,a.dragTarget,"drag",b,a);Qn(a.id,this.Nk);this.Nk[a.id]=setTimeout(function(){c.mj(a,b)},150)};function Qn(a,b){b[a]&&(b[a].timeout?clearTimeout(b[a].timeout):clearTimeout(b[a]),delete b[a])} 480function Tn(a,b,c){var d=b.target,e=new K(b.viewportX,b.viewportY),f=b.id;Qn(f,a.sf);var g=setTimeout(function(){d&&d===b.target&&e.kb({x:b.viewportX,y:b.viewportY}
480)<a.Cq&&(Sn(a,d,"longpress",c,b),delete a.$f[b.id])},a.Dq);a.sf[f]={timeout:g,vk:e}} 481m.Wy=function(a,b,c){var d=a.dragTarget,e=a.id;var f=a.target;a.target=b;f!==b&&(Sn(this,f,"pointerleave",c,a),Sn(this,b,"pointerenter",c,a));d?this.Ka?(this.mj(a,c),this.sf[e]&&this.sf[e].vk.kb({x:a.viewportX,y:a.viewportY})>this.Cq&&Qn(e,this.sf)):this.em?this.em=!1:(this.Ka=a,Sn(this,d,"dragstart",c,a),this.mj(a,c),delete this.$f[e],this.em=!0):(!this.Ka||this.Ka&&this.Ka.dragTarget!==b&&this.Ka.dragTarget!==this.map)&&Sn(this,b,"pointermove",c,a)}; 482m.Vy=function(a,b,c){var d=!(/^(?:mouse|pen)$/.test(a.type)&&0!==c.button);if(b){a.target=b;this.$f[a.id]={vk:new K(a.viewportX,a.viewportY),target:a.target,ps:c.timeStamp};"mouse"!==a.type&&Sn(this,b,"pointerenter",c,a);var e=Sn(this,b,"pointerdown",c,a);!this.Ka&&d&&(b.draggable&&!Ln(this.pointers,b)?a.dragTarget=b:!this.map.draggable||e.defaultPrevented||Ln(this.pointers,this.map)||(a.dragTarget=this.map));Tn(this,a,c)}}; 483m.Uy=function(a,b,c){var d=a.id;a.target=null;b?(Sn(this,b,"pointerleave",c,a),Sn(this,b,"pointercancel",c,a)):Sn(this,this.map,"pointercancel",c,a);Rn(this,a,c);this.$f={};Qn(d,this.sf)}; 484function Sn(a,b,c,d,e){if(b&&"function"===typeof b.dispatchEvent){var f=mn;var g=a.pointers.Ta(),h=a.changedPointers.Ta();a=a.pointers;var k,l=a.Ea.length,n=[];for(k=0;k<l;k++)a.Ea[k].target===b&&n.push(a.Ea[k]);f=new f(c,g,h,n,e,b,d);e.button=/^(?:longpress|(?:dbl)?tap|pointer(?:down|up))$/.test(c)?e.Pm:Hn.NONE;b.dispatchEvent(f)}return f} 485m.disposeInternal=function(){Nn(this,!0);this.pointers.clear();this.changedPointers.clear();var a=this.Nk,b;for(b in a)Qn(b,a);a=this.sf;for(var c in a)Qn(c,a);delete this.element;delete this.np;delete this.pointers;delete this.changedPointers;delete this.map;this.bk=null;delete this.$f;this.Ka=null;ed.prototype.disposeInternal.call(this)};function Un(a){var b="onwheel"in document;this.cy=b;this.ay=(b?"d":"wheelD")+"elta";this.aq=z(this.aq,this);Un.g.constructor.call(this,a,[{$a:(b?"":"mouse")+"wheel",listener:this.aq}]);this.sa=this.map.sa}u(Un,Mn); 486Un.prototype.normalize=function(a,b,c){var d=this.ay,e=a[d+(d+"Y"in a?"Y":"")],f;Ma&&"rtl"===globalThis.getComputedStyle(this.sa.element).direction&&(b-=(globalThis.devicePixelRatio-1)*this.sa.width);if(e){var g=Math.abs;var h=g(e);e=(!(f=a[d+"X"])||3<=h/g(f))&&(!(f=a[d+"Z"])||3<=h/g(f))?(+(0<e)-+(0>e))*(this.cy?1:-1):0}return new Bn(e,b,c,null,a)}; 487Un.prototype.aq=function(a){if(!a.Rx){var b=ln(this.element);b=this.normalize(a,a.pageX-b.x,a.pageY-b.y);b.delta&&(a.stopImmediatePropagation(),a.preventDefault(),this.map.Bh(b.viewportX,b.viewportY,this.Lp.bind(this,b)))}};Un.prototype.Lp=function(a,b){var c=a.target=b||this.map,d,e;setTimeout(function(){c.dispatchEvent(a);a.defaultPrevented||(d=a.originalEvent,e=new globalThis.WheelEvent("wheel",d),e.Rx=!0,d.target.dispatchEvent(e))},0)};function Vn(a){this.Uf=z(this.Uf,this);Mn.call(this,a,[{$a:"mousedown",listener:this.Uf},{$a:"mousemove",listener:this.Uf,target:window},{$a:"mouseup",listener:this.Uf,target:window},{$a:"mouseover",listener:this.Uf},{$a:"mouseout",listener:this.Uf},{$a:"dragstart",listener:this.kC}])}u(Vn,Mn);Vn.prototype.$o=function(a){a=new Cn(a.x,a.y,1,"mouse");this.pointers.push(a);return a}; 488Vn.prototype.Uf=function(a){var b=a.type,c=ln(this.element),d={x:a.pageX-c.x,y:a.pageY-c.y};c=this.pointers.item(0)||this.$o(d);this.changedPointers.push(c);Dn(c,d.x,d.y);/^mouse(?:move|over|out)$/.test(b)?On(this,"pointermove",a):(/^mouse(down|up)$/.test(b)&&(d=a.which-1,"up"===globalThis.RegExp.$1?Gn(c,d):En(c,d)),On(this,b.replace("mouse","pointer"),a));this.changedPointers.clear()};Vn.prototype.kC=function(a){a.preventDefault()};function Wn(a){var b=Xn(this);(window.PointerEvent||window.MSPointerEvent)&&b.push({$a:"MSHoldVisual",listener:"prevent"});Mn.call(this,a,b)}u(Wn,Mn);function Xn(a){var b=!!window.PointerEvent,c,d,e=[];a.$p=z(a.$p,a);"MSPointerDown MSPointerMove MSPointerUp MSPointerCancel MSPointerOut MSPointerOver".split(" ").forEach(function(f){c=f.toLowerCase().replace(/ms/g,"");d=b?c:f;e.push({$a:d,listener:a.$p,target:/^pointer(up|move)$/.test(c)?window:null})});return e}var Yn={2:"touch",3:"pen",4:"mouse"}; 489Wn.prototype.$o=function(a,b){var c=a.pointerType;"number"===typeof c&&(c=Yn[c]);a=new Cn(b.x,b.y,a.pointerId,c,a.button,a.buttons);this.pointers.push(a);return a}; 490Wn.prototype.$p=function(a){var b=window.PointerEvent?a.type:a.type.toLowerCase().replace(/ms/g,""),c=ln(this.element),d=Jn(this.pointers,a.pointerId),e=a.pageX-c.x;c=a.pageY-c.y;var f=Yn[a.pointerType]||a.pointerType;Ma&&"rtl"===globalThis.getComputedStyle(this.za.element).direction&&(e-=(globalThis.devicePixelRatio-1)*this.za.width);d||/^pointer(up|out|cancel)$/.test(b)||"touch"===f&&"pointerdown"!==b||(d=this.$o(a,{x:e,y:c}));if(d)if(/^pointer(up|cancel)$/.test(b)?("touch"===f&&this.pointers.remove(d.id), 491Gn(d,a.button)):"pointerdown"===b&&("touch"===a.pointerType&&(Kn(this.pointers,"mouse"),Kn(this.pointers,"pen")),En(d,a.button)),this.changedPointers.push(d),"pointermove"!==b)Dn(d,e,c),On(this,/^pointer(over|out)$/.test(b)?"pointermove":b,a);else if(d.viewportX!==e||d.viewportY!==c)Dn(d,e,c),On(this,b,a);this.changedPointers.clear()};function Zn(a){this.Gh=z(this.Gh,this);Mn.call(this,a,[{$a:"touchstart",listener:this.Gh},{$a:"touchmove",listener:this.Gh},{$a:"touchend",listener:this.Gh},{$a:"touchcancel",listener:this.Gh}]);this.Cx={touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",touchcancel:"pointercancel"};this.Ju=(a=(a=a.Yd)?a.B():null)?Array.prototype.slice.call(a.querySelectorAll("a"),0):[]}u(Zn,Mn); 492Zn.prototype.Gh=function(a){var b=a.touches,c=this.pointers.length(),d;if("touchstart"===a.type&&c>=b.length){c=this.pointers.clone();for(d=b.length;d--;)c.remove(b[d].identifier);for(d=c.length();d--;)this.pointers.remove(c.item(d).id);this.changedPointers=c;On(this,"pointercancel",a);this.changedPointers.clear()}if(this.Cx[a.type]){b=ln(this.za.element);c=a.type;d=a.changedTouches;var e=d.length,f;this.changedPointers.clear();for(f=0;f<e;f++){var g=d[f];var h=Jn(this.pointers,g.identifier);var k= 493g.pageX-b.x;var l=g.pageY-b.y;if(h)if("touchmove"===c){g=Math.abs(h.viewportX-k);var n=Math.abs(h.viewportY-l);if(1<g||1<n||1===g&&1===n)Dn(h,k,l),this.changedPointers.push(h)}else"touchend"===c&&(this.pointers.remove(h.id),this.changedPointers.push(h),Gn(h,Hn.LEFT));else h=new Cn(k,l,g.identifier,"touch",Hn.LEFT,1),this.pointers.push(h),this.changedPointers.push(h)}On(this,this.Cx[a.type],a);-1===this.Ju.indexOf(a.target)&&a.preventDefault()}}; 494Zn.prototype.disposeInternal=function(){this.Ju=null;Mn.prototype.disposeInternal.call(this)};function $n(a,b,c,d){$n.g.constructor.call(this,"contextmenu");this.items=[];this.viewportX=a;this.viewportY=b;this.target=c;this.originalEvent=d}u($n,pd);t("H.mapevents.ContextMenuEvent",$n);function ao(a){this.Xp=z(this.Xp,this);this.Zp=z(this.Zp,this);this.Yp=z(this.Yp,this);this.qn=!1;this.ih=-1;this.jv=0;ao.g.constructor.call(this,a,[{$a:"contextmenu",listener:this.Xp},{target:a,$a:"longpress",listener:this.Zp},{target:a,$a:"dbltap",listener:this.Yp}])}u(ao,Mn);m=ao.prototype;m.Zp=function(a){var b=a.currentPointer;"touch"===b.type&&1===a.pointers.length&&bo(this,b.viewportX,b.viewportY,a.originalEvent,a.target)};m.Yp=function(a){"touch"===a.currentPointer.type&&(this.jv=Date.now())}; 495m.Xp=function(a){var b=this;-1===this.ih?this.ih=setTimeout(function(){var c=ln(b.element),d=a.pageX-c.x;c=a.pageY-c.y;b.ih=-1;bo(b,d,c,a)},this.fp):(clearInterval(this.ih),this.ih=-1);a.preventDefault()};function bo(a,b,c,d,e){var f=a.map,g=Date.now()-a.jv;e?!a.qn&&g>a.Dq&&(a.qn=!0,e.dispatchEvent(new $n(b,c,e,d)),Ed(f.B(),co,a.Ht,!1,a)):f.Bh(b,c,a.Lp.bind(a,b,c,d))}m.Lp=function(a,b,c,d){bo(this,a,b,c,d&&db(d.dispatchEvent)?d:this.map)}; 496m.Ht=function(){this.qn&&(this.qn=!1,this.map.dispatchEvent(new pd("contextmenuclose",this.map)))};m.disposeInternal=function(){var a=this.map.B();clearInterval(this.ih);a&&Ld(a,co,this.Ht,!1,this);Mn.prototype.disposeInternal.call(this)};var co=["mousedown","touchstart","pointerdown","wheel"];function eo(a){var b=a.sa.element.style;if(-1!==fo.indexOf(a))throw Error("InvalidArgument: map is already in use");this.v=a;fo.push(a);b.msTouchAction=b.touchAction="none";Na||!window.PointerEvent&&!window.MSPointerEvent?(this.Bx=new Zn(this.v),this.Ev=new Vn(this.v)):this.Bx=new Wn(this.v);this.JD=new Un(this.v);this.Fy=new ao(this.v);this.v.bc(this.l,this);ed.call(this)}u(eo,ed);t("H.mapevents.MapEvents",eo);var fo=[];rb(fo); 497eo.prototype.l=function(){delete this.v;this.Bx.l();this.JD.l();this.Fy.l();this.Ev&&this.Ev.l();fo.splice(fo.indexOf(this.v),1);ed.prototype.l.call(this)};eo.prototype.dispose=eo.prototype.l;eo.prototype.wz=function(){return this.v};eo.prototype.getAttachedMap=eo.prototype.wz;t("H.mapevents.buildInfo",function(){return Wh("H-mapevents","1.61.0","3b08619",{region:"row"})}); 498 499R.prototype.Yn=da(3,function(a){var b=this.getCache(),c=this;if(a!==x){B(a,kk,R.prototype.Yn,0);var d=a}else d=Jk;d!==b&&b.ia(function(e,f,g){return c.cc(e)?(d.add(e,f,g),!0):!1});this.jt=d});Xg.prototype.Yb=da(2,function(a){this.ts=a;a=this.getState();a!==Ag.INIT&&a!==Ag.LOADING&&dh(this)});function go(a){a=a.Vd("_#-;,:","_#-;,:","_#-;,:");return new RegExp("^"+a.replace(/[.*+?^${}()|[\]\\\/]/g,"\\$&").replace(/_#-;,:/g,"\\d+")+"$")}function ho(a,b){Wa.apply(null,arguments);return a} 500function io(a,b){var c=globalThis.console;c&&c.warn&&(a=hb(a)+" is deprecated and will be removed soon. ",b&&(a+=b),c.warn(a)
500)}var jo={};function ko(){}ko.prototype.pop=function(a){this[a]||(this[a]=[]);return this[a].pop()||document.createElement("canvas")};ko.prototype.push=function(a,b){this[b]||(this[b]=[]);this[b].push(a)};var lo=new ko;t("H.service.util.eval",function(a){return eval(a)});function mo(a,b,c,d,e,f,g){var h=this;g=g||{};f=f?f:{};var k=a.i().clone().A(b+"/"+a.fb+"/"+c).u(f),l=a.bd;this.$=a;this.sx=k;Tk.call(this,{tileSize:d,max:512===d?19:20,min:512===d?2:0,getURL:function(n,p,q){var r=h.sx.clone();l&&r.la(l[(q+p+n)%l.length]);r.A(q+"/"+n+"/"+p+"/"+d+"/"+e);return r.toString()},crossOrigin:g.crossOrigin,headers:g.headers,uri:k.toString().replace(/_/g,"")+d,engineType:g.engineType});this.wD=b;this.oi=c;this.Ga=f;this.Xo=c.split(".")[0];this.Ce=z(this.Ce,this);this.getCopyrights= 501this.U;this.Ye=!1;a.addEventListener("versionupdate",this.Ce)}u(mo,Tk);mo.prototype.MAX_STORE_TIME=2592E6;mo.prototype.o=function(a,b,c,d,e,f){this.Ye||(io(no,"Use HERE Vector Tile API or Raster Tile API v3 instead."),this.Ye=!0);return mo.g.o.call(this,a,b,c,d,e,f)};mo.prototype.requestInternal=mo.prototype.o;mo.prototype.disposeInternal=function(){Tk.prototype.disposeInternal.call(this);this.$.removeEventListener("versionupdate",this.Ce)}; 502mo.prototype.U=function(a,b){return this.$.U().query(this.Xo,b,a)};mo.prototype.getCopyrights=mo.prototype.U;mo.prototype.Ce=function(){var a=this.$;this.sx=a.i().clone().A(this.wD+"/"+a.fb+"/"+this.oi).u(this.Ga);this.reload(!1)};mo.prototype.Vi=function(){return pm()};mo.prototype.td=function(){return pm()?om():mo.g.td.call(this)};function oo(a,b){b=void 0===b?{}:b;if(!a.Hm)throw new Bb(a);oo.g.constructor.call(this);var c=po(this,b);if(!c.baseUrl&&!c.platformBaseUrl)throw new C(a,0,'either "baseUrl" or "platformBaseUrl" must be specified');this.yc=(c.baseUrl?c.baseUrl:c.platformBaseUrl).clone();a=c.baseUrl?b:c;a.host&&this.yc.Qk(a.host);a.subDomain&&this.yc.la(a.subDomain);a.path&&this.yc.wc(a.path);qo(this.yc);this.pc=c.headers||{}}u(oo,I);t("H.service.Service",oo);function po(a,b){a=a.Da();return b?ho({},a,b):a} 503oo.prototype.Da=function(){return{}};oo.prototype.i=function(){return this.yc};oo.prototype.getUrl=oo.prototype.i;oo.prototype.o=function(a,b,c,d){d=new qg(void 0===d?"application/json":d,a.toString(),De,{headers:this.pc});d.then(b,ro(this,a,c));return d};function ro(a,b,c){return function(d){return"function"!==typeof d.json?Promise.reject(c(so(b,d))):d.json().then(function(e){return c(a.Jc(e))},function(){return c(so(b,d))})}}oo.prototype.Jc=function(a){return Error(a.message)}; 504function so(a,b){return Error((b.statusText?"["+b.statusText+"] ":"")+a+" request failed")};function to(){this.qs={}}function uo(a,b){for(var c in b)b.hasOwnProperty(c)&&a.Bo(c,b[c])}to.prototype.Bo=function(a,b){a=this.qs[a]||(this.qs[a]=[]);var c,d=b.length;for(c=0;c<d;c++){var e=new jo.Rs(b[c]);a.push(e)}};to.prototype.query=function(a,b,c){a=this.qs[a];var d,e=a?a.length:0,f=[];for(d=0;d<e;d++)a[d].Wf(b,c)&&f.push(a[d]);return f}; 505jo.Rs=function(a){var b,c=a.boxes;this.alt=a.alt;this.label=a.label;this.min=a.minLevel;this.max=a.maxLevel;this.Gn=[];if(c&&(b=c.length)){var d=c[0];var e=new E(d[0],d[1],d[2],d[3]);this.Gn.push(e);this.rn=new E(d[0],d[1],d[2],d[3]);for(a=1;a<b;a++)d=c[a],e=new E(d[0],d[1],d[2],d[3]),this.Gn.push(e),this.rn.zd(e,!1,this.rn)}};jo.Rs.prototype.Wf=function(a,b){if(a>=this.min&&a<=this.max)if((a=this.Gn.length)&&this.rn){if(this.rn.Wf(b))for(;a--;)if(this.Gn[a].Wf(b))return!0}else return!0;return!1};function W(a,b,c,d,e,f){if(a&&b)this.$r(a),this.Qk(b),this.wc(c),this.Wr(e),this.Pw(f),this.Tk(d);else throw new C(W,A,'Parameters "scheme" and "host" must be specified');}t("H.service.Url",W); 506function vo(a,b){var c=globalThis.document,d;var e="";if(c){e=c.createElement("a");if(b){var f=(d=c.getElementsByTagName("base")[0])&&d.href;var g=c.head;var h=d||g.appendChild(c.createElement("base"));h.href=b}e.href=a;e=e.href;b&&(d?d.href=f:g.removeChild(h))}else/[\w]+:\/\//.test(a)&&(e=a);f=/(?:(\w+):\/\/)?(?:([^:]+):([^@/]*)@)?([^/:]+)?(?:[:]{1}([0-9]+))?(\/[^?#]*)?(\?[^#]+)?(#.*)?/.exec(e);a=f[1];g=f[4];b=f[5];h=f[6];c=f[7];d=f[8];!f[2]&&g&&/@/.test(g)&&(g=g.split("@")[1]);f=W;h=h&&0<h.length? 507h.substr(1):"";e={};var k,l;if(c)for(k=/([?&]?([^=&+]+))(=([^&]+))?/g;l=k.exec(c);
507)e[decodeURIComponent(l[2])]=l[4]?decodeURIComponent(l[4]):void 0;return new f(a,g,h,e,isNaN(+b)?void 0:+b,d&&0<d.length?d.substr(1):"")}W.parse=vo;W.prototype.clone=function(){var a={},b;for(b in this.Ga)a[b]=this.Ga[b];return new W(this.oi,this.Qj,this.jf,a,this.uk,this.Db)};W.prototype.clone=W.prototype.clone; 508W.prototype.$r=function(a){if(!a||"string"!==typeof a)throw new C(this.$r,0,'The "scheme" parameter must be a non-empty string.');this.oi=a;return this};W.prototype.setScheme=W.prototype.$r;W.prototype.DA=function(){return this.oi};W.prototype.getScheme=W.prototype.DA;W.prototype.Qk=function(a){if(!a||"string"!==typeof a||"-"===a.charAt(0)||"."===a.charAt(0)||"."===a.charAt(a.length-1))throw new C(this.Qk,0,'The "host" parameter is not a valid host name.');this.Qj=a;return this}; 509W.prototype.setHost=W.prototype.Qk;W.prototype.Wz=function(){return this.Qj};W.prototype.getHost=W.prototype.Wz;W.prototype.wc=function(a){this.jf=a||void 0;return this};W.prototype.setPath=W.prototype.wc;W.prototype.pA=function(){return this.jf};W.prototype.getPath=W.prototype.pA;W.prototype.Tk=function(a){if(a)if("object"==typeof a)this.Ga=a;else throw new C(this.Tk,0,'Parameter "params" must be an object.');else this.Ga={};return this};W.prototype.setQuery=W.prototype.Tk;W.prototype.Du=function(){return!wo(this)}; 510W.prototype.hasQuery=W.prototype.Du;W.prototype.getQuery=function(){return this.Ga};W.prototype.getQuery=W.prototype.getQuery;W.prototype.Wr=function(a){if(void 0===a)this.uk=a;else{var b=gc(+a<<0,0,65535);if(b!=a)throw new C(this.Wr,0,'Parameter "port" must be an integer in range [0...65535]');this.uk=b}return this};W.prototype.setPort=W.prototype.Wr;W.prototype.uA=function(){return this.uk};W.prototype.getPort=W.prototype.uA;W.prototype.Pw=function(a){this.Db=a||void 0;return this}; 511W.prototype.setAnchor=W.prototype.Pw;W.prototype.yp=function(){return this.Db};W.prototype.getAnchor=W.prototype.yp;W.prototype.u=function(a){if("object"!==typeof a)throw new C(this.u,0,'Parameter "other" must be an object.');var b=this.Ga,c;for(c in a)a.hasOwnProperty(c)&&"function"!==typeof a[c]&&(b[c]=a[c]);return this};W.prototype.mergeQuery=W.prototype.u; 512W.prototype.la=function(a){if(!a||"string"!==typeof a)throw new C(this.la,0,'Parameter "subDomain" must be a non-empty string');"."===a.substr(a.length-1)&&(a=a.substr(0,a.length-1));return this.Qk(a+"."+this.Qj)};W.prototype.addSubDomain=W.prototype.la;W.prototype.A=function(a){if(!a||"string"!==typeof a)throw new C(this.A,0,'Parameter "subPath" must be a non-empty string');return this.wc((this.jf?this.jf+"/":"")+a)};W.prototype.addSubPath=W.prototype.A; 513W.prototype.toString=function(){return[this.oi+"://",this.Qj,this.uk?":"+this.uk:"",this.jf||!wo(this)||this.Db?"/":"",this.jf?encodeURI(this.jf):"",xo(this),this.Db?"#"+encodeURIComponent(this.Db):""].join("")};W.prototype.toString=W.prototype.toString;function yo(a){return encodeURIComponent(a).replace(/[!'()*]/g,function(b){return"%"+b.charCodeAt(0).toString(16)})} 514function xo(a){var b=[],c=a.Ga,d={},e;for(e in c){if(c.hasOwnProperty(e)&&"function"!==typeof c[e]){var f=a.Ga[e];d.Og=yo(e);B(f,zo)?f.jo.forEach(function(g){return function(h){b.push(g.Og+"="+yo(h))}}(d)):B(f,Ao)?b.push(d.Og+"="+f.jo.map(function(g){return yo(g)}).join(f.Sy)):b.push(void 0===f?d.Og:d.Og+"="+yo(f))}d={Og:d.Og}}return 0<b.length?"?"+b.join("&"):""} 515function qo(a){var b=Wh("H-service","1.61.0","3b08619",{region:"row"});a.Ga.xnlp="CL_JSMv3."+b.version;return a}function wo(a){var b,c=0;for(b in a.Ga)if(a.Ga.hasOwnProperty(b)&&"function"!==typeof a.Ga[b]&&(c++,0<c))break;return!c}function Bo(a,b){if(kb(a))for(var c=0;c<a.length;c++){var d=a[c];if(!lb(d)&&!ob(d)){var e="The Array does not contain only strings and numbers";break}}else e="Not an Array";if(e)throw new C(b,0,a);return a} 516function zo(a){this.jo=Bo(a,zo)}W.MultiValueQueryParameter=zo;zo.prototype.OA=function(){return this.jo};zo.prototype.getValues=zo.prototype.OA;function Ao(a,b){this.jo=Bo(a,Ao);if(!/^[!\$\(\)\*\+,;]$/.test(b))throw new C(Ao,1,'Invalid delimiter "'+b+'"');this.Sy=b}W.DelimitedQuerySubValues=Ao;function Co(a,b){B(a,Do,Co,0);var c={};Object.assign(c,b);c.min=c.min||0;c.max=c.max||20;c.tileSize=c.tileSize||512;c.getURL=function(d,e,f){return a.Sf(d,e,f).clone().u({size:c.tileSize})};Tk.call(this,c);this.$=a}u(Co,Tk);t("H.service.rasterTile.Provider",Co);Co.prototype.U=function(a,b){var c=this.$;return c.U().query(c.Ci.Rn+"."+c.K(),b,a)};Co.prototype.getCopyrights=Co.prototype.U;Co.prototype.Vi=function(){return pm()};Co.prototype.td=function(){return pm()?om():Co.g.td.call(this)};function X(a){a=ho({},this.Qy,a);var b=a.apikey||a.apiKey,c=a.baseUrl;if(c=b?c?0:"baseUrl":"apikey")throw new C(X,0,'"'+c+'" must be specified');this.Sw(a.baseUrl);this.ct=b;this.md.u({apikey:b});this.pc=a.headers||{};this.YC=Ta(a.servicesConfig||{})}t("H.service.Platform",X);X.prototype.Qy={apikey:null,baseUrl:new W("https","hereapi.com")};X.prototype.Sw=function(a){this.md=qo(a.clone());this.ct=a=this.ct;this.md.u({apikey:a})};X.prototype.setBaseUrl=X.prototype.Sw;X.prototype.Lc=function(){return this.md}; 517X.prototype.getBaseUrl=X.prototype.Lc;X.prototype.Ja=function(a,b){try{return a.Hm=!0,new a(ho({platformBaseUrl:this.Lc(),headers:this.pc},this.YC[a.CONFIG_KEY]||{},b||{}))}finally{a.Hm=!1}};X.prototype.createService=X.prototype.Ja; 518X.prototype.Yl=function(a,b,c){var d=this;if(!H.map.render.harp)throw Error("HARP engine module not found");
518if(!ya(a)&&!lb(a))throw new C(this.Yl,0,"is invalid: must be either a configuration object or a URL");if(!db(b))throw new C(this.Yl,1,"is invalid: must be a Function");if(!db(c))throw new C(this.Yl,2,"is invalid: must be a Function");var e=new H.map.render.harp.Style(a);e.addEventListener("change",function(){var f=e.getState();if(-1===f)c(Error("H.service.platform#createHybridLayers method failed to load style configuration")); 519else if(2===f){f={dark:!0};var g=d.Qp({resource:"background",queryParams:{style:"satellite.day"}}),h=e.Sd(),k={styles:[{technique:"raster",attr:{gamma:1,brightness:1}}]};h.definitions&&(void 0!==h.definitions["Satellite.Texture.Gamma"]&&(k.styles[0].attr.gamma=h.definitions["Satellite.Texture.Gamma"]),void 0!==h.definitions["Satellite.Texture.Brightness"]&&(k.styles[0].attr.brightness=h.definitions["Satellite.Texture.Brightness"]));g=new Co(g,{engineType:Nm,style:new H.map.render.harp.Style(k)}); 520b({raster:new sl(g,f),vector:d.Lj().od(e,{engineType:Nm},f),traffic:d.Tp().od(e,{engineType:Nm},f)})}});e.load()};X.prototype.createHybridLayers=X.prototype.Yl;function no(a){no.g.constructor.call(this,no,a);a=po(this,a);this.bd=a.shards;(this.Ra=a.ignoreTypes?null:a.type)&&this.i().la(this.Ra);this.fb=a.version;this.ec=new to;this.pr={};this.Wl=0;"newest"===this.fb&&this.rp()}u(no,oo);t("H.service.MapTileService",no);no.prototype.Da=function(){return{subDomain:"maps.ls",path:"maptile/2.1",type:"base",version:"newest",shards:["1","2","3","4"]}};no.CONFIG_KEY="maptile"; 521function Eo(a,b){for(var c={},d=a[b+"s"][b],e=d.length;e--;)c[d[e].id]=d[e];a[b+"s"]=c}no.prototype.vu=function(){return this.Ra};no.prototype.getType=no.prototype.vu;no.prototype.Wp=function(){return this.fb};no.prototype.getVersion=no.prototype.Wp;no.prototype.cs=function(a){this.fb=a};no.prototype.U=function(){this.Wl||(this.fb&&"newest"!==this.fb||"traffic"===this.Ra)&&this.Kf();return this.ec};no.prototype.getCopyrights=no.prototype.U;m=no.prototype; 522m.ss=function(a){a=a.response;var b;Eo(a,"map");Eo(a,"scheme");Eo(a,"tiletype");Eo(a,"format");Eo(a,"resolution");Eo(a,"language");if("newest"===this.fb&&"traffic"!==this.Ra)for(b in a.maps)a.maps[b].hash&&a.maps[b].newest&&(this.cs(a.maps[b].hash),this.dispatchEvent("versionupdate"));this.fq=a;this.dispatchEvent("infoupdate")};m.pl=function(a){uo(this.ec,a);this.dispatchEvent("copyrightupdate")}; 523m.rp=function(){var a=this;var b=this.i().clone().A("info").u({output:"json"});this.bd&&b.la(this.bd[0]);this.o(b,function(c){a.ss(c)},function(c){throw c;})};m.Kf=function(){var a=this;var b=this.i().clone().A("copyright").A(a.fb).u({output:"json"});this.bd&&b.la(this.bd[0]);this.Wl=1;this.o(b,function(c){a.Wl=2;a.pl(c)},function(c){a.Wl=-1;throw c;})};m.Kj=function(){return this.fq};no.prototype.getInfo=no.prototype.Kj; 524no.prototype.nj=function(a,b,c,d,e,f){var g=this.i().clone().A(a+"/"+this.fb+"/"+b+"/"+c+"/"+d).u(e?e:{}).toString();var h=0,k,l=g.length;if(0!==l)for(k=0;k<l;k++){var n=g.charCodeAt(k);h=(h<<5)-h+n;h|=0}g=h;h=this.pr[g];h||(h=new mo(this,a,b,c,d,e,ho({headers:this.pc},f||{})),this.pr[g]=h);return h};no.prototype.createTileProvider=no.prototype.nj;no.prototype.Pd=function(a,b,c,d,e,f,g,h){a=this.nj(a,b,c,d,e,h);return new sl(a,{opacity:f,dark:!!g})};no.prototype.createTileLayer=no.prototype.Pd; 525X.prototype.Kp=function(a){return this.Ja(no,a)};X.prototype.getMapTileService=X.prototype.Kp;function Fo(a){this.ns=!!a.toBypassToken;if(!this.ns&&!a.token)throw new C(Fo,0,'"token" must be specified');io(Fo,"Use HERE IML service instead.");Fo.g.constructor.call(this,Fo,a);this.zx=a.token;this.st={};this.Vl={}}u(Fo,oo);t("H.service.xyz.Service",Fo);Fo.prototype.Da=function(){return{host:"xyz.api.here.com",path:"hub/spaces"}};Fo.prototype.Jc=function(a){return Error(a.errorMessage||a.message)}; 526Fo.prototype.Np=function(a,b,c){ib(a,"String",this.Np,0,'"projectId" must be a string');Go(this.Np,1,b,c);a=Ho(this.i().clone().wc("project-api/projects/"+a));return this.o(a,b,c)};Fo.prototype.getProject=Fo.prototype.Np;Fo.prototype.tu=function(a,b,c){Go(this.tu,0,a,b);c=Io(this,this.i().clone().u(c||{}));return this.o(c,a,b)};Fo.prototype.getSpaces=Fo.prototype.tu; 527Fo.prototype.qm=function(a,b,c){ib(a,"String",this.qm,0,'"spaceId" must be a string');Go(this.qm,1,b,c);a=Io(this,this.i().clone().A(a));return this.o(a,b,c)};Fo.prototype.getSpace=Fo.prototype.qm;Fo.prototype.Dh=function(a,b,c){ib(a,"String",this.Dh,0,'"spaceId" must be a string');Go(this.Dh,1,b,c);a=Io(this,this.i().clone().A(a+"/statistics"));return this.o(a,b,c)};Fo.prototype.getStatistics=Fo.prototype.Dh; 528Fo.prototype.lm=function(a,b,c,d,e,f,g){a=Io(this,this.i().clone().A(d+"/tile/web/"+c+"_"+a+"_"+b+".mvtf").u(Object.assign({clip:!0},g)));return this.o(a,function(h){return h.arrayBuffer().then(e)},f,"arraybuffer")};Fo.prototype.search=function(a,b,c,d){ib(a,"String",this.search,0,'"spaceId" must be a string');Go(this.search,1,b,c);a=Io(this,this.i().clone().A(a+"/search").u(d||{}));return this.o(a,b,c)};Fo.prototype.search=Fo.prototype.search; 529Fo.prototype.Ue=function(a,b,c,d){ib(a,"String",this.Ue,0,'"spaceId" must be a string');
529if(!ya(b))throw new C(this.Ue,1,'"params" must be an object');Go(this.Ue,2,c,d);a=Io(this,this.i().clone().A(a+"/features").u(b));return this.o(a,c,d)};Fo.prototype.getFeaturesById=Fo.prototype.Ue; 530Fo.prototype.wh=function(a,b,c,d){ib(a,"String",this.wh,0,'"spaceId" must be a string');if(!ya(b))throw new C(this.Ue,1,'"params" must be an object');Go(this.wh,2,c,d);a=Io(this,this.i().clone().A(a+"/bbox").u(b));return this.o(a,c,d)};Fo.prototype.getFeaturesByBoundingBox=Fo.prototype.wh;Fo.prototype.U=function(a){var b=this.st[a];if(b)return b;this.Vl[a]||this.Kf(a);return null}; 531Fo.prototype.nf=function(a,b,c,d,e){ib(a,"String",this.nf,0,'"spaceId" must be a string');if(!ya(b))throw new C(this.nf,1,'"geojsonObject" must be an object');Go(this.nf,2,c,d);if(e&&!ya(e))throw new C(this.nf,4,'"opt_params" must be an object');return Jo(this,a,c,d,"PUT",b,e)};Fo.prototype.putFeatures=Fo.prototype.nf; 532Fo.prototype.lf=function(a,b,c,d,e){ib(a,"String",this.lf,0,'"spaceId" must be a string');if(!ya(b))throw new C(this.lf,1,'"featureCollection" must be an object');Go(this.lf,2,c,d);if(e&&!ya(e))throw new C(this.lf,4,'"opt_params" must be an object');return Jo(this,a,c,d,"POST",b,e)};Fo.prototype.postFeatures=Fo.prototype.lf; 533Fo.prototype.If=function(a,b,c,d){ib(a,"String",this.If,0,'"spaceId" must be a string');if(!ya(b))throw new C(this.If,1,'"params" must be an object');Go(this.If,2,c,d);return Jo(this,a,c,d,"DELETE",A,b)};Fo.prototype.deleteFeatures=Fo.prototype.If; 534function Jo(a,b,c,d,e,f,g){var h=Object.assign(a.ns?{}:{authorization:"Bearer "+a.zx},{"Content-Type":"application/geo+json"},a.pc);e={method:e,headers:h};f&&(e.data=JSON.stringify(f));b=Ho(a.i().clone().A(b+"/features").u(g||{}));f=new qg("application/json",b.toString(),De,e);f.then(c,ro(a,b,d));return f}Fo.prototype.Kf=function(a){var b=this;this.Vl[a]=Ko;this.qm(a,function(c){b.Vl[a]=Lo;b.st[a]=c.copyright;b.dispatchEvent("copyrightupdate")},function(c){b.Vl[a]=Mo;throw c;})}; 535function Io(a,b){return a.ns?b:Ho(b).u({access_token:a.zx})}function Ho(a){var b=Object.assign({},a.getQuery());delete b.apikey;return a.Tk(b)}Fo.CONFIG_KEY="xyz";var Ko=1,Lo=2,Mo=-1;function Go(a,b,c,d){if(!db(c))throw new C(a,b,'"onResult" must be a function');if(!db(d))throw new C(a,b+1,'"onError" must be a function');}X.prototype.SA=function(a){return this.Ja(Fo,a)};X.prototype.getXYZService=X.prototype.SA;function No(a,b,c){var d;No.g.constructor.call(this,c?{min:c.min,max:c.max,engineType:c.engineType}:void 0);B(a,Fo,No,0);if(!lb(b))throw new C(No,1,'"spaceId" must be a string');this.$=a;this.Gg=b;this.Ok={};if(c&&(["limit","simplificationLevel","tags"].forEach(function(e){e in c&&(this.Ok[e]=c[e])},this),a=c.parameters))for(d in a)this.Ok[d]=a[d];this.Xa(this.Ep())}u(No,R);t("H.service.xyz.Provider",No);No.prototype.o=function(a,b,c,d,e){return this.$.lm(a,b,c,this.Gg,d,e,this.Ok)}; 536No.prototype.requestInternal=No.prototype.o;No.prototype.U=function(){return this.$.U(this.Gg)};No.prototype.getCopyrights=No.prototype.U;No.prototype.Xc=We;No.prototype.providesOMV=No.prototype.Xc;No.prototype.K=function(){return this.mb()};No.prototype.getStyle=No.prototype.K;No.prototype.Cb=function(a){B(a,Xg)&&a.Yb("MVT");this.Xa(a)};No.prototype.setStyle=No.prototype.Cb; 537No.prototype.Ep=function(){return this.vb===mi.WEBGL?new Xg({sources:{xyz:{type:"MVT"}},layers:{xyz:{data:{source:"xyz",layer:this.Gg},points:{filter:{$geometry:"point"},draw:{points:{collide:!1,order:200,color:"#92CF48",size:[[10,"8px"],[14,"12px"],[18,"16px"]]}}},polygons:{filter:{$geometry:"polygon"},draw:{polygons:{order:201,color:"#E39E3C"},lines:{order:202,color:"#755DA5",width:"1px"}}},lines:{filter:{$geometry:"line"},draw:{lines:{order:203,color:"#000000",width:"2px",join:"round",cap:"round"}}}}}}): 538new H.map.render.harp.Style({styles:[{layer:this.Gg,when:["==",["geometry-type"],"Point"],technique:"circles",renderOrder:200,color:"#92CF48",size:["interpolate",["linear"],["zoom"],10,8,14,12,18,16]},{layer:this.Gg,when:["==",["geometry-type"],"Polygon"],technique:"polygon",color:"#E39E3C",renderOrder:201},{layer:this.Gg,when:["==",["geometry-type"],"Polygon"],technique:"solid-line",color:"#755DA5",width:"1px",renderOrder:202},{layer:this.Gg,when:["==",["geometry-type"],"LineString"],technique:"solid-line", 539color:"#000000",width:"2px",renderOrder:203}]})};function Oo(a){Oo.g.constructor.call(this,Oo,a)}u(Oo,oo);t("H.service.WaypointsSequenceService",Oo);Oo.CONFIG_KEY="waypointsSequence";Oo.prototype.hz=function(a,b,c){a=this.i().clone().la("wps").wc("v8/findsequence2").u(a);return this.o(a,b,c)};Oo.prototype.findSequence=Oo.prototype.hz;X.prototype.RA=function(a){return this.Ja(Oo,a)};X.prototype.getWaypointsSequenceService=X.prototype.RA;function Po(a){Po.g.constructor.call(this,Po,a)}u(Po,oo);t("H.service.publicTransit.Service",Po);Po.prototype.Da=function(){return{subDomain:"transit.router",path:"v8"}};Po.CONFIG_KEY="publicTransit";Po.prototype.BA=function(a,b,c){a=this.i().clone().A("routes").u(a);return this.o(a,b,c)};Po.prototype.getRoutes=Po.prototype.BA;Po.prototype.Jz=function(a,b,c){a=this.i().clone().A("departures").u(a);return this.o(a,b,c)};Po.prototype.getDepartures=Po.prototype.Jz; 540Po.prototype.FA=function(a,b,c){a=this.i().clone().A("stations").u(a);return this.o(a,b,c)};Po.prototype.getStations=Po.prototype.FA;Po.prototype.Jc=function(a){return Error(JSON.stringify(a))};X.prototype.xA=function(a){return this.Ja(Po,a)};X.prototype.getPublicTransitService=X.prototype.xA;X.prototype.Xl=function(a,b,c,d,e,f){function g(Pa,ic,jc){ic=Pa.rm(ic);ic=r?new Xg(ic):new H.map.render.harp.Style(ic);var La={engineType:l};p&&p.politicalView&&(La.politicalView=p.politicalView);c&&(La.lg=c);d&&(La.lg2=d);f&&(La.pois=f);var Cc;jc&&(Cc={dark:jc});return Pa.od(ic,La,Cc)}function h(Pa,ic,jc,La,Cc){return Pa.Pd(ic,jc,v,La,w,1,Cc,n)}var k=this,l=li,n={crossOrigin:"anonymous"};if(ya(a)){var p=a;"crossOrigin"in p&&(n.crossOrigin=p.crossOrigin);a=p.tileSize;b=p.ppi;c=p.lg;d=p.lg2;e=p.style; 541f=p.pois;void 0!==p.engineType&&(l=p.engineType,n.engineType=l)}var q=l===mi.HARP,r=l===mi.WEBGL,v=a||512,w={};if(0>[72,250,320,500].indexOf(+b)){if(b!==A)throw new C(this.Xl,1,b);}else w.ppi=+b;c&&(w.lg=c);d&&(w.lg2=d);e&&(w.style=e);f&&(w.pois=!!f);if(q&&!H.map.render.harp)throw new C(this.Xl,0,"HARP engine is not supported, module not found");a={};e=this.Kp();var y=this.Kp({type:"aerial"}),F=this.Sp(),G=F.vt(w.lg?{lg:w.lg,i18n:!0,engineType:l}:{engineType:l});ho(a,{raster:{normal:{xbase:h(e,"xbasetile", 542"normal.day","png8",!1),xbasenight:h(e,"xbasetile","normal.night","png8",!0),base:h(e,"basetile","normal.day","png8",!1),basenight:h(e,"basetile","normal.night","png8",!0),map:h(e,"maptile","normal.day","png8",!1),mapnight:h(e,"maptile","normal.night","png8",!0),trafficincidents:G,transit:h(e,"maptile","normal.day.transit","png8",!1),labels:h(e,"labeltile","normal.day","png",!1)},satellite:{xbase:h(y,"xbasetile","hybrid.day","jpg",!0),base:h(y,"basetile","hybrid.day","jpg",!0),map:h(y,"maptile","hybrid.day", 543"jpg",!0),labels:h(y,"labeltile","hybrid.day","png",!0)},terrain:{xbase:h(y,"xbasetile","terrain.day","jpg",!1),base:h(y,"basetile","terrain.day","jpg",!1),map:h(y,"maptile","terrain.day","jpg",!1),labels:h(y,"labeltile","terrain.day","png",!1)}}});if(q||r){ho(a,{vector:{normal:{traffic:F.ut(void 0,l),trafficincidents:G}}});y=this.Lj({queryParams:{content:"default,transit"}});e=this.Tp();F=this.Lj({queryParams:{content:"default,advanced_roads,advanced_pois,transit"}});var O=this.Lj({queryParams:{content:"default,hillshade,contours,transit"}}); 544if(r)a.vector.normal.map=g(y,"omv/miami/normal.day.yaml"),a.vector.normal.truck=g(y,"omv/miami/truck.day.yaml");else if(q){a.vector.normal.map=g(y,"harp/oslo/normal.day.json");a.vector.normal.truck=g(y,"harp/oslo/normal.day.json");a.vector.normal.logistics=g(F,"harp/oslo/logistics.day.json");a.vector.normal.logisticsnight=g(F,"harp/oslo/logistics.night.json");G=g(O,"harp/oslo/topo.day.json");O=g(O,"harp/oslo/topo.night.json");var V=function(Pa){Pa=Pa.target;if(2===Pa.getState()){Pa.removeEventListener("change", 545V);var ic=Pa.getEnabledFeatures()||[];[{feature:"terrain",mode:"hillshade"},{feature:"contours",mode:"all"}
545].forEach(function(jc){var La=ic.findIndex(function(Cc){return Cc.feature===jc.feature});ic.splice(La,-1===La?0:1,jc)});Pa.setEnabledFeatures(ic)}};G.D.K().addEventListener("change",V);O.D.K().addEventListener("change",V);a.vector.normal.topo=G;a.vector.normal.toponight=O;var Ua={ppi:72<b||void 0===b&&2<=window.devicePixelRatio?200:100,size:256<v?512:256,features:"pois:"+(!0===f||lb(f)&&/[^0]/.test(f)? 546"all":"disabled")};c&&(Ua.lang=c);d&&(Ua.lang2=d);p&&p.politicalView&&(Ua.pview=p.politicalView);b={dark:!0};G=function(Pa,ic,jc,La,Cc){var Kc=ho({},Ua);/^explore\./.test(jc)||delete Kc.features;Pa=k.Qp({format:ic,resource:Pa,queryParams:ho({style:jc},Kc)});Cc=new Co(Pa,{engineType:l,style:Cc});return new sl(Cc,La)};ho(a.raster.normal,{base:G("background","png8","explore.day"),basenight:G("background","png8","explore.night",b),map:G("base","png8","explore.day"),mapnight:G("base","png8","explore.night", 547b),labels:G("label","png","explore.day")});ho(a.raster.satellite,{xbase:G("background","jpeg","satellite.day",b),base:G("background","jpeg","explore.satellite.day",b),map:G("base","jpeg","explore.satellite.day",b),labels:G("label","png","explore.satellite.day")});ho(a.vector.normal,{mapnight:g(y,"harp/oslo/normal.night.json",!0),lite:g(y,"harp/oslo/lite.day.json"),litenight:g(y,"harp/oslo/lite.night.json",!0),ism:g(y,"harp/oslo/road.network.day.json"),ismnight:g(y,"harp/oslo/road.network.night.json", 548!0),roadnetwork:g(y,"harp/oslo/road.network.day.json"),roadnetworknight:g(y,"harp/oslo/road.network.night.json",!0)});O={styles:[{technique:"raster",attr:{gamma:["step",["zoom"],.9,13,1],brightness:["step",["zoom"],.6,12,.7,13,.8,14,.8,17,.9]}}]};for(var aa=[],vb=0;6>vb;vb++){var Ba=new H.map.render.harp.Style(JSON.parse(JSON.stringify(O)));Ba=G("background","jpeg","satellite.day",b,Ba);aa.push(Ba)}a.hybrid={day:{raster:aa[0],vector:g(y,"harp/oslo/hybrid.day.json",!0),traffic:g(e,"harp/oslo/hybrid.day.json", 549!0)},night:{raster:aa[1],vector:g(y,"harp/oslo/hybrid.night.json",!0),traffic:g(e,"harp/oslo/hybrid.night.json",!0)},liteday:{raster:aa[2],vector:g(y,"harp/oslo/lite.hybrid.day.json",!0),traffic:g(e,"harp/oslo/lite.hybrid.day.json",!0)},litenight:{raster:aa[3],vector:g(y,"harp/oslo/lite.hybrid.night.json",!0),traffic:g(e,"harp/oslo/lite.hybrid.night.json",!0)},logistics:{raster:aa[4],vector:g(F,"harp/oslo/logistics.hybrid.day.json",!0),traffic:g(e,"harp/oslo/logistics.hybrid.day.json",!0)},logisticsnight:{raster:aa[5], 550vector:g(F,"harp/oslo/logistics.hybrid.night.json",!0),traffic:g(e,"harp/oslo/logistics.hybrid.night.json",!0)}}}y={traffic:{}};y.traffic.map=g(e,r?"traffic/vector.tile.yaml":"harp/oslo/normal.day.json");q&&(y.traffic.logistics=g(e,"harp/oslo/logistics.day.json"),y.traffic.logisticsnight=g(e,"harp/oslo/logistics.night.json"),y.traffic.mapnight=g(e,"harp/oslo/normal.night.json"),y.traffic.lite=g(e,"harp/oslo/lite.day.json"),y.traffic.litenight=g(e,"harp/oslo/lite.night.json"),y.traffic.topo=g(e,"harp/oslo/topo.day.json"), 551y.traffic.toponight=g(e,"harp/oslo/topo.night.json"));ho(a.vector,y)}return a};X.prototype.createDefaultLayers=X.prototype.Xl;function Do(a){a=void 0===a?{}:a;Do.g.constructor.call(this,Do,a);this.Ci={Rn:a.resource||"base",Dn:a.projection||"mc",format:a.format||"png8"};this.Fn=a.queryParams||{}}u(Do,oo);t("H.service.rasterTile.Service",Do);m=Do.prototype;m.K=function(){return this.Fn.style||"explore.day"};m.Sf=function(a,b,c){return this.i().clone().A(this.Ci.Rn+"/"+(this.Ci.Dn+"/")+(c+"/"+a+"/"+b+"/")+this.Ci.format).u(this.Fn)};m.Da=function(){return{subDomain:"maps",path:"v3"}}; 552m.U=function(){this.ec||this.Kf();return this.ec};m.Kf=function(){this.ec=new to;this.o(this.i().clone().A("copyright"),z(this.pl,this),Ye)};m.pl=function(a){var b=a.copyrights;a=a.resources;var c={},d=this.Ci.Rn+"."+this.K();c[d]=[];a[this.Ci.Rn].styles[this.K()].forEach(function(e){b[e].forEach(function(f){var g=[];f.boundingBoxes.forEach(function(h){g.push([h.north,h.west,h.south,h.east])});c[d].push({boxes:g,label:f.label,alt:f.alt,minLevel:f.minLevel,maxLevel:f.maxLevel})})});uo(this.ec,c)}; 553m.Kj=function(a,b){return this.o(this.i().clone().A("info"),a,b)};Do.prototype.getInfo=Do.prototype.Kj;Do.prototype.Nj=function(a,b){return this.o(this.i().clone().A("politicalViews"),a,b)};Do.prototype.getPoliticalViews=Do.prototype.Nj;Do.prototype.Sz=function(a,b){return this.o(this.i().clone().A("features"),a,b)};Do.prototype.getFeatures=Do.prototype.Sz;Do.prototype.Ip=function(a,b){return this.o(this.i().clone().A("languages"),a,b)};Do.prototype.getLanguages=Do.prototype.Ip;Do.CONFIG_KEY="rasterTile"; 554X.prototype.Qp=function(a){return this.Ja(Do,a)};X.prototype.getRasterTileService=X.prototype.Qp;function Qo(a){Qo.g.constructor.call(this,Qo,a);this.Kw=po(this,a).reverseSubDomain;io(Qo,"Use HERE Geocoding and Search API v7 instead.")}u(Qo,oo);t("H.service.GeocodingService",Qo);Qo.prototype.Da=function(){return{subDomain:"geocoder.ls",reverseSubDomain:"reverse",path:"6.2"}};Qo.CONFIG_KEY="geocoding";Qo.prototype.Jc=function(a){return Error(a.Details||a.message||a.error)};Qo.prototype.xp=function(a,b,c){a=this.i().clone().A("geocode.json").u(a);return this.o(a,b,c)}; 555Qo.prototype.geocode=Qo.prototype.xp;Qo.prototype.Fr=function(a,b,c){a=this.i().clone().A("reversegeocode.json").u(a);this.Kw&&a.la(this.Kw);return this.o(a,b,c)};Qo.prototype.reverseGeocode=Qo.prototype.Fr;Qo.prototype.search=function(a,b,c){a=this.i().clone().A("search.json").u(a);return this.o(a,b,c)};Qo.prototype.search=Qo.prototype.search;X.prototype.Tz=function(a){return this.Ja(Qo,a)};X.prototype.getGeocodingService=X.prototype.Tz;function Ro(a){Ro.g.constructor.call(this,Ro,a)}u(Ro,oo);t("H.service.GeofencingService",Ro);Ro.CONFIG_KEY="geofencing";Ro.prototype.Jc=function(a){return Error(a.issues&&a.issues[0]?a.issues[0].message:a.message,{cause:a})};Ro.prototype.qz=function(a,b,c){a=this.i().clone().la("geofencing").wc("v8/geofence").u(a);return this.I(a,"GET",b,c)};Ro.prototype.geofence=Ro.prototype.qz; 556Ro.prototype.delete=function(a,b,c){a=this.i().clone().la("geofencing").wc("v8/geofence/delete").u(a);return this.I(a,"GET",b,c)};Ro.prototype["delete"]=Ro.prototype.delete;Ro.prototype.upload=function(a,b,c,d){a=this.i().clone().la("geofencing").wc("v8/geofence/upload").u(a);b=So(Ro.prototype.upload,b);return this.I(a,"POST",c,d,b)};Ro.prototype.upload=Ro.prototype.upload; 557Ro.prototype.modify=function(a,b,c,d){a=this.i().clone().la("geofencing").wc("v8/geofence/modify").u(a);b=So(Ro.prototype.modify,b);return this.I(a,"POST",c,d,b)};Ro.prototype.modify=Ro.prototype.modify;function So(a,b){if(!(b instanceof Blob))throw new C(a,1,"must be an instance of Blob");a=new FormData;a.append("file",b);return a} 558Ro.prototype.I=function(a,b,c,d,e,f){f=void 0===f?"application/json":f;b={method:b,headers:Object.assign({},this.pc),data:e?e:void 0};f=new qg(f,a.toString(),De,b);f.then(c,ro(this,a,d));return f};function To(a){To.g.constructor.call(this,To,a);
558io(To,"Use HERE Geofencing API v8 instead.")}u(To,oo);t("H.service.extension.geofencing.Service",To);To.prototype.Da=function(){return{subDomain:"fleet.ls",path:"2"}};To.CONFIG_KEY="geofencing";To.prototype.request=function(a,b,c,d){return this.I(a,b,c,d)};To.prototype.request=To.prototype.request;To.prototype.Jc=function(a){return Error(a.issues&&a.issues.length?a.issues.map(function(b){return b.message}).join(". "):a.message||a.response_code)}; 559To.prototype.I=function(a,b,c,d){if(!a)throw new C(this.request,0,a);if(!db(c))throw new TypeError("onResult must be a function");if(!db(d))throw new TypeError("onError must be a function");a=this.i().clone().A(a+".json").u(b);return this.o(a,c,d)};To.EntryPoint={SEARCH_PROXIMITY:"search/proximity"};X.prototype.ku=function(a,b){b=b?+b:void 0;if(void 0===b)b=To;else if(8===b)b=Ro;else throw new C(this.ku,1,"allowed values are 8 or undefined");return this.Ja(b,a)};X.prototype.getGeofencingService=X.prototype.ku;function Uo(a){Uo.g.constructor.call(this,Uo,a)}u(Uo,oo);t("H.service.traffic.Service7",Uo);Uo.prototype.Da=function(){return{subDomain:"data.traffic",path:"v7"}};Uo.CONFIG_KEY="traffic_v7";Uo.prototype.MC=function(a,b,c,d){a=this.i().clone().A(["incidents",a].join("/")).u(b||{});return this.o(a,c,d)};Uo.prototype.requestIncidentById=Uo.prototype.MC;Uo.prototype.KC=function(a,b,c){a=this.i().clone().A("flow").u(a||{});return this.o(a,b,c)};Uo.prototype.requestFlowByArea=Uo.prototype.KC; 560Uo.prototype.PC=function(a,b,c){a=this.i().clone().A("incidents").u(a||{});return this.o(a,b,c)};Uo.prototype.requestIncidentsByArea=Uo.prototype.PC;function Vo(a){if(!a||!db(a.requestData))throw new C(Vo,0,"options.requestData");Vo.g.constructor.call(this,a);this.JC=a.requestData;this.yC=!!a.providesDomMarkers}u(Vo,R);t("H.map.provider.MarkerTileProvider",Vo);Vo.prototype.o=function(a,b,c,d,e){var f=this;return this.JC(a,b,c,function(g){for(var h=[],k,l,n=g.length;n--;)l=g[n],l.uD=f.getTileKey(a,b,c),l.ea(f),k=l.kc(),(B(l,Li)||1===k.getState())&&h.push(g[n]);d(h)},e)};Vo.prototype.requestInternal=Vo.prototype.o; 561Vo.prototype.Hh=function(a,b){b===hh.VISUAL&&(a=this.Sb().get(a.uD))&&(a.valid=!1,this.jb(a))};Vo.prototype.invalidateObject=Vo.prototype.Hh;Vo.prototype.Vc=function(){return this.yC};Vo.prototype.providesDomMarkers=Vo.prototype.Vc;Vo.prototype.Wc=We;Vo.prototype.providesMarkers=Vo.prototype.Wc;function Wo(){this.vd={}}Wo.prototype.kc=function(a,b){var c=a+b,d;if(d=this.vd[c])return d;a=Xo.MARKER.replace("{{icon}}",Yo[a]||Yo.OTHER);a=a.replace("{{color}}",Zo[b]||Zo.BLOCKING);b={size:{w:26,h:33},anchor:{x:13,y:30},hitArea:new Gi(Hi.POLYGON,$o.MARKER)};return this.vd[c]=d=new zm(a,b)}; 562var Xo={MARKER:'<svg width="26" height="33" enable-background="new 0 0 26 33" viewBox="0 0 26 33" xmlns="http://www.w3.org/2000/svg"><path d="m26 33h-26v-33h26z" fill="#8c8c8c" opacity="0"/><path d="m17 29.566c0 1.116-1.791 2.022-4 2.022s-4-.906-4-2.022c0-1.118 1.791-2.026 4-2.026s4 .908 4 2.026" fill="#878787" opacity=".6"/><path d="m1.795 17.971c-1.562-1.555-1.574-3.828-.028-5.655l8.343-10.021c.769-.895 1.795-1.384 2.894-1.384 1.117 0 2.197.521 2.889 1.394l8.338 10.014c1.588 1.854 1.578 4.022-.029 5.65l-11.202 11.202z" fill="{{color}}"/>{{icon}}</svg>'},Yo= 563{CONGESTION:'<path style="fill:#FFFFFF;" d="M12.966,1.177c0.965,0,1.894,0.442,2.496,1.204l8.378,10.258c1.362,1.592,1.482,3.477,0,4.979L12.994,28.464L2.143,17.618c-1.381-1.375-1.38-3.348,0-4.979l8.314-10.258C11.174,1.547,12.085,1.177,12.966,1.177 M12.967,0.177L12.967,0.177c-1.247,0-2.408,0.551-3.269,1.552l-8.332,10.28c-1.711,2.022-1.688,4.567,0.07,6.317l10.85,10.845l0.707,0.707l0.707-0.707l10.847-10.846c1.784-1.807,1.803-4.292,0.053-6.337L16.237,1.748C15.462,0.769,14.236,0.177,12.967,0.177L12.967,0.177z M16.645,10.405l-2.025-2.22c-0.48-0.51-1.15-0.8-1.84-0.8H9.53c-0.69,0-1.36,0.29-1.84,0.8l-1.94,2.22c-0.39,0.63-0.59,1.35-0.59,2.09v1.64c0,0.69,0.56,1.25,1.25,1.25h1.44l0.255-0.539c0.204-0.431,0.456-0.837,0.753-1.21l0.962-1.211l0.83-0.9c0.32-0.35,0.72-0.63,1.15-0.82H8.23c-0.28,0-0.55-0.07-0.79-0.22l-0.28-0.17l1.27-1.45c0.28-0.31,0.68-0.48,1.1-0.48h3.25c0.42,0,0.82,0.17,1.1,0.48l1.354,1.54H16.645z M18.31,12.205c-0.35-0.37-0.81-0.63-1.3-0.74c-0.18-0.04-0.36-0.06-0.54-0.06h-3.24c-0.7,0-1.37,0.29-1.84,0.8l-1.13,1.22l-0.82,1c-0.38,0.63-0.59,1.35-0.59,2.09v1.64c0,0.69,0.56,1.25,1.25,1.25h1.75v-1h5.99v1h1.75c0.69,0,1.25-0.56,1.25-1.25v-1.64c0-0.74-0.2-1.46-0.59-2.09L18.31,12.205z M12.1,17.105h-1c-0.138,0-0.25-0.112-0.25-0.25v-1c0-0.138,0.112-0.25,0.25-0.25h1c0.138,0,0.25,0.112,0.25,0.25v1C12.35,16.993,12.238,17.105,12.1,17.105z M18.59,17.105h-1c-0.138,0-0.25-0.112-0.25-0.25v-1c0-0.138,0.112-0.25,0.25-0.25h1c0.138,0,0.25,0.112,0.25,0.25v1C18.84,16.993,18.728,17.105,18.59,17.105z M18.56,14.505c-0.24,0.15-0.51,0.22-0.79,0.22h-5.85c-0.28,0-0.55-0.07-0.78-0.22l-0.29-0.
56317l1.27-1.45c0.15-0.16,0.33-0.28,0.53-0.37c0.18-0.07,0.38-0.11,0.58-0.11h3.24c0.24,0,0.48,0.06,0.68,0.16c0.16,0.08,0.3,0.19,0.42,0.32l1.27,1.45L18.56,14.505z M8.42,13.03h-1c-0.138,0-0.25-0.112-0.25-0.25v-1c0-0.138,0.112-0.25,0.25-0.25h1c0.138,0,0.25,0.112,0.25,0.25v1C8.67,12.918,8.559,13.03,8.42,13.03z"/>', 564ROADWORKS:'<path d="m13.004 1.411c.964 0 1.894.441 2.496 1.204l8.346 10.023c1.363 1.592 1.482 3.477 0 4.979l-10.846 10.847-10.852-10.846c-1.381-1.375-1.379-3.348 0-4.979l8.346-10.023c.717-.835 1.628-1.205 2.51-1.205m0-1c-1.248 0-2.408.551-3.268 1.552l-8.356 10.035c-1.718 2.033-1.695 4.578.064 6.328l10.85 10.845.706.707.707-.707 10.846-10.846c1.784-1.808 1.803-4.293.053-6.337l-8.337-10.012c-.769-.973-1.996-1.565-3.265-1.565zm-.575 15.264c.018-.332-.13-.651-.394-.851l-2.945-2.235-.21.36c-.22.39-.41.78-.58 1.19l-.677 2.129-1.364 3.051h1.314l2.109-4.672 1.317 1.212.138 3.46h1.092zm6.16-1.327c-.401-.54-1.209-.539-1.609.001l-1.17 1.58-2.29-1.74-.139-4.054c-.011-.276-.134-.535-.342-.716l-.7-.61c-.185-.161-.422-.25-.667-.25h-1.885c-.335 0-.648.168-.833.447l-1.144 1.723 7.58 5.76-1.86 2.51c-.098.132-.004.32.161.32h6.648l1.142-1.077zm-8.79-2.989-.876-.665.841-1.018.965.043zm1.63 1.24.969-1.781.118 2.61zm2.76-5.79c-.64 0-1.16.52-1.16 1.16 0 .65.52 1.17 1.16 1.17s1.16-.52 1.16-1.17c0-.64-.52-1.16-1.16-1.16z" fill="#fff"/>', 565ACCIDENT:'<path style="fill:#FFFFFF;" d="M12.998,1.091c0.964,0,1.894,0.442,2.496,1.204l8.346,10.344c1.363,1.592,1.482,3.477,0,4.979L12.994,28.465L2.143,17.618c-1.381-1.375-1.379-3.348,0-4.979l8.346-10.344C11.205,1.462,12.115,1.091,12.998,1.091 M12.998,0.091L12.998,0.091c-1.248,0-2.408,0.551-3.269,1.552L1.364,12.011c-1.708,2.021-1.685,4.566,0.073,6.316l10.85,10.845l0.707,0.707l0.707-0.707l10.846-10.846c1.784-1.808,1.803-4.293,0.053-6.337l-8.327-10.32C15.494,0.684,14.268,0.091,12.998,0.091L12.998,0.091z M7.83,18.982l-3.309-1.855l0.945,1.855H7.83z M16.111,19h3.942l1.596-2L16.111,19z M10.512,20.064l1.021-1.021l1.632,0.076c0.329,0.018,0.651-0.022,0.963-0.123c0.626-0.206,1.122-0.76,1.288-1.44l0.264-1.089l2.066-0.93c0.373-0.17,0.673-0.42,0.861-0.731c0.275-0.449,0.405-0.97,0.369-1.498L18.9,11.676l1.021-1.021l-0.724-0.724l-0.427,0.427l-0.121-0.364c-0.201-0.603-0.54-1.151-0.989-1.6l-1.159-1.159c-0.5-0.5-1.31-0.5-1.809,0l-1.267,1.267l0.724,0.724l-5.066,5.066l-0.724-0.724l-1.267,1.267c-0.5,0.5-0.5,1.31,0,1.809l1.159,1.159c0.449,0.449,0.997,0.788,1.6,0.989l0.364,0.121l-0.427,0.427L10.512,20.064z M14.901,10.349l0.732-0.732c0.098-0.098,0.256-0.098,0.354,0l0.732,0.732c0.098,0.098,0.098,0.256,0,0.354l-0.732,0.732c-0.098,0.098-0.256,0.098-0.354,0l-0.732-0.732C14.803,10.604,14.803,10.446,14.901,10.349z M9.472,15.777l0.732-0.732c0.098-0.098,0.256-0.098,0.354,0l0.732,0.732c0.098,0.098,0.098,0.256,0,0.354l-0.732,0.732c-0.098,0.098-0.256,0.098-0.354,0L9.472,16.13C9.375,16.033,9.375,15.874,9.472,15.777z M11.391,17.615c0.069-0.271,0.206-0.518,0.405-0.717l4.961-4.961c0.195-0.195,0.445-0.337,0.717-0.405l0.344-0.083l0.137,1.925c0.022,0.318-0.058,0.63-0.221,0.901c-0.101,0.166-0.279,0.271-0.409,0.329L14.8,15.74l-0.38,1.574c-0.083,0.344-0.318,0.615-0.612,0.713c-0.188,0.058-0.38,0.083-0.579,0.072l-1.925-0.138L11.391,17.615z"/>', 566OTHER:'<path style="fill:#FFFFFF;" d="M13.004,1.411c0.964,0,1.894,0.441,2.496,1.204l8.346,10.023c1.363,1.592,1.482,3.477,0,4.979L13,28.465L2.148,17.618c-1.381-1.375-1.379-3.348,0-4.979l8.346-10.023C11.211,1.781,12.122,1.411,13.004,1.411 M13.004,0.411L13.004,0.411c-1.248,0-2.408,0.551-3.268,1.552L1.38,11.998c-1.718,2.033-1.694,4.579,0.064,6.328l10.85,10.845L13,29.878l0.707-0.707l10.846-10.846c1.784-1.808,1.803-4.293,0.053-6.337L16.269,1.976C15.5,1.003,14.273,0.411,13.004,0.411L13.004,0.411z M14.716,20.139c0,0.947-0.758,1.724-1.724,1.724c-0.947,0-1.704-0.777-1.704-1.724c0-0.928,0.757-1.704,1.704-1.704C13.958,18.435,14.716,19.211,14.716,20.139z M14.204,16.33H11.78l-0.537-8.533h3.5L14.204,16.33z"/>'}, 567Zo={BLOCKING:"#323232",VERYHIGH:"#d5232f",HIGH:"#ffa100"},$o={MARKER:[24.1,17.8,14.2,28.42,16.8,29.4,12.8,31.4,8.79,29.4,11.23,28.42,1.7,17.8,1.7,12.1,10,1.9,12.9,.498,15.8,1.9,24.1,12.1,24.1,17.8]};function ap(a,b,c){c=c?c:{};c.criticality||(c.criticality="major,critical");B(a,bp,ap,0);Vo.call(this,{max:20,min:8,requestData:z(this.NC,this),engineType:c.engineType});this.vd=new Wo;this.$=a;this.Ga=c;this.reload=z(this.reload,this);this.yr=setInterval(this.reload,b||18E4)}u(ap,Vo);t("H.service.traffic.incidents.Provider",ap);var cp={minor:"HIGH","low impact":"HIGH",major:"VERYHIGH",critical:"BLOCKING"}; 568ap.prototype.NC=function(a,b,c,d,e){var f=this,g=this.vd;return this.$.requestIncidentsByTile(a,b,c,function(h){var k=[];h=h.TRAFFIC_ITEMS;var l;if(h)for(h=h.TRAFFIC_ITEM,l=h.length;l--;){var n=h[l];var p=n.TRAFFIC_ITEM_TYPE_DESC;switch(p){case "ACCIDENT":case "CONGESTION":var q=p;break;case "CONSTRUCTION":q="ROADWORKS";break;default:q="OTHER"}q=g.kc(q,cp[n.CRITICALITY.DESCRIPTION]);p=n.LOCATION.GEOLOC.ORIGIN;p=new bn({lat:p.LATITUDE,lng:p.LONGITUDE},{provider:f,icon:q});p.setData(n);k.push(p)}d(k)}, 569e,this.Ga)};ap.prototype.l=function(){Vo.prototype.l.call(this);clearInterval(this.yr)};ap.prototype.dispose=ap.prototype.l;var dp="A21 A22 F01 F02 F08 F04 F05 F07 F03 F06 A2F F13 A25 A2C F12 D1B F1B A27 E12 A3A A24 A3D A3F F1F F25 F2C E32 A33 F29 D26 D36 F26 D0F F0F F2B E0C D3A A45 D23 D11 F2E F19 F14 F39 A4A A4B A5C D38 F2A F1A D0A F1C A48 D25 D1D F32 A46 A3E D24 E1C E32 A5F D2E D22 D0A".split(" ");function ep(a,b,c,d){ep.g.constructor.call(this,{min:10,max:21,engineType:d});B(a,bp,ep,0);this.$=a;this.Ga=c||fp;this.Ga.responseattributes="sh,fc";this.yr=setInterval(z(this.reload,this),b||18E4);this.vb===mi.WEBGL?this.Xa(new Xg(a.rm("traffic/flow.yaml")),!0):this.Xa(new H.map.render.harp.Style({styles:[{when:["==",["geometry-type"],"LineString"],technique:"solid-line",renderOrder:10002,attr:{color:["case",[">=",["get","JF"],10],"black",[">=",["get","JF"],8],"red",[">=",["get","JF"],4],"yellow", 570"green"],width:3,metricUnit:"Pixel"}}]}))}u(ep,R);t("H.service.traffic.flow.Provider",ep);ep.prototype.rr=We;ep.prototype.providesGeoJSON=ep.prototype.rr;ep.prototype.K=function(){return this.mb()};ep.prototype.getStyle=ep.prototype.K;ep.prototype.Cb=function(a){a.Yb&&a.Yb("GeoJSONTileSource");this.Xa(a)};ep.prototype.setStyle=ep.prototype.Cb;var fp={locationreferences:"tmc,shp"};
570ep.prototype.disposeInternal=function(){ep.g.disposeInternal.call(this);clearInterval(this.yr)}; 571ep.prototype.o=function(a,b,c,d,e){return this.$.requestFlowByTile(a,b,c,function(f){f.type&&-1!==f.type.indexOf("Error")?e(f.Details):d(f)},e,this.Ga)};ep.prototype.requestInternal=ep.prototype.o; 572ep.prototype.pd=function(a,b,c,d,e){var f,g,h,k,l={type:"FeatureCollection",features:[]},n;var p=d.RWS.length;for(f=0;f<p;f++){var q=d.RWS[f];var r=q.RW;var v=r.length;var w=-1!==dp.indexOf(q.EXTENDED_COUNTRY_CODE+q.EBU_COUNTRY_CODE);for(q=0;q<v;q++){var y=r[q].FIS;var F=y.length;for(y=0;y<F;y++){var G=r[q].FIS[y].FI;var O=G.length;for(g=0;g<O;g++){var V=G[g];var Ua=[];var aa=V.CF[0];var vb=!!aa.SSS;var Ba={type:"Feature",properties:aa,geometry:{type:"MultiLineString",coordinates:Ua}};Ba.properties.LHT= 573w;V.SHP.length&&(Ba.properties.FC=V.SHP[0].FC);vb&&(n=[]);for(aa=0;aa<V.SHP.length;aa++){var Pa=V.SHP[aa].value;var ic=Pa.length;for(h=0;h<ic;h++){var jc=vb?n:void 0,La=new Qa(Pa[h].trim()),Cc=[],Kc={};for(La.yi();-1!==(k=La.eb());)k===gp?(Kc.lat=+String.fromCharCode.apply(ep,La.mh()),La.next(),La.yi()):k===hp?(Kc.lng=+String.fromCharCode.apply(ep,La.mh()),Cc.push([Kc.lng,Kc.lat]),jc&&jc.push(vc(Kc)),Kc=[],La.next(),La.yi()):La.next();Kc.lng=+String.fromCharCode.apply(ep,La.mh());Cc.push([Kc.lng, 574Kc.lat]);jc&&jc.push(vc(Kc));k=Cc;Ua.push(k)}}l.features.push(Ba)}}}}return ep.g.pd.call(this,a,b,c,l,e)};ep.prototype.createTileInternal=ep.prototype.pd;var hp=32,gp=44;function ip(a){function b(n){d.contains(e)&&d.removeChild(e);l&&clearTimeout(l);delete ip.Br[f];n&&a.Ot&&a.Ot.call(k,n)}if(!a.url||!a.Oo)throw Error('Parameter "options" must specify at least a URL and a callback.');if("function"!==typeof a.Oo)throw Error("Parameters options.callback must be a function");var c=a.ZD||document;var d=c.getElementsByTagName("head")[0];var e=c.createElement("script");c=a.url instanceof W?a.url:vo(a.url,a.XD);var f=ip.TC++;var g=a.xy||"callback";var h=a.Oo;var k={};var l= 575null;k.id=f;k.cancel=function(){b("cancelled")};0!==a.timeout&&(l=globalThis.setTimeout(function(){b("timeout")},a.timeout||3E4));ip.Br[f]=function(n){b();h.call(k,n)};e.type="text/javascript";e.src=c.toString()+(c.Du()?"&":"?")+g+"="+(a.$D?"H.service.jsonp.handleResponse("+f+")":encodeURI("H.service.jsonp.handleResponse("+f+")"));d.appendChild(e);return k}t("H.service.jsonp",ip);ip.VA=function(a){return(a=ip.Br[a])?a:function(){}};ip.handleResponse=ip.VA;ip.TC=0;ip.Br={};function bp(a){bp.g.constructor.call(this,bp,a);this.yy=po(this,a).callbackKey;this.Ye=!1}u(bp,oo);t("H.service.traffic.Service",bp);bp.prototype.Da=function(){return{subDomain:"traffic.ls",path:"traffic/6.1",callbackKey:"jsoncallback"}};bp.CONFIG_KEY="traffic";bp.prototype.ut=function(a,b){return new sl(new ep(this,void 0,a,b),{max:22})};bp.prototype.createFlowLayer=bp.prototype.ut;bp.prototype.vt=function(a){return new Zm(new ap(this,void 0,a))};bp.prototype.createIncidentsLayer=bp.prototype.vt; 576function jp(a,b,c,d){a.Ye||(io(bp,"Use HERE Traffic API v7 instead."),a.Ye=!0);return ip({url:b,Oo:c,Ot:function(e){d(Error("["+e+"] "+b+" request failed"))},xy:a.yy})}bp.prototype.OC=function(a,b,c){a=this.i().clone().A("incidents.json").u(a);return jp(this,a,b,c)};bp.prototype.requestIncidents=bp.prototype.OC;bp.prototype.LC=function(a,b,c,d,e,f){a=this.i().clone().A(["flow/json",c,a,b].join("/")).u(f||{});return jp(this,a,d,e)};bp.prototype.requestFlowByTile=bp.prototype.LC; 577bp.prototype.QC=function(a,b,c,d,e,f){a=this.i().clone().A(["incidents/json",c,a,b].join("/")).u(f||{});return jp(this,a,d,e)};bp.prototype.requestIncidentsByTile=bp.prototype.QC;bp.prototype.rm=function(a){return kn()+"/"+a};X.prototype.Sp=function(a,b){b=b||6;if(6===b)b=bp;else if(7===b)b=Uo;else throw new C(this.Sp,1,"allowed values are 6 and 7");return this.Ja(b,a)};X.prototype.getTrafficService=X.prototype.Sp;function kp(a,b,c){c=c||{};var d=+c.min,e=+c.max;c.min=d?gc(d,1,17):1;c.max=e?gc(e,1,17):17;kp.g.constructor.call(this,c);B(a,lp,kp,0);B(b,zg,kp,1);this.$=a;b.Yb&&b.Yb("OMV");this.Xa(b,!0);this.Hl=go(this)}u(kp,R);t("H.service.trafficVectorTile.Provider",kp);kp.prototype.Xc=We;kp.prototype.providesOMV=kp.prototype.Xc;kp.prototype.cc=function(a){return this.Hl.test(a)};kp.prototype.cacheFilter=kp.prototype.cc;kp.prototype.Vd=function(a,b,c){return this.$.Sf(a,b,c).toString()}; 578kp.prototype.getTileKey=kp.prototype.Vd;kp.prototype.Sb=function(){return this.wf};kp.prototype.getCache=kp.prototype.Sb;kp.prototype.MAX_STORE_TIME=2592E6;kp.prototype.Vi=function(){return pm()};kp.prototype.td=function(){return pm()?om():kp.g.td.call(this)};kp.prototype.o=function(a,b,c,d,e){return this.$.Pa(a,b,c,d,e)};kp.prototype.requestInternal=kp.prototype.o;kp.prototype.Cb=function(a){a.Yb&&a.Yb("OMV");this.Xa(a)};kp.prototype.setStyle=kp.prototype.Cb;kp.prototype.K=function(){return kp.g.mb.apply(this)}; 579kp.prototype.getStyle=kp.prototype.K;kp.prototype.wf=new kk(256);kp.prototype.U=function(){return null};kp.prototype.getCopyrights=kp.prototype.U;function lp(a){lp.g.constructor.call(this,lp,a);this.Aq=(a||$e).layer||"traffic";this.me="mc";this.lz="omv"}u(lp,oo);t("H.service.trafficVectorTile.Service",lp);lp.prototype.Da=function(){return{subDomain:"traffic.vector",path:"v2"}};lp.CONFIG_KEY="trafficVectorTile";lp.prototype.od=function(a,b,c){b=b||{};var d={min:0,max:22};ya(c)&&ho(d,c);
579return new sl(new kp(this,a,b),d)};lp.prototype.createLayer=lp.prototype.od; 580lp.prototype.Pa=function(a,b,c,d,e){return this.o(this.Sf(a,b,c),function(f){return f.arrayBuffer().then(d,e)},e,"arraybuffer")};lp.prototype.Sf=function(a,b,c){return this.i().clone().A("traffictiles/"+this.Aq+"/"+this.me+"/"+c+"/"+a+"/"+b+"/"+this.lz)};lp.prototype.rm=function(a){return kn()+"/"+a};lp.prototype.cA=function(){return this.Aq};lp.prototype.getLayerName=lp.prototype.cA;X.prototype.Tp=function(a){return this.Ja(lp,a)};X.prototype.getTrafficVectorTileService=X.prototype.Tp;function mp(a){mp.g.constructor.call(this,mp,a)}u(mp,oo);t("H.service.SearchService",mp);mp.CONFIG_KEY="search";mp.prototype.Da=function(){return{subDomain:"search",path:"v1"}};mp.prototype.Jc=function(a){a=[a.title,a.action,a.cause].filter(function(b){return b});return Error(a.join(". "))};mp.prototype.xp=function(a,b,c){a=this.i().clone().la("geocode").A("geocode").u(a);return this.o(a,b,c)};mp.prototype.geocode=mp.prototype.xp; 581mp.prototype.Fr=function(a,b,c){a=this.i().clone().la("revgeocode").A("revgeocode").u(a);return this.o(a,b,c)};mp.prototype.reverseGeocode=mp.prototype.Fr;mp.prototype.qy=function(a,b,c){a=this.i().clone().la("autosuggest").A("autosuggest").u(a);return this.o(a,b,c)};mp.prototype.autosuggest=mp.prototype.qy;mp.prototype.autocomplete=function(a,b,c){a=this.i().clone().la("autocomplete").A("autocomplete").u(a);return this.o(a,b,c)};mp.prototype.autocomplete=mp.prototype.autocomplete; 582mp.prototype.Ty=function(a,b,c){a=this.i().clone().la("discover").A("discover").u(a);return this.o(a,b,c)};mp.prototype.discover=mp.prototype.Ty;mp.prototype.zB=function(a,b,c){a=this.i().clone().la("lookup").A("lookup").u(a);return this.o(a,b,c)};mp.prototype.lookup=mp.prototype.zB;mp.prototype.uy=function(a,b,c){a=this.i().clone().la("browse").A("browse").u(a);return this.o(a,b,c)};mp.prototype.browse=mp.prototype.uy;X.prototype.EA=function(a){return this.Ja(mp,a)}; 583X.prototype.getSearchService=X.prototype.EA;function np(a){io(np,"Use HERE Geocoding and Search API v7 instead.");np.g.constructor.call(this,np,a)}u(np,oo);t("H.service.PlacesService",np);np.prototype.Da=function(){return{subDomain:"places.ls",path:"places/v1"}};np.CONFIG_KEY="places";np.EntryPoint={SEARCH:"discover/search",SUGGEST:"suggest",EXPLORE:"discover/explore",AROUND:"discover/around",HERE:"discover/here",CATEGORIES:"categories/places"};np.prototype.request=function(a,b,c,d){return this.I(a,b,c,d)};np.prototype.request=np.prototype.request; 584np.prototype.I=function(a,b,c,d){a=this.i().clone().A(a).u(b||{});return this.o(a,c,d)};np.prototype.search=function(a,b,c){return this.I("discover/search",a,b,c)};np.prototype.search=np.prototype.search;np.prototype.sD=function(a,b,c){return this.I("suggest",a,b,c)};np.prototype.suggest=np.prototype.sD;np.prototype.fz=function(a,b,c){return this.I("discover/explore",a,b,c)};np.prototype.explore=np.prototype.fz;np.prototype.oy=function(a,b,c){return this.I("discover/around",a,b,c)}; 585np.prototype.around=np.prototype.oy;np.prototype.XA=function(a,b,c){return this.I("discover/here",a,b,c)};np.prototype.here=np.prototype.XA;np.prototype.Ay=function(a,b,c){return this.I("categories/places",a,b,c)};np.prototype.categories=np.prototype.Ay;np.prototype.jz=function(a,b,c,d){a=vo(a).u(this.i().getQuery()).u(d||{});return this.o(a,b,c)};np.prototype.follow=np.prototype.jz;X.prototype.qA=function(a){return this.Ja(np,a)};X.prototype.getPlacesService=X.prototype.qA;function op(){}t("H.service.extension.dataView.IRow",op);op.prototype.ab=function(){};op.prototype.getColumnNames=op.prototype.ab;op.prototype.va=function(){};op.prototype.getCell=op.prototype.va;op.prototype.Rf=function(){};op.prototype.getTable=op.prototype.Rf;function pp(){}t("H.service.extension.dataView.ITable",pp);pp.prototype.zh=function(){};pp.prototype.getMeta=pp.prototype.zh;pp.prototype.Ch=function(){};pp.prototype.getRowCount=pp.prototype.Ch;pp.prototype.Ud=function(){};pp.prototype.getRow=pp.prototype.Ud;pp.prototype.ab=function(){};pp.prototype.getColumnNames=pp.prototype.ab;pp.prototype.Fj=function(){};pp.prototype.getColumn=pp.prototype.Fj;pp.prototype.va=function(){};pp.prototype.getCell=pp.prototype.va;pp.prototype.concat=function(){}; 586pp.prototype.concat=pp.prototype.concat;function qp(){}t("H.service.extension.dataView.IColumn",qp);qp.prototype.va=function(){};qp.prototype.getCell=qp.prototype.va;
586function rp(a,b,c,d){if(!db(c))throw new C(a,b,"has invalid type");if(!db(d))throw new C(a,b+1,"has invalid type");};function sp(a,b){this.$b=a;this.Kk=b}t("H.service.extension.dataView.ObjRow",sp);sp.prototype.ab=function(){return this.$b.ab()};sp.prototype.getColumnNames=sp.prototype.ab;sp.prototype.va=function(a){return this.$b.va(this.Kk,a)};sp.prototype.getCell=sp.prototype.va;sp.prototype.Rf=function(){return this.$b};sp.prototype.getTable=sp.prototype.Rf;function tp(a,b){this.$b=a;this.Nl=b}t("H.service.extension.dataView.ObjColumn",tp);tp.prototype.va=function(a){return this.$b.va(a,this.Nl)};tp.prototype.getCell=tp.prototype.va;function up(a,b,c){var d;b=b||(a&&a.length?Object.keys(a[0]):A);this.Ob=a;if(b)for(this.eh=b,this.To=a=Za(),d=b.length;d--;)a[b[d]]=!0;c!==A&&(this.Lq=c)}t("H.service.extension.dataView.ObjTable",up);m=up.prototype;m.Lq=A;m.Ob=A;m.eh=A;m.To=A;m.zh=function(){return this.Lq};up.prototype.getMeta=up.prototype.zh;up.prototype.Ch=function(){return this.Ob?this.Ob.length:0};up.prototype.getRowCount=up.prototype.Ch;up.prototype.Ud=function(a){var b=this.Ob;return b&&b[a]?new sp(this,a):A}; 587up.prototype.getRow=up.prototype.Ud;up.prototype.ab=function(){return this.eh||Ze};up.prototype.getColumnNames=up.prototype.ab;up.prototype.Fj=function(a){return this.To[a]?new tp(this,a):A};up.prototype.getColumn=up.prototype.Fj;up.prototype.va=function(a,b){var c=this.Ob;return(a=c&&this.To[b]&&c[a])&&a[b]};up.prototype.getCell=up.prototype.va; 588up.prototype.concat=function(){var a=arguments.length,b,c=this.eh,d=""+this.eh,e=(this.Ob||[]).slice();for(b=0;b<a;b++){var f=arguments[b];if(!(f instanceof up))throw new C(this.concat,b);if(f.Ob){if(c&&""+f.eh!==d)throw new C(this.concat,b,"Incompatible columns!");e=e.concat(f.Ob)}}return new up(e,this.eh,this.Lq)};up.prototype.concat=up.prototype.concat;function vp(a){this.zy=a}vp.prototype.cancel=function(){for(var a=this.zy,b=a.length;b--;)a[b].cancel();a.length=0};vp.prototype.cancel=vp.prototype.cancel;function wp(a,b,c,d,e,f){rp(wp,1,b,c);rp(wp,2,d,e);(this.Tn=a.length)?(this.Ob=a,this.mn=b,this.dn=c,this.kk=0,this.vn=z(this.vn,this),this.Jy=d,this.Hy=e,this.Yh=Za(),Wa(this.Yh,xp,f||{}),this.ks={},globalThis.setTimeout(this.vn,0)):b(Ze,!0)}var xp={duration:100,sz:"geometry",rz:"WKT",XC:"searchAttributes",At:A}; 589wp.prototype.vn=function(){var a=[];var b=!1;for(var c=rk(),d;this.kk<this.Tn;){var e=this.Ob[this.kk];b=e.attributes;d=e.layerId||this.Yh.At;e.distance&&(b[this.Yh.XC]={nearest:new tc(e.nearestLat,e.nearestLon),distance:e.distance});if(e=e[this.Yh.sz]){try{var f=Pf(new Qa(e))}catch(g){this.dn(new globalThis.Error(g.message));b=!0;break}b[this.Yh.rz]=f}(e=this.ks[d])||(e=this.ks[d]=this.Jy({layerId:d,columnNames:Object.keys(b)}));b=this.Hy(e,b);a.push(b);this.kk++;if((b=this.kk===this.Tn)||rk()-c>= 590this.Yh.duration){this.mn(a,b);break}}b?this.ks={}:this.kl=globalThis.setTimeout(this.vn,0)};wp.prototype.cancel=function(){globalThis.clearTimeout(this.kl);this.kk<this.Tn&&this.dn(new globalThis.Error("parsing canceled"))};wp.prototype.cancel=wp.prototype.cancel;function yp(a,b,c,d){d=d||Ap;this.Fk={};d.provider=a;this.invalidate=Xe;yp.g.constructor.call(this,b,d);delete this.invalidate;c&&(this.FD=c);this.ra(hh.ADD)}u(yp,Eh);t("H.service.remote.Spatial",yp);var Ap={};yp.prototype.xb=function(){return this.FD||Eh.prototype.xb.call(this)};yp.prototype.getId=yp.prototype.xb;yp.prototype.Sn=Ye;yp.prototype.retain=yp.prototype.Sn;yp.prototype.release=We;yp.prototype.release=yp.prototype.release;function Bp(a,b){this.gm=a;b&&(this.labels=b)}var Cp=new Bp(Ze); 591yp.prototype.xh=function(a){return(this.Fk[a.key]||Cp).gm};yp.prototype.getGeometriesForTile=yp.prototype.xh;yp.prototype.Hp=function(a){return(this.Fk[a.key]||Cp).labels};yp.prototype.getLabels=yp.prototype.Hp;function Dp(a,b,c){a.Fk[b.key]=new Bp(c,void 0)};function Ep(a,b,c){var d=8===a;this.zi=b;this.Pt=c||Ye;(this.Mm=4===a||d)?this.Xe=d:this.Xu=1===a;this.cu=this.Mm?"$HProjGeometry":"geometry"} 592Ep.prototype.parse=function(a,b,c){var d,e={},f=[],g,h;var k=0;for(g=c.length;k<g;k++){var l=c[k];var n=l.Rows;if(l=n.length){var p=Object.keys(n[0]).filter(function(v){return"geometry"!==v&&"$HProjGeometry"!==v});p=new up(n,p);for(h=0;h<l;h++){var q=n[h];if(d=q[this.cu]){if(delete q[this.cu],q=p.Ud(h))try{var r=this.Mm?Fp(this,a,b,q,d):Gp(this,a,q,d.path);r.ea(a);f.push(r)}catch(v){this.Pt(v.message)}}else this.Pt("Layer must contain geometries")}}}
592e[this.Mm?"spatials":this.Xu?"markers":"domMarkers"]= 593f;return e};function Fp(a,b,c,d,e){var f=[],g=e.paths,h=g.length,k=0,l=a.zi&&a.zi(d);for(a=new yp(b,a.Xe,A,{style:l||a.Ry,data:d});k!==h;){b=f;d=b.push;l=g[k++];for(var n=0,p=l.length,q=[];n<p;)q.push(new K(l[n++],l[n++]));d.call(b,q)}Dp(a,c,[new ih(f,e.interiorsIndex,e.outlinesIndex)]);return a}function Gp(a,b,c,d){d=new tc(d[0],d[1]);var e=a.zi&&a.zi(c);a.Xu?(a={icon:e,data:c,provider:b},a=new bn(d,a)):(a={icon:e,data:c,provider:b},a=new Li(d,a));return a};function Hp(a){var b=Ip;if(!a||!lb(Re(a.layerId,a.layer))||!ob(a.level)||fb(a.rowFilter)&&!db(a.rowFilter)||fb(a.rowFilterContext)&&!ya(a.rowFilterContext))throw new C(b,1,fb("invalid layer config")?"invalid layer config":a);};function Jp(a,b){var c={};this.sC=a;Wa(c,b||c);ym.call(this,c);this.Jn={};a=this.Nc(zh.SPATIAL);a.update(a.Md+1,hh.ADD)}u(Jp,ym);t("H.service.remote.ObjectProvider",Jp);Jp.prototype.l=function(){ym.prototype.l.call(this)};Jp.prototype.dispose=Jp.prototype.l;Jp.prototype.qe=function(){return Ze};Jp.prototype.requestMarkers=Jp.prototype.qe;Jp.prototype.pe=function(){return Ze};Jp.prototype.requestDomMarkers=Jp.prototype.pe;Jp.prototype.xg=function(){return Ze};Jp.prototype.requestOverlays=Jp.prototype.xg; 594Jp.prototype.Wc=We;Jp.prototype.providesMarkers=Jp.prototype.Wc;Jp.prototype.Vc=We;Jp.prototype.providesDomMarkers=Jp.prototype.Vc;Jp.prototype.ne=We;Jp.prototype.providesSpatials=Jp.prototype.ne;Jp.prototype.Nn=function(){return Ze};Jp.prototype.requestSpatials=Jp.prototype.Nn;function Kp(a){return a.Wd(!0)}Jp.prototype.On=function(a,b){a=Lp(this,a,Mp);b&&(a=a.filter(Kp));return a};Jp.prototype.requestSpatialsByTile=Jp.prototype.On; 595function Lp(a,b,c){var d=b.Ji&&b.Ji[c],e;!d&&(e=b.ul)&&(delete b.ul,(b.Ji=a=a.sC.parse(a,b,e))&&(d=a[c]));return d||Ze}Jp.prototype.Y=function(a){var b=a.xb();if(this.Jn[b])throw new Bb(this.Y,"Remote object "+b+" already added");return this.Jn[b]=a};Jp.prototype.Oa=function(a){delete this.Jn[a.xb()]};var Mp="spatials";function Np(a){a=a||{};var b=a.tileCacheSize||1024,c=a.resultType,d=a.styleCallback;fb(a.min)||(a.min=12);Np.g.constructor.call(this,a);if(-1===Op.indexOf(c))throw new C(Np,2,"invalid resultType");this.resultType=c;if(d&&!db(d))throw new C(Np,2,"invalid style callback");this.zi=d;this.oa=a.pixelRatio||Ke();this.Ic=z(this.Ic,this);this.Yn(new kk(b,z(this.ke,this)));this.createTileInternal=4===c||8===c?z(this.Iy,this):z(this.Gy,this)}u(Np,R);t("H.service.extension.TileProvider",Np); 596Np.prototype.rq=!1;Np.prototype.getCapabilities=function(){return Np.g.getCapabilities.call(this)|di.CROP_LINES_BY_TILE|di.CROP_POLYGONS_BY_TILE};Np.prototype.Pa=function(a,b,c,d){return this.rq?Np.g.Pa.call(this,a,b,c,d):A};Np.prototype.requestTile=Np.prototype.Pa;Np.prototype.Ic=function(a){this.dispatchEvent(new Pd("error",lb(a)?a:a+"",this))};Np.prototype.Wc=function(){return 1===this.resultType};Np.prototype.providesMarkers=Np.prototype.Wc;Np.prototype.Vc=function(){return 2===this.resultType}; 597Np.prototype.providesDomMarkers=Np.prototype.Vc;Np.prototype.ne=function(){return 4===this.resultType||8===this.resultType};Np.prototype.providesSpatials=Np.prototype.ne;function Pp(a){var b=a.Bd;b||(a.cw||(a.cw=a.qu(a.resultType,a.zi,a.Ic)),b=a.Bd=new Jp(a.cw),b.ea(a),b.addEventListener(a.j.Aa,z(a.he,a)),b.vw=!0);return b} 598Np.prototype.Gy=function(a,b,c,d){var e=this.getTileKey(a,b,c);e=this.Sb().get(e);var f=2==this.resultType,g=[],h=Pp(this);e?e.valid=!0:(a=e=new Hk(a,b,c,x),delete a.Ji,a.ul=d);d=f?Lp(h,e,"domMarkers"):Lp(h,e,"markers");for(b=d.length;b--;)a=d[b],a.ys=e,(f||1===a.kc().getState())&&g.push(a);e.data=g;return e};Np.prototype.he=function(a){if(a=a.target.ys)a.valid=!1};Np.prototype.dD=function(a){this.Gw=!!a};Np.prototype.setTileCanvasRendering=Np.prototype.dD;Np.prototype.Gw=!0; 599Np.prototype.Iy=function(a,b,c,d){var e=Pp(this),f=this.getTileKey(a,b,c),g=this.tileSize,h=this.Sb().get(f);h||(a=h=new Yk(f,a,b,c,g,this.oa,c,e),delete a.Ji,a.ul=d);this.Gw?(d=lo.pop(g),h.L(d)||lo.push(d,g)):dl(h);return h};Np.prototype.ke=function(a,b){var c;if(4===this.resultType||8===this.resultType){a=b.bb();for(c=a.length;c--;)delete a[c].Fk[b.key];if(a=b.Hn())lo.push(a,this.tileSize),b.In()}else for(a=b.data,c=a.length;c--;)delete a[c].ys}; 600Np.prototype.disposeInternal=function(){Np.g.disposeInternal.call(this);Pp(this).l()};var Qp={MARKER:1,DOM_MARKER:2,POLYLINE:4,POLYGON:8};Np.ResultType=Qp;var Op=[1,2,4,8];function Ip(a,b,c){var d=this,e=b&&b.rowFilter,f=c.resultType;Ip.g.constructor.call(this,c);B(a,Rp,Ip,0);Hp(b);e?(c=Ta(b),c.rowFilter=e.toString()):c=Ta(b);delete c.layer;c.layerId=Re(b.layerId,b.layer);(new Vm).registerProcessor("pde","H.service.extension.worker.processor");a=a.i().clone().A(Sp+"."+Tp).u({meta:1});(new Xm("pde",{message:[this.uid,0,{tileSize:this.tileSize,projected:!0,onlyOutline:4===f,serverUrl:a.toString(),layerConfigs:[c],horizontalMargin:1}]})).then(function(){d.rq=!0;d.jb()}, 601this.Ic)}u(Ip,Np);t("H.service.extension.platformData.TileProvider",Ip);Ip.prototype.qu=function(a,b,c){a=new Ep(a,b,c);a.Ry=Up;return a};var Up=new M({strokeColor:"transparent",fillColor:"transparent",lineWidth:0,lineJoin:"round",lineCap:"round"}); 602Ip.prototype.o=function(a,b,c,d,e){var f=this,g=this.getTileKey(a,b,c),h;g=this.Sb().get(g);var k={cancel:Ye},l=!0,n=this.resultType;g&&(4===n||8===n?g.Ih()||(d(lo.pop(this.tileSize),null),l=!1):(d(x),l=!1));if(l){var p=globalThis.setTimeout(function(){h=new Xm("pde",{message:[f.uid,1,[a,b,c]]});h.then(d,e)},500);k.cancel=function(){h?h.cancel():globalThis.clearTimeout(p)}}return k};
602Ip.prototype.requestInternal=Ip.prototype.o; 603Ip.prototype.disposeInternal=function(){Ip.g.disposeInternal.call(this);new Xm("pde",{message:[this.uid,3]})};Ip.ResultType=Qp;function Rp(a){Rp.g.constructor.call(this,Rp,a);io(Rp)}u(Rp,oo);t("H.service.extension.platformData.Service",Rp);Rp.prototype.Da=function(){return{subDomain:"s.fleet.ls",path:"1"}};Rp.CONFIG_KEY="platformData";Rp.prototype.request=function(a,b,c,d,e){return this.I(a,b,c,d,e)};Rp.prototype.request=Rp.prototype.request; 604Rp.prototype.I=function(a,b,c,d,e){var f="text/plain";if(!a)throw new C(this.request,0,a);if(!b)throw new C(this.request,1,b);if(!d)throw new C(this.request,3,d);if(!e)throw new C(this.request,4,e);a=this.i().clone().A(a+"."+b).u(c);b===Vp.JSON&&(f="application/json");return this.o(a,d,e,f)};var Sp="tiles"; 605Rp.EntryPoint={DOC_ATTRIBUTES:"doc/attributes",DOC_LAYER:"doc/layer",DOC_LAYERS:"doc/layers",DOC_MAPS:"doc/maps",DOC_INDEXES:"doc/indexes",SEARCH_BBOX:"search/bbox",SEARCH_CORRIDOR:"search/corridor",SEARCH_PROXIMITY:"search/proximity",SEARCH_QUADKEY:"search/quadkey",SERVICE_CONFIGURATION:"serviceconfiguration",STATIC:"static",TILE:"tile",TILES:Sp,FILE:"file",INDEX:"index"};var Tp="json",Vp={TXT:"txt",JSON:Tp,HTML:"html",BIN:"bin"};Rp.EntryPointType=Vp; 606Rp.prototype.Pd=function(a,b){var c=b&&b.resultType;a=new Ip(this,a,b);return 1==c||2===c?new Zm(a):new sl(a)};Rp.prototype.createTileLayer=Rp.prototype.Pd;Rp.prototype.Cg=function(a,b,c,d){var e=[],f,g=b.layer_id||b.layer_ids;a=this.request(a,Tp,b,function(h){f=new wp(h.geometries,c,d,function(k){return new up([],k.columnNames,k)},function(k,l){var n=k.Ud;k.Ob?k.Ob.push(l):k.Ob=[l];return n.call(k,k.Ob.length-1)},{At:g});e.push(f)},function(h){d(new globalThis.Error(h))});e.push(a);return new vp(e)}; 607function Wp(a,b,c){if(!kb(a))throw new C(c,0,"has invalid type");if(!kb(b))throw new C(c,1,"has invalid type");if(a.length!==b.length||!a.length)throw new C(c,1,"specify one key attribute for each given layer id in the same order");} 608Rp.prototype.se=function(a,b,c,d,e,f){function g(l,n){n&&h--;d(l,!h)}var h,k=[];Wp(a,b,this.se);rp(this.se,3,d,e);B(c,E,this.se,2);c={bbox:c.fa+","+c.W+";"+c.ga+","+c.ca};f&&Wa(c,f);a=c.layer_id?[c.layer_id]:a;f=0;for(h=a.length;f<h;f++)c.layer_id=a[f],c.key_attribute=b[f],k.push(this.Cg("search/bbox",c,g,e));return new vp(k)};Rp.prototype.searchByBoundingBox=Rp.prototype.se; 609Rp.prototype.Zc=function(a,b,c,d,e,f,g){Wp(a,b,this.Zc);B(c,tc,this.Zc,2,"has invalid type");if(!ob(d))throw new C(this.Zc,3,"has invalid type");rp(this.Zc,4,e,f);a={layer_ids:a.join(","),key_attributes:b.join(","),proximity:c.lat+","+c.lng+","+d};g&&Wa(a,g);return this.Cg("search/proximity",a,e,f)};Rp.prototype.searchByProximity=Rp.prototype.Zc; 610Rp.prototype.Yc=function(a,b,c,d,e,f,g){var h="";Wp(a,b,this.Yc);if(!lb(c)&&!B(c,J))throw new C(this.Yc,1,"has invalid type");if(!ob(d))throw new C(this.Yc,2,"has invalid type");rp(this.Yc,4,e,f);a={layer_ids:a.join(","),key_attributes:b.join(","),radius:d};if(lb(c))a.route_id=c;else{d=c.S;c=0;for(b=d.length;c<b;c+=3)h+=d[c]+","+d[c+1],c<b-3&&(h+=";");a.corridor=h}g&&Wa(a,g);return this.Cg("search/corridor",a,e,f)};Rp.prototype.searchByCorridor=Rp.prototype.Yc; 611X.prototype.rA=function(a){return this.Ja(Rp,a)};X.prototype.getPlatformDataService=X.prototype.rA;function Xp(a){if(a===A)a="\t";else if(!/^[^"\r\n]$/.test(a))throw new C(Xp,0);this.$x=String(a).charCodeAt(0);this.xd=z(this.xd,this);this.s=Yp}var Yp=0;m=Xp.prototype;m.getState=function(){return this.s};function Zp(a,b,c){var d=a.s;if(d!==b)throw 1===d&&(a.s=Yp),new Bb(c,"Requires state: "+["READY","PARSE","PAUSE"][b]+" but found "+["READY","PARSE","PAUSE"][d]);}m.abort=function(){Zp(this,2,Xp.prototype.abort);this.s=Yp}; 612m.xd=function(a){this.s=Yp;throw new C(Xp.prototype.parse,0,"Malformed DSV at row "+this.ed.Gr+" column "+this.ed.fj+": "+a);};function $p(a,b){var c=[];a.parse(b,function(d,e,f){1>d&&(c[e]=f);return 0<d});a.s=Yp;return c}m.parse=function(a,b,c){Zp(this,Yp,Xp.prototype.parse);a=a.trim();this.ed=new aq(a,this.$x,this.xd);this.ZB=b;this.Jv=c||Xe;this.s=2;this.resume()};m.Jv=Xe; 613m.resume=function(){var a=this.ed,b=[];Zp(this,2,Xp.prototype.resume);this.s=1;do{if(!a.cq){this.s=Yp;break}if(e>a.fj){if(void 0!==c&&c!==e){this.ed.xd("The number of columns must be the same for all rows");return}var c=e}var d=a.Gr;var e=a.fj;var f=a.Ol;var g=this.Jv(d,e,a);if(a.Ol>f)for(;-1!==a.next(););else{for(;-1!==(f=a.next());)b.push(f);g=String.fromCharCode.apply(x,b);b.length=0}bq(a);this.ZB(d,e,g)&&(this.s=a.cq?2:Yp)}while(1===this.s);2!=this.s&&void 0!==c&&0<e&&c!==e&&this.ed.xd("The number of columns must be the same for all rows")}; 614function aq(a,b,c){this.ed=new Qa(a);this.Is=b;this.cq=!0;this.Ol=this.Gr=this.fj=0;bq(this);this.xd=c;this.Ec=[];this.Yf=!1}m=aq.prototype;m.Ol=0;function bq(a){var b=a.ed.eb();a.Yt=!1;(a.hB=34===b)&&a.ed.next()}function cq(a,b){var c=a.ed;a.Yt=!0;switch(b){case a.Is:a.fj++;break;case 13:c.next(),10!==c.eb()&&a.xd("CR without LF");case 10:a.fj=0;a.Gr++;break;case -1:a.cq=!1;break;default:a.xd("End of field expected")}c.next();return-1} 615m.eb=function(){if(this.Yt)var a=-1;else{var b=this.ed;a=b.eb();if(this.hB)switch(a){case 34:b.next();a=b.eb();34!==a&&(a=cq(this,a));break;case -1:this.xd("Closing quotation mark expected")}else switch(a){case 34:this.xd("Unexpected quotation mark");case this.Is:case 13:case 10:case -1:a=cq(this,a)}}return a};m.yi=function(){this.Yf=!0;this.Ec=[]};m.mh=function(){var a=this.Ec.slice();this.Yf=!1;this.Ec=[];return a}; 616m.next=function(){var a=this.eb();-1!==a&&this.ed.next();this.Yf&&this.Ec.push(a);this.Ol++;return a};t("H.service.extension.customLocation.Permission",{READ:"read",WRITE:"write",EXPORT:"export"});t("H.service.extension.customLocation.Storage",{READONLY:"readonly",UPDATABLE:"updatable"});
616function dq(){if(eq)throw new Bb(dq);}t("H.service.extension.customLocation.Table",dq);var eq=!0;function fq(a,b){var c;eq=!1;var d=new dq;eq=!0;d.Ym=bb(globalThis.JSON.parse(globalThis.JSON.stringify(a)));a=a.columnNames;var e=Za();for(c=a.length;c--;)e[a[c]]=c;d.So=e;d.Hc=a.length;if(b){if(b.length%a.length)throw new C(fq,1,"Invalid number of cells");}else b=[];d.tb=b;return d}dq.prototype.zh=function(){return this.Ym};dq.prototype.getMeta=dq.prototype.zh; 617dq.prototype.Ch=function(){return this.tb.length/this.Hc};dq.prototype.getRowCount=dq.prototype.Ch;dq.prototype.Ud=function(a){return a<this.tb.length/this.Hc?new gq(this,a):A};dq.prototype.getRow=dq.prototype.Ud;dq.prototype.CA=function(){var a=this.tb.length/this.Hc,b,c=new globalThis.Array(a);for(b=0;b<a;b++)c[b]=new gq(this,b);return c};dq.prototype.getRows=dq.prototype.CA; 618dq.prototype.zo=function(a){var b=this.Hc,c=this.tb,d=c.length/this.Hc;if(!a||a.length%b)throw new C(this.zo,0,"Invalid number of cells");this.tb=c.concat(a);return d};dq.prototype.addCells=dq.prototype.zo;dq.prototype.ly=function(){for(var a=this.Hc,b=this.tb,c=this.tb.length/this.Hc;a--;)b.push(x);return this.Ud(c)};dq.prototype.addRow=dq.prototype.ly;dq.prototype.ab=function(){return this.Ym.columnNames};dq.prototype.getColumnNames=dq.prototype.ab; 619dq.prototype.Fj=function(a){return this.So[a]===A?A:new hq(this,a)};dq.prototype.getColumn=dq.prototype.Fj;dq.prototype.va=function(a,b){return this.tb[a*this.Hc+this.So[b]]};dq.prototype.getCell=dq.prototype.va;dq.prototype.ue=function(a,b,c){b=this.So[b];if(a>=this.tb.length/this.Hc)throw new C(this.ue,0,"Row index out of bounds");if(b===A)throw new C(this.ue,0,"Column unknown");this.tb[a*this.Hc+b]=c};dq.prototype.setCell=dq.prototype.ue; 620dq.prototype.concat=function(a){var b=arguments.length,c,d=""+this.ab(),e=this.tb?this.tb.slice():[];for(c=0;c<b;c++){var f=arguments[c];if(!(f instanceof dq))throw new C(this.concat,c);if(""+f.ab()!==d)throw new C(this.concat,c,"Incompatible columns!");f.tb&&(e=e.concat(f.tb))}return fq(this.Ym,e)};dq.prototype.concat=dq.prototype.concat;var iq=/(\n|\t|\r|")/; 621dq.prototype.os=function(a,b){var c,d=this.Hc,e=this.ab(),f=[],g=[],h=this.tb,k=-1;for(c=0;c<d;c++)if(!a||a.test(e[c]))"WKT"===e[c]&&(k=f.length),f.push(c);if(!(a=f.length))throw new C(this.os,1,"No columns filtered");jq(this,g,e,0,d,f,a,k);if(b){var l=b.length;for(c=0;c<l;c++)g.push("\n"),e=b[c],jq(this,g,h,e,d,f,a,k)}else for(l=this.Ch(),e=0;e<l;e++)g.push("\n"),jq(this,g,h,e,d,f,a,k);return g.join("")}; 622function jq(a,b,c,d,e,f,g,h){var k;for(k=0;k<g;k++){k&&b.push("\t");var l=c[d*e+f[k]];if(k!==h){if(l!==x){l=String(l);if(iq.test(l))throw new C(a.os,0,'Invalid character (\\n, \\r, \\t, or ") in row '+d+" column "+a.Ym.columnNames[f[k]]);b.push(l)}}else b.push(l)}}function hq(a,b){this.$b=a;this.Nl=b}dq.Column=hq;hq.prototype.va=function(a){return this.$b.va(a,this.Nl)};hq.prototype.getCell=hq.prototype.va;hq.prototype.ue=function(a,b){this.$b.ue(a,this.Nl,b)};hq.prototype.setCell=hq.prototype.ue; 623function gq(a,b){this.$b=a;this.Kk=b}dq.Row=gq;gq.prototype.ab=function(){return this.$b.ab()};gq.prototype.getColumnNames=gq.prototype.ab;gq.prototype.va=function(a){return this.$b.va(this.Kk,a)};gq.prototype.getCell=gq.prototype.va;gq.prototype.ue=function(a,b){this.$b.ue(this.Kk,a,b)};gq.prototype.setCell=gq.prototype.ue;gq.prototype.Rf=function(){return this.$b};gq.prototype.getTable=gq.prototype.Rf;function kq(a,b,c,d){d=d||{};if(!b)throw new C(kq,1,"has to be a function");if(!c)throw new C(kq,2,"has to be a function");this.mn=b;this.dn=c;this.bh=[];this.pc={};this.xq=[];this.lh={};this.fs={};this.ls={};this.nx={};this.rj=d.duration||100;this.Gm=z(this.Gm,this);a=a.split("Meta:\t").slice(1);for(b=0;b<a.length;b++){d=a[b].split("\n");c=d[0].split("\t")[0];d=d.slice(1).join("\n");this.lh[c]=new Xp;this.pc[c]=$p(this.lh[c],d);var e={layerId:c,columnNames:this.pc[c]};this.xq.push(c);this.nx[c]= 624fq(e);this.fs[c]=rk();lq(this,d,c);this.Gm(c)}}function lq(a,b,c){var d=[],e=a.pc[c].length-1,f=a.nx[c];try{a.lh[c].parse(b,function(g,h,k){var l=!1;0<g&&(d[h]=k,h===e&&(a.bh.push(f.Ud(f.zo(d))),rk()-a.fs[c]>a.rj&&(l=!0)));return l},function(g,h,k){if(0<g&&h===e)return Pf(k)})}catch(g){a.dn(g)}}kq.prototype.cancel=function(){for(var a in this.ls)globalThis.clearTimeout(this.ls[a])};kq.prototype.cancel=kq.prototype.cancel; 625kq.prototype.Gm=function(a){var b=this,c,d;this.ls[a]=globalThis.setTimeout(function(){if(2===b.lh[a].getState())b.fs[a]=rk(),b.mn(b.bh,!1),b.bh=[],b.lh[a].resume(),b.Gm(a);else{c=!0;for(d=0;d<b.xq.length;d++)if(b.lh[b.xq[d]].getState()!==Yp){c=!1;break}c&&(0<b.bh.length&&b.mn(b.bh,!0),b.bh=[])}},0)};function mq(a){var b=nq;if(!a||!lb(a.layerId)||fb(a.rowFilter)&&!db(a.rowFilter)||fb(a.rowFilterContext)&&!ya(a.rowFilterContext))throw new C(b,1,fb("invalid layer config")?"invali
625d layer config":a);}function oq(a){return lb(a)&&/^[A-Z][A-Z0-9_]*$/.test(a)}function pq(a){for(var b=a&&a.length,c=2<=b&&"WKT"===a[--b]&&"GEOMETRY_ID"===a[--b];c&&b--;)c=oq(a[b]);return c} 626function qq(a,b){var c="",d=[];if(b){var e=a.geometries;if(e&&e.length){var f=Object.keys(e[0].attributes);c=c+("Meta:\t"+b+"\n")+f.join("\t");c+="\tWKT\n";for(a=0;a<e.length;a++){var g=e[a].attributes;var h=e[a].geometry;for(b=0;b<f.length;b++)d.push(g[f[b]]);c+=d.join("\t");c+="\t"+h+"\n";d=[]}}}else{h={};d=[];if(a.geometries)for(e=0;e<a.geometries.length;e++)b=a.geometries[e],h[b.layerId]||(h[b.layerId]=[]),h[b.layerId].push(b);for(f in h)d.push({layerId:f,geometries:h[f]});for(a=0;a<d.length;a++)c+= 627qq(d[a],d[a].layerId)}return c};function nq(a,b,c){var d=this,e=b&&b.rowFilter,f;nq.g.constructor.call(this,c);B(a,rq,nq,0);var g=c.resultType;mq(b);if(e){var h=Ta(b);h.rowFilter=e.toString()}else h=b;(new Vm).registerProcessor("cle","H.service.extension.worker.processor");var k=b.layerId;a.request(sq,tq,{detail_level:"all",layer_id:k},function(l){l=l.layers;var n;for(n=0;n<l.length;n++)if(l[n].layerId===k){h.level=l[n].level;break}f=a.i().clone().A(uq+"."+tq).u({meta:1});(new Xm("cle",{message:[d.uid,0,{tileSize:d.tileSize, 628projected:!0,onlyOutline:4===g,serverUrl:f.toString(),layerConfigs:[h],batchTiles:!1,horizontalMargin:1}]})).then(function(){d.rq=!0;d.jb()},d.Ic)},function(l){d.Ic(l.message)})}u(nq,Np);t("H.service.extension.customLocation.TileProvider",nq);nq.prototype.qu=function(a,b,c){return new Ep(a,b,c)}; 629nq.prototype.o=function(a,b,c,d,e){var f=this,g=this.getTileKey(a,b,c),h;g=this.Sb().get(g);var k={cancel:Ye},l=!0,n=this.resultType;g&&(4===n||8===n?g.Ih()||(d(lo.pop(this.tileSize),null),l=!1):(d(x),l=!1));if(l){var p=globalThis.setTimeout(function(){h=new Xm("cle",{message:[f.uid,1,[a,b,c]]});h.then(d,e)},500);k.cancel=function(){h?h.cancel():globalThis.clearTimeout(p)}}return k};nq.prototype.requestInternal=nq.prototype.o; 630nq.prototype.disposeInternal=function(){nq.g.disposeInternal.call(this);new Xm("cle",{message:[this.uid,3]})};function rq(a){rq.g.constructor.call(this,rq,a);io(rq)}u(rq,oo);t("H.service.extension.customLocation.Service",rq);rq.prototype.Da=function(){return{subDomain:"fleet.ls",path:"2"}};rq.CONFIG_KEY="customLocation";rq.prototype.Pd=function(a,b){var c=b&&b.resultType;a=new nq(this,a,b);return 1===c||2===c?new Zm(a):new sl(a)};rq.prototype.createTileLayer=rq.prototype.Pd; 631function vq(a,b,c,d){a=a===wq?"changes":"file";var e=b[a];var f=lb(e),g=!f&&B(e,Blob);if(!f&&!g)throw new C(d,0,"Invalid "+a+" parameter");if(xq)e=g?e:ff(e,"text/plain"),d=new globalThis.FormData,d.append(a,e,e.name||a+".wkt"),c.method="POST",c.data=d,delete b[a];else if(g)throw new C(d,0,"Sending Blob data is not supported by the browser");}var xq=globalThis.FormData&&!!globalThis.FormData.prototype.append;rq.prototype.request=function(a,b,c,d,e){return this.I(a,b,c,d,e)};rq.prototype.request=rq.prototype.request; 632rq.prototype.I=function(a,b,c,d,e){var f="text/plain",g=a===yq.LAYERS_UPLOAD||a===yq.LAYERS_MODIFY||a===yq.LAYERS_IMPORT,h=c,k={data:A,method:"GET",headers:this.pc};if(!a)throw new C(this.request,0,a);if(!b)throw new C(this.request,1,b);rp(this.request,3,d,e);g&&(B(c,Object,this.request,2,"Invalid request parameters"),h=Ta(c),vq(a,h,k,this.request));var l=this.i().clone().A(a+"."+b).u(h);b===zq.JSON&&(f="application/json");a=new qg(f,l.toString(),De,k);a.then(function(n){var p=n.issues;p&&n.error_id&& 633n.response_code?e(Error(p[0].message)):d(n)},function(n){"error"===n.type||404===n.status?e(Error(n.statusText||"Unable to load data")):n.json().then(function(p){e(Error("["+p.issues[0].message+"] "+l+" request failed"))},function(){e(Error("["+n.statusText+"] "+l+" request failed"))})});return a}; 634var sq="layers/list",wq="layers/modify",uq="tiled/tile",yq={LAYERS_DELETE:"layers/delete",LAYERS_GRANT:"layers/access/grant",LAYERS_LIST:sq,LAYERS_MODIFY:wq,LAYERS_UPLOAD:"layers/upload",LAYERS_IMPORT:"layers/import",SEARCH_ALL:"search/all",SEARCH_BBOX:"search/bbox",SEARCH_CORRIDOR:"search/corridor",SEARCH_PROXIMITY:"search/proximity",SEARCH_QUADKEY:"search/quadkey",SEARCH_TILE:uq};rq.EntryPoint=yq;var tq="json",zq={TXT:"txt",JSON:tq};rq.EntryPointType=zq; 635rq.prototype.Tb=function(a,b,c){var d=this;return this.request("search/all","txt",{filter:'WKT==""',layer_id:a},function(e){var f=String(e).replace(/[\r\n]+$/g,"").split("\t");d.request(sq,tq,{layer_id:a,detail_level:"all"},function(g){g=g.layers[0];g.columnNames=f;b(fq(g))},c)},c)};rq.prototype.getLayer=rq.prototype.Tb; 636rq.prototype.Au=function(a,b,c,d){function e(){return++g<f?h.request("layers/access/grant",tq,{layer_id:a,granted_app_id:b[g].grantedAppId,permissions:b[g].permissions.join(",")},e,d):h.Tb(a,c,d)}var f=b&&b.length,g=-1,h=this;return e()};rq.prototype.grantAccess=rq.prototype.Au;rq.prototype.Dt=function(a,b,c){return this.request("layers/delete",tq,{layer_ids:a},b,c)};rq.prototype.deleteLayer=rq.prototype.Dt; 637rq.prototype.od=function(a,b,c){function d(){setTimeout(function(){k.Tb(g,function(q){setTimeout(e.bind(null,q),n)},function(){64E3>l?(l+=n,d()):c(globalThis.Error("Timeout"))})},n);n*=2}function e(q){var r=JSON.stringify(q.ab()),v=a.grants;
637if(r!==JSON.stringify(h)){var w="Results into different column names on the backend: "+r;setTimeout(function(){k.Dt(g,function(){c(globalThis.Error(w))},function(y){c(globalThis.Error(w+". "+y.message))})},n)}else v&&v.length?k.Au(g,v,b,c):b(q)}var f,g,h,k=this, 638l=0,n=1E3;var p=!a||!oq(g=a.layerId)&&(f="layerId")||!pq(h=a.columnNames)&&(f="columnNames")?0:db(b)?db(c)?-1:2:1;if(0<=p)throw new C(k.od,p,f||arguments[p]);return k.Tb(g,function(){c(globalThis.Error("Layer exists already"))},function(){var q={layer_id:g,file:h.join("\t")},r=a.level,v=a.storage;r!==A&&(q.level=r);v!==A&&(q.storage=v);k.request("layers/upload",tq,q,d,c)})};rq.prototype.createLayer=rq.prototype.od; 639rq.prototype.Cg=function(a,b,c,d){var e=[],f;a=this.request(a,tq,b,function(g){g.geometries.length?(g=qq(g,b.layer_id),f=new kq(g,c,d),e.push(f)):c(Ze,!0)},d);e.push(a);return new vp(e)};rq.prototype.Zc=function(a,b,c,d,e,f){if(!kb(a))throw new C(this.Zc,0,"has invalid type");B(b,tc,this.Zc,1,"has invalid type");if(!ob(c))throw new C(this.Zc,2,"has invalid type");rp(this.Zc,3,d,e);a={layer_ids:a.join(","),proximity:b.lat+","+b.lng+","+c};f&&Wa(a,f);return this.Cg("search/proximity",a,d,e)}; 640rq.prototype.searchByProximity=rq.prototype.Zc;rq.prototype.Yc=function(a,b,c,d,e,f){var g="";if(!kb(a))throw new C(this.Yc,0,"has invalid type");if(!lb(b)&&!B(b,J))throw new C(this.Yc,1,"has invalid type");if(!ob(c))throw new C(this.Yc,2,"has invalid type");rp(this.Yc,3,d,e);a={layer_ids:a.join(","),radius:c};if(lb(b))a.route_id=b;else{var h=b.S;b=0;for(c=h.length;b<c;b+=3)g+=h[b]+","+h[b+1],b<c-3&&(g+=",");a.corridor=g}f&&Wa(a,f);return this.Cg("search/corridor",a,d,e)}; 641rq.prototype.searchByCorridor=rq.prototype.Yc;rq.prototype.se=function(a,b,c,d,e){function f(k,l){l&&h--;c(k,!h)}var g=[],h;if(!kb(a))throw new C(this.se,0,"has invalid type");B(b,E,this.se,1,"has invalid type");rp(this.se,2,c,d);b={bbox:b.fa+","+b.W+";"+b.ga+","+b.ca};e&&Wa(b,e);a=b.layer_id?[b.layer_id]:a;e=0;for(h=a.length;e<h;e++)b.layer_id=a[e],g.push(this.Cg("search/bbox",b,f,d));return new vp(g)};rq.prototype.searchByBoundingBox=rq.prototype.se; 642rq.prototype.Lr=function(a,b,c,d){var e,f=[];if(!lb(a))throw new C(this.Lr,0,"has invalid type");rp(this.Lr,1,b,c);var g={layer_id:a};d&&Wa(g,d);d=this.request("search/all",tq,g,function(h){h.geometries.length?(h=qq(h,a),e=new kq(h,b,c),f.push(e)):b(Ze,!0)},c);f.push(d);return new vp(f)};rq.prototype.searchAll=rq.prototype.Lr;var Aq={"delete":/^GEOMETRY_ID$/,append:/^(?!GEOMETRY_ID$)/}; 643function Bq(a,b,c,d,e,f){function g(){v++;d(this,v===q)}function h(O){v++;e(O,this,v===q)}var k="append"!==b,l,n={},p=Za(),q=0,r=[],v=0;if(!kb(c))throw new C(f,0,c);rp(f,1,d,e);for(l=c.length;l--;){var w=c[l];if(B(w,gq)){var y=w.Rf().zh().layerId;var F=w.va("GEOMETRY_ID");if(k){if(F===x||""===String(F))var G='GEOMETRY_ID must not be null or ""';n[F=y+"_"+F]&&(G="same GEOMETRY_ID for multiple rows");n[F]=w}else F!==x&&""!==String(F)&&(G='GEOMETRY_ID must be null or ""')}else G="Invalid type";if(G)throw new C(f, 6440,"- Invalid row at index "+l+", "+G);F=p[y];F||(F=p[y]=[],q++);F.push(w)}for(y in p){F=p[y];c=[];for(l=F.length;l--;)c.push(F[l].Kk);r.push(a.request(wq,tq,{layer_id:y,action:b,changes:F[0].Rf().os(Aq[b]||null,c)},z(g,F),z(h,F)))}return new vp(r)}rq.prototype.dt=function(a,b,c){return Bq(this,"append",a,b,c,this.dt)};rq.prototype.appendRows=rq.prototype.dt;rq.prototype.Hx=function(a,b,c){return Bq(this,"update",a,b,c,this.Hx)};rq.prototype.updateRows=rq.prototype.Hx; 645rq.prototype.Et=function(a,b,c){return Bq(this,"delete",a,b,c,this.Et)};rq.prototype.deleteRows=rq.prototype.Et;X.prototype.Hz=function(a){return this.Ja(rq,a)};X.prototype.getCustomLocationService=X.prototype.Hz;function Cq(a){np.g.constructor.call(this,Cq,a);io(Cq)}u(Cq,oo);t("H.service.extension.customRoute.Service",Cq);Cq.prototype.Da=function(){return{subDomain:"s.fleet.ls",path:"2"}};Cq.CONFIG_KEY="customRoute";Cq.prototype.Jc=function(a){return Error(a.issues&&a.issues.length?a.issues.map(function(b){return b.message}).join(". "):a)};Cq.prototype.Xg=function(a,b,c){rp(this.Xg,1,b,c);a=this.i().clone().A("calculateroute.json").u(a);return this.o(a,b,c)};Cq.prototype.calculateRoute=Cq.prototype.Xg; 646X.prototype.Iz=function(a){return this.Ja(Cq,a)};X.prototype.getCustomRoutingService=X.prototype.Iz;function Dq(a){Dq.g.constructor.call(this,Dq,a);this.uu=a.getToken}u(Dq,oo);t("H.service.iml.Service",Dq);Dq.prototype.Da=function(){return{host:"interactive.data.api.platform.here.com",path:"interactive/v1/catalogs"}}; 647Dq.prototype.Jc=function(a){function b(){for(var d=fa(c),e=d.next();!e.done;e=d.next()){e=e.value;var f=e.format;if(e.keys.every(function(g){return a[g]}))return f()}return JSON.stringify(a)}var c=[{keys:["code","title","cause","action"],format:function(){return a.code+": "+a.title+"; cause: "+a.cause+"; action: "+a.action}},{keys:["error","error_description"],format:function(){return a.error+": "+a.error_description}},{keys:["error","errorMessage"],format:function(){return a.error+": "+a.errorMessage}}]; 648return Error(ya(a)?b():a)};Dq.prototype.Dh=function(a,b,c,d,e){var f=this.Dh;Eq(f,0,a,b);Fq(f,2,c,d);a=this.i().clone().A(a+"/layers/"+b+"/statistics").u(e||{});return this.I(a,"GET",c,d)};Dq.prototype.getStatistics=Dq.prototype.Dh;Dq.prototype.lm=function(a,b,c,d,e,f,g,h,k){var l=k?"":".mvtf";a=this.i().clone().A(d+"/layers/"+e+"/tile/web/"+c+"_"+a+"_"+b+l).u(Object.assign({clip:!0},h));return this.I(a,"GET",k?f:function(n){return n.arrayBuffer().then(f)},g,void 0,k?"application/json":"arraybuffer")}; 649Dq.prototype.getFeaturesByTile=Dq.prototype.lm;Dq.prototype.hu=function(a,b,c,d,e,f){var g=this.hu;Gq(g,a);Eq(g,1,b,c);Fq(g,3,d,e);a=Hq(this,a,b,c,f);return this.I(a,"GET",d,e)};Dq.prototype.getFeatureById=Dq.prototype.hu;Dq.prototype.Ue=function(a,b,c,d,e,f){var g=this.Ue;Iq(g,a);Eq(g,1,b,c);Fq(g,3,d,e);a=Jq(this,a,b,c,f);return this.I(a,"GET",d,e)};Dq.prototype.getFeaturesById=Dq.prototype.Ue; 650Dq.prototype.wh=function(a,b,c,d,e){var f=this.wh;if(!ya(a)||!(a.bbox||a.north&&a.east&&a.south&&a.west))throw new C(f,0,'must be an object with either "bbox" or a full set of "north", "east", "south" and "west"');Eq(f,1,b,c);Fq(f,3,d,e);a=this.i().clone().A(b+"/layers/"+c+"/bbox").u(a);return this.I(a,"GET",d,e)};Dq.prototype.getFeaturesByBoundingBox=Dq.prototype.wh; 651Dq.prototype.ju=function(a,b,c,d,e){var f=this.ju;if(!(ya(a)&&a.radius&&(a.lat&&(a.lng||a.lon)||a.refCatalogHrn&&a.refLayerId&&a.refFeatureId)))throw new C(f,0,'must be an object with "radius" and a combination of either "lat"+"lng" or "refCatalogHrn"+"refLayerId"+"refFeatureId"');Eq(f,1,b,c);Fq(f,3,d,e);a=this.i().clone().A(b+"/layers/"+c+"/spatial").u(a);return this.I(a,"GET",d,e)};Dq.prototype.getFeaturesByPointAndRadius=Dq.prototype.ju; 652Dq.prototype.iu=function(a,b,c,d,e,f){var g=this.iu;if(!ya(a)||!a.radius)throw new C(g,0,'must be an object with "radius"');Kq(g,1,b);Eq(g,2,c,d);Fq(g,4,e,f);a=this.i().clone().A(c+"/layers/"+d+"/spatial").u(a);return this.I(a,"POST",e,f,b)};Dq.prototype.getFeaturesByGeometryAndRadius=Dq.prototype.iu;Dq.prototype.Nw=function(a,b,c,d,e){var f=this.Nw;Eq(f,0,a,b);Fq(f,2,c,d);a=this.i().clone().A(a+"/layers/"+b+"/search").u(e||{});return this.I(a,"GET",c,d)};Dq.prototype.searchFeatures=Dq.prototype.Nw; 653Dq.prototype.av=function(a,b,c,d,e){var f=this.av;Eq(f,0,a,b);Fq(f,2,c,d);a=this.i().clone().A(a+"/layers/"+b+"/iterate").u(e||{});return this.I(a,"GET",c,d)};Dq.prototype.iterateFeatures=Dq.prototype.av;Dq.prototype.nf=function(a,b,c,d,e,f){var g=this.nf;Kq(g,0,a);Eq(g,1,b,c);Fq(g,3,d,e);b=Lq(this,b,c,f);return this.I(b,"PUT",d,e,a)};Dq.prototype.putFeatures=Dq.prototype.nf; 654Dq.prototype.lf=function(a,b,c,d,e,f){var g=this.lf;Kq(g,0,a);Eq(g,1,b,c);Fq(g,3,d,e);b=Lq(this,b,c,f);return this.I(b,"POST",d,e,a)};Dq.prototype.postFeatures=Dq.prototype.lf;Dq.prototype.If=function(a,b,c,d,e){var f=this.If;Iq(f,a);Eq(f,1,b,c);Fq(f,3,d,e);a=Jq(this,a,b,c);
654return this.I(a,"DELETE",d,e)};Dq.prototype.deleteFeatures=Dq.prototype.If;Dq.prototype.xw=function(a,b,c,d,e,f,g){var h=this.xw;Gq(h,a);Kq(h,1,b);Eq(h,2,c,d);Fq(h,4,e,f);a=Hq(this,a,c,d,g);return this.I(a,"PUT",e,f,b)}; 655Dq.prototype.putFeature=Dq.prototype.xw;Dq.prototype.dw=function(a,b,c,d,e,f,g){var h=this.dw;Gq(h,a);Kq(h,1,b);Eq(h,2,c,d);Fq(h,4,e,f);a=Hq(this,a,c,d,g);return this.I(a,"PATCH",e,f,b)};Dq.prototype.patchFeature=Dq.prototype.dw;Dq.prototype.Ct=function(a,b,c,d,e){var f=this.Ct;Gq(f,a);Eq(f,1,b,c);Fq(f,3,d,e);a=Hq(this,a,b,c);return this.I(a,"DELETE",d,e,void 0,"text/plain")};Dq.prototype.deleteFeature=Dq.prototype.Ct; 656function Lq(a,b,c,d){return a.i().clone().A(b+"/layers/"+c+"/features").u(d||{})}function Jq(a,b,c,d,e){b=Object.assign({},e,{id:new zo(b)});return Lq(a,c,d,b)}function Hq(a,b,c,d,e){return a.i().clone().A(c+"/layers/"+d+"/features/"+b).u(e||{})} 657Dq.prototype.I=function(a,b,c,d,e,f){f=void 0===f?"application/json":f;b={method:b,headers:Object.assign({},e?{"Content-Type":"application/geo+json"}:void 0,"function"===typeof this.uu?{Authorization:"Bearer "+this.uu()}:void 0,this.pc)};e&&(b.data=JSON.stringify(e));e=new qg(f,a.toString(),De,b);e.then(c,ro(this,a,d));return e};Dq.CONFIG_KEY="iml";function Eq(a,b,c,d){ib(c,"String",a,b,"must be a string");ib(d,"String",a,b+1,"must be a string")} 658function Gq(a,b){ib(b,"String",a,0,"must be a string")}function Iq(a,b){if(!Array.isArray(b)||0===b.length||b.some(function(c){return"string"!==typeof c}))throw new C(a,0,"must be a non-empty array of strings");}function Kq(a,b,c){if(!ya(c))throw new C(a,b,"must be a GeoJSON object");}function Fq(a,b,c,d){if(!db(c))throw new C(a,b,"must be a function");if(!db(d))throw new C(a,b+1,"must be a function");}X.prototype.Xz=function(a){return this.Ja(Dq,a)};X.prototype.getIMLService=X.prototype.Xz;function Mq(a,b,c,d){Mq.g.constructor.call(this,d?{min:d.min,max:d.max,engineType:d.engineType}:void 0);B(a,Dq,Mq,0);if(!lb(b))throw new C(Mq,1,'"catalogHrn" must be a string');if(!lb(c))throw new C(Mq,2,'"layerId" must be a string');this.$=a;this.$g=b;this.Mh=c;this.Ok=ya(d)&&ya(d.parameters)?d.parameters:{};this.Xa(this.Ep())}u(Mq,R);t("H.service.iml.Provider",Mq);Mq.prototype.o=function(a,b,c,d,e){return this.$.lm(a,b,c,this.$g,this.Mh,d,e,this.Ok)};Mq.prototype.requestInternal=Mq.prototype.o; 659Mq.prototype.Xc=We;Mq.prototype.providesOMV=Mq.prototype.Xc;Mq.prototype.K=function(){return this.mb()};Mq.prototype.getStyle=Mq.prototype.K;Mq.prototype.Cb=function(a){B(a,Xg)&&a.Yb("MVT");this.Xa(a)};Mq.prototype.setStyle=Mq.prototype.Cb; 660Mq.prototype.Ep=function(){return this.vb===mi.WEBGL?new Xg({sources:{iml:{type:"MVT"}},layers:{iml:{data:{source:"iml",layer:this.$g+":"+this.Mh},points:{filter:{$geometry:"point"},draw:{points:{collide:!1,order:200,color:"#92CF48",size:[[10,"8px"],[14,"12px"],[18,"16px"]]}}},polygons:{filter:{$geometry:"polygon"},draw:{polygons:{order:201,color:"#E39E3C"},lines:{order:202,color:"#755DA5",width:"1px"}}},lines:{filter:{$geometry:"line"},draw:{lines:{order:203,color:"#0258AE",width:"2px",join:"round", 661cap:"round"}}}}}}):new H.map.render.harp.Style({styles:[{layer:this.$g+":"+this.Mh,when:["==",["geometry-type"],"Point"],technique:"circles",renderOrder:200,color:"#92CF48",size:["interpolate",["linear"],["zoom"],10,8,14,12,18,16]},{layer:this.$g+":"+this.Mh,when:["==",["geometry-type"],"Polygon"],technique:"polygon",color:"#E39E3C",renderOrder:201},{layer:this.$g+":"+this.Mh,when:["==",["geometry-type"],"Polygon"],technique:"solid-line",color:"#755DA5",width:"1px",renderOrder:202},{layer:this.$g+ 662":"+this.Mh,when:["==",["geometry-type"],"LineString"],technique:"solid-line",color:"#0258AE",width:"2px",renderOrder:203}]})};function Nq(a,b,c){var d=this,e=c||{},f=+e.min,g=+e.max;e.tileSize=e.tileSize||512;e.min=f?gc(f,1,17):1;e.min+=Gk(e.tileSize,1);e.max=g?gc(g,1,17):17;Nq.g.constructor.call(this,e);B(a,Oq,Nq,0);B(b,zg,Nq,1);this.$=a;b.Yb&&b.Yb("OMV");this.Xa(b,!0);this.xn=!1;c&&(c.politicalView&&(this.yn=c.politicalView),Pq(this,c.lg,c.lg2),this.xn=!!c.pois);this.zw=function(){d.Hl=go(d);d.reload(!1)};a.addEventListener("versionupdate",this.zw);this.Hl=go(this);Nq.prototype.Xo=function(){var h=/^v2\/vectortiles\/(.+)\/mc$/.exec(a.i().jf); 663return h?h[1]:A+""}()}u(Nq,R);t("H.service.omv.Provider",Nq);Nq.prototype.Xc=We;Nq.prototype.providesOMV=Nq.prototype.Xc;Nq.prototype.cc=function(a){return this.Hl.test(a)};Nq.prototype.cacheFilter=Nq.prototype.cc;Nq.prototype.Vd=function(a,b,c){return this.$.Sf(a,b,c).toString()};Nq.prototype.getTileKey=Nq.prototype.Vd;Nq.prototype.Sb=function(){return this.TB};Nq.prototype.getCache=Nq.prototype.Sb;Nq.prototype.tA=function(){return this.yn};Nq.prototype.getPoliticalView=Nq.prototype.tA; 664Nq.prototype.bD=function(a){var b=this.yn;this.yn=a;this.dispatchEvent(new ji("politicalviewchange",this.yn,b))};Nq.prototype.setPoliticalView=Nq.prototype.bD;Nq.prototype.MAX_STORE_TIME=2592E6;Nq.prototype.Vi=function(){return pm()};Nq.prototype.td=function(){return pm()?om():Nq.g.td.call(this)};Nq.prototype.o=function(a,b,c,d,e){return this.$.Pa(a,b,c,d,e)};Nq.prototype.requestInternal=Nq.prototype.o;Nq.prototype.Cb=function(a){a.Yb&&a.Yb("OMV");this.Xa(a)};Nq.prototype.setStyle=Nq.prototype.Cb; 665Nq.prototype.K=function(){return Nq.g.mb.apply(this)};Nq.prototype.getStyle=Nq.prototype.K;Nq.prototype.mb=function(){var a=Nq.g.mb.apply(this),b=a.getState()===Ag.READY,c=a.Sd();b&&c&&c.global&&(this.pq&&(this.ow&&(c.global.ux_language=this.ow),this.Wt&&(c.global.ux_language_fallback=this.Wt)),this.xn&&c.global.poi&&c.global.poi["default"]&&(c.global.poi["default"].visible=this.xn),this.pq||this.xn)&&(a=new Xg(c,a.Lc()));return a};Nq.prototype.getStyleInternal=Nq.prototype.mb; 666function Pq(a,b,c){var d=lb(b),e=lb(c);d&&(a.ow=b);e&&(a.Wt=c);if(d||e)a.Zj=[],d=/^([a-zA-Z]{2})(-|$)/,(e=d.exec(b))&&("zh"===e[1]?a.Zj.push(b):a.Zj.push(e[1])),(e=d.exec(c))&&("zh"===e[1]?a.Zj.push(c):a.Zj.push(e[1])),a.pq=!0}Nq.prototype.pq=!1;var Qq=["en"];Nq.prototype.Ip=function(){return this.Zj||Qq};Nq.prototype.getLanguages=Nq.prototype.Ip;Nq.prototype.disposeInternal=function(){Nq.g.disposeInternal.call(this);this.$.removeEventListener("versionupdate",this.zw)};Nq.prototype.TB=new kk(256); 667Nq.prototype.U=function(a,b){return this.$.U().query(this.Xo,b,a)};Nq.prototype.getCopyrights=Nq.prototype.U;function Oq(a){Oq.g.constructor.call(this,Oq,a);var b=po(this,a).mapVersion;this.Fn=a.queryParams||{};this.dk=fb(b)?b:Rq[this.i().toString()];fb(this.dk)||Sq(this)}u(Oq,oo);t("H.service.omv.Service",Oq);Oq.prototype.Da=function(){return{subDomain:"vector",path:"v2/vectortiles/base/mc"}};Oq.CONFIG_KEY="omv";var Rq={};rb(Rq);Oq.prototype.hA=function(){return this.dk};Oq.prototype.getMapVersion=Oq.prototype.hA; 668function Sq(a){a.o(a.i().clone().A("../../info"),function(b){b=b.mapVersion;var c=a.i().toString();a.dk=b;b!==Rq[c]&&(Rq[c]=b,a.dispatchEvent("versionupdate"))},function(){})}Oq.prototype.od=function(a,b,c){b=b||{};var d={min:0,max:22};ya(c)&&ho(d,c);
668return new sl(new Nq(this,a,b),d)};Oq.prototype.createLayer=Oq.prototype.od;Oq.prototype.Pa=function(a,b,c,d,e){return this.o(this.Sf(a,b,c),function(f){return f.arrayBuffer().then(d,e)},e,"arraybuffer")}; 669Oq.prototype.Sf=function(a,b,c){a=this.i().clone().A(c+"/"+a+"/"+b+"/omv");fb(this.dk)&&a.u({mv:this.dk}).u(this.Fn);return a};Oq.prototype.rm=function(a){return kn()+"/"+a};Oq.prototype.Nj=function(a,b){if(!db(a))throw new C(this.Nj,0,'"onResult" must be a function');if(!db(b))throw new C(this.Nj,1,'"onError" must be a function');return this.o(this.i().clone().wc("v2/vectortiles/pviews"),a,b)};Oq.prototype.getPoliticalViews=Oq.prototype.Nj;X.prototype.Lj=function(a){return this.Ja(Oq,a)}; 670X.prototype.getOMVService=X.prototype.Lj;Oq.prototype.Kf=function(){this.ec=new to;this.o(this.i().clone().A("../../copyrights"),z(this.pl,this),Ye)};Oq.prototype.pl=function(a){uo(this.ec,a);this.dispatchEvent("copyrightupdate")};Oq.prototype.U=function(){this.ec||this.Kf();return this.ec};Oq.prototype.getCopyrights=Oq.prototype.U;function Tq(a){Tq.g.constructor.call(this,Tq,a)}u(Tq,oo);t("H.service.RoutingService8",Tq);Tq.CONFIG_KEY="routing_v8";Tq.prototype.Da=function(){return{subDomain:"router",path:"v8/routes"}};Tq.prototype.Jc=function(a){return Error(401===(a&&void 0===a.status?401:a.status)?a.error_description:a.title,{cause:a})};Tq.prototype.Xg=function(a,b,c){a=this.i().clone().u(a);return this.o(a,b,c)};Tq.prototype.calculateRoute=Tq.prototype.Xg; 671Tq.prototype.Mo=function(a,b,c){a=this.i().clone().la("isoline").wc("v8/isolines").u(a);return this.o(a,b,c)};Tq.prototype.calculateIsoline=Tq.prototype.Mo;function Uq(a){Uq.g.constructor.call(this,Uq,a);io(Uq,"Use HERE Routing API v8 instead.")}u(Uq,oo);t("H.service.RoutingService",Uq);Uq.prototype.Da=function(){return{subDomain:"route.ls",path:"routing/7.2"}};Uq.prototype.Jc=function(a){return Error(a.details)};Uq.CONFIG_KEY="routing";Uq.prototype.Xg=function(a,b,c){a=this.i().clone().A("calculateroute.json").u(a);return this.o(a,b,c)};Uq.prototype.calculateRoute=Uq.prototype.Xg; 672Uq.prototype.Mo=function(a,b,c){a=this.i().clone().la("isoline").A("calculateisoline.json").u(a);return this.o(a,b,c)};Uq.prototype.calculateIsoline=Uq.prototype.Mo;X.prototype.su=function(a,b){b=+b||7;if(7===b)b=Uq;else if(8===b)b=Tq;else throw new C(this.su,1,"allowed values are 7 and 8");return this.Ja(b,a)};X.prototype.getRoutingService=X.prototype.su;t("H.service.buildInfo",function(){return Wh("H-service","1.61.0","3b08619",{region:"row"})}); 673 674function Vq(a,b,c,d,e){e&1&&Wq(a,a,b,c,d,0);e&2&&Wq(a,a,b,c,d,1);e&4&&Wq(a,a,b,c,d,2);e&8&&Wq(a,a,b,c,d,3)} 675function Wq(a,b,c,d,e,f){var g=(c+1)*(c+1),h,k=4*d,l=c+1,n,p=[{r:0,nz:0,b:0,a:0,next:null}];var q=1;var r=["r","g","b","a"][f];var v=2*c+1;for(var w,y;q<v;q++)p[q]={r:0,nz:0,b:0,a:0,next:null},p[q-1].next=p[q];p[2*c].next=p[0];var F=4*(d-1);for(h=0;h<e;h++){var G=h*k;var O=a[G+f];var V=O*l*(c+2)/2;v=O*l;for(q=0;q<=c;q++)p[q][r]=O;var Ua=0;for(q=1;q<=c;q++){var aa=q<d?G+4*q:G+F;aa=a[aa+f];V+=aa*(l-q);Ua+=aa;p[c+q][r]=aa}aa=p[0];w=p[l];q=G;y=4*l;var vb=G+F;for(O=0;O<d;O++){b[q+f]=V/g;V-=v;var Ba=O+ 676l<d?q+y:vb;Ba=a[Ba+f];Ua+=Ba;V+=Ua;v-=aa[r];v+=w[r];Ua-=w[r];aa[r]=Ba;aa=aa.next;w=w.next;q+=4;if(!V)for(;(n=4*(O+l))<k&&0===a[G+f+n];)O++,q+=4}}G=(e-1)*k;for(O=0;O<d;O++){a=4*O;h=b[a+f];V=h*l*(c+2)/2;v=h*l;for(q=0;q<=c;q++)p[q][r]=h;Ua=0;for(q=1;q<=c;q++)aa=q<e?a+q*k:a+G,aa=b[aa+f],V+=aa*(c-q+1),Ua+=aa,p[c+q][r]=aa;aa=p[0];w=p[l];q=a;vb=l*k;F=a+G;for(h=0;h<e;h++)if(b[q+f]=V/g,V-=v,Ba=h+l<e?q+vb:F,Ba=b[Ba+f],Ua+=Ba,V+=Ua,v-=aa[r],v+=w[r],Ua-=w[r],aa[r]=Ba,aa=aa.next,w=w.next,q+=k,!V)for(;(n=h+l)< 677e&&0===b[n*k+f+a];)h++,q+=k}};function Xq(a,b,c){this.$A=b=a>>b;this.CB=Math.log(b)*Math.LOG2E;this.Ec=a=document.createElement("CANVAS");this.vy=a.getContext("2d");this.wy=a.width=a.height=3*b;var d=document.createElement("canvas");a=c.Ru;var e=c.pD;b=[];var f;d.width=256;d.height=1;d=d.getContext("2d");for(g in e)e.hasOwnProperty(g)&&b.push({stop:parseFloat(g),value:e[g]});e=b.length;b.sort(this.oD);0<b[0].stop&&b.unshift({stop:0,value:b[0].value});1>b[e-1].stop&&b.push({stop:1,value:b[e-1].value});e=b.length;var g=d.createLinearGradient(0, 6780,256,0);for(f=0;f<e;f++){if(!a&&k){var h=k.stop+(b[f].stop-k.stop)/2;g.addColorStop(h,k.value);g.addColorStop(h,b[f].value)}g.addColorStop(b[f].stop,b[f].value);var k=b[f]}d.fillStyle=g;d.fillRect(0,0,256,1);this.Dy=d.getImageData(0,0,256,1).data;this.aB=c.Ru}Xq.prototype.oD=function(a,b){return a.stop-b.stop};Xq.prototype.Tx="#000";Xq.prototype.hy="#080";function Yq(a,b){this.canvas=a;this.size=b};function Zq(a,b,c){this.cf=a=gc(a,0,30);this.Ra=b;this.oj=c;this.gs=[];this.ci=[];do this.ci[a]=[],this.gs[a]=new $q;while(a--);b===ar?(this.Ts=br,this.normalize=cr):(this.Ts=dr,this.normalize=er);this.gk=1/0;this.Xm=-1/0}var fr=Math.log(.5);function cr(a){return this.ip?Math.round((a-this.gk)/this.ip*255):127}function er(a){return void 0===this.bu?127:Math.round(255*Math.pow(a,this.bu))} 679Zq.prototype.zc=function(a){var b,c;var d=a.value;void 0===d&&(d=1);d>this.Xm&&(this.Xm=d,this.ip=this.Xm-this.gk);d<this.gk&&(this.gk=d,this.ip=this.Xm-this.gk);var e=ri.Se(a).scale(1073741823).floor();d=this.cf;var f=e.x>>30-d;e=e.y>>30-d;for(c=this.Ts;-1<d;){this.ci[d][e]||(this.ci[d][e]=[]);(b=this.ci[d][e][f])||(b=this.ci[d][e][f]=new c(f,e,d));b.zc(a,d);var g=this.gs[d];g.Bv>b.fd&&(g.Bv=b.fd);g.Qh<b.fd&&(g.Qh=b.fd);g.Av>b.Cc&&(g.Av=b.Cc);g.Iq<b.Cc&&(g.Iq=b.Cc);d--;f>>=1;e>>=1}}; 680function gr(a,b,c,d,e){var f=1<<b,g,h;d=fc(d,f);f=0<=c&&c<f&&(g=a.ci[b])&&(h=g[c])&&(f=h[d])||null;!f&&e&&0<=b&&(f=gr(a,b-1,c>>1,d>>1,e));return f}function hr(a,b,c,d,e,f){for(var g,h=[];c<=d;c++)for(g=e;g<=f;g++)h.push(gr(a,b,c,g,!1));return h}function ir(a,b){var c=0,d=0,e=gr(a,0,0,0,!1),f;if(b.fm)return b.Aj;b.z===a.cf?b.Aj=b.Cc:(jr(a,b,function(g){var h=kr(a,g),k=4-h.length;if(g.z!==a.cf){for(f=0;f<h.length;f++)c+=h[f].Cc,d++;c+=k*e.Cc;d+=k}}),b.Aj=c/d);b.fm=!0;return b.Aj}
681function jr(a,b,c){b=[b];for(var d,e;0<b.length;)e=b.shift(),d=kr(a,e),c(e),b.push.apply(b,d)}function kr(a,b){var c=[],d,e,f;for(e=0;1>=e;e++)for(f=0;1>=f;f++)(d=gr(a,b.z+1,2*b.x+e,2*b.y+f,!1))&&c.push(d);return c}Zq.prototype.clear=function(){Zq.call(this,this.cf,this.Ra,this.oj)};function dr(a,b,c){this.x=a;this.y=b;this.z=c;this.Cc=this.fd=this.count=0;this.fm=!1;this.Aj=0}dr.prototype.zc=function(a,b){this.count++;this.fd+=a.value||1;this.Cc=this.fd/Math.pow(2,2*(30-b))}; 682function br(a,b,c){this.x=a;this.y=b;this.z=c;this.Cc=this.fd=this.count=0;this.fm=!1;this.Aj=0}br.prototype.zc=function(a){a=a.value;this.fd+=void 0!==a?a:1;this.Cc=this.fd/++this.count;this.fm=!1};function $q(){this.Bv=this.Av=1/0;this.Qh=this.Iq=-1/0};function lr(a,b){var c,d=0;if(!ya(a)||Sa(a))throw new C(lr,0,a);for(c in a){var e=+c;d++;if(!(ob(e)&&0<=e&&1>=e&&lb(a[c])))throw new C(lr,0,a);}if(2>d)throw new C(lr,0,"Specify at least 2 stops");this.pD=a;this.Ru=!!b}t("H.data.heatmap.Colors",lr);var mr=new lr({0:"#008","0.2":"#0b0","0.5":"#ff0","0.7":"#f00"},!0);lr.DEFAULT=mr;function nr(a){var b=a||{},c=+b.sampleDepth,d=b.pointSize;a=+b.coarseness;var e=b.colors,f={min:b.min,max:b.max,engineType:b.engineType},g=b.tileSize,h=+b.dataMax;b.tileSize&&(f.tileSize=g);R.call(this,f);this.Fg(b.opacity);this.Ra="value"===b.type?ar:or;
682this.sampleDepth_=ob(c)?gc(Math.round(c),1,8):4;this.Lw=this.Ra===or?ob(d)?gc(Math.round(7-d),0,6):2:1;this.et=!!b.assumeValues;b=this.max;this.oj=ob(h)?gc(Math.round(h),this.min,b+this.sampleDepth_):b;a=ob(a)?gc(Math.round(a),0,3):1;if(e&&!B(e,lr))throw new C(nr, 6830,"colors");this.Bi=new Zq(b+this.sampleDepth_+this.Lw,this.Ra,this.oj);this.vD=new Xq(this.tileSize,a,e||mr);this.sg=z(this.sg,this);this.mg=z(this.mg,this);this.Mn=new pl(20,this.sg)}u(nr,R);t("H.data.heatmap.Provider",nr);nr.prototype.Fd=function(a){this.Fg(a)};nr.prototype.setOpacity=nr.prototype.Fd;nr.prototype.Ve=function(){return this.Sc};nr.prototype.getOpacity=nr.prototype.Ve;nr.prototype.zk=We;nr.prototype.providesRasters=nr.prototype.zk; 684nr.prototype.o=function(a,b,c,d,e){var f=this.et,g,h;if(gr(this.Bi,0,0,0,!1)){if(!f){var k=hr(this.Bi,c,b-1,b+1,a-1,a+1);for(g=k.length;g--&&!f;)if(null!==k[g]){f=!0;break}}f&&(h=this.Mn.push([a,b,c,d,e],this.mg))}f||d(null);return h||Sk};nr.prototype.requestInternal=nr.prototype.o; 685nr.prototype.sg=function(a,b){var c=a.done,d=b[0],e=b[1],f=b[2];b=document.createElement("canvas");var g=this.tileSize,h=b.getContext("2d");b.width=b.height=g;var k=this.vD;var l=this.Bi,n=this.et,p=this.Ra,q=this.Lw;var r=k.$A;var v=k.vy,w,y,F=p===or?void 0===q?2:q:1;q=F;F=Math.min(this.sampleDepth_+F,k.CB);var G=k.wy,O=l.cf;if(n&&p===ar){for(y=-1;1>=y;y++)for(n=-1;1>=n;n++){var V=(V=gr(l,f,e+y,d+n,!0))?l.normalize(ir(l,V)):128;v.fillStyle="rgba("+V+",128,0,1)";v.fillRect((n+1)*r,(y+1)*r,r,r)}n= 686r-Math.floor(r/10);y=3;V=v.getImageData(0,0,G,G);Vq(V.data,n,G,G,y);v.putImageData(V,0,0)}else v.fillStyle=n?k.hy:k.Tx,v.fillRect(0,0,G,G);for(;q<=F&&f+q<=O;q++){n=r>>q;y=r-n;var Ua=p===or?127+Math.floor(128/(1<<F-q)):255;V=(1<<q)+2;var aa=1<<q;var vb=d<<q;var Ba=e<<q;aa=hr(l,f+q,Ba-1,Ba+aa,vb-1,vb+aa);for(vb=aa.length;vb--;){Ba=vb%V;var Pa=vb/V<<0;if(w=aa[vb])w=l.normalize(w.Cc),v.fillStyle="rgba("+w+","+Ua+",0,1)",v.fillRect(Ba*n+y,Pa*n+y,n,n)}V=v;Ua=n;aa=y;vb=r+2*n;n=r+2*n;Ba=Ba=3;Pa=v.getImageData(aa, 687y,vb,n);Vq(Pa.data,Ua,vb,n,Ba);V.putImageData(Pa,aa,y)}d=v.getImageData(0,0,G,G);e=k.Dy;f=k.aB;l=d.data;F=0;for(G=l.length;F<G;F+=4)p=l[F],q=l[F+1],4===e.length&&(p=0),l[F]=e[4*p],l[F+1]=e[4*p+1],l[F+2]=e[4*p+2],l[F+3]=e[4*p+3]*(f?q/255:10>q?0:1);v.putImageData(d,0,0);k=new Yq(k.Ec,r);r=k.size;h.drawImage(k.canvas,r,r,r,r,0,0,g,g);c.call(a,b)};nr.prototype.mg=function(a,b,c){var d=a.data;a=d[3];d=d[4];c?d():a(b)}; 688nr.prototype.Zs=function(a,b){var c;if(!kb(a))throw new C(this.Zs,0,a);if(c=a.length){for(;c--;)this.Bi.zc(a[c]);a=this.Bi;var d;c=a.gs;var e=a.cf,f=0;if(a.Ra===or){var g=c[a.cf].Qh;for(d=a.cf;0<=d;d--)if(c[d].Qh===g)f=d;else break;g=c[0].Qh;for(d=0;d<=f;d++)if(g===c[d].Qh)e=d;else break;f>a.oj&&(f=a.oj);g=Math.round(e+(f-e)/2);a.bu=fr/Math.log(c[g].Iq)}this.reload(!!b)}};nr.prototype.addData=nr.prototype.Zs;nr.prototype.clear=function(){this.Bi.clear();this.reload(!0)};nr.prototype.clear=nr.prototype.clear;var or=0,ar=1;function pr(){}t("H.data.utils.Dom",pr);pr.prototype.sh=function(a){return!!a&&/^\s*(1|true)\s*$/i.test(this.Ua(a))};pr.prototype.getBoolean=pr.prototype.sh;pr.prototype.Ua=function(a){var b;try{if(a.nodeType===Node.ATTRIBUTE_NODE)return a.value;var c="";var d=0;var e=a.childNodes;for(b=e.length;d<b;d++)e[d].nodeType!==Node.COMMENT_NODE&&(c+=e[d].nodeValue.replace(/^\s+|\s+$/g,""))}catch(f){}return c||""};pr.prototype.getString=pr.prototype.Ua; 689pr.prototype.mm=function(a){return parseFloat(this.Ua(a))||0};pr.prototype.getFloat=pr.prototype.mm;pr.prototype.bw=function(a){var b=a.split(/\s+/),c=b.length,d=!(b&&1==c),e=d?1:3,f=[],g;d||(b=a.split(","),c=b.length);for(g=0;g<c;g+=e)if(a=this.fr(d?b[g]:g+3>b.length?null:b.slice(g,g+3)))f.push(a);else return[];return f};pr.prototype.parseCoords=pr.prototype.bw; 690pr.prototype.fr=function(a){if(!a)return null;var b=a instanceof Array&&0<a.length&&4>a.length?a:a.split(",");a=parseFloat(b[0]);var c=parseFloat(b[1]);b=parseFloat(b[2]);return isNaN(c)||isNaN(a)?null:new tc(c,a,isNaN(b)?void 0:b)};pr.prototype.parseCoord=pr.prototype.fr;pr.prototype.km=function(a){a=this.Ua(a);return/^[0-9a-fA-F]{8}$/.test(a)?"#"+a.substr(6,2)+a.substr(4,2)+a.substr(2,2)+a.substr(0,2):"#000000ff"};pr.prototype.getColor=pr.prototype.km;function qr(){this.ZA={4:function(a){return["#",a.charAt(1),a.charAt(1),a.charAt(2),a.charAt(2),a.charAt(3),a.charAt(3),"ff"].join("")},5:function(a){return["#",a.charAt(1),a.charAt(1),a.charAt(2),a.charAt(2),a.charAt(3),a.charAt(3),a.charAt(4),a.charAt(4)].join("")},7:function(a){return a+"ff"},9:function(a){return a}};this.UC={4:function(a){return[rr(a.charAt(1)),rr(a.charAt(2)),rr(a.charAt(3)),255]},5:function(a){return[rr(a.charAt(1)),rr(a.charAt(2)),rr(a.charAt(3)),rr(a.charAt(4))]},7:function(a){a= 691parseInt(a.substring(1),16);return[a>>16&255,a>>8&255,a&255,255]},9:function(a){a=parseInt(a.substring(1),16);return[a>>24&255,a>>16&255,a>>8&255,a&255]}}}t("H.data.utils.ColorHelper",qr);function rr(a){a=parseInt(a,16);return(a<<4)+a}function sr(a){return 16>a?"0"+Math.round(a).toString(16):Math.round(a).toString(16)} 692function tr(a,b,c){if(!/^(#|rgb).*/.test(b))return[0,0,0,255];c||(c="","#"===b.charAt(0)?c=a.ZA[b.length]?b:"":"rgb"===b.substr(0,3)&&(b=b.match(/\d+(\.\d+)?/g),c=b.length,c=2<c&&5>c?["#",sr(+b[0]),sr(+b[1]),sr(+b[2]),3<c?sr(255*+b[3]):"ff"].join(""):""),b=c);a=a.UC[b.length](b);a[3]=Math.round(a[3]/255*100)/100;return a} 693qr.prototype.wx=function(a,b){var c="";if(!/^(#|rgb).*/.test(a)){c="";for(a=0;6>a;a++)c+="ABCDEF0123456789".charAt(Math.floor(16*Math.random()));return c+"ff"}a=tr(this,a,b);for(b=0;4>b;b++)c+=""+sr(3>b?Math.floor(Math.random()*(a[b]-0+1))+0:255*a[b]);return c};qr.prototype.toRandomRGBA=qr.prototype.wx;function ur(a){a=a.childNodes;for(var b,c=a.length,d=new pr,e=new qr;c--;)switch(b=a[c],b.nodeName){case "color":this.color=d.km(b);break;case "colorMode":this.Cy=d.Ua(b)}"random"===this.Cy&&(this.color="#"+e.wx(this.color,!1))}t("H.data.kml.ColorStyle",ur);function vr(a){var b=a.childNodes,c=b.length,d=new pr;this.outline=this.fill=!0;for(this.Ml=new ur(a);c--;)switch(a=b[c],a.nodeName){case "fill":this.fill=d.sh(a);break;case "outline":this.outline=d.sh(a)}}t("H.data.kml.PolyStyle",vr);function wr(a){var b=a.childNodes,c=new pr;this.offsetX=this.offsetY=0;for(a=b.length;a--;){var d=b[a];switch(d.nodeName){case "href":this.href=c.Ua(d)}}}t("H.data.kml.Icon",wr);function xr(a){a=a.attributes;for(var b,c=a.length;c--;)switch(b=a[c],b.name){case "x":this.x=parseFloat(b.value);break;case "y":this.y=parseFloat(b.value);break;case "xunits":this.Ze="fraction"===pr.prototype.Ua(b);break;case "yunits":this.$d="fraction"===pr.prototype.Ua(b)}}t("H.data.kml.HotSpot",xr);function yr(a){var b;if(a){a=a.childNodes;var c=a.length;for(b=new pr;c--;){var d=a[c];switch(d.nodeName){case "scale":this.scale=b.mm(d);break;case "Icon":this.icon=d=new wr(d);break;case "hotSpot":this.Gu=d=new xr(d)}}}}t("H.data.kml.IconStyle",yr);function zr(a){var b=a.childNodes,c=b.length,d=new pr;for(this.Ml=new ur(a);c--;)a=b[c],"width"===a.nodeName&&(this.width=d.mm(a))}t("H.data.kml.LineStyle",zr);function Ar(a){a=a.childNodes;for(var b,c=a.length,d=new pr;c--;)switch(b=a[c],b.nodeName){case "bgColor":this.bgColor=d.km(b);break;case "textColor":this.textColor=d.km(b);break;case "text":this.text=d.Ua(b);break;case "displayMode":this.displayMode=d.Ua(b)}}t("H.data.kml.BalloonStyle",Ar);function Br(a){var b=a.childNodes,c=b.length;for(this.id=a.getAttribute("id");c--;)switch(a=b[c],a.nodeName){case "IconStyle":this.Iu=a=new yr(a);break;case "LineStyle":this.Nh=a=new zr(a);break;case "PolyStyle":this.iw=a=new vr(a);break;case "BalloonStyle":this.Dl=a=new Ar(a)}}t("H.data.kml.Style",Br);function Cr(a,b){a=a.childNodes;var c=a.length,d=new pr;for(this.rD=b;c--;)switch(b=a[c],b.nodeName){case "key":this.key=d.Ua(b);break;case "styleUrl":this.bl=d.Ua(b)}}t("H.data.kml.Pair",Cr);Cr.prototype.K=function(){if(this.bl){var a="highlight"===this.key?!0:!1;a=this.rD.Rp(this.bl.substr(1),a)}return a};Cr.prototype.getStyle=Cr.prototype.K;function Dr(a,b){var c=a.childNodes,d=c.length;this.hs=b;this.id=a.getAttribute("id");for(this.un=[];d--;)a=c[d],"Pair"===a.nodeName&&(a=new Cr(a,this.hs),this.un.push(a))}t("H.data.kml.StyleMap",Dr);Dr.prototype.K=function(a){var b=null;a=a?"highlight":"normal";for(var c=this.un.length;c--;)this.un[c].key===a&&(b=this.un[c].K());return b};Dr.prototype.getStyle=Dr.prototype.K;function Er(){this.kx={}}t("H.data.kml.StyleContainer",Er);Er.prototype.Ao=function(a){a&&a.id&&(this.kx["style_"+a.id]=a)};Er.prototype.addStyle=Er.prototype.Ao;Er.prototype.Rp=function(a,b){a=this.kx["style_"+a];a instanceof Dr&&(a=a.K(b));return a};Er.prototype.getStyleById=Er.prototype.Rp;function Fr(a){a=a.childNodes;for(var b,c=a.length,d=new pr;c--;
693)if(b=a[c],"coordinates"===b.nodeName){b=d.Ua(b);var e=[],f=new pr;try{e=f.bw(b)}catch(g){e=[]}this.Tl=2>e.length?[]:e}}t("H.data.kml.Line",Fr);Fr.prototype.vh=function(){for(var a=new J,b=this.Tl?this.Tl.length:0;b--;)a.tg(this.Tl[b]);return a};function Gr(){}Gr.prototype.elevation=0;Gr.prototype.Ut=0;function Hr(a){var b=a.childNodes,c=b.length;this.Tt=new J;for(this.Qu=[];c--;){var d=b[c];var e=d.nodeName;if("outerBoundaryIs"===e||"innerBoundaryIs"===e){var f=d.childNodes;for(d=f.length;d--;){var g=f[d];if("LinearRing"===g.nodeName){var h=new Fr(g);if("outerBoundaryIs"===e){this.Tt=h.vh();var k=void 0,l=a,n=h.Tl;h=new pr;var p=l.querySelector("altitudeMode");if(p&&p.parentNode===l&&!/^\s*clampTo/.test(h.Ua(p))&&n){p=n.length;for(var q=0;q<p&&0!==k;q++){var r=n[q].alt;r?k?r!==k&&(k=0):k=r:k=0}(n= 694l.querySelector("*|altitudeOffset"))&&n.parentNode===g&&"http://www.google.com/kml/ext/2.2"===n.namespaceURI&&(g=h.mm(n))&&(k+=g);k&&(k=Eb(2047,k),(g=l.querySelector("extrude"))&&g.parentNode===l&&h.sh(g)?this.Ut=k:this.elevation=k)}}else this.Qu.push(h.vh())}}}}}u(Hr,Gr);t("H.data.kml.Polygon",Hr);function Ir(a,b){var c=a&&a.childNodes||[],d=new pr;if(!a||!b)throw Error("Node or stylesContainer is not defined");this.visibility=!0;this.uC=a;for(a=c.length;a--;){var e=c[a];switch(e.nodeName){case "name":this.name=d.Ua(e);break;case "description":this.description=d.Ua(e);break;case "visibility":this.visibility=d.sh(e);break;case "open":this.open=d.sh(e);break;case "styleUrl":if(this.bl=d.Ua(e))e=this.bl.substr(1),this.gz=b.Rp(e,!1);break;case "Style":this.pv=e=new Br(e)}}} 695t("H.data.kml.Feature",Ir);function Jr(a){a=a.childNodes;for(var b,c=a.length,d=null,e=new pr;c--;)b=a[c],"coordinates"===b.nodeName&&(d=e.Ua(b));this.lv=null;d&&(this.lv=e.fr(d)||null)}t("H.data.kml.Point",Jr);Jr.prototype.vh=function(){return this.lv};function Kr(a,b){var c=document.createElement("CANVAS");c.width=1;c.height=1;this.hs=a;this.eq={};this.hr={};this.az=new zm(c);this.md=b||""}Kr.prototype.create=function(a){this.oh=new Ir(a,this.hs);return Lr(this,a)}; 696function Lr(a,b,c){b=b.childNodes;for(var d=b.length,e,f={},g;d--;){var h=b[d];switch(h.nodeName){case "Point":h=new Jr(h);g=Mr(a,"Marker");if(h=h.vh())e=new bn(h,g),g.gr&&Ed(g.gr,"statechange",z(a.gC,a,g.gr,e,g),!1);break;case "LineString":h=new Fr(h);g=Mr(a,"Polyline");e=new Bi(h.vh(),g);break;case "LinearRing":h=new Fr(h);g=Mr(a,"Polyline");e=new Bi(h.vh(),g);break;case "Polygon":h=new Hr(h);g=Mr(a,"Polygon");g.elevation=h.elevation;g.extrusion=h.Ut;e=new Kh(new L(h.Tt,h.Qu),g);break;case "MultiGeometry":e= 697Lr(a,h,new T)}e&&(a.oh.name&&(f.name=a.oh.name),a.oh.description&&(f.description=a.oh.description),g&&g.Dl&&(f.balloonStyle=g.Dl),f.kmlNode=a.oh.uC,e.setData(f),c&&c.Y(e))}return c||e} 698Kr.prototype.gC=function(a,b,c){var d=c.anchor,e=c.scale;c=e+"_"+d.x+d.y+d.Ze+d.$d+"_"+c.href;var f={};if(1===a.getState()){var g=this.eq[c];if(!g){var h=d.x;var k=d.y;if(g=a.mc())g={w:g.w*e,h:g.h*e},f.size=g;h=d.Ze&&g?g.w*h:h*e;k=d.$d&&g?g.h*(1-k):!d.$d&&g?g.h-k*e:k*e;f.anchor={x:h,y:k};g=new zm(a.Te(),f);this.eq[c]=g}b.we(g)}delete this.hr[c]}; 699function Mr(a,b){var c=a.oh,d={visibility:c.visibility};var e=new qr;var f=1;var g={x:0,y:0,Ze:!1,$d:!1};var h=Nr(a,c.gz);c.pv&&(h=Nr(a,c.pv,h));switch(b){case "Marker":if(h&&h.Iu){e=h.Iu;e.scale&&(f=e.scale);if(e.Gu){var k=e.Gu;g={x:k.x,y:k.y,Ze:k.Ze,$d:k.$d}}e.icon&&e.icon.href?(b=e.icon.href,Or.test(b)||(b=a.md+b),e=f+"_"+g.x+g.y+g.Ze+g.$d+"_"+b,k=a.eq[e]||a.hr[e],k||(k=new zm(b),a.hr[e]=k),0===k.getState()?(d.icon=a.az,d.gr=k,d.href=b,d.anchor=g,d.scale=f):1===k.getState()&&(d.icon=k)):1!==f&& 700(k||(g={x:14,y:4,Ze:!1,$d:!1}),e=zm,a=a.Dp(),k={w:28*f,h:36*f},f={size:new Xh(k.w,k.h),anchor:new K(g.Ze?k.w*g.x:g.x*f,g.$d?k.h*(1-g.y):k.h-g.y*f),hitArea:new Gi(Hi.POLYGON,[0*f,16*f,0*f,7*f,8*f,0*f,18*f,0*f,26*f,7*f,26*f,16*f,18*f,34*f,8*f,34*f])},d.icon=new e(a,f))}break;case "Polyline":d.style={};h&&h.Nh&&(f=h.Nh,d.style.strokeColor="rgba("+tr(e,f.Ml.color,!0)+")",0<=f.width&&(d.style.lineWidth=f.width));break;case "Polygon":d.style={},h&&(h.Nh&&(f=h.Nh,d.style.strokeColor="rgba("+tr(e,f.Ml.color, 701!0)+")",0<=f.width&&(d.style.lineWidth=f.width)),h.iw&&(f=h.iw,d.style.fillColor=f.fill?"rgba("+tr(e,f.Ml.color,!0)+")":"rgba(0,0,0,0)",f.outline||(d.style.lineWidth=0)))}d.Dl=h.Dl;return d}function Nr(a,b,c){c=c||{};for(var d in b)b.hasOwnProperty(d)&&(c[d]="object"===typeof b[d]?Nr(a,b[d],c[d]):b[d]);return c}var Or=/^[^:\/]+:/;Kr.prototype.Dp=function(){return'<svg xmlns="http://www.w3.org/2000/svg" width="28px" height="36px"><path d="M 19 31 C 19 32.7 16.3 34 13 34 C 9.7 34 7 32.7 7 31 C 7 29.3 9.7 28 13 28 C 16.3 28 19 29.3 19 31 Z" fill="#000" fill-opacity=".2"/><path d="M 13 0 C 9.5 0 6.3 1.3 3.8 3.8 C 1.4 7.8 0 9.4 0 12.8 C 0 16.3 1.4 19.5 3.8 21.9 L 13 31 L 22.2 21.9 C 24.6 19.5 25.9 16.3 25.9 12.8 C 25.9 9.4 24.6 6.1 22.1 3.8 C 19.7 1.3 16.5 0 13 0 Z" fill="#fff"/><path d="M 13 2.2 C 6 2.2 2.3 7.2 2.1 12.8 C 2.1 16.1 3.1 18.4 5.2 20.5 L 13 28.2 L 20.8 20.5 C 22.9 18.4 23.8 16.2 23.8 12.8 C 23.6 7.07 20 2.2 13 2.2 Z" fill="#18d"/></svg>'};function Pr(a){gb(this,Pr);this.url=a;this.gj=[];this.be=x;this.lj=z(this.lj,this);I.call(this)}u(Pr,I);t("H.data.AbstractReader",Pr);var Qr={ERROR:-1,LOADING:0,VISIT:1,READY:2};Pr.State=Qr;Pr.prototype.state=Qr.READY;Pr.prototype.j={gy:"statechange"};Pr.prototype.Tb=function(){if(!this.be){this.be=new P;var a=this.be.sd();a.kd(this.gj)}return new tl(this.be)};Pr.prototype.getLayer=Pr.prototype.Tb;Pr.prototype.oA=function(){return this.gj.concat([])};Pr.prototype.getParsedObjects=Pr.prototype.oA; 702Pr.prototype.i=function(){return this.url};Pr.prototype.getUrl=Pr.prototype.i;
702Pr.prototype.fD=function(a){if(this.state===Qr.LOADING||this.state===Qr.VISIT)throw Error("InvalidState: state "+this.state);this.gj=[];this.be=x;this.url=a;return this};Pr.prototype.setUrl=Pr.prototype.fD;Pr.prototype.getState=function(){return this.state};Pr.prototype.getState=Pr.prototype.getState;Pr.prototype.F=function(a,b,c){this.state=a;this.dispatchEvent(new Rr(b||this,this.j.gy,a,c||""))}; 703Pr.prototype.parse=function(){var a=this;fb(this.url)?(this.F(Qr.LOADING),(new qg("text/plain",this.url)).then(function(b){try{a.lj(b)}catch(c){a.F(Qr.ERROR,x,c.message)}},function(){a.F(Qr.ERROR,x,"Error loading file")})):a.F(Qr.ERROR,x,"File url was not set")};Pr.prototype.parse=Pr.prototype.parse;function Rr(a,b,c,d){Rr.g.constructor.call(this,b,a);this.state=c;this.message=d}u(Rr,pd);Pr.Event=Rr;function Sr(a){var b=a?a.lastIndexOf("/"):-1;this.Ak=[];Pr.call(this,a);0<=b&&(this.kB=a.substr(0,b)+"/")}u(Sr,Pr);t("H.data.kml.Reader",Sr); 704Sr.prototype.lj=function(a){var b,c=null;if(lb(a)&&""!=a.trim()){try{var d=(new DOMParser).parseFromString(a,"text/xml")}catch(h){this.F(Qr.ERROR,x,"Error parsing KML document");return}if(d.getElementsByTagName("parsererror").length)this.F(Qr.ERROR,x,"Error parsing KML document");else if((a=d.childNodes&&"kml"===d.childNodes[0].nodeName?d.childNodes[0]:void 0)&&(b=Tr(a.childNodes,"Document")[0]),b=b||a){d=new Er;for(var e=Tr(b.childNodes,"Style"),f=Tr(b.childNodes,"StyleMap"),g=e.length;g--;)a=new Br(e[g]), 705d.Ao(a);for(g=f.length;g--;)a=new Dr(f[g],d),d.Ao(a);this.RB=new Kr(d,this.kB);a=b.childNodes;for(b=a.length;b--;)if(e=a[b],d=c,"Placemark"===e.nodeName?(e=this.RB.create(e))&&this.Rg(e,d):"Folder"===e.nodeName&&(e={group:new T,node:e},this.Rg(e.group,d),this.Ak.push(e)),!b&&(d=this.Ak.shift()))a=d.node.childNodes,c=d.group,b=a.length;this.F(Qr.READY)}else this.F(Qr.ERROR,x,"Invalid KML document")}else this.F(Qr.ERROR,x,"Unable to create objects from the empty data")}; 706Sr.prototype.Rg=function(a,b){b?b.Y(a):(this.be&&this.be.sd().Y(a),this.gj.push(a),this.F(Qr.VISIT,a))};function Tr(a,b){for(var c=a.length,d,e=[];c--;)d=a[c],d.nodeName===b&&e.push(d);return e};function Ur(a,b){this.Ya=a;this.Pe=b} 707Ur.prototype.create=function(a,b){var c=a.coordinates;switch(a.type){case "Point":var d=new bn(Vr(c));break;case "LineString":d=new Bi(Wr(c));break;case "Polygon":d=new Kh(Xr(c));break;case "MultiPoint":var e=0;var f=c.length;d=[];if(this.Pe){for(;e<f;e++)d.push(Vr(c[e]));c=new bn(new Nf(d))}else{for(;e<f;e++)d.push(new bn(Vr(c[e])));c=new T;c.kd(d)}d=c;f="multiPoint";break;case "MultiLineString":e=0;f=c.length;d=[];if(this.Pe){for(;e<f;e++)d.push(Wr(c[e]));c=new Bi(new Lf(d))}else{for(;e<f;e++)d.push(new Bi(Wr(c[e]))); 708c=new T;c.kd(d)}d=c;f="multiLineString";break;case "MultiPolygon":d=[];e=0;f=c.length;if(this.Pe){for(;e<f;e++)d.push(Xr(c[e]));c=new Kh(new Mf(d))}else{for(;e<f;e++)d.push(new Kh(Xr(c[e])));c=new T;c.kd(d)}d=c;f="multiPolygon";break;case "GeometryCollection":c=d=new T;e=a.geometries;f=0;for(var g=e.length;f<g;f++)this.create(e[f],c);f="geometryCollection"}d&&(c=d,e=a.properties,a=a.id,g={},e&&(this.Pe?g=e:g.properties=e),f&&!this.Pe&&(g[f]=!0),a&&c.Zr(a),c.setData(g),this.Ya(d));b&&d&&b.Y(d);return d}; 709Ur.prototype.create=Ur.prototype.create;function Vr(a){return new tc(a[1],a[0])}function Xr(a){for(var b=Wr(a[0]),c=[],d,e=1,f=a.length;e<f;e++)d=Wr(a[e]),c.push(d);return new L(b,c)}function Wr(a){for(var b=0,c=a.length,d=new J;b<c;b++)d.tg(Vr(a[b]));return d};function Yr(a,b){b=b||{};this.Ya=b.style||this.gh;(this.Pe=!!b.disableLegacyMode)||window.console.warn("H.data.geojson.Reader: Legacy parser is enabled in GeoJSON Reader. Features like Multi-Geometries, Polygon interiors and GeoJSON feature properties might not work as expected. To maximise compatibility with the remote services it is recommended to set the `disableLegacyMode` flag to true.");Pr.call(this,a)}u(Yr,Pr);t("H.data.geojson.Reader",Yr); 710Yr.prototype.lj=function(a){var b,c;try{var d="string"===typeof a?JSON.parse(a):a;if("object"===typeof d){var e=new Ur(this.Ya,this.Pe);switch(d.type){case "FeatureCollection":if(b=d.features){var f=new T;this.Rg(f);for(c=0;c<b.length;c++){var g=Zr(b[c]);(g=e.create(g))&&f.Y(g)}}break;case "Feature":g=Zr(d);(g=e.create(g))&&this.Rg(g);break;default:(g=e.create(d))&&this.Rg(g)}this.F(Qr.READY)}else this.F(Qr.ERROR,x,"Invalid syntax")}catch(h){this.F(Qr.ERROR,x,"Parse error. "+h.message)}}; 711Yr.prototype.rC=function(a){this.F(Qr.LOADING);this.lj(a)};Yr.prototype.parseData=Yr.prototype.rC;Yr.prototype.gh=function(){};function Zr(a){var b={};if(a.geometry){var c=a.geometry;b.type=c.type;b.properties=a.properties;c.coordinates&&(b.coordinates=c.coordinates);c.geometries&&(b.geometries=c.geometries);a.id&&(b.id=a.id)}return b}Yr.prototype.Rg=function(a){this.be&&this.be.sd().Y(a);this.gj.push(a);this.F(Qr.VISIT,a)};t("H.data.buildInfo",function(){return Wh("H-data","1.61.0","3b08619",{region:"row"})}); 712 713Gc.prototype.Ae=da(1,function(a,b){this.root.Ae(a,ob(b)?b:this.Ph)});Lc.prototype.Ae=da(0,function(a,b){var c=0,d;if(!a(this)&&b--)for(;3>=c;c++)(d=this[c])&&d.Ae(a,b)});function $r(a,b){this.ir=a;this.ee=b}t("H.clustering.grid.NoisePoint",$r);
713$r.prototype.ya=function(){return vc(this.ir)};$r.prototype.getPosition=$r.prototype.ya;$r.prototype.Xd=function(){return this.ir.wt};$r.prototype.getWeight=$r.prototype.Xd;$r.prototype.Zf=Xe;$r.prototype.isCluster=$r.prototype.Zf;$r.prototype.Td=function(){return this.ee};$r.prototype.getMinZoom=$r.prototype.Td;$r.prototype.getData=function(){return this.ir.data};$r.prototype.getData=$r.prototype.getData;function as(a,b,c){this.Jq=this.ee=c;this.jr=[];this.us=0;this.J=Wc(a,b,!0)}t("H.clustering.grid.Cluster",as);as.prototype.Pi=function(a){this.Uc||(this.Uc=vc(a));this.us+=a.wt||1;this.jr.push(a)};as.prototype.ya=function(){return this.Uc};as.prototype.getPosition=as.prototype.ya;as.prototype.Xd=function(){return this.us};as.prototype.getWeight=as.prototype.Xd;as.prototype.Zf=We;as.prototype.isCluster=as.prototype.Zf;as.prototype.Td=function(){return this.ee};as.prototype.getMinZoom=as.prototype.Td; 714as.prototype.om=function(){return this.Jq};as.prototype.getMaxZoom=as.prototype.om;as.prototype.C=function(){return this.J};as.prototype.getBoundingBox=as.prototype.C;as.prototype.vp=function(a){this.zj(a)};as.prototype.forEachEntry=as.prototype.vp;as.prototype.zj=function(a){var b=this;if(!db(a))throw new C(this.zj,0,a);this.jr.forEach(function(c){a(new $r(c,b.ee+1))})};as.prototype.forEachDataPoint=as.prototype.zj;function bs(a){ed.call(this);this.fc=[];var b;a?Wa(b={},cs,a):b=cs;this.options=b;ed.call(this)}u(bs,ed);var ds={clusters:[],noisePoints:[]},cs={projection:ri,min:0,max:22,eps:32,minWeight:2};m=bs.prototype;m.ve=function(a){this.fc=a;this.qd=!0};m.zc=function(a){this.fc.push(a);this.qd=!0};m.Al=function(a){this.fc=this.fc.concat(a);this.qd=!0};m.Dk=function(a){this.fc=this.fc.filter(function(b){return b!==a});this.qd=!0};m.disposeInternal=function(){bs.g.disposeInternal.call(this);delete this.fc}; 715bs.prototype.disposeInternal=bs.prototype.disposeInternal;bs.prototype.Qw=Ye;function es(a){bs.call(this,a);a=this.options;if(a.projection!==ri)throw new C(es,0,"Other projection than mercator not supported yet");this.me=a.projection;this.lp=a.eps;this.KB=a.minWeight;this.fw=new si(this.me);(new Vm).registerProcessor("cluster","H.clustering.dynamicgrid.worker");this.hg=z(this.hg,this);this.Pq=z(this.Pq,this)}u(es,bs);es.prototype.Qw=function(a,b){this.Ly=a;this.My=Hb(b)}; 716es.prototype.es=function(a,b){var c=this.Lg;var d=this.Ly,e=this.My||0;var f=!c||!(c.zoom===e&&c.Si.da(d));if(d&&(this.qd||f)){c&&3>c.state&&c.cancel();this.qd=!1;c=this.lp;if(c>=128*Mb(2,e))var g=fs;else{f=this.fw;f.Va(e);var h=f.Gb(d.Oc());g=f.Gb(d.Mc());h.y-=c;g.y+=c;h=f.sk(h);var k=f.sk(g);g=new E(h.lat,h.lng,k.lat,k.lng);c=f.Za(c,0).lng+180;g=g.de(h.lat,h.lng-c,k.lat,h.lng).de(h.lat,k.lng,k.lat,k.lng+c)}c=g;h=this.fc;g=[];for(f=h.length;f--;)c.Gf(h[f])&&g.push(h[f]);0<g.length?(this.Lg=new gs(d, 717e,g,this.lp,this.KB,this.me!==ri,a,b),this.Lg.then(this.hg,this.Pq)):a(ds)}}; 718es.prototype.hg=function(a){Ca(a)||(a=new globalThis.Uint32Array(a));for(var b=this.Lg,c=b.hC,d=0,e=a[d++],f=Array(e),g=0,h=[],k=a.length,l=this.Lg.Oy,n=this.Lg.zoom;e--;)f[g++]=new $r(l[a[d++]],n);for(;d<k;){e=a[d++];g=l[a[d]];var p=this.fw;var q=this.lp;p.Va(this.Lg.zoom);var r=p.Gb(g);g=p.Za(r.x-q,r.y-q);p=p.Za(r.x+q,r.y+q);g=new E(g.lat,g.lng,p.lat,p.lng);for(g=new as(g.Oc(),g.Mc(),n);e--;)g.Pi(l[a[d++]]);h.push(g)}c.call(b,{clusters:h,noisePoints:f})};es.prototype.Pq=function(a){lb(a)&&this.Lg.YB(a)}; 719var fs=new E(90,-180,-90,180);es.prototype.disposeInternal=function(){es.g.disposeInternal.call(this)};es.prototype.disposeInternal=es.prototype.disposeInternal;function gs(a,b,c,d,e,f,g,h){this.Si=a;this.zoom=b;this.Oy=c;this.hC=g;this.YB=h;a=c.length;g=3*a;h=new (globalThis.Float64Array||Array)(g);for(var k;a--;)k=c[a],h[--g]=k.lat,h[--g]=k.lng,h[--g]=k.wt;Ce.call(this,"cluster",{message:[h,d,e,b,f]},void 0)}u(gs,Xm);function hs(a){bs.call(this,a)}u(hs,bs); 720hs.prototype.es=function(a){var b=this.options,c=b.min,d=b.max,e=[],f=[],g;if(this.qd){for(g=this.fc;c<=d;c++){for(var h,k=void 0,l,n,p,q,r,v,w,y=c,F=g,G=e,O=f,V=b.eps,Ua=b.projection,aa=b.minWeight,vb=F.length,Ba=Math.pow(2,y+8),Pa=[];w=F[--vb];)if(!w.Bs){n=Ua.Se(w).scale(Ba).floor();v=Ba;r=n.x;q=n.y;for(l=Pa.length;l--;)h=Pa[l],p=h.ya(),h.zs||(h.zs=Ua.Se(p).scale(Ba).floor()),p=h.zs,p=p.kb(n),p<v&&(v=p,k=h);k&&k.C().Gf(w)||(k=new as(Ua.wn({x:(r-V)/Ba,y:(q-V)/Ba}),Ua.wn({x:(r+V)/Ba,y:(q+V)/Ba}), 721y),Pa.push(k));k.Pi(w);k=null}for(vb=Pa.length;vb--;)if(h=Pa[vb],l=h.Xd(),l<aa)for(h=h.jr,l=h.length;w=h[--l];
721)O.push(new $r(w,y)),w.Bs=!0;else G.push(h)}c=0;for(d=g.length;c<d;c++)delete g[c].Bs;this.qd=!1;a({clusters:e,noisePoints:f})}};function is(a){this.oa=a;this.ry=11;a=document.createElement("canvas");var b=a.getContext("2d"),c=this.oa,d=14*c;a.width=d;a.height=d;b.scale(c,c);b.beginPath();b.strokeStyle="#FFFFFF";b.fillStyle="#1080DD";b.arc(7,7,6,0,2*Math.PI,!1);b.fill();b.lineWidth=1;b.stroke();this.PB=new zm(a,{size:{w:14,h:14},anchor:{x:7,y:7}});this.ot={};this.pt={}}t("H.clustering.theme.Circular",is); 722function js(a,b,c){var d,e=document.createElement("canvas"),f=e.getContext("2d");var g=a.oa;var h=b*g;e.width=h;e.height=h;f.scale(g,g);g=b+":"+c;(d=a.ot[g])?f.putImageData(d,0,0):(b/=2,f.beginPath(),f.strokeStyle="rgba("+c+",0.2)",f.fillStyle="rgba("+c+",1)",f.arc(b,b,b/5*3,0,2*Math.PI,!1),f.fill(),f.lineWidth=b/5*4,f.stroke(),a.ot[g]=f.getImageData(0,0,h,h));return e} 723is.prototype.Bz=function(a){var b=a.Xd();var c=this.pt[b];if(!c){if(10>b){c=js(this,28,"118,209,0");var d={x:11,y:18}}else 25>b?(c=js(this,38,"255,105,0"),d={x:13,y:23}):50>b?(c=js(this,38,"240,60,0"),d={x:13,y:23}):100>b?(c=js(this,38,"181,0,21"),d={x:13,y:23}):1E3>b?(c=js(this,48,"181,0,21"),d={x:15,y:28}):(c=js(this,66,"181,0,21"),d={x:20,y:38});var e=c.getContext("2d");e.fillStyle="#FFFFFF";e.font="bold "+this.ry+"px Arial";e.fillText(String(b),d.x,d.y);d=c.width/this.oa;c=new zm(c,{size:{w:d, 724h:d},anchor:{x:d/2,y:d/2}});this.pt[b]=c}b=new bn(a.ya(),{icon:c,min:a.Td(),max:a.om()});b.setData(a);return b};is.prototype.getClusterPresentation=is.prototype.Bz;is.prototype.lA=function(a){var b=new bn(a.ya(),{icon:this.PB,min:a.Td()});b.setData(a);return b};is.prototype.getNoisePresentation=is.prototype.lA;function ks(a,b,c){this.qa=a;this.dm=b;this.ee=c}t("H.clustering.fastgrid.NoisePoint",ks);ks.prototype.ya=function(){this.Uc||(this.Uc=this.qa.Za(this.dm[1],this.dm[0],1));return this.Uc};ks.prototype.getPosition=ks.prototype.ya;ks.prototype.Xd=function(){return this.dm.weight};ks.prototype.getWeight=ks.prototype.Xd;ks.prototype.Zf=Xe;ks.prototype.isCluster=ks.prototype.Zf;ks.prototype.Td=function(){return this.ee-this.qa.hh};ks.prototype.getMinZoom=ks.prototype.Td;ks.prototype.getData=function(){return this.dm.data}; 725ks.prototype.getData=ks.prototype.getData;function ls(a,b,c,d){this.qa=a;this.uc=b;this.ee=c;this.Jq=d;this.wp=Ia(this.wp,this);this.up=Ia(this.up,this)}t("H.clustering.fastgrid.Cluster",ls);ls.prototype.ya=function(){this.Uc||(this.Uc=this.qa.Za(this.uc.dj,this.uc.ej,this.uc.Gc));return this.Uc};ls.prototype.getPosition=ls.prototype.ya;ls.prototype.Xd=function(){return this.uc.Gc};ls.prototype.getWeight=ls.prototype.Xd;ls.prototype.Zf=We;ls.prototype.isCluster=ls.prototype.Zf; 726ls.prototype.Td=function(){return this.ee?this.ee-this.qa.hh:-1/0};ls.prototype.getMinZoom=ls.prototype.Td;ls.prototype.om=function(){return this.Jq-this.qa.hh};ls.prototype.getMaxZoom=ls.prototype.om;ls.prototype.C=function(){this.J||(this.J=Wc(this.qa.Za(this.uc.dh,this.uc.cj,1),this.qa.Za(this.uc.aj,this.uc.bj,1),!0));return this.J};ls.prototype.getBoundingBox=ls.prototype.C;ls.prototype.vp=function(a){this.$t=a;this.uc.Ae(this.wp,bc)};ls.prototype.forEachEntry=ls.prototype.vp; 727ls.prototype.wp=function(a,b){var c=!1,d,e;a.Gc>=this.qa.Cv&&a!==this.uc&&a.Gc!==this.uc.Gc&&(this.$t(new ls(this.qa,a,0,b)),c=!0);if(!c&&(d=a.entries))for(a=d.length,e=0;e<a;e++)this.$t(new ks(this.qa,d[e],b));return c};ls.prototype.zj=function(a){this.kz=a;this.uc.Ae(this.up,bc)};ls.prototype.forEachDataPoint=ls.prototype.zj;ls.prototype.up=function(a,b){var c;if(a=a.entries){var d=a.length;for(c=0;c<d;c++)this.kz(new ks(this.qa,a[c],b))}return!1};function ms(a,b,c,d,e,f){this.Co=b;a&&(this.parent=a,b&1?(c=a[8],e=a[5]):(c=a[7],e=a[8]),b&2?(d=a[9],f=a[6]):(d=a[4],f=a[9]));this[7]=c;this[5]=e;this[8]=(c+e)/2;this[4]=d;this[6]=f;this[9]=(d+f)/2}m=ms.prototype;m.hb=0;m.th=function(a){return this[a]||(++this.hb,this[a]=new ms(this,a))};m.removeChild=function(a){var b=a.Co;this[b]===a&&(delete this[b],delete a.parent,--this.hb)};m.Ae=function(a,b){for(var c=0,d=this;d=d.parent;)++c;ns(this,a,b,c)}; 728function ns(a,b,c,d){var e,f;if(!b(a,d)&&c--)for(++d,e=0;4>e;e++)(f=a[e])&&ns(f,b,c,d)}m.Qg=function(a){(this.entries||(this.entries=[])).push(a)};m.dj=0;m.ej=0;m.Gc=0;function os(a){this.Ph=a||10;this.Ck=this.Bk=this.Zi=this.Yi=2147483648;this.Em()}m=os.prototype;m.Em=function(){this.head=this.root=new ms(null,NaN,this.Yi-this.Bk,this.Zi-this.Ck,this.Yi+this.Bk,this.Zi+this.Ck)};m.Ll=function(){ps(this,this.root);this.Em()};function ps(a,b){var c,d;for(c=0;4>c;c++)if(d=b[c])ps(a,d),delete b[c];delete b.parent;delete b.entries} 729m.ld=function(a){var b=this.head,c;if(a){var d=a;if(d!==b)for(b=d;d=d.parent;
729)if(d.entries||1<d.hb)b=d}else for(;!b.entries&&2>(c=b.hb);)if(c)b=d;else break;this.head=b};m.Zd=function(a,b,c,d){var e=this.root;if(!(a>=e[7]&&b>=e[4]&&a<=e[5]&&b<=e[6]))throw Error("Coordinates out of bounds");return this.Vb(this.root,a,b,c,this.Ph,d)}; 730m.Vb=function(a,b,c,d,e,f){var g=a.entries;e?a.hb?g=this.Sj(a,b,c,d,e,f):g?(g=g[0],g=a.th(+(g[1]>=a[8])|+(g[0]>=a[9])<<1),g.entries=a.entries,g.dj=a.dj,g.ej=a.ej,g.Gc=a.Gc,g.dh=a.dh,g.cj=a.cj,g.aj=a.aj,g.bj=a.bj,delete a.entries,this.ld(g),g=this.Sj(a,b,c,d,e,f)):(a.Qg(g=new qs(b,c,d,f)),this.ld(a)):(g||this.ld(a),a.Qg(g=new qs(b,c,d,f)));a.dj+=b*d;a.ej+=c*d;a.Gc+=d;a.dh===A?(a.dh=a.aj=b,a.cj=a.bj=c):(b<a.dh?a.dh=b:b>a.aj&&(a.aj=b),c<a.cj?a.cj=c:c>a.bj&&(a.bj=c));return g}; 731m.Sj=function(a,b,c,d,e,f){return this.Vb(a.th(+(b>=a[8])|+(c>=a[9])<<1),b,c,d,e-1,f)};m.Ae=function(a,b){ns(this.root,a,b===+b?b:this.Ph,0)};function qs(a,b,c,d){this[0]=b;this[1]=a;this.weight=c;this.data=d};function rs(a){bs.call(this,a);a=this.options;this.me=a.projection;this.hk=a.min;this.fg=a.max;this.Cv=a.minWeight;this.hh=7-Gb(Kb(Fb(1,a.eps))/Ub);this.vr=new os(Fb(this.hk,this.fg+this.hh))}u(rs,bs);m=rs.prototype;m.ve=function(a){var b=0,c=a.length,d,e=new K(0,0),f=this.me,g=this.vr;rs.g.ve.call(this,a);for(g.Ll();b<c;b++)f.Se(d=a[b],e).scale(4294967296).floor(),g.Zd(e.x,e.y,d.wt,d.data);this.qd=!0};m.zc=function(a){rs.g.zc.call(this,a);this.ve(this.fc)}; 732m.Al=function(a){for(var b=a.length,c=rs.g.zc;b--;)c.call(this,a[b]);this.ve(this.fc)};m.Dk=function(a){rs.g.Dk.call(this,a);this.ve(this.fc)};m.Za=function(a,b,c,d){return this.me.Za(a/c/4294967296,b/c/4294967296,d)};m.es=function(a){if(this.qd){var b={clusters:[],noisePoints:[]};ss(this,this.vr.root,0,this.fg+this.hh,-1/0,b,null);this.qd=!1;a(b)}}; 733function ss(a,b,c,d,e,f,g){var h=b.Gc,k;g&&(g.node.Gc!==h?(f.clusters.push(new ls(a,g.node,g.depth,c-1)),g=null):e++);g||(h>=a.Cv?(g={node:b,depth:c},e=c):ts(a,b,e+1,f));if(b.hb&&d--)for(c++,h=0;4>h;h++)if(k=b[h])ss(a,k,c,d,e,f,g),g=null;g&&f.clusters.push(new ls(a,g.node,g.depth,a.fg+a.hh))}function ts(a,b,c,d){b=b.entries;var e;if(b){var f=b.length;d=d.noisePoints;for(e=0;e<f;e++)d.push(new ks(a,b[e],c))}else for(e=0;4>e;e++)(f=a[e])&&ts(a,f,c,d)} 734m.disposeInternal=function(){rs.g.disposeInternal.call(this);this.vr=null};rs.prototype.disposeInternal=rs.prototype.disposeInternal;t("H.clustering.DataPoint",function(a,b,c,d){this.lat=a;this.lng=b;this.wt=c===+c?c:1;this.data=d});function us(a,b){b=b||{};var c={},d=b.min||0,e=Fb(d,b.max||22);d={min:d,max:e};us.g.constructor.call(this,d);this.oa=b.pixelRatio||Ke();Wa(c,cs,d,b.clusteringOptions||{});c.minWeight=Fb(cs.minWeight,c.minWeight);switch(c.strategy){case vs.DYNAMICGRID:if(c.projection!==ri)throw new C(us,1,"Unsupported projection");this.qa=new es(c);break;case vs.GRID:this.qa=new hs(c);break;default:this.qa=new rs(c)}this.qa.ve(a);this.fl=b.theme||new is(this.oa);this.No=z(this.No,this);this.hg=z(this.hg,this);ws(this)} 735u(us,P);t("H.clustering.Provider",us);us.prototype.disposeInternal=function(){us.g.disposeInternal.call(this);this.Bg.ia();this.qa.l();delete this.qa;delete this.Qm;delete this.fl;globalThis.clearTimeout(this.hp)};var vs={FASTGRID:0,GRID:1,DYNAMICGRID:2};us.Strategy=vs;us.prototype.fy=150;us.prototype.No=function(){this.dispatchEvent("start");this.qa.es(this.hg,Ye)};function ws(a,b,c){a.hp&&globalThis.clearTimeout(a.hp);b&&a.qa.Qw(b,c);a.hp=globalThis.setTimeout(a.No,a.fy)} 736us.prototype.hg=function(a){this.Qm=a;xs(this);this.dispatchEvent("end")};us.prototype.ve=function(a){this.qa.ve(a);ws(this)};us.prototype.setDataPoints=us.prototype.ve;us.prototype.zc=function(a){this.qa.zc(a);ws(this)};us.prototype.addDataPoint=us.prototype.zc;us.prototype.Al=function(a){this.qa.Al(a);ws(this)};us.prototype.addDataPoints=us.prototype.Al;us.prototype.Dk=function(a){this.qa.Dk(a);ws(this)};us.prototype.removeDataPoint=us.prototype.Dk;us.prototype.HA=function(){return this.fl}; 737us.prototype.getTheme=us.prototype.HA;us.prototype.cD=function(a){this.fl=a;this.Qm&&(this.Bg.ia(),xs(this))};us.prototype.setTheme=us.prototype.cD;function xs(a){var b=a.Qm.clusters,c=a.Qm.noisePoints,d=b.length,e=c.length,f=0<d+e;for(a.Bg.ia();e--;){var g=c[e];a.Bg.Y(a.fl.getNoisePresentation(g))}for(;d--;)c=b[d],a.Bg.Y(a.fl.getClusterPresentation(c));f&&a.jb()}us.prototype.Vc=function(){return!0};us.prototype.providesDomMarkers=us.prototype.Vc;us.prototype.Wc=function(){return!0}; 738us.prototype.providesMarkers=us.prototype.Wc;us.prototype.ne=function(){return!0};us.prototype.providesSpatials=us.prototype.ne;us.prototype.xk=function(a,b){ws(this,a,b)};us.prototype.preprocessData=us.prototype.xk;t("H.clustering.buildInfo",function(){return Wh("H-clustering","1.61.0","3b08619",{region:"row"})}); 739 740function ys(a,b){a:{for(var c=a.length,d="string"===typeof a?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a)){b=e;break a}b=-1}return 0>b?null:"string"===typeof a?a.charAt(b):a[b]}var zs={};function As(a){var b=a.ownerDocument,c=b.documentElement;b=b.defaultView;var d=a.getBoundingClientRect();a=d.left;d=d.top;isNaN(b.pageXOffset)?(a+=c.scrollLeft,d+=c.scrollTop):(a+=b.pageXOffset,d+=b.pageYOffset);return new K(a,d)}
741function Bs(a,b,c){b=ob(b)?b+"px":b;c=ob(c)?c+"px":c;a.style[xk("transform")]="translate("+b+","+c+")"}var Cs,Ds=navigator.userAgent,Es=-1<Ds.indexOf("Android")&&-1<Ds.indexOf("Mozilla/5.0")&&-1<Ds.indexOf("AppleWebKit"),Fs=/AppleWebKit\/([\d.]+)/,Gs=null===Fs.exec(Ds)?null:parseFloat(Fs.exec(Ds)[1]);Cs=Es&&null!==Gs&&537>Gs;var Hs=document.createElement("T");function Is(){this.ax=this.Gt()}Is.prototype.Gt=function(){var a=navigator,b=[];a&&(a.msPointerEnabled?b.push(Js):a.pointerEnabled&&b.push(Ks));1>b.length&&("TouchEvent"in globalThis&&b.push(Ls),b.push(Ms));b.push(Ns);return b};Is.prototype.detectEventSets=Is.prototype.Gt;Is.prototype.addEventListener=function(a,b,c,d){for(var e=this.ax,f,g=e.length,h=!1;g--;)if(f=e[g][b])h=!0,a.addEventListener(f,c,d||!1);h||a.addEventListener(b,c,d||!1)}; 742Is.prototype.removeEventListener=function(a,b,c,d){for(var e=this.ax,f,g=e.length,h=!1;g--;)if(f=e[g][b])h=!0,a.removeEventListener(f,c,d||!1);h||a.removeEventListener(b,c,d||!1)}; 743var Ks={start:"pointerdown",end:"pointerup",move:"pointermove",cancel:"pointercancel",over:"pointerover",out:"pointerout",hover:"pointerhover"},Js={start:"MSPointerDown",end:"MSPointerUp",move:"MSPointerMove",cancel:"MSPointerCancel",over:"MSPointerOver",out:"MSPointerOut",hover:"MSPointerHover"},Ls={start:"touchstart",end:"touchend",move:"touchmove",cancel:"touchcancel"},Ms={start:"mousedown",end:"mouseup",move:"mousemove",over:"mouseover",out:"mouseout",hover:"mousehover"},Ns={start:"keydown",end:"keyup"}; 744function Os(a){return!(a instanceof KeyboardEvent)||"Enter"===a.code};function Ps(a,b,c,d){a=a.createElement(b);c&&(a.className=c);d&&(a.innerHTML=d);return a}function Qs(a,b){for(var c=1,d=arguments.length;c<d;c++)a.appendChild(arguments[c])}var Rs=new Is;function Ss(a,b,c){Rs.addEventListener(a,b,c,void 0)}function Ts(a,b,c){Rs.removeEventListener(a,b,c,void 0)};function Y(a,b){I.call(this);this.Ra=a||"div";this.Me=b?b.split(" "):[];this.ub=!1;this.Me.push("H_el")}u(Y,I);t("H.ui.base.Element",Y);Y.prototype.L=function(a){if(!a)throw Error("Wrong document object");this.G=Ps(a,this.Ra,this.Me.join(" "));this.renderInternal(this.G,a);this.wa(this.ub,!0);this.Gd(this.Ax);this.Zb(this.Ld);this.uf(this.mx);return this.G};Y.prototype.subscribe=function(){};Y.prototype.unsubscribe=function(){};Y.prototype.N=function(){};Y.prototype.renderInternal=Y.prototype.N; 745Y.prototype.mq=function(){return this.ub};Y.prototype.isDisabled=Y.prototype.mq;Y.prototype.wa=function(a,b){a=!!a;if(a!==this.ub||b)(this.ub=a)?this.Ha("H_disabled"):this.Bb("H_disabled");return this};Y.prototype.setDisabled=Y.prototype.wa;Y.prototype.ep=null;Y.prototype.getData=function(){return this.ep};Y.prototype.getData=Y.prototype.getData;Y.prototype.setData=function(a){this.ep=a};Y.prototype.setData=Y.prototype.setData; 746Y.prototype.Gd=function(a){var b=this.B();this.Ax=a;b&&(a?(b.setAttribute("title",a),b.setAttribute("aria-label",a)):(b.removeAttribute("title"),b.removeAttribute("aria-label")))};Y.prototype.setTooltip=Y.prototype.Gd;Y.prototype.G=null;Y.prototype.B=function(){return this.G};Y.prototype.getElement=Y.prototype.B;Y.prototype.Ld=!0;Y.prototype.Zb=function(a){var b=this.B();this.Ld=a;b&&(b.style.display=a?"":"none")};Y.prototype.setVisibility=Y.prototype.Zb;Y.prototype.Wd=function(){return this.Ld}; 747Y.prototype.getVisibility=Y.prototype.Wd;Y.prototype.mx=-1;Y.prototype.uf=function(a){this.mx=a;var b=this.B();b&&(b.tabIndex=a)};Y.prototype.setTabIndex=Y.prototype.uf;Y.prototype.Ha=function(a){var b=this.B();0>this.Me.indexOf(a)&&this.Me.push(a);b&&(b.className=this.Me.join(" "));return this};Y.prototype.addClass=Y.prototype.Ha;Y.prototype.Bb=function(a){a=this.Me.indexOf(a);var b=this.B();-1<a&&this.Me.splice(a,1);b&&(b.className=this.Me.join(" "));return this};Y.prototype.removeClass=Y.prototype.Bb; 748function Us(a){(a=a.B())&&a.parentNode&&a.parentNode.removeChild(a)}Y.prototype.disposeInternal=function(){Y.g.disposeInternal.call(this);Us(this);this.ep=this.G=null;delete this.Ax};function Vs(a,b){b=b||{};var c=this;Y.call(this,"div","H_ib H_ib_top");this.Tv=z(function(d){c.ub||!Os(d)&&d instanceof KeyboardEvent&&"Escape"!==d.code||(c.close(),d.preventDefault())},this);this.update=z(this.update,this);this.am=z(this.am,this);this.setPosition(a);this.Pk(b.content);b.onStateChange&&this.addEventListener("statechange",b.onStateChange);this.F(Ws.OPEN)}u(Vs,Y);t("H.ui.InfoBubble",Vs);Vs.prototype.v=null;Vs.prototype.ya=function(){return this.Uc}; 749Vs.prototype.setPosition=function(a){this.Uc=vc(a);this.update()};Vs.prototype.setPosition=Vs.prototype.setPosition;Vs.prototype.Qa=function(a){this.v=a}; 750Vs.prototype.N=function(a,b){this.Jo=Ps(b,"div","H_ib_body");this.tailEl_=Ps(b,"div","H_ib_tail");this.$i=Ps(b,"div","H_ib_close H_btn",'<svg version="1.1" class="H_icon" viewB
750ox="0 0 12 12"><path d="m8.12 6 3.66-3.66c.29-.29.29-.76 0-1.05l-1.06-1.06c-.29-.29-.76-.29-1.05 0l-3.66 3.66-3.66-3.66c-.29-.29-.76-.29-1.05 0l-1.06 1.06c-.29.29-.3.76 0 1.05l3.66 3.66-3.66 3.66c-.29.29-.29.76 0 1.05l1.06 1.06c.29.29.76.29 1.05 0l3.66-3.66 3.66 3.66c.29.29.76.29 1.05 0l1.06-1.06c.29-.29.3-.76 0-1.05z"></path></svg>');this.$i.setAttribute("tabindex", 751"0");this.fh=Ps(b,"div","H_ib_content"," ");this.Jo.appendChild(this.$i);this.Jo.appendChild(this.fh);Ss(this.$i,"start",this.Tv);this.v.xa.addEventListener("sync",this.update);this.v.sa.addEventListener("sync",this.update);a.appendChild(this.Jo);a.appendChild(this.tailEl_);this.Pk(this.Rl)};Vs.prototype.renderInternal=Vs.prototype.N;Vs.prototype.am=function(){this.Bt||(this.Bt=setTimeout(this.update,0))}; 752Vs.prototype.update=function(){var a=this.B(),b=this.v,c,d="none";this.Bt=0;if(b&&a&&this.getState()===Ws.OPEN){if(c=b.La(this.Uc)){var e=c.x;c=c.y;b=b.sa.width;if(e>=-b||e<=2*b||c>=-b||c<=2*b)d="",Cs?(a.style.left=e-b+"px",a.style.top=c+"px"):Bs(a,e,c)}a.style.display=d;""===d&&(a.style.visibility="visible")}};var Ws={OPEN:"open",CLOSED:"closed"};Vs.State=Ws;Vs.prototype.s=Ws.OPEN;Vs.prototype.getState=function(){return this.s};Vs.prototype.getState=Vs.prototype.getState; 753Vs.prototype.F=function(a){a!==this.s&&(this.s=a,this.dispatchEvent("statechange"));if(a=this.B())this.s===Ws.OPEN?(a.style.display="block",a.style.visibility="hidden",this.am()):a.style.display="none"};Vs.prototype.setState=Vs.prototype.F;Vs.prototype.close=function(){this.F(Ws.CLOSED)};Vs.prototype.close=Vs.prototype.close;Vs.prototype.open=function(){this.F(Ws.OPEN)};Vs.prototype.open=Vs.prototype.open;Vs.prototype.Dz=function(){return this.fh||null};Vs.prototype.getContentElement=Vs.prototype.Dz; 754Vs.prototype.Pk=function(a){if(a)if("string"===typeof a||"number"===typeof a.nodeType&&"string"===typeof a.nodeName)this.Rl=a;else throw Error("InfoBubble content must be a string or HTML node.");else this.Rl="";this.B()&&(this.Rl?(this.fh.innerHTML="","string"===typeof this.Rl?this.fh.innerHTML=a:"number"===typeof a.nodeType&&"string"===typeof a.nodeName&&this.fh.appendChild(a)):this.fh.innerHTML=" ",this.am())};Vs.prototype.setContent=Vs.prototype.Pk; 755Vs.prototype.disposeInternal=function(){this.close();this.Pk("");this.$i&&Ts(this.$i,"end",this.Tv);this.v&&(this.v.xa.removeEventListener("sync",this.update),this.v.sa.removeEventListener("sync",this.update));Y.prototype.disposeInternal.call(this)};var Xs={TOP_LEFT:"top-left",TOP_CENTER:"top-center",TOP_RIGHT:"top-right",LEFT_TOP:"left-top",LEFT_MIDDLE:"left-middle",LEFT_BOTTOM:"left-bottom",RIGHT_TOP:"right-top",RIGHT_MIDDLE:"right-middle",RIGHT_BOTTOM:"right-bottom",BOTTOM_LEFT:"bottom-left",BOTTOM_CENTER:"bottom-center",BOTTOM_RIGHT:"bottom-right"};t("H.ui.LayoutAlignment",Xs);var Ys={IMPERIAL:"imperial",METRIC:"metric"};t("H.ui.UnitSystem",Ys);function Zs(a,b,c){Y.call(this,a,b);this.dc=c?[].concat(c):[]}u(Zs,Y);t("H.ui.base.Container",Zs);Zs.prototype.wa=function(a,b){var c=this.dc?this.dc.length:0;for(Y.prototype.wa.call(this,a,b);c--;)this.dc[c].wa(a,b);return this};Zs.prototype.setDisabled=Zs.prototype.wa;Zs.prototype.Sa=function(a){var b=this.B();this.dc.push(a);b&&(a.L(b.ownerDocument),b.appendChild(a.B()));return this};Zs.prototype.addChild=Zs.prototype.Sa;Zs.prototype.Dj=function(){return[].concat(this.dc)}; 756Zs.prototype.getChildren=Zs.prototype.Dj;Zs.prototype.removeChild=function(a){var b=this.dc.indexOf(a),c=this.B();0<=b&&(this.dc.splice(b,1),c&&c.removeChild(a.B()))};Zs.prototype.removeChild=Zs.prototype.removeChild;Zs.prototype.ia=function(){var a=this.B();a&&this.dc.forEach(function(b){a.removeChild(b.B())});this.dc=[]};Zs.prototype.N=function(a,b){for(var c=0,d=this.dc.length;c<d;c++)a.appendChild(this.dc[c].L(b))};Zs.prototype.renderInternal=Zs.prototype.N; 757Zs.prototype.disposeInternal=function(){this.ia();this.dc.forEach(this.Zy,this);Y.prototype.disposeInternal.call(this)};Zs.prototype.Zy=function(a){a.l()};function $s(){Zs.call(this,"div","H_ctl");this.map=null;this.Fe="top-left"}u($s,Zs);t("H.ui.Control",$s);$s.prototype.Qa=function(a){this.map=a};$s.prototype.L=function(a){return Zs.prototype.L.call(this,a)};$s.prototype.N=function(a,b){Zs.prototype.renderInternal.call(this,a,b);this.$c(this.Fe)};$s.prototype.renderInternal=$s.prototype.N;$s.prototype.qk=function(){};$s.prototype.onUnitSystemChange=$s.prototype.qk;$s.prototype.lc=function(){return this.map};$s.prototype.getMap=$s.prototype.lc; 758$s.prototype.ma=function(){return this.yB};$s.prototype.getLocalization=$s.prototype.ma;$s.prototype.uz=function(){return this.Fe};$s.prototype.getAlignment=$s.prototype.uz;$s.prototype.$c=function(a){"string"===typeof a&&Xs[a.replace("-","_").toUpperCase()]===a&&(this.Fe=a,this.dispatchEvent("alignmentchange"));return this};$s.prototype.setAlignment=$s.prototype.$c;function at(a){a=a||{};
758$s.call(this);this.Ha("H_scalebar");this.$c(a.alignment||"right-bottom");this.maxWidth=150;this.update=z(this.update,this);this.bv=this.Ir=this.Mk=this.dl=null;this.uf(0)}u(at,$s);t("H.ui.ScaleBar",at); 759at.prototype.N=function(a,b){$s.prototype.renderInternal.call(this,a,b);a.innerHTML='<svg height="12" version="1.1" xmlns="http://www.w3.org/2000/svg"><polyline style="fill:none; stroke:white; stroke-width:4" points="2,2 2,10 98,10 98,2"/><polyline style="fill:none; stroke:black; stroke-width:2" points="2,2 2,10 98,10 98,2"/></svg><div style="padding: 0 0 0 10px"></div>';a.style.direction="ltr";this.dl=a.firstChild;b=this.dl.childNodes;this.Mk=b[0];this.Ir=b[1];this.bv=a.lastChild;this.Qb=Ys.METRIC; 760this.Yy=z(function(c){!this.ub&&Os(c)&&(this.dispatchEvent("toggleunitsystem"),c.preventDefault())},this);this.je=z(function(c){!this.ub&&Os(c)&&c.preventDefault()},this);Ss(a,"start",this.je);Ss(a,"end",this.Yy);this.Gd(this.ma().translate("scale.switchToImperial"));this.update()};at.prototype.renderInternal=at.prototype.N;at.prototype.Qa=function(a){this.map&&this.map.removeEventListener("mapviewchange",this.update);a&&a.addEventListener("mapviewchange",this.update);$s.prototype.Qa.apply(this,arguments)}; 761at.prototype.setMap=at.prototype.Qa; 762at.prototype.capture=function(a,b,c){var d=this.B();var e=d.ownerDocument,f=e.createElement("canvas"),g=f.getContext("2d"),h=e.createElementNS("http://www.w3.org/2000/svg","svg"),k=e.createElementNS("http://www.w3.org/2000/svg","foreignObject"),l=bf(d,e,!1);e=parseFloat(d.offsetWidth)+1;var n=parseFloat(d.offsetHeight),p=e*a;a*=n;f.width=p;f.height=a;h.setAttribute("xmlns","http://www.w3.org/2000/svg");h.setAttribute("width",p);h.setAttribute("height",a);h.setAttribute("viewBox","0 0 "+e+" "+n);k.setAttribute("width", 763"100%");k.setAttribute("height","100%");h.appendChild(k);l.setAttribute("width","100%");l.setAttribute("height","100%");l.setAttribute("xmlns","http://www.w3.org/1999/xhtml");var q=window.getComputedStyle(d);"box-shadow display align-items font font-family font-size height text-shadow direction".split(" ").forEach(function(r){l.style.setProperty(r,q.getPropertyValue(r))});k.appendChild(l);d=Se(h.outerHTML);(new qg("image",d)).then(function(r){g.drawImage(r,0,0);b(f)},c)};at.prototype.capture=at.prototype.capture; 764at.prototype.qk=function(a){this.Qb=a;this.Gd("imperial"===a?this.ma().translate("scale.switchToMetric"):this.ma().translate("scale.switchToImperial"));this.update()};at.prototype.onUnitSystemChange=at.prototype.qk; 765at.prototype.update=function(){var a;if(this.B()){this.dl=this.dl;this.Mk=this.Mk;var b=this.maxWidth;var c=0;if(a=this.map){var d=a.sa;var e=Math.round(.5*d.width);var f=Math.round(.5*d.height);0<e&&0<f&&(d=a.Wa(e,f))&&(a=a.Wa(e+1,f))&&(c=100*d.kb(a))}c&&(this.Qb===Ys.IMPERIAL?1609.344>c?(e=c/.3048006,a=this.ma().translate("scale.ft")):(e=c/1609.344,a=this.ma().translate("scale.mi")):1E3>c?(e=c,a=this.ma().translate("scale.m")):(e=c/1E3,a=this.ma().translate("scale.km")),c=Math.pow(10,Math.floor(Math.log(e)/ 766Math.LN10)),e=c/e*100,e<b/5?(c*=5,e*=5):e<b/2?(c*=2,e*=2):e>b&&(c/=2,e/=2),e=Math.round(e),this.dl.setAttribute("width",e),this.bv.textContent=c+" "+a,this.Mk.points.getItem(2).x=this.Ir.points.getItem(2).x=this.Mk.points.getItem(3).x=this.Ir.points.getItem(3).x=e-2)}};function bt(a){a=a||{};Y.call(this,"div","H_btn");this.xe(a.label||" ");this.Gd(a.tooltip||"");this.setData(a.data);this.wa(!!a.disabled);this.uf(0);this.F(ct.UP,!0);a.onStateChange&&this.addEventListener("statechange",a.onStateChange);this.cn=z(this.cn,this);this.Vh=z(this.Vh,this)}u(bt,Y);t("H.ui.base.Button",bt);bt.prototype.wa=function(a,b){a&&this.Bb("H_active");return bt.g.wa.call(this,a,b)};bt.prototype.setDisabled=bt.prototype.wa; 767bt.prototype.N=function(a){Ss(a,"start",this.cn);Ss(a,"end",this.Vh);Ss(a,"out",this.Vh);this.xe(this.Wb,!0)};bt.prototype.renderInternal=bt.prototype.N;bt.prototype.getState=function(){return this.s};bt.prototype.getState=bt.prototype.getState;bt.prototype.F=function(a,b){a!==this.s&&(this.s=a,a===ct.DOWN?this.Ha("H_active"):this.Bb("H_active"),b||this.dispatchEvent("statechange"));return this};bt.prototype.setState=bt.prototype.F;bt.prototype.Gp=function(){return this.Wb}; 768bt.prototype.getLabel=bt.prototype.Gp;bt.prototype.xe=function(a,b){if(b||a!==this.Wb)if(this.Wb=a,b=this.B())b.innerHTML=a;return this};bt.prototype.setLabel=bt.prototype.xe;bt.prototype.cn=function(a){!this.ub&&Os(a)&&(this.F(ct.DOWN),a.preventDefault())};bt.prototype.Vh=function(a){!this.ub&&Os(a)&&(this.F(ct.UP),a.preventDefault())};bt.prototype.disposeInternal=function(){var a=this.B();a&&(Ts(a,"start",this.cn),Ts(a,"end",this.Vh),Ts(a,"out",this.Vh));Y.prototype.disposeInternal.call(this)}; 769var ct={UP:"up",DOWN:"down"};bt.State=ct;function dt(a){bt.call(this,a);this.XB=function(b){Os(b)&&b.preventDefault()};this.je=z(function(b){!this.ub&&Os(b)&&(this.toggleState(),b.preventDefault())},this)}u(dt,bt);t("H.ui.base.PushButton",dt);dt.prototype.N=function(a){Ss(a,"start",this.je);Ss(a,"end",this.XB);this.xe(this.Wb,!0)};dt.prototype.renderInternal=dt.prototype.N;dt.prototype.xx=function(){var a=ct.DOWN;this.F(this.getState()===a?ct.UP:a);return this};dt.prototype.toggleState=dt.prototype.xx; 770dt.prototype.disposeInternal=function(){var a=this.B();a&&Ts(a,"start",this.je);bt.prototype.disposeInternal.call(this)};function et(a){a=a||{};
770$s.call(this);this.tc=new dt({label:'<svg xmlns="http://www.w3.org/2000/svg" class="H_icon" viewBox="0 0 24 24"><g transform="translate(1 3)"><path fill-rule="nonzero" d="M5,0 L5,2 L2,2 L2,16 L5,16 L5,18 L2,18 C0.9,18 0,17 0,15.75 L0,2.25 C0,1 0.9,0 2,0 L5,0 Z M17,0 L20,0 C21.1,0 22,1 22,2.25 L22,15.75 C22,17 21.1,18 20,18 L17,18 L17,16 L20,16 L20,2 L17,2 L17,0 Z"></path><rect width="10" height="2" x="6" y="8"></rect><rect width="2" height="10" x="10" y="4"></rect></g></svg>', 771onStateChange:z(this.gf,this)});this.Sa(this.tc);this.$c(a.alignment||"right-bottom")}u(et,$s);t("H.ui.ZoomRectangle",et);m=et.prototype; 772m.gf=function(a){var b=this.map,c=b.sa.element;a.target.getState()===ct.DOWN?(b.addEventListener("dragstart",this.Cd,!0,this),b.addEventListener("drag",this.ig,!0,this),b.addEventListener("dragend",this.ef,!0,this),a=c.ownerDocument.createElement("div"),a.className="H_zoom_lasso",c.appendChild(a),this.Om=a):(b.removeEventListener("dragstart",this.Cd,!0,this),b.removeEventListener("drag",this.ig,!0,this),b.removeEventListener("dragend",this.ef,!0,this),c.removeChild(this.Om))}; 773m.Cd=function(a){var b=this.Om.style,c=a.currentPointer,d=c.viewportX;c=c.viewportY;a.target===this.map&&(a.stopPropagation(),b.width="0px",b.height="0px",b.top=c+"px",b.left=d+"px",b.display="block",this.ix=c,this.hx=d)};m.ig=function(a){var b=a.currentPointer,c=b.viewportX,d=b.viewportY;b=this.hx;var e=this.ix,f=this.Om.style;a.target===this.map&&(a.stopPropagation(),a=c-b,c=d-e,f.left=b+(0>a?a:0)+"px",f.top=e+(0>c?c:0)+"px",f.width=Math.abs(a)+"px",f.height=Math.abs(c)+"px")}; 774m.ef=function(a){var b=this.map,c=a.currentPointer;a.target===this.map&&(a.stopPropagation(),this.Om.style.display="none",b.xa.ad({bounds:Xc([b.Wa(this.hx,this.ix),b.Wa(c.viewportX,c.viewportY)])},!0))};m.N=function(a,b){$s.prototype.renderInternal.call(this,a,b);this.tc.Gd(this.ma().translate("zoom.rectangle"))};et.prototype.renderInternal=et.prototype.N;function ft(a,b){b=b||{};if(!(a&&a instanceof sl))throw Error("Base layer is mandatory for overview UI element");$s.call(this);this.dr=new dt({label:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="H_icon"><g fill-rule="evenodd" transform="translate(2 2)"><rect width="9" height="9" x="10" y="10"/><rect class="H_icon_stroke" width="18" height="18" x="1" y="1" fill="none" stroke="#000" stroke-width="2" rx="2"/></g></svg>',onStateChange:z(this.gf,this)});this.Sa(this.dr); 775this.$h=new gt(a,b.zoomDelta,b.scaleX,b.scaleY);this.$c(b.alignment||"right-bottom");this.Sa(this.$h)}u(ft,$s);t("H.ui.Overview",ft);ft.prototype.Dg=function(a){this.$h.Dg(a);return this};ft.prototype.setBaseLayer=ft.prototype.Dg;ft.prototype.gf=function(a){a.target.getState()===ct.DOWN?(a=this.$h,ht(a,!0),a.js(),a.Ha(a.Xs),a.v.addEventListener("mapviewchange",a.js,!1,a)):it(this.$h)}; 776ft.prototype.N=function(a,b){$s.prototype.renderInternal.call(this,a,b);this.dr.B().style["float"]=this.Fe.match("right")?"right":"left";this.$h.Qa(this.map);this.dr.Gd(this.ma().translate("minimap"))};ft.prototype.renderInternal=ft.prototype.N;ft.prototype.disposeInternal=function(){this.$h.l();Y.prototype.disposeInternal.call(this)}; 777function gt(a,b,c,d){this.pa=a;this.Xs="H_overview_active";"number"===typeof b&&(this.Px=b);"number"===typeof c&&(this.$v=c);"number"===typeof d&&(this.aw=d);Zs.call(this,"div","H_overview")}u(gt,$s);gt.prototype.Dg=function(a){this.ai.Dg(a)};gt.prototype.N=function(a,b){b=Ps(b,"div","H_overview_map");Qs(a,b);this.Eq=b};gt.prototype.renderInternal=gt.prototype.N;gt.prototype.renderInternal=gt.prototype.N;m=gt.prototype;m.Px=3;m.$v=5;m.aw=5; 778m.Qa=function(a){this.v=a;this.ai=new U(this.Eq,this.pa,{pixelRatio:this.v.lb(),engineType:this.v.Ca.type});this.ai.Yd.B().style.display="none";this.Zv=this.ai.xa;this.tv=this.v.xa};function it(a){!a.jh&&ht(a);a.Bb(a.Xs);a.v.removeEventListener("mapviewchange",a.js,!1,a)}m.js=function(a){a&&a.modifiers&a.SIZE&&ht(this,!0);a=this.tv.Ib();a.zoom-=this.Px;this.Zv.ad(a)}; 779function ht(a,b){var c=a.v.sa.element,d=a.B().style,e=c.offsetWidth/a.$v/10;c=c.offsetHeight/a.aw/10;var f=a.Eq.style;b?(d.width=e+"em",d.height=c+"em",f.width=e+"em",f.height=c+"em"):d.width=d.height="0em";a.ai.sa.resize()}
779m.disposeInternal=function(){gt.g.disposeInternal.call(this);it(this);this.ai.l();this.ai=this.Zv=this.tv=this.v=this.pa=this.Eq=null};function jt(a,b){var c={},d={};c["top-left"]=Ps(b,"div",[kt,lt].join(" "));c["top-center"]=Ps(b,"div",[kt,mt,nt,lt].join(" "));c["top-right"]=Ps(b,"div",[kt,lt].join(" "));c["left-top"]=Ps(b,"div",[kt,ot].join(" "));c["left-middle"]=Ps(b,"div",[kt,pt,qt,ot].join(" "));c["left-bottom"]=Ps(b,"div",[kt,ot].join(" "));c["right-top"]=Ps(b,"div",[kt,ot].join(" "));c["right-middle"]=Ps(b,"div",[kt,rt,qt,ot].join(" "));c["right-bottom"]=Ps(b,"div",[kt,ot].join(" "));c["bottom-left"]=Ps(b,"div",[kt,lt].join(" ")); 780c["bottom-center"]=Ps(b,"div",[kt,st,nt,lt].join(" "));c["bottom-right"]=Ps(b,"div",[kt,lt].join(" "));d["top-left"]=Ps(b,"div",[mt,pt].join(" "));d["top-right"]=Ps(b,"div",[mt,rt].join(" "));d["bottom-left"]=Ps(b,"div",[st,pt].join(" "));d["bottom-right"]=Ps(b,"div",[st,rt].join(" "));Qs(d["top-left"],c["top-left"],c["left-top"]);Qs(d["top-right"],c["top-right"],c["right-top"]);Qs(d["bottom-left"],c["left-bottom"],c["bottom-left"]);Qs(d["bottom-right"],c["right-bottom"],c["bottom-right"]);Qs(a,d["top-left"], 781d["top-right"],d["bottom-left"],d["bottom-right"],c["top-center"],c["left-middle"],c["right-middle"],c["bottom-center"]);this.at=c}var mt="H_l_top",st="H_l_bottom",pt="H_l_left",rt="H_l_right",nt="H_l_center",qt="H_l_middle",lt="H_l_horizontal",ot="H_l_vertical",kt="H_l_anchor";jt.prototype.update=function(){var a=this.at;tt(a["top-center"],!0);tt(a["bottom-center"],!0);tt(a["left-middle"],!1);tt(a["right-middle"],!1)}; 782function tt(a,b){b?(b=a.offsetWidth,a.style.marginLeft=-Math.round(.5*b)+"px"):(b=a.offsetHeight,a.style.marginTop=-Math.round(.5*b)+"px")}jt.prototype.put=function(a,b){a=a?a.B():null;var c=b?this.at[b]:null;a&&c&&(a.parentElement&&a.parentElement.removeChild(a),c.insertBefore(a,/(bottom|right)$/.test(b)||/(center|middle)/.test(b)&&c.childNodes.length%2?c.firstChild:null));this.update()};var ut=[];t("H.ui.i18n.defaultLocales",ut);var vt={},wt=[];function xt(a,b){vt[a]=b;-1===ut.indexOf(a)&&ut.push(a);wt.length?yt(a,b):wt=Object.keys(b)}function yt(a,b){for(var c=wt,d=c.length,e;d--;)if(e=c[d],!b[e])throw Error("'"+e+"' key missing in translation map for "+a);};xt("en-US",{"layers.normal":"Map view","layers.satellite":"Satellite","layers.terrain":"Terrain","layer.transit":"Public transport","layer.traffic":"Traffic conditions","layer.incidents":"Show traffic incidents","layers.choose":"Choose view",minimap:"Minimap","scale.switchToImperial":"Change to miles","scale.switchToMetric":"Change to km","scale.km":"km","scale.m":"m","scale.mi":"mi","scale.ft":"ft","zoom.out":"Zoom out","zoom.in":"Zoom in","zoom.rectangle":"Zoom rectangle","traffic.MASS_TRANSIT":"Public transport", 783"traffic.MISCELLANEOUS":"Miscellaneous","traffic.ACCIDENT":"Accident","traffic.OTHER_NEWS":"Other news","traffic.OTHER":"Other news","traffic.PLANNED_EVENT":"Planned event","traffic.ROAD_HAZARD":"Road hazard","traffic.ROAD_CLOSURE":"Roadway closed","traffic.WEATHER":"Weather","traffic.CONGESTION":"Congestion","traffic.CONSTRUCTION":"Construction","traffic.DISABLED_VEHICLE":"Disabled vehicle","traffic.LANE_RESTRICTION":"Lane restriction","traffic.from":"Start time:","traffic.until":"Estimated end time:", 784"distance.measurement":"Measure distance"});xt("tr-TR",{"layers.normal":"Harita g\u00f6r\u00fcn\u00fcm\u00fc","layers.satellite":"Uydu","layers.terrain":"Arazi","layer.transit":"Toplu ula\u015f\u0131m","layer.traffic":"Trafik durumlar\u0131","layer.incidents":"Trafik olaylar\u0131n\u0131 g\u00f6ster","layers.choose":"G\u00f6r\u00fcn\u00fcm se\u00e7",minimap:"Minimap","scale.switchToImperial":"Mile d\u00f6n\u00fc\u015ft\u00fcr","scale.switchToMetric":"Kilometreye d\u00f6n\u00fc\u015ft\u00fcr","scale.km":"km","scale.m":"m","scale.mi":"mil","scale.ft":"ft", 785"zoom.out":"Uzakla\u015ft\u0131r","zoom.in":"Yak\u0131nla\u015ft\u0131r","zoom.rectangle":"Zoom rectangle","traffic.MASS_TRANSIT":"Toplu ula\u015f\u0131m","traffic.MISCELLANEOUS":"\u00c7e\u015fitli","traffic.ACCIDENT":"Kaza","traffic.OTHER_NEWS":"Di\u011fer haberler","traffic.OTHER":"Di\u011fer haberler","traffic.PLANNED_EVENT":"Planl\u0131 etkinlik","traffic.ROAD_HAZARD":"Yol tehlikesi","traffic.ROAD_CLOSURE":"Yol kapal\u0131","traffic.WEATHER":"Hava durumu","traffic.CONGESTION":"Yo\u011funluk", 786"traffic.CONSTRUCTION":"Yol \u00e7al\u0131\u015fmas\u0131","traffic.DISABLED_VEHICLE":"Ara\u00e7 ar\u
7860131zas\u0131","traffic.LANE_RESTRICTION":"\u015eerit k\u0131s\u0131tlamas\u0131","traffic.from":"Ba\u015flang\u0131\u00e7 zaman\u0131:","traffic.until":"Tahmini biti\u015f zaman\u0131:","distance.measurement":"Measure distance"});xt("pt-PT",{"layers.normal":"Vista do mapa","layers.satellite":"Sat\u00e9lite","layers.terrain":"Terreno","layer.transit":"Transportes p\u00fablicos","layer.traffic":"Condi\u00e7\u00f5es de tr\u00e2nsito","layer.incidents":"Mostrar incidentes de tr\u00e2nsito","layers.choose":"Escolher vista",minimap:"Minimap","scale.switchToImperial":"Mudar para milhas","scale.switchToMetric":"Mudar para km","scale.km":"km","scale.m":"m","scale.mi":"mi","scale.ft":"ft","zoom.out":"Diminuir","zoom.in":"Aumentar", 787"zoom.rectangle":"Zoom rectangle","traffic.MASS_TRANSIT":"Transportes p\u00fablicos","traffic.MISCELLANEOUS":"Diversos","traffic.ACCIDENT":"Acidente","traffic.OTHER_NEWS":"Outras not\u00edcias","traffic.OTHER":"Outras not\u00edcias","traffic.PLANNED_EVENT":"Evento planeado","traffic.ROAD_HAZARD":"Perigo na estrada","traffic.ROAD_CLOSURE":"Estrada fechada","traffic.WEATHER":"Meteorologia","traffic.CONGESTION":"Congestionamento","traffic.CONSTRUCTION":"Constru\u00e7\u00e3o","traffic.DISABLED_VEHICLE":"Ve\u00edculo avariado", 788"traffic.LANE_RESTRICTION":"Limita\u00e7\u00e3o da faixa de rodagem","traffic.from":"Hora de in\u00edcio:","traffic.until":"Hora de fim prevista:","distance.measurement":"Measure distance"});xt("fr-FR",{"layers.normal":"Carte","layers.satellite":"Satellite","layers.terrain":"Terrain","layer.transit":"Transports publics","layer.traffic":"Conditions de circulation","layer.incidents":"Afficher les incidents de circulation","layers.choose":"Choisir la vue",minimap:"Minimap","scale.switchToImperial":"Passer en miles","scale.switchToMetric":"Passer en km","scale.km":"km","scale.m":"m","scale.mi":"mi","scale.ft":"ft","zoom.out":"Zoom arri\u00e8re","zoom.in":"Zoom avant","zoom.rectangle":"Zoom rectangle", 789"traffic.MASS_TRANSIT":"Transports publics","traffic.MISCELLANEOUS":"Divers","traffic.ACCIDENT":"Accident","traffic.OTHER_NEWS":"Autre","traffic.OTHER":"Autre","traffic.PLANNED_EVENT":"\u00c9v\u00e9nement pr\u00e9vu","traffic.ROAD_HAZARD":"Danger routier","traffic.ROAD_CLOSURE":"Chauss\u00e9e ferm\u00e9e","traffic.WEATHER":"M\u00e9t\u00e9o","traffic.CONGESTION":"Embouteillage","traffic.CONSTRUCTION":"Travaux","traffic.DISABLED_VEHICLE":"V\u00e9hicule en panne","traffic.LANE_RESTRICTION":"Restriction de voie", 790"traffic.from":"Date ou heure de d\u00e9but:","traffic.until":"Date et heure de fin estim\u00e9es:","distance.measurement":"Measure distance"});xt("de-DE",{"layers.normal":"Kartenansicht","layers.satellite":"Satellit","layers.terrain":"Gel\u00e4nde","layer.transit":"\u00d6ffentliche Verkehrsmittel","layer.traffic":"Verkehrslage","layer.incidents":"Verkehrsst\u00f6rungen anzeigen","layers.choose":"Ansicht ausw\u00e4hlen",minimap:"Minimap","scale.switchToImperial":"Umrechnung in Meilen","scale.switchToMetric":"Umrechnung in Kilometer","scale.km":"km","scale.m":"m","scale.mi":"mi","scale.ft":"ft","zoom.out":"Verkleinern","zoom.in":"Vergr\u00f6\u00dfern", 791"zoom.rectangle":"Zoom rectangle","traffic.MASS_TRANSIT":"\u00d6ffentliche Verkehrsmittel","traffic.MISCELLANEOUS":"Diverse","traffic.ACCIDENT":"Unfall","traffic.OTHER_NEWS":"Anderes Ereignis","traffic.OTHER":"Anderes Ereignis","traffic.PLANNED_EVENT":"Geplantes Ereignis","traffic.ROAD_HAZARD":"Verkehrshindernis","traffic.ROAD_CLOSURE":"Fahrbahn gesperrt","traffic.WEATHER":"Wetter","traffic.CONGESTION":"Verkehrsstau","traffic.CONSTRUCTION":"Baustelle","traffic.DISABLED_VEHICLE":"Liegengebliebenes Fahrzeug", 792"traffic.LANE_RESTRICTION":"Fahrstreifensperrung","traffic.from":"Beginn:","traffic.until":"Voraussichtliches Ende:","distance.measurement":"Measure distance"});xt("zh-CN",{"layers.normal":"\u5730\u56fe\u89c6\u56fe","layers.satellite":"\u536b\u661f","layers.terrain":"\u5730\u5f62","layer.transit":"\u516c\u5171\u4ea4\u901a","layer.traffic":"\u4ea4\u901a\u60c5\u51b5","layer.incidents":"\u663e\u793a\u4ea4\u901a\u4e8b\u4ef6","layers.choose":"\u9009\u62e9\u89c6\u56fe",minimap:"Minimap","scale.switchToImperial":"\u5207\u6362\u4e3a\u300c\u82f1\u91cc\u300d","scale.switchToMetric":"\u5207\u6362\u4e3a\u300c\u516c\u91cc\u300d","scale.km":"\u516c\u91cc","scale.m":"\u7c73", 793"scale.mi":"\u82f1\u91cc","scale.ft":"\u82f1\u5c3a","zoom.out":"\u7f29\u5c0f","zoom.in":"\u653e\u5927","zoom.rectangle":"Zoom rectangle","traffic.MASS_TRANSIT":"\u516c\u5171\u4ea4\u901a","traffic.MISCELLANEOUS":"\u7efc\u5408\u4e8b\u4ef6","traffic.ACCIDENT":"\u4ea4\u901a\u610f\u5916","traffic.OTHER_NEWS":"\u5176\u4ed6\u65b0\u95fb","traffic.OTHER":"\u5176\u4ed6\u65b0\u95fb","traffic.PLANNED_EVENT":"\u9884\u5b9a\u4e8b\u4ef6","traffic.ROAD_HAZARD":"\u9053\u8def\u5371\u9669","traffic.ROAD_CLOSURE":"\u9053\u8def\u5df2\u5173\u95ed", 794"traffic.WEATHER":"\u5929\u6c14","traffic.CONGESTION":"\u5835\u585e","traffic.CONSTRUCTION":"\u65bd\u5de5","traffic.DISABLED_VEHICLE":"\u8f66\u8f86\u629b\u951a","traffic.LANE_RESTRICTION":"\u8f66\u9053\u9650\u5236","traffic.from":"\u5f00\u59cb\u65f6\u95f4\uff1a","traffic.until":"\u9884\u8ba1\u7ed3\u675f\u65f6\u95f4\uff1a","distance.measurement":"Measure distance"});xt("pl-PL",{"layers.normal":"Widok mapy","layers.satellite":"Satelita","layers.terrain":"Teren","layer.transit":"Transport publiczny","layer.traffic":"Warunki drogowe","layer.incidents":"Poka\u017c zdarzenia drogowe","layers.choose":"Wybierz widok",minimap:"Minimap","scale.switchToImperial":"Zmie\u0144 na mile","scale.switchToMetric":"Zmie\u0144 na km","scale.km":"km","scale.m":"m","scale.mi":"mi","scale.ft":"ft","zoom.out":"Oddal","zoom.in":"Przybli\u017c","zoom.rectangle":"Zoom rectangle","traffic.MASS_TRANSIT":"Transport publiczny", 795"traffic.MISCELLANEOUS":"Inne zdarzenie","traffic.ACCIDENT":"Wypadek","traffic.OTHER_NEWS":"Inne wiadomo\u015bci","traffic.OTHER":"Inne wiadomo\u015bci","traffic.PLANNED_EVENT":"Zdarzenie planowane","traffic.ROAD_HAZARD":"Niebezpiecze\u0144stwo na drodze","traffic.ROAD_CLOSURE":"Jezdnia zamkni\u0119ta","traffic.WEATHER":"Pogoda","traffic.CONGESTION":"Korek","traffic.CONSTRUCTION":"Budowa","traffic.DISABLED_VEHICLE":"Uszkodzony pojazd","traffic.LANE_RESTRICTION":"Ograniczenie pasa ruchu","traffic.from":"Data rozpocz\u0119cia:", 796"traffic.until":"Przybli\u017cona data zako\u0144czenia:","distance.measurement":"Measure distance"});xt("ru-RU",{"layers.normal":"\u0420\u0435\u0436\u0438\u043c \u043a\u0430\u0440\u0442\u044b","layers.satellite":"\u
7960421\u043f\u0443\u0442\u043d\u0438\u043a\u043e\u0432\u0430\u044f","layers.terrain":"\u041c\u0435\u0441\u0442\u043d\u043e\u0441\u0442\u044c","layer.transit":"\u041e\u0431\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442","layer.traffic":"\u0414\u043e\u0440\u043e\u0436\u043d\u044b\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f", 797"layer.incidents":"\u041f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0434\u043e\u0440\u043e\u0436\u043d\u044b\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f","layers.choose":"\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0432\u0438\u0434",minimap:"Minimap","scale.switchToImperial":"\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0438\u043b\u0438","scale.switchToMetric":"\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0438\u043b\u043e\u043c\u0435\u0442\u0440\u044b", 798"scale.km":"\u043a\u043c","scale.m":"\u043c","scale.mi":"\u043c\u0438\u043b\u044c","scale.ft":"\u0444\u0443\u0442","zoom.out":"\u041e\u0442\u0434\u0430\u043b\u0438\u0442\u044c","zoom.in":"\u041f\u0440\u0438\u0431\u043b\u0438\u0437\u0438\u0442\u044c","zoom.rectangle":"Zoom rectangle","traffic.MASS_TRANSIT":"\u041e\u0431\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442","traffic.MISCELLANEOUS":"\u041f\u0440\u043e\u0447\u0435\u0435 \u0414\u0422\u041f", 799"traffic.ACCIDENT":"\u0414\u0422\u041f","traffic.OTHER_NEWS":"\u0414\u0440\u0443\u0433\u0438\u0435 \u043d\u043e\u0432\u043e\u0441\u0442\u0438","traffic.OTHER":"\u0414\u0440\u0443\u0433\u0438\u0435 \u043d\u043e\u0432\u043e\u0441\u0442\u0438","traffic.PLANNED_EVENT":"\u041f\u043b\u0430\u043d\u043e\u0432\u043e\u0435 \u043c\u0435\u0440\u043e\u043f\u0440\u0438\u044f\u0442\u0438\u0435","traffic.ROAD_HAZARD":"\u0414\u043e\u0440\u043e\u0436\u043d\u0430\u044f \u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c", 800"traffic.ROAD_CLOSURE":"\u0414\u043e\u0440\u043e\u0433\u0430 \u0437\u0430\u043a\u0440\u044b\u0442\u0430","traffic.WEATHER":"\u041f\u043e\u0433\u043e\u0434\u0430","traffic.CONGESTION":"\u041f\u0440\u043e\u0431\u043a\u0430","traffic.CONSTRUCTION":"\u0420\u0435\u043c\u043e\u043d\u0442","traffic.DISABLED_VEHICLE":"\u041d\u0435\u0438\u0441\u043f\u0440\u0430\u0432\u043d\u044b\u0439 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044c","traffic.LANE_RESTRICTION":"\u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u043e\u0441\u044b \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f", 801"traffic.from":"\u0412\u0440\u0435\u043c\u044f \u043d\u0430\u0447\u0430\u043b\u0430:","traffic.until":"\u041e\u0436\u0438\u0434\u0430\u0435\u043c\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044f:","distance.measurement":"\u0418\u0437\u043c\u0435\u0440\u0438\u0442\u044c \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435"});xt("nl-NL",{"layers.normal":"Kaartweergave","layers.satellite":"Satelliet","layers.terrain":"Terrein","layer.transit":"Openbaar vervoer","layer.traffic":"Verkeerssituatie","layer.incidents":"Toon verkeersincidenten","layers.choose":"Weergave kiezen",minimap:"Minimap","scale.switchToImperial":"Overgaan naar mijlen","scale.switchToMetric":"Wijzigen naar km","scale.km":"km","scale.m":"m","scale.mi":"mi","scale.ft":"ft","zoom.out":"Uitzoomen","zoom.in":"Inzoomen","zoom.rectangle":"Zoom rectangle","traffic.MASS_TRANSIT":"Openbaar vervoer", 802"traffic.MISCELLANEOUS":"Diversen","traffic.ACCIDENT":"Ongeval","traffic.OTHER_NEWS":"Meer informatie","traffic.OTHER":"Meer informatie","traffic.PLANNED_EVENT":"Geplande afzetting","traffic.ROAD_HAZARD":"Gevaar op de weg","traffic.ROAD_CLOSURE":"Rijbaan afgesloten","traffic.WEATHER":"Weer","traffic.CONGESTION":"Verkeersopstopping","traffic.CONSTRUCTION":"Wegwerkzaamheden","traffic.DISABLED_VEHICLE":"Voertuig met pech","traffic.LANE_RESTRICTION":"Rijstrookbeperking","traffic.from":"Begintijd:","traffic.until":"Geschatte eindtijd:", 803"distance.measurement":"Measure distance"});
803xt("pt-BR",{"layers.normal":"Exibi\u00e7\u00e3o do mapa","layers.satellite":"Sat\u00e9lite","layers.terrain":"Terreno","layer.transit":"Transporte p\u00fablico","layer.traffic":"Condi\u00e7\u00f5es do tr\u00e2nsito","layer.incidents":"Mostrar incidentes no tr\u00e2nsito","layers.choose":"Escolher exibi\u00e7\u00e3o",minimap:"Minimap","scale.switchToImperial":"Mudar para milhas","scale.switchToMetric":"Mudar para km","scale.km":"km","scale.m":"m","scale.mi":"milhas","scale.ft":"p\u00e9s","zoom.out":"Menos zoom", 804"zoom.in":"Mais zoom","zoom.rectangle":"Zoom rectangle","traffic.MASS_TRANSIT":"Transporte p\u00fablico","traffic.MISCELLANEOUS":"Miscel\u00e2nea","traffic.ACCIDENT":"Acidente","traffic.OTHER_NEWS":"Outras not\u00edcias","traffic.OTHER":"Outras not\u00edcias","traffic.PLANNED_EVENT":"Evento planejado","traffic.ROAD_HAZARD":"Risco na estrada","traffic.ROAD_CLOSURE":"Estrada fechada","traffic.WEATHER":"Clima","traffic.CONGESTION":"Congestionamento","traffic.CONSTRUCTION":"Constru\u00e7\u00e3o","traffic.DISABLED_VEHICLE":"Ve\u00edculo incapacitado", 805"traffic.LANE_RESTRICTION":"Restri\u00e7\u00e3o de pista","traffic.from":"Hora de in\u00edcio:","traffic.until":"Tempo final estimado:","distance.measurement":"Measure distance"});xt("es-ES",{"layers.normal":"Mapa","layers.satellite":"Sat\u00e9lite","layers.terrain":"Terreno","layer.transit":"Transporte p\u00fablico","layer.traffic":"Estado del tr\u00e1fico","layer.incidents":"Mostrar incidentes de tr\u00e1fico","layers.choose":"Elija una vista",minimap:"Minimap","scale.switchToImperial":"Cambiar a millas","scale.switchToMetric":"Cambiar a km","scale.km":"km","scale.m":"m","scale.mi":"mi","scale.ft":"ft","zoom.out":"Alejar","zoom.in":"Acercar","zoom.rectangle":"Zoom rectangle", 806"traffic.MASS_TRANSIT":"Transporte p\u00fablico","traffic.MISCELLANEOUS":"Varios","traffic.ACCIDENT":"Accidente","traffic.OTHER_NEWS":"M\u00e1s noticias","traffic.OTHER":"M\u00e1s noticias","traffic.PLANNED_EVENT":"Acto programado","traffic.ROAD_HAZARD":"Riesgo en carretera","traffic.ROAD_CLOSURE":"Carretera cerrada","traffic.WEATHER":"Tiempo","traffic.CONGESTION":"Atasco","traffic.CONSTRUCTION":"Construcci\u00f3n","traffic.DISABLED_VEHICLE":"Veh\u00edculo averiado","traffic.LANE_RESTRICTION":"Restricci\u00f3n de carril", 807"traffic.from":"Inicio:","traffic.until":"Finalizaci\u00f3n estimada:","distance.measurement":"Measure distance"});xt("it-IT",{"layers.normal":"Vista mappa","layers.satellite":"Satellite","layers.terrain":"Terreno","layer.transit":"Mezzi pubblici","layer.traffic":"Condizioni del traffico","layer.incidents":"Mostra incidenti stradali","layers.choose":"Scegli vista",minimap:"Minimap","scale.switchToImperial":"Passa a miglia","scale.switchToMetric":"Passa a km","scale.km":"km","scale.m":"m","scale.mi":"mi","scale.ft":"ft","zoom.out":"Zoom indietro","zoom.in":"Zoom avanti","zoom.rectangle":"Zoom rectangle","traffic.MASS_TRANSIT":"Mezzi pubblici", 808"traffic.MISCELLANEOUS":"Varie","traffic.ACCIDENT":"Incidente","traffic.OTHER_NEWS":"Altre notizie","traffic.OTHER":"Altre notizie","traffic.PLANNED_EVENT":"Evento pianificato","traffic.ROAD_HAZARD":"Strada dissestata","traffic.ROAD_CLOSURE":"Strada chiusa","traffic.WEATHER":"Maltempo","traffic.CONGESTION":"Ingorgo","traffic.CONSTRUCTION":"Lavori in corso","traffic.DISABLED_VEHICLE":"Veicolo in panne","traffic.LANE_RESTRICTION":"Restrizione di corsia","traffic.from":"Ora di inizio:","traffic.until":"Ora di fine stimata:", 809"distance.measurement":"Measure distance"});xt("fi-FI",{"layers.normal":"Karttan\u00e4kym\u00e4","layers.satellite":"Satelliitti","layers.terrain":"Maasto","layer.transit":"Julkinen liikenne","layer.traffic":"Liikenneolosuhteet","layer.incidents":"N\u00e4yt\u00e4 liikennetapahtumat","layers.choose":"Valitse n\u00e4kym\u00e4",minimap:"Minimap","scale.switchToImperial":"Vaihda maileihin","scale.switchToMetric":"Vaihda kilometreihin","scale.km":"km","scale.m":"m","scale.mi":"mi","scale.ft":"ft","zoom.out":"Loitonna","zoom.in":"L\u00e4henn\u00e4", 810"zoom.rectangle":"Zoom rectangle","traffic.MASS_TRANSIT":"Julkinen liikenne","traffic.MISCELLANEOUS":"Erittelem\u00e4t\u00f6n syy","traffic.ACCIDENT":"Onnettomuus","traffic.OTHER_NEWS":"Muu tapahtuma","traffic.OTHER":"Muu tapahtuma","traffic.PLANNED_EVENT":"Suunniteltu tapahtuma","traffic.ROAD_HAZARD":"Vaara tiell\u00e4","traffic.ROAD_CLOSURE":"Tie suljettu","traffic.WEATHER":"S\u00e4\u00e4","traffic.CONGESTION":"Ruuhka","traffic.CONSTRUCTION":"Rakennusty\u00f6","traffic.DISABLED_VEHICLE":"Pys\u00e4htynyt ajoneuvo", 811"traffic.LANE_RESTRICTION":"Kaista rajoitus","traffic.from":"Alkamisaika:","traffic.until":"Arvioitu p\u00e4\u00e4ttymisaika:","distance.measurement":"Measure distance"});function zt(a,b){if(!lb(a))throw new TypeError("string locale code required");if(ya(b))yt(a,b);else{if(-1===ut.indexOf(a))throw Error("Default locale '"+a+"' does nto exist.");b=vt[a]}this.v=b||{};this.Tm=a}t("H.ui.i18n.Localization",zt);zt.prototype.gA=function(){return this.Tm};zt.prototype.getLocale=zt.prototype.gA;zt.prototype.$z=function(){return Object.keys(this.v)};zt.prototype.getKeys=zt.prototype.$z;zt.prototype.xm=function(a){return!(!this.v||!this.v[a])};zt.prototype.hasKey=zt.prototype.xm; 812zt.prototype.translate=function(a){var b=this.v[a];if(!lb(b))throw Error("Translation missing for key '"+a+"'.");return b};zt.prototype.translate=zt.prototype.translate;function At(a,b){this.xc=a;this.Dc=null;this.hk=0;this.fg=22;this.CD=b;this.en=z(this.en,this);this.Zo=z(this.Zo,this);a=this.xc.lc();a.addEventListener("mapviewchange",this.fC,!1,this);this.vb=a.Ca.type;a=a.O;a.addEventListener("add",this.jg,!1,this);a.addEventListener("remove",this.kg,!1,this)}function Bt(a,b,c){var d=b.D;d&&(void 0===c?0:c)&&d.removeEventListener("tap",a.en);b?(d.addEventListener("tap",a.en),a.hk=d.min,a.fg=d.max):(a.hk=0,a.fg=22)}m=At.prototype; 813m.fC=function(a){var b=a.newValue.zoom;this.Dc&&a.modifiers&a.ZOOM&&(b<this.hk||b>this.fg)&&this.Dc.close()};m.jg=function(a){a=a.added;Ct(a)&&Bt(this,a)};m.kg=function(a){a=a.removed;Ct(a)&&(this.Dc&&this.Dc.close(),Bt(this,a,!0))};function Ct(a){return window.H.service&&(a.D instanceof window.H.service.traffic.incidents.Provider||a.D instanceof window.H.service.trafficVectorTile.Provider&&"incident"===a.D.$.Aq)} 814m.en=function(a){var b,c=this.vb===mi.HARP;a.target&&(b=a.target.getData())&&0===a.currentPointer.button&&(c?(b=this.xc.lc().Wa(a.currentPointer.viewportX,a.currentPointer.viewportY),(c=a.target.getData()?a.target.getData().properties.id:null)&&this.CD.requestIncidentById(c,{locationReferencing:"none",lang:this.xc.ma().Tm,units:this.xc.Qb===Ys.METRIC?"metric":"imperial"},this.Fx.bind(this,b),console.error)):(c=a.target.V(),this.Fx(c,b)),a.stopPropagation())}; 815m.Fx=function(a,b){if(this.vb===mi.HARP){b=b.incidentDetails;var c=this.xc.ma().Tm,d=b.type,e=d.split(/(?=[A-Z])/).join("_").toUpperCase();this.xc.ma().xm("traffic."+e)&&(d=this.xc.ma().translate("traffic."+e));a={position:a,title:d,description:b.description.value,startTime:(new Date(b.startTime)).toLocaleStr
815ing(c).split(",").join(" "),endTime:(new Date(b.endTime)).toLocaleString(c).split(",").join(" ")}}else c=b.TRAFFIC_ITEM_TYPE_DESC.replace(" ","_"),c=this.xc.ma().xm("traffic."+c)?this.xc.ma().translate("traffic."+ 816c):b.TRAFFIC_ITEM_DESCRIPTION[b.TRAFFIC_ITEM_DESCRIPTION.length-1].value,a={position:a,title:c,description:b.TRAFFIC_ITEM_DESCRIPTION[0].value,startTime:b.START_TIME,endTime:b.END_TIME};this.Zo(a)}; 817m.Zo=function(a){var b=a.position,c=a.title,d=a.description,e=a.startTime;a=a.endTime;this.Dc||(this.Dc=new Vs(b),this.Dc.Ha("H_tib"),this.xc.Ys(this.Dc));this.Dc.setPosition(b);this.Dc.Pk('<div class="H_tib_content"><div class="H_rdo_title" dir="auto">{{title}}</div><div class="H_tib_desc" dir="auto"><span>{{desc}}</span><div class="H_tib_time"><span class="H_tib_left">{{traffic.from}}</span><span class="H_tib_right">{{from}}</span><br/><span class="H_tib_left">{{traffic.until}}</span><span class="H_tib_right">{{until}}</span></div></div>'.replace("{{title}}",c).replace("{{desc}}", 818d).replace("{{traffic.from}}",this.xc.ma().translate("traffic.from")).replace("{{traffic.until}}",this.xc.ma().translate("traffic.until")).replace("{{from}}",e).replace("{{until}}",a));this.Dc.open()};function Dt(){this.s=Et.CLOSED;Zs.call(this,"div","H_overlay")}u(Dt,Zs);t("H.ui.base.OverlayPanel",Dt);Dt.prototype.F=function(a,b){if(a!==this.s||b)this.s=a,a===Et.OPEN?this.Ha("H_open"):this.Bb("H_open");return this};Dt.prototype.setState=Dt.prototype.F;Dt.prototype.getState=function(){return this.s};Dt.prototype.getState=Dt.prototype.getState; 819Dt.prototype.hw=function(a){var b=a.Fe;a=a.B();var c=this.B(),d=c.style;this.Bb("H_top");this.Bb("H_middle");this.Bb("H_bottom");this.Bb("H_left");this.Bb("H_center");this.Bb("H_right");d.bottom=d.top=d.left=d.right=d.margin="";if(/top/g.test(b)){this.Ha("H_top");d.top="0";d.margin="0 12px";var e=-1}else/bottom/g.test(b)?(this.Ha("H_bottom"),d.bottom="0",d.margin="0 12px",e=1):(this.Ha("H_middle"),d.top="50%",d.margin="0 12px",d.marginTop=-Math.round(.5* 820c.offsetHeight)+"px",e=0);/left/g.test(b)?(this.Ha("H_left"),d.left=a.offsetWidth+"px",d.marginLeft="12px"):/right/g.test(b)?(this.Ha("H_right"),d.right=a.offsetWidth+"px",d.marginRight="12px"):(this.Ha("H_center"),d.left="50%",0>e?(d.top=a.offsetHeight+"px",d.marginTop="12px"):0<e&&(d.bottom=a.offsetHeight+"px",d.marginBottom="12px"),d.marginLeft=-Math.round(.5*c.offsetWidth)+"px",a.appendChild(c))};Dt.prototype.pointToControl=Dt.prototype.hw;var Et={OPEN:"open",CLOSED:"closed"}; 821Dt.State=Et;function Ft(a){B(a,He,Ft,1);Y.call(this,"div","H_context_menu_item");this.Kb=a;this.lk=z(this.lk,this);this.De=z(this.De,this);this.Kb.addEventListener("update",this.De)}u(Ft,Y);t("H.ui.context.Item",Ft);Ft.prototype.lk=function(a){var b=this.Kb,c=b.callback;c&&!b.isDisabled()&&(this.dispatchEvent("click"),c(a))};Ft.prototype.N=function(){var a=this,b=this.B();Ss(b,"click",this.lk);Ss(b,"keyup",function(c){"Enter"===c.code.code&&a.lk(c)});this.uf(-1);this.De()}; 822Ft.prototype.renderInternal=Ft.prototype.N;Ft.prototype.De=function(){var a=this.B(),b=this.Kb;b.callback?this.Ha("H_clickable"):this.Bb("H_clickable");b.isDisabled()?this.Ha("H_disabled"):this.Bb("H_disabled");b=b.getLabel();Hs.textContent=b;a.innerHTML=Hs.innerHTML.split("\n").join("<br/>")};Ft.prototype.disposeInternal=function(){Y.prototype.disposeInternal.call(this);this.Kb.removeEventListener("update",this.De)};function Gt(a){a=a||{};Zs.call(this,"div","H_rdo");this.ms=new Y("div","H_rdo_title");this.Ti=new Zs("div","H_rdo_buttons");this.Sa(this.ms);this.Sa(this.Ti);this.Kv=z(function(b){b.target.getState()===ct.DOWN?(this.Ow(b.target,!0),this.dispatchEvent(Ht)):b.target.F(ct.DOWN,!0)},this);this.addEventListener("statechange",this.Kv);this.bs(a.title||"");a.onActiveButtonChange&&this.addEventListener(Ht,a.onActiveButtonChange);a.buttonsOptions&&a.buttonsOptions.forEach(function(b){this.yo(new dt(b))}, 823this)}u(Gt,Zs);t("H.ui.base.RadioGroup",Gt);var Ht="activebuttonchange";Gt.prototype.N=function(a,b){Zs.prototype.renderInternal.call(this,a,b);this.bs(this.io,!0)};Gt.prototype.renderInternal=Gt.prototype.N;Gt.prototype.ia=function(){this.Ti.ia()};Gt.prototype.bs=function(a,b){if(a!==this.io||b)this.io=a,this.ms.B()&&(this.ms.B().innerHTML=this.io);return this};Gt.prototype.setTitle=Gt.prototype.bs;Gt.prototype.JA=function(){return this.io};Gt.prototype.getTitle=Gt.prototype.JA;
824Gt.prototype.yo=function(a){if(!(a instanceof dt))throw Error("PushButton expected");a.ea(this);this.Ti.Sa(a);return this};Gt.prototype.addButton=Gt.prototype.yo;Gt.prototype.BC=function(a){this.Ti.removeChild(a);a.ea(null);return this};Gt.prototype.removeButton=Gt.prototype.BC;Gt.prototype.Cj=function(){return this.Ti.Dj()};Gt.prototype.getButtons=Gt.prototype.Cj;Gt.prototype.Ow=function(a,b){for(var c=this.Cj(),d=c.length;d--;)c[d].F(c[d]===a?ct.DOWN:ct.UP,b)};Gt.prototype.setActiveButton=Gt.prototype.Ow; 825Gt.prototype.disposeInternal=function(){this.removeEventListener("statechange",this.Kv);this.ia();Zs.prototype.disposeInternal.call(this)};var It={};It=function(a,b,c){ed.call(this);this.qh=-1;this.G=a;this.Nm=b;this.Nv=c;this.je=z(this.je,this);a.focus();Ss(a,"keydown",this.je)};u(It,ed);It.prototype.disposeInternal=function(){this.qh=-1;this.Gx();It.g.disposeInternal.call(this);Ts(this.G,"keydown",this.je);var a=this.Nv;this.G=this.Nm=this.Nv=null;a()}; 826It.prototype.je=function(a){if(a instanceof KeyboardEvent){var b=this.Nm.length-1,c=/^Arrow(Down|Up)$/.exec(a.code);if(c){if(a={Up:-1,Down:1}[c[1]])this.qh=0>this.qh&&0>a?b:gc(this.qh+a,0,b),this.Gx()}else"Enter"===a.code?(b=this.Nm[this.qh],b instanceof bt?(b.Jb()instanceof Gt?b.F(ct.DOWN):b.xx(),this.l()):b instanceof Ft&&(b.lk(),this.l())):"Escape"===a.code&&this.l()}};It.prototype.Gx=function(){var a=this;this.Nm.forEach(function(b,c){c===a.qh?b.Ha("H_focused"):b.Bb("H_focused")})};function Jt(a){a=a||{};$s.call(this);this.ce=new Dt;this.te=this.te.bind(this);this.Fc=this.Fc.bind(this);this.Rc=this.Rc.bind(this);this.um=this.um.bind(this);this.$c(a.alignment||"bottom-right");Kt(this,a.baseLayers,a.layers)}u(Jt,$s);t("H.ui.MapSettingsControl",Jt);function Lt(a,b){var c=[];a.concat(b).forEach(function(d){c=c.concat(d.layer)});return c}function Mt(a,b,c){var d=a.lc();if(d){a=Lt(a.He,a.ag);var e=Lt(b,c);a.forEach(function(f){e.includes(f)||d.hi(f)})}} 827function Kt(a,b,c){Mt(a,b,c);a.vq=NaN;a.He=kb(b)?b:[];a.ag=kb(c)?c:[];a.Bf&&(a.Bf.ia(),a.ck.ia(),Nt(a))}Jt.prototype.subscribe=function(){var a=this.lc();if(a){var b=this.Jb();b&&(b=b.B())&&Dd(b,"pointerdown",this.Rc);Dd(a,"pointerdown",this.Rc);a=a.O;Dd(a,"add",this.te);Dd(a,"remove",this.te);Dd(a,"set",this.te)}};Jt.prototype.Rc=function(a){this.ce.getState()===Et.OPEN&&(a.currentTarget!==this.lc()&&this.ce.B().contains(a.target)||this.Fc())}; 828Jt.prototype.unsubscribe=function(){var a=this.lc();if(a){var b=this.Jb();b&&(b=b.B())&&Ld(b,"pointerdown",this.Rc);Ld(a,"pointerdown",this.Rc);a=a.O;Ld(a,"add",this.te);Ld(a,"remove",this.te);Ld(a,"set",this.te)}}; 829Jt.prototype.N=function(a,b){var c=this.ma().translate("layers.choose");$s.prototype.renderInternal.call(this,a,b);this.subscribe();this.tc=new dt({tooltip:c,label:'<svg xmlns="http://www.w3.org/2000/svg" class="H_icon" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M6.7,14.6 L4.5,16 L12,20.6 L19.5,16 L17.3,14.6 L19.1,13.5 L23,16 L12,23 L1,16 L4.9,13.5 L6.7,14.6 Z M12,2 L23,9 L12,16 L1,9 L12,2 Z"></path></svg>',onStateChange:z(function(e){var f=this;e.target.getState()===ct.DOWN?(this.ce.F(Et.OPEN), 830this.ce.hw(this),this.Yj=new It(this.B().ownerDocument.body,this.Bf.Cj().c
830oncat(this.ck.Dj()),function(){f.tc.F(ct.UP);f.tc.B().blur()})):globalThis.setTimeout(function(){f.ce.F(Et.CLOSED);f.Yj.l()})},this)});this.Bf=new Gt({title:c,onActiveButtonChange:function(){var e=this.vq;a:{var f=this.Bf.Cj();for(var g=f.length;g--;)if(f[g].getState()===ct.DOWN){f=f[g];break a}f=null}f=f.getData();f=this.He[f].layer;g=kb(f);this.map.Dg(g?f[0]:f);if(e=this.He[e])if(e=e.layer,kb(e))for(var h=e.length;1<h--;)this.map.hi(e[h]); 831if(g)for(e=f.length;1<e--;)this.map.Bl(f[e],1);Ot(this,f);this.um();this.Fc()}.bind(this)});this.ck=new Zs("div","H_grp");this.Bu=new Y("div","H_separator");this.Sa(this.tc);this.Sa(this.ce);this.ce.Sa(this.Bf);this.ce.Sa(this.Bu);this.ce.Sa(this.ck);Nt(this);var d=this;Ss(this.tc.B(),"focus",function(){d.tc.F(ct.DOWN)});Ss(this.tc.B(),"blur",function(){d.Fc()})};Jt.prototype.renderInternal=Jt.prototype.N; 832function Ot(a,b){if(a.map.Ca.type===Nm){var c=H.map.render.harp.Style;b=[].concat(b);for(var d=0;!f&&d<b.length;d++){var e=b[d].D;if(e.Xc()&&e.K){e=e.K();var f=e.getConfig()||e.getUrl()}}if(f){var g=function(h){h=h.D;h.Xc()&&h.K&&h.K()instanceof c&&h.Cb(new c(f))};a.ag.forEach(function(h){h=h.layer;kb(h)?h.forEach(g):h&&g(h)})}}} 833function Nt(a){var b=a.ma();a.He.forEach(function(c,d){var e=c.layer;c=new dt({label:Pt(b,c.label),data:d,disabled:!e||kb(e)&&!e.length});c.uf(-1);this.Bf.yo(c)},a);a.ag.forEach(function(c,d){var e=c.layer;c=new dt({label:Pt(b,c.label),onStateChange:this.bC.bind(this,c.layer),data:d,disabled:!e||kb(e)&&!e.length});c.uf(-1);this.ck.Sa(c)},a);a.Bu.Zb(!(!a.ag.length||!a.He.length));globalThis.setTimeout(function(){this.map&&(this.te(),this.tc.wa(!(this.He&&this.He.length||this.ag&&this.ag.length)))}.bind(a))} 834Jt.prototype.te=function(){var a=this.map.pa,b=this.map.O;this.vq=NaN;this.He.forEach(function(c,d){c=c.layer;c=a===(kb(c)?c[0]:c);this.Bf.Cj()[d].F(ct[c?"DOWN":"UP"],!0);c&&(this.vq=d)},this);this.ag.forEach(function(c,d){c=c.layer;var e=kb(c);d=this.ck.Dj()[d];!c||e&&!c.length?d.wa(!0):d.F(ct[-1!==b.indexOf(e?c[0]:c)?"DOWN":"UP"],!0)},this)};Jt.prototype.bC=function(a,b){a=kb(a)?a:[a];b=b.target.getState()===ct.DOWN;for(var c=0;c<a.length;c++)b?this.map.Bl(a[c]):this.map.hi(a[c]);this.um();this.Fc()}; 835Jt.prototype.um=function(){var a=Qt(this);a&&(a.vo.D.K().fk(a.D.K().Sd()),this.map.hi(a),a.l(),delete a.vo);Rt(this)&&St(this,this.map.pa)}; 836function St(a,b){var c=window.H.service&&window.H.service.omv.Provider,d=b.D;if(c&&b.D instanceof c&&d.K().vj){var e=d.K(),f=function(){var g=Tt.ground.filter(function(l){return!!e.Op("layers."+l)}),h=Tt.water.filter(function(l){return!!e.Op("layers."+l)});if(g.concat(h).length){var k={};Dg(k,e.vj(g));Dg(k,e.vj(h,!1,!0));delete k.global;g=new Xg(k,e.Lc());g=d.$.od(g);g.vo=b;this.map.Bl(g)}e.removeEventListener(Cg.CHANGE,f)}.bind(a);e.getState()!==Ag.READY?e.addEventListener(Cg.CHANGE,f): 837f()}}function Qt(a){return ys(a.map.O.Ta(),function(b){return!!b.vo})}function Rt(a){a=a.map.O.Ta();var b=window.H.service&&window.H.service.traffic.flow.Provider;return!!b&&a.some(function(c){return c.D instanceof b})}var Tt={water:["water.water-labels"],ground:"road_labels continent_label island_label roads.shields roads.directions truck-restriction.signs places landuse.label".split(" ")};function Pt(a,b){return/^layers?/.test(b)&&a.xm(b)?a.translate(b):b} 838Jt.prototype.Fc=function(){this.tc.F(ct.UP);this.tc.B().blur()};Jt.prototype.disposeInternal=function(){Jt.g.disposeInternal.call(this);this.unsubscribe()};function Ut(a){B(a,Array,Ut,1);Zs.call(this,"div","H_context_menu");this.FB=a;this.v=null;this.Fc=this.Fc.bind(this)}u(Ut,Zs);t("H.ui.context.Menu",Ut);Ut.prototype.disposeInternal=function(){Ut.g.disposeInternal.call(this);this.Yj&&this.Yj.l();this.Yj=null};Ut.prototype.disposeInternal=Ut.prototype.disposeInternal; 839Ut.prototype.N=function(){Zs.prototype.N.apply(this,arguments);this.FB.forEach(function(a){a===Ie?a=new Y("div","H_context_menu_item_separator"):(a=new Ft(a),a.addEventListener("click",this.Fc));this.Sa(a);this.uf(0)},this);Dd(this.B(),["mousedown","touchstart","pointerdown","wheel"],function(a){a.stopPropagation()});this.Yj=new It(this.B(),this.Dj().filter(function(a){return a instanceof Ft?(a=a.Kb,a.callback&&!a.isDisabled()):!1}),this.Fc)};Ut.prototype.renderInternal=Ut.prototype.N; 840Ut.prototype.setPosition=function(a,b){if(this.v){var c=this.B();var d=c.offsetWidth;var e=c.offsetHeight;var f=this.v;var g=f.sa.width;f=f.sa.height;a+d>g&&a>g/2&&(a-=d);b+e>f&&b>f/2&&(b-=e);Bs(c,a,b)}};Ut.prototype.setPosition=Ut.prototype.setPosition;Ut.prototype.Fc=function(){this.v&&this.v.dispatchEvent(new pd("contextmenuclose",this.v))};Ut.prototype.Qa=function(a){this.v=a};Ut.prototype.setMap=Ut.prototype.Qa;function Vt(a,b,c){Li.call(this,a,{icon:Wt,visibility:c}
840);Xt(this,b)}u(Vt,Li);function Xt(a,b){a.mB=b;a.G&&(a.G.textContent=b)}var Wt=new Ei(Ps(globalThis.document,"span","H_dm_label"),{onAttach:function(a,b,c){c.G=a;Xt(c,c.mB)},onDetach:function(a,b,c){delete c.G}});function Yt(a,b){I.call(this);this.Ne=a;this.Wb=new Vt(this.zD,"");b.push(this.Wb);this.ud=new T({objects:b,data:this});this.$n=this.$n.bind(this)}u(Yt,I);m=Yt.prototype;m.$e=!1;m.zD={lat:0,lng:0};m.xe=function(a,b){Xt(this.Wb,a);this.Wb.X(b)};m.Sk=function(a){(this.Ld=a)?this.$n():(this.kl&&globalThis.clearTimeout(this.kl),this.kl=globalThis.setTimeout(this.$n,100))};m.kl=0;m.$n=function(){this.Wb.Zb(this.Ld)};function Zt(a,b){b&&(a.nextSibling=b,b.previousSibling=a)};var $t={btn:'<svg class="H_icon" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><g fill-rule="evenodd"><g transform="translate(3 2)"><path d="m18 13v7h-18v-7h2v5h2v-2h2v2h2v-3h2v3h2v-2h2v2h2v-5z"></path><path d="m2.3.3c.7 0 1.3.1 1.8.4s.9.6 1.1 1 .4.9.4 1.4c0 .5-.1 1-.3 1.4s-.57 1-1 1.6-1.3 1.3-2.3 2.2h3.9l-.2 1.7h-6.16v-1.6c1.1-1.1 2-2 2.5-2.6s.9-1 1-1.4.3-.8.3-1.2c0-.4-.1-.7-.3-.9s-.5-.3-.9-.3c-.3 0-.6 0-.9.2s-.5.4-.8.7l-1.3-1c.4-.5.9-.9 1.4-1.2s1.2-.4 1.8-.4zm14.4 9.7h-2.3l-.2-3.8c 0-.9-.1-1.7-.1-2.4 0-.5 0-1 0-1.5l-1.5 6.7h-2.2l-1.6-6.7c.1.8.1 1.6.1 2.3 0 .5 0 1.1 0 1.7l-.2 3.8h-2.2l.7-9.7h2.9l1.5 6.6 1.4-6.6h2.9z"></path></g></g></svg>', 841point:'<svg height="22" viewBox="0 0 12 12" width="22" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><path d="m6 12c3.3 0 6-2.7 6-6s-2.7-6-6-6-6 2.7-6 6 2.7 6 6 6z" fill="#fff"></path><path d="m6 10c2.2 0 4-1.8 4-4s-1.8-4-4-4-4 1.8-4 4 1.8 4 4 4z" fill="#2ed5c9" stroke="#272c36" stroke-width="2"></path></g></svg>'};function au(a,b,c,d){var e=new J,f=[];Zt(a,this);Zt(this,b);e.tg(a.ya());e.tg(b.ya());this.Oh=new Bi(e,{style:c.Nh});this.yu=new Bi(e,{style:{strokeColor:"transparent",lineWidth:Math.min(100,this.Oh.K().lineWidth+2*(d||5))}});c.outlineStyle&&(this.cr=new Bi(e,{style:c.outlineStyle}),f.push(this.cr));f.push(this.Oh,this.yu);Yt.call(this,c,f);this.fv=this.ev=-1;a=this.ud;a.addEventListener("pointermove",this.ie,!0,this);a.addEventListener("pointerleave",this.Wq,!0,this)}u(au,Yt); 842au.prototype.Ij=function(){var a=this.Oh.V();return a.wj(0).kb(a.wj(1))};function bu(a,b,c){var d=a.Oh.V();d.Yk(3*+c,3,[b.lat,b.lng,0]);a.cr&&a.cr.X(d);a.yu.X(d);a.Oh.X(d)}au.prototype.ie=function(a){var b=a.currentPointer;a=this.previousSibling.ya();var c=this.nextSibling.ya(),d=this.Ne.gx,e=b.viewportX;b=b.viewportY;if(this.ev!==e||this.fv!==b)this.ev=e,this.fv=b,d.X(this.Ne.kA(a,c,{x:e,y:b})),d.Zb(!0)};au.prototype.Wq=function(){this.Ne.gx.Zb()}; 843au.prototype.Nr=function(){this.xe(this.Ne.Jt(this.Ij()),this.Oh.C().wb())};function cu(a,b,c){c=b.Jj(c||0);this.eg=new bn(a,{icon:c,zIndex:0});this.eg.draggable=!0;Yt.call(this,b,[this.eg]);a=this.ud;a.addEventListener("dragstart",this.Cd,!0,this);a.addEventListener("drag",this.ig,!0,this);a.addEventListener("dragend",this.ef,!0,this)}u(cu,Yt);m=cu.prototype;m.kh=0;m.j={Af:"change"};m.Ij=function(){return this.kh};m.ya=function(){return this.eg.V()}; 844function du(a){var b=0;a.nextSibling&&a.previousSibling&&(a.nextSibling.$e||a.previousSibling.$e?a.nextSibling.$e&&!a.previousSibling.$e&&(b=2):b=1);b=a.Ne.Jj(b);a.eg.we(b)}m.ig=function(a){var b=a.currentPointer;a=b.viewportX;b=b.viewportY;if(this.nB!==a||this.oB!==b)this.nB=a,this.oB=b,this.eg.X(this.Ne.map.Wa(a-this.wv.x,b-this.wv.y)),this.dispatchEvent(new pd(this.j.Af,this))}; 845m.Cd=function(a){var b=a.currentPointer,c=b.viewportX;b=b.viewportY;var d=this.Ne.map.La(this.ya());this.eg.ui(1);this.wv={x:c-d.x,y:b-d.y};a.stopPropagation()};m.ef=function(){this.eg.ui(0)};m.Nr=function(a){this.kh=a;this.xe(this.Ne.Jt(a),this.ya())};function eu(a,b){this.Ia=b;this.vc=a;this.nb={$e:!0};fu(this,this.nb);this.hn=z(this.hn,this)}t("H.ui.distanceMeasurement.Model",eu);m=eu.prototype;m.Im=function(){return this.nb.nextSibling===this.nb};m.Sk=function(a){for(var b=this.nb,c=b.nextSibling;c!==b;)c.Sk(c.previousSibling===b?!1:a),c=c.nextSibling}; 846function gu(a,b){var c=b||a.nb.nextSibling,d=0,e=0;if(b&&!hu(a,b))throw new C(a.Ek,0,b);c instanceof cu?d=c.Ij():c instanceof au&&(d=c.previousSibling.Ij());for(b=c;b&&b!==a.nb;b=b.nextSibling,e++)b.Nr(d),1===e%2&&(d+=b.Ij())}m.Pi=function(a){var b=this.nb.previousSibling,c=this.Im();a=new cu(a,this.Ia,c?0:2);this.vc.Y(a.ud);Zt(a,this.nb);a.addEventListener(a.j.Af,this.hn);c?fu(this,a):(iu(this,b,a),du(b),gu(this,b));return a}; 847m.insertBefore=function(a,b){var c;var d=1;if(b){if(!hu(this,b))throw new C(this.insertBefore,1,b);if(c=b.previousSibling.$e)d=0;a=new cu(a,this.Ia,d);a.addEventListener(a.j.Af,this.hn);this.vc.Y(a.ud);
847c?(c=this.nb.nextSibling,iu(this,a,c),fu(this,a),b=a,du(c)):(c=b.previousSibling,b=c.previousSibling,d=c.nextSibling,this.vc.Oa(c.ud),iu(this,b,a),iu(this,a,d));gu(this,b)}else a=this.Pi(a);return a};m.ia=function(){fu(this,this.nb);this.vc.ia()}; 848m.Ek=function(a){var b=this.nb,c=a.previousSibling,d=a.nextSibling;if(!hu(this,a))throw new C(this.Ek,0,a);this.vc.Oa(a.ud);if(c===b){var e=d;e!==b?(a=e.nextSibling,fu(this,a),a.Nr(0),du(a),gu(this,a)):fu(this,this.nb)}else d===b?(e=c,a=e.previousSibling,Zt(a,b),du(a)):c&&d&&(iu(this,c.previousSibling,d.nextSibling),this.vc.vg([d.ud,c.ud]),gu(this,c.previousSibling));e&&e!==b&&this.vc.Oa(e.ud)}; 849function hu(a,b){for(var c=a.nb.nextSibling,d=!1;c!==a.nb;){if(c===b){d=!0;break}c=c.nextSibling}return d}function iu(a,b,c){b=new au(b,c,a.Ia);a.vc.Y(b.ud)}function fu(a,b){a.nb.nextSibling=b;b.previousSibling=a.nb}m.hn=function(a){a=a.target;var b=a.previousSibling,c=a.nextSibling,d=a.ya();if(!c.$e){bu(c,d,!1);var e=a}b.$e||(bu(b,d,!0),e=b.previousSibling);gu(this,e)};function ju(a){a=a||{};var b,c=a.lineStyle;$s.call(this);this.Lo=new dt({label:$t.btn,onStateChange:z(this.gf,this)});this.Sa(this.Lo);if(b=a.distanceFormatter)this.Kt=b;c&&(this.ov=c,this.Xv=A);this.$c(a.alignment||"right-bottom");this.vd={};this.vd[0]=a.startIcon;this.vd[2]=a.endIcon;this.vd[1]=a.stopoverIcon;this.vd[3]=a.splitIcon}u(ju,$s);t("H.ui.DistanceMeasurement",ju);m=ju.prototype;m.Qb=Ys.METRIC;m.Vx=22;m.ov={strokeColor:"rgb(39,44,54)",lineWidth:5};m.Xv={strokeColor:"white",lineWidth:7}; 850m.Wk=function(){var a=this.map,b,c={};this.Wj||(this.sc=new P,this.qb=new tl(this.sc,{pixelRatio:this.map.lb()}),this.vc=b=this.sc.sd(),this.vc.$w(!0),b.addEventListener("dragstart",this.Cd,!0,this),b.addEventListener("dragend",this.Xk,!0,this),b.addEventListener("pointerenter",this.Xk,!0,this),b.addEventListener("pointerleave",this.Wq,!0,this),b.addEventListener("tap",this.iC,!0,this),this.Zk=ku(this),c.Jt=z(this.Kt,this),c.Jj=z(this.Jj,this),c.kA=z(this.pu,this),c.map=this.map,c.gx=this.Zk,c.Nh= 851this.ov,c.outlineStyle=this.Xv,this.Kb=new eu(this.vc,c),this.Wj=!0);this.Zk&&this.vc.Y(this.Zk);a.addEventListener("tap",this.Qv,!0,this);a.O.add(this.qb)};m.Ai=function(){var a=this.map;this.Wj&&(a.removeEventListener("tap",this.Qv,!0,this),a.hi(this.qb),this.Kb.ia())}; 852function ku(a){function b(){var h=c.mc();h={anchor:c.Db.clone().scale(f).floor(),size:new Xh(Hb(h.w*f),Hb(h.h*f)),hitArea:d};return new zm(c.Te(),h)}var c=a.Jj(3),d=new Gi(Hi.NONE,[]),e,f=c===a.Hs?.5:1;if(1===c.getState())var g=b();else g=new zm("<svg/>",{hitArea:d}),c.addEventListener("statechange",function(){1===c.getState()&&e.we(b())});return e=new bn(a.map.wb(),{visibility:!1,icon:g})} 853m.Kt=function(a){var b="m",c=0;"metric"===this.Qb?1E3<=a&&(a/=1E3,b="km",c=1):(a/=.3048,b="ft",5280<=a&&(a/=5280,b="mi",c=1));return a.toFixed(c)+" "+this.ma().translate("scale."+b)};m.pu=function(a,b,c){var d=this.map.La(a);b=this.map.La(b);c=(new K(c.x,c.y)).ou(d,b);return this.map.Wa(c.x,c.y)||vc(a)}; 854m.N=function(a,b){var c=this.map.Ca.type===mi.P2D?this.map.lb():1;c*=this.Vx;var d=c/2;$s.prototype.renderInternal.call(this,a,b);this.Qb=Ys.METRIC;this.Hs=new zm($t.point,{anchor:{x:d,y:d},size:{w:c,h:c},hitArea:new Gi(Hi.CIRCLE,[d,d,d])});this.Lo.Gd(this.ma().translate("distance.measurement"))};ju.prototype.renderInternal=ju.prototype.N;m=ju.prototype;m.Jj=function(a){return this.vd[a]||this.Hs};m.Xk=function(){this.Kb.Sk(!0)};m.Cd=function(){this.Kb.Sk()}; 855m.Wq=function(a){"touch"!==a.currentPointer.type&&this.Kb.Sk()};m.iC=function(a){var b=a.currentPointer;var c=a.target.Na;var d;c&&(c=c.getData())instanceof Yt&&(d=c);c=d;a=a.originalEvent;a=a.metaKey||a.altKey;c&&(a&&c instanceof cu?this.Kb.Ek(c):c instanceof au&&(a=c.previousSibling.ya(),d=c.nextSibling.ya(),b={x:b.viewportX,y:b.viewportY},this.Kb.insertBefore(this.pu(a,d,b),c.nextSibling),this.Zk.Zb()),this.Xk())}; 856m.Qv=function(a){var b=a.currentPointer;a=a.target;a!==this.map&&a.getProvider&&a.getProvider()===this.sc||(this.Kb.Pi(this.map.Wa(b.viewportX,b.viewportY)),this.Zk.Zb(),this.Xk())};m.gf=function(a){"down"===a.target.getState()?this.Wk():this.Ai()};m.qk=function(a){this.Qb=a;this.Wj&&(gu(this.Kb),this.Xk())};ju.prototype.onUnitSystemChange=ju.prototype.qk;ju.prototype.disposeInternal=function(){this.Ai();this.Wj&&(this.sc.l(),this.qb.l());ju.g.disposeInternal.call(this)}; 857ju.prototype.Qa=function(a){a?this.Lo.getState()===ct.DOWN&&(this.map=a,this.Wk()):(this.Ai(),this.Wj=!1);$s.prototype.Qa.apply(this,arguments)};ju.prototype.setMap=ju.prototype.Qa;var lu={"in":'<svg version="1.1" class="H_icon" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px"viewBox="0 0 24 24" enable-background="new 0 0 24 24" xml:space="preserve"><g><path d="m5 10.6h5.6v-5.6h2.8v5.6h5.6v2.8h-5.6v5.6h-2.8v-5.6h-5.6v-2.8z"></path></g></svg>',out:'<svg version="1.1" class="H_icon" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px"viewBox="0 0 24 24" enable-background="new 0 0 24 24" xml:space="preserve"><path d="m5 10.6h14v2.8h-14z"/></svg>'};function mu(a){a=a||{};var b;this.zf=!!a.vertical;this.rB=a.length||this.Wx;this.zb=ob(b=a.min)?b:this.Yx;this.Qc=Fb(this.zb,ob(b=a.max)?b:this.Xx);this.lD=D(b=a.step)?this.Zx:b;this.Ei=nu(this,ob(b=a.value)?b:(this.zb+this.Qc)/2);this.Rc=z(this.Rc,this);this.ie=z(this.ie,this);this.kn=z(this.kn,this);this.jn=z(this.jn,this);this.tk=a.pointerArea;Y.call(this,"div","H_slider"+(this.zf?"":" H_l_horizontal"))}u(mu,Y);
857t("H.ui.base.Slider",mu);m=mu.prototype;m.Ms=1;m.Yx=0;m.Xx=100; 858m.Zx=1;m.Wx="16em";m.bo=function(a,b){var c=this.zf,d=c?"top":"left";if(!this.Ka||b)a=gc(a,this.zb,this.Qc),this.Lh&&(b=100*(a-this.zb)/(this.Qc-this.zb),c=(c?-1:1)*b,this.Lh.style[d]=c+"%",this.BD.style[d]=100+c+"%"),this.Ei=nu(this,a);return this.Ei};mu.prototype.setValue=mu.prototype.bo;mu.prototype.NA=function(){return this.Ei};mu.prototype.getValue=mu.prototype.NA;m=mu.prototype; 859m.Wk=function(){if(!this.jq){Ss(this.B(),"start",this.Rc);var a=this.tk;Ss(a,"move",this.ie);Ss(a,"end",this.kn);Ss(a,"out",this.jn);this.jq=!0}};m.Ai=function(){if(this.jq){Ts(this.B(),"start",this.Rc);var a=this.tk;Ts(a,"move",this.ie);Ts(a,"end",this.kn);Ts(a,"out",this.jn);this.jq=!1}};function nu(a,b){var c=a.lD;b=gc(b,a.zb,a.Qc);return c?a.zb+Gb((b-a.zb)/c)*c:b} 860function ou(a,b){var c=a.Ex,d=a.zf;a.Dx||(a.Dx=c["offset"+(d?"Height":"Width")]);b-=As(c)[d?"y":"x"];0>b&&(b=0);b=(a.Qc-a.zb)*b/a.Dx;b=nu(a,d?a.Qc-b:a.zb+b);a.Ei!==b&&(a.bo(b,!0),a.dispatchEvent(new ji(a.j.Af,b,a.Ei)))}function pu(a,b){return(b.touches?b.targetTouches[0]:b)["page"+(a.zf?"Y":"X")]}function qu(a,b){var c=!1,d=a.type;-1!==d.indexOf("pointer")||-1!==d.indexOf("touch")?c=!0:B(a,MouseEvent)&&(c=a.which===b||a.buttons===b);return c} 861function ru(a){var b=a.touches;return b&&1===b.length||B(a,MouseEvent)}m.Rc=function(a){var b=this.zf;if(qu(a,this.Ms)&&ru(a)){var c=pu(this,a);var d=a.target;d===this.Lh||d.parentElement===this.Lh?(this.lB=c-As(this.Lh)[b?"y":"x"]-this.Lh.offsetWidth/2,this.B().className="H_slider H_slider_active"+(this.zf?"":" H_l_horizontal"),this.Ka=!0):ou(this,c);a.preventDefault()}};m.kn=function(){this.Ka&&(this.B().className="H_slider "+(this.zf?"":" H_l_horizontal"),this.Ka=!1)}; 862m.jn=function(a){this.Ka&&a.target===this.tk&&(this.Ka=!1)};m.ie=function(a){this.Ka&&ru(a)&&(qu(a,this.Ms)?(ou(this,pu(this,a)-this.lB),a.preventDefault()):this.Ka=!1)};m.j={Af:"change"}; 863m.N=function(a,b){var c=Ps(b,"div","H_slider_cont"),d=Ps(b,"div","H_slider_knob_cont"),e=Ps(b,"div","H_slider_knob"),f=Ps(b,"div","H_slider_knob_halo"),g=Ps(b,"div","H_slider_track");b=Ps(b,"div","H_slider_track H_slider_track_active");a.appendChild(c);c.appendChild(g);g.appendChild(b);c.appendChild(d);d.appendChild(e);d.appendChild(f);this.Ex=g;this.BD=b;this.Lh=d;this.tk||(this.tk=a.ownerDocument.body);c.style[this.zf?"height":"width"]=this.rB;this.bo(this.Ei); 864this.Wk()};mu.prototype.renderInternal=mu.prototype.N;mu.prototype.disposeInternal=function(){this.Ai()};mu.prototype.wa=function(a,b){a?this.Ai():this.Ex&&this.Wk();return Y.prototype.wa.call(this,a,b)};mu.prototype.setDisabled=mu.prototype.wa;function su(a){a=a||{};var b=a.slider;$s.call(this);this.on=z(this.on,this);this.ql=z(this.ql,this);this.Kd=z(this.Kd,this);b&&(this.Xq=z(this.Xq,this),this.Eu=b,this.kD=a.sliderSnaps,this.Ha("H_zoom_slider"));this.tl=new bt({label:lu["in"],onStateChange:this.on});this.so=new bt({label:lu.out,onStateChange:this.on});this.Ha("H_zoom");this.Ha("H_grp");this.mz=!1!==a.fractionalZoom;this.setZoomSpeed(a.zoomSpeed||4);this.$c(a.alignment||"right-middle")}u(su,$s); 865t("H.ui.ZoomControl",su);su.prototype.TA=function(){return this.Qx};su.prototype.getZoomSpeed=su.prototype.TA;su.prototype.gD=function(a){this.Qx=a};su.prototype.setZoomSpeed=su.prototype.gD;su.prototype.Qa=function(a){this.map!==a&&(this.map&&this.map.removeEventListener("mapviewchange",this.ql),tu(this));$s.prototype.Qa.apply(this,arguments);this.map&&(this.Kd(),a.addEventListener("mapviewchange",this.ql),a.addEventListener("baselayerchange",this.Kd))};su.prototype.setMap=su.prototype.Qa; 866su.prototype.disposeInternal=function(){$s.prototype.disposeInternal.apply(this,arguments);this.map.removeEventListener("baselayerchange",this.Kd);tu(this)};su.prototype.N=function(a,b){$s.prototype.renderInternal.call(this,a,b);this.tl.Gd(this.ma().translate("zoom.in"));this.so.Gd(this.ma().translate("zoom.out"))};su.prototype.renderInternal=su.prototype.N;su.prototype.$c=function(a){var b=this.Fe;$s.prototype.$c.call(this,a);b!==a&&this.Kd();return this};su.prototype.setAlignment=su.prototype.$c; 867su.prototype.ql=function(){var a=this.map,b=a.Ub(),c=a.lb()-1;a=a.pa||a.Ca.getCapabilities().lookAt.zoom;this.Eu&&this.vi.bo(b);this.ub||(this.tl.wa(b+c>=a.max),this.so.wa(b<=a.min))};su.prototype.wa=function(a,b){su.g.wa.call(this,a,b);this.ql();return this};su.prototype.setDisabled=su.prototype.wa;function tu(a){a.removeChild(a.vi);a.vi=null;a.pa&&(a.pa.removeEventListener("minchange",a.Kd),a.pa.removeEventListener("maxchange",a.Kd),a.pa=null)} 868su.prototype.on=function(a){a=a.target;var b=a===this.tl?1:-1,c=0<b?Math.ceil:Math.floor,d=this.map,e,f=this;d&&("down"===a.getState()?(d.xa.startControl(),d.xa.control(0,0,b*this.Qx,0,0,0)):d.xa.endControl(!0,function(g){e=f.mz?g.zoom:c(g.zoom);g.zoom=e}))};su.prototype.Xq=function(a){this.map&&this.map.Vk(a.newValue)}; 869su.prototype.Kd=function(){var a=this.Fe,b=this.lc();
869if(/^top/g.test(a)||/^bottom/g.test(a)){var c=this.so;a=this.tl;var d=!1}else c=this.tl,a=this.so,d=!0;this.removeChild(c);this.removeChild(a);this.Sa(c);if(this.Eu&&b){tu(this);b=d;var e=(d=(c=this.map)&&c.pa)||c.Ca.getCapabilities().lookAt.zoom;if(this.pa=d)d.addEventListener("minchange",this.Kd),d.addEventListener("maxchange",this.Kd);this.vi=new mu({step:this.kD?1:0,vertical:b,min:e.min,max:e.max,value:c.Ub(),pointerArea:c.B()});this.vi.addEventListener(this.vi.j.Af, 870this.Xq);this.Sa(this.vi)}this.Sa(a)};function uu(a,b){try{return a.Hm=!0,new a(b)}finally{a.Hm=!1}} 871function vu(a,b){var c=a.B(),d=this;I.call(this);this.v=a;this.qj=c.ownerDocument;this.Hf={};this.Je=[];this.G=Ps(this.qj,"div","H_ui");this.setDirection();this.UB=z(function(e){this.nv.put(e.target,e.target.Fe)},this);this.addEventListener("alignmentchange",this.UB);this.jC=z(function(){this.yx()},this);this.addEventListener("toggleunitsystem",this.jC);this.G.addEventListener("contextmenu",this.mw,!1);this.G.addEventListener("MSHoldVisual",this.mw,!1);this.v.addEventListener("contextmenu",this.bn, 872!1,this);this.v.addEventListener("contextmenuclose",this.Lv,!1,this);this.v.bc(this.l.bind(this));this.Od=null;this.rt=-1;this.nv=new jt(this.G,this.qj);this.Qb=Ys.METRIC;wu(this,"en-US");b&&xu(this,b);c.appendChild(this.G);globalThis.setTimeout(function(){d.nv.update()},1)}u(vu,I);t("H.ui.UI",vu);vu.prototype.mw=function(a){for(var b=a.target;b&&!/\bH_ib_content\b/.test(b.className);)b=b.parentNode;b||a.preventDefault()};vu.prototype.B=function(){return this.G}; 873vu.prototype.getElement=vu.prototype.B;vu.prototype.lc=function(){return this.v};vu.prototype.getMap=vu.prototype.lc;vu.prototype.MA=function(){return this.Qb};vu.prototype.getUnitSystem=vu.prototype.MA;vu.prototype.ao=function(a){var b=this.Hf,c;if(a!==this.Qb)for(c in this.Qb=a,b)if(b[c]instanceof $s)b[c].onUnitSystemChange(this.Qb)};vu.prototype.setUnitSystem=vu.prototype.ao;vu.prototype.setDirection=function(a){this.G.setAttribute("dir",a||getComputedStyle(this.lc().B()).direction)}; 874vu.prototype.setDirection=vu.prototype.setDirection;function wu(a,b){if(lb(b))var c=b;else if(b instanceof zt){c=b.Tm;var d=b}else throw Error("The locale parameter must be a string or a H.ui.i18n.Localization object.");if(c)if(d)a.Bq=d;else if(0<=ut.indexOf(c))a.Bq=new zt(c);else throw Error("Locale ["+c+"] is not supported.");else throw Error("No locale was defined.");}vu.prototype.ma=function(){return this.Bq};vu.prototype.yx=function(){this.Qb===Ys.METRIC?this.ao(Ys.IMPERIAL):this.ao(Ys.METRIC)}; 875vu.prototype.toggleUnitSystem=vu.prototype.yx;vu.prototype.Ys=function(a){var b=this.Je.length,c=this.G;if(0>this.Je.indexOf(a)){a.ea(this);a.Qa(this.v);var d=a.L(this.qj);b=0<b?this.Je[b-1].B().nextSibling:this.G.firstChild;c.insertBefore(d,b);this.Je.push(a)}};vu.prototype.addBubble=vu.prototype.Ys; 876vu.prototype.bn=function(a){var b=a.items;this.Od&&this.Lv();clearTimeout(this.rt);this.rt=globalThis.setTimeout(function(){b.length&&(this.Od=new Ut(b),this.G.insertBefore(this.Od.L(this.qj),this.G.firstChild),this.Od.ea(this),this.Od.Qa(this.v),this.Od.setPosition(a.viewportX,a.viewportY))}.bind(this),0)};vu.prototype.Lv=function(){this.Od&&(this.Od.l(),this.Od=null)};vu.prototype.AC=function(a){var b=this.Je.indexOf(a);-1<b&&(a.ea(null),a.Qa(null),this.Je.splice(b,1),this.G.removeChild(a.B()))}; 877vu.prototype.removeBubble=vu.prototype.AC;vu.prototype.zz=function(){return this.Je};vu.prototype.getBubbles=vu.prototype.zz;vu.prototype.Pg=function(a,b){if(this.Gj(a))throw Error("A control with name ["+a+"] is already registered.");b.ea(this);b.Qa(this.v);b.yB=this.Bq;b.L(this.qj);b.onUnitSystemChange(this.Qb);this.Hf[a]=b};vu.prototype.addControl=vu.prototype.Pg; 878vu.prototype.CC=function(a){var b=this.Gj(a);if(b)b.unsubscribe(),b.ea(null),b.Qa(null),Us(b),delete this.Hf[a];else throw Error("Control ["+a+"] not found in this UI's controls.");return b};vu.prototype.removeControl=vu.prototype.CC;vu.prototype.Gj=function(a){return this.Hf[a]};vu.prototype.getControl=vu.prototype.Gj; 879vu.prototype.disposeInternal=function(){for(var a in this.Hf)zs.hasOwnProperty.call(this.Hf,a)&&this.Hf[a].l();this.Je.forEach(function(b){b.l()});(a=this.G.parentNode)&&a.removeChild(this.G);I.prototype.disposeInternal.call(this);delete this.G}; 880function xu(a,b){var c,d;b.unitSystem&&a.ao(b.unitSystem);(d=b.locale)&&wu(a,d);(c=b.zoom)&&a.Pg("zoom",new su(ya(c)?c:null));(c=b.zoomrectangle)&&a.Pg("zoomrectangle",new et(ya(c)?c:null));
880(c=b.mapsettings)&&a.Pg("mapsettings",new Jt(ya(c)?c:null));(c=b.scalebar)&&a.Pg("scalebar",new at(ya(c)?c:null));(c=b.distancemeasurement)&&a.Pg("distancemeasurement",new ju(ya(c)?c:null))} 881vu.prototype.capture=function(a,b,c,d){var e=this.Gj("scalebar"),f=a.getContext("2d"),g=a.width,h=a.height,k=this.v.Yd,l=5+(k?k.B().childNodes[1].offsetHeight:0);e&&e.Wd()?e.capture(b,function(n){f.drawImage(n,g-n.width-5*b,h-n.height-l*b);c(a)},d):c(a)};vu.prototype.capture=vu.prototype.capture; 882vu.createDefault=function(a,b,c){var d=a.Ca.type;c=new vu(a,{unitSystem:Ys.METRIC,zoom:{alignment:"right-bottom"},mapsettings:yu(d,b,a.pa),scalebar:{alignment:"bottom-right"},locale:c||"en-US"});if(d===mi.P2D){var e=c.Gj("mapsettings");var f=function(){if(e.lc()){var l=yu(d,b,a.pa);Kt(e,l.baseLayers,l.layers)}};a.addEventListener(a.j.xl,f);c.bc(function(){a.removeEventListener(a.j.xl,f)});e.bc(function(){a.removeEventListener(a.j.xl,f)})}if(d===mi.HARP){if(window.H.service){var g=b.vector.traffic.map.D.$.i(), 883h=new window.H.service.Url(g.oi,g.Qj.split(".").slice(-2).join("."));h=uu(window.H.service.traffic.Service7,{platformBaseUrl:h});var k=h.i().getQuery();k.apikey=g.getQuery().apikey;h.i().Tk(k);new At(c,h)}}else new At(c);return c};vu.prototype.eD=function(){};vu.prototype.setTrafficIncidentsHandle=vu.prototype.eD;function zu(a,b,c,d){for(var e=a,f=0;e&&f<b.length;f++)e=e[b[f]];if(e&&e!==a)return a={label:c,layer:e},d.push(a),a} 884function yu(a,b,c){var d=[],e=[],f=b.raster;if(a===mi.P2D&&f){zu(b,["raster","normal","map"],"layers.normal",d);zu(b,["raster","satellite","map"],"layers.satellite",d);zu(b,["raster","terrain","map"],"layers.terrain",d);if(c)for(var g in f)if(f[g]&&f[g].map===c){var h=g;break}zu(b,["raster","normal","trafficincidents"],"layer.incidents",e);zu(b,["raster",h,"transit"],"layer.transit",e)}else zu(b,["vector","normal","map"],"layers.normal",d),a===mi.WEBGL?(zu(b,["raster","satellite","map"],"layers.satellite", 885d),zu(b,["vector","normal","traffic"],"layer.traffic",e),zu(b,["vector","normal","trafficincidents"],"layer.incidents",e)):(c=zu(b,["hybrid","day","vector"],"",[]),f=zu(b,["hybrid","day","raster"],"layers.satellite",d),f.layer=[f.layer,c.layer],window.H.service&&(c=b.vector.traffic.map.D.$.i(),b=uu(window.H.service.trafficVectorTile.Service,{baseUrl:c,layer:"flow"}),c=uu(window.H.service.trafficVectorTile.Service,{baseUrl:c,layer:"incident"}),h=kn()+"/harp/oslo/normal.day.json",f=new H.map.render.harp.Style(h), 886h=new H.map.render.harp.Style(h),b=b.createLayer(f,{engineType:a}),a=c.createLayer(h,{engineType:a}),e.push({label:"layer.traffic",layer:b},{label:"layer.incidents",layer:a})));return{alignment:"bottom-right",baseLayers:d,layers:e}};t("H.ui.buildInfo",function(){return Wh("H-ui","1.61.0","3b08619",{region:"row"})}); 887 888function Au(a,b){if(!a)throw new C(Au,0,a);Au.g.constructor.call(this,a);this.gw={};this.tj=!(!b||!b.Qd);this.Rj=Bu++}u(Au,rj);var Bu=0; 889Au.prototype.L=function(a,b,c,d,e,f){var g=Gb(d),h=this.yb,k=g+(c.exp-h.pixelProjection.exp),l=h.min,n=h.max;d=h.tileSize;var p=h.D.Sc,q=this.Pb,r=q.Ve();var v=q.mc().w;var w=c.w,y=c.x,F=c.y,G={};if(g<l||g>n)return fh.DONE;e=h.requestTiles(a,k,e,f,this.Rj);a=e.total;e=e.tiles;f=e.length;this.me=c;this.WC=b;this.ws=k;r!==p&&q.Fd(p);c=d=d*w/(Mb(2,k)*d);this.tj||(d%1&&(d=Hb(d),w=c/d,y/=w,F/=w,w=Mb(2,k)*d),y=Hb(y),F=Hb(F));this.IC=c;k=-d;g=v+d;for(h=0;h<f;h++){v=e[h];if((l=v.data)&&l.tagName){c=b.x-(y- 890v.x*d);p=b.y-(F-v.y*d);q.Re(l,c,p,d,d);for(r=c;(r-=w)>k;)q.Re(l,r,p,d,d);for(r=c;(r+=w)<g;)q.Re(l,r,p,d,d)}G[this.ws+"_"+v.x+"_"+v.y]=v}this.gw=G;return f===a?fh.DONE:fh.PENDING};Au.prototype.Ma=function(a,b,c){var d=this.IC,e=d/this.yb.tileSize,f=this.me,g=this.WC,h;if(fb(this.ws)&&f){a=f.x+(a-g.x);b=f.y+(b-g.y);var k=Hb(f.w/d);var l=f=Hb(a/d);g=Hb(b/d);Jb(l)>=k&&(l%=k);0>l&&(l=k+l);(k=this.gw[this.ws+"_"+l+"_"+g])&&k.Ma&&(h=k.Ma((a-d*f)/e,(b-d*g)/e,c))}return h||Ze};Au.prototype.Eh=function(){return"2d"};function Cu(a,b){this.Wm=[];Cu.g.constructor.apply(this,arguments)}u(Cu,sj);m=Cu.prototype;m.Xt=function(){return this.yb.qe.apply(this.yb,arguments)};m.L=function(a,b,c,d,e,f,g){this.Wm=[];return Cu.g.L.apply(this,arguments)};m.oa=1;m.Fw=function(a,b,c,d,e,f){var g=this.oa=d.lb();e*=g;f*=g;var h=c.mc();b=h.w*g;h=h.h*g;var k=c.Db;this.Qd?(e-=k.x*g,f-=k.y*g):(e=Gb(e-k.x*g),f=Gb(f-k.y*g));d.Re(c.Te(),e,f,b,h);a.detail?a.detail.set(e,f,e+b,f+h):a.detail=new lh(e,f,e+b,f+h);this.Wm.push(a)}; 891m.Ma=function(a,b,c){for(var d=this.Wm,e=d.length,f,g,h,k=Ze,l=this.oa;e--&&!(f=d[e],g=f.detail,g.Ql(a,b)&&(f=f.vv,(!(h=f.kc().Am)||h.Bm((a-g.left)/l,(b-g.top)/l,0))&&0>
891k.indexOf(f)&&(k===Ze&&(k=[]),k.push(f),c))););return k};m.Eh=function(){return"2d"};m.disposeInternal=function(){this.Wm=[];Cu.g.disposeInternal.call(this)};Cu.prototype.disposeInternal=Cu.prototype.disposeInternal;function Du(a,b){b=b||{};B(a,tl,Du,0);Du.g.constructor.call(this,a);this.Qd=!!b.Qd;this.tC=b.Ab||0;this.tn=[];this.Yv={}}u(Du,rj); 892Du.prototype.L=function(a,b,c,d,e,f){var g,h=this.yb,k;d-=this.tC;this.tn.length=0;var l=this.Yv;this.Yv=g={};if(d>=h.min&&d<=h.max){var n=h.xg(a,d,e,f);var p=n.overlays;if(a=p.length)for(p.sort(Bh),d=this.Pb,e=this.Qd,f=0;f<a;f++){h=p[f];var q=h.C();var r=c.Gb(q.Oc());var v=c.Gb(q.Mc());q=c.w;r.x>=v.x&&(r.x-=q);q*=-((r.x+v.x)/q>>1);r.x+=q;r.add(b);v.x+=q;v.add(b);e||(r.round(),v.round());(q=l[k=h.xb()])?delete l[k]:q={pC:h};g[k]=q;var w=r.x;r=r.y;var y=v.x;v=v.y;var F=y-w;var G=v-r;d.Fd(h.Ve()); 893d.Re(h.Te(),w,r,F,G);q.details?q.details.set(w,r,y,v):q.details=new lh(w,r,y,v);this.tn.push(q)}}return!n||n.requested&&n.requested===n.total||!n.requested&&p.length===n.total?fh.DONE:fh.PENDING};Du.prototype.Ma=function(a,b,c){for(var d=this.tn,e=d.length,f,g,h;e--;)if(f=d[e],g=f.details,g.Ql(a,b))if(f=f.pC,h)h.push(f);else if(h=[f],c)break;return h||Ze};Du.prototype.Eh=function(){return"2d"};Du.prototype.disposeInternal=function(){delete this.tn;Du.g.disposeInternal.call(this)}; 894Du.prototype.disposeInternal=Du.prototype.disposeInternal;var Eu={lookAt:{zoom:{min:-8,max:24},tilt:{min:0,max:0},incline:{min:0,max:0},heading:{min:180,max:180}},interaction:{ZOOM:Yj.ZOOM,COORD:Yj.COORD},capture:!0};t("H.map.render.p2d.capabilities",Eu);function Z(a,b,c,d){Z.g.constructor.call(this,a,b,c,d);this.Xb=new K(0,0);if(c=d.renderBaseBackground)this.Ew=c.lower,this.Dw=c.higher;this.tj=!!d.enableSubpixelRendering;this.Kg=Fu;this.kv=0;this.xs=this.cv=!1;this.na=new Il;this.T=d=new tk;this.gg=z(this.gg,this);d.addEventListener(d.j.wo,this.gg);this.La=z(this.La,this);d=a.element;this.rc=a=d.ownerDocument.createElement("div");a.style.position="absolute";a.style.width=a.style.height="100%";a.style.zIndex=0;d.insertBefore(a,d.firstChild);this.cl= 895new Dk(this.rc,this.ja);this.Ge=[];this.gq();this.wg=z(Z.prototype.wg,this);this.s=Gu;this.Qn();this.zoom=Hu(this,this.Ee.Ub()+this.Ab);this.Ac();Iu(this,b.Ib().position,this.zoom);this.rb();this.ng()}u(Z,Vj);t("H.map.render.p2d.RenderEngine",Z);Z.prototype.type=ek.P2D;var Gu=2;Z.prototype.getState=function(){return this.s};Z.prototype.getState=Z.prototype.getState;Z.prototype.Ej=function(a,b){a=b-a;return Jb(a)<this.pixelProjection.w/2?a:a-this.pixelProjection.w*b/Jb(b)}; 896Z.prototype.ar=function(a){var b=this,c=a.animate,d=a.newValue,e=a.modifiers;a=d.position;var f=d.bounds,g,h=this.zoom,k=this.yd,l=0;e&Oi.POSITION&&(g=b.pixelProjection.Gb(a));if(e&Oi.BOUNDS)d=Ju(this,f.C(),e&Oi.ZOOM?d.zoom:A,e&Oi.POSITION?a:A),this.Ee.ad(d,c);else{e&Oi.POSITION||(g=b.pixelProjection.Gb(d.position));var n=g.x;var p=g.y;this.Jg();this.Xb.set(0,0);d=this.Do(d);var q=d.zoom;var r=d.position;if(c){var v=q-h;var w={x:k.x,y:k.y};c=this.pixelProjection.bi(w).x;var y=this.pixelProjection.projection.Se(a); 897if(y.x!==this.yd.x||y.y!==this.yd.y||q!==this.zoom)n=this.Ej(c,n),this.cd(function(F){var G=F-l;if(q!==h){g=b.pixelProjection.bi(y);var O=b.pixelProjection.bi(w);n=b.Ej(O.x,g.x);p=g.y-O.y}l=F;b.Sg(n*G,p*G);h+=v*G;b.sb(h);b.rb();b.ba()},this.vl,function(){Iu(b,r,q);b.sb(q);b.rb(r);b.ba()},this.wl)}else this.dd(),Iu(this,r,q),this.sb(q),this.rb(r);this.ba()}};Z.prototype.vl=300;Z.prototype.Wn=function(a){var b=ob(a);if(!b||b&&0>a)throw new C(this.Wn,1,"positive number required");this.vl=a}; 898Z.prototype.setAnimationDuration=Z.prototype.Wn;Z.prototype.zp=function(){return this.vl};Z.prototype.getAnimationDuration=Z.prototype.zp;Z.prototype.wl=jj;Z.prototype.Xn=function(a){if(!db(a))throw new C(this.Xn,1,"function required");this.wl=a};Z.prototype.setAnimationEase=Z.prototype.Xn;Z.prototype.Ap=function(){return this.wl};Z.prototype.getAnimationEase=Z.prototype.Ap;Z.prototype.Qn=function(){this.wl=jj;this.vl=300};Z.prototype.resetAnimationDefaults=Z.prototype.Qn;m=Z.prototype; 899m.Uq=function(a,b,c){var d;this.$j=rk();(d=this.Zh.ka.splice(a,1)[0])&&d.l&&d.l();(d=this.Mf.ka.splice(a,1)[0])&&d.l&&d.l();(d=this.ri.ka.splice(a,1)[0])&&d.l&&d.l();(d=this.pi.ka.splice(a,1)[0])&&d.l&&d.l();this.bf=this.ib.Ta();0===a&&(Zj(this,b,!1),this.Ac());this.Ge=Ek(this.cl,this.Tf(),this.Qf());this.li();c||this.ba()}; 900m.gq=function(){var a=this.ib.Ta(),b=0,c=a.length;[this.Zh={},this.Mf={},this.ri={},this.pi={}
900].forEach(function(d){d.Qe=[];d.ka=[]});for(this.bf=this.ib.Ta();b<c;b++)this.pk(b,a[b]);this.Ac()};m.Vq=function(){this.Ac();this.ba()}; 901m.hq=function(a,b,c){var d,e,f,g;if(b){var h={Qd:this.tj,Ab:this.Ab};b.L?B(b,zi)?e=new ik(b):B(b,xi)&&(g=new ik(b)):(b.requestOverlays&&(d=new Du(b,h)),b.requestTiles&&(e=new Au(b,h)),b.requestMarkers&&(f=new Cu(b,h)),b.requestDomMarkers&&(g=new vj(b,h)))}c=c||0;this.Zh.ka.splice(a,c,d);this.Mf.ka.splice(a,c,e);this.ri.ka.splice(a,c,f);this.pi.ka.splice(a,c,g);this.bf=this.ib.Ta();this.Ge=Ek(this.cl,this.Tf(),this.Qf())}; 902m.Qf=function(){var a=[];a=a.concat(this.Mf.ka);a=a.concat(this.Zh.ka);a=a.concat(this.ri.ka);a=a.concat(this.pi.ka);return a=a.filter(fb)};m.Po=function(){return this.s===Gu};m.Do=function(a){var b=ak(this,ak(this,a.zoom)+this.Ab);a=bk(this,a);a.zoom=b;return a};function Iu(a,b,c){var d=a.pixelProjection;d.Va(c);a.yd=d.projection.Se(b);d.x=d.w*a.yd.x;d.y=d.h*a.yd.y}m.Wa=function(a,b){var c=this.za.center,d=this.ja;return this.pixelProjection.Za((a-c.x)*d,(b-c.y)*d)};Z.prototype.screenToGeo=Z.prototype.Wa; 903Z.prototype.Un=function(a,b){a=this.Wa(a,b);b=this.Ee.Ib();b.position=a;return b};Z.prototype.La=function(a){var b=this.ja,c=this.za.center,d=c.x*b;c=c.y*b;a=this.pixelProjection.Gb(a);var e=this.pixelProjection.w;return new K(Gb((a.x-Gb(a.x/e)*e+d)/b),Gb((a.y+c)/b))};Z.prototype.geoToScreen=Z.prototype.La;Z.prototype.C=function(a,b){var c=this.rl[a||4];a=this.pixelProjection;var d=c.left-b,e=a.Za(d,c.top-b),f=c.right+b;b=a.Za(f,c.bottom+b);f-d>=a.w&&(e.lng=-(b.lng=180));return Wc(e,b)}; 904Z.prototype.Ma=function(a,b,c,d){var e=[],f=this.ja,g;a*=f;b*=f;f=[this.Zh,this.Mf,this.ri,this.pi];for(g=f.length;g--&&(!c||!e.length);)e=this.Mp(e,f[g].ka,a,b,c);d(e)};Z.prototype.getObjectsAt=Z.prototype.Ma;m=Z.prototype;m.Mp=function(a,b,c,d,e){for(var f=b.length,g;f--&&!((g=b[f])&&g.Ma&&(a=a.concat(g.Ma(c,d,e)),a.length&&e)););return a};m.ye=x;m.Tf=function(){var a=this.rl[2];return{w:a.right-a.left,h:a.bottom-a.top}}; 905m.ng=function(){var a=this.Ge.length,b;Z.g.ng.call(this);var c=this.Tf();this.Xb.set(0,0);var d=c.w;for(b=c.h;a--;){c=this.Ge[a];var e=c.mc();e.w===d&&e.h===b||c.Uk(d,b)}this.ye=new Xh(d,b);this.ba()};m.getCapabilities=function(){return Eu};Z.prototype.getCapabilities=Z.prototype.getCapabilities;m=Z.prototype;m.Lk=function(){this.ta&&this.ta.R||rk()-this.$j<this.Kg&&!this.oe?this.rh=pk(this.wg):(this.oe&&(this.li(),this.pj()),this.s=Gu)}; 906m.li=function(){this.Zh.Qe.length=0;this.Mf.Qe.length=0;this.ri.Qe.length=0;this.pi.Qe.length=0}; 907m.wg=function(){var a;this.ff&&this.ff.before();var b=this.Mf.ka;var c=this.za.center.clone().scale(this.ja).round();var d=this.C(1,0);var e=this.C(1,Ku);var f=this.zoom;var g=f-this.Ab;var h=this.pixelProjection;var k=this.Ew;var l=this.Dw;var n=b[0];b=this.Xb;var p=this.Ge.length;var q=this.bf;for(a=q.length;p--;){var r=this.Ge[p];B(r,hk)&&r.clear()}if(n){if(k)for(;k;)p=f-k,n.L(d,c,h,p,!0,b),--k;if(l&&this.xs)for(r=1;r<=l&&(p=f+r,h.Va(p),k=this.C(2,0),h.Va(f),!n.L(k,c,h,p,!0,b));r++);}for(this.Kg= 908Fu;a--;)h=q[a],B(h,vi)&&h.D&&h.D.xk(e,g);d=this.Ln(d,c,f,!1,b,Lu,this.Mf,this.Zh);c=this.Ln(e,c,g,!1,b,Mu,this.ri,this.pi);this.oe=d&&c;this.ta&&this.ta.R&&this.Fo();this.vf||(this.vf=this.Ee.Ib());this.vf.bounds=this.C(4,0);this.Ee.rb(this.vf);this.vf=null;this.ye&&(this.za.rb(this.ye),this.ye=x);f<this.kv?this.xs=!0:this.cv&&(this.xs=!1);this.kv=f;this.cv=d;this.ff&&this.ff.after();this.Lk()}; 909m.Ln=function(a,b,c,d,e,f,g){var h=Array.prototype.slice.call(arguments,6),k=h.length,l=h[0].ka.length,n=k*l,p=!!n,q;for(q=0;q<n;q++){if(f===Lu){var r=q%k;var v=Math.floor(q/k)}else r=Math.floor(q/l),v=q%l;var w=h[r].ka[v];r=h[r].Qe;w&&(w=w.L(a,b,this.pixelProjection,c,d,e,this.La),w===fh.ACTIVE&&(this.Kg=Infinity),w!==fh.DONE||r[v]||(this.pj(this.bf[v]),r[v]=!0),r[v]||(p=!1))}return p};m.pj=function(a){this.dispatchEvent({type:this.j.Us,target:a||this})}; 910m.disposeInternal=function(){var a=this.ib.Ta()[0],b=this.za;qk(this.rh);this.dd(!0);a&&Zj(this,a,!1);this.Qf().forEach(function(c){c.l()});b.element&&b.element.removeChild(this.rc);this.rc=null;this.s=3;
910Z.g.disposeInternal.call(this)};m.ba=function(){this.$j=rk();this.Po()&&(this.oe=!1,this.s=1,this.Lk())};m.Bc=function(a,b){this.Sg(a*this.ja,b*this.ja);this.Xb.set(0,0);this.rb();this.ba()}; 911m.Sg=function(a,b){var c=this.pixelProjection,d=this.yd;c.x=ec(c.x+a,c.w);c.y=Fb(0,Eb(c.w,c.y+b));d.x=c.x/c.w;d.y=c.y/c.h};m.Ng=function(a,b,c){a=ak(this,ak(this,a)+this.Ab);this.sb(a,b,c)};Z.prototype.zoomAt=Z.prototype.Ng;Z.prototype.sb=function(a,b,c){var d=this.ja,e=this.za.center;b===+b&&c===+c?(b=(b-e.x)*d,c=(c-e.y)*d,this.Xb.set(b,c),this.Sg(b,c),this.pixelProjection.Va(a),this.Sg(-b,-c)):(this.Xb.set(0,0),this.pixelProjection.Va(a));this.zoom=a;this.rb();this.ba()}; 912function Ju(a,b,c,d){var e=a.getCapabilities().lookAt.zoom.max,f=b.wb(),g=d||f;if(b.Im()||c&&d)c=c===A?e:c;else{var h=new si(a.pixelProjection.projection);h.Va(e);var k=h.Gb(b.Oc()).round();var l=h.Gb(b.Mc()).round();e=h.w;b.qc()&&(k.x-=e);d?(f=h.Gb(g),b=2*Fb(f.x-k.x,l.x-f.x),k=2*Fb(f.y-k.y,l.y-f.y)):(b=l.x-k.x,k=l.y-k.y,g=f);c===A&&(f=a.rl[4],c=f.right-f.left,f=f.bottom-f.top,c=-8+Eb(Kb(c/b*e)/Ub,Kb(f/k*e)/Ub)-a.Ab,c=ak(a,c))}return{zoom:Hb(c),position:g}} 913Z.prototype.Jg=function(){this.dd(!0);this.T.R&&this.hc(!0);this.na.R&&this.ic(!0);this.dd(!0)};Z.prototype.Jd=function(a,b){this.Jg();this.Rk(b);this.na.start(a,!!b)};Z.prototype.startInteraction=Z.prototype.Jd;Z.prototype.Rk=function(a){if(a){var b={};b.wk=a.power;b.sj=a.ease;b.duration=a.duration;this.ua=b}};function Hu(a,b){return ak(a,ak(a,b-a.Ab)+a.Ab)} 914Z.prototype.wd=function(a,b,c,d,e){var f=!1;this.na.R&&(b=this.na.store(a,b,c,d,e),this.na.ae(Yj.COORD)&&(a=this.na.Ah(),0<Hl(a)&&(this.Bc(-a.x,-a.y),f=!0)),b&&this.na.ae(Yj.ZOOM)&&(a=this.na.im(),b=this.na.jm(),b=Kb(Mb(2,this.zoom)*b)/Ub,b!==this.zoom&&(b=Hu(this,b),this.sb(b,a.x,a.y),f=!0)),f&&this.ba())};Z.prototype.interaction=Z.prototype.wd; 915Z.prototype.ic=function(a){var b=this;if(this.na.R&&!a){if(this.ua){a=this.na.nc();var c=this.na.Nf();var d=this.ua.duration;var e=(this.ua.wk||1)*a;var f=new gk(-e/(0<d?d:1),e);!D(c.x)&&!D(c.y)&&0<e&&b.na.ae(Yj.COORD)&&this.cd(function(g){e=f.Hj(g*d);D(e)||b.Bc(Gb(-c.x*e),Gb(-c.y*e))},d,void 0,this.ua.sj)}this.ua=null;this.na.clear()}};Z.prototype.endInteraction=Z.prototype.ic;Z.prototype.Id=function(a,b,c){this.Jg();this.T.start(b,c);this.Rk(a)};Z.prototype.startControl=Z.prototype.Id; 916Z.prototype.control=function(a,b,c){if(D(+c))throw new C(this.control,2,c);if(D(a))throw new C(this.control,0,a);if(D(b))throw new C(this.control,1,b);this.T.R&&this.T.set(a,b,c,0,0,0)};Z.prototype.control=Z.prototype.control; 917Z.prototype.hc=function(a,b){var c=this,d;if(this.T.R){this.dd(!0);var e=rk();var f=e-this.jj;if(1<=f){var g=wk(this.T);this.Qi(g,f)}if(!this.ua||a||b)"function"===typeof b&&(a=this.Ib(),a.zoom=this.zoom-this.Ab,b(a),a.zoom+=this.Ab,this.Go(a));else{b=this.T.nc();var h=this.T.Nf();var k=this.ua.duration;var l=(this.ua.wk||1)*b;var n=new gk(-l/(0<k?k:1),l);!D(h.Lb)&&!D(h.Mb)&&0<l&&this.cd(function(p,q,r,v){e&&(r=v-e,e=0);l=n.Hj(p*k)*r;D(l)||((d=h.Nb*l)&&c.sb(Hu(c,c.zoom+d),c.T.Ug,c.T.Vg),c.Bc(Gb(h.Lb* 918l),Gb(h.Mb*l)))},k,void 0,this.ua.sj)}this.T.reset()}};Z.prototype.endControl=Z.prototype.hc;m=Z.prototype; 919m.Go=function(a){var b=this,c=this.yd,d=this.pixelProjection.projection.Se(a.position),e=this.pixelProjection.bi(d),f=e.y;e=e.x;var g=a.zoom;c=this.pixelProjection.bi(c);a=c.y;var h=c.x;c=this.zoom;var k=this.T.nc(),l=this.T.Ug,n=this.T.Vg,p=0;e=this.Ej(h,e);e-=h;f-=a;c=g-c;a=Lb(e*e+f*f+c*c);if(0!==k&&0!==a){var q=e/a;var r=f/a;var v=c/a;var w=k*k/(2*a);this.cd(function(y,F){var G;if(1!==y){y=k*F-w*F*F/2;F=y-p;if(G=v*F)G=Hu(b,b.zoom+G),b.sb(Hu(b,G),l,n);b.Bc(Gb(q*F),Gb(r*F));p=y}else b.yd=d,b.sb(Hu(b, 920g),l,n),b.rb(),b.ba()},2*a/k)}};m.gg=function(a){var b=this,c=a.mt;this.Xb.set(0,0);c.Lb||c.Mb||c.Nb?(this.jj=rk(),this.cd(function(d,e,f,g){b.jj=g;b.Qi(c,f)},Number.POSITIVE_INFINITY),this.ba()):this.dd(!0)};m.Qi=function(a,b){b=b||0;a.Nb&&this.sb(Hu(this,this.zoom+a.Nb*b),this.T.atX,this.T.atY);this.Bc(a.Lb*b,a.Mb*b)};m.cd=function(a,b,c,d){this.ta&&this.ta.R&&this.ta.stop(!0);this.ta=new sk(this,a,b,c,d);this.ta.start()};m.dd=function(a){this.ta&&this.ta.R&&this.ta.stop(a)};m.kp=function(){}; 921Z.prototype.enter=Z.prototype.kp;Z.prototype.pp=function(a){Xj(this.rc,a)};Z.prototype.exit=Z.prototype.pp;Z.prototype.capture=function(a,b,c,d){var e=this.rc.ownerDocument.createElement("canvas"),f=e.getContext("2d"),g=this.ja;e.width=(c-a)*g;e.height=(d-b)*g;for(c=0;c<this.Ge.length;c++)d=this.Ge[c],B(d,hk)&&f.drawImage(d.B(),-a*g,-b*g);return me(e)};var Mu=0,Lu=1,Fu=1E3,Ku=256; 922 923function Nu(a){var b;if(a)for(Ou={},b=a.length;b--;)Ou[a[b]]=!0;this.jx={}}var Pu,Ou={};Nu.prototype.parse=function(a,b,c){var d,e,f,g,h;Pu=!1;try{c=JSON.parse(c)}catch(n){Pu=!0}if(c&&(d=c.metadata)){var k={spatials:[]};for(e in d){if(c=!Ou[e]&&(f=Qu[e]))(g=d[e])||(Pu=!0,g=void 0),c=g;if(c)for(c=g.length;c--;){var l;(l=g[c])||(Pu=!0,l=void 0);(h=l)&&f(b,a,this,e,h,k)}}}else Pu=!0;return Pu?void 0:k};Nu.prototype.parse=Nu.prototype.parse; 924var Qu={"street labels":function(a,b,c,d,e,f){var g;(g=e.vertices)||(Pu=!0,g=void 0);if(g){var h,k=g.length,l;(l=0<k)||(Pu=!0,l=void 0);if(l)for(h=Array(k/2);k;){var n=g[--k];l=g[--k];h[k/2]=new K(l,n)}h=h?{Tc:[h]}:A;k=+e["font size"]/a.lb();g=c.jx[k];g||(Ru.lineWidth=k,g=c.jx[k]=c.gh.fu(Ru));Su(a,b,h,!1,g,e,d,f)}delete e.vertices},"city center labels":function(a,b,c,d,e,f){Su(a,b,Tu(e,new ih([])),!0,c.gh,e,d,f)},labels:function(a,b,c,d,e,f){var g;(g=e["bounding boxes"])||(Pu=!0,g=void 0);if(g){for(var h= 925g.length,k=new ih([]),l;h--;){var n;(n=g[h])||(Pu=!0,n=void 0);(l=n)&&Tu(l,k)}Su(a,b,k,!0,c.gh,e,d,f)}delete e["bounding boxes"]},buildings:function(a,b,c,d,e,f){var g=e.id,h=b.Jn[g],k,l,n,p=[],q=[];(k=e)||(Pu=!0,k=void 0);if(k&&((l=k.vertices)||(Pu=!0,l=void 0),l)){var r;(r=k.polygons)||(Pu=!0,r=void 0);
925(n=r)&&p.push.apply(p,Uu(l,n));(k=k.outlines)||(Pu=!0,k=void 0);(n=k)&&q.push.apply(q,Uu(l,n))}n=p.length;p.push.apply(p,q);q=new ih(p,bc,n);(p=p.length)||(Pu=!0,p=void 0);p&&(h?(Dp(h,a,[q]),f.spatials.push(h)): 926(h=Su(a,b,q,!0,c.gh,e,d,f,g),b.Y(h)))}};Qu["transit stops"]=Qu.POIs=Qu.labels;var Vu=["box 2","box 1","annotation box","icon box"];function Tu(a,b){for(var c=Vu.length,d,e;c--;)if(d=Vu[c],e=a[d]){var f=e[0],g=e[1],h=e[2];e=e[3];b.Tc.push([new K(f,g),new K(f+h,g),new K(f+h,g+e),new K(f,g+e)]);delete a[d]}return b} 927function Uu(a,b){var c=b.length,d,e,f;if(0<c)for(e=Array(c);c--;)if((d=b[c])||(Pu=!0,d=void 0),d){var g=d.length;if(0<g)for(e[c]=f=Array(g);g--;){var h=2*d[g];f[g]=new K(a[h],a[h+1])}}return e||[]}var Wu={};function Su(a,b,c,d,e,f,g,h,k){Wu.style=e;d=new yp(b,d,k,Wu);c&&Dp(d,a,[c]);Xu(f);f.category=g;d.setData(f);h.spatials.push(d);d.ea(b);return d}Nu.prototype.gh=new M({strokeColor:"transparent",fillColor:"transparent",lineWidth:0});var Ru={}; 928function Xu(a){var b,c=!1;switch(typeof a){case "object":if(a instanceof Array)for(b=a.length;b--;)Xu(a[b])?c=!0:delete a[b];else if(a)for(b in a)Xu(a[b])?c=!0:delete a[b];break;case "number":c=!0;break;default:c=!!a}return c};function Yu(a,b,c){c=c||{};b=b||{};var d=c.tileType||"maptile",e=c.scheme||"normal.day";R.call(this,{min:0,max:20});!0===b.pois&&(b.pois="!F");this.Ga=b;if(!(a&&a instanceof Zu))throw Error("InvalidArgument: service required");this.$=a;this.Ce=z(this.Ce,this);this.$.addEventListener("versionupdate",this.Ce);this.md=a.i().clone().A(d+"/"+a.fb+"/"+e).u($u).u(b);this.bd=a.bd||null;this.oa=c.pixelRatio||c.pixelratio||Ke();this.tileSize=c.tileSize||256;this.tileType=d;this.scheme=e;this.vs=0;this.Bd=new Jp(new Nu(c.categoryFilter)); 929this.Bd.ea(this);this.he=z(this.he,this);this.Bd.addEventListener("update",this.he);this.Ye=!1;R.call(this,{min:0,max:20});this.Yn(new kk(c.tileCacheSize||256,z(this.ke,this)))}u(Yu,R);t("H.service.metaInfo.TileProvider",Yu);Yu.prototype.ke=function(a,b){a=b.bb();for(var c=a.length,d;c--;)d=a[c],delete d.Fk[b.key],d.release();b.data&&(lo.push(b.Hn(),this.tileSize),b.In())};Yu.prototype.he=function(){this.dispatchEvent("update")}; 930Yu.prototype.o=function(a,b,c,d,e){var f=this.md.clone(),g=this.bd,h=this.tileSize,k=this.getTileKey(a,b,c);k=this.Sb().get(k);var l;if(k&&!k.Ih()){d(lo.pop(this.tileSize),null);var n={cancel:function(){}}}else{g&&f.la(g[(c+b+a)%g.length]);f.A(c+"/"+a+"/"+b+"/"+h+"/png8");var p=globalThis.setTimeout(function(){l=new qg("text/plain",f.toString());l.then(function(q){d(null,q)},e)},500)}this.Ye||(io(Yu,"Use HERE Vector Tile API or Raster Tile API v3 instead."),this.Ye=!0);return n||{cancel:function(){l? 931l.cancel():globalThis.clearTimeout(p)}}};Yu.prototype.requestInternal=Yu.prototype.o;Yu.prototype.pd=function(a,b,c,d,e){var f=this.Bd;var g=d||lo.pop(this.tileSize);if(d)a=this.Sb().get(this.getTileKey(a,b,c)),a.L(d);else if(d=a=new Yk(this.Vd(a,b,c),a,b,c,this.tileSize,this.oa,c+this.vs,f),delete d.Ji,d.ul=e,a.L(g))for(e=a.bb(),g=e.length;g--;)e[g].Sn();else lo.push(g,this.tileSize);return a};Yu.prototype.createTileInternal=Yu.prototype.pd; 932Yu.prototype.l=function(){this.Bd.l();this.$.removeEventListener("versionupdate",this.Ce);R.prototype.l.call(this)};Yu.prototype.dispose=Yu.prototype.l;Yu.prototype.Ce=function(){var a=this.$;this.md=a.i().clone().A(this.tileType+"/"+a.fb+"/"+this.scheme).u($u).u(this.Ga);this.reload(!1)};var $u={metadata:"metaonly",mgen:"2"};function Zu(a){Zu.g.constructor.call(this,Zu,a);a=po(this,a);this.bd=a.shards;(this.Ra=a.ignoreTypes?null:a.type)&&this.i().la(this.Ra);this.fb=a.version;this.pr={};this.ec=new to;"newest"===this.fb&&this.rp()}u(Zu,oo);t("H.service.metaInfo.Service",Zu);Zu.prototype.Da=function(){return{type:"base",version:"newest",subDomain:"maps.ls",path:"maptile/2.1",shards:["1","2","3","4"]}};Zu.CONFIG_KEY="metaInfo";function av(a,b){for(var c={},d=a[b+"s"][b],e=d.length;e--;)c[d[e].id]=d[e];a[b+"s"]=c} 933Zu.prototype.vu=function(){return this.Ra};Zu.prototype.Wp=function(){return this.fb};Zu.prototype.getVersion=Zu.prototype.Wp;Zu.prototype.cs=function(a){this.fb=a};Zu.prototype.U=function(){return this.ec};Zu.prototype.getCopyrights=Zu.prototype.U; 934Zu.prototype.ss=function(a){a=a.response;var b;av(a,"map");av(a,"scheme");av(a,"tiletype");av(a,"format");av(a,"resolution");av(a,"language");if("newest"===this.fb&&"traffic"!==this.Ra)for(b in a.maps)a.maps[b].hash&&a.maps[b].newest&&(this.cs(a.maps[b].hash),this.dispatchEvent("versionupdate"));this.fq=a;this.dispatchEvent("infoupdate")}; 935Zu.prototype.rp=function(){var a=this;var b=this.i().clone().A("info").u({output:"json"});this.bd&&b.la(this.bd[0]);this.o(b,function(c){a.ss(c)},function(c){throw c;})};Zu.prototype.Kj=function(){return this.fq};Zu.prototype.getInfo=Zu.prototype.Kj;Zu.prototype.nj=function(a,b,c,d,e,f){return new Yu(this,d,{tileSize:a,pixelRatio:b,categoryFilter:c,tileType:e,scheme:f})};Zu.prototype.createTileProvider=Zu.prototype.nj;Zu.prototype.Pd=function(a,b,c,d,e,f){return new sl(this.nj(a,b,c,d,e,f))}; 936Zu.prototype.createTileLayer=Zu.prototype.Pd;X.prototype.mu=function(a){return this.Ja(Zu,a)};X.prototype.getMetaInfoService=X.prototype.mu;(function(){var a=X.prototype.createDefaultLayers;X.prototype.createDefaultLayers=function(b,c,d,e,f,g){var h=a.call(this,b,c,d,e,f,g),k={},l=this.mu();"object"===typeof b&&(g=b,b=g.tileSize,c=g.ppi,d=g.lg,e=g.lg2,f=g.style,g=g.pois);b=b||256;var n=320===c?2:1;if(0>[72,250,320,500].indexOf(+c)){if(c!==A)throw new C(this.Xl,1,c);}else k.ppi=+c;d&&(k.lg=d);e&&(k.lg2=e);f&&(k.style=f);g&&(k.pois=g);h.raster.normal.metaInfo=l.Pd(b,n,["buildings"],k);return h}})(); 937 938H.__bootstrap__="/*\n\n Copyright The Closure Library Authors.\n SPDX-License-Identifier: Apache-2.0\n*/\nvar l;function ba(a){a=[\"object\"==typeof globalThis&&globalThis,a,\"object\"==typeof window&&window,\"object\"==typeof self&&self,\"object\"==typeof global&&global];for(var b=0;b<a.length;++b){var c=a[b];if(c&&c.Math==Math)return c}throw Error(\"Cannot find global object\");}var ca=ba(this);function da(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}}\nvar ea=\"function\"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(a==Array.prototype||a==Object.prototype)return a;a[b]=c.value;return a};function fa(a,b){if(b)a:{var c=ca;a=a.split(\".\");for(var d=0;d<a.length-1;d++){var e=a[d];if(!(e in c))break a;c=c[e]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&null!=b&&ea(c,a,{configurable:!0,writable:!0,value:b})}}\nfa(\"Symbol\",function(a){function b(f){if(this instanceof b)throw new TypeError(\"Symbol is not a constructor\");return new c(d+(f||\"\")+\"_\"+e++,f)}function c(f,g){this.fc=f;ea(this,\"description\",{configurable:!0,writable:!0,value:g})}
938if(a)return a;c.prototype.toString=function(){return this.fc};var d=\"jscomp_symbol_\"+(1E9*Math.random()>>>0)+\"_\",e=0;return b});\nfa(\"Symbol.iterator\",function(a){if(a)return a;a=Symbol(\"Symbol.iterator\");for(var b=\"Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array\".split(\" \"),c=0;c<b.length;c++){var d=ca[b[c]];\"function\"===typeof d&&\"function\"!=typeof d.prototype[a]&&ea(d.prototype,a,{configurable:!0,writable:!0,value:function(){return ha(da(this))}})}return a});function ha(a){a={next:a};a[Symbol.iterator]=function(){return this};return a}\nfa(\"globalThis\",function(a){return a||ca});function ka(a,b){a instanceof String&&(a+=\"\");var c=0,d=!1,e={next:function(){if(!d&&c<a.length){var f=c++;return{value:b(f,a[f]),done:!1}}d=!0;return{done:!0,value:void 0}}};e[Symbol.iterator]=function(){return e};return e}fa(\"Array.prototype.keys\",function(a){return a?a:function(){return ka(this,function(b){return b})}});var la;\nif(\"function\"==typeof Object.setPrototypeOf)la=Object.setPrototypeOf;else{var ma;a:{var na={a:!0},oa={};try{oa.__proto__=na;ma=oa.a;break a}catch(a){}ma=!1}la=ma?function(a,b){a.__proto__=b;if(a.__proto__!==b)throw new TypeError(a+\" is not extensible\");return a}:null}var pa=la;fa(\"Object.setPrototypeOf\",function(a){return a||pa});var p=this||self;\nfunction qa(a,b,c,d){a=a.split(\".\");d=d||p;a[0]in d||\"undefined\"==typeof d.execScript||d.execScript(\"var \"+a[0]);for(var e;a.length&&(e=a.shift());)if(a.length||void 0===b)d=d[e]&&d[e]!==Object.prototype[e]?d[e]:d[e]={};else if(!c&&ra(b)&&ra(d[e]))for(var f in b)b.hasOwnProperty(f)&&(d[e][f]=b[f]);else d[e]=b}function sa(){}function ta(a){var b=typeof a;return\"object\"!=b?b:a?Array.isArray(a)?\"array\":b:\"null\"}function ra(a){var b=typeof a;return\"object\"==b&&null!=a||\"function\"==b}\nfunction ua(a){return Object.prototype.hasOwnProperty.call(a,ya)&&a[ya]||(a[ya]=++za)}var ya=\"closure_uid_\"+(1E9*Math.random()>>>0),za=0;function Aa(a,b,c){return a.call.apply(a.bind,arguments)}function Ba(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var e=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(e,d);return a.apply(b,e)}}return function(){return a.apply(b,arguments)}}\nfunction Ca(a,b,c){Ca=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf(\"native code\")?Aa:Ba;return Ca.apply(null,arguments)}function Da(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var d=c.slice();d.push.apply(d,arguments);return a.apply(this,d)}}function r(a,b){qa(a,b,!0,void 0)}\nfunction Fa(a,b){function c(){}c.prototype=b.prototype;a.Z=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.Cd=function(d,e,f){for(var g=Array(arguments.length-2),h=2;h<arguments.length;h++)g[h-2]=arguments[h];return b.prototype[e].apply(d,g)}};function Ga(){var a=Ha,b;for(b in a)return!1;return!0}function Ia(a){var b={},c;for(c in a)b[c]=a[c];return b}var Ja=\"constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf\".split(\" \");function Ka(a,b){for(var c,d,e=1;e<arguments.length;e++){d=arguments[e];for(c in d)a[c]=d[c];for(var f=0;f<Ja.length;f++)c=Ja[f],Object.prototype.hasOwnProperty.call(d,c)&&(a[c]=d[c])}};function La(a){if(Error.captureStackTrace)Error.captureStackTrace(this,La);else{var b=Error().stack;b&&(this.stack=b)}a&&(this.message=String(a))}Fa(La,Error);La.prototype.name=\"CustomError\";var Ma=Array.prototype.indexOf?function(a,b){return Array.prototype.indexOf.call(a,b,void 0)}:function(a,b){if(\"string\"===typeof a)return\"string\"!==typeof b||1!=b.length?-1:a.indexOf(b,0);for(var c=0;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1};var Na=Ca,Oa=String,Pa=globalThis.Object.freeze||function(a){return a},t=[].pop(),Qa=/x/.exec(\"\");function Ra(a){return Oa(a).split(\",\"!==t?\",\":\" \")}var Sa=\"prototype constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf\".split(\" \");function Ta(a,b,c,d){if(!(b=a instanceof b)&&c)throw new x(c,d,void 0!==t?void 0:a);return b}function Ua(a){return\"function\"==ta(a)}function Va(a,b,c,d){var e;if(!(e=\"Array\"===Wa(a))&&b)throw new x(b,c,d!==t?d:a);return e}\nr(\"H.lang.isArray\",function(a,b,c,d){return Va(a,b,c,d)});
938function Xa(a){return\"string\"===typeof a}r(\"H.lang.isString\",Xa);var Ya=isNaN;function $a(a){return a===+a}r(\"H.lang.isNumber\",$a);r(\"H.lang.isInteger\",Number.isInteger?Number.isInteger:function(a){return\"number\"===typeof a&&0===a%1});function Wa(a){var b=Object[Sa[0]][Sa[6]].call(a).match(/^\\[object (\\w+)\\]$/);return b?b[1]:typeof a}var ab=[];0>ab.indexOf(ab)&&ab.push(ab);\nfunction bb(a,b,c,d){var e=\"\",f=2>arguments.length,g;f&&(b={H:globalThis.H},c=\"\",d=ab.slice());cb(b,!0,function(h,k){try{if(g=h[k],k=db(h,g),!(ra(g)&&g.window===g&&g.self===g||ra(g)&&0<g.nodeType&&Ua(g.cloneNode))&&ra(g)){if(g===a)return e=c+\".\"+k,!0;if(0>d.indexOf(g)&&(d.push(g),e=bb(a,g,c+\".\"+k,d)))return!0}}catch(m){}});f&&(e=e?e.substr(1).replace(\".\"+Sa[0]+\".\",\"#\"):\"~\"+(Ua(a)?eb(a)+\"()\":Wa(a)));return e}\nfunction db(a,b){var c=[];cb(a,!1,function(d,e){d[e]===b&&c.push(e)});return c.sort(fb)[0]}function fb(a,b){return b.length-a.length}var gb=Object[Sa[0]][Sa[2]];function cb(a,b,c){var d;if(a){for(e in a)if((!b||gb.call(a,e))&&c(a,e,!0))return;for(d=Sa.length;d--;){var e=Sa[d];if((!b||gb.call(a,e))&&c(a,e,!1))break}}}function eb(a){return(a=/^\\s*function ([^\\( ]+)/.exec(a))?a[1]:\"anonymous\"}function hb(a,b,c){c[b]=\"#\"+b}\nfunction x(a,b,c){var d=arguments.length;b=b!==t?+b:b;if(b!==t){var e=(e=/^.*?\\(([^\\)]+)/.exec((\"\"+a).replace(/(\\/\\*([\\s\\S]*?)\\*\\/)|(\\/\\/(.*)$)/gm,\"\")))?Ra(e[1].replace(/\\s+/g,\"\")):[];e.forEach(hb);e=e[b]||\"#\"+b}var f=a?bb(a):\"\";d=2<d?Oa(c):\"\";if(e||d)f+=\" (Argument \"+(e||\"\")+(d?\" \"+d:\"\")+\")\";d=Error(f);Object.setPrototypeOf(d,x.prototype);return d}Fa(x,Error);r(\"H.lang.InvalidArgumentError\",x);x.prototype.name=\"InvalidArgumentError\";\nfunction ib(a,b){var c=[];a&&c.push(bb(a));1<arguments.length&&c.push(\"\"+b);c=Error(c.join(\" \"));Object.setPrototypeOf(c,ib.prototype);return c}Fa(ib,Error);r(\"H.lang.IllegalOperationError\",ib);ib.prototype.name=\"IllegalOperationError\";var jb={};function kb(a){try{importScripts.apply(self,arguments)}catch(b){this.postError(\"invalid_script\")}}function lb(a){delete jb[a];this.postMessage(a)}function mb(a,b,c){if(Ua(b))var d=b;else try{d=self.eval(\"(\"+b+\")\"),Ua(d)||(d=null)}catch(e){}d?(jb[a]=d,c||this.postMessage(a)):this.postError(\"invalid_processor\")}function nb(a){this.Wb=a&&a[0];this.Ua=a&&a[1];this.kc=a&&a[2]||[]}nb.prototype.postError=function(a){this.postMessage(a,t,0)};\nnb.prototype.postMessage=function(a,b,c){self.postMessage({processor:this.Wb,taskId:this.Ua,type:c===t?1:c,data:a},b||t)};function ob(a,b,c){if(!Xa(a))throw new x(ob,0,\"InvalidArgument\");if(!Ua(b))throw new x(ob,1,\"InvalidArgument\");var d=pb++;qb[d]={mimeType:c||rb,nc:b};(new nb([\"3\",d,[]])).postMessage(a,[],2)}var qb={},pb=0;\nfunction sb(a,b){var c=a;if(qb[this.Ua]){var d=qb[this.Ua];var e=d.nc;delete qb[this.Ua];if(b)e(null,b);else{if(d.mimeType===tb){a=new Uint8Array(a);b=a.byteLength;d=\"\";c=0;for(var f,g,h,k;c<b;)f=a[c++],192>f||(g=a[c++],224>f?f=(f&31)<<6|g&63:(h=a[c++],240>f?f=(f&15)<<12|(g&63)<<6|h&63:(k=a[c++],f=(f&7)<<18|(g&63)<<12|(h&63)<<6|k&63))),65536>f?d+=String.fromCharCode(f):(f-=65536,d+=String.fromCharCode((f>>10)+55296,(f&1023)+56320));c=d}e(c)}}}var rb=0,tb=1;var y=Math,ub=y.min,vb=y.max,wb=y.round,xb=y.floor,yb=y.ceil,zb=y.abs,Bb=y.log,Cb=y.sqrt,z=y.pow,Db=y.exp,Eb=y.sin,Fb=y.asin,Gb=y.cos,Hb=y.tan,Ib=y.atan,Jb=y.atan2,Kb=y.LN2,A=y.PI,Lb=A/2,Mb=A/4,Nb=2*A,Ob=3*A,Pb=A/180,Qb=180/A,Rb=1/0;function Sb(a,b){var c;return 0>(c=a%b)===0>b?c:c+b}r(\"H.math.normalize\",function(a,b,c){b-=c=c||0;a-=c;return a-xb(a/b)*b+c});function Tb(a,b,c){return(a-=0)>c?c:a<b?b:a}r(\"H.math.clamp\",Tb);\nfunction Ub(a,b,c){var d=0;(d-=0)||(d=0);return b<c?a>=b-d&&a<=c+d:a>=c-d&&a<=b+d}var Vb={NONE:0,VERTEX:1,EDGE:2,SURFACE:3};r(\"H.math.CoverType\",Vb);\nfunction Wb(a,b,c){for(var d=c.length,e=d,f,g,h,k,m=c[0],n=0,q=0,u=0;1!=n&&1<e;){e-=0;g=c[--e];f=c[--e];k=c[e?e-0-1:(d+(e-0-1))%d];h=c[e?e-0-2:(d+(e-0-2))%d];if(f>=a-0&&f<=a+0&&g>=b-0&&g<=b+0||h>=a-0&&h<=a+0&&k>=b-0&&k<=b+0)n=1;else if(!n&&f===a)h===a&&(g<b&&k>b||g>b&&k<b)||(m<=a&&h>a||m>=a&&h<a)&&(g>=b?++q:++u),n=Ub(b,g,k)&&0>=Cb(z((a-h)*(g-k)-(b-k)*(f-h),2)/(z(f-h,2)+z(g-k,2)))?2:0;else if(!n&&Ub(a,f,h)){if(f<a&&h>a||f>a&&h<a)m=g+(a-f)/(h-f)*(k-g),q+=m>b,u+=m<b;n=Ub(b,g,k)&&0>=Cb(z((a-h)*(g-k)-\n(b-k)*(f-h),2)/(z(f-h,2)+z(g-k,2)))?2:0}m=f}!n&&0!==u&&0!==q%2&&(n=3);return n}function Xb(a,b){return Wb(a.x,a.y,b)!==Vb.NONE}r(\"H.math.isPointInsidePolygon\",Xb);function Yb(a){for(var b=a.length,c=new Float64Array(2*b),d=b&&a[0].x!==t;b--;){var e=a[b],f=b<<1;c[f]=d?e.x:e[0];c[f+1]=d?e.y:e[1]}return c}r(\"H.math.flatten\",Yb);function B(a,b){this.x=+a;this.y=+b}r(\"H.math.Point\",B);B.prototype.set=B;B.prototype.set=B.prototype.set;B.prototype.clone=function(a){a?(a.x=this.x,a.y=this.y):a=new B(this.x,this.y);return a};B.prototype.clone=B.prototype.clone;B.prototype.add=function(a){this.x+=a.x;this.y+=a.y;return this};B.prototype.add=B.prototype.add;B.prototype.sub=function(a){this.x-=a.x;this.y-=a.y;return this};B.prototype.sub=B.prototype.sub;B.prototype.scale=function(a,b){this.x*=a;this.y*=void 0===b?a:b;return this};\nB.prototype.scale=B.prototype.scale;B.prototype.round=function(){this.x=wb(this.x);this.y=wb(this.y);return this};B.prototype.round=B.prototype.round;B.prototype.floor=function(){this.x=xb(this.x);this.y=xb(this.y);return this};B.prototype.floor=B.prototype.floor;B.prototype.ceil=function(){this.x=yb(this.x);this.y=yb(this.y);return this};B.prototype.ceil=B.prototype.ceil;B.prototype.S=function(a){return!(!a||this.x!==a.x||this.y!==a.y)};B.prototype.equals=B.prototype.S;\nB.prototype.Kc=function(a,b){var c=b.x-a.x,d=b.y-a.y;var e=a;if(c||d)e=((this.x-a.x)*c+(this.y-a.y)*d)/(c*c+d*d),e=0>=e?a:1<=e?b:new B(a.x+e*c,a.y+e*d);return e};B.prototype.getNearest=B.prototype.Kc;B.prototype.eb=function(a){return Cb(z(this.x-a.x,2)+z(this.y-a.y,2))};B.prototype.distance=B.prototype.eb;
938B.fromIPoint=function(a){if(!a)throw Error(\"invalid argument\");return a instanceof B?a:new B(a.x,a.y)};r(\"H.util.constants.DEFAULT_MIN_ZOOM_LEVEL\",0);r(\"H.util.constants.DEFAULT_MAX_ZOOM_LEVEL\",22);function Zb(a,b,c){var d=Tb(+a,-90,90);if(b&&Ya(d))throw new x(b,c,a);return d}function $b(a,b,c){var d=+a;if(-180>d||180<d)d=Sb(d+180,360)-180;if(b&&Ya(d))throw new x(b,c,a);return d}function ac(a,b,c){var d;if(a!==t&&Ya(d=+a)&&b)throw new x(b,c,a);return d}r(\"H.geo.isDBC\",function(a,b){return 0>a!==0>b&&180<zb(b-a)});function C(){var a=C;if(!0===(Ta(this,a)&&this.constructor===a))throw new TypeError(\"Illegal constructor \"+bb(a));}r(\"H.geo.AbstractGeometry\",C);C.prototype.getBoundingBox=C.prototype.pa;C.prototype.equals=C.prototype.S;C.prototype.Xa=\"\";C.prototype.kb=\"\";C.prototype.toString=function(){return this.dc([this.Xa.toUpperCase(),\" \"]).join(\"\")};C.prototype.toString=C.prototype.toString;C.prototype.sd=function(){return{type:this.kb,coordinates:this.cc()}};C.prototype.toGeoJSON=C.prototype.sd;\nC.prototype.ib=function(){return{type:this.Xa,coordinates:this.jb(),boundingBox:this.pa().ib()}};C.prototype.forWorkerMessage=C.prototype.ib;function D(a,b,c){this.lat=Zb(a,D,0);this.lng=$b(b,D,1);c!==t&&(this.alt=ac(c,D,2))}Fa(D,C);r(\"H.geo.Point\",D);D.prototype.S=function(a){return this===a||!!a&&this.lat===a.lat&&this.lng===a.lng&&(this.alt||0)===(a.alt||0)};D.prototype.equals=D.prototype.S;D.prototype.eb=function(a){if(this===a||this.lat===a.lat&&this.lng===a.lng)a=0;else{var b=this.lat*Pb;var c=a.lat*Pb;a=1.274200158E7*Fb(ub(1,Cb(z(Eb((b-c)/2),2)+Gb(b)*Gb(c)*z(Eb((this.lng*Pb-a.lng*Pb)/2),2))))}return a};\nD.prototype.distance=D.prototype.eb;\nD.prototype.vd=function(a,b,c){var d;if(c){if(d=b/6371000.79){b=a*Pb;a=Pb*this.lat;var e=Eb(a);c=Eb(d);var f=Gb(d);d=Pb*this.lng;var g=Gb(a);a=Fb(g*Gb(b)*c+e*f);b=Jb(Eb(b)*g*c,f-e*Eb(a));b=(d+b+A)%(2*A)-A;b*=Qb;e=new D(a*Qb,(b+540)%360-180)}return e||this}a=(a%360+360)%360;if(0===(a+90)%180)return a=this.lng+b/(6371000.79*Nb*Gb(this.lat*Pb))*(270===a?-360:360),new D(this.lat,(a+540)%360-180);if(b/=6371000.79)a*=Pb,e=this.lat*Pb,c=this.lng*Pb,d=e+b*Gb(a),f=d-e,g=Bb(Hb(d/2+Mb)/Hb(e/2+Mb)),g=Ya(f/g)?\nGb(e):f/g,a=b*Eb(a)/g,zb(d)>Lb&&(d=0<d?A-d:-(A+d)),d=new D(d*Qb,((c+a+Ob+(zb(e+f)>Lb?A:0))%Nb-A)*Qb);return d||this};D.prototype.walk=D.prototype.vd;D.prototype.pa=function(){return new E(this.lat,this.lng,this.lat,this.lng)};D.prototype.getBoundingBox=D.prototype.pa;function bc(a,b,c){var d=ra(a)&&!(Ya(a.lat=Zb(a.lat))||Ya(a.lng=$b(a.lng))||a.alt!==t&&Ya(a.alt=ac(a.alt)));if(!d&&b)throw new x(b,c,a);return d}D.validate=bc;function cc(a){if(!a)throw new x(cc,0,a);return new D(a.lat,a.lng,a.alt)}\nD.fromIPoint=cc;l=D.prototype;l.Xa=\"Point\";l.dc=function(a){a.push(\"(\",this.lng,\" \",this.lat,\")\");return a};l.kb=\"Point\";l.cc=function(){return[this.lng,this.lat,this.alt||0]};l.jb=function(){return[this.lat,this.lng,this.alt||0]};function dc(){}function ec(a){return ub(1,vb(0,.5-Bb(Hb(Mb+Lb*a/180))/A/2))}dc.prototype.Oa=function(a,b,c){c?(c.x=b/360+.5,c.y=ec(a)):c=new B(b/360+.5,ec(a));return c};dc.prototype.latLngToPoint=dc.prototype.Oa;dc.prototype.Ac=function(a,b){return this.Oa(a.lat,a.lng,b)};dc.prototype.geoToPoint=dc.prototype.Ac;function fc(a){return 0>=a?90:1<=a?-90:Qb*(2*Ib(Db(A*(1-2*a)))-Lb)}\ndc.prototype.ka=function(a,b,c){c?(c.lat=fc(b),c.lng=360*(1===a?1:Sb(a,1))-180):c=new D(fc(b),360*(1===a?1:Sb(a,1))-180);return c};dc.prototype.xyToGeo=dc.prototype.ka;dc.prototype.ed=function(a,b){return this.ka(a.x,a.y,b)};dc.prototype.pointToGeo=dc.prototype.ed;var gc=new dc;r(\"H.geo.mercator\",gc);function G(a,b){this.projection=a||gc;this.ec=0;this.Da=this.exp=Bb(b||256)/Kb;hc(this);this.y=this.x=0}r(\"H.geo.PixelProjection\",G);var ic=zb(24)+zb(-8);G.prototype.hd=gc;G.prototype.projection=G.prototype.hd;G.prototype.x=0;G.prototype.x=G.prototype.x;G.prototype.y=0;G.prototype.y=G.prototype.y;G.prototype.w=z(2,ic);G.prototype.w=G.prototype.w;G.prototype.Rc=z(2,ic);G.prototype.h=G.prototype.Rc;\nG.prototype.Aa=function(a){if(Ya(a))throw new x(this.Aa,0,a);var b=this.x/this.w;var c=this.y/this.h;this.ec=a;this.Da=this.exp+a;hc(this);this.x=b*this.w;this.y=c*this.h};G.prototype.rescale=G.prototype.Aa;function hc(a){a.Da>ic&&(a.Da=ic);a.w=z(2,a.Da);a.h=z(2,a.Da)}G.prototype.Ob=function(){return this.ec||0};G.prototype.getZoomScale=G.prototype.Ob;G.prototype.zc=function(a,b){a=this.projection.Oa(a.lat,a.lng,b);a.x=a.x*this.w-this.x;a.y=a.y*this.h-this.y;return a};G.prototype.geoToPixel=G.prototype.zc;\nG.prototype.xb=function(a,b){return this.projection.ka((a.x+this.x)/this.w,(a.y+this.y)/this.h,b)};G.prototype.pixelToGeo=G.prototype.xb;G.prototype.ka=function(a,b,c){return this.projection.ka((a+this.x)/this.w,(b+this.y)/this.h,c)};G.prototype.xyToGeo=G.prototype.ka;G.prototype.sb=function(a,b,c){a=this.projection.Oa(a,b,c);a.x=a.x*this.w-this.x;a.y=a.y*this.h-this.y;return a};G.prototype.latLngToPixel=G.prototype.sb;G.prototype.fd=function(a){return new B(a.x*this.w-this.x,a.y*this.h-this.y)};\nG.prototype.pointToPixel=G.prototype.fd;function jc(a,b,c){var d=a[b];a=a[b+1];this.Pb=[];this.Eb=0;this.oc=b;this.mc=[a-c,d-c,a+c,d+c]}jc.prototype.Ia=function(a,b){var c=a[b];a=a[b+1];b=this.mc;return b[1]<=c&&c<=b[3]&&b[0]<=a&&a<=b[2]};jc.prototype.T=function(){return this.oc};var kc=new B(0,0);function lc(a,b,c,d,e){d[e]=b;
938d[e+1]=a}var oc=new G;function pc(a,b,c,d,e){oc.sb(a,b,kc);d[e]=kc.x;d[e+1]=kc.y}\nr(\"H.clustering.dynamicgrid.worker\",function(a,b,c,d,e){var f=e?lc:pc,g=0;e=!!self.ArrayBuffer;var h=a.byteLength?new Float64Array(a):a,k=h.length/3;a=[];var m=[],n=[],q=e?new Float64Array(2*k):[];k=0;var u=0;for(oc.Aa(d);g<h.length;){var I=h[g++];var K=h[g++];var w=h[g++];f(w,K,d,q,u);for(w=a.length;w--;)if(K=a[w],K.Ia(q,u)){var F=K;break}F||(F=new jc(q,u,b),a.push(F));w=u/2;F.Eb+=I||1;F.Pb.push(w);F=null;u+=2}for(w=a.length;w--;)K=a[w],b=K.Eb>=c,f=K.Pb,d=f.length,b?(m.push(d),m=m.concat(f)):\n(k+=d,n=n.concat(f));c=[k].concat(n).concat(m);c=e?(new Uint32Array(c)).buffer:c;this.postMessage(c,[c])});function L(){}r(\"H.util.ICache\",L);L.prototype.add=function(){};L.prototype.add=L.prototype.add;L.prototype.get=function(){};L.prototype.get=L.prototype.get;L.prototype.fb=function(){};L.prototype.drop=L.prototype.fb;L.prototype.forEach=function(){};L.prototype.forEach=L.prototype.forEach;L.prototype.ia=function(){};L.prototype.removeAll=L.prototype.ia;L.prototype.ya=function(){};L.prototype.registerOnDrop=L.prototype.ya;L.prototype.bb=function(){};L.prototype.deRegisterOnDrop=L.prototype.bb;function M(a,b,c){this.ta=[];b&&this.ya(b);if(c&&!Ua(c))throw new x(M,2,c);this.J=0;this.filter=c;this.s={};this.qa=this.ea=null;this.zb(a)}r(\"H.util.Cache\",M);M.prototype.add=function(a,b,c){var d,e;c=+c;if(!$a(c)||0>c)throw new x(this.add,2,c);a=String(a);if(e=this.filter?this.filter(a,b,c):!0)(d=this.s[a])?(d.data!==b&&qc(this,d),this.J+=c-d.size,d.size=c,d.data=b,rc(this,d)):this.s[a]=sc(this,{id:a,data:b,size:c,v:null,N:null},this.ea),tc(this);return e};M.prototype.add=M.prototype.add;\nM.prototype.ya=function(a){if(!Ua(a))throw new x(this.ya,0,a);this.ta.push(a)};M.prototype.registerOnDrop=M.prototype.ya;M.prototype.bb=function(a){this.ta=this.ta.filter(function(b){return b!==a})};M.prototype.deRegisterOnDrop=M.prototype.bb;M.prototype.get=function(a,b){return(a=b?this.s[a]:rc(this,this.s[a]))&&a.data};M.prototype.get=M.prototype.get;M.prototype.fb=function(a){var b;(b=this.s[a])&&uc(this,b,!0)};M.prototype.drop=M.prototype.fb;\nM.prototype.forEach=function(a,b,c){var d;for(d in this.s){var e=this.s[d];(c?c(d,e.data,e.size):1)&&a.call(b,d,e.data,e.size)}};M.prototype.forEach=M.prototype.forEach;M.prototype.ia=function(a){var b;for(b in this.s){var c=this.s[b];(a?a(b,c.data,c.size):1)&&uc(this,this.s[b],!0)}};M.prototype.removeAll=M.prototype.ia;M.prototype.zb=function(a){if(!(0<+a))throw new x(M.prototype.zb,0,a);this.Tb=+a;tc(this);return this};M.prototype.setMaxSize=M.prototype.zb;M.prototype.Jc=function(){return this.Tb};\nM.prototype.getMaxSize=M.prototype.Jc;M.prototype.Ec=function(){return this.J};M.prototype.getCurrentSize=M.prototype.Ec;function rc(a,b){b&&(a.ea=sc(a,b,a.ea));return b}function tc(a){for(;a.J>a.Tb&&a.qa;)uc(a,a.qa,!0)}function sc(a,b,c){if(c!==b){(b.v||b.N)&&uc(a,b,!1);if(b.v=c)b.N=c.N,c.N=b;b.N||(a.ea=b);b.v||(a.qa=b);a.J+=b.size}return b}function uc(a,b,c){var d=b.N,e=b.v;if(d||e||b==a.ea&&b==a.qa)d?d.v=e:a.ea=e,e?e.N=d:a.qa=d,a.J-=b.size,c&&(delete a.s[b.id],qc(a,b));b.v=b.N=null}\nfunction qc(a,b){for(var c=a.ta.length;c--;)a.ta[c].call(a,b.id,b.data,b.size)};function vc(a){p.setTimeout(function(){throw a;},0)};function wc(a,b){return-1!=a.indexOf(b)};var O;a:{var xc=p.navigator;if(xc){var yc=xc.userAgent;if(yc){O=yc;break a}}O=\"\"};function zc(a){zc[\" \"](a);return a}zc[\" \"]=sa;var Ac=wc(O,\"Gecko\")&&!(wc(O.toLowerCase(),\"webkit\")&&!wc(O,\"Edge\"))&&!(wc(O,\"Trident\")||wc(O,\"MSIE\"))&&!wc(O,\"Edge\"),Bc=wc(O.toLowerCase(),\"webkit\")&&!wc(O,\"Edge\");function Cc(){var a=document;var b=\"IFRAME\";\"application/xhtml+xml\"===a.contentType&&(b=b.toLowerCase());return a.createElement(b)};var Dc;\nfunction Ec(){var a=p.MessageChannel;\"undefined\"===typeof a&&\"undefined\"!==typeof window&&window.postMessage&&window.addEventListener&&!wc(O,\"Presto\")&&(a=function(){var e=Cc();e.style.display=\"none\";document.documentElement.appendChild(e);var f=e.contentWindow;e=f.document;e.open();e.close();var g=\"callImmediate\"+Math.random(),h=\"file:\"==f.location.protocol?\"*\":f.location.protocol+\"//\"+f.location.host;e=Ca(function(k){if((\"*\"==h||k.origin==h)&&k.data==g)this.port1.onmessage()},this);f.addEventListener(\"message\",e,\n!1);this.port1={};this.port2={postMessage:function(){f.postMessage(g,h)}}});if(\"undefined\"!==typeof a&&!wc(O,\"Trident\")&&!wc(O,\"MSIE\")){var b=new a,c={},d=c;b.port1.onmessage=function(){if(void 0!==c.next){c=c.next;var e=c.Jb;c.Jb=null;e()}};return function(e){d.next={Jb:e};d=d.next;b.port2.postMessage(0)}}return function(e){p.setTimeout(e,0)}};function Fc(a,b){this.$c=100;this.rc=a;this.md=b;this.Qa=0;this.Ma=null}Fc.prototype.get=function(){if(0<this.Qa){this.Qa--;var a=this.Ma;this.Ma=a.next;a.next=null}else a=this.rc();return a};Fc.prototype.put=function(a){this.md(a);this.Qa<this.$c&&(this.Qa++,a.next=this.Ma,this.Ma=a)};function Gc(){this.Ya=this.ja=null}Gc.prototype.add=function(a,b){var c=Hc.get();c.set(a,b);this.Ya?this.Ya.next=c:this.ja=c;this.Ya=c};Gc.prototype.remove=function(){var a=null;
938this.ja&&(a=this.ja,this.ja=this.ja.next,this.ja||(this.Ya=null),a.next=null);return a};var Hc=new Fc(function(){return new Ic},function(a){return a.reset()});function Ic(){this.next=this.scope=this.hb=null}Ic.prototype.set=function(a,b){this.hb=a;this.scope=b;this.next=null};\nIc.prototype.reset=function(){this.next=this.scope=this.hb=null};function Jc(a,b){Kc||Lc();Mc||(Kc(),Mc=!0);Nc.add(a,b)}var Kc;function Lc(){if(p.Promise&&p.Promise.resolve){var a=p.Promise.resolve(void 0);Kc=function(){a.then(Oc)}}else Kc=function(){var b=Oc;\"function\"!==typeof p.setImmediate||p.Window&&p.Window.prototype&&!wc(O,\"Edge\")&&p.Window.prototype.setImmediate==p.setImmediate?(Dc||(Dc=Ec()),Dc(b)):p.setImmediate(b)}}var Mc=!1,Nc=new Gc;function Oc(){for(var a;a=Nc.remove();){try{a.hb.call(a.scope)}catch(b){vc(b)}Hc.put(a)}Mc=!1};function Pc(a){this.u=Qc;this.Zb=void 0;this.ba=this.I=this.W=null;this.Ka=this.gb=!1;if(a!=sa)try{var b=this;a.call(void 0,function(c){Rc(b,Sc,c)},function(c){Rc(b,Tc,c)})}catch(c){Rc(this,Tc,c)}}var Qc=0,Sc=2,Tc=3;function Uc(){this.next=this.context=this.ha=this.ua=this.R=null;this.Fa=!1}Uc.prototype.reset=function(){this.context=this.ha=this.ua=this.R=null;this.Fa=!1};var Vc=new Fc(function(){return new Uc},function(a){a.reset()});\nfunction Wc(a,b,c){var d=Vc.get();d.ua=a;d.ha=b;d.context=c;return d}function Xc(a,b,c){Yc(a,b,c,null)||Jc(Da(b,a))}function Zc(a){return new Pc(function(b,c){var d=a.length,e=[];if(d)for(var f=function(m,n){d--;e[m]=n;0==d&&b(e)},g=function(m){c(m)},h=0,k;h<a.length;h++)k=a[h],Xc(k,Da(f,h),g);else b(e)})}function $c(){var a,b,c=new Pc(function(d,e){a=d;b=e});return new ad(c,a,b)}Pc.prototype.then=function(a,b,c){return bd(this,\"function\"===typeof a?a:null,\"function\"===typeof b?b:null,c)};\nPc.prototype.$goog_Thenable=!0;Pc.prototype.cancel=function(a){if(this.u==Qc){var b=new cd(a);Jc(function(){dd(this,b)},this)}};function dd(a,b){if(a.u==Qc)if(a.W){var c=a.W;if(c.I){for(var d=0,e=null,f=null,g=c.I;g&&(g.Fa||(d++,g.R==a&&(e=g),!(e&&1<d)));g=g.next)e||(f=g);e&&(c.u==Qc&&1==d?dd(c,b):(f?(d=f,d.next==c.ba&&(c.ba=d),d.next=d.next.next):ed(c),fd(c,e,Tc,b)))}a.W=null}else Rc(a,Tc,b)}function gd(a,b){a.I||a.u!=Sc&&a.u!=Tc||hd(a);a.ba?a.ba.next=b:a.I=b;a.ba=b}\nfunction bd(a,b,c,d){var e=Wc(null,null,null);e.R=new Pc(function(f,g){e.ua=b?function(h){try{var k=b.call(d,h);f(k)}catch(m){g(m)}}:f;e.ha=c?function(h){try{var k=c.call(d,h);void 0===k&&h instanceof cd?g(h):f(k)}catch(m){g(m)}}:g});e.R.W=a;gd(a,e);return e.R}Pc.prototype.td=function(a){this.u=Qc;Rc(this,Sc,a)};Pc.prototype.ud=function(a){this.u=Qc;Rc(this,Tc,a)};\nfunction Rc(a,b,c){a.u==Qc&&(a===c&&(b=Tc,c=new TypeError(\"Promise cannot resolve to itself\")),a.u=1,Yc(c,a.td,a.ud,a)||(a.Zb=c,a.u=b,a.W=null,hd(a),b!=Tc||c instanceof cd||id(a,c)))}function Yc(a,b,c,d){if(a instanceof Pc)return gd(a,Wc(b||sa,c||null,d)),!0;if(a)try{var e=!!a.$goog_Thenable}catch(g){e=!1}else e=!1;if(e)return a.then(b,c,d),!0;if(ra(a))try{var f=a.then;if(\"function\"===typeof f)return jd(a,f,b,c,d),!0}catch(g){return c.call(d,g),!0}return!1}\nfunction jd(a,b,c,d,e){function f(k){h||(h=!0,d.call(e,k))}function g(k){h||(h=!0,c.call(e,k))}var h=!1;try{b.call(a,g,f)}catch(k){f(k)}}function hd(a){a.gb||(a.gb=!0,Jc(a.uc,a))}function ed(a){var b=null;a.I&&(b=a.I,a.I=b.next,b.next=null);a.I||(a.ba=null);return b}Pc.prototype.uc=function(){for(var a;a=ed(this);)fd(this,a,this.u,this.Zb);this.gb=!1};\nfunction fd(a,b,c,d){if(c==Tc&&b.ha&&!b.Fa)for(;a&&a.Ka;a=a.W)a.Ka=!1;if(b.R)b.R.W=null,kd(b,c,d);else try{b.Fa?b.ua.call(b.context):kd(b,c,d)}catch(e){ld.call(null,e)}Vc.put(b)}function kd(a,b,c){b==Sc?a.ua.call(a.context,c):a.ha&&a.ha.call(a.context,c)}function id(a,b){a.Ka=!0;Jc(function(){a.Ka&&ld.call(null,b)})}var ld=vc;function cd(a){La.call(this,a)}Fa(cd,La);cd.prototype.name=\"cancel\";function ad(a,b,c){this.promise=a;this.resolve=b;this.reject=c};function md(){}r(\"H.util.ICancelable\",md);md.prototype.cancel=function(){};md.prototype.cancel=md.prototype.cancel;
938function nd(a,b,c,d){this.key=\"\";this.x=a;this.y=b;this.Sb=c;this.ra=d;this.O=$c()}nd.prototype.then=function(a,b,c){return this.O.promise.then(a,b,c)};nd.prototype.resolve=function(a){this.O.resolve(a)};nd.prototype.reject=function(a){this.O.reject(a)};nd.prototype.cancel=function(){this.O.promise.cancel()};nd.prototype.cancel=nd.prototype.cancel;function E(a,b,c,d){od(this,Zb(a,E,0),$b(b,E,1),Zb(c,E,2),$b(d,E,3))}Fa(E,C);r(\"H.geo.Rect\",E);E.prototype.Xa=\"Polygon\";E.prototype.dc=function(a){var b=this.l,c=this.g,d=this.j,e=this.i;a.push(\"(\",\"(\",c,\" \",b,\",\",e,\" \",b,\",\",e,\" \",d,\",\",c,\" \",d,\",\",c,\" \",b,\")\",\")\");return a};E.prototype.S=function(a){var b=this===a;!b&&Ta(a,E)&&(b=this.l===a.l&&this.g===a.g&&this.j===a.j&&this.i===a.i);return b};E.prototype.equals=E.prototype.S;\nE.prototype.clone=function(){return new E(this.l,this.g,this.j,this.i)};E.prototype.clone=E.prototype.clone;function od(a,b,c,d,e){a.g=c;a.i=e;b<d&&(c=b,b=d,d=c);a.l=b;a.j=d;a.Db=a.Za=a.$a=null;return a}E.prototype.Nb=function(){this.Db||(this.Db=new D(this.l,this.g));return this.Db};E.prototype.getTopLeft=E.prototype.Nb;E.prototype.Mb=function(){this.Za||(this.Za=new D(this.j,this.i));return this.Za};E.prototype.getBottomRight=E.prototype.Mb;E.prototype.Pc=function(){return this.l};\nE.prototype.getTop=E.prototype.Pc;E.prototype.Cc=function(){return this.j};E.prototype.getBottom=E.prototype.Cc;E.prototype.Ic=function(){return this.g};E.prototype.getLeft=E.prototype.Ic;E.prototype.Nc=function(){return this.i};E.prototype.getRight=E.prototype.Nc;E.prototype.T=function(){this.$a||(this.$a=new D(this.j+(this.l-this.j)/2,pd(this.g,this.U())));return this.$a};E.prototype.getCenter=E.prototype.T;E.prototype.U=function(){return qd(this.g,this.i)};E.prototype.getWidth=E.prototype.U;\nE.prototype.fa=function(){return this.l-this.j};E.prototype.getHeight=E.prototype.fa;E.prototype.Wc=function(){return this.g>this.i};E.prototype.isCDB=E.prototype.Wc;E.prototype.Yc=function(){return!this.U()&&!this.fa()};E.prototype.isEmpty=E.prototype.Yc;E.prototype.pa=function(){return new E(this.l,this.g,this.j,this.i)};E.prototype.getBoundingBox=E.prototype.pa;\nE.prototype.Ha=function(a,b,c){var d=this.T();c||(a=Zb(a,this.Ha,0),b=$b(b,this.Ha,1));b=this.V(a,b,c);a=b.T();return a.lat===d.lat&&a.lng===d.lng&&this.fa()===b.fa()&&this.U()===b.U()};E.prototype.containsLatLng=E.prototype.Ha;E.prototype.Ia=function(a,b){b||bc(a,this.Ia,0);return this.Ha(a.lat,a.lng,b)};E.prototype.containsPoint=E.prototype.Ia;\nE.prototype.Kb=function(a,b){var c=this.T();if(!b&&!Ta(a,E))throw new x(this.Kb,0,a);b=this.Pa(a,b);a=b.T();return a.lat===c.lat&&a.lng===c.lng&&this.fa()===b.fa()&&this.U()===b.U()};E.prototype.containsRect=E.prototype.Kb;E.prototype.V=function(a,b,c,d){if(!c){if(Ya(a=Zb(a)))throw new x(this.V,0,a);if(Ya(b=$b(b)))throw new x(this.V,1,b);}return rd(this.l,this.g,this.j,this.i,a,b,a,b,d)};E.prototype.mergeLatLng=E.prototype.V;\nE.prototype.Ub=function(a,b,c){b||bc(a,this.Ub,0);return this.V(a.lat,a.lng,b,c)};E.prototype.mergePoint=E.prototype.Ub;E.prototype.Pa=function(a,b,c){if(!b&&!Ta(a,E))throw new x(this.Pa,0,a);return rd(this.l,this.g,this.j,this.i,a.l,a.g,a.j,a.i,c)};E.prototype.mergeRect=E.prototype.Pa;E.prototype.sa=function(a,b,c,d,e,f){e||(a=Zb(a,this.sa,0),b=$b(b,this.sa,1),c=Zb(c,this.sa,2),d=$b(d,this.sa,3));return rd(this.l,this.g,this.j,this.i,a,b,c,d,f)};E.prototype.mergeTopLeftBottomRight=E.prototype.sa;\nE.prototype.Qb=function(a,b){var c=this.g<=this.i,d=a.g<=a.i,e=this.g<a.i,f=a.g<this.i;if(!b&&!Ta(a,E))throw new x(this.Qb,0,a);return this.j<=a.l&&a.j<=this.l&&(!c&&(!d||e||f)||!d&&(e||f)||e&&f)};E.prototype.intersects=E.prototype.Qb;function qd(a,b){a=b-a;return a+(0>a?360:0)}function pd(a,b){a+=b/2;return a-(180<a?360:0)}\nfunction rd(a,b,c,d,e,f,g,h,k){c=ub(c,g);a=vb(a,e);e=qd(b,d);var m=pd(b,e);g=qd(f,h);var n=pd(f,g)-m;n+=0>n-1E-6?360:0;if(180>n-1E-6){m=b;var q=h}else n=360-n,m=f,q=d;n=n+e/2+g/2;360<=n+5E-7?(m=-180,q=180):n-5E-7<e?(m=b,q=d):n-5E-7<g&&(m=f,q=h);return k?od(k,a,m,c,q):new E(a,m,c,q)}E.merge=rd;function sd(a,b,c){c||(bc(a,sd,0),bc(b,sd,1));return new E(a.lat,a.lng,b.lat,b.lng)}E.fromPoints=sd;\nfunction td(a,b){var c=1,d=a.length,e=null;var f=ta(a);if(\"array\"!=f&&(\"object\"!=f||\"number\"!=typeof a.length))throw new x(td,0,a);if(0<d)for(f=a[0],e=sd(f,f,b);c<d;c++)f=a[c],e.V(f.lat,f.lng,b,e);return e}E.coverPoints=td;function ud(a,b){var c=3,d=a.length,e;if(!(b||a&&null!=a.length))throw new x(ud,0,a);if(0<d)for(e=new E(a[0],a[1],a[0],a[1]);c<d;c+=3)e.V(a[c],a[c+1],b,e);return e}E.coverLatLngAlts=ud;\nfunction vd(a,b){var c=1,d=a.length,e;if(b&&(!a||null==a.length))throw new x(vd,0,a);if(0<d)for(e=new E(a[0].l,a[0].g,a[0].j,a[0].i);c<d;c++)e.Pa(a[c],b,e);return e}E.coverRects=vd;\nE.prototype.Yb=function(a,b){var c=this.g,d=this.l,e=this.i,f=this.j,g=this.T().lng;bc(a,this.Yb,0);var h=a.lat-f-(d-f)/2;var k=a.lng-g;k=180<k||-180>k?-(g+a.lng):k;a=c+(0>k?2*k:0);a=-180>a?360+a:a;e+=0<k?2*k:0;e=180<e?e-360:e;d=0<h?d+2*h:d;90<=d&&(d=90);f=0>h?f+2*h:f;-90>=f&&(f=-90);return b?od(b,d,a,f,e):new E(d,a,f,e)};E.prototype.resizeToCenter=E.prototype.Yb;E.prototype.kb=\"Polygon\";\nE.prototype.cc=function(){return[[this.g,this.l,0],[this.i,this.l,0],[this.i,this.j,0],[this.g,this.j,0],[this.g,this.l,0]]};E.prototype.ib=function(){return this.jb()};E.prototype.jb=function(){return[this.l,this.g,this.j,this.i]};function wd(a,b,c,d){var e=!!c,f,g=0,h=0,k=0,m=0,n=0,q,u=-1;var I=globalThis.Float32Array;var K,w=[];if(b){b=Ra(b);a=Ra(a);e&&(f=Ra(c));c=b.length;d=d?1E-7:1E-5;for(K=new I(3*c);g<c;){I=b[g];var F=+I;var W=+a[g];e&&(q=+f[g]);
938xd.test(I)?0<=u&&(0<g-u&&w.push(u,g+1),u=-1):0>u&&(u=g);g++;m=K[h++]=m+W*d;k=K[h++]=k+F*d;e&&(n=K[h]=n+q);h++}0<=u&&1<c-u&&w.push(u,c)}else K=new I(0);return{path:K,outlineIndices:w}}var xd=/^-?0\\d/;\nfunction yd(a,b){for(var c=0,d=a.length/3,e=new globalThis.Array(d),f=0;c<d;)e[c++]=b.sb(a[f],a[++f]),f+=2;return e};function Q(){0!=zd&&(Ad[ua(this)]=this);this.na=this.na;this.G=this.G}var zd=0,Ad={};Q.prototype.na=!1;Q.prototype.C=function(){if(!this.na&&(this.na=!0,this.K(),0!=zd)){var a=ua(this);if(0!=zd&&this.G&&0<this.G.length)throw Error(this+\" did not empty its onDisposeCallbacks queue. This probably means it overrode dispose() or disposeInternal() without calling the superclass' method.\");delete Ad[a]}};\nQ.prototype.aa=function(a,b){this.na?void 0!==b?a.call(b):a():(this.G||(this.G=[]),this.G.push(void 0!==b?Ca(a,b):a))};Q.prototype.K=function(){if(this.G)for(;this.G.length;)this.G.shift()()};var Bd=function(){if(!p.addEventListener||!Object.defineProperty)return!1;var a=!1,b=Object.defineProperty({},\"passive\",{get:function(){a=!0}});try{p.addEventListener(\"test\",sa,b),p.removeEventListener(\"test\",sa,b)}catch(c){}return a}();function S(a,b){this.type=a;this.currentTarget=this.target=b;this.defaultPrevented=this.xa=!1}S.prototype.stopPropagation=function(){this.xa=!0};S.prototype.preventDefault=function(){this.defaultPrevented=!0};function Cd(a,b){S.call(this,a?a.type:\"\");this.relatedTarget=this.currentTarget=this.target=null;this.button=this.screenY=this.screenX=this.clientY=this.clientX=this.offsetY=this.offsetX=0;this.key=\"\";this.charCode=this.keyCode=0;this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1;this.state=null;this.pointerId=0;this.pointerType=\"\";this.oa=null;if(a){var c=this.type=a.type,d=a.changedTouches&&a.changedTouches.length?a.changedTouches[0]:null;this.target=a.target||a.srcElement;this.currentTarget=\nb;if(b=a.relatedTarget){if(Ac){a:{try{zc(b.nodeName);var e=!0;break a}catch(f){}e=!1}e||(b=null)}}else\"mouseover\"==c?b=a.fromElement:\"mouseout\"==c&&(b=a.toElement);this.relatedTarget=b;d?(this.clientX=void 0!==d.clientX?d.clientX:d.pageX,this.clientY=void 0!==d.clientY?d.clientY:d.pageY,this.screenX=d.screenX||0,this.screenY=d.screenY||0):(this.offsetX=Bc||void 0!==a.offsetX?a.offsetX:a.layerX,this.offsetY=Bc||void 0!==a.offsetY?a.offsetY:a.layerY,this.clientX=void 0!==a.clientX?a.clientX:a.pageX,\nthis.clientY=void 0!==a.clientY?a.clientY:a.pageY,this.screenX=a.screenX||0,this.screenY=a.screenY||0);this.button=a.button;this.keyCode=a.keyCode||0;this.key=a.key||\"\";this.charCode=a.charCode||(\"keypress\"==c?a.keyCode:0);this.ctrlKey=a.ctrlKey;this.altKey=a.altKey;this.shiftKey=a.shiftKey;this.metaKey=a.metaKey;this.pointerId=a.pointerId||0;this.pointerType=\"string\"===typeof a.pointerType?a.pointerType:Dd[a.pointerType]||\"\";this.state=a.state;this.oa=a;a.defaultPrevented&&Cd.Z.preventDefault.call(this)}}\nFa(Cd,S);var Dd={2:\"touch\",3:\"pen\",4:\"mouse\"};Cd.prototype.stopPropagation=function(){Cd.Z.stopPropagation.call(this);this.oa.stopPropagation?this.oa.stopPropagation():this.oa.cancelBubble=!0};Cd.prototype.preventDefault=function(){Cd.Z.preventDefault.call(this);var a=this.oa;a.preventDefault?a.preventDefault():a.returnValue=!1};var Ed=\"closure_listenable_\"+(1E6*Math.random()|0);var Fd=0;function Gd(a,b,c,d,e){this.listener=a;this.proxy=null;this.src=b;this.type=c;this.capture=!!d;this.La=e;this.key=++Fd;this.za=this.Ga=!1}function Hd(a){a.za=!0;a.listener=null;a.proxy=null;a.src=null;a.La=null};function Id(a){this.src=a;this.m={};this.Ea=0}Id.prototype.add=function(a,b,c,d,e){var f=a.toString();a=this.m[f];a||(a=this.m[f]=[],this.Ea++);var g=Jd(a,b,d,e);-1<g?(b=a[g],c||(b.Ga=!1)):(b=new Gd(b,this.src,f,!!d,e),b.Ga=c,a.push(b));return b};Id.prototype.remove=function(a,b,c,d){a=a.toString();if(!(a in this.m))return!1;var e=this.m[a];b=Jd(e,b,c,d);return-1<b?(Hd(e[b]),Array.prototype.splice.call(e,b,1),0==e.length&&(delete this.m[a],this.Ea--),!0):!1};\nfunction Kd(a,b){var c=b.type;if(c in a.m){var d=a.m[c],e=Ma(d,b),f;(f=0<=e)&&Array.prototype.splice.call(d,e,1);f&&(Hd(b),0==a.m[c].length&&(delete a.m[c],a.Ea--))}}
938Id.prototype.ia=function(a){a=a&&a.toString();var b=0,c;for(c in this.m)if(!a||c==a){for(var d=this.m[c],e=0;e<d.length;e++)++b,Hd(d[e]);delete this.m[c];this.Ea--}return b};Id.prototype.mb=function(a,b,c,d){a=this.m[a.toString()];var e=-1;a&&(e=Jd(a,b,c,d));return-1<e?a[e]:null};\nfunction Jd(a,b,c,d){for(var e=0;e<a.length;++e){var f=a[e];if(!f.za&&f.listener==b&&f.capture==!!c&&f.La==d)return e}return-1};var Ld=\"closure_lm_\"+(1E6*Math.random()|0),Md={},Nd=0;function Od(a,b,c,d,e){if(d&&d.once)Pd(a,b,c,d,e);else if(Array.isArray(b))for(var f=0;f<b.length;f++)Od(a,b[f],c,d,e);else c=Qd(c),a&&a[Ed]?a.D.add(String(b),c,!1,ra(d)?!!d.capture:!!d,e):Rd(a,b,c,!1,d,e)}\nfunction Rd(a,b,c,d,e,f){if(!b)throw Error(\"Invalid event type\");var g=ra(e)?!!e.capture:!!e,h=Sd(a);h||(a[Ld]=h=new Id(a));c=h.add(b,c,d,g,f);if(!c.proxy){d=Td();c.proxy=d;d.src=a;d.listener=c;if(a.addEventListener)Bd||(e=g),void 0===e&&(e=!1),a.addEventListener(b.toString(),d,e);else if(a.attachEvent)a.attachEvent(Ud(b.toString()),d);else if(a.addListener&&a.removeListener)a.addListener(d);else throw Error(\"addEventListener and attachEvent are unavailable.\");Nd++}}\nfunction Td(){function a(c){return b.call(a.src,a.listener,c)}var b=Vd;return a}function Pd(a,b,c,d,e){if(Array.isArray(b))for(var f=0;f<b.length;f++)Pd(a,b[f],c,d,e);else c=Qd(c),a&&a[Ed]?a.D.add(String(b),c,!0,ra(d)?!!d.capture:!!d,e):Rd(a,b,c,!0,d,e)}function Xd(a,b,c,d,e){if(Array.isArray(b))for(var f=0;f<b.length;f++)Xd(a,b[f],c,d,e);else d=ra(d)?!!d.capture:!!d,c=Qd(c),a&&a[Ed]?a.D.remove(String(b),c,d,e):a&&(a=Sd(a))&&(b=a.mb(b,c,d,e))&&Yd(b)}\nfunction Yd(a){if(\"number\"!==typeof a&&a&&!a.za){var b=a.src;if(b&&b[Ed])Kd(b.D,a);else{var c=a.type,d=a.proxy;b.removeEventListener?b.removeEventListener(c,d,a.capture):b.detachEvent?b.detachEvent(Ud(c),d):b.addListener&&b.removeListener&&b.removeListener(d);Nd--;(c=Sd(b))?(Kd(c,a),0==c.Ea&&(c.src=null,b[Ld]=null)):Hd(a)}}}function Ud(a){return a in Md?Md[a]:Md[a]=\"on\"+a}function Vd(a,b){if(a.za)a=!0;else{b=new Cd(b,this);var c=a.listener,d=a.La||a.src;a.Ga&&Yd(a);a=c.call(d,b)}return a}\nfunction Sd(a){a=a[Ld];return a instanceof Id?a:null}var Zd=\"__closure_events_fn_\"+(1E9*Math.random()>>>0);function Qd(a){if(\"function\"===typeof a)return a;a[Zd]||(a[Zd]=function(b){return a.handleEvent(b)});return a[Zd]};r(\"H.util.Event\",S);S.prototype.stopPropagation=S.prototype.stopPropagation;S.prototype.stopPropagation=S.prototype.stopPropagation;S.prototype.CAPTURING_PHASE=1;S.prototype.CAPTURING_PHASE=S.prototype.CAPTURING_PHASE;S.prototype.AT_TARGET=2;S.prototype.AT_TARGET=S.prototype.AT_TARGET;S.prototype.BUBBLING_PHASE=3;S.prototype.BUBBLING_PHASE=S.prototype.BUBBLING_PHASE;S.prototype.eventPhase=0;S.prototype.eventPhase=S.prototype.eventPhase;function T(){Q.call(this);this.D=new Id(this);this.hc=this;this.wb=null}Fa(T,Q);T.prototype[Ed]=!0;l=T.prototype;l.M=function(){return this.wb};l.Sa=function(a){this.wb=a};l.addEventListener=function(a,b,c,d){Od(this,a,b,c,d)};l.removeEventListener=function(a,b,c,d){Xd(this,a,b,c,d)};\nl.dispatchEvent=function(a){var b,c=this.M();if(c)for(b=[];c;c=c.M())b.push(c);c=this.hc;var d=a.type||a;if(\"string\"===typeof a)a=new S(a,c);else if(a instanceof S)a.target=a.target||c;else{var e=a;a=new S(d,c);Ka(a,e)}e=!0;if(b)for(var f=b.length-1;!a.xa&&0<=f;f--){var g=a.currentTarget=b[f];e=g.da(d,!0,a)&&e}a.xa||(g=a.currentTarget=c,e=g.da(d,!0,a)&&e,a.xa||(e=g.da(d,!1,a)&&e));if(b)for(f=0;!a.xa&&f<b.length;f++)g=a.currentTarget=b[f],e=g.da(d,!1,a)&&e;return e};\nl.K=function(){T.Z.K.call(this);this.D&&this.D.ia(void 0);this.wb=null};l.da=function(a,b,c){a=this.D.m[String(a)];if(!a)return!0;a=a.concat();for(var d=!0,e=0;e<a.length;++e){var f=a[e];if(f&&!f.za&&f.capture==b){var g=f.listener,h=f.La||f.src;f.Ga&&Kd(this.D,f);d=!1!==g.call(h,c)&&d}}return d&&!c.defaultPrevented};l.mb=function(a,b,c,d){return this.D.mb(String(a),b,c,d)};r(\"H.util.EventTarget\",T);T.prototype.Sa=T.prototype.Sa;T.prototype.setParentEventTarget=T.prototype.Sa;T.prototype.M=T.prototype.M;T.prototype.getParentEventTarget=T.prototype.M;T.prototype.addEventListener=T.prototype.addEventListener;T.prototype.addEventListener=T.prototype.addEventListener;T.prototype.removeEventListener=T.prototype.removeEventListener;T.prototype.removeEventListener=T.prototype.removeEventListener;T.prototype.dispatchEvent=T.prototype.dispatchEvent;\nT.prototype.dispatchEvent=T.prototype.dispatchEvent;T.prototype.C=T.prototype.C;T.prototype.dispose=T.prototype.C;T.prototype.aa=T.prototype.aa;T.prototype.addOnDisposeCallback=T.prototype.aa;T.prototype.yc=T.prototype.da;\nT.prototype.da=function(a,b,c){var d,e,f=!0;var g=c[c.currentTarget===c.target?\"AT_TARGET\":b?\"CAPTURING_PHASE\":(d=!0,\"BUBBLING_PHASE\")];if(!d||\"pointerenter\"!==(e=c.type)&&\"pointerleave\"!==e)c.eventPhase=g,f=T.prototype.yc.apply(this,arguments),d&&this.M&&null===this.M()&&delete c.eventPhase;return f};T.prototype.qd=function(a){for(var b,c=this;c&&(b=c.M())&&b!==a;)c=b;b||c.Sa(a)};T.prototype.setRootParentEventTarget=T.prototype.qd;function U(a){a=a||{};var b=a.callback;this.rb=a.label;Ua(b)&&(this.callback=b);this.cb=!!a.disabled;U.Z.constructor.call(this)}Fa(U,T);r(\"H.util.ContextItem\",U);U.prototype.Hc=function(){return this.rb};U.prototype.getLabel=U.prototype.Hc;U.prototype.pd=function(a){this.rb!==a&&(this.rb=a,this.dispatchEvent(\"update\"));return this};U.prototype.setLabel=U.prototype.pd;U.prototype.Xc=function(){return this.cb};U.prototype.isDisabled=U.prototype.Xc;\nU.prototype.od=function(a){a!==this.cb&&(this.cb=a,this.dispatchEvent(\"update\"));return this};U.prototype.setDisabled=U.prototype.od;var $d=new U;U.SEPARATOR=$d;function ae(a,b,c){this.type=a;this.data=b;this.O=$c();this.resolve=Na(this.resolve,this);this.reject=Na(this.reject,this);this.priority=be;c!==t&&(this.priority=c);this.Gc().add(this)}var be=1,ce={zd:0,Ad:be,yd:2};l=ae.prototype;l.then=function(a,b,c){return this.O.promise.then(a,b,c)};l.resolve=function(a){this.state=3;this.O.resolve(a)};l.reject=function(a){this.state=5;this.O.reject(a)};l.state=0;l.cancel=function(){3>this.state&&(this.Dd(),this.Gc().remove(this),this.state=4)};\nae.prototype.cancel=ae.prototype.cancel;function de(a){var b;this.Y={};for(b in ce)this.Y[ce[b]]=[];this.Ba=a;this.Ba.addEventListener(\"allocatable\",Na(this.Lb,this))}r(\"H.util.JobManager\",de);var ee=Object.keys(ce).map(function(a){return ce[a]}).sort().reverse();de.prototype.add=function(a){Ta(a,ae,this.add,0);this.Y[a.priority].push(a);this.Lb()};de.prototype.contains=function(a){return-1<this.Y[a.priority].indexOf(a)};\nde.prototype.remove=function(a){var b=a.priority,c=this.Y[b].indexOf(a);if(-1<c)return this.Y[b].splice(c,1),!0;a.Fb&&this.Ba.sc(a.Fb);return!1};de.prototype.Lb=function(){ee.forEach(function(a){this.Y[a]=this.Y[a].filter(function(b){var c;if((c=this.Ba.Bd(b))!==Qa){var d=Na(this.Ba.sc,this.Ba,c,b);b.Fb=c;b.then(d,d);b.state=b.Ed(c)?1:5}else return!0},this)},this)};function fe(a,b,c){fe.Z.constructor.call(this,a,c);this.message=b}Fa(fe,S);r(\"H.util.ErrorEvent\",fe);function ge(a,b,c){var d=[],e=arguments.length;a&&d.push(bb(a));1<e&&(e=2<e&&Va(c,void 0,void 0,void 0)?\" out of [\"+c[0]+\"...\"+c[1]+\"]\":\"\",d.push(\"(\"+b+e+\")\"));d=Error(d.join(\" \"));Object.setPrototypeOf(d,ge.prototype);return d}Fa(ge,Error);r(\"H.lang.OutOfRangeError\",ge);ge.prototype.name=\"OutOfRangeError\";function he(a,b,c){he.Z.constructor.call(this,a,c);this.data=b}Fa(he,S);r(\"H.util.DataEvent\",he);function ie(a){if(globalThis.document){var b=document.createElement(\"canvas\");b.width=b.height=1;b.getContext(\"2d\",{Fd:a})}}r(\"H.util.getPixelRatio\",function(){return window.devicePixelRatio||1});Object.create(Qa,void 0);r(\"H.util.eval\",function(a){return eval(a)});r(\"H.util.provide\",function(a){var b=p.$jscomp;if(b&&(\"function\"!=typeof b.Dc?0:b.Dc()))throw Error(\"goog.provide cannot be used within a module.\");qa(a,void 0,void 0)});function je(){this.v=0}
938\nje.prototype.next=function(a){if(9007199254740992===this.v)throw new ge(a,this.v,[0,9007199254740991]);return this.v++};var ke=new je;Na(ke.next,ke);var le=Pa([]);Pa({});ie(!0);ie(!1);r(\"H.util.Disposable\",Q);Q.prototype.aa=Q.prototype.aa;Q.prototype.addOnDisposeCallback=Q.prototype.aa;r(\"H.util.dispose\",function(a){a&&\"function\"==typeof a.C&&a.C()});Q.prototype.C=Q.prototype.C;Q.prototype.dispose=Q.prototype.C;Q.prototype.K=Q.prototype.K;Q.prototype.disposeInternal=Q.prototype.K;function me(a,b){b=180/(1<<b);var c=a.lat+90;a=(a.lng+180)%360;var d=0;180==c&&d--;d+=Math.floor(c/b);return[d,0+Math.floor(a/b)]}var ne=1/Math.pow(10,10);function oe(a,b){var c=[],d=a.Nb();a=a.Mb();var e;180==a.lng&&(a.lng-=ne);d=me(d,b);a=me(a,b);for(e=d[0];e>=a[0];e--)for(b=d[1];b<=a[1];b++)c.push(e,b);return c};function pe(a,b,c,d){if(!a||!b||!c)throw new x(pe,t,\"Must specify name, version and revision parameter\");this.name=a;this.version=b;this.revision=c;d&&Ka(this,d)}r(\"H.util.BuildInfo\",pe);pe.prototype.toString=function(){var a,b=[];for(a in this)Xa(this[a])&&b.push(this[a]);return b.join(\";\")};var qe={};function re(a,b,c,d){if(!a)throw new x(re,1,\"Must specify a name parameter\");return qe[a]||(qe[a]=new pe(a,b,c,d))}pe.get=re;function X(a,b,c,d,e,f){if(a&&b)this.Cb(a),this.Ra(b),this.Ab(c),this.Bb(e),this.ac(f),this.Ta(d);else throw new x(X,t,'Parameters \"scheme\" and \"host\" must be specified');}r(\"H.service.Url\",X);\nfunction se(a,b){var c=globalThis.document,d;var e=\"\";if(c){e=c.createElement(\"a\");if(b){var f=(d=c.getElementsByTagName(\"base\")[0])&&d.href;var g=c.head;var h=d||g.appendChild(c.createElement(\"base\"));h.href=b}e.href=a;e=e.href;b&&(d?d.href=f:g.removeChild(h))}else/[\\w]+:\\/\\//.test(a)&&(e=a);f=/(?:(\\w+):\\/\\/)?(?:([^:]+):([^@/]*)@)?([^/:]+)?(?:[:]{1}([0-9]+))?(\\/[^?#]*)?(\\?[^#]+)?(#.*)?/.exec(e);a=f[1];g=f[4];b=f[5];h=f[6];c=f[7];d=f[8];!f[2]&&g&&/@/.test(g)&&(g=g.split(\"@\")[1]);f=X;h=h&&0<h.length?\nh.substr(1):\"\";e={};var k,m;if(c)for(k=/([?&]?([^=&+]+))(=([^&]+))?/g;m=k.exec(c);)e[decodeURIComponent(m[2])]=m[4]?decodeURIComponent(m[4]):void 0;return new f(a,g,h,e,isNaN(+b)?void 0:+b,d&&0<d.length?d.substr(1):\"\")}X.parse=se;X.prototype.clone=function(){var a={},b;for(b in this.A)a[b]=this.A[b];return new X(this.yb,this.Na,this.X,a,this.wa,this.la)};X.prototype.clone=X.prototype.clone;\nX.prototype.Cb=function(a){if(!a||\"string\"!==typeof a)throw new x(this.Cb,0,'The \"scheme\" parameter must be a non-empty string.');this.yb=a;return this};X.prototype.setScheme=X.prototype.Cb;X.prototype.Oc=function(){return this.yb};X.prototype.getScheme=X.prototype.Oc;X.prototype.Ra=function(a){if(!a||\"string\"!==typeof a||\"-\"===a.charAt(0)||\".\"===a.charAt(0)||\".\"===a.charAt(a.length-1))throw new x(this.Ra,0,'The \"host\" parameter is not a valid host name.');this.Na=a;return this};\nX.prototype.setHost=X.prototype.Ra;X.prototype.Fc=function(){return this.Na};X.prototype.getHost=X.prototype.Fc;X.prototype.Ab=function(a){this.X=a||void 0;return this};X.prototype.setPath=X.prototype.Ab;X.prototype.Lc=function(){return this.X};X.prototype.getPath=X.prototype.Lc;X.prototype.Ta=function(a){if(a)if(\"object\"==typeof a)this.A=a;else throw new x(this.Ta,0,'Parameter \"params\" must be an object.');else this.A={};return this};X.prototype.setQuery=X.prototype.Ta;X.prototype.Sc=function(){return!te(this)};\nX.prototype.hasQuery=X.prototype.Sc;X.prototype.getQuery=function(){return this.A};X.prototype.getQuery=X.prototype.getQuery;X.prototype.Bb=function(a){if(void 0===a)this.wa=a;else{var b=Tb(+a<<0,0,65535);if(b!=a)throw new x(this.Bb,0,'Parameter \"port\" must be an integer in range [0...65535]');this.wa=b}return this};X.prototype.setPort=X.prototype.Bb;X.prototype.Mc=function(){return this.wa};X.prototype.getPort=X.prototype.Mc;X.prototype.ac=function(a){this.la=a||void 0;return this};\nX.prototype.setAnchor=X.prototype.ac;X.prototype.Bc=function(){return this.la};X.prototype.getAnchor=X.prototype.Bc;X.prototype.ga=function(a){if(\"object\"!==typeof a)throw new x(this.ga,0,'Parameter \"other\" must be an object.');var b=this.A,c;for(c in a)a.hasOwnProperty(c)&&\"function\"!==typeof a[c]&&(b[c]=a[c]);return this};X.prototype.mergeQuery=X.prototype.ga;
938\nX.prototype.Gb=function(a){if(!a||\"string\"!==typeof a)throw new x(this.Gb,0,'Parameter \"subDomain\" must be a non-empty string');\".\"===a.substr(a.length-1)&&(a=a.substr(0,a.length-1));return this.Ra(a+\".\"+this.Na)};X.prototype.addSubDomain=X.prototype.Gb;X.prototype.Hb=function(a){if(!a||\"string\"!==typeof a)throw new x(this.Hb,0,'Parameter \"subPath\" must be a non-empty string');return this.Ab((this.X?this.X+\"/\":\"\")+a)};X.prototype.addSubPath=X.prototype.Hb;\nX.prototype.toString=function(){return[this.yb+\"://\",this.Na,this.wa?\":\"+this.wa:\"\",this.X||!te(this)||this.la?\"/\":\"\",this.X?encodeURI(this.X):\"\",ue(this),this.la?\"#\"+encodeURIComponent(this.la):\"\"].join(\"\")};X.prototype.toString=X.prototype.toString;function ve(a){return encodeURIComponent(a).replace(/[!'()*]/g,function(b){return\"%\"+b.charCodeAt(0).toString(16)})}\nfunction ue(a){var b=[],c=a.A,d={},e;for(e in c){if(c.hasOwnProperty(e)&&\"function\"!==typeof c[e]){var f=a.A[e];d.$=ve(e);Ta(f,we)?f.Va.forEach(function(g){return function(h){b.push(g.$+\"=\"+ve(h))}}(d)):Ta(f,xe)?b.push(d.$+\"=\"+f.Va.map(function(g){return ve(g)}).join(f.tc)):b.push(void 0===f?d.$:d.$+\"=\"+ve(f))}d={$:d.$}}return 0<b.length?\"?\"+b.join(\"&\"):\"\"}function te(a){var b,c=0;for(b in a.A)if(a.A.hasOwnProperty(b)&&\"function\"!==typeof a.A[b]&&(c++,0<c))break;return!c}\nfunction ye(a,b){if(Va(a,void 0,void 0,void 0))for(var c=0;c<a.length;c++){var d=a[c];if(!Xa(d)&&!$a(d)){var e=\"The Array does not contain only strings and numbers\";break}}else e=\"Not an Array\";if(e)throw new x(b,0,a);return a}function we(a){this.Va=ye(a,we)}X.MultiValueQueryParameter=we;we.prototype.Qc=function(){return this.Va};we.prototype.getValues=we.prototype.Qc;function xe(a,b){this.Va=ye(a,xe);if(!/^[!\\$\\(\\)\\*\\+,;]$/.test(b))throw new x(xe,1,'Invalid delimiter \"'+b+'\"');this.tc=b}\nX.DelimitedQuerySubValues=xe;function Y(){}r(\"H.service.extension.dataView.ITable\",Y);Y.prototype.nb=function(){};Y.prototype.getMeta=Y.prototype.nb;Y.prototype.ob=function(){};Y.prototype.getRowCount=Y.prototype.ob;Y.prototype.Ja=function(){};Y.prototype.getRow=Y.prototype.Ja;Y.prototype.L=function(){};Y.prototype.getColumnNames=Y.prototype.L;Y.prototype.lb=function(){};Y.prototype.getColumn=Y.prototype.lb;Y.prototype.o=function(){};Y.prototype.getCell=Y.prototype.o;Y.prototype.concat=function(){};Y.prototype.concat=Y.prototype.concat;function ze(){}r(\"H.service.extension.dataView.IRow\",ze);ze.prototype.L=function(){};ze.prototype.getColumnNames=ze.prototype.L;ze.prototype.o=function(){};ze.prototype.getCell=ze.prototype.o;ze.prototype.pb=function(){};ze.prototype.getTable=ze.prototype.pb;function Ae(a,b){this.Ca=a;this.nd=b}r(\"H.service.extension.dataView.ObjRow\",Ae);Ae.prototype.L=function(){return this.Ca.L()};Ae.prototype.getColumnNames=Ae.prototype.L;Ae.prototype.o=function(a){return this.Ca.o(this.nd,a)};Ae.prototype.getCell=Ae.prototype.o;Ae.prototype.pb=function(){return this.Ca};Ae.prototype.getTable=Ae.prototype.pb;function Be(){}r(\"H.service.extension.dataView.IColumn\",Be);Be.prototype.o=function(){};Be.prototype.getCell=Be.prototype.o;function Ce(a,b){this.Ca=a;this.qc=b}r(\"H.service.extension.dataView.ObjColumn\",Ce);Ce.prototype.o=function(a){return this.Ca.o(a,this.qc)};Ce.prototype.getCell=Ce.prototype.o;function Z(a,b,c){var d;b=b||(a&&a.length?Object.keys(a[0]):t);this.P=a;if(b)for(this.ca=b,this.ab=a=Object.create(Qa,void 0),d=b.length;d--;)a[b[d]]=!0;c!==t&&(this.ub=c)}r(\"H.service.extension.dataView.ObjTable\",Z);l=Z.prototype;l.ub=t;l.P=t;l.ca=t;l.ab=t;l.nb=function(){return this.ub};Z.prototype.getMeta=Z.prototype.nb;Z.prototype.ob=function(){return this.P?this.P.length:0};Z.prototype.getRowCount=Z.prototype.ob;Z.prototype.Ja=function(a){var b=this.P;return b&&b[a]?new Ae(this,a):t};\nZ.prototype.getRow=Z.prototype.Ja;Z.prototype.L=function(){return this.ca||le};Z.prototype.getColumnNames=Z.prototype.L;Z.prototype.lb=function(a){return this.ab[a]?new Ce(this,a):t};Z.prototype.getColumn=Z.prototype.lb;Z.prototype.o=function(a,b){var c=this.P;return(a=c&&this.ab[b]&&c[a])&&a[b]};Z.prototype.getCell=Z.prototype.o;\nZ.prototype.concat=function(){var a=arguments.length,b,c=this.ca,d=\"\"+this.ca,e=(this.P||[]).slice();for(b=0;b<a;b++){var f=arguments[b];if(!(f instanceof Z))throw new x(this.concat,b);if(f.P){if(c&&\"\"+f.ca!==d)throw new x(this.concat,b,\"Incompatible columns!\");e=e.concat(f.P)}}return new Z(e,this.ca,this.ub)};Z.prototype.concat=Z.prototype.concat;function De(a,b,c,d,e,f){var g,h,k=a.length,m,n;if(k)for(g=[];k--;){var q=a[k];var u=q.length;var I=0;for(m=1;m<u;m++)if(n=Ee(q[m-1],q[m],c,b,d,e)){var K=n[0];var w=n[1];I&&I.S(K)?h.push(w):g.push(h=n);I=w;f&&(m=u,k=0)}}else g=a;return g}r(\"H.math.clipping.clipStrips\",De);\nfunction Ee(a,b,c,d,e,f){var g=a.x;a=-a.y;var h=b.x;b=-b.y;c=-c;f=-f;if(g>h){if(h>e||g<d)return;var k=g;var m=a;g=h;a=b;h=k;b=m;k=1}else if(g>e||h<d)return;if(a>b){if(b>c||a<f)return;var n=1;a=-a;b=-b;m=f;f=-c;c=-m}else if(a>c||b<f)return;if(g<d){if((a+=(d-g)*(b-a)/(h-g))>c)return;g=d}if(a<f){if((g+=(f-a)*(h-g)/(b-a))>e)return;a=f}h>e&&(b=a+(e-g)*(b-a)/(h-g),h=e);b>c&&(h=g+(c-a)*(h-g)/(b-a),b=c);n&&(a=-a,b=-b);return k?[new B(h,-b),new B(g,-a)]:[new B(g,-a),new B(h,-b)]}\nfunction Fe(a,b,c){a=Ge(a,!0);b=Ge(b,!1);var d,e;var f={};var g=d=1;switch(~~(1*(c||0))){case 1:g=d=0;break;case 2:d=0;g=1;break;case 3:d=1,g=0}c=d;var h=g;if(b&&a){b.ma=new He(b.x,b.y,null,Ie(b));
938a.ma=new He(a.x,a.y,null,Ie(a));for(g=b;g.next;g=g.next)if(!g.F)for(d=a;d.next;d=d.next)if(!d.F){var k=Je(g.next);var m=Je(d.next);if(e=Ke(g,k,d,m,f)){e=f.ic;var n=f.jc;var q=f.wd;var u=f.xd;e=new He(q,u,null,null,null,null,!0,0,0,e);Le(e,g,k);k=new He(q,u,null,null,null,null,!0,0,0,n);Le(k,d,m);e.vb=k;\nk.vb=e}}f=Xb(b,Me(a));c&&(f=!f);for(g=b;g;g=g.next)g.F&&(g.qb=f,f=!f);f=Xb(a,Me(b));h&&(f=!f);for(d=a;d.next;d=d.next)d.F&&(d.qb=f,f=!f);Ne(b);for(Ne(a);(a=Oe(b))!=b;){for(c=null;!a.Wa;a=a.vb){for(f=a.qb;;){c=new He(a.x,a.y,c);c.artificial=a.F||a.Rb;a.Wa=1;a=f?a.next:a.B;if(!a)break;if(a.F){a.Wa=1;break}}if(!a)break}c.Vb=I||null;var I=c}return I}}r(\"H.math.clipping.clipPolygon\",Fe);\nfunction He(a,b,c,d,e,f,g,h,k,m){this.x=a;this.y=b;this.next=c||null;this.B=d||null;this.Vb=e||null;this.vb=f||null;this.F=!!g;this.qb=!!h;this.Wa=k||0;this.alpha=m||0;d&&(d.next=this);c&&(c.B=this);this.Rb=!1;this.ma=null}function Je(a){for(;a&&a.F;)a=a.next;return a}function Ie(a){if(a)for(;a.next;)a=a.next;return a}function Oe(a){var b=a;if(b){do b=b.next;while(b!=a&&(!b.F||b.F&&b.Wa))}return b}function Ne(a){var b=Ie(a);b.B.next=a;a.B=b.B}\nfunction Ke(a,b,c,d,e){var f,g=b.x-a.x,h=b.y-a.y;var k=d.x-c.x;var m=d.y-c.y;var n=g*m-h*k;if(!n)return 0;k=((c.x-a.x)*m-(c.y-a.y)*k)/n;n=(h*(c.x-a.x)-g*(c.y-a.y))/n;if(0>k||1<k||0>n||1<n)return 0;0===k?f=a:1===k?f=b:0===n?f=c:1===n&&(f=d);if(f)return f.x+=2.480549651603763E-5,f.y+=7.321997314118067E-5,f.ma&&(f.ma.x=f.x,f.ma.y=f.y),Ke(a,b,c,d,e);e.wd=a.x+k*g;e.xd=a.y+k*h;e.ic=k;e.jc=n;return 1}function Me(a){for(var b=[];a;)b.push(a.x,a.y),a=a.next;return b}\nfunction Le(a,b,c){for(b=b.next;b!==c&&b.alpha<=a.alpha;)b=b.next;a.next=b;a.B=b.B;a.next.B=a;a.B.next=a}function Ge(a,b){for(var c,d=null,e=0,f=a.length;e<f;e++){c=new He(a[e].x,a[e].y,d);c.Rb=b;if(c.next=d)d.B=c;d=c}return d};function Pe(a,b){var c=a.tileSize||256;this.va={};this.$b=se(a.serverUrl);this.Ib=b;this.Zc=a.layerConfigs||[];this.Xb=a.projected;this.bc=c;this.lc=!1!==a.batchTiles;this.Tc=a.horizontalMargin||0;this.ad=a.onlyOutline;this.jd=new G(t,c);this.tb=new G(t,c);this.tb.Aa(22-Math.log(c)/Math.LN2+8)}Fa(Pe,Q);\nPe.prototype.ld=function(a,b,c){var d=this.bc,e=this.Tc,f={x:a*d-e,y:b*d};d={x:(a+1)*d-1+e,y:(b+1)*d-1};e=this.jd;e.Aa(c);f=e.xb(f);d=e.xb(d);return Qe(this,new E(f.lat,f.lng,d.lat,d.lng),this.Zc,{x:a,y:b,z:c})};Pe.prototype.kd=function(a,b,c,d,e){return Qe(this,new E(a,b,c,d),e)};\nfunction Qe(a,b,c,d){var e=Re(c),f=e.length,g={},h,k=a.va,m=[],n=[];for(c=0;c<f;c++){var q=e[c];var u=q.layerId;var I=q.level;g[u]=q.columns;q=oe(b,I);var K=q.length-1;for(h=0;h<K;h+=2){var w=[u,q[h+1],q[h],I].join(\"_\");var F=k[w]||a.Ib.get(w);F||(F=new nd(q[h+1],q[h],I,u),F.key=w,k[w]=F,n.push(F));m.push(F)}}n.length&&(a.lc?Se(a,n):Te(a,n));return Zc(m.map(function(W){var ia=Na(this.xc,this,g[W.ra]),N=Na(this.gd,this,W,d||Ue),Ea=W.then,va=this.wc,wa=W.ra,xa={},v,R=e.length;for(v=0;v<R;v++){var J=\ne[v];if(J.rowFilter){var V=J.layerId;V=V!==t?V:J.layer;xa[V]=Na(J.rowFilter,J.rowFilterContext)}}return Ea.call(W,Na(va,this,wa,xa)).then(N).then(ia)},a))}var Ue={x:0,y:0,z:0};Pe.prototype.wc=function(a,b,c){var d=c.Rows,e=d.length,f,g;if(e&&(f=b[a])){b=new Z(c.Rows);var h=[];for(g=0;g<e;g++){var k=d[g];f(b.Ja(g),a)&&h.push(k)}a={Rows:h};if(c=c.Meta)a.Meta=c}else a=c;return a};\nfunction Te(a,b){function c(k,m,n){n?(delete a.va[k.key],k.reject(n)):Ve(a,k,m)}var d,e=b.length,f=a.$b;for(d=0;d<e;d++){var g=b[d];var h=f.clone().ga({tilex:g.x}).ga({tiley:g.y}).ga({level:g.Sb}).ga({layer:g.ra});new ob(h.toString(),Na(c,null,g),tb)}}function Se(a,b){var c=b.length,d;for(d=0;d<c;d+=15){var e=b.slice(d,d+15);We(a,e)}}\nfunction We(a,b){var c=a.$b.clone(),d=[],e=[],f=[],g=c.getQuery();b.length&&(b.forEach(function(h){d.push(h.x,h.y);e.push(h.Sb);f.push(h.ra)}),g.tilexy=d.join(\",\"),g.layers=f.join(\",\"),g.levels=e.join(\",\"),c.Ta(g),new ob(c.toString(),function(h,k){k?b.forEach(function(m){delete a.va[m.key];m.reject(\"error\")}):Ve(a,b,h)},tb))}\nfunction Ve(a,b,c){var d=b.length,e;if(Va(b,void 0,void 0,void 0)){var f=c.indexOf(\"[\")+1;for(e=0;e<d;e++){var g=c.indexOf(\"]},{\",f+3)+2;g<f&&(g=c.lastIndexOf(\"]}\"));var h=c.substr(f,g-f);f=g+1;Xe(a,b[e],h)}}else Xe(a,b,c)}function Xe(a,b,c){try{var d=c.length;var e=b.key;delete a.va[e];a.Ib.add(e,b,2*d);b.resolve(JSON.parse(c))}catch(f){b.reject(f.message)}}function Ye(a,b,c,d,e){return e?[new B(a,b),new B(c,b),new B(c,d),new B(a,d),new B(a,b)]:[a,b,c,b,c,d,a,d]}\nPe.prototype.gd=function(a,b,c){var d=this.tb.Ob()-b.z,e=this.bc<<d,f=50<<d,g=b.x*e;b=b.y*e;var h=g+e;e=b+e;var k=g-f,m=b-f,n=h+f;f=e+f;var q,u,I=c.Rows,K=I.length,w,F=/^ADAS/.test(a.ra),W=this.tb,ia=this.ad,N,Ea=[],va=[],wa=[],xa=[];for(a=0;a<K;a++){var v=w=I[a];var R=(N=F)?\"HPY\":\"LAT\";var J=N?\"HPX\":\"LON\";var V=N?\"HPZ\":\"ZLEVEL\";if(v[R]){var P=wd(v[R],v[J],v[V],N);v.geometry=P;delete v[R];delete v[J];delete v[V];if(v.INNER_LAT)for(R=v.INNER_LAT.split(\";\"),P=v.INNER_LON.split(\";\"),delete v.INNER_LAT,\ndelete v.INNER_LON,v.interiors=V=[],J=R.length,v=0;v<J;v++)V.push(wd(R[v],P[v],\"\",N))}if(this.Xb){J=w;v=W;P=J.$$projected$$;R=0;if(!P){var aa=J.geometry;N=yd(aa.path,v);w=[N];J.$$projected$$=P={dd:w};J=(V=J.interiors)?V.length:0;w.length+=J;R|=+Ze(w,N,aa.outlineIndices);if(J)for(P.Uc=1,q=0;q<J;q++)aa=V[q],N=yd(aa.path,v),w[1+q]=N,R|=+Ze(w,N,aa.outlineIndices);R&&(P.bd=1+J)}v=P;N=v.dd;w=v.Uc;var mc=v.bd;P=[];R=J=Rb;var Za=V=t;v=N[0];if(1===v.length){var nc=nc||(nc=Ye(g,b,h,e,!1));w=v[0];Wb(w.x,w.y,\nnc)&&P.push($e(v,g,b,d))}else{var Wd=N.length;for(aa=ia?mc:0;aa<Wd&&(ia||!aa||P.length);aa++)if(v=N[aa],aa>=mc){aa===mc&&(R=P.length);var ja=De([v],k,m,n,f,!1);af(ja,g,b,d,P)}else{var Ab=Ab||(Ab=Ye(k,m,n,f,!0));if(aa>=w)if(aa===w&&(J=P.length),Za)for(q=Za.length;q--;){if(ja=bf(Za[q],v),u=ja.length){for(V=V||[];u--;)V.push(q);af(ja,g,b,d,P)}}else ja=bf(Ab,v),af(ja,g,b,d,P);else if(ja=bf(Ab,v),af(ja,g,b,d,P),1<ja.length&&w<Wd)for(Za=[],q=ja.length;q--;)Za[q]=ja[q]}}P.length&&(Ea[a]=P,va[a]=J,wa[a]=\nV,xa[a]=R)}}return{rd:c,pc:Ea,Vc:va,vc:wa,cd:xa}};function Ze(a,b,c){for(var d=c.length,e=0,f,g,h=b.length;e<d;)f=c[e++],g=c[e++],a.push(g-f===h?b:b.slice(f,g));return 0<c.length}function bf(a,b){var c,d=[];if(c=Fe(a,b)){do{a=[];b=c;do a.push(b);while(b=b.next);d.push(a)}while(c=c.Vb)}else Xb(b[0],Yb(a))?d.push(b):Xb(a[0],Yb(b))&&d.push(a);return d}function af(a,b,c,d,e){for(var f=0,g=a.length;f<g;f++)e.push($e(a[f],b,c,d))}\nfunction $e(a,b,c,d){var e,f=a.length,g=new Int32Array(2*f),h=0;for(e=0;e<f;e++){var k=a[e];g[h++]=k.x-b>>d;g[h++]=k.y-c>>d}return g}\nPe.prototype.xc=function(a,b){var c=b.rd,d=b.pc,e=b.Vc,f=b.cd;b=b.vc;for(var g=[],h,k={Rows:g},m,n=a?a.length:0,q=0,u,I=c.Rows,K=I.length,w;q<K;q+=1)if(d[q]||!this.Xb){h={};u=I[q];
938if(n)for(m=0;m<n;m++)u.hasOwnProperty(a[m])&&(h[a[m]]=u[a[m]]);else for(w in u)\"$$projected$$\"!==w&&(h[w]=u[w]);u.geometry&&(h.geometry=u.geometry);m=void 0;var F,W=h,ia=d[q],N=e[q],Ea=b[q],va=f[q],wa=g;if(ia){var xa=ia.length;if(Ea)for(F=N;F--;){if(F){var v={};for(m in W)v[m]=W[m]}else v=W;u=[ia[F]];var R=ub(xa,va)-N;for(h=\n0;h<R;h++)Ea[h]===F&&u.push(ia[N+h]);R=u.length;if(!F)for(h=va;h<xa;h++)u.push(ia[h]);v.$HProjGeometry={paths:u,interiorsIndex:1,outlinesIndex:R};wa.push(v)}else W.$HProjGeometry={paths:ia,interiorsIndex:N,outlinesIndex:va},wa.push(W)}else wa.push(W)}c.Meta&&(k.Meta=c.Meta);return k};Pe.prototype.K=function(){var a,b=this.va;for(a in b)b.hasOwnProperty(a)&&(b[a].reject(\"disposed\"),delete b[a])};Pe.prototype.disposeInternal=Pe.prototype.K;\nfunction Re(a){for(var b=[],c,d=a.length,e=0;e<d;e++){c=Ia(a[e]);if(c.rowFilter&&(c.rowFilter=eval(\"(\"+c.rowFilter+\")\"),!Ua(c.rowFilter)))throw Error(\"Invalid row filter for layer \"+c.layerId);b.push(c)}return b};r(\"H.service.extension.worker.processor\",function(a,b,c){function d(h){e.postMessage(h)}var e=this,f=Ha[a];var g=function(h){e.postError(h.toString())};if(0===b)f||(Ha[a]=new Pe(c,cf)),this.postMessage(void 0);else if(f)switch(b){case 1:try{f.ld.apply(f,c).then(d,g)}catch(h){this.postError(h.message)}break;case 2:try{f.kd.apply(f,c).then(d,g)}catch(h){this.postError(h.message)}break;case 3:f.C();delete Ha[a];Ga()&&cf.ia();break;default:e.postError(\"Unsupported command\")}});\nvar cf=new M(26214400),Ha=Object.create(Qa,void 0);self.addEventListener(\"message\",function(a){a=new nb(a.data);var b=jb[a.Wb];if(b)try{b.apply(a,a.kc)}catch(c){a.postError(c.message)}else a.postError(\"processor_not_found\")});(function(){var a=new nb;var b=function(c,d){mb.apply(a,[c,d,!0])};b(\"0\",kb);b(\"1\",mb);b(\"2\",lb);b(\"3\",sb)})();\n"; 939/**! 940 * The code below uses open source software. Please visit the URL below for an overview of the licenses: 941 * https://sdk.venues.here.com/v3/3.1/HERE_NOTICE 942 */ 943this.H=this.H||{},this.H.venues=function(e){"use strict";function t(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}function n(e,t,n){return t=y(t),function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,i()?Reflect.construct(t,n||[],y(e).constructor):t.apply(e,n))}function r(e,t,n){if(i())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var o=new(e.bind.apply(e,r));return n&&m(o,n.prototype),o}function i(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(i=function(){return!!e})()}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){v(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(){s=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",u=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof m?t:m,a=Object.create(o.prototype),s=new w(r||[]);return i(a,"_invoke",{value:T(e,n,s)}),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var p="suspendedStart",f="suspendedYield",v="executing",g="completed",y={};function m(){}function E(){}function I(){}var _={};c(_,a,(function(){return this}));var b=Object.getPrototypeOf,S=b&&b(b(x([])));S&&S!==n&&r.call(S,a)&&(_=S);var L=I.prototype=m.prototype=Object.create(_);function M(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}
vendor: 4,571 bytes, line 943
943))}function A(e,t){function n(i,o,a,s){var u=d(e[i],e,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==typeof c&&r.call(c,"__await")?t.resolve(c.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(c).then((function(e){l.value=e,a(l)}),(function(e){return n("throw",e,a,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,i){n(e,r,t,i)}))}return o=o?o.then(i,i):i()}})}function T(t,n,r){var i=p;return function(o,a){if(i===v)throw Error("Generator is already running");if(i===g){if("throw"===o)throw a;return{value:e,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var u=O(s,r);if(u){if(u===y)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===p)throw i=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=v;var l=d(t,n,r);if("normal"===l.type){if(i=r.done?g:f,l.arg===y)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(i=g,r.method="throw",r.arg=l.arg)}}}function O(t,n){var r=n.method,i=t.iterator[r];if(i===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,O(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),y;var o=d(i,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,y;var a=o.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,y):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,y)}function N(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function w(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(N,this),this.reset(!0)}function x(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function n(){for(;++i<t.length;)if(r.call(t,i))return n.value=t[i],n.done=!1,n;return n.value=e,n.done=!0,n};return o.next=o}}throw new TypeError(typeof t+" is not iterable")}return E.prototype=I,i(L,"constructor",{value:I,configurable:!0}),i(I,"constructor",{value:E,configurable:!0}),E.displayName=c(I,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===E||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,I):(e.__proto__=I,c(e,l,"GeneratorFunction")),e.prototype=Object.create(L),e},t.awrap=function(e){return{__await:e}},M(A.prototype),c(A.prototype,u,(function(){return this})),t.AsyncIterator=A,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new A(h(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},M(L),c(L,l,"Generator"),c(L,a,(function(){return this})),c(L,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=x,w.prototype={constructor:w,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(k),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function i(r,i){return s.type="throw",s.arg=t,n.next=r,i&&(n.method="next",n.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);
943var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;k(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:x(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),y}},t}function u(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function l(e){return l="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},l(e)}function c(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function h(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){c(o,r,i,a,s,"next",e)}function s(e){c(o,r,i,a,s,"throw",e)}a(void 0)}))}}function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,u(r.key),r)}}function f(e,t,n){return t&&p(e.prototype,t),n&&p(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function v(e,t,n){return(t=u(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&m(e,t)}function y(e){return y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},y(e)}function m(e,t){return m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},m(e,t)}function E(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function I(){return I="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=y(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},I.apply(this,arguments)}function _(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],u=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);u=!0);}catch(e){l=!0,i=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(e,t)||S(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(e){return function(e){if(Array.isArray(e))return L(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||S(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function S(e,t){if(e){if("string"==typeof e)return L(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?L(e,t):void 0}}function L(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}t(".H_l_right .venues-ui__drawings .trigger.button--active .arrow {\n transform: rotate(90deg);\n}\n.H_l_right .venues-ui__drawings .drawings {\n right: 45px;\n left: initial;\n}");var M=function(e){function t(e){var r;return d(this,t),(r=n(this,t)).id=e.id,r.model=e,r}return g(t,H.map.Feature),f(t,[{key:"getData",value:function(){return this.model}},{key:"getAddress",value:function(){return this.model.getInternalAddress()}},{key:"getCenter",value:function(){var e=_(this.model.getCenter(),2),t=e[0],n=e[1];return new H.geo.Point(n,t)}},{key:"getId",value:function(){return this.model.getId()}},{key:"getIdentifier",value:function(){return this.model.getIdentifier()}},{key:"getName",value:function(){return this.model.getDisplayName()}},{key:"toGeoJSON",value:function(){return this.model.toJSON()}},{key:"getLevel",value:function(){return this.getParentEventTarget()}},{key:"getVenue",value:function(){return this.getLevel().getDrawing().getParentEventTarget()}}])}(),A=function(e){function t(e){var r;return d(this,t),(r=n(this,t)).id=e.id,r.model=e,r}return g(t,H.map.Feature),f(t,[{key:"getData",value:function(){return this.model}},{key:"getBoundingBox",value:function(){return r(H.geo.Rect,b(this.model.getBoundingBox()))}},{key:"getCenter",value:function(){var e=_(this.model.getCenter(),2),t=e[0],n=e[1];return new H.geo.Point(n,t)}},{key:"getId",value:function(){return this.model.getId()}},{key:"getIdentifier",value:function(){return this.model.getIdentifier()}},{key:"getName",value:function(){return this.model.getDisplayName()}},{key:"getLevel",value:function(e){return this.getLevels().find((function(t){return t.getIdentifier()===e}))}},{key:"getLevels",value:function(){var e=this.getData().getLevels().map((function(e){return e.getIdentifier()}));return this.getVenue().getLevels().filter((function(t){return-1!==e.indexOf(t.id)}))}},{key:"getMainLevel",value:function(){return this.getLevel(this.model.getMainLevel().getIdentifier())}},{key:"getVenue",value:function(){return this.getParentEventTarget()}}])}(),T=function(e){function t(e){var r;return d(this,t),(r=n(this,t)).id=e.id,r.model=e,r}return g(t,H.map.Feature),f(t,[{key:"getGeometry",value:function(e){return this.getGeometries().find((function(t){return t.getIdentifier()===e}))}},{key:"getGeometries",value:function(){var e=this.getData().getGeometries().map((function(e){return e.getIdentifier()}));return this.getDrawing().getVenue().getGeometries().filter((function(t){return-1!==e.indexOf(t.id)}))}},{key:"getData",value:function(){return this.model}},{key:"getId",value:function(){return this.model.getId()}},{key:"getIdentifier",value:function(){return this.model.getIdentifier()}},{key:"getName",value:function(){return this.model.getDisplayName()}},{key:"getShortName",value:function(){return this.model.getShortName()}},{key:"getZIndex",value:function(){return this.model.getZIndex()}},{key:"isMain",value:function(){return this.model.isMain()}},{key:"getDrawing",value:function(){return this.getParentEventTarget()}},{key:"getVenue",value:function(){return this.getDrawing().getParentEventTarget()}}])}();function O(e,t,n,r){for(var i,o=r,a=n-t>>1,s=n-t,u=e[t],l=e[t+1],c=e[n],h=e[n+1],d=t+3;d<n;d+=3){var p=N(e[d],e[d+1],u,l,c,h);if(p>o)i=d,o=p;else if(p===o){var f=Math.abs(d-a);f<s&&(i=d,s=f)}}o>r&&(i-t>3&&O(e,t,i,r),e[i+2]=o,n-i>3&&O(e,i,n,r))}function N(e,t,n,r,i,o){var a=i-n,s=o-r;if(0!==a||0!==s){var u=((e-n)*a+(t-r)*s)/(a*a+s*s);u>1?(n=i,r=o):u>0&&(n+=a*u,r+=s*u)}return(a=e-n)*a+(s=t-r)*s}function k(e,t,n,r){var i={id:void 0===e?null:e,type:t,geometry:n,tags:r,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(e){var t=e.geometry,n=e.type;if("Point"===n||"MultiPoint"===n||"LineString"===n)w(e,t);else if("Polygon"===n||"MultiLineString"===n)for(var r=0;r<t.length;r++)w(e,t[r]);else if("MultiPolygon"===n)for(r=0;r<t.length;r++)for(var i=0;i<t[r].length;i++)w(e,t[r][i])}(i),i}function w(e,t){for(var n=0;n<t.length;n+=3)e.minX=Math.min(e.minX,t[n]),e.minY=Math.min(e.minY,t[n+1]),e.maxX=Math.max(e.maxX,t[n]),e.maxY=Math.max(e.maxY,t[n+1])}function x(e,t,n,r){if(t.geometry){var i=t.geometry.coordinates,o=t.geometry.type,a=Math.pow(n.tolerance/((1<<n.maxZoom)*n.extent),2),s=[],u=t.i
vendor: 1,255 bytes, line 943
943d;if(n.promoteId?u=t.properties[n.promoteId]:n.generateId&&(u=r||0),"Point"===o)P(i,s);else if("MultiPoint"===o)for(var l=0;l<i.length;l++)P(i[l],s);else if("LineString"===o)C(i,s,a,!1);else if("MultiLineString"===o){if(n.lineMetrics){for(l=0;l<i.length;l++)s=[],C(i[l],s,a,!1),e.push(k(u,"LineString",s,t.properties));return}D(i,s,a,!1)}else if("Polygon"===o)D(i,s,a,!0);else{if("MultiPolygon"!==o){if("GeometryCollection"===o){for(l=0;l<t.geometry.geometries.length;l++)x(e,{id:u,geometry:t.geometry.geometries[l],properties:t.properties},n,r);return}throw new Error("Input data is not a valid GeoJSON object.")}for(l=0;l<i.length;l++){var c=[];D(i[l],c,a,!0),s.push(c)}}e.push(k(u,o,s,t.properties))}}function P(e,t){t.push(j(e[0])),t.push(G(e[1])),t.push(0)}function C(e,t,n,r){for(var i,o,a=0,s=0;s<e.length;s++){var u=j(e[s][0]),l=G(e[s][1]);t.push(u),t.push(l),t.push(0),s>0&&(a+=r?(i*l-u*o)/2:Math.sqrt(Math.pow(u-i,2)+Math.pow(l-o,2))),i=u,o=l}var c=t.length-3;t[2]=1,O(t,0,c,n),t[c+2]=1,t.size=Math.abs(a),t.start=0,t.end=t.size}function D(e,t,n,r){for(var i=0;i<e.length;i++){var o=[];C(e[i],o,n,r),t.push(o)}}function j(e){return e/360+.5}function G(e){var t=Math.sin(e*Math.PI/180),n=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return n<0?0:n>1?1:n}
vendor: 8,109 bytes, line 943
943function R(e,t,n,r,i,o,a,s){if(r/=t,o>=(n/=t)&&a<r)return e;if(a<n||o>=r)return null;for(var u=[],l=0;l<e.length;l++){var c=e[l],h=c.geometry,d=c.type,p=0===i?c.minX:c.minY,f=0===i?c.maxX:c.maxY;if(p>=n&&f<r)u.push(c);else if(!(f<n||p>=r)){var v=[];if("Point"===d||"MultiPoint"===d)V(h,v,n,r,i);else if("LineString"===d)z(h,v,n,r,i,!1,s.lineMetrics);else if("MultiLineString"===d)U(h,v,n,r,i,!1);else if("Polygon"===d)U(h,v,n,r,i,!0);else if("MultiPolygon"===d)for(var g=0;g<h.length;g++){var y=[];U(h[g],y,n,r,i,!0),y.length&&v.push(y)}if(v.length){if(s.lineMetrics&&"LineString"===d){for(g=0;g<v.length;g++)u.push(k(c.id,d,v[g],c.tags));continue}"LineString"!==d&&"MultiLineString"!==d||(1===v.length?(d="LineString",v=v[0]):d="MultiLineString"),"Point"!==d&&"MultiPoint"!==d||(d=3===v.length?"Point":"MultiPoint"),u.push(k(c.id,d,v,c.tags))}}}return u.length?u:null}function V(e,t,n,r,i){for(var o=0;o<e.length;o+=3){var a=e[o+i];a>=n&&a<=r&&(t.push(e[o]),t.push(e[o+1]),t.push(e[o+2]))}}function z(e,t,n,r,i,o,a){for(var s,u,l=B(e),c=0===i?Y:Z,h=e.start,d=0;d<e.length-3;d+=3){var p=e[d],f=e[d+1],v=e[d+2],g=e[d+3],y=e[d+4],m=0===i?p:f,E=0===i?g:y,I=!1;a&&(s=Math.sqrt(Math.pow(p-g,2)+Math.pow(f-y,2))),m<n?E>n&&(u=c(l,p,f,g,y,n),a&&(l.start=h+s*u)):m>r?E<r&&(u=c(l,p,f,g,y,r),a&&(l.start=h+s*u)):F(l,p,f,v),E<n&&m>=n&&(u=c(l,p,f,g,y,n),I=!0),E>r&&m<=r&&(u=c(l,p,f,g,y,r),I=!0),!o&&I&&(a&&(l.end=h+s*u),t.push(l),l=B(e)),a&&(h+=s)}var _=e.length-3;p=e[_],f=e[_+1],v=e[_+2],(m=0===i?p:f)>=n&&m<=r&&F(l,p,f,v),_=l.length-3,o&&_>=3&&(l[_]!==l[0]||l[_+1]!==l[1])&&F(l,l[0],l[1],l[2]),l.length&&t.push(l)}function B(e){var t=[];return t.size=e.size,t.start=e.start,t.end=e.end,t}function U(e,t,n,r,i,o){for(var a=0;a<e.length;a++)z(e[a],t,n,r,i,o,!1)}function F(e,t,n,r){e.push(t),e.push(n),e.push(r)}function Y(e,t,n,r,i,o){var a=(o-t)/(r-t);return e.push(o),e.push(n+(i-n)*a),e.push(1),a}function Z(e,t,n,r,i,o){var a=(o-n)/(i-n);return e.push(t+(r-t)*a),e.push(o),e.push(1),a}function W(e,t){for(var n=[],r=0;r<e.length;r++){var i,o=e[r],a=o.type;if("Point"===a||"MultiPoint"===a||"LineString"===a)i=K(o.geometry,t);else if("MultiLineString"===a||"Polygon"===a){i=[];for(var s=0;s<o.geometry.length;s++)i.push(K(o.geometry[s],t))}else if("MultiPolygon"===a)for(i=[],s=0;s<o.geometry.length;s++){for(var u=[],l=0;l<o.geometry[s].length;l++)u.push(K(o.geometry[s][l],t));i.push(u)}n.push(k(o.id,a,i,o.tags))}return n}function K(e,t){var n=[];n.size=e.size,void 0!==e.start&&(n.start=e.start,n.end=e.end);for(var r=0;r<e.length;r+=3)n.push(e[r]+t,e[r+1],e[r+2]);return n}function J(e,t){if(e.transformed)return e;var n,r,i,o=1<<e.z,a=e.x,s=e.y;for(n=0;n<e.features.length;n++){var u=e.features[n],l=u.geometry,c=u.type;if(u.geometry=[],1===c)for(r=0;r<l.length;r+=2)u.geometry.push(X(l[r],l[r+1],t,o,a,s));else for(r=0;r<l.length;r++){var h=[];for(i=0;i<l[r].length;i+=2)h.push(X(l[r][i],l[r][i+1],t,o,a,s));u.geometry.push(h)}}return e.transformed=!0,e}function X(e,t,n,r,i,o){return[Math.round(n*(e*r-i)),Math.round(n*(t*r-o))]}function Q(e,t,n,r,i){for(var o=t===i.maxZoom?0:i.tolerance/((1<<t)*i.extent),a={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:n,y:r,z:t,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},s=0;s<e.length;s++){a.numFeatures++,q(a,e[s],o,i);var u=e[s].minX,l=e[s].minY,c=e[s].maxX,h=e[s].maxY;u<a.minX&&(a.minX=u),l<a.minY&&(a.minY=l),c>a.maxX&&(a.maxX=c),h>a.maxY&&(a.maxY=h)}return a}function q(e,t,n,r){var i=t.geometry,o=t.type,a=[];if("Point"===o||"MultiPoint"===o)for(var s=0;s<i.length;s+=3)a.push(i[s]),a.push(i[s+1]),e.numPoints++,e.numSimplified++;else if("LineString"===o)$(a,i,e,n,!1,!1);else if("MultiLineString"===o||"Polygon"===o)for(s=0;s<i.length;s++)$(a,i[s],e,n,"Polygon"===o,0===s);else if("MultiPolygon"===o)for(var u=0;u<i.length;u++){var l=i[u];for(s=0;s<l.length;s++)$(a,l[s],e,n,!0,0===s)}if(a.length){var c=t.tags||null;if("LineString"===o&&r.lineMetrics){for(var h in c={},t.tags)c[h]=t.tags[h];c.mapbox_clip_start=i.start/i.size,c.mapbox_clip_end=i.end/i.size}var d={geometry:a,type:"Polygon"===o||"MultiPolygon"===o?3:"LineString"===o||"MultiLineString"===o?2:1,tags:c};null!==t.id&&(d.id=t.id),e.features.push(d)}}function $(e,t,n,r,i,o){var a=r*r;if(r>0&&t.size<(i?a:r))n.numPoints+=t.length/3;else{for(var s=[],u=0;u<t.length;u+=3)(0===r||t[u+2]>a)&&(n.numSimplified++,s.push(t[u]),s.push(t[u+1])),n.numPoints++;i&&function(e,t){for(var n=0,r=0,i=e.length,o=i-2;r<i;o=r,r+=2)n+=(e[r]-e[o])*(e[r+1]+e[o+1]);if(n>0===t)for(r=0,i=e.length;r<i/2;r+=2){var a=e[r],s=e[r+1];e[r]=e[i-2-r],e[r+1]=e[i-1-r],e[i-2-r]=a,e[i-1-r]=s}}(s,o),e.push(s)}}function ee(e,t){var n=(t=this.options=function(e,t){for(var n in t)e[n]=t[n];return e}(Object.create(this.options),t)).debug;if(n&&console.time("preprocess data"),t.maxZoom<0||t.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(t.promoteId&&t.generateId)throw new Error("promoteId and generateId cannot be used together.");var r=function(e,t){var n=[];if("FeatureCollection"===e.type)for(var r=0;r<e.features.length;r++)x(n,e.features[r],t,r);else"Feature"===e.type?x(n,e,t):x(n,{geometry:e},t);return n}(e,t);this.tiles={},this.tileCoords=[],n&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",t.indexMaxZoom,t.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),r=function(e,t){var n=t.buffer/t.extent,r=e,i=R(e,1,-1-n,n,0,-1,2,t),o=R(e,1,1-n,2+n,0,-1,2,t);return(i||o)&&(r=R(e,1,-n,1+n,0,-1,2,t)||[],i&&(r=W(i,1).concat(r)),o&&(r=r.concat(W(o,-1)))),r}(r,t),r.length&&this.splitTile(r,0,0,0),n&&(r.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}function te(e,t,n){return 32*((1<<e)*n+t)+e}ee.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},ee.prototype.splitTile=function(e,t,n,r,i,o,a){for(var s=[e,t,n,r],u=this.options,l=u.debug;s.length;){r=s.pop(),n=s.pop(),t=s.pop(),e=s.pop();var c=1<<t,h=te(t,n,r),d=this.tiles[h];if(!d&&(l>1&&console.time("creation"),d=this.tiles[h]=Q(e,t,n,r,u),this.tileCoords.push({z:t,x:n,y:r}),l)){l>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",t,n,r,d.numFeatures,d.numPoints,d.numSimplified),console.timeEnd("creation"));var p="z"+t;this.stats[p]=(this.stats[p]||0)+1,this.total++}if(d.source=e,i){if(t===u.maxZoom||t===i)continue;var f=1<<i-t;if(n!==Math.floor(o/f)||r!==Math.floor(a/f))continue}else if(t===u.indexMaxZoom||d.numPoints<=u.indexMaxPoints)continue;if(d.source=null,0!==e.length){l>1&&console.time("clipping");var v,g,y,m,E,I,_=.5*u.buffer/u.extent,b=.5-_,S=.5+_,L=1+_;v=g=y=m=null,E=R(e,c,n-_,n+S,0,d.minX,d.maxX,u),I=R(e,c,n+b,n+L,0,d.minX,d.maxX,u),e=null,E&&(v=R(E,c,r-_,r+S,1,d.minY,d.maxY,u),g=R(E,c,r+b,r+L,1,d.minY,d.maxY,u),E=null),I&&(y=R(I,c,r-_,r+S,1,d.minY,d.maxY,u),m=R(I,c,r+b,r+L,1,d.minY,d.maxY,u),I=null),l>1&&console.timeEnd("clipping"),s.push(v||[],t+1,2*n,2*r),s.push(g||[],t+1,2*n,2*r+1),s.push(y||[],t+1,2*n+1,2*r),s.push(m||[],t+1,2*n+1,2*r+1)}}},ee.prototype.getTile=function(e,t,n){var r=this.options,i=r.extent,o=r.debug;if(e<0||e>24)return null;var a=1<<e,s=te(e,t=(t%a+a)%a,n);if(this.tiles[s])return J(this.tiles[s],i);o>1&&console.log("drilling down to z%d-%d-%d",e,t,n);for(var u,l=e,c=t,h=n;!u&&l>0;)l--,c=Math.floor(c/2),h=Math.floor(h/2),u=this.tiles[te(l,c,h)];return u&&u.source?(o>1&&console.log("found parent tile z%d-%d-%d",l,c,h),o>1&&console.time("drilling down"),this.splitTile(u.source,l,c,h,e,t,n),o>1&&console.timeEnd("drilling down"),this.tiles[s]?J(this.tiles[s],i):null):null};var ne="Point",re="Polygon",ie="MultiPoint",oe="MultiLineString",ae="MultiPolygon",se={fillColor:"#e0e0e0",outlineColor:"#829DB4",outlineWidth:1},ue={fill:"#333333",size:13},le={fillColor:"#F2F285",outlineColor:"#0088BF",outlineWidth:1.2},ce=16,he=18,de=24,pe={FOOTPRINT:"FOOTPRINT",ICON:"ICON",TEXT:"TEXT",VECTOR:"VECTOR"},fe=Object.freeze({v1:1,v2:2}
943),ve=1,ge=2,ye=3,me="CW",Ee="CCW",Ie=function(e){var t=function(e){for(var t=0,n=e.length,r=0;r<n-1;r+=1){var i=e[r],o=e[r+1];t+=i[0]*o[1]-o[0]*i[1]}return t+(e[n-1][0]*e[0][1]-e[0][0]*e[n-1][1])}(e);return t>0?me:t<0?Ee:void 0},_e=function(e){for(var t,n=[],r=[],i=0,o=e.coordinates.length;i<o;i+=1){var a=e.coordinates[i],s=Ie(a);null!==s&&(s===(t=t||s)&&r.length&&(n.push(r),r=[]),r.push(a))}return r.length>0&&n.push(r),1===n.length?(e.type=re,e.coordinates=n[0]):n.length>1?(e.type=ae,e.coordinates=n):e=null,e},be=function(e,t,n,r,i){var o,a,s,u,l,c,h=function(e,t,n,r,i){var o=1<<t,a=[];return a[0]=(e[0]/i+n)/o,a[1]=(e[1]/i+r)/o,{x:a[0],y:a[1]}}(e,t,n,r,i);return a=(o=h).x,s=o.y,u=360*(a-.5),l=Math.exp(Math.PI*(.5-s)/.25)-1,c=Math.exp(Math.PI*(.5-s)/.25)+1,[u,180*Math.asin(l/c)/Math.PI]};"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var Se,Le,Me,Ae=(Se=function(e,t){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==l(e)&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){function r(e){return(r="function"==typeof Symbol&&"symbol"==l(Symbol.iterator)?function(e){return l(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":l(e)})(e)}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var o=n(1),a=n(7),s=a.get,u=(a.deepValue,a.isArray),c=function(){function e(t,n){var r=n.location,i=void 0===r?0:r,o=n.distance,a=void 0===o?100:o,u=n.threshold,l=void 0===u?.6:u,c=n.maxPatternLength,h=void 0===c?32:c,d=n.caseSensitive,p=void 0!==d&&d,f=n.tokenSeparator,v=void 0===f?/ +/g:f,g=n.findAllMatches,y=void 0!==g&&g,m=n.minMatchCharLength,E=void 0===m?1:m,I=n.id,_=void 0===I?null:I,b=n.keys,S=void 0===b?[]:b,L=n.shouldSort,M=void 0===L||L,A=n.getFn,T=void 0===A?s:A,O=n.sortFn,N=void 0===O?function(e,t){return e.score-t.score}:O,k=n.tokenize,w=void 0!==k&&k,x=n.matchAllTokens,P=void 0!==x&&x,C=n.includeMatches,D=void 0!==C&&C,j=n.includeScore,G=void 0!==j&&j,R=n.verbose,V=void 0!==R&&R;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.options={location:i,distance:a,threshold:l,maxPatternLength:h,isCaseSensitive:p,tokenSeparator:v,findAllMatches:y,minMatchCharLength:E,id:_,keys:S,includeMatches:D,includeScore:G,shouldSort:M,getFn:T,sortFn:N,verbose:V,tokenize:w,matchAllTokens:P},this.setCollection(t),this._processKeys(S)}var t;return(t=[{key:"setCollection",value:function(e){return this.list=e,e}},{key:"_processKeys",value:function(e){if(this._keyWeights={},this._keyNames=[],e.length&&"string"==typeof e[0])for(var t=0,n=e.length;t<n;t+=1){var r=e[t];this._keyWeights[r]=1,this._keyNames.push(r)}else{for(var i=null,o=null,a=0,s=0,u=e.length;s<u;s+=1){var l=e[s];if(!l.hasOwnProperty("name"))throw new Error('Missing "name" property in key object');var c=l.name;if(this._keyNames.push(c),!l.hasOwnProperty("weight"))throw new Error('Missing "weight" property in key object');var h=l.weight;if(h<0||h>1)throw new Error('"weight" property in key must bein the range of [0, 1)');o=null==o?h:Math.max(o,h),i=null==i?h:Math.min(i,h),this._keyWeights[c]=h,a+=h}if(a>1)throw new Error("Total of weights cannot exceed 1")}}},{key:"search",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{limit:!1};this._log('---------\nSearch pattern: "'.concat(e,'"'));var n=this._prepareSearchers(e),r=n.tokenSearchers,i=n.fullSearcher,o=this._search(r,i);
vendor: 4,656 bytes, line 943
943return this._computeScore(o),this.options.shouldSort&&this._sort(o),t.limit&&"number"==typeof t.limit&&(o=o.slice(0,t.limit)),this._format(o)}},{key:"_prepareSearchers",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=[];if(this.options.tokenize)for(var n=e.split(this.options.tokenSeparator),r=0,i=n.length;r<i;r+=1)t.push(new o(n[r],this.options));return{tokenSearchers:t,fullSearcher:new o(e,this.options)}}},{key:"_search",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=this.list,r={},i=[];if("string"==typeof n[0]){for(var o=0,a=n.length;o<a;o+=1)this._analyze({key:"",value:n[o],record:o,index:o},{resultMap:r,results:i,tokenSearchers:e,fullSearcher:t});return i}for(var s=0,u=n.length;s<u;s+=1)for(var l=n[s],c=0,h=this._keyNames.length;c<h;c+=1){var d=this._keyNames[c];this._analyze({key:d,value:this.options.getFn(l,d),record:l,index:s},{resultMap:r,results:i,tokenSearchers:e,fullSearcher:t})}return i}},{key:"_analyze",value:function(e,t){var n=this,r=e.key,i=e.arrayIndex,o=void 0===i?-1:i,a=e.value,s=e.record,l=e.index,c=t.tokenSearchers,h=void 0===c?[]:c,d=t.fullSearcher,p=t.resultMap,f=void 0===p?{}:p,v=t.results,g=void 0===v?[]:v;!function e(t,i,o,a){if(null!=i)if("string"==typeof i){var s=!1,l=-1,c=0;n._log("\nKey: ".concat(""===r?"--":r));var p=d.search(i);if(n._log('Full text: "'.concat(i,'", score: ').concat(p.score)),n.options.tokenize){for(var v=i.split(n.options.tokenSeparator),y=v.length,m=[],E=0,I=h.length;E<I;E+=1){var _=h[E];n._log('\nPattern: "'.concat(_.pattern,'"'));for(var b=!1,S=0;S<y;S+=1){var L=v[S],M=_.search(L),A={};M.isMatch?(A[L]=M.score,s=!0,b=!0,m.push(M.score)):(A[L]=1,n.options.matchAllTokens||m.push(1)),n._log('Token: "'.concat(L,'", score: ').concat(A[L]))}b&&(c+=1)}l=m[0];for(var T=m.length,O=1;O<T;O+=1)l+=m[O];l/=T,n._log("Token score average:",l)}var N=p.score;l>-1&&(N=(N+l)/2),n._log("Score average:",N);var k=!n.options.tokenize||!n.options.matchAllTokens||c>=h.length;if(n._log("\nCheck Matches: ".concat(k)),(s||p.isMatch)&&k){var w={key:r,arrayIndex:t,value:i,score:N};n.options.includeMatches&&(w.matchedIndices=p.matchedIndices);var x=f[a];x?x.output.push(w):(f[a]={item:o,output:[w]},g.push(f[a]))}}else if(u(i))for(var P=0,C=i.length;P<C;P+=1)e(P,i[P],o,a)}(o,a,s,l)}},{key:"_computeScore",value:function(e){this._log("\n\nComputing score:\n");for(var t=this._keyWeights,n=!!Object.keys(t).length,r=0,i=e.length;r<i;r+=1){for(var o=e[r],a=o.output,s=a.length,u=1,l=0;l<s;l+=1){var c=a[l],h=c.key,d=n?t[h]:1,p=0===c.score&&t&&t[h]>0?Number.EPSILON:c.score;u*=Math.pow(p,d)}o.score=u,this._log(o)}}},{key:"_sort",value:function(e){this._log("\n\nSorting...."),e.sort(this.options.sortFn)}},{key:"_format",value:function(e){var t=[];if(this.options.verbose){var n=[];this._log("\n\nOutput:\n\n",JSON.stringify(e,(function(e,t){if("object"===r(t)&&null!==t){if(-1!==n.indexOf(t))return;n.push(t)}return t}),2)),n=null}var i=[];this.options.includeMatches&&i.push((function(e,t){var n=e.output;t.matches=[];for(var r=0,i=n.length;r<i;r+=1){var o=n[r];if(0!==o.matchedIndices.length){var a={indices:o.matchedIndices,value:o.value};o.key&&(a.key=o.key),o.hasOwnProperty("arrayIndex")&&o.arrayIndex>-1&&(a.arrayIndex=o.arrayIndex),t.matches.push(a)}}})),this.options.includeScore&&i.push((function(e,t){t.score=e.score}));for(var o=0,a=e.length;o<a;o+=1){var s=e[o];if(this.options.id&&(s.item=this.options.getFn(s.item,this.options.id)[0]),i.length){for(var u={item:s.item},l=0,c=i.length;l<c;l+=1)i[l](s,u);t.push(u)}else t.push(s.item)}return t}},{key:"_log",value:function(){var e;this.options.verbose&&(e=console).log.apply(e,arguments)}}])&&i(e.prototype,t),e}();e.exports=c},function(e,t,n){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var i=n(2),o=n(3),a=n(6),s=function(){function e(t,n){var r=n.location,i=void 0===r?0:r,o=n.distance,s=void 0===o?100:o,u=n.threshold,l=void 0===u?.6:u,c=n.maxPatternLength,h=void 0===c?32:c,d=n.isCaseSensitive,p=void 0!==d&&d,f=n.tokenSeparator,v=void 0===f?/ +/g:f,g=n.findAllMatches,y=void 0!==g&&g,m=n.minMatchCharLength,E=void 0===m?1:m,I=n.includeMatches,_=void 0!==I&&I;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.options={location:i,distance:s,threshold:l,maxPatternLength:h,isCaseSensitive:p,tokenSeparator:v,findAllMatches:y,includeMatches:_,minMatchCharLength:E},this.pattern=p?t:t.toLowerCase(),this.pattern.length<=h&&(this.patternAlphabet=
943a(this.pattern))}var t;return(t=[{key:"search",value:function(e){var t=this.options,n=t.isCaseSensitive,r=t.includeMatches;if(n||(e=e.toLowerCase()),this.pattern===e){var a={isMatch:!0,score:0};return r&&(a.matchedIndices=[[0,e.length-1]]),a}var s=this.options,u=s.maxPatternLength,l=s.tokenSeparator;if(this.pattern.length>u)return i(e,this.pattern,l);var c=this.options,h=c.location,d=c.distance,p=c.threshold,f=c.findAllMatches,v=c.minMatchCharLength;return o(e,this.pattern,this.patternAlphabet,{location:h,distance:d,threshold:p,findAllMatches:f,minMatchCharLength:v,includeMatches:r})}}])&&r(e.prototype,t),e}();e.exports=s},function(e,t){var n=/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g;e.exports=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:/ +/g,i=new RegExp(t.replace(n,"\\$&").replace(r,"|")),o=e.match(i),a=!!o,s=[];if(a)for(var u=0,l=o.length;u<l;u+=1){var c=o[u];s.push([e.indexOf(c),c.length-1])}return{score:a?.5:1,isMatch:a,matchedIndices:s}}},function(e,t,n){var r=n(4),i=n(5);e.exports=function(e,t,n,o){for(var a=o.location,s=void 0===a?0:a,u=o.distance,l=void 0===u?100:u,c=o.threshold,h=void 0===c?.6:c,d=o.findAllMatches,p=void 0!==d&&d,f=o.minMatchCharLength,v=void 0===f?1:f,g=o.includeMatches,y=void 0!==g&&g,m=s,E=e.length,I=h,_=e.indexOf(t,m),b=t.length,S=[],L=0;L<E;L+=1)S[L]=0;if(-1!==_){var M=r(t,{errors:0,currentLocation:_,expectedLocation:m,distance:l});if(I=Math.min(M,I),-1!==(_=e.lastIndexOf(t,m+b))){var A=r(t,{errors:0,currentLocation:_,expectedLocation:m,distance:l});I=Math.min(A,I)}}_=-1;for(var T=[],O=1,N=b+E,k=1<<(b<=31?b-1:30),w=0;w<b;w+=1){for(var x=0,P=N;x<P;)r(t,{errors:w,currentLocation:m+P,expectedLocation:m,distance:l})<=I?x=P:N=P,P=Math.floor((N-x)/2+x);N=P;var C=Math.max(1,m-P+1),D=p?E:Math.min(m+P,E)+b,j=Array(D+2);j[D+1]=(1<<w)-1;for(var G=D;G>=C;G-=1){var R=G-1,V=n[e.charAt(R)];if(V&&(S[R]=1),j[G]=(j[G+1]<<1|1)&V,0!==w&&(j[G]|=(T[G+1]|T[G])<<1|1|T[G+1]),j[G]&k&&(O=r(t,{errors:w,currentLocation:R,expectedLocation:m,distance:l}))<=I){if(I=O,(_=R)<=m)break;C=Math.max(1,2*m-_)}}if(r(t,{errors:w+1,currentLocation:m,expectedLocation:m,distance:l})>I)break;T=j}var z={isMatch:_>=0,score:0===O?.001:O};return y&&(z.matchedIndices=i(S,v)),z}},function(e,t){e.exports=function(e,t){var n=t.errors,r=void 0===n?0:n,i=t.currentLocation,o=void 0===i?0:i,a=t.expectedLocation,s=void 0===a?0:a,u=t.distance,l=void 0===u?100:u,c=r/e.length,h=Math.abs(s-o);return l?c+h/l:h?1:c}},function(e,t){e.exports=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=[],r=-1,i=-1,o=0,a=e.length;o<a;o+=1){var s=e[o];s&&-1===r?r=o:s||-1===r||((i=o-1)-r+1>=t&&n.push([r,i]),r=-1)}return e[o-1]&&o-r>=t&&n.push([r,o-1]),n}},function(e,t){e.exports=function(e){for(var t={},n=e.length,r=0;r<n;r+=1)t[e.charAt(r)]=0;for(var i=0;i<n;i+=1)t[e.charAt(i)]|=1<<n-i-1;return t}},function(e,t){var n=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===Object.prototype.toString.call(e)},r=function(e){return null==e?"":function(e){if("string"==typeof e)return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(e)},i=function(e){return"string"==typeof e},o=function(e){return"number"==typeof e};e.exports={get:function(e,t){var a=[];return function e(t,s){if(s){var u=s.indexOf("."),l=s,c=null;-1!==u&&(l=s.slice(0,u),c=s.slice(u+1));var h=t[l];if(null!=h)if(c||!i(h)&&!o(h))if(n(h))for(var d=0,p=h.length;d<p;d+=1)e(h[d],c);else c&&e(h,c);else a.push(r(h))}else a.push(t)}(e,t),a},isArray:n,isString:i,isNum:o,toString:r}}])},Se(Le={exports:{}},Le.exports),Le.exports),Te=(Me=Ae)&&Me.__esModule&&Object.prototype.hasOwnProperty.call(Me,"default")?Me.default:Me;Ae.Fuse;var Oe,Ne=f((function e(t){var n=t.addressList,r=void 0===n?[]:n,i=t.geometries,o=void 0===i?[]:i,a=t.entity,s=void 0===a?null:a,u=t.name,l=void 0===u?"":u,c=t.icon,h=void 0===c?"":c;d(this,e),this.addressList=r,this.geometries=o,this.icon=h,this.entity=s,this.name=l})),ke={keys:[{name:"name",weight:.6},{name:"addressList",weight:.4}],threshold:.2},we=function(){return f((function e(t){d(this,e),this.fuseSearch=null,this.levels_=null,this.searchListEntities_=[],this.searchListIcons_=[],this.searchList_=[],this.venueModel=t,this.init()}),[{key:"init",value:function(){var e=this.venueModel.getGeometries().reduce((function(e,t){var n=e;return n[t.getId()]=t,n}),{});this.initEntityList(this.venueModel.getOccupant()),this.initIconList(e),this.levels_=this.venueModel.getLevels().map((function(e){return{levelId:e.getId(),levelName:e.getName(),drawingId:e.getDrawing().getId(),drawingName:e.getDrawing().getName()}}));var t=[].concat(b(this.searchListEntities_),b(this.searchListIcons_));this.searchList_=t.sort((function(e,t){return e.name.localeCompare(t.name)})),this.fuseSearch_=new Te(this.searchList_,ke)}},{key:"initEntityList",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map((function(e){return e.spaceIds?new Ne({geometries:e.space,addressList:e.spaceIds||[],name:e.properties.name||"",entity:e}):null})).filter((function(e){return null!==e}));this.searchListEntities_=e}},{key:"initIconList",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.searchListIcons_=Object.values(e).filter((function(e){return e.isIcon()})).map((function(e){var t=e.getIcon();return new Ne({geometries:[e],icon:t,name:e.properties.name||""})}))}},{key:"all",value:function(){return this.searchList_}},{key:"allIconTypes",value:function(){var e=this.searchListIcons_.reduce((function(e,t){var n=e;return n[t.name]=t.name,n}),{});return Object.keys(e)}},{key:"find",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return""===e?this.searchList_:this.fuseSearch_.search(e)}}])}(),xe=Object.freeze({SITE:"SITE",IMAGES:"IMAGES",THEME:"THEME"}),Pe={SITE:"indoor.Site",STRUCTURE:"indoor.Structure",OCCUPANT:"indoor.Occupant",SPACE:"indoor.Space",SPACEGROUPS:"indo
943or.SpaceGroups",TOPOLOGY:"Topology",ADDRESS:"Address",LEVEL:"indoor.Level",LEVELCONNECTOR:"indoor.LevelConnector",ENTRANCE:"indoor.Entrance"},Ce="OCCUPANT_NAMES",De="SPACE_NAME",je="INTERNAL_ADDRESS_SHORT",Ge="INTERNAL_ADDRESS",Re="INTERNAL_ADDRESS_LONG",Ve="SPACE_TYPE_NAME",He="SPACE_CATEGORY_NAME",ze="Point",Be="LineString",Ue="Polygon",Fe="MultiPoint",Ye="MultiLineString",Ze="MultiPolygon",We=Object.freeze({STANDARD:"STANDARD",FLATTEN:"FLATTEN",OUTDOOR_MAIN:"OUTDOOR_MAIN",INDOOR_MAIN:"INDOOR_MAIN",NO_OUTDOORS:"NO_OUTDOORS",FLATTEN_INDOOR_MAIN:"FLATTEN_INDOOR_MAIN",FLATTEN_OUTDOOR_COPY:"FLATTEN_OUTDOOR_COPY"}),Ke="9999999999999",Je="icons",Xe="config",Qe="https://interactive.data.api.platform.here.com/interactive/v1/catalogs",qe=Object.freeze({THEME:"THEME",THEME_MAP:"THEME_MAP",PRESETS:"PRESETS",SDK_STRINGS:"SDK_STRINGS",ICON_FILE:"ICON_FILE",INPUT_COLORS:"INPUT_COLORS",BASE_MAP_INFO:"BASE_MAP_INFO",CONFIG_PROFILE:"CONFIG_PROFILE",NAV_THEME:"NAV_THEME",NAV_NAME_THEME:"NAV_NAME_THEME",NAV_PROP_MAP:"NAV_PROP_MAP",NAV_STRINGS:"NAV_STRINGS",NAV_THEME_MAP:"NAV_THEME_MAP",NAV_NAME_THEME_MAP:"NAV_NAME_THEME_MAP",V4_THEME_FAMILY:"V4_THEME_FAMILY",V4_MAPTYPE_THEME:"V4_MAPTYPE_THEME",ICON:"ICON",MARKER:"MARKER",PERMISSIONS:"PERMISSIONS",NAICS_ARRAY:"NAICS_ARRAY",NAICS_MAP:"NAICS_MAP"});Object.freeze(v(v(v(v({},qe.THEME,"themeUrls"),qe.THEME_MAP,"themeMapUrl"),qe.PRESETS,"presetsUrl"),qe.SDK_STRINGS,"stringsUrl")),Object.freeze(v(v(v(v(v({},qe.THEME,"themeOverrides"),qe.THEME_MAP,"themeMapOverrides"),qe.PRESETS,"presetOverrides"),qe.SDK_STRINGS,"stringsOverrides"),qe.INPUT_COLORS,"inputColorOverrides")),Object.freeze(v(v(v(v(v(v({},qe.THEME,["Modern","Standard","Factory","Navteq","TheBase","Westfield_noLabels","Westfield","TDM_noLabel"]),qe.SDK_STRINGS,["Standard","SDK","sdk/standard"]),qe.V4_THEME_FAMILY,["modern","standard"]),qe.V4_MAPTYPE_THEME,["Airport Terminal","Airport","Casino","College Building","College Campus","Convention","General","Hospital","Outdoor","Retail","School Building","School Campus","Shopping Mall","Traffic","Train Station"]),qe.NAV_THEME,["Factory","MapEditor"]),qe.ICON,["Multicolor","Standard","TheBase","Factory"])),Object.freeze((v(v(v(v(v(v(v(v(v(v(Oe={},qe.THEME,"Modern"),qe.THEME_MAP,"Standard"),qe.PRESETS,"Standard"),qe.SDK_STRINGS,"Standard"),qe.ICON_FILE,"Standard"),qe.INPUT_COLORS,"Standard"),qe.BASE_MAP_INFO,"Standard"),qe.CONFIG_PROFILE,"factory"),qe.NAV_THEME,"Factory"),qe.NAV_NAME_THEME,"FactoryName"),v(v(v(v(v(v(v(v(Oe,qe.NAV_PROP_MAP,"Standard"),qe.NAV_STRINGS,"Standard"),qe.NAV_THEME_MAP,"Standard"),qe.NAV_NAME_THEME_MAP,"StandardName"),qe.V4_THEME_FAMILY,"Standard"),qe.V4_MAPTYPE_THEME,"Standard"),qe.ICON,"Multicolor"),qe.MARKER,"Standard")));var $e=Object.freeze({GEO_JSON:"GEO_JSON",V5_MAP:"V5_MAP",V5_NAV:"V5_NAV",V5_INFO:"V5_INFO",KML:"KML",SVG:"SVG",PNG:"PNG"});Object.freeze(v({},$e.GEO_JSON,{COMMUNITY_MAP:"COMMUNITY_MAP",COMMUNITY_ENTITY:"COMMUNITY_ENTITY",PATH_LEVEL_GEOMETRY:"PATH_LEVEL_GEOMETRY",GEOJSON_LEVEL_GEOMETRY:"GEOJSON_LEVEL_GEOMETRY"}));var et=Object.freeze({ACCOUNT_API:"ACCOUNT_API",DEFAULT_COLLECTION:"DEFAULT_COLLECTION",CATALOG_LAYER:"CATALOG_LAYER"}),tt=Object.freeze(v(v(v({},et.ACCOUNT_API,{BASE_URL:"https://account.api.here.com/authorization/v1.1/projects/me"}),et.DEFAULT_COLLECTION,{BASE_URL:"https://config.data.api.platform.here.com/config/v1/catalogs",PARAMS:{CREATED:"created",COLLECTION:"-collection",VERBOSE:"true"}}),et.CATALOG_LAYER,{BASE_URL:"https://interactive.data.api.platform.here.com/interactive/v1/catalogs",MOMDATA_LAYER:"9999999999999",ICON_LAYER:"icons",THEMERULE_LAYER:"config",COLLECTION_LAYER:"layers/9999999999999/search",PARAMS:{FEATURE_TYPE:{KEY:"p.featureType",VALUE:"indoor.Site"}}})),nt=Object.freeze({isIconsEnabled:!0,isMetaEnabled:!0,metaOptions:{},iconOptions:{}}),rt=Object.freeze({GET:"GET",POST:"POST",PUT:"PUT",DELETE:"DELETE",PATCH:"PATCH",OPTIONS:"OPTIONS",HEAD:"HEAD"});function it(){}function ot(){ot.init.call(this)}function at(e){return void 0===e._maxListeners?ot.defaultMaxListeners:e._maxListeners}function st(e,t,n,r){var i,o,a,s;if("function"!=typeof n)throw new TypeError('"listener" argument must be a function');if((o=e._events)?(o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),a=o[t]):(o=e._events=new it,e._eventsCount=0),a){if("function"==typeof a?a=o[t]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),!a.warned&&(i=at(e))&&i>0&&a.length>i){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=a.length,s=u,"function"==typeof console.warn?console.warn(s):console.log(s)}}else a=o[t]=n,++e._eventsCount;return e}function ut(e,t,n){var r=!1;function i(){e.removeListener(t,i),r||(r=!0,n.apply(e,arguments))}return i.listener=n,i}function lt(e){var t=this._events;if(t){var n=t[e];if("function"==typeof n)return 1;if(n)return n.length}return 0}function ct(e,t){for(var n=new Array(t);t--;)n[t]=e[t];return n}it.prototype=Object.create(null),ot.EventEmitter=ot,ot.usingDomains=!1,ot.prototype.domain=void 0,ot.prototype._events=void 0,ot.prototype._maxListeners=void 0,ot.defaultMaxListeners=10,ot.
vendor: 5,240 bytes, line 943
943init=function(){this.domain=null,ot.usingDomains&&undefined.active,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new it,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},ot.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},ot.prototype.getMaxListeners=function(){return at(this)},ot.prototype.emit=function(e){var t,n,r,i,o,a,s,u="error"===e;if(a=this._events)u=u&&null==a.error;else if(!u)return!1;if(s=this.domain,u){if(t=arguments[1],!s){if(t instanceof Error)throw t;var l=new Error('Uncaught, unspecified "error" event. ('+t+")");throw l.context=t,l}return t||(t=new Error('Uncaught, unspecified "error" event')),t.domainEmitter=this,t.domain=s,t.domainThrown=!1,s.emit("error",t),!1}if(!(n=a[e]))return!1;var c="function"==typeof n;switch(r=arguments.length){case 1:!function(e,t,n){if(t)e.call(n);else for(var r=e.length,i=ct(e,r),o=0;o<r;++o)i[o].call(n)}(n,c,this);break;case 2:!function(e,t,n,r){if(t)e.call(n,r);else for(var i=e.length,o=ct(e,i),a=0;a<i;++a)o[a].call(n,r)}(n,c,this,arguments[1]);break;case 3:!function(e,t,n,r,i){if(t)e.call(n,r,i);else for(var o=e.length,a=ct(e,o),s=0;s<o;++s)a[s].call(n,r,i)}(n,c,this,arguments[1],arguments[2]);break;case 4:!function(e,t,n,r,i,o){if(t)e.call(n,r,i,o);else for(var a=e.length,s=ct(e,a),u=0;u<a;++u)s[u].call(n,r,i,o)}(n,c,this,arguments[1],arguments[2],arguments[3]);break;default:for(i=new Array(r-1),o=1;o<r;o++)i[o-1]=arguments[o];!function(e,t,n,r){if(t)e.apply(n,r);else for(var i=e.length,o=ct(e,i),a=0;a<i;++a)o[a].apply(n,r)}(n,c,this,i)}return!0},ot.prototype.addListener=function(e,t){return st(this,e,t,!1)},ot.prototype.on=ot.prototype.addListener,ot.prototype.prependListener=function(e,t){return st(this,e,t,!0)},ot.prototype.once=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.on(e,ut(this,e,t)),this},ot.prototype.prependOnceListener=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.prependListener(e,ut(this,e,t)),this},ot.prototype.removeListener=function(e,t){var n,r,i,o,a;if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');if(!(r=this._events))return this;if(!(n=r[e]))return this;if(n===t||n.listener&&n.listener===t)0==--this._eventsCount?this._events=new it:(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,o=n.length;o-- >0;)if(n[o]===t||n[o].listener&&n[o].listener===t){a=n[o].listener,i=o;break}if(i<0)return this;if(1===n.length){if(n[0]=void 0,0==--this._eventsCount)return this._events=new it,this;delete r[e]}else!function(e,t){for(var n=t,r=n+1,i=e.length;r<i;n+=1,r+=1)e[n]=e[r];e.pop()}(n,i);r.removeListener&&this.emit("removeListener",e,a||t)}return this},ot.prototype.removeAllListeners=function(e){var t,n;if(!(n=this._events))return this;if(!n.removeListener)return 0===arguments.length?(this._events=new it,this._eventsCount=0):n[e]&&(0==--this._eventsCount?this._events=new it:delete n[e]),this;if(0===arguments.length){for(var r,i=Object.keys(n),o=0;o<i.length;++o)"removeListener"!==(r=i[o])&&this.removeAllListeners(r);return this.removeAllListeners("removeListener"),this._events=new it,this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(t)do{this.removeListener(e,t[t.length-1])}while(t[0]);return this},ot.prototype.listeners=function(e){var t,n=this._events;return n&&(t=n[e])?"function"==typeof t?[t.listener||t]:function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(t):[]},ot.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):lt.call(e,t)},ot.prototype.listenerCount=lt,ot.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};var ht="venues-ui-button--active",dt="venues-ui-button",pt="venues-ui__drawings",ft="data-drawing",vt=function(){return f((function e(t,n,r){var i=this;d(this,e),this.clickHandler=r,this.containerDiv=document.createElement("div"),this.containerDiv.setAttribute("class",pt);var o=document.createElement("div");o.setAttribute("class","trigger ".concat(dt));var a=document.createElement("div");a.setAttribute("class","arrow arrow--down"),o.appendChild(a),o.addEventListener("click",(function(){o.classList.toggle(ht),i.containerButtons.classList.toggle("drawings--open")})),this.containerDiv.appendChild(o),this.containerButtons=document.createElement("div"),this.containerButtons.setAttribute("class","drawings"),this.containerDiv.appendChild(this.containerButtons),n&&this.update(n),t.appendChild(this.containerDiv)}),[{key:"drawButton",value:function(e,t,n){var r=this,i=document.createElement("div"),o=Number(n)===Number(e);i.setAttribute("class",o?"".concat(dt," ").concat(ht):dt),i.innerHTML=t,i.setAttribute(ft,e),i.addEventListener("click",(function(){r.switch(e),r.clickHandler(e)})),this.containerButtons.appendChild(i)}},{key:"switch",value:function(e){this.containerButtons.querySelectorAll(".".concat(pt," .").concat(ht)).forEac
943h((function(e){return e.setAttribute("class",dt)}));var t=this.containerButtons.querySelector("[".concat(ft,"='").concat(e,"']"));t&&t.setAttribute("class","".concat(dt," ").concat(ht))}},{key:"update",value:function(e){var t=this;this.containerButtons.innerHTML="";var n=function(e){var t=e.getDrawings();return new Map(t.map((function(e){var t=e.getDisplayName()||e.getName();return[e.getId(),t]})))}(e);n.size>0&&n.forEach((function(n,r){return t.drawButton(r,n,e.getRootDrawing().getId())}))}}])}(),gt="venues-ui-button--active",yt="venues-ui-button",mt="data-level",Et="venues-ui__levels",It=function(){return f((function e(t,n,r,i){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:4;d(this,e),this.clickHandler=i,this.levelButtonCount=o,this.currentScrollIndex=0,this.containerUI=document.createElement("div"),this.containerUI.setAttribute("class","".concat(Et)),this.containerButtons=document.createElement("div"),this.containerButtons.setAttribute("class","levels"),this.containerUI.appendChild(this.containerButtons),n&&this.update(n,r),t.appendChild(this.containerUI)}),[{key:"clear",value:function(){this.containerButtons.innerHTML="",this.buttonScrollUp&&(this.containerUI.removeChild(this.buttonScrollUp),this.buttonScrollUp=null),this.buttonScrollDown&&(this.containerUI.removeChild(this.buttonScrollDown),this.buttonScrollDown=null)}},{key:"drawLevelButton",value:function(e,t){var n=this,r=document.createElement("div");r.innerHTML=t,r.style.fontSize="".concat(Math.max(Math.min(28.8/t.length,11.52),10),"px"),r.style.display="block",r.setAttribute("class",yt),r.setAttribute(mt,e),r.addEventListener("click",(function(){n.switch(e),n.clickHandler(e)})),this.containerButtons.appendChild(r)}},{key:"drawScrollButtons",value:function(){var e=this;this.buttonScrollUp=document.createElement("div"),this.buttonScrollUp.setAttribute("class","".concat(yt," ").concat(yt,"--up"));var t=document.createElement("div");t.setAttribute("class","arrow arrow--up"),this.buttonScrollUp.appendChild(t),this.buttonScrollUp.addEventListener("click",(function(){return e.scroll(1)})),this.containerUI.insertBefore(this.buttonScrollUp,this.containerButtons),this.buttonScrollDown=document.createElement("div"),this.buttonScrollDown.setAttribute("class","".concat(yt," ").concat(yt,"--down"));var n=document.createElement("div");n.setAttribute("class","arrow arrow--down"),this.buttonScrollDown.appendChild(n),this.buttonScrollDown.addEventListener("click",(function(){return e.scroll(-1)})),this.containerUI.appendChild(this.buttonScrollDown)}},{key:"scroll",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=Array.from(this.containerButtons.querySelectorAll(".".concat(yt))).reverse(),n=[];if(e>=0){this.currentScrollIndex=Math.min(this.currentScrollIndex+e,t.length-this.levelButtonCount);var r=Math.min(this.currentScrollIndex,t.length-this.levelButtonCount),i=Math.min(this.currentScrollIndex+this.levelButtonCount,t.length);n=t.slice(r,i)}else if(e<0){this.currentScrollIndex=Math.max(this.currentScrollIndex+e,0);var o=Math.max(0,this.currentScrollIndex),a=Math.min(t.length,this.currentScrollIndex+this.levelButtonCount);n=t.slice(o,a)}t.forEach((function(e){-1!==n.indexOf(e)?e.style.display="block":e.style.display="none"})),this.buttonScrollDown&&(0===this.currentScrollIndex?this.buttonScrollDown.setAttribute("disabled","disabled"):this.buttonScrollDown.removeAttribute("disabled")),this.buttonScrollUp&&(this.currentScrollIndex===t.length-this.levelButtonCount?this.buttonScrollUp.setAttribute("disabled","disabled"):this.buttonScrollUp.removeAttribute("disabled"))}},{key:"switch",value:function(e){this.containerButtons.querySelectorAll(".".concat(gt)).forEach((function(e){return e.setAttribute("class",yt)}));var t=this.containerButtons.querySelector(".".concat(Et," [").concat(mt,"='").concat(e,"']"));if(t){var n=Array.from(this.containerButtons.querySelectorAll(".".concat(yt))).reverse();t.setAttribute("class","".concat(yt," ").concat(gt));var r=n.indexOf(t);(r<this.currentScrollIndex||r>=this.currentScrollIndex+4)&&this.scroll(r-this.currentScrollIndex)}}},{key:"update",value:function(e,t){var n=this,r=function(){return new Map((arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map((function(e){return[e.getZIndex(),e.getShortName()||e.getDisplayName()||e.getName()]})))}(function(e,t){if(t===We.FLATTEN){var n=e.getVenueModel().getLevelMapFlattenedByZIndex_();return Object.values(n).map((function(e){return e[0]}))}return e.getLevels()}(e,t).sort((function(e,t){return t.getZIndex()-e.getZIndex()}))),i=e.getMainLevel().getZIndex();this.clear(),r.forEach((function(e,t){return n.drawLevelButton(t,e)})),r.size>this.levelButtonCount&&(r.size>this.levelButtonCount+1?this.currentScrollIndex=Math.min(Array.from(r).reverse().findIndex((function(e){return e[0]===i})),r.size-this.levelButtonCount):this.currentScrollIndex=0,this.drawScrollButtons(),this.scroll(0)),this.switch(i)}}])}(),_t=function(){return f((function e(t,n){d(this,e),this.baseTheme=t,this.metaInformation=n,this.labelStyleMap={},this.styleMap={},this.setStyleMap()}),[{key:"setStyleMap",value:function(){this.styleMap.ENTRANCE=this.baseTheme.entranceRules.default.styleProperties,this.labelStyleMap.ENTRANCE=this.baseTheme.entranceRules.default.textLabelStyleProperties;for(var e=0,t=Object.entries(this.baseTheme.spaceRules);e<t.length;e++){var n=_(t[e],2),r=n[0],i=n[1],o=i.properties.behavioralAppearance.default.styleProperties,a=i.properties.behavioralAppearance.default.textLabelStyleProperties;if(this.styleMap[r]=o,this.labelStyleMap[r]=a,i.spaceTypes)for(var s=0,u=Object.entries(i.spaceTypes);s<u.length;s++){var l=_(u[s],2),c=l[0],h=l[1],d=h.behavioralAppearance.default.styleProperties,p=h.behavioralAppearance.default.textLabelStyleProperties;this.styleMap["".concat(r,"_").concat(c)]=d&&0!==Object.keys(d)?d:o,this.labelStyleMap["".concat(r,"_").concat(c)]=p&&0!==Object.keys(p)?p:a}}}},{key:"getBaseTheme",value:function(){return this.baseTheme}},{key:"getStyleMap",value:function(){return this.styleMap}},{key:"getGeometryStyle",value:function(e){return this.styleMap&&Object.getOwnPropertyNames(this.styleMap)?this.styleMap[e]:null}},{key:"getLabelStyle",value:function(e){return this.labelStyleMap&&Object.getOwnPropertyNames(this.labelStyleMap)?this.labelStyleMap[e]:null}}],[{key:"getGeometryDefaultStyle",value:function(){return{fill:"#e5e5e5",fillOpacity:1,stroke:"#6c7a89",strokeOpacity:1,strokeWidth:2}}},{key:"getLabelDefaultStyle",value:function(){return{stroke:"#6c7a89",zmin:15}}}])}
vendor: 4,504 bytes, line 943
943(),bt=function(){return f((function e(){d(this,e),this.config=Object.seal({emitEventOnOverrideUpdate:!0}),this.imageCache={},this.releaseSettings_={displayOptions:{},mom:[]},this.theme={}}),[{key:"getMomData",value:function(){return this.releaseSettings_.mom}},{key:"getTheme",value:function(){return this.theme||{}}},{key:"getStyle",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.getTheme(),i=_t.getGeometryDefaultStyle(),o=e.properties.spaceType,a=e.properties.spaceCategory,s=a;return o&&(s="".concat(a,"_").concat(o)),(t=r.getGeometryStyle(s))&&!n||(t=i),{m:t.fill&&t.fill.toLowerCase()||"#fff",w:t.strokeWidth/10||.1,o:t.stroke&&t.stroke.toLowerCase()||"#fff",l:"Dark"}||void 0}},{key:"getLabelStyle",value:function(e){this.getTheme();var t=_t.getLabelDefaultStyle();return{fill:t.stroke,zmin:t.zmin}}}])}(),St=Math.PI/180,Lt=180/Math.PI,Mt=function(){function e(){d(this,e)}return f(e,null,[{key:"toRadians",value:function(e){return e*St}},{key:"toDegrees",value:function(e){return e*Lt}},{key:"getBoundingBox",value:function(t,n){var r=[];switch(t){case ze:r=[n,n];break;case Fe:case Be:r=n;break;case Ye:case Ue:r=n.reduce((function(e,t){return e.concat(t)}),[]);break;case Ze:r=n.reduce((function(e,t){return e.concat(t)}),[]).reduce((function(e,t){return e.concat(t)}),[])}return e.getBoundingBoxVertices(r)}},{key:"getInverseTransform",value:function(e){var t=e[0]*e[3]-e[1]*e[2],n=[e[3]/t,-e[1]/t,-e[2]/t,e[0]/t,0,0];return n[4]=-(n[0]*e[4]+n[2]*e[5]),n[5]=-(n[1]*e[4]+n[3]*e[5]),n}},{key:"applyTransformToPoint",value:function(e,t){return[t[0]*e[0]+t[1]*e[2]+e[4],t[0]*e[1]+t[1]*e[3]+e[5]]}},{key:"transformProduct",value:function(e,t){var n=[0,0,0,0,0,0];return n[0]=t[0]*e[0]+t[2]*e[1],n[1]=t[1]*e[0]+t[3]*e[1],n[2]=t[0]*e[2]+t[2]*e[3],n[3]=t[1]*e[2]+t[3]*e[3],n[4]=t[0]*e[4]+t[2]*e[5]+t[4],n[5]=t[1]*e[4]+t[3]*e[5]+t[5],n}},{key:"convertLonLatToMerc",value:function(e){var t=e[0]*St,n=e[1]*St,r=Math.sin(n);return[.5+t/(2*Math.PI),.5-Math.log((1+r)/(1-r))/(4*Math.PI)]}},{key:"convertMercToLatLon",value:function(e){var t=2*Math.PI*(e[0]-.5),n=Math.atan(Math.sinh(2*Math.PI*(.5-e[1])));return[t/St,n/St]}},{key:"getTransformScale",value:function(e){return Math.sqrt(e[0]*e[3]-e[1]*e[2])}},{key:"getLonLatToMercTransform",value:function(t){var n=[1/360,0,0,-1/(360*Math.cos(t[1]*St)),0,0],r=e.applyTransformToPoint(n,t),i=e.convertLonLatToMerc(t);return n[4]=i[0]-r[0],n[5]=i[1]-r[1],n}},{key:"getNatToMercTransform",value:function(t){var n=[t[4],t[5]],r=e.getLonLatToMercTransform(n);return e.transformProduct(t,r)}},{key:"convertMxMy2LonLat",value:function(t,n){return t.length&&n.length?e.applyTransformToPoint(t,n):[]}},{key:"convertLonLat2MxMy",value:function(t,n){if(!t.length||!n.length)return[];var r=e.getInverseTransform(t);return e.applyTransformToPoint(r,n)}},{key:"getFlattenedQuadraticBezierCurve",value:function(e,t,n){var r=[],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10;i<1&&(i=6);for(var o=0;o<=i;o+=1){var a=o/i,s=(1-a)*(1-a),u=2*a*(1-a),l=a*a,c=s*e[0]+u*t[0]+l*n[0],h=s*e[1]+u*t[1]+l*n[1];r.push([c,h])}return r}},{key:"getFlattenedCubicBezierCurve",value:function(e,t,n,r){var i=[],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:10;o<1&&(o=6);for(var a=0;a<=o;a+=1){var s=a/o,u=(1-s)*(1-s)*(1-s),l=3*s*(1-s)*(1-s),c=3*s*s*(1-s),h=s*s*s,d=u*e[0]+l*t[0]+c*n[0]+h*r[0],p=u*e[1]+l*t[1]+c*n[1]+h*r[1];i.push([d,p])}return i}},{key:"getRectangularCoordinatesOfLabelArea",value:function(t,n){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=_(t,6),o=i[0],a=i[1],s=i[2],u=i[3],l=i[5],c=e.getDeltaLonLatForMeterAtGivenLonLat(o,a),h=t[4];return r?(l&&(h*=-1),null!=n&&(h=(h+=n<0?2*Math.PI+n:n)<0?2*Math.PI+h:h)):h=0,e.getRectVerticesFromSignatureRectRepresentation([o,a],{xLength:s,yLength:u},h,c)}},{key:"getRotatedPoint",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[0,0],i=Math.cos(t),o=Math.sin(t),a=e[0]-r[0],s=e[1]-r[1],u=[];return[(u=n?[a*i+s*o,s*i-a*o]:[a*i-s*o,s*i+a*o])[0]+r[0],u[1]+r[1]]}},{key:"getRectVerticesFromSignatureRectRepresentation",value:function(t,n,r,i){var o=n.xLength,a=n.yLength,s=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],u=_(t,2),l=u[0],c=u[1],h=o/2,H=a/2,d=_(i,2),p=d[0],f=d[1];return[[1,1],[-1,1],[-1,-1],[1,-1]].map((function(e){return[e[0]*h,e[1]*H]})).map((function(t){return e.getRotatedPoint(t,r,s)})).map((function(e){return[e[0]*p,e[1]*f]}
943)).map((function(e){return[e[0]+l,e[1]+c]}))}},{key:"getScaleFactorForRectInSpace",value:function(e,t,n,r){var i=e/n,o=t/r;return i>o?o:i}},{key:"getDeltaLonLatForMeterAtGivenLonLat",value:function(e,t){var n=6371e3;return[1/n*(180/Math.PI)/Math.cos(t*Math.PI/180),1/n*(180/Math.PI)]}},{key:"getBoundingBoxVertices",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY],[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY]];return e.reduce((function(e,t){return[[Math.min(t[0],e[0][0]),Math.min(t[1],e[0][1])],[Math.max(t[0],e[1][0]),Math.max(t[1],e[1][1])]]}),t)}},{key:"isPointInBoundingBox",value:function(e,t){if(e&&t){var n=_(e,2),r=n[0],i=n[1],o=_(t,2),a=_(o[0],2),s=a[0],u=a[1],l=_(o[1],2),c=l[0],h=l[1];return r<=c&&r>=s&&i<=h&&i>=u}}},{key:"isPointOnLineSegment",value:function(e,t,n){var r=_(e,2),i=r[0],o=r[1],a=_(t,2),s=a[0],u=a[1],l=_(n,2),c=l[0],h=l[1],d=(u-o)*(h-o)<=0;return s===c?s===i&&d:!(o-h!=(h-u)/(c-s)*(i-c)||!d)}},{key:"rayIntersectLineSegment",value:function(e,t,n){var r=_(e,2),i=r[0],o=r[1],a=_(t,2),s=a[0],u=a[1],l=_(n,2),c=l[0],h=l[1];if(s===c)return!1;var d=(i-s)/(c-s);return d>=0&&d<1&&(h-u)*d+u>o}},{key:"isPointInPolygon",value:function(t,n){var r=_(t,2),i=r[0],o=r[1],a=n.length;if(a<3)return!1;var s=0,u=n[a-1];return n.forEach((function(t){e.rayIntersectLineSegment([i,o],u,t)&&(s+=1),u=t})),s%2!=0}},{key:"isPointOnLineString",value:function(t,n){var r=_(t,2),i=r[0],o=r[1],a=n.length;if(a<2)return!1;for(var s=n[a-1],u=0;u<a;u+=1){var l=n[u];if(e.isPointOnLineSegment([i,o],s,l))return!0;s=n[u]}return!1}},{key:"getAreaOfPolygon",value:function(e){var t=e.length;if(t<3)return null;var n=0,r=e[t-1];return e.forEach((function(e){var t,i,o,a,s,u;n+=.5*(t=e,i=_(r,2),o=i[0],a=i[1],s=_(t,2),u=s[0],o*s[1]-a*u),r=e})),n}},{key:"getDistanceBetweenPoints",value:function(e,t){var n=_(e,2),r=n[0],i=n[1],o=_(t,2),a=r-o[0],s=i-o[1];return Math.sqrt(a*a+s*s)}}])}(),At=function(){return f((function e(){d(this,e),this.spaceRules={}}),null,[{key:"getDataEntriesOne",value:function(e,t){var n=[e,""];if(null!==t&&Array.isArray(t))n[1]=t.toString();else if(null!==t&&"object"===l(t)){var r=Object.entries(t);if(r.length>0){var i=this.getDataEntriesOne(r[0][0],r[0][1]);n[0]="".concat(n[0],".").concat(i[0]),n[1]=i[1]}}else n[1]=t;return n}},{key:"getDataEntriesAll",value:function(e){for(var t=[],n=0,r=Object.entries(e);n<r.length;n++){var i=_(r[n],2),o=i[0],a=i[1],s=this.getDataEntriesOne(o,a);t.push(s)}return t}},{key:"doFindComboMatch",value:function(e,t){var n="";if(e&&e.configuration&&e.configuration.combinations)for(var r=this.getDataEntriesAll(t),i=Object.entries(e.configuration.combinations),o=0,a=function(){var e=u[s],t=Object.keys(e[1]).filter((function(t){return r.some((function(n){return t===n[0]&&e[1][t]===n[1]}))}));t.length===Object.keys(e[1]).length&&t.length>o&&(n=e[0],o=t.length)},s=0,u=i;s<u.length;s++)a();return n}},{key:"getIconFromCombinations",value:function(e,t){if(e&&e.configuration.combinations&&t&&Object.keys(t).length>0&&e.behavioralAppearance.combinations&&Object.keys(e.behavioralAppearance.combinations).length>0){var n=this.doFindComboMatch(e,t);if(""===n||!e.behavioralAppearance.combinations[n].labelIcon)return"";if(e.behavioralAppearance.combinations&&e.behavioralAppearance.combinations[n]&&e.behavioralAppearance.combinations[n].labelIcon)return e.behavioralAppearance.combinations[n].labelIcon.referenceUri}return""}},{key:"findSpace",value:function(e,t){if(t.spaceTypes&&t.spaceTypes[e])return t.spaceTypes[e]}},{key:"findCategory",value:function(e){if(this.spaceRules[e])return this.spaceRules[e]}},{key:"setSpaceRules",value:function(e){this.spaceRules=e}},{key:"getSpaceIcon",value:function(e,t,n){var r="",i=this.findCategory(t);if(i){var o=this.findSpace(e,i);if(o){var a="";n&&(a=this.getIconFromCombinations(o,n)),a&&""!==a?r=a:o.behavioralAppearance.default.labelIcon?r=o.behavioralAppearance.default.labelIcon.referenceUri:i.properties.behavioralAppearance.default.labelIcon&&(r=i.properties.behavioralAppearance.default.labelIcon.referenceUri)}}return r}}])}(),Tt=function(){return f((function e(){d(this,e)}),null,[{key:"getFormattedIndoorMapId",value:function(e){var t=/^\d{5}$/.test(e),n="string"==typeof e&&e.includes("indoormap");return t||!n?"indoormap-00000000-0000-4000-a000-".concat(e.toString().padStart(12,"0")):e}},{key:"validateIsMicelloId",value:function(e){return new RegExp(/^indoormap-00000000-0000-4000-[a-f]000-[0-9]{12}$/).test(e)}}])}(),Ot=function(){return f((function e(){d(this,e),this.themeRule={},this.svgList={},this.defaultLang="ENG"}),null,[{key:"getNumberFromAlphaNumeric",value:function(e){try{var t=e.split("").reverse().join("").replace(/[^0-9]/g,"").substr(0,6);return parseInt(t,10)}catch(e){return null}}},{key:"extractNumFromSting",value:function(e){try{var t=e.replace(/[^0-9]/g,"");return parseInt(t,10)}
943catch(t){return console.warn("Exception in converting string to Id"),this.getNumberFromAlphaNumeric(e)}}},{key:"getVenueId",value:function(e){if("number"!=typeof e){var t=e.substr(e.length-6);return parseInt(t,10)}return e}},{key:"setSite",value:function(e,t){var n=this.getName(e),r={id:Tt.getFormattedIndoorMapId(t),location:e.referencePoint,properties:a({},e.properties),geometry:e.geometry,identifier:this.getVenueId(t),obj_type:"CommunityMap"},i=e.properties.indoorSiteMetadata,o=void 0===i?{}:i;return o.legacyVersion&&o.legacyVersion.mapVersion&&(r.map_version=o.legacyVersion.mapVersion),r.properties.name=n,r.properties.display_name=n,r}},{key:"setEntrance",value:function(e){var t=this.themeRule.entranceRules.default.labelIcon.referenceUri,n=this.extractNumFromSting(e.id),r=this.getName(e),i=e.properties;return i.icon=!0,i.svg=this.svgList[t.toLowerCase()],i.name=r||"entrance",i.display_name=r||"entrance",i.level={id:e.properties.level.id},{id:e.id,levelId:e.properties.level.id,momType:Pe.ENTRANCE,geometry:e.geometry,location:e.geometry,properties:i,identifier:n,label_area:[e.referencePoint.coordinates[0],e.referencePoint.coordinates[1],50,50,180]}}},{key:"setStructure",value:function(e){var t=this.extractNumFromSting(e.id),n=this.getName(e),r=e.properties;return r.is_root=0===e.properties.drawOrder,r.display_name=n,r.map_type=e.properties.structureType,r.name=n,{id:e.id,obj_type:"Drawing",identifier:t,properties:r}}},{key:"getNameByPriority",value:function(e,t){for(var n=this,r="",i=function(e){return"OFFICIAL"===e.nameType&&e.languageCode&&e.languageCode===n.defaultLang||"OFFICIAL"===e.nameType},o=0;o<e.length;o++){var a=e[o];if(i(a)&&(t&&t===a.nameType||!t)){r=a.name;break}if("ABBREVIATION"===a.nameType&&(t&&t===a.nameType||!t)){r=a.name;break}if("UNCLASSIFIED"===a.nameType&&(t&&t===a.nameType||!t)){r=a.name;break}if(!a.nameType&&a.name){r=a.name;break}}return r}},{key:"getName",value:function(e,t){return e.properties&&e.properties.names?this.getNameByPriority(e.properties.names,t):e.properties.placeProperties&&e.properties.placeProperties&&e.properties.placeProperties.names?this.getNameByPriority(e.properties.placeProperties.names,t):e.properties.locationDetails&&e.properties.locationDetails[0]&&e.properties.locationDetails[0].names?this.getNameByPriority(e.properties.locationDetails[0].names,t):""}},{key:"setLevel",value:function(e){var t=this.extractNumFromSting(e.id),n=e.properties.names,r=e.properties,i=e.geometry;return r["short name"]=this.getNameByPriority(n,n&&1!==n.length?"ABBREVIATION":""),r.name=this.getNameByPriority(n,n&&1!==n.length?"ABBREVIATION":""),{id:e.id,obj_type:"Level",identifier:t,properties:r,geometry:i}}},{key:"setLevelConnector",value:function(e){var t=this.extractNumFromSting(e.id);return{id:e.id,obj_type:"LevelConnector",properties:e.properties,geometry:e.geometry,identifier:t,location:e.geometry}}},{key:"setOccupant",value:function(e){var t=this.getName(e),n=this.extractNumFromSting(e.id),r=e.properties;return r.occupantName=t,r.email=e.properties.placeProperties&&e.properties.placeProperties.contacts&&e.properties.placeProperties.contacts.find((function(e){return"EMAIL"===e.contactType}))&&e.properties.placeProperties.contacts.find((function(e){return"EMAIL"===e.contactType})).value,r.name=t,r.tags=e.properties.attributes&&e.properties.attributes.tags,{geometry:e.geometry,id:e.id,obj_type:"Geometry",properties:r,identifier:n,spaceIds:e.properties.spaces?e.properties.spaces:[],type:"Feature",momType:Pe.OCCUPANT}}},{key:"getIcon",value:function(e){var t=!1,n="";return this.svgList[e]&&(t=!0,n=this.svgList[e]),{icon:t,svg:n}}},{key:"setSpace",value:function(e){var t=At.getSpaceIcon(e.properties.spaceType,e.properties.spaceCategory,e.properties.spaceTypeProperties),n=this.getName(e),r=this.getIcon(t),i=r.icon,o=r.svg,a=this.extractNumFromSting(e.id),s=e.properties.level.id,u=e.properties;u.spaceName=n,u[e.properties.spaceCategory]=e.properties.spaceType,u.spaceType=e.properties.spaceType,u.spaceCategory=e.properties.spaceCategory,u.icon=i,u.svg=o;var l={geometry:e.geometry,id:e.id,levelId:s,label_area:[e.referencePoint.coordinates[0],e.referencePoint.coordinates[1],50,50,
943180],location:e.referencePoint,obj_type:"Geometry",identifier:a,properties:u,momType:Pe.SPACE,type:"Feature"};return e.properties.spaceAddress&&e.properties.spaceAddress.id&&(l.addressId=e.properties.spaceAddress.id),l}},{key:"setSpaceGroups",value:function(e){var t=this.extractNumFromSting(e.id);return{id:e.id,obj_type:"SpaceGroups",properties:e.properties,geometry:e.geometry,location:e.referencePoint,identifier:t}}},{key:"setTopology",value:function(e){var t=this.extractNumFromSting(e.id);return{id:e.id,obj_type:"Topology",properties:e.properties,geometry:e.geometry,identifier:t}}},{key:"setAddress",value:function(e){var t=this.extractNumFromSting(e.id),n=this.getName(e),r=e.properties;return r.addressName=n,r.name=n,{id:e.id,properties:r,obj_type:"Address",identifier:t}}},{key:"manageSvgDimensions",value:function(e){for(var t={},n=0,r=Object.entries(e);n<r.length;n++){var i=_(r[n],2),o=i[0],a=i[1];if("string"==typeof a){var s=-1!==a.indexOf("<g")&&a.indexOf("<g")||a.indexOf("<p"),u=a.indexOf("</s");if(s&&u){var l=a.substring(s-1,u-1);t[o]="<svg width='64' height='64' viewBox='0 0 24 32' fill='none' xmlns='http://www.w3.org/2000/svg'>".concat(l,"</svg>")}}}return t}},{key:"getSiteBoundingBox",value:function(e){if(e){var t=_(Mt.getBoundingBox(e.geometry.type,e.geometry.coordinates),2),n=t[0],r=t[1];if(n)return"".concat(n[0],",").concat(n[1],",").concat(r[0],",").concat(r[1])}return"null, null, null, null"}}])}(),Nt=function(){return f((function e(){d(this,e)}),null,[{key:"get",value:function(e){return fetch(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{method:"GET"}).then((function(t){return t.ok?t.json():Promise.reject(new Error("Call failed for ".concat(e," : ").concat(t.status," ").concat(t.statusText)))}))}},{key:"getConfigUrl",value:function(e,t,n){var r=n.apiKey,i=n.url,o=n.token,a=n.hrn,s={method:"GET",mode:"cors",cache:"default"},u="".concat(i||Qe,"/").concat(a),l="";return t===xe.SITE&&(l="".concat(u,"/layers/").concat(Ke,"/search?p.featureType=indoor.Site&p.indoorMapId='").concat(Tt.getFormattedIndoorMapId(e),"'")),t===xe.IMAGES&&(l="".concat(u,"/layers/").concat(Je,"/features/svg")),t===xe.Theme&&(l="".concat(u,"/layers/").concat(Xe,"/features/indoorMapRules")),o?s.headers={Authorization:"Bearer ".concat(o)}:l=l.concat("".concat(t===xe.SITE?"&":"?","apiKey=").concat(r)),this.get(l,s)}},{key:"getMomData",value:function(e,t){var n=t.apiKey,r=t.url,i=t.token,o=t.hrn,a={method:"GET",mode:"cors",cache:"default"},s="".concat(r||Qe,"/").concat(o),u=e&&e.features&&e.features.find((function(e){return e.momType===Pe.SITE})),l=Ot.getSiteBoundingBox(u),c=[Pe.TOPOLOGY,Pe.LEVELCONNECTOR],h=Object.values(Pe).filter((function(e){return!c.includes(e)})).join(),d="".concat(s,"/layers/").concat(Ke,"/bbox?bbox=").concat(l,"&limit=100000&f.momType=").concat(h);return i?a.headers={Authorization:"Bearer ".concat(i)}:d=d.concat("&apiKey=".concat(n)),{mom:this.get(d,a),site:u}}},{key:"getIndoorMapsCollectionList",value:(e=h(s().mark((function e(t){var n,r,i,o,a,u,l,c,h,d,p;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.token,r=tt[et.DEFAULT_COLLECTION],i=r.PARAMS,o=r.BASE_URL,a=encodeURI("".concat(o,"?sortBy=").concat(i.CREATED,"&verbose=").concat(i.VERBOSE)),u=a,!n){e.next=23;break}return l={method:"GET",headers:{Authorization:"Bearer ".concat(n)}},e.prev=6,e.next=9,this.get(u,l);case 9:if((c=e.sent).results&&0!==c.results.items.length){e.next=12;break}return e.abrupt("return",Promise.reject(new Error("empty catalogs, no result found")));case 12:if(h=c.results.items,d=/^indoormap.*-collection$/,p=h.filter((function(e){return d.test(e.id)})),!(Array.isArray(p)&&p.length<1)){e.next=17;break}return e.abrupt("return",Promise.reject(new Error("No indoormap collections found")));case 17:return e.abrupt("return",p);case 20:return e.prev=20,e.t0=e.catch(6),e.abrupt("return",Promise.reject(new Error("Error while accessing default collection")));case 23:return e.abrupt("return",Promise.reject(new Error("Please provide valid token")));case 24:case"end":return e.stop()}}),e,this,[[6,20]])}))),function(t){return e.apply(this,arguments)})},{key:"getProjectAccountDetails",value:function(e){var t=e.token,n=tt[et.ACCOUNT_API].BASE_URL;if(t){var r={method:"GET",mode:"cors",headers:{Authorization:"Bearer ".concat(t)}};return this.get(n,r)}return Promise.reject(new Error("Please provide valid token"))}},{key:"fetchIndoorMapList",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.hrn,n=e.url,r=tt[et.CATALOG_LAYER],i=r.PARAMS,o=r.COLLECTION_LAYER;if(t){var a=encodeURI("".concat(n||Qe,"/").concat(t,"/").concat(o,"?").concat(i.FEATURE_TYPE.KEY,"=").concat(i.FEATURE_TYPE.VALUE)),s=this.createBaseUrl(a,rt.GET,{},e),u=s.URL,l=s.options;return this.get(u,l)}return Promise.reject(new Error("Please provide valid hrn"))}},{key:"createBaseUrl",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:rt.GET,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=r.token,o=r.apiKey,s=e,u={method:t,mode:"cors"};return i?u.headers=a({Authorization:"Bearer ".concat(i)},n):s=e.concat("&apiKey=".concat(o)),{URL:s,options:u}}}]);// removed by dead control flow 944 var e; }(),kt=function(){function e(){d(this,e)}return f(e,null,[{key:"isPointOnGeoJSONLineString",value:function(e,t){var n=!1;if(t&&t.length>1)for(var r=0,i=0,o=1;o<t.length;o+=1)if(r=t[o-1],i=t[o],Mt.isPointOnLineSegment(e,r,i)){n=!0;break}return n}},{key:"isPointOnGeoJSONMultiLineString",value:function(t,n){for(var r=!1,i=0;i<n.length;i+=1)if(e.isPointOnGeoJSONLineString(t,n[i])){r=!0;break}return r}},{key:"isPointInsideGeoJSONPolygon",value:function(e,t){var n=!1;if(Mt.isPointInPolygon(e,t[0])&&(n=!0),n)for(var r=1;r<t.length;r+=1)if(Mt.isPointInPolygon(e,t[r])){n=!1;break}return n}},{key:"isPointInsideGeoJSONMultiPolygon",value:function(t,n){for(var r=n.length,i=0;i<r;i+=1)if(e.isPointInsideGeoJSONPolygon(t,n[i]))return!0;return!1}},{key:"getGeometriesByLonLat",value:function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=[],i=t.filter((function(t){return Mt.isPointInBoundingBox(e,t.getBoundingBox())})),o=0;o<i.length;o+=1){var a=i[o];if(a.isPointInsideGeometry(e,true)&&(r.push(a),!n))break}return r.sort((function(e,t){return t.getZIndex()-e.getZIndex()}))}}])}(),wt=function(){return f((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;d(this,e),this.id=t.id,this.properties=t.properties||{},this.labelArea=t.label_area||[],this.geometry=t.geometry||{},this.location=t.location||{},this.address=t.address||{},this.level=n,this.zIndex=r,this.spaceId=t.spaceId,this.state_={isHighlighted:!1,highlightedStyle:{}},this.geometryData=t}),[{key:"getId",value:function(){return this.geometryData&&this.geometryData.identifier}},{key:"getIdentifier",value:function(){return this.id}},{key:"getProperties",value:function(){return this.properties}},{key:"getInternalAddress",value:function(){return this.address?this.address.properties&&this.address.properties.name:null}},{key:"getCenter",value:function(){return this.location.coordinates||[]}},{key:"getCoordinates",value:function(){return this.geometry.coordinates||[]}},{key:"getDisplayName",value:function(){return this.properties.display_name||""}},{key:"getName",value:function(){return this.properties.name||""}},{key:"getStyle",value:function(){return this.getMetaInformation_().getStyle(this)}},{key:"getIcon",value:function(){return this.properties.svg}},{key:"getLabelArea",value:function(){return this.labelArea||[]}},{key:"getLabelStyle",value:function(){return this.getMetaInformation_().getLabelStyle(this)||null}},{key:"getLevel",value:function(){return this.level}},{key:"getType",value:function(){return this.geometry.type}},{key:"getZIndex",value:function(){return this.zIndex}},{key:"getBoundingBox",value:function(){var e=this.getType(),t=this.getCoordinates(),n=[];
944switch(e){case ze:n=[t,t];break;case Fe:case Be:n=t;break;case Ye:case Ue:n=t.reduce((function(e,t){return e.concat(t)}),[]);break;case Ze:n=t.reduce((function(e,t){return e.concat(t)}),[]).reduce((function(e,t){return e.concat(t)}),[])}return Mt.getBoundingBoxVertices(n)}},{key:"isIcon",value:function(){return!!this.properties.icon}},{key:"isPointInsideGeometry",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=!1;switch(this.getType()){case ze:t=this.getLabelArea()&&Mt.getRectangularCoordinatesOfLabelArea(this.getLabelArea()),r=Mt.isPointInPolygon(e,t);break;case Fe:break;case Be:r=n&&kt.isPointOnGeoJSONLineString(e,this.getCoordinates());break;case Ye:r=n&&kt.isPointOnGeoJSONMultiLineString(e,this.getCoordinates());break;case Ue:r=kt.isPointInsideGeoJSONPolygon(e,this.getCoordinates());break;case Ze:r=kt.isPointInsideGeoJSONMultiPolygon(e,this.getCoordinates())}return r}},{key:"highlight",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1?arguments[1]:void 0;this.state_.isHighlighted=e,this.state_.highlightedStyle=e?t:{}}},{key:"isHighlighted",value:function(){return Boolean(this.state_.isHighlighted)}},{key:"getHighlightedStyle",value:function(){return this.state_.highlightedStyle||{}}},{key:"toJSON",value:function(){return a({},this.geometry)}},{key:"getMetaInformation_",value:function(){return this.getLevel()?this.getLevel().getDrawing().getVenueModel().metaInformation_:null}}])}(),xt=function(){return f((function e(t,n){var r=this;d(this,e),this.id=t&&t.id,this.properties=t&&t.properties,this.zIndexCount=0,this.geometries=t&&t.features&&Object.values(t.features).reduce((function(e,t){return e[[t.id]]=new wt(t,r,t.properties.drawOrder),e}),{}),this.drawing=n,this.levelData=t}),[{key:"getId",value:function(){return this.levelData&&this.levelData.identifier}},{key:"getIdentifier",value:function(){return this.id}},{key:"getProperties",value:function(){return this.properties}},{key:"getName",value:function(){return this.properties&&this.properties.name||""}},{key:"getDisplayName",value:function(){return this.properties&&this.properties.display_name||""}},{key:"getDrawing",value:function(){return this.drawing}},{key:"getShortName",value:function(){return this.properties&&this.properties["short name"]||""}},{key:"getZIndex",value:function(){return this.properties&&this.properties.zLevel}},{key:"getFeatureCollectionArray",value:function(){return this.getGeometries().map((function(e){return e.toJSON()}))}},{key:"getGeometryById",value:function(e){return this.geometries[e]}},{key:"getGeometries",value:function(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]?this.geometries&&Object.values(this.geometries).sort((function(e,t){return t.getZIndex()-e.getZIndex()})):this.geometries&&Object.values(this.geometries).sort((function(e,t){return e.getZIndex()-t.getZIndex()}))}},{key:"getGeometriesByAddress",value:function(e){return Object.values(this.geometries).filter((function(t){return t.address&&t.address.properties&&t.address.properties.name&&t.address.properties.name===e}))}},{key:"isMain",value:function(){return Boolean(this.properties.isMain)}}])}(),Pt=function(){return f((function e(t){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],o=arguments.length>3?arguments[3]:void 0;d(this,e),this.venueModel=o,this.levels=i.map((function(e){return new xt(e,n)})),this.structure=t,this.id=t&&t.id,this.properties=r}),[{key:"getId",value:function(){return this.structure&&this.structure&&this.structure.identifier}},{key:"getIdentifier",value:function(){return this.id}},{key:"getProperties",value:function(){return this.properties}},{key:"isRoot",value:function(){return Boolean(this.properties.is_root)}},{key:"getDisplayName",value:function(){return this.properties.display_name||""}},{key:"getName",value:function(){return this.properties.name||""}},{key:"getBoundingBox",value:function(){if(this.structure&&this.structure.geometry){var e=_(Mt.getBoundingBox(this.structure.geometry.type,this.structure.geometry.coordinates),2),t=e[0],n=e[1];if(t)return[n[1],t[0],t[1],n[0]]}
944return[null,null,null,null]}},{key:"getCenter",value:function(){return this.structure&&this.structure.location&&this.structure.location.coordinates}},{key:"getGeometryById",value:function(e){return this.getGeometries().find((function(t){return t.getId()===e||t.getIdentifier()===e}))}},{key:"getGeometries",value:function(){return this.levels.flatMap((function(e){return e.getGeometries()}))}},{key:"getLevelById",value:function(e){return this.levels.find((function(t){return t.getId()===e||t.getIdentifier()===e}))}},{key:"getLevelByZIndex",value:function(e){return this.levels.find((function(t){return t.getZIndex()===e}))}},{key:"getLevels",value:function(){return this.levels}},{key:"getMainLevel",value:function(){return this.levels.find((function(e){return e.isMain()}))}},{key:"getVenueModel",value:function(){return this.venueModel}}])}(),Ct=We.STANDARD,Dt=function(){return f((function e(t){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new bt;d(this,e),this.metaInformation_=r,this.momStructure=t,this.id=t&&t.site&&t.site.id,this.location=t&&t.site&&t.site.location||{},this.properties=t&&t.site&&a({},t.site.properties),this.drawings=t&&t.structure&&Object.values(t.structure).map((function(e){var r=t.getStructureWiseGeometry(e.id);return new Pt(e,e.properties,Object.values(r),n)}))}),[{key:"getDisplaySettings",value:function(){return(this.metaInformation_.releaseSettings_?this.metaInformation_.releaseSettings_.displayOptions:"").display||Ct}},{key:"getId",value:function(){return this.momStructure&&this.momStructure.site&&this.momStructure.site.identifier}},{key:"getIdentifier",value:function(){return this.id}},{key:"getName",value:function(){return this.properties.name}},{key:"getBoundingBox",value:function(){if(this.momStructure){var e=_(Mt.getBoundingBox(this.momStructure.site.geometry.type,this.momStructure.site.geometry.coordinates),2),t=e[0],n=e[1];if(t)return[n[1],t[0],t[1],n[0]]}return[null,null,null,null]}},{key:"getCenter",value:function(){return this.location.coordinates}},{key:"getGeometryById",value:function(e){return this.getGeometries().find((function(t){return t.getId()===e||t.getIdentifier()===e}))}},{key:"getGeometries",value:function(){return this.getLevels().sort((function(e,t){return e.getZIndex()-t.getZIndex()})).flatMap((function(e){return e.getGeometries()}))}},{key:"getGeometriesByLonLat",value:function(e){var t=this,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]).map((function(e){return t.getLevelById(e)}));0===r.length&&(r=this.drawings.filter((function(t){var n=t.getBoundingBox();return Mt.isPointInBoundingBox(e,n)})).flatMap((function(e){return e.getLevels()})));return kt.getGeometriesByLonLat(e,r.flatMap((function(e){return e.getGeometries(!0)})),n)}},{key:"getDrawingById",value:function(e){return this.drawings.find((function(t){return t.getId()===e||t.getIdentifier()===e}))}},{key:"getDrawings",value:function(){return this.drawings}},{key:"getRootDrawing",value:function(){return this.drawings.find((function(e){return e.isRoot()}))}},{key:"getLevelById",value:function(e){return this.getLevels().find((function(t){return t.getId()===e||t.getIdentifier()===e}))}},{key:"getLevelsByZIndex",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.getLevels().filter((function(t){return Number(t.getZIndex())===Number(e)}))}},{key:"getLevels",value:function(){return this.drawings.flatMap((function(e){return e.getLevels()}))}},{key:"getMomStructure",value:function(){return this.momStructure}},{key:"getLevelMapFlattenedByZIndex_",value:function(){var e=this.getLevels().reduce((function(e,t){var n=t.getZIndex(),r=e;return r[n]||(r[n]=[]),r[n].push(t),r}),{});return e}},{key:"getOccupant",value:function(){var e=this.momStructure.occupant;return Object.values(e)}}])}(),jt=function(){return f((function e(t){d(this,e),this.theme=t&&t.theme,this.level=t&&t.level,this.site=t&&t.site,this.spaces=t&&t.spaces,this.address=t&&t.address,this.levelConnector=t&&t.levelConnector,this.topology=t&&t.topology,this.entrance=t&&t.entrance,this.occupant=t&&t.occupant,this.structure=t&&t.structure,this.spaceGroups=t&&t.spaceGroups,this.levelWiseGeometry={},this.levelStructureMapping=t&&t.levelStructureMapping,this.outdoorLevelMapping=t&&t.outdoorLevelMapping||{},this.labelTextPreference=t&&t.labelTextPreference||null}),[{key:"setSpaceWithLevel",value:function(){var e=this;
944this.spaces&&Object.values(this.spaces).forEach((function(t){var n="";t.addressId&&(n=e.address&&e.address[t.addressId]&&e.address[t.addressId].properties.addressName);var r=t.properties;r.addressName=n;var i=e.getLabelAsPerPreference(a(a({},t),{},{properties:r})),o=t.properties;o.name=i,o.display_name=i,t.properties.icon&&(o.name=t.id,o.display_name=t.id);var s=t;s.properties=o,s.address=e.address[t.addressId],e.spaces[t.id]=t;var u=t.levelId;e.outdoorLevelMapping[u]&&(u=e.outdoorLevelMapping[u]),e.levelWiseGeometry[u]||(e.levelWiseGeometry[u]={}),e.levelWiseGeometry[u][s.id]=s}))}},{key:"setOccupantWithLevel",value:function(){var e=this;this.occupant&&Object.values(this.occupant).forEach((function(t){if(t.spaceIds&&t.properties.occupantName){var n=[],r=[];t.spaceIds.forEach((function(i){var o=i.id,a=e.spaces[o],s=null;e.spaceGroups&&Object.values(e.spaceGroups).forEach((function(e){e.properties.spaceGroups&&e.properties.spaceGroups&&e.properties.spaceGroups.forEach((function(e){e.mainSpace&&e.mainSpace.id===i.id&&(s=e.spaces.map((function(e){return e.id})))}))}));var u=function(i){var o=!1;e.labelTextPreference&&e.labelTextPreference.length&&(o=-1!==e.labelTextPreference.indexOf("OCCUPANT_NAMES"));var a=null===e.labelTextPreference||o,s=i,u=i.properties;u.name=i.properties.icon||!a?i.properties.name:t.properties.occupantName,u.display_name=i.properties.icon||!a?i.properties.display_name:t.properties.occupantName,u.address=i.address,u.occupantName=t.properties.occupantName;var l=i.levelId;e.outdoorLevelMapping[l]&&(l=e.outdoorLevelMapping[l]),e.levelWiseGeometry[l]||(e.levelWiseGeometry[l]={}),e.levelWiseGeometry[l][i.id]=s,n.push(s),r.push(i.id)};s&&s.length>0&&s.forEach((function(t){u(e.spaces[t])})),a&&u(a)}
944)),e.occupant[t.id]=t,e.occupant[t.id].space=n,e.occupant[t.id].spaceIds=r}}))}},{key:"setEntrance",value:function(){var e=this;this.entrance&&Object.values(this.entrance).forEach((function(t){var n=t.properties.level.id;e.levelWiseGeometry[n]||(e.levelWiseGeometry[t.properties.level.id]={}),e.outdoorLevelMapping[n]&&(n=e.outdoorLevelMapping[n]),e.levelWiseGeometry[n][t.id]=t}))}},{key:"setLevelWiseGeometry",value:function(){var e=this;this.level&&Object.keys(this.level).forEach((function(t){e.levelWiseGeometry[t]={}})),this.setSpaceWithLevel(),this.setOccupantWithLevel(),this.setEntrance()}},{key:"getStructureWiseGeometry",value:function(e){for(var t={},n=0,r=Object.entries(this.levelWiseGeometry);n<r.length;n++){var i=_(r[n],2),o=i[0],a=i[1];e===this.levelStructureMapping[o]&&(t[o]=this.level[o],t[o].features=a)}return t}},{key:"getLabelAsPerPreference",value:function(e){var t=e.properties,n=t.spaceType,r=t.occupantName,i=t.spaceName,o=t.addressName,a=t.spaceCategory,s=v(v(v(v(v(v(v({},Ce,r),De,i),Ve,n?n.charAt(0).toUpperCase()+n.slice(1).toLowerCase():""),He,a?a.charAt(0).toUpperCase()+a.slice(1).toLowerCase():""),je,o),Ge,o),Re,o),u=this.theme.spaceRules,l="",c=a&&n&&u[a]&&u[a].spaceTypes&&u[a].spaceTypes[n].behavioralAppearance.default.labelType;if("NONE"===c){if(!this.labelTextPreference)return"";s[Ve]=""}var h=a&&n&&u[a]&&u[a].properties&&u[a].properties.behavioralAppearance&&u[a].properties.behavioralAppearance.default&&u[a].properties.behavioralAppearance.default.labelType;if(("NONE"===h||void 0===h)&&void 0===c){if(!this.labelTextPreference)return"";s[Ve]="",s[He]=""}var d=a&&n&&u[a]&&u[a].properties&&u[a].properties.behavioralAppearance&&u[a].properties.behavioralAppearance.default&&u[a].properties.behavioralAppearance.default.labelTextPreference,p=d&&this.labelTextPreference?this.labelTextPreference:d;if(p)for(var f=0;f<p.length;f++)if(s[p[f]]){l=s[p[f]];break}return l}}])}(),Gt=function(){return f((function e(t){var n=t.apiKey,r=t.baseUrl,i=t.token,o=t.hrn;d(this,e);var a={apiKey:n,url:r,token:i,hrn:o};this.hostOptions_=a,this.momData=[],this.theme={},this.loadOptions={}}),[{key:"setHostOptions",value:function(e){0===Object.keys(e).length||(this.hostOptions_=a(a({},this.hostOptions_),e))}},{key:"getToken",value:function(){return this.hostOptions_.token}},{key:"getHrn",value:function(){return this.hostOptions_.hrn}},{key:"load",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.loadOptions=a(a(a({},nt),n),{},{venueId:e}),this.hostOptions_.mapData=n.mapData,this.hostOptions_.themeRule=n.themeRule,this.hostOptions_.svgList=n.svgList,this.hostOptions_.labelTextPreference=n.labelTextPreferenceOverride,this.getHrn()?this.getVenueModalInstance():this.getToken()?this.getDefaultCollectionWithToken().then((function(){return t.getVenueModalInstance()})).catch((function(){return Promise.reject(new Error("Unable to find indoor map collection. Please contact your administrator"))})):Promise.reject(new Error("In order to load indoor map, Please provide either hrn or token"))}},{key:"getVenueModalInstance",value:function(){var e=this;return Promise.resolve().then((function(){return e.loadOptions.isMetaEnabled?e.getMeta_(e.loadOptions.isIconsEnabled).catch((function(e){return console.warn(e),Promise.resolve()})):Promise.reject()})).then((function(t){return e.getVenue_(t)})).then((function(e){return e})).catch((function(e){console.debug("Captured event VENUE_ERROR_STATE",e)}))}},{key:"createMomStructure",value:function(){var e=this,t={site:{},structure:{},level:{},levelConnector:{},occupant:{},spaces:{},spaceGroups:{},topology:{},address:{},outdoorLevelMapping:{},entrance:{},levelStructureMapping:{}};return this.momData.forEach((function(n){var r=Tt.getFormattedIndoorMapId(e.loadOptions.venueId),i=n.id;(n.momType===Pe.ADDRESS||e.hostOptions_.mapData||n.properties.indoorMapId==e.loadOptions.venueId||n.properties.indoorMapId===r)&&(n.momType===Pe.SITE?t.site=Ot.setSite(n,e.loadOptions.venueId):n.momType===Pe.STRUCTURE?t.structure[i]=Ot.setStructure(n):n.momType!==Pe.LEVEL||n.properties.isOutdoor&&(!n.properties.isOutdoor||n.properties.parentIndoorLevel)?n.momType===Pe.LEVEL&&n.properties.isOutdoor&&n.properties.parentIndoorLevel?t.outdoorLevelMapping[n.id]=n.properties.parentIndoorLevel.
944id:n.momType===Pe.ENTRANCE?t.entrance[i]=Ot.setEntrance(n):n.momType===Pe.OCCUPANT?t.occupant[i]=Ot.setOccupant(n):n.momType===Pe.SPACE?t.spaces[i]=Ot.setSpace(n):n.momType===Pe.SPACEGROUPS?t.spaceGroups[i]=Ot.setSpaceGroups(n):n.momType===Pe.ADDRESS&&(t.address[i]=Ot.setAddress(n)):(t.level[i]=Ot.setLevel(n),t.levelStructureMapping[i]=n.properties.structure.id))})),t.theme=this.theme,t.labelTextPreference=this.hostOptions_.labelTextPreference,new jt(t)}},{key:"getVenue_",value:function(e){this.momData=e.getMomData();var t=this.createMomStructure();return t.setLevelWiseGeometry(),new Dt(t,e)}},{key:"setConfigData",value:function(e){var t=e.themeRule,n=e.svgList,r=e.defaultLang;At.setSpaceRules(t.spaceRules),Ot.svgList=n,Ot.themeRule=t,Ot.defaultLang=r,this.theme=t}},{key:"getMeta_",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=new bt,r=this.hostOptions_.mapData?{}:this.getMetaConfig_(this.loadOptions.venueId,xe.SITE),i=this.hostOptions_.themeRule||this.getMetaConfig_(this.loadOptions.venueId,xe.Theme),o=[];return t&&(o=this.hostOptions_.svgList||this.getMetaConfig_(this.loadOptions.venueId,xe.IMAGES)),new Promise((function(a){Promise.all([r,i,o]).then((function(r){var i=_(r,3),o=i[0],s=i[1],u=i[2],l=e.hostOptions_.mapData?{mom:new Promise((function(t){return t(e.hostOptions_.mapData)})),site:e.hostOptions_.mapData.features.find((function(e){return e.momType===Pe.SITE}))}:Nt.getMomData(o,e.hostOptions_);l.mom.then((function(r){var i=s.properties;n.imageCache=t?Ot.manageSvgDimensions(u.properties):[],e.setConfigData({themeRule:i,svgList:n.imageCache,defaultLang:l&&l.site&&l.site.properties.defaultLanguageCode}),n.releaseSettings_={displayOptions:{display:i.entranceRules.default.displayName||We.STANDARD},mom:r.features},n.theme=new _t(i,n),a(n)}))}))}))}},{key:"getMetaConfig_",value:function(e,t){return Nt.getConfigUrl(e,t,this.hostOptions_)}},{key:"fetchCollections",value:function(){return Nt.getIndoorMapsCollectionList(this.hostOptions_)}},{key:"fetchUserProjects",value:function(){return Nt.getProjectAccountDetails(this.hostOptions_)}},{key:"getDefaultCollectionWithToken",value:(e=h(s().mark((function e(){var t=this;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Promise.all([this.fetchCollections(),this.fetchUserProjects()]).then((function(e){var n=_(e,2),r=n[0],i=n[1],o=t.getDefaultCollection(r,i);if(o.hrn){var a={hrn:o.hrn};return t.setHostOptions(a),Promise.resolve()}return Promise.reject()})).catch((function(e){return Promise.reject(e)})));case 1:case"end":return e.stop()}}),e,this)}))),function(){return e.apply(this,arguments)})},{key:"getDefaultCollection",value:function(e,t){if(Array.isArray(e)&&e.length){var n=this.getProjectRealm(t);return e.find((function(e){return e.hrn.includes(n)}))}return Promise.reject(new Error("Error while accessing default collection"))}},{key:"getProjectRealm",value:function(e){if(Array.isArray(e.items)&&e.items.length&&e.items[0].id.includes("indoor-")){var t=e.items[0].hrn;return this.getRealmNameFromHrn(t)}return""}},{key:"getRealmNameFromHrn",value:function(e){if(e){var t=e.split(":");return t.length&&t[4]}return""}},{key:"getSupportedMapList",value:function(){var e=this,t=this.hostOptions_,n=t.hrn,r=t.token;return n?this.fetchMapInfoList():r?this.getDefaultCollectionWithToken().then((function(){return e.fetchMapInfoList()})).catch((function(){return Promise.reject(new Error("Unable to find indoor map collection. Please contact your administrator"))})):Promise.reject(new Error("In order to load map list, Please provide either hrn or token"))}},{key:"fetchMapInfoList",value:function(){var e=this;return Nt.fetchIndoorMapList(this.hostOptions_).then((function(t){var n=t.features;return n.length>0?n.map((function(t){var n=t.properties,r=n.placeProperties,i=n.indoorMapId,o=i;if(Tt.validateIsMicelloId(i)){var a=i.split("-").pop();o=parseInt(a.substring(a.length-Math.min(a.length,5)),10).toString()}return{mapIdentifier:i,mapName:e.getMapName(r.names).name,mapId:o}})):[]})).catch((function(e){Promise.reject(new Error("".concat(e,": Error while fetching map list")))}))}},{key:"getMapName",value:function(e){return Array.isArray(e)&&e.length>0?e.find((function(e){return"OFFICIAL"===e.nameType})):{}}}]);// removed by dead control flow 945 var e; }(),Rt=["origin","destination"],Vt=function(){return f((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(d(this,e),!t.apiKey&&!t.token)throw new Error("API key or Token is missing");this.config_=a({baseUrl:"https://meta-indoor-routing.api-gateway.ls.hereapi.com"},t)}),[{key:"calculateRoute",value:function(e){var t=e.origin,n=void 0===t?{}:t,r=e.destination,i=void 0===r?{}:r,o=E(e,Rt);if(!n.coordinates||!i.coordinates)throw new Error("Waypoint coordinates are missing");var a=function(e){var t=e.coordinates,n=e.venueId,r=e.levelId,i=t.join(",");return n&&r?i.concat(";indoorMapId=",n,";levelId=",r):i},s=new URL("".concat(this.config_.baseUrl,"/v1/routes")),u=new URLSearchParams({origin:a(n),destination:a(i),apiKey:this.config_.apiKey});
945return Object.entries(o).forEach((function(e){var t=_(e,2),n=t[0],r=t[1];u.append(n,"object"===l(r)?JSON.stringify(r):r)})),s.search=u,fetch(s,{headers:{"X-Api-Key":this.config_.apiKey}}).then((function(e){return e.json()}))}}])}(),Ht={VENUE_DATA_LOADED:"VENUE_DATA_LOADED",VENUE_THEME_LOADED:"VENUE_THEME_LOADED",VENUE_ICONS_LOADED:"VENUE_ICONS_LOADED",VENUE_MOM_DATA_LOADED:"VENUE_MOM_DATA_LOADED",VENUE_ERROR_STATE:"VENUE_ERROR_STATE",VENUE_MAP_DATA_LOADED:"VENUE_MAP_DATA_LOADED",VENUE_ENTITY_DATA_LOADED:"VENUE_ENTITY_DATA_LOADED",VENUE_DATA_MODEL_LOADED:"VENUE_DATA_MODEL_LOADED",VENUE_NAV_DATA_LOADED:"VENUE_NAV_DATA_LOADED",META_DATA_LOADED:"META_DATA_LOADED",META_DATA_MODEL_LOADED:"META_DATA_MODEL_LOADED",META_DATA_MODEL_UPDATED:"META_DATA_MODEL_UPDATED"};Object.freeze(v(v(v(v(v(v(v(v(v({},Ht.VENUE_DATA_LOADED,{description:"event fired when all requested files along with metadata & overrides are loaded",emitTemplate:{}}),Ht.VENUE_MAP_DATA_LOADED,{description:"event fired when requested levels, drawings & community files are loaded",emitTemplate:{}}),Ht.VENUE_ENTITY_DATA_LOADED,{description:"event fired when requested entity data is loaded",emitTemplate:{}}),Ht.VENUE_DATA_MODEL_LOADED,{description:"event fired when a map file is loaded",emitTemplate:{}}),Ht.VENUE_NAV_DATA_LOADED,{description:"event fired when requested navigation product is loaded",emitTemplate:{}}),Ht.META_DATA_LOADED,{description:"event fired when all requested meta files are loaded except icon & marker",emitTemplate:{}}),Ht.META_DATA_MODEL_LOADED,{description:"event fired when a specific model is loaded except icon & marker",emitTemplate:{}}),Ht.META_DATA_MODEL_UPDATED,{description:"event fired when a specific meta override is added or removed",emitTemplate:{}}),Ht.VENUE_ICONS_LOADED,{description:"event fired when all icons of venue are loaded",emitTemplate:{}}));var zt=new ot;zt.EVENT_NAME=Ht,zt.on("newListener",(function(e){Ht[e]||console.warn("subscribing for un-registered/documented event")}));var Bt=function(e){function t(e){var r;if(d(this,t),r=n(this,t),!(e instanceof Dt))throw new Error("It is mandatory to provide valid instance of venueModel");return r.venueModel=e,r.search_=new we(e),r.status_={activeDrawingId:e.getRootDrawing().getIdentifier(),activeLevelIndex:e.getRootDrawing().getMainLevel().getZIndex()},r.mapObjectStore_=r.getDefaultMapObjectsStore_(),r.drawings=e.getDrawings().map((function(e){var t=new A(e);return t.setParentEventTarget(r),t})),r.levels=e.getLevels().map((function(e){var t=new T(e);return t.setParentEventTarget(r.drawings.find((function(e){return e.getIdentifier()===t.getData().getDrawing().getIdentifier()}))),t})),r.geometries=e.getGeometries().map((function(e){var t=new M(e);return t.setParentEventTarget(r.levels.find((function(e){return e.getIdentifier()===t.getData().getLevel().getIdentifier()}))),t})),r.mutualExclusiveHighlight_=!1,r}return g(t,H.map.Feature),f(t,[{key:"getData",value:function(){return this.venueModel}},{key:"getBoundingBox",value:function(){return r(H.geo.Rect,b(this.venueModel.getBoundingBox()))}},{key:"getCenter",value:function(){var e=_(this.venueModel.getCenter(),2),t=e[0],n=e[1];return new H.geo.Point(n,t)}},{key:"getId",value:function(){return this.venueModel.getId()}},{key:"getIdentifier",value:function(){return this.venueModel.getIdentifier()}},{key:"getName",value:function(){return this.venueModel.getName()}},{key:"getDrawing",value:function(e){return this.drawings.find((function(t){return t.getIdentifier()===e}))}},{key:"getDrawings",value:function(){return this.drawings}},{key:"getLevel",value:function(e){return this.levels.find((function(t){return t.getIdentifier()===e}))}},{key:"getLevels",value:function(){return this.levels}},{key:"getGeometry",value:function(e){return this.getGeometries().find((function(t){return t.getIdentifier()===e}))}},{key:"getGeometries",value:function(){return this.geometries}},{key:"getActiveLevels",value:function(){var e=this;return this.getData().getDisplaySettings()===We.FLATTEN?this.venueModel.getLevelsByZIndex(this.status_.activeLevelIndex).map((function(t){return e.getLevel(t.getIdentifier())})):[this.venueModel.getDrawingById(this.status_.activeDrawingId).getLevelByZIndex(this.status_.activeLevelIndex)].map((function(t){return e.getLevel(t.getIdentifier())}))}},{key:"getActiveDrawing",value:function(){return this.getDrawing(this.status_.activeDrawingId)}},{key:"setActiveDrawing",value:function(e){if(this.status_.activeDrawingId!==e){var n=this.venueModel.getDrawingById(e);if(!n)throw new Error("Drawing ".concat(e," was not found"));var r=this.status_.activeDrawingId;this.status_.activeDrawingId=n.id,this.setActiveLevelIndex(n.getMainLevel().getZIndex()),this.dispatchEvent(new H.util.ChangeEvent(t.EVENTS.DRAWING_CHANGE,e,r))}}},{key:"getActiveLevelIndex",value:function(){return this.status_.activeLevelIndex}},{key:"setActiveLevelIndex",value:function(e){if(this.venueModel.getLevelsByZIndex(e)){var n=this.status_.activeLevelIndex;this.status_.activeLevelIndex=e,this.dispatchEvent(new H.util.ChangeEvent(t.EVENTS.LEVEL_CHANGE,e,n))}}},{key:"isActive",value:function(){var e=this.getParentEventTarget();return!!e&&this===e.activeVenue}},{key:"getHighlightedGeometries",value:function(){var e=this;return this.venueModel.getGeometries().filter((function(e){return e.isHighlighted()})).map((function(t){return e.getGeometry(t.getIdentifier())}))}},{key:"setHighlightedGeometries",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=a(a({},le),r),s=o.fillColor,u=o.outlineColor,l=o.outlineWidth;(this.mutualExclusiveHighlight_=!!i,this.mutualExclusiveHighlight_)&&this.getHighlightedGeometries().forEac
945h((function(e){e.getData().highlight(!1)}));n.forEach((function(t){t.getData().highlight(e,{m:s,o:u,w:l})})),this.dispatchEvent(t.EVENTS.GEOMETRY_HIGHLIGHT)}},{key:"getMapObjects",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getActiveLevelIndex(),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getActiveDrawing();return this.mapObjectStore_[e][t.getIdentifier()]}},{key:"setMapObjects",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getActiveLevelIndex(),n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.getActiveDrawing();this.mapObjectStore_[t]&&this.mapObjectStore_[t][n.getIdentifier()]&&(this.mapObjectStore_[t][n.getIdentifier()]=b(e)),this.updateMapObjectsVisibility_()}},{key:"search",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this.search_.find(t).flatMap((function(t){return t.geometries.map((function(t){return e.getGeometry(t.id)}))}))}},{key:"updateMapObjectsVisibility_",value:function(){Object.values(this.mapObjectStore_).forEach((function(e){Object.values(e).forEach((function(e){return e.forEach((function(e){return e.setVisibility(!1)}))}))})),this.isActive()&&this.mapObjectStore_[this.getActiveLevelIndex()][this.getActiveDrawing().getIdentifier()].forEach((function(e){return e.setVisibility(!0)}))}},{key:"getDefaultMapObjectsStore_",value:function(){var e=this,t=this.getData().getDisplaySettings()===We.FLATTEN;return this.venueModel.getLevels().reduce((function(n,r){var i=r.getZIndex(),o=a({},n);return o[i]||(o[i]={}),o[i][r.getDrawing().getIdentifier()]=[],t&&(o[i][e.venueModel.getRootDrawing().getIdentifier()]=[]),o}),{})}}])}();Bt.EVENTS={ACTIVE_VENUE_CHANGE:"activevenuechange",DRAWING_CHANGE:"drawingchange",LEVEL_CHANGE:"levelchange",GEOMETRY_HIGHLIGHT:"geometryhighlight"};var Ut=function(){return f((function e(){d(this,e)}),null,[{key:"getIconLayer",value:function(){return{type:"FeatureCollection",features:(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).flatMap((function(e){return e.getData().getGeometries()})).filter((function(e){return e.isIcon()&&e.getIcon()})).map((function(e){var t=_(e.getLabelArea(),2),n=t[0],r=t[1],i=e.getLevel(),o=e.getIcon(),a=e.properties.spaceType||e.properties.spaceCategory||e.getDisplayName();return{type:"Feature",properties:{id:e.getIdentifier(),geometryId:e.getIdentifier(),levelId:i.getIdentifier(),name:a,venueId:i.getDrawing().getVenueModel().getIdentifier(),url:o?"data:image/svg+xml;utf8,".concat(encodeURIComponent(o)):""},geometry:{type:ne,coordinates:[n,r]}}}))}}},{key:"getLabelLayer",value:function(){return{type:"FeatureCollection",features:(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).flatMap((function(e){return e.getData().getGeometries()})).filter((function(e){return e.getDisplayName()&&!e.isIcon()})).map((function(e){var t=_(e.getLabelArea(),2),n=t[0],r=t[1],i=e.getLabelStyle(),o=i.fill,a=i.zmin,s=e.getLevel();return{type:"Feature",properties:{id:e.getIdentifier(),geometryId:e.getIdentifier(),levelId:s.getIdentifier(),venueId:s.getDrawing().getVenueModel().getIdentifier(),name:e.getDisplayName(),minZoom:a||15,textFillColor:o.toLowerCase()},geometry:{type:ne,coordinates:[n,r]}}}))}}},{key:"getGeometryLayer",value:function(){return{type:"FeatureCollection",features:(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).flatMap((function(e){return e.getData().getGeometries()})).filter((function(e){return e.getType()!==ne})).map((function(e){var t=e.getHighlightedStyle()||{},n=t.m,r=t.o,i=t.w,o=a({},e.getStyle()),s=o.m,u=o.o,l=o.w,c=se,h=c.fillColor,d=c.outlineColor,p=c.outlineWidth,f=e.getLevel();return{type:"Feature",properties:{id:e.getIdentifier(),fillColor:(n||s||h).toLowerCase(),geometryId:e.getIdentifier(),levelId:f.getIdentifier(),venueId:f.getDrawing().getVenueModel().getIdentifier(),outlineColor:(r||u||d).toLowerCase(),outlineWidth:Number(((i||l||p)/3).toFixed(2)),zIndex:e.getZIndex()},geometry:{type:e.getType(),coordinates:e.getCoordinates()}}}))}}},{key:"getFootprintLayer",value:function(e){return{type:"FeatureCollection",features:e.flatMap((function(e){return e.getData().getLevels().map((function(t){var n=t.getIdentifier(),r
945=e.getLevel(n).getData().levelData.geometry;return{type:"Feature",properties:{isFootprint:!0,levelId:n,venueId:e.getIdentifier(),zIndex:1},geometry:{type:"MultiPolygon",coordinates:r.coordinates}}}))}))}}}])}(),Ft=function(){return f((function e(){d(this,e)}),null,[{key:"getStyle",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n={styles:[{dataLayer:pe.FOOTPRINT,when:["==",["geometry-type"],"Polygon"],technique:"solid-line",color:"#4E5663",width:["interpolate",["linear"],["zoom"],0,"1px",6,"1px",7,"2px",18,"2px",19,"4px",24,"4px"],renderOrder:1},{dataLayer:pe.FOOTPRINT,when:["==",["geometry-type"],"Point"],technique:"text",color:"black",size:16,text:["get","venueName"],priority:61},{dataLayer:pe.VECTOR,when:["==",["geometry-type"],"Polygon"],technique:"polygon",color:["get","fillColor"],renderOrder:["get","zIndex"]},{dataLayer:pe.VECTOR,technique:"solid-line",color:["get","outlineColor"],width:["get","outlineWidth"],renderOrder:["get","zIndex"]},{dataLayer:pe.TEXT,minZoomLevel:["get","minZoom"],technique:"text",color:["get","textFillColor"],size:ue.size,text:["get","name"],priority:60},{dataLayer:pe.ICON,minZoomLevel:ce,when:["==",["geometry-type"],"Point"],technique:"labeled-icon",textIsOptional:!0,size:0,text:["get","name"],imageTexture:["concat","texture",["get","name"]],screenWidth:["interpolate",["linear"],["zoom"],15,3,21,70],screenHeight:["interpolate",["linear"],["zoom"],15,3,21,70],priority:61}],images:{},imageTextures:[]};return e.forEach((function(e){var t="texture"+e.properties.name;n.images[t]||(n.images[t]={url:e.properties.url,preload:!0},n.imageTextures.push({name:t,image:t}))})),t.forEach((function(e){var t,r=e.getData().getHighlightedStyle(),i=r.m,o=r.o,a=r.w;(t=n.styles).push.apply(t,[{dataLayer:pe.VECTOR,when:["==",["get","id"],e.id],technique:"polygon",color:i,renderOrder:["get","zIndex"]},{dataLayer:pe.VECTOR,when:["==",["get","id"],e.id],technique:"solid-line",color:o,width:a,renderOrder:["get","zIndex"]}])})),new H.map.render.harp.Style(n)}}])}(),Yt=function(){function e(){d(this,e)}return f(e,null,[{key:"getIconsTextures",value:function(){var e={},t={},n=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce((function(e,t){var n=t.properties.name;return e[n]||(e[n]=[]),e[n].push(t),e}),{});return Object.keys(n).forEach((function(r){var i="texture".concat(r),o="sprite".concat(r),a=n[r][0].properties.url;e[i]={url:a,sprites:v({},o,[0,0,50,50])},n[r].forEach((function(e){var n=e.properties;t["icon".concat(n.name)]={filter:{name:n.name,$zoom:{min:ce}},draw:{points:{interactive:!0,priority:1,size:[[15,"50%"],[16,"55%"],[17,"60%"],[18,"65%"],[19,"75%"],[20,"80%"],[21,"100%"]],texture:i,sprite:o}}}}))})),{textures:e,iconLayers:t}}},{key:"getFootprintLayer",value:function(){return{data:{source:"venues",layer:pe.FOOTPRINT},draw:{lines:{color:"#4E5663",width:[[0,"1px"],[6,"1px"],[7,"2px"],[18,"2px"],[19,"4px"],[24,"4px"]],order:1},points:{color:"[0, 0, 0, 0]",size:"0px",order:3,priority:1,text:{anchor:"center",collide:!1,font:{fill:"black",size:"16px"},text_source:"function() { return feature.venueName }"}}}}}},{key:"getGeometryLayer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t={};if(e.length){var n=e[0].getData().getHighlightedStyle(),r=n.m,i=n.o,o=n.w;t={filter:{id:e.map((function(e){return e.id}))},draw:{polygons:{interactive:!0,color:r},lines:{color:i,width:o}}}}return{data:{source:"venues",layer:pe.VECTOR},draw:{polygons:{interactive:!0,color:"function() { return feature.fillColor }",order:"function() { return feature.zIndex }"},lines:{color:"function() { return feature.outlineColor }",order:"function() { return feature.zIndex }",width:"function() { return feature.outlineWidth }"}},highlighted:t}}},{key:"getTextLayer",value:function(){return{filter:{$zoom:{min:he}},data:{source:"venues",layer:pe.TEXT},draw:{points:{filter:"function() { return $zoom > feature.minZoom }",color:"[0, 0, 0, 0]",size:"0px",offset:["0px","-10px"],priority:2,text:{font:{fill:"function() { return feature.textFillColor }",size:ue.size},text_source:"function() { return feature.name }"}}}}}},{key:"getIconLayer",value:function(e){return a({data:{source:"venues",layer:pe.ICON}},e)}},{key:"getStyle",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=e.getIconsTextures(t),i=r.textures,o=r.iconLayers,a={venue_footprints:e.getFootprintLayer(),venue_geometries:e.getGeometryLayer(n),venue_labels:e.getTextLayer(),venue_icons:e.getIconLayer(o)}
945,s=H.gl.yaml.dump({sources:{venues:{max_zoom:de,type:"GeoJSONTileSource"}},layers:a,textures:i});return new H.map.render.webgl.Style(s)}}])}(),Zt={type:"FeatureCollection",features:[]},Wt={extent:4096,indexMaxZoom:0,maxZoom:24,tolerance:3},Kt=function(e){function t(e){var r;return d(this,t),(r=n(this,t,[e])).venues=[],r.activeVenue=null,r.dataLayers_={},r.tileIndexes_={},r.addEventListener(Bt.EVENTS.ACTIVE_VENUE_CHANGE,r.activeVenueChangeHandler_,void 0,r),r}return g(t,H.map.provider.RemoteTileProvider),f(t,[{key:"setStyle",value:function(e){return this.setStyleInternal(e)}},{key:"getStyle",value:function(){return this.getStyleInternal()}},{key:"isFeatureVisible_",value:function(e){var t=e.properties;return!!this.activeVenue.getActiveLevels().some((function(e){return e.id===t.levelId}))}},{key:"requestInternal",value:function(e,t,n,r){var i=this,o=function(r){for(var i=0;i<r.length;i+=1)r[i]=r[i].map((function(r){return be(r,n,e,t,Wt.extent)}))},a={};return Object.keys(this.tileIndexes_).forEach((function(r){var s=i.tileIndexes_[r].getTile(n,e,t);a[r]=s?function(e){var t=[],n=e&&e.features;if(n)for(var r=0,i=n.length;r<i;r+=1){var o=n[r],a=o.type,s=void 0,u=!1;switch(a){case ve:s={type:ie,coordinates:o.geometry.map((function(e){return e.slice()}))};break;case ge:case ye:s={type:oe,coordinates:o.geometry.map((function(e){return e.map((function(e){return e.slice()}))}))},a===ye&&null==(s=_e(s))&&(u=!0);break;default:u=!0}u||t.push({geometry:s,id:o.id,properties:o.tags,type:"Feature"})}return{type:"FeatureCollection",features:t}}(s):Zt,a[r].features=a[r].features.filter((function(e){return i.isFeatureVisible_(e)}));for(var u=0;u<a[r].features.length;u+=1){var l=a[r].features[u],c=l.geometry.type;if(c===re||c===oe)o(l.geometry.coordinates);else if(c===ae)l.geometry.coordinates.map(o);else for(var h=l.geometry.coordinates,d=0;d<h.length;d+=1)h[d]=be(h[d],n,e,t,Wt.extent)}})),r(a),{cancel:function(){}}}},{key:"getActiveVenue",value:function(){return this.activeVenue}},{key:"getVenue",value:function(e){return e?this.venues.find((function(t){return t.getIdentifier()===e})):this.activeVenue}},{key:"setActiveVenue",value:function(e){var t=this.activeVenue;this.activeVenue=e,this.dispatchEvent(new H.util.ChangeEvent(Bt.EVENTS.ACTIVE_VENUE_CHANGE,e,t)),this.reload()}},{key:"addVenue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!(e instanceof Bt))throw new Error("Invalid argument");var n=e.getIdentifier();if(this.getVenue(n))throw new Error("Please invoke provider.removeVenue to remove old instance of venue ".concat(n," before adding new"));e.setParentEventTarget(this),this.venues.push(e),t||(this.reloadData_(),this.reloadStyle_())}},{key:"addVenues",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];t.length>0&&(t.forEach((function(t){t instanceof Bt&&e.addVenue(t,!0)})),this.reloadData_(),this.reloadStyle_())}},{key:"removeVenue",value:function(e){if(e instanceof Bt&&this.venues.indexOf(e)>-1){var t=e.getIdentifier();this.activeVenue&&this.activeVenue.getIdentifier()===t&&this.setActiveVenue(null),this.venues.splice(this.venues.indexOf(e),1),this.reloadData_(),this.reloadStyle_(),this.reload()}}},{key:"getFeatureProxy",value:function(e,t,n){var r=e.geometryId,i=e.venueId,o=this.getVenue(i);return r?n(o.getGeometries().find((function(e){return e.id===r}))):o&&n(o),!0}},{key:"addVenueEventListeners_",value:function(e){e&&(e.addEventListener(Bt.EVENTS.GEOMETRY_HIGHLIGHT,this.geometryHighlightHandler_,void 0,this),e.addEventListener(Bt.EVENTS.LEVEL_CHANGE,this.levelChangeHandler_,void 0,this),e.addEventListener(Bt.EVENTS.DRAWING_CHANGE,this.drawingChangeHandler_,void 0,this))}},{key:"removeVenueEventListeners_",value:function(e){e&&(e.removeEventListener(Bt.EVENTS.GEOMETRY_HIGHLIGHT,this.geometryHighlightHandler_,void 0,this),e.removeEventListener(Bt.EVENTS.LEVEL_CHANGE,this.levelChangeHandler_,void 0,this),e.removeEventListener(Bt.EVENTS.DRAWING_CHANGE,this.drawingChangeHandler_,void 0,this))}},{key:"activeVenueChangeHandler_",value:function(e){var t=e.oldValue,n=e.newValue;t&&(this.removeVenueEventListeners_(t),t.updateMapObjectsVisibility_()),n&&(this.addVenueEventListeners_(n),n.updateMapObjectsVisibility_())}},{key:"drawingChangeHandler_",value:function(){this.reload()}},{key:"levelChangeHandler_",value:function(){this.activeVenue&&(this.activeVenue.updateMapObjectsVisibility_(),this.reload())}},{key:"geometryHighlightHandler_",value:function(){this.reloadStyle_(this.activeVenue.getHighlightedGeometries())}},{key:"createDataLayers_",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Object.keys(pe),n=pe.FOOTPRINT,r=pe.ICON,i=pe.TEXT,o=pe.VECTOR;t.forEach((function(t){switch(t){case o:e.dataLayers_[o]=Ut.getGeometryLayer(e.venues);break;case n:e.dataLayers_[n]=Ut.getFootprintLayer(e.venues);break;case r:e.dataLayers_[r]=Ut.getIconLayer(e.venues);break;case i:e.dataLayers_[i]=Ut.getLabelLayer(e.venues);break;default:throw new Error("Unsupported Layer ".concat(t))}}))}},{key:"createTileIndexes_",value:function(){var e=this;(arguments.length>
9450&&void 0!==arguments[0]?arguments[0]:Object.keys(pe)).forEach((function(t){e.tileIndexes_[t]=new ee(e.dataLayers_[t],Wt)}))}},{key:"reloadData_",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Object.keys(pe);this.createDataLayers_(e),this.createTileIndexes_(e)}},{key:"reloadStyle_",value:function(e){var t=this.dataLayers_[pe.ICON]?this.dataLayers_[pe.ICON].features:[];this.getEngineType()===H.Map.EngineType.WEBGL?this.setStyle(Yt.getStyle(t,e)):this.getEngineType()===H.Map.EngineType.HARP&&this.setStyle(Ft.getStyle(t,e))}},{key:"providesGeoJSON",value:function(){return!0}}])}(),Jt=new H.map.SpatialStyle({strokeColor:"#1ab4bf",lineWidth:3}),Xt=new H.map.SpatialStyle({strokeColor:"#1ab4bf",lineWidth:3}),Qt=new H.map.Icon("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI1MCIgdmlld0JveD0iMCAwIDQwIDUwIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+PGRlZnM+PHBhdGggaWQ9ImIiIGQ9Ik0zNC4yNSAzMS42NTJBMTkuMDE1IDE5LjAxNSAwIDAgMCAzOSAxOS4wNkMzOSA4LjU0OSAzMC40NzggMCAyMCAwUzEgOC41NSAxIDE5LjA1OWMwIDQuODIzIDEuNzk1IDkuMjMzIDQuNzUgMTIuNTkzTDE5Ljk3NSA0NiAzNC4yNSAzMS42NTJ6Ii8+PHBhdGggaWQ9ImEiIGQ9Ik0zNC4yNSAzMS42NTJBMTkuMDE1IDE5LjAxNSAwIDAgMCAzOSAxOS4wNkMzOSA4LjU0OSAzMC40NzggMCAyMCAwUzEgOC41NSAxIDE5LjA1OWMwIDQuODIzIDEuNzk1IDkuMjMzIDQuNzUgMTIuNTkzTDE5Ljk3NSA0NiAzNC4yNSAzMS42NTJ6Ii8+PG1hc2sgaWQ9ImMiIHdpZHRoPSIzOCIgaGVpZ2h0PSI0NiIgeD0iMCIgeT0iMCIgZmlsbD0iI2ZmZiI+PHVzZSB4bGluazpocmVmPSIjYSIvPjwvbWFzaz48L2RlZnM+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48ZWxsaXBzZSBjeD0iMjAiIGN5PSI0NS4xNiIgZmlsbD0iI0ZGRiIgc3Ryb2tlPSIjOTc5Nzk3IiBzdHJva2Utd2lkdGg9Ii4yNSIgcng9IjMuNSIgcnk9IjMuNSIvPjx1c2UgZmlsbD0iIzAxQjZCMiIgeGxpbms6aHJlZj0iI2IiLz48cGF0aCBmaWxsPSIjMzIzMjMyIiBmaWxsLW9wYWNpdHk9Ii41IiBkPSJNMTEuODEgMzcuNjZoMTYuMzhsLTguMiA4eiIvPjx1c2Ugc3Ryb2tlPSIjNDE2QTg2IiBzdHJva2Utd2lkdGg9Ii41IiBtYXNrPSJ1cmwoI2MpIiB4bGluazpocmVmPSIjYSIvPjxlbGxpcHNlIGN4PSIxOS44MSIgY3k9IjE5LjE5IiBmaWxsPSIjRkZGIiByeD0iNC44MSIgcnk9IjQuODEiLz48L2c+PC9zdmc+"),qt=new H.map.Icon("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI1MCIgdmlld0JveD0iMCAwIDQwIDUwIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+PGRlZnM+PHBhdGggaWQ9ImEiIGQ9Ik0zNC4yNSAzMS42NTJBMTkuMDE1IDE5LjAxNSAwIDAgMCAzOSAxOS4wNkMzOSA4LjU0OSAzMC40NzggMCAyMCAwUzEgOC41NSAxIDE5LjA1OWMwIDQuODIzIDEuNzk1IDkuMjMzIDQuNzUgMTIuNTkzTDE5Ljk3NSA0NiAzMi44MyAzMy4xMDRjLjQwNy0uMzc0IDEuNDE5LTEuNDUyIDEuNDE5LTEuNDUyeiIvPjxtYXNrIGlkPSJjIiB3aWR0aD0iMzgiIGhlaWdodD0iNDYiIHg9IjAiIHk9IjAiIGZpbGw9IiNmZmYiPjx1c2UgeGxpbms6aHJlZj0iI2EiLz48L21hc2s+PGVsbGlwc2UgaWQ9ImIiIGN4PSIxOS44MDciIGN5PSIxOS4xNjgiIHJ4PSIxMi4zNjMiIHJ5PSIxMi4xOTciLz48bWFzayBpZD0iZCIgd2lkdGg9IjI1LjcyNSIgaGVpZ2h0PSIyNS4zOTQiIHg9Ii0uNSIgeT0iLS41Ij48cGF0aCBmaWxsPSIjZmZmIiBkPSJNNi45NDQgNi40NzFoMjUuNzI1djI1LjM5NEg2Ljk0NHoiLz48dXNlIHhsaW5rOmhyZWY9IiNiIi8+PC9tYXNrPjwvZGVmcz48ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxlbGxpcHNlIGN4PSIyMCIgY3k9IjQ1LjE2IiBmaWxsPSIjRkZGIiBzdHJva2U9IiM5Nzk3OTciIHN0cm9rZS13aWR0aD0iLjI1IiByeD0iMy41IiByeT0iMy41Ii8+PHVzZSBmaWxsPSIjMzIzMjMyIiB4bGluazpocmVmPSIjYSIvPjxwYXRoIGZpbGw9IiM3RDdEN0QiIGQ9Ik0xMi4wMTEgMzcuODA1aDE1Ljk3OGwtNy45MTYgOHoiLz48dXNlIHN0cm9rZT0iIzdDN0M3QyIgc3Ryb2tlLXdpZHRoPSIuNSIgbWFzaz0idXJsKCNlKSIgeGxpbms6aHJlZj0iI2EiLz48dXNlIHN0cm9rZT0iI0ZGRiIgc3Ryb2tlLXdpZHRoPSIuNSIgbWFzaz0idXJsKCNjKSIgeGxpbms6aHJlZj0iI2EiLz48ZWxsaXBzZSBmaWxsPSIjRkZGIiBjeD0iMTkuODA3IiBjeT0iMTkuMTY4IiByeD0iMTIuMzYzIiByeT0iMTIuMTk3Ii8+PHBhdGggZmlsbD0iIzMyMzIzMiIgZD0iTTYuODEyIDYuOTQ4aDYuNDV2Ni4zNjRoLTYuNDV6bTAgMTIuNzI3aDYuNDV2Ni4zNjRoLTYuNDV6bTYuNDUtNi4zNjNoNi40NXY2LjM2NGgtNi40NXptMCAxMi43MjdoNi40NXY2LjM2NGgtNi40NXptNi40NS0xOS4wOTFoNi40NXY2LjM2NGgtNi40NXptMCAxMi43MjdoNi40NXY2LjM2NGgtNi40NXptNi40NS02LjM2M2g2LjQ1djYuMzY0aC02LjQ1em0wIDEyLjcyN2g2LjQ1djYuMzY0aC02LjQ1eiIvPjx1c2Ugc3Ryb2tlPSIjRkZGIiBtYXNrPSJ1cmwoI2QpIiB4bGluazpocmVmPSIjYiIgc3Ryb2tlLWxpbmVjYXA9InNxdWFyZSIvPjwvZz48L3N2Zz4="),$t=function(e,t,n){return n===en.ObjectType.SEGMENT_START_MARKER?0===e?Qt:null:n===en.ObjectType.SEGMENT_FINISH_MARKER?1===t.length||e===t.length-1?qt:null:"indoor"===t[e].departure.place.type?Jt:Xt},en=function(){function e(t,n){d(this,e),this.indoorMapObjects_=null,this.outdoorMapObjects_=null,this.createRouteObjects_(t,n)}return f(e,[{key:"createRouteObjects_",value:function(t){var n=this,r=t.sections,i=void 0===r?[]:r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:$t;this.indoorMapObjects_={},this.outdoorMapObjects_=new H.map.Group;for(var s=function(){var t,r,s=i[u],l=s.departure.place,c=l.id,h=l.type,d=H.util.flexiblePolyline.decode(s.polyline).polyline,p=o(u,i,e.ObjectType.SEGMENT_START_MARKER);p&&(t=new H.map.Marker(s.departure.place.location,{icon:p}));var f=o(u,i,e.ObjectType.SEGMENT_FINISH_MARKER);f&&(r=new H.map.Marker(s.arrival.place.location,{icon:f}));var v=o(u,i,e.ObjectType.SEGMENT_POLYLINE);if("indoor"===h){var g=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=new Map,n=new H.geo.LineString,r=_(e[0],3)[2];return t.set(r,[n]),e.forEach((function(e){var i;e[2]!==r&&(r=e[2],n=new H.geo.LineString,t.has(r)?t.get(r).push(n):t.set(r,[n])),(i=n).pushLatLngAlt.apply(i,b(e))})),t}(d),y=Array.from(g.keys()).reduce((function(e,t){return e[t]||(e[t]=new H.map.Group),e}),{});v&&g.forEach((function(e,t){e.forEach((function(e){if(e.getPointCount()>1){var n=new H.map.Polyline(e,{style:v});y[t].addObject(n)}}))})),t&&y[s.departure.place.location.lvl].addObject(t),r&&y[s.arrival.place.location.lvl].addObject(r),n.indoorMapObjects_[c]=a(a({},n.indoorMapObjects_[c]||{}),y)}else{if(v){var m=new H.geo.LineString(d.flatMap((function(e){return[e[0],e[1],0]}))),E=new H.map.Polyline(m,{style:v});n.outdoorMapObjects_.addObject(E)}t&&n.outdoorMapObjects_.addObject(t),r&&n.outdoorMapObjects_.addObject(r)}},u=0;u<i.length;u++)s()}},{key:"getIndoorObjects",value:function(){return this.indoorMapObjects_}},{key:"getOutdoorObjects",value:function(){return this.outdoorMapObjects_}}])}();en.ObjectType={SEGMENT_START_MARKER:1,SEGMENT_FINISH_MARKER:2,SEGMENT_POLYLINE:3};var tn=function(e){function t(e){var r;d(this,t),r=n(this,t,[t,a(a({},e),{},{baseUrl:void 0})]);var i={apiKey:e.apikey,baseUrl:e.baseUrl,token:e.token},o={apiKey:i.apiKey,token:i.token};i.apiKey||(i.apiKey=r.getUrl().getQuery().apikey);var s=e.useLegacy||!1;return r.venueService_=new Gt(i,s),o.apiKey||(o.apiKey=r.getUrl().getQuery().apikey),e.rout
vendor: 6,539 bytes, line 945
945ingBaseUrl&&(o.baseUrl=e.routingBaseUrl),r.routingService_=new Vt(o),r}return g(t,H.service.Service),f(t,[{key:"loadVenue",value:function(e){return console.warn("Venue service version 1 is no longer supported hence "+e+" could not be loaded"),Promise.resolve()}},{key:"calculateRoute",value:function(e){return console.warn("HERE Indoor Routing is deprecated and will be removed soon."),this.routingService_.calculateRoute(e)}}])}();tn.CONFIG_KEY="venues";var nn=function(e){function t(e){var r;d(this,t),r=n(this,t,[t,a(a({},e),{},{baseUrl:void 0})]);var i={apiKey:e.apikey,baseUrl:e.baseUrl,token:e.token,hrn:e.hrn};i.apiKey||(i.apiKey=r.getUrl().getQuery().apikey);var o=e.useLegacy||!1;return r.venueService_=new Gt(i,o),r}return g(t,H.service.Service),f(t,[{key:"loadVenue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.venueService_.load(e,t).then((function(e){return new Bt(e)}))}},{key:"getMapInfoList",value:function(){return this.venueService_.getSupportedMapList()}}])}();nn.CONFIG_KEY="indoorMaps",H.service.Platform.prototype.getVenuesService=function(e,t){var n=nn;return 1!==t&&t?t!==fe.v2||e.token||(e.hrn?e.apikey||console.error("Venue Service version 2 requires either apikey or token"):console.error("Token is mandatory when Hrn is not provided in Venue Service version 2")):(console.warn("Venue service version 1 is no longer supported"),n=tn),this.createService(n,e)},nn.LABEL_TEXT_PREFERENCE_OVERRIDE={OCCUPANT_NAMES:"OCCUPANT_NAMES",SPACE_NAME:"SPACE_NAME",SPACE_TYPE_NAME:"SPACE_TYPE_NAME",SPACE_CATEGORY_NAME:"SPACE_CATEGORY_NAME",INTERNAL_ADDRESS:"INTERNAL_ADDRESS"};var rn=function(e){function t(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return d(this,t),(r=n(this,t)).provider_=null,r.levelSelectorUI_=null,r.setAlignment(i&&i.alignment||H.ui.LayoutAlignment.RIGHT_BOTTOM),r.addClass("venues-ui"),e instanceof Bt&&r.setVenue(e),r}return g(t,H.ui.Control),f(t,[{key:"renderInternal",value:function(e,n){I(y(t.prototype),"renderInternal",this).call(this,e,n),this.createLevelSelectorUI_(e),this.venue&&this.setVenue(this.venue)}},{key:"setVenue",value:function(e){e instanceof Bt&&(this.removeEventListeners_(),this.venue=e,this.provider_=e.getParentEventTarget(),this.update_(),this.addEventListeners_())}},{key:"createLevelSelectorUI_",value:function(e){var t=this;e.innerHTML="",this.levelSelectorUI_=null;this.levelSelectorUI_=new It(e,null,null,(function(e){return t.venue.setActiveLevelIndex(e)}))}},{key:"update_",value:function(){if(this.levelSelectorUI_){var e=this.venue.getActiveDrawing().getData(),t=this.venue.getData().getDisplaySettings();this.levelSelectorUI_.update(e,t),this.levelChangeHandler_()}}},{key:"addEventListeners_",value:function(){this.venue&&(this.venue.addEventListener(Bt.EVENTS.LEVEL_CHANGE,this.levelChangeHandler_,void 0,this),this.venue.addEventListener(Bt.EVENTS.DRAWING_CHANGE,this.drawingChangeHandler_,void 0,this)),this.provider_&&this.provider_.addEventListener(Bt.EVENTS.ACTIVE_VENUE_CHANGE,this.activeVenueChangeHandler_,void 0,this)}},{key:"removeEventListeners_",value:function(){this.venue&&(this.venue.removeEventListener(Bt.EVENTS.LEVEL_CHANGE,this.levelChangeHandler_,void 0,this),this.venue.removeEventListener(Bt.EVENTS.DRAWING_CHANGE,this.drawingChangeHandler_,void 0,this)),this.provider_&&this.provider_.removeEventListener(Bt.EVENTS.ACTIVE_VENUE_CHANGE,this.activeVenueChangeHandler_,void 0,this)}},{key:"levelChangeHandler_",value:function(){this.levelSelectorUI_.switch(this.venue.getActiveLevelIndex())}},{key:"drawingChangeHandler_",value:function(){this.update_()}},{key:"activeVenueChangeHandler_",value:function(e){this.setVenue(e.newValue)}}])}(),on=function(e){function t(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return d(this,t),(r=n(this,t)).provider_=null,r.drawingSelectorUI_=null,r.addClass("venues-ui"),r.setAlignment(i&&i.alignment||H.ui.LayoutAlignment.RIGHT_BOTTOM),e instanceof Bt&&r.setVenue(e),r}return g(t,H.ui.Control),f(t,[{key:"renderInternal",value:function(e,n){I(y(t.prototype),"renderInternal",this).call(this,e,n),this.createDrawingSelectorUI_(e),this.venue&&this.setVenue(this.venue)}},{key:"setVenue",value:function(e){e instanceof Bt&&(this.removeEventListeners_(),this.venue=e,this.provider_=e.getParentEventTarget(),this.drawingSelectorUI_&&this.drawingSelectorUI_.update(e.getData()),this.addEventListeners_())}},{key:"createDrawingSelectorUI_",value:function(e){var t=this;e.innerHTML="",this.drawingSelectorUI_=null,this.drawingSelectorUI_=new vt(e,null,(function(e){return t.venue.setActiveDrawing(e)}))}},{key:"addEventListeners_",value:function(){this.venue&&this.venue.addEventListener(Bt.EVENTS.DRAWING_CHANGE,this.drawingChangeHandler_,void 0,this),this.provider_&&this.provider_.addEventListener(Bt.EVENTS.ACTIVE_VENUE_CHANGE,this.activeVenueChangeHandler_,void 0,this)}},{key:"removeEventListeners_",value:function(){this.venue&&this.venue.removeEventListener(Bt.EVENTS.DRAWING_CHANGE,this.drawingChangeHandler_,void 0,this),this.provider_&&this.provider_.removeEventListener(Bt.EVENTS.ACTIVE_VENUE_CHANGE,this.activeVenueChangeHandler_,void 0,this)}},{key:"drawingChangeHandler_",value:function(){this.drawingSelectorUI_.switch(this.venue.getActiveDrawing().id)}},{key:"activeVenueChangeHandler_",value:function(e){this.setVenue(e.newValue)}}])}(),an=Object.freeze({__proto__:null,DrawingControl:on,LevelControl:rn});return t(".venues-ui * {\n font-family: \"Fira Sans\", \"Helvetica Neue\", Helvetica, sans-serif;\n color: #0F1621;\n}\n.venues-ui .arrow {\n display: block;\n width: 100%;\n height: 100%;\n background-repeat: no-repeat;\n background-position: center;\n}\n.venues-ui .arrow--up {\n background-image: url(\"data:image/svg+xml,%0A%3Csvg width='13px' height='9px' viewBox='0 0 13 9' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg id='VenueMap_Facilities_Detail' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3E%3Cg id='Floorplan-Switcher' transform='translate(-426.000000, -584.000000)' fill='%23383C45'%3E%3Cg id='Map-Controls-Copy' transform='translate(417.753906, 572.000000)'%3E%3Cg id='Chevron,-Dark' transform='translate(15.000000, 16.499023) rotate(-180.000000) translate(-15.000000, -16.499023) translate(9.000000, 12.749023)'%3E%3Cpath d='M6.0105,7.5 L4.1895,5.76404817 L0.1695,1.90510321 C0.057,1.79759174 0,1.68291284 0,1.56106651 C0,1.44065367 0.057,1.32597477 0.1695,1.2184633 L1.2465,0.16771789 C1.347,
9450.0587729358 1.47,0.00430045872 1.617,0.00430045872 C1.764,0.00430045872 1.887,0.0587729358 1.986,0.166284404 L6.009,3.98365826 L10.023,0.161983945 C10.122,0.0530389908 10.236,0 10.3695,0 C10.503,0 10.62,0.0530389908 10.7205,0.161983945 L11.841,1.21129587 C12.0525,1.43922018 12.0525,1.67144495 11.8425,1.89793578 L7.827,5.76118119 L6.0105,7.5 Z' id='Fill-3'%3E%3C/path%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E\");\n}\n.venues-ui .arrow--down {\n background-image: url(\"data:image/svg+xml,%0A%3Csvg width='13px' height='9px' viewBox='0 0 13 9' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg id='VenueMap_Facilities_Detail' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3E%3Cg id='Floorplan-Switcher' transform='translate(-347.000000, -704.000000)' fill='%23383C45'%3E%3Cg id='Map-Controls' transform='translate(338.251953, 572.000000)'%3E%3Cg id='Chevron,-Dark' transform='translate(9.000000, 132.746094)'%3E%3Cpath d='M6.0105,7.5 L4.1895,5.76404817 L0.1695,1.90510321 C0.057,1.79759174 0,1.68291284 0,1.56106651 C0,1.44065367 0.057,1.32597477 0.1695,1.2184633 L1.2465,0.16771789 C1.347,0.0587729358 1.47,0.00430045872 1.617,0.00430045872 C1.764,0.00430045872 1.887,0.0587729358 1.986,0.166284404 L6.009,3.98365826 L10.023,0.161983945 C10.122,0.0530389908 10.236,0 10.3695,0 C10.503,0 10.62,0.0530389908 10.7205,0.161983945 L11.841,1.21129587 C12.0525,1.43922018 12.0525,1.67144495 11.8425,1.89793578 L7.827,5.76118119 L6.0105,7.5 Z' id='Fill-3'%3E%3C/path%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E\");\n}\n.venues-ui .venues-ui-button {\n display: block;\n width: 40px;\n height: 40px;\n line-height: 40px;\n font-size: 16px;\n font-weight: 600;\n background-color: #fff;\n border: none;\n border-bottom: 1px solid #9FA2A6;\n cursor: pointer;\n overflow: hidden;\n color: #6e737a;\n text-align: center;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.venues-ui .venues-ui-button:hover, .venues-ui .venues-ui-button--active {\n background-color: #f0f0f0;\n color: #0F1621;\n}\n@keyframes fade {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}\n.venues-ui__drawings .drawings {\n position: absolute;\n top: 0;\n right: 45px;\n display: none;\n opacity: 0;\n border-radius: 5px;\n box-shadow: 0 0 0.4em 0 rgba(15, 22, 33, 0.6);\n}\n.venues-ui__drawings .drawings--open {\n display: block;\n opacity: 1;\n animation: fade 1s;\n overflow-y: auto;\n max-height: 250px;\n}\n.venues-ui__drawings .drawings .venues-ui-button {\n width: auto;\n padding: 0 10px;\n}\n.venues-ui__drawings .drawings .venues-ui-button:first-of-type {\n border-top-left-radius: 5px;\n border-top-right-radius: 5px;\n}\n.venues-ui__drawings .drawings .venues-ui-button:last-of-type {\n border-bottom-left-radius: 5px;\n border-bottom-right-radius: 5px;\n}\n.venues-ui__drawings .trigger {\n border-radius: 5px;\n box-shadow: 0 0 0.4em 0 rgba(15, 22, 33, 0.6);\n}\n.venues-ui__drawings .trigger .arrow {\n transform: rotate(0);\n transition: 0.4s;\n}\n.venues-ui__drawings .trigger.venues-ui-button--active .arrow {\n transform: rotate(90deg);\n transition: 0.4s;\n}\n.venues-ui__levels {\n border-radius: 5px;\n box-shadow: 0 0 0.4em 0 rgba(15, 22, 33, 0.6);\n}\n.venues-ui__levels .levels {\n overflow: hidden;\n}\n.venues-ui__levels .venues-ui-button--up + .levels .venues-ui-button {\n border-radius: 0;\n}\n.venues-ui__levels .venues-ui-button:first-of-type {\n border-top-left-radius: 5px;\n border-top-right-radius: 5px;\n}\n.venues-ui__levels .venues-ui-button:last-of-type {\n border-bottom-left-radius: 5px;\n border-bottom-right-radius: 5px;\n}\n.venues-ui__levels .venues-ui-button[disabled=disabled] .arrow {\n opacity: 0.5;\n}\n.venues-ui__directory {\n position: absolute;\n top: 10px;\n right: 60px;\n bottom: calc(100% - 45px);\n width: 350px;\n overflow: hidden;\n background: white;\n border-radius: 5px;\n box-shadow: 0 0 0.4em 0 rgba(15, 22, 33, 0.6);\n}\n.venues-ui__directory.active {\n bottom: 10px;\n}\n.venues-ui__directory .directory__list {\n top: 80px;\n bottom: 20px;\n position: absolute;
945\n overflow-y: scroll;\n right: 10px;\n left: 10px;\n font-size: 12px;\n}\n.venues-ui__directory .directory__list svg {\n width: 25px;\n height: 25px;\n}\n.venues-ui__directory .directory__heading {\n margin: 8px;\n font-size: 15px;\n font-weight: normal;\n cursor: pointer;\n}\n.venues-ui__directory .directory__input {\n margin: 10px;\n}\n.venues-ui__directory .directory__input input {\n width: 100%;\n padding: 5px 0;\n}\n.venues-ui__directory .directory__trigger {\n position: absolute;\n right: 10px;\n top: 15px;\n width: 10px;\n height: 10px;\n}\n.venues-ui__directory .directory__trigger .arrow {\n transform: rotate(0);\n transition: 0.4s;\n}\n.venues-ui__directory .directory__trigger--active .arrow {\n transform: rotate(-180deg);\n transition: 0.4s;\n}"),e.Drawing=A,e.Geometry=M,e.Level=T,e.Provider=Kt,e.Route=en,e.Service=tn,e.Service2=nn,e.Venue=Bt,e.ui=an,Object.defineProperty(e,"__esModule",{value:!0}),e}({}); 946 947H.__harp_worker_decoders__="/*! For license information please see mapsjs-harp-decoders.js.LICENSE.txt */\n(()=>{var __webpack_modules__={3577:(e,t,n)=>{\"use strict\";const i=n(5133);var r=n(5218),o=n(6918);o.util.Long=i,o.configure(),e.exports=r},5218:(e,t,n)=>{\"use strict\";var i,r,o,s=n(6918),a=s.Reader,l=s.util,c=s.roots.default||(s.roots.default={});c.com=((o={}).mapbox=((r={}).pb=((i={}).Tile=function(){function e(e){if(this.layers=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}var t,n;return e.prototype.layers=l.emptyArray,e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,i=new c.com.mapbox.pb.Tile;e.pos<n;){var r=e.uint32();r>>>3==3?(i.layers&&i.layers.length||(i.layers=[]),i.layers.push(c.com.mapbox.pb.Tile.Layer.decode(e,e.uint32()))):e.skipType(7&r)}return i},e.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},e.fromObject=function(e){if(e instanceof c.com.mapbox.pb.Tile)return e;var t=new c.com.mapbox.pb.Tile;if(e.layers){if(!Array.isArray(e.layers))throw TypeError(\".com.mapbox.pb.Tile.layers: array expected\");t.layers=[];for(var n=0;n<e.layers.length;++n){if(\"object\"!=typeof e.layers[n])throw TypeError(\".com.mapbox.pb.Tile.layers: object expected\");t.layers[n]=c.com.mapbox.pb.Tile.Layer.fromObject(e.layers[n])}}return t},e.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.layers=[]),e.layers&&e.layers.length){n.layers=[];for(var i=0;i<e.layers.length;++i)n.layers[i]=c.com.mapbox.pb.Tile.Layer.toObject(e.layers[i],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},e.GeomType=(t={},(n=Object.create(t))[t[0]=\"UNKNOWN\"]=0,n[t[1]=\"POINT\"]=1,n[t[2]=\"LINESTRING\"]=2,n[t[3]=\"POLYGON\"]=3,n),e.Value=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.stringValue=\"\",e.prototype.floatValue=0,e.prototype.doubleValue=0,e.prototype.intValue=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.uintValue=l.Long?l.Long.fromBits(0,0,!0):0,e.prototype.sintValue=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.boolValue=!1,e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,i=new c.com.mapbox.pb.Tile.Value;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:i.stringValue=e.string();break;case 2:i.floatValue=e.float();break;case 3:i.doubleValue=e.double();break;case 4:i.intValue=e.int64();break;case 5:i.uintValue=e.uint64();break;case 6:i.sintValue=e.sint64();break;case 7:i.boolValue=e.bool();break;default:e.skipType(7&r)}}return i},e.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},e.fromObject=function(e){if(e instanceof c.com.mapbox.pb.Tile.Value)return e;var t=new c.com.mapbox.pb.Tile.Value;return null!=e.stringValue&&(t.stringValue=String(e.stringValue)),null!=e.floatValue&&(t.floatValue=Number(e.floatValue)),null!=e.doubleValue&&(t.doubleValue=Number(e.doubleValue)),null!=e.intValue&&(l.Long?(t.intValue=l.Long.fromValue(e.intValue)).unsigned=!1:\"string\"
947==typeof e.intValue?t.intValue=parseInt(e.intValue,10):\"number\"==typeof e.intValue?t.intValue=e.intValue:\"object\"==typeof e.intValue&&(t.intValue=new l.LongBits(e.intValue.low>>>0,e.intValue.high>>>0).toNumber())),null!=e.uintValue&&(l.Long?(t.uintValue=l.Long.fromValue(e.uintValue)).unsigned=!0:\"string\"==typeof e.uintValue?t.uintValue=parseInt(e.uintValue,10):\"number\"==typeof e.uintValue?t.uintValue=e.uintValue:\"object\"==typeof e.uintValue&&(t.uintValue=new l.LongBits(e.uintValue.low>>>0,e.uintValue.high>>>0).toNumber(!0))),null!=e.sintValue&&(l.Long?(t.sintValue=l.Long.fromValue(e.sintValue)).unsigned=!1:\"string\"==typeof e.sintValue?t.sintValue=parseInt(e.sintValue,10):\"number\"==typeof e.sintValue?t.sintValue=e.sintValue:\"object\"==typeof e.sintValue&&(t.sintValue=new l.LongBits(e.sintValue.low>>>0,e.sintValue.high>>>0).toNumber())),null!=e.boolValue&&(t.boolValue=Boolean(e.boolValue)),t},e.toObject=function(e,t){t||(t={});var n={};if(t.defaults){if(n.stringValue=\"\",n.floatValue=0,n.doubleValue=0,l.Long){var i=new l.Long(0,0,!1);n.intValue=t.longs===String?i.toString():t.longs===Number?i.toNumber():i}else n.intValue=t.longs===String?\"0\":0;l.Long?(i=new l.Long(0,0,!0),n.uintValue=t.longs===String?i.toString():t.longs===Number?i.toNumber():i):n.uintValue=t.longs===String?\"0\":0,l.Long?(i=new l.Long(0,0,!1),n.sintValue=t.longs===String?i.toString():t.longs===Number?i.toNumber():i):n.sintValue=t.longs===String?\"0\":0,n.boolValue=!1}return null!=e.stringValue&&e.hasOwnProperty(\"stringValue\")&&(n.stringValue=e.stringValue),null!=e.floatValue&&e.hasOwnProperty(\"floatValue\")&&(n.floatValue=t.json&&!isFinite(e.floatValue)?String(e.floatValue):e.floatValue),null!=e.doubleValue&&e.hasOwnProperty(\"doubleValue\")&&(n.doubleValue=t.json&&!isFinite(e.doubleValue)?String(e.doubleValue):e.doubleValue),null!=e.intValue&&e.hasOwnProperty(\"intValue\")&&(\"number\"==typeof e.intValue?n.intValue=t.longs===String?String(e.intValue):e.intValue:n.intValue=t.longs===String?l.Long.prototype.toString.call(e.intValue):t.longs===Number?new l.LongBits(e.intValue.low>>>0,e.intValue.high>>>0).toNumber():e.intValue),null!=e.uintValue&&e.hasOwnProperty(\"uintValue\")&&(\"number\"==typeof e.uintValue?n.uintValue=t.longs===String?String(e.uintValue):e.uintValue:n.uintValue=t.longs===String?l.Long.prototype.toString.call(e.uintValue):t.longs===Number?new l.LongBits(e.uintValue.low>>>0,e.uintValue.high>>>0).toNumber(!0):e.uintValue),null!=e.sintValue&&e.hasOwnProperty(\"sintValue\")&&(\"number\"==typeof e.sintValue?n.sintValue=t.longs===String?String(e.sintValue):e.sintValue:n.sintValue=t.longs===String?l.Long.prototype.toString.call(e.sintValue):t.longs===Number?new l.LongBits(e.sintValue.low>>>0,e.sintValue.high>>>0).toNumber():e.sintValue),null!=e.boolValue&&e.hasOwnProperty(\"boolValue\")&&(n.boolValue=e.boolValue),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},e}(),e.Feature=function(){function e(e){if(this.tags=[],this.geometry=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.id=l.Long?l.Long.fromBits(0,0,!0):0,e.prototype.tags=l.emptyArray,e.prototype.type=0,e.prototype.geometry=l.emptyArray,e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,i=new c.com.mapbox.pb.Tile.Feature;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:i.id=e.uint64();break;case 2:if(i.tags&&i.tags.length||(i.tags=[]),2==(7&r))for(var o=e.uint32()+e.pos;e.pos<o;)i.tags.push(e.uint32());else i.tags.push(e.uint32());break;case 3:i.type=e.int32();break;case 4:if(i.geometry&&i.geometry.length||(i.geometry=[]),2==(7&r))for(o=e.uint32()+e.pos;e.pos<o;)i.geometry.push(e.uint32());else i.geometry.push(e.uint32());break;default:e.skipType(7&r)}}return i},e.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},e.fromObject=function(e){if(e instanceof c.com.mapbox.pb.Tile.Feature)return e;var t=new c.com.mapbox.pb.Tile.Feature;if(null!=e.id&&(l.Long?(t.id=l.Long.fromValue(e.id)).unsigned=!0:\"string\"
947==typeof e.id?t.id=parseInt(e.id,10):\"number\"==typeof e.id?t.id=e.id:\"object\"==typeof e.id&&(t.id=new l.LongBits(e.id.low>>>0,e.id.high>>>0).toNumber(!0))),e.tags){if(!Array.isArray(e.tags))throw TypeError(\".com.mapbox.pb.Tile.Feature.tags: array expected\");t.tags=[];for(var n=0;n<e.tags.length;++n)t.tags[n]=e.tags[n]>>>0}switch(e.type){case\"UNKNOWN\":case 0:t.type=0;break;case\"POINT\":case 1:t.type=1;break;case\"LINESTRING\":case 2:t.type=2;break;case\"POLYGON\":case 3:t.type=3}if(e.geometry){if(!Array.isArray(e.geometry))throw TypeError(\".com.mapbox.pb.Tile.Feature.geometry: array expected\");for(t.geometry=[],n=0;n<e.geometry.length;++n)t.geometry[n]=e.geometry[n]>>>0}return t},e.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.tags=[],n.geometry=[]),t.defaults){if(l.Long){var i=new l.Long(0,0,!0);n.id=t.longs===String?i.toString():t.longs===Number?i.toNumber():i}else n.id=t.longs===String?\"0\":0;n.type=t.enums===String?\"UNKNOWN\":0}if(null!=e.id&&e.hasOwnProperty(\"id\")&&(\"number\"==typeof e.id?n.id=t.longs===String?String(e.id):e.id:n.id=t.longs===String?l.Long.prototype.toString.call(e.id):t.longs===Number?new l.LongBits(e.id.low>>>0,e.id.high>>>0).toNumber(!0):e.id),e.tags&&e.tags.length){n.tags=[];for(var r=0;r<e.tags.length;++r)n.tags[r]=e.tags[r]}if(null!=e.type&&e.hasOwnProperty(\"type\")&&(n.type=t.enums===String?c.com.mapbox.pb.Tile.GeomType[e.type]:e.type),e.geometry&&e.geometry.length)for(n.geometry=[],r=0;r<e.geometry.length;++r)n.geometry[r]=e.geometry[r];return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},e}(),e.Layer=function(){function e(e){if(this.features=[],this.keys=[],this.values=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.version=1,e.prototype.name=\"\",e.prototype.features=l.emptyArray,e.prototype.keys=l.emptyArray,e.prototype.values=l.emptyArray,e.prototype.extent=4096,e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,i=new c.com.mapbox.pb.Tile.Layer;e.pos<n;){var r=e.uint32();switch(r>>>3){case 15:i.version=e.uint32();break;case 1:i.name=e.string();break;case 2:i.features&&i.features.length||(i.features=[]),i.features.push(c.com.mapbox.pb.Tile.Feature.decode(e,e.uint32()));break;case 3:i.keys&&i.keys.length||(i.keys=[]),i.keys.push(e.string());break;case 4:i.values&&i.values.length||(i.values=[]),i.values.push(c.com.mapbox.pb.Tile.Value.decode(e,e.uint32()));break;case 5:i.extent=e.uint32();break;default:e.skipType(7&r)}}if(!i.hasOwnProperty(\"version\"))throw l.ProtocolError(\"missing required 'version'\",{instance:i});if(!i.hasOwnProperty(\"name\"))throw l.ProtocolError(\"missing required 'name'\",{instance:i});return i},e.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},e.fromObject=function(e){if(e instanceof c.com.mapbox.pb.Tile.Layer)return e;var t=new c.com.mapbox.pb.Tile.Layer;if(null!=e.version&&(t.version=e.version>>>0),null!=e.name&&(t.name=String(e.name)),e.features){if(!Array.isArray(e.features))throw TypeError(\".com.mapbox.pb.Tile.Layer.features: array expected\");t.features=[];for(var n=0;n<e.features.length;++n){if(\"object\"!=typeof e.features[n])throw TypeError(\".com.mapbox.pb.Tile.Layer.features: object expected\");t.features[n]=c.com.mapbox.pb.Tile.Feature.fromObject(e.features[n])}}if(e.keys){if(!Array.isArray(e.keys))throw TypeError(\".com.mapbox.pb.Tile.Layer.keys: array expected\");for(t.keys=[],n=0;n<e.keys.length;++n)t.keys[n]=String(e.keys[n])}if(e.values){if(!Array.isArray(e.values))throw TypeError(\".com.mapbox.pb.Tile.Layer.values: array expected\");for(t.values=[],n=0;n<e.values.length;++n){if(\"object\"!=typeof e.values[n])throw TypeError(\".com.mapbox.pb.Tile.Layer.values: object expected\");t.values[n]=c.com.mapbox.pb.Tile.Value.fromObject(e.values[n])}}return null!=e.extent&&(t.extent=e.extent>>>0),t},e.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.features=[],n.keys=[],n.values=[]),t.defaults&&(n.name=\"\",n.extent=4096,n.version=1),null!=e.name&&e.hasOwnProperty(\"name\")&&(n.name=e.name),e.features&&e.features.length){n.features=[];for(var i=0;i<e.features.length;++i)n.features[i]=c.com.mapbox.pb.Tile.Feature.toObject(e.features[i],t)}if(e.keys&&e.keys.length)for(n.keys=[],i=0;i<e.keys.length;++i)n.keys[i]=e.keys[i];if(e.values&&e.values.length)for(n.values=[],i=0;i<e.values.length;++i)n.values[i]=c.com.mapbox.pb.Tile.Value.toObject(e.values[i],t);return null!=e.extent&&e.hasOwnProperty(\"extent\")&&(n.extent=e.extent),null!=e.version&&e.hasOwnProperty(\"version\")&&(n.version=e.version),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},e}(),e}(),i),r),o),e.exports=c},7018:e=>{\"use strict\";e.exports=function(e,t){for(var n=new Array(arguments.length-1),i=0,r=2,o=!0;r<arguments.length;)n[i++]=arguments[r++];return new Promise((function(r,s){n[i]=function(e){if(o)if(o=!1,e)s(e);else{for(var t=new Array(arguments.length-1),n=0;n<t.length;)t[n++]=arguments[n];r.apply(null,t)}};try{e.apply(t||null,n)}catch(e){o&&(o=!1,s(e))}}))}},2647:(e,t)=>{\"use strict\";var n=t;n.length=function(e){var t=e.length;if(!t)return 0;for(var n=0;--t%4>1&&\"=\"===e.charAt(t);)++n;return Math.ceil(3*e.length)/4-n};for(var i=new Array(64),r=new Array(123),o=0;o<64;)r[i[o]=o<26?o+65:o<52?o+71:o<62?o-4:o-59|43]=o++;n.encode=function(e,t,n){for(var r,o=null,s=[],a=0,l=0;t<n;){var c=e[t++];switch(l){case 0:s[a++]=i[c>>
vendor: 10,369 bytes, line 947
9472],r=(3&c)<<4,l=1;break;case 1:s[a++]=i[r|c>>4],r=(15&c)<<2,l=2;break;case 2:s[a++]=i[r|c>>6],s[a++]=i[63&c],l=0}a>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,s)),a=0)}return l&&(s[a++]=i[r],s[a++]=61,1===l&&(s[a++]=61)),o?(a&&o.push(String.fromCharCode.apply(String,s.slice(0,a))),o.join(\"\")):String.fromCharCode.apply(String,s.slice(0,a))};var s=\"invalid encoding\";n.decode=function(e,t,n){for(var i,o=n,a=0,l=0;l<e.length;){var c=e.charCodeAt(l++);if(61===c&&a>1)break;if(void 0===(c=r[c]))throw Error(s);switch(a){case 0:i=c,a=1;break;case 1:t[n++]=i<<2|(48&c)>>4,i=c,a=2;break;case 2:t[n++]=(15&i)<<4|(60&c)>>2,i=c,a=3;break;case 3:t[n++]=(3&i)<<6|c,a=0}}if(1===a)throw Error(s);return n-o},n.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},2922:e=>{\"use strict\";function t(){this._listeners={}}e.exports=t,t.prototype.on=function(e,t,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:n||this}),this},t.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var n=this._listeners[e],i=0;i<n.length;)n[i].fn===t?n.splice(i,1):++i;return this},t.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var n=[],i=1;i<arguments.length;)n.push(arguments[i++]);for(i=0;i<t.length;)t[i].fn.apply(t[i++].ctx,n)}return this}},7955:e=>{\"use strict\";function t(e){return\"undefined\"!=typeof Float32Array?function(){var t=new Float32Array([-0]),n=new Uint8Array(t.buffer),i=128===n[3];function r(e,i,r){t[0]=e,i[r]=n[0],i[r+1]=n[1],i[r+2]=n[2],i[r+3]=n[3]}function o(e,i,r){t[0]=e,i[r]=n[3],i[r+1]=n[2],i[r+2]=n[1],i[r+3]=n[0]}function s(e,i){return n[0]=e[i],n[1]=e[i+1],n[2]=e[i+2],n[3]=e[i+3],t[0]}function a(e,i){return n[3]=e[i],n[2]=e[i+1],n[1]=e[i+2],n[0]=e[i+3],t[0]}e.writeFloatLE=i?r:o,e.writeFloatBE=i?o:r,e.readFloatLE=i?s:a,e.readFloatBE=i?a:s}():function(){function t(e,t,n,i){var r=t<0?1:0;if(r&&(t=-t),0===t)e(1/t>0?0:2147483648,n,i);else if(isNaN(t))e(2143289344,n,i);else if(t>34028234663852886e22)e((r<<31|2139095040)>>>0,n,i);else if(t<11754943508222875e-54)e((r<<31|Math.round(t/1401298464324817e-60))>>>0,n,i);else{var o=Math.floor(Math.log(t)/Math.LN2);e((r<<31|o+127<<23|8388607&Math.round(t*Math.pow(2,-o)*8388608))>>>0,n,i)}}function s(e,t,n){var i=e(t,n),r=2*(i>>31)+1,o=i>>>23&255,s=8388607&i;return 255===o?s?NaN:r*(1/0):0===o?1401298464324817e-60*r*s:r*Math.pow(2,o-150)*(s+8388608)}e.writeFloatLE=t.bind(null,n),e.writeFloatBE=t.bind(null,i),e.readFloatLE=s.bind(null,r),e.readFloatBE=s.bind(null,o)}(),\"undefined\"!=typeof Float64Array?function(){var t=new Float64Array([-0]),n=new Uint8Array(t.buffer),i=128===n[7];function r(e,i,r){t[0]=e,i[r]=n[0],i[r+1]=n[1],i[r+2]=n[2],i[r+3]=n[3],i[r+4]=n[4],i[r+5]=n[5],i[r+6]=n[6],i[r+7]=n[7]}function o(e,i,r){t[0]=e,i[r]=n[7],i[r+1]=n[6],i[r+2]=n[5],i[r+3]=n[4],i[r+4]=n[3],i[r+5]=n[2],i[r+6]=n[1],i[r+7]=n[0]}function s(e,i){return n[0]=e[i],n[1]=e[i+1],n[2]=e[i+2],n[3]=e[i+3],n[4]=e[i+4],n[5]=e[i+5],n[6]=e[i+6],n[7]=e[i+7],t[0]}function a(e,i){return n[7]=e[i],n[6]=e[i+1],n[5]=e[i+2],n[4]=e[i+3],n[3]=e[i+4],n[2]=e[i+5],n[1]=e[i+6],n[0]=e[i+7],t[0]}e.writeDoubleLE=i?r:o,e.writeDoubleBE=i?o:r,e.readDoubleLE=i?s:a,e.readDoubleBE=i?a:s}():function(){function t(e,t,n,i,r,o){var s=i<0?1:0;if(s&&(i=-i),0===i)e(0,r,o+t),e(1/i>0?0:2147483648,r,o+n);else if(isNaN(i))e(0,r,o+t),e(2146959360,r,o+n);else if(i>17976931348623157e292)e(0,r,o+t),e((s<<31|2146435072)>>>0,r,o+n);else{var a;if(i<22250738585072014e-324)e((a=i/5e-324)>>>0,r,o+t),e((s<<31|a/4294967296)>>>0,r,o+n);else{var l=Math.floor(Math.log(i)/Math.LN2);1024===l&&(l=1023),e(4503599627370496*(a=i*Math.pow(2,-l))>>>0,r,o+t),e((s<<31|l+1023<<20|1048576*a&1048575)>>>0,r,o+n)}}}function s(e,t,n,i,r){var o=e(i,r+t),s=e(i,r+n),a=2*(s>>31)+1,l=s>>>20&2047,c=4294967296*(1048575&s)+o;return 2047===l?c?NaN:a*(1/0):0===l?5e-324*a*c:a*Math.pow(2,l-1075)*(c+4503599627370496)}e.writeDoubleLE=t.bind(null,n,0,4),e.writeDoubleBE=t.bind(null,i,4,0),e.readDoubleLE=s.bind(null,r,0,4),e.readDoubleBE=s.bind(null,o,4,0)}(),e}function n(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}function i(e,t,n){t[n]=e>>>24,t[n+1]=e>>>16&255,t[n+2]=e>>>8&255,t[n+3]=255&e}function r(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function o(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}e.exports=t(t)},8446:module=>{\"use strict\";function inquire(moduleName){try{var mod=eval(\"quire\".replace(/^/,\"re\"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}module.exports=inquire},5374:e=>{\"use strict\";e.exports=function(e,t,n){var i=n||8192,r=i>>>1,o=null,s=i;return function(n){if(n<1||n>r)return e(n);s+n>i&&(o=e(i),s=0);var a=t.call(o,s,s+=n);return 7&s&&(s=1+(7|s)),a}}},5226:(e,t)=>{\"use strict\";var n=t;n.length=function(e){for(var t=0,n=0,i=0;i<e.length;++i)(n=e.charCodeAt(i))<128?t+=1:n<2048?t+=2:55296==(64512&n)&&56320==(64512&e.charCodeAt(i+1))?(++i,t+=4):t+=3;return t},n.read=function(e,t,n){if(n-t<1)return\"\";for(var i,r=null,o=[],s=0;t<n;)(i=e[t++])<128?o[s++]=i:i>191&&i<224?o[s++]=(31&i)<<6|63&e[t++]:i>239&&i<365?(i=((7&i)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,o[s++]=55296+(i>>10),o[s++]=56320+(1023&i)):o[s++]=(15&i)<<12|(63&e[t++])<<6|63&e[t++],s>8191&&((r||(r=[])).push(String.fromCharCode.apply(String,o)),s=0);return r?(s&&r.push(String.fromCharCode.apply(String,o.slice(0,s))),r.join(\"\")):String.fromCharCode.apply(String,o.slice(0,s))},n.write=function(e,t,n){for(var i,r,o=n,s=0;s<e.length;++s)(i=e.charCodeAt(s))<128?t[n++]=i:i<2048?(t[n++]=i>>6|192,t[n++]=63&i|128):55296==(64512&i)&&56320==(64512&(r=e.charCodeAt(s+1)))?(i=65536+((1023&i)<<10)+(1023&r),++s,t[n++]=i>>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=63&i|128):(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=63&i|128);return n-o}},6925:(e,t)=>{var n={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function i(e){return(e=Math.round(e))<0?0:e>255?255:e}function r(e){return e<0?0:e>1?1:e}function o(e){return\"%\"===e[e.length-1]?i(parseFloat(e)/100*255):i(parseInt(e))}function s(e){return\"%\"===e[e.length-1]?r(parseFloat(e)/100):r(parseFloat(e))}function a(e,t,n){return n<0?n+=1:n>1&&(n-=1),6*n<1?e+(t-e)*n*6:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}try{t.parseCSSColor=function(e){var t,r=e.replace(/ /g,\"\").toLowerCase();if(r in n)return n[r].slice();if(\"#\"===r[0])return 4===r.length?(t=parseInt(r.substr(1),16))>=0&&t<=4095?[(3840&t)>>4|(3840&t)>>8,240&t|(240&t)>>4,15&t|(15&t)<<4,1]:null:7===r.length&&(t=parseInt(r.substr(1),16))>=0&&t<=16777215?[(16711680&t)>>16,(65280&t)>>8,255&t,1]:null;var l=r.indexOf(\"(\"),c=r.indexOf(\")\");
947if(-1!==l&&c+1===r.length){var u=r.substr(0,l),h=r.substr(l+1,c-(l+1)).split(\",\"),d=1;switch(u){case\"rgba\":if(4!==h.length)return null;d=s(h.pop());case\"rgb\":return 3!==h.length?null:[o(h[0]),o(h[1]),o(h[2]),d];case\"hsla\":if(4!==h.length)return null;d=s(h.pop());case\"hsl\":if(3!==h.length)return null;var p=(parseFloat(h[0])%360+360)%360/360,f=s(h[1]),m=s(h[2]),g=m<=.5?m*(f+1):m+f-m*f,v=2*m-g;return[i(255*a(v,g,p+1/3)),i(255*a(v,g,p)),i(255*a(v,g,p-1/3)),d];default:return null}}return null}}catch(e){}},1874:e=>{\"use strict\";function t(e,t,i){i=i||2;var o,s,a,l,h,d,f,m=t&&t.length,g=m?t[0]*i:e.length,v=n(e,0,g,i,!0),y=[];if(!v||v.next===v.prev)return y;if(m&&(v=function(e,t,i,r){var o,s,a,l=[];for(o=0,s=t.length;o<s;o++)(a=n(e,t[o]*r,o<s-1?t[o+1]*r:e.length,r,!1))===a.next&&(a.steiner=!0),l.push(p(a));for(l.sort(c),o=0;o<l.length;o++)i=u(l[o],i);return i}(e,t,v,i)),e.length>80*i){o=a=e[0],s=l=e[1];for(var x=i;x<g;x+=i)(h=e[x])<o&&(o=h),(d=e[x+1])<s&&(s=d),h>a&&(a=h),d>l&&(l=d);f=0!==(f=Math.max(a-o,l-s))?32767/f:0}return r(v,y,i,o,s,f,0),y}function n(e,t,n,i,r){var o,s;if(r===T(e,t,n,i)>0)for(o=t;o<n;o+=i)s=M(o,e[o],e[o+1],s);else for(o=n-i;o>=t;o-=i)s=M(o,e[o],e[o+1],s);return s&&v(s,s.next)&&(S(s),s=s.next),s}function i(e,t){if(!e)return e;t||(t=e);var n,i=e;do{if(n=!1,i.steiner||!v(i,i.next)&&0!==g(i.prev,i,i.next))i=i.next;else{if(S(i),(i=t=i.prev)===i.next)break;n=!0}}while(n||i!==t);return t}function r(e,t,n,c,u,h,p){if(e){!p&&h&&function(e,t,n,i){var r=e;do{0===r.z&&(r.z=d(r.x,r.y,t,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,function(e){var t,n,i,r,o,s,a,l,c=1;do{for(n=e,e=null,o=null,s=0;n;){for(s++,i=n,a=0,t=0;t<c&&(a++,i=i.nextZ);t++);for(l=c;a>0||l>0&&i;)0!==a&&(0===l||!i||n.z<=i.z)?(r=n,n=n.nextZ,a--):(r=i,i=i.nextZ,l--),o?o.nextZ=r:e=r,r.prevZ=o,o=r;n=i}o.nextZ=null,c*=2}while(s>1)}(r)}(e,c,u,h);for(var f,m,g=e;e.prev!==e.next;)if(f=e.prev,m=e.next,h?s(e,c,u,h):o(e))t.push(f.i/n|0),t.push(e.i/n|0),t.push(m.i/n|0),S(e),e=m.next,g=m.next;else if((e=m)===g){p?1===p?r(e=a(i(e),t,n),t,n,c,u,h,2):2===p&&l(e,t,n,c,u,h):r(i(e),t,n,c,u,h,1);break}}}function o(e){var t=e.prev,n=e,i=e.next;if(g(t,n,i)>=0)return!1;for(var r=t.x,o=n.x,s=i.x,a=t.y,l=n.y,c=i.y,u=r<o?r<s?r:s:o<s?o:s,h=a<l?a<c?a:c:l<c?l:c,d=r>o?r>s?r:s:o>s?o:s,p=a>l?a>c?a:c:l>c?l:c,m=i.next;m!==t;){if(m.x>=u&&m.x<=d&&m.y>=h&&m.y<=p&&f(r,a,o,l,s,c,m.x,m.y)&&g(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function s(e,t,n,i){var r=e.prev,o=e,s=e.next;if(g(r,o,s)>=0)return!1;for(var a=r.x,l=o.x,c=s.x,u=r.y,h=o.y,p=s.y,m=a<l?a<c?a:c:l<c?l:c,v=u<h?u<p?u:p:h<p?h:p,y=a>l?a>c?a:c:l>c?l:c,x=u>h?u>p?u:p:h>p?h:p,_=d(m,v,t,n,i),b=d(y,x,t,n,i),w=e.prevZ,M=e.nextZ;w&&w.z>=_&&M&&M.z<=b;){if(w.x>=m&&w.x<=y&&w.y>=v&&w.y<=x&&w!==r&&w!==s&&f(a,u,l,h,c,p,w.x,w.y)&&g(w.prev,w,w.next)>=0)return!1;if(w=w.prevZ,M.x>=m&&M.x<=y&&M.y>=v&&M.y<=x&&M!==r&&M!==s&&f(a,u,l,h,c,p,M.x,M.y)&&g(M.prev,M,M.next)>=0)return!1;M=M.nextZ}for(;w&&w.z>=_;){if(w.x>=m&&w.x<=y&&w.y>=v&&w.y<=x&&w!==r&&w!==s&&f(a,u,l,h,c,p,w.x,w.y)&&g(w.prev,w,w.next)>=0)return!1;w=w.prevZ}for(;M&&M.z<=b;){if(M.x>=m&&M.x<=y&&M.y>=v&&M.y<=x&&M!==r&&M!==s&&f(a,u,l,h,c,p,M.x,M.y)&&g(M.prev,M,M.next)>=0)return!1;M=M.nextZ}return!0}function a(e,t,n){var r=e;do{var o=r.prev,s=r.next.next;!v(o,s)&&y(o,r,r.next,s)&&b(o,s)&&b(s,o)&&(t.push(o.i/n|0),t.push(r.i/n|0),t.push(s.i/n|0),S(r),S(r.next),r=e=s),r=r.next}while(r!==e);return i(r)}function l(e,t,n,o,s,a){var l=e;do{for(var c=l.next.next;c!==l.prev;){if(l.i!==c.i&&m(l,c)){var u=w(l,c);return l=i(l,l.next),u=i(u,u.next),r(l,t,n,o,s,a,0),void r(u,t,n,o,s,a,0)}c=c.next}l=l.next}while(l!==e)}function c(e,t){return e.x-t.x}function u(e,t){var n=function(e,t){var n,i=t,r=e.x,o=e.y,s=-1/0;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){var a=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(a<=r&&a>s&&(s=a,n=i.x<i.next.x?i:i.next,a===r))return n}i=i.next}while(i!==t);if(!n)return null;var l,c=n,u=n.x,d=n.y,p=1/0;i=n;do{r>=i.x&&i.x>=u&&r!==i.x&&f(o<d?r:s,o,u,d,o<d?s:r,o,i.x,i.y)&&(l=Math.abs(o-i.y)/(r-i.x),b(i,e)&&(l<p||l===p&&(i.x>n.x||i.x===n.x&&h(n,i)))&&(n=i,p=l)),i=i.next}while(i!==c);return n}(e,t);if(!n)return t;var r=w(n,e);return i(r,r.next),i(n,n.next)}function h(e,t){return g(e.prev,e,t.prev)<0&&g(t.next,e,e.next)<0}function d(e,t,n,i,r){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*r|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*r|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function p(e){var t=e,n=e;do{(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next}
vendor: 2,812 bytes, line 947
947while(t!==e);return n}function f(e,t,n,i,r,o,s,a){return(r-s)*(t-a)>=(e-s)*(o-a)&&(e-s)*(i-a)>=(n-s)*(t-a)&&(n-s)*(o-a)>=(r-s)*(i-a)}function m(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&y(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(b(e,t)&&b(t,e)&&function(e,t){var n=e,i=!1,r=(e.x+t.x)/2,o=(e.y+t.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&r<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==e);return i}(e,t)&&(g(e.prev,e,t.prev)||g(e,t.prev,t))||v(e,t)&&g(e.prev,e,e.next)>0&&g(t.prev,t,t.next)>0)}function g(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function v(e,t){return e.x===t.x&&e.y===t.y}function y(e,t,n,i){var r=_(g(e,t,n)),o=_(g(e,t,i)),s=_(g(n,i,e)),a=_(g(n,i,t));return r!==o&&s!==a||!(0!==r||!x(e,n,t))||!(0!==o||!x(e,i,t))||!(0!==s||!x(n,e,i))||!(0!==a||!x(n,t,i))}function x(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function _(e){return e>0?1:e<0?-1:0}function b(e,t){return g(e.prev,e,e.next)<0?g(e,t,e.next)>=0&&g(e,e.prev,t)>=0:g(e,t,e.prev)<0||g(e,e.next,t)<0}function w(e,t){var n=new E(e.i,e.x,e.y),i=new E(t.i,t.x,t.y),r=e.next,o=t.prev;return e.next=t,t.prev=e,n.next=r,r.prev=n,i.next=n,n.prev=i,o.next=i,i.prev=o,i}function M(e,t,n,i){var r=new E(e,t,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function S(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 E(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function T(e,t,n,i){for(var r=0,o=t,s=n-i;o<n;o+=i)r+=(e[s]-e[o])*(e[o+1]+e[s+1]),s=o;return r}e.exports=t,e.exports.default=t,t.deviation=function(e,t,n,i){var r=t&&t.length,o=r?t[0]*n:e.length,s=Math.abs(T(e,0,o,n));if(r)for(var a=0,l=t.length;a<l;a++){var c=t[a]*n,u=a<l-1?t[a+1]*n:e.length;s-=Math.abs(T(e,c,u,n))}var h=0;for(a=0;a<i.length;a+=3){var d=i[a]*n,p=i[a+1]*n,f=i[a+2]*n;h+=Math.abs((e[d]-e[f])*(e[p+1]-e[d+1])-(e[d]-e[p])*(e[f+1]-e[d+1]))}return 0===s&&0===h?0:Math.abs((h-s)/s)},t.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},i=0,r=0;r<e.length;r++){for(var o=0;o<e[r].length;o++)for(var s=0;s<t;s++)n.vertices.push(e[r][o][s]);r>0&&(i+=e[r-1].length,n.holes.push(i))}return n}},242:(e,t,n)=>{\"use strict\";function i(e,t,n,o){for(var s,a=o,l=n-t>>1,c=n-t,u=e[t],h=e[t+1],d=e[n],p=e[n+1],f=t+3;f<n;f+=3){var m=r(e[f],e[f+1],u,h,d,p);if(m>a)s=f,a=m;else if(m===a){var g=Math.abs(f-l);g<c&&(s=f,c=g)}}a>o&&(s-t>3&&i(e,t,s,o),e[s+2]=a,n-s>3&&i(e,s,n,o))}function r(e,t,n,i,r,o){var s=r-n,a=o-i;if(0!==s||0!==a){var l=((e-n)*s+(t-i)*a)/(s*s+a*a);l>
vendor: 4,127 bytes, line 947
9471?(n=r,i=o):l>0&&(n+=s*l,i+=a*l)}return(s=e-n)*s+(a=t-i)*a}function o(e,t,n,i){var r={id:void 0===e?null:e,type:t,geometry:n,tags:i,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(e){var t=e.geometry,n=e.type;if(\"Point\"===n||\"MultiPoint\"===n||\"LineString\"===n)s(e,t);else if(\"Polygon\"===n||\"MultiLineString\"===n)for(var i=0;i<t.length;i++)s(e,t[i]);else if(\"MultiPolygon\"===n)for(i=0;i<t.length;i++)for(var r=0;r<t[i].length;r++)s(e,t[i][r])}(r),r}function s(e,t){for(var n=0;n<t.length;n+=3)e.minX=Math.min(e.minX,t[n]),e.minY=Math.min(e.minY,t[n+1]),e.maxX=Math.max(e.maxX,t[n]),e.maxY=Math.max(e.maxY,t[n+1])}function a(e,t,n,i){if(t.geometry){var r=t.geometry.coordinates,s=t.geometry.type,h=Math.pow(n.tolerance/((1<<n.maxZoom)*n.extent),2),d=[],p=t.id;if(n.promoteId?p=t.properties[n.promoteId]:n.generateId&&(p=i||0),\"Point\"===s)l(r,d);else if(\"MultiPoint\"===s)for(var f=0;f<r.length;f++)l(r[f],d);else if(\"LineString\"===s)c(r,d,h,!1);else if(\"MultiLineString\"===s){if(n.lineMetrics){for(f=0;f<r.length;f++)d=[],c(r[f],d,h,!1),e.push(o(p,\"LineString\",d,t.properties));return}u(r,d,h,!1)}else if(\"Polygon\"===s)u(r,d,h,!0);else{if(\"MultiPolygon\"!==s){if(\"GeometryCollection\"===s){for(f=0;f<t.geometry.geometries.length;f++)a(e,{id:p,geometry:t.geometry.geometries[f],properties:t.properties},n,i);return}throw new Error(\"Input data is not a valid GeoJSON object.\")}for(f=0;f<r.length;f++){var m=[];u(r[f],m,h,!0),d.push(m)}}e.push(o(p,s,d,t.properties))}}function l(e,t){t.push(h(e[0])),t.push(d(e[1])),t.push(0)}function c(e,t,n,r){for(var o,s,a=0,l=0;l<e.length;l++){var c=h(e[l][0]),u=d(e[l][1]);t.push(c),t.push(u),t.push(0),l>0&&(a+=r?(o*u-c*s)/2:Math.sqrt(Math.pow(c-o,2)+Math.pow(u-s,2))),o=c,s=u}var p=t.length-3;t[2]=1,i(t,0,p,n),t[p+2]=1,t.size=Math.abs(a),t.start=0,t.end=t.size}function u(e,t,n,i){for(var r=0;r<e.length;r++){var o=[];c(e[r],o,n,i),t.push(o)}}function h(e){return e/360+.5}function d(e){var t=Math.sin(e*Math.PI/180),n=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return n<0?0:n>1?1:n}function p(e,t,n,i,r,s,a,l){if(i/=t,s>=(n/=t)&&a<i)return e;if(a<n||s>=i)return null;for(var c=[],u=0;u<e.length;u++){var h=e[u],d=h.geometry,p=h.type,g=0===r?h.minX:h.minY,y=0===r?h.maxX:h.maxY;if(g>=n&&y<i)c.push(h);else if(!(y<n||g>=i)){var x=[];if(\"Point\"===p||\"MultiPoint\"===p)f(d,x,n,i,r);else if(\"LineString\"===p)m(d,x,n,i,r,!1,l.lineMetrics);else if(\"MultiLineString\"===p)v(d,x,n,i,r,!1);else if(\"Polygon\"===p)v(d,x,n,i,r,!0);else if(\"MultiPolygon\"===p)for(var _=0;_<d.length;_++){var b=[];v(d[_],b,n,i,r,!0),b.length&&x.push(b)}if(x.length){if(l.lineMetrics&&\"LineString\"===p){for(_=0;_<x.length;_++)c.push(o(h.id,p,x[_],h.tags));continue}\"LineString\"!==p&&\"MultiLineString\"!==p||(1===x.length?(p=\"LineString\",x=x[0]):p=\"MultiLineString\"),\"Point\"!==p&&\"MultiPoint\"!==p||(p=3===x.length?\"Point\":\"MultiPoint\"),c.push(o(h.id,p,x,h.tags))}}}return c.length?c:null}function f(e,t,n,i,r){for(var o=0;o<e.length;o+=3){var s=e[o+r];s>=n&&s<=i&&(t.push(e[o]),t.push(e[o+1]),t.push(e[o+2]))}}function m(e,t,n,i,r,o,s){for(var a,l,c=g(e),u=0===r?x:_,h=e.start,d=0;d<e.length-3;d+=3){var p=e[d],f=e[d+1],m=e[d+2],v=e[d+3],b=e[d+4],w=0===r?p:f,M=0===r?v:b,S=!1;s&&(a=Math.sqrt(Math.pow(p-v,2)+Math.pow(f-b,2))),w<n?M>n&&(l=u(c,p,f,v,b,n),s&&(c.start=h+a*l)):w>i?M<i&&(l=u(c,p,f,v,b,i),s&&(c.start=h+a*l)):y(c,p,f,m),M<n&&w>=n&&(l=u(c,p,f,v,b,n),S=!0),M>i&&w<=i&&(l=u(c,p,f,v,b,i),S=!0),!o&&S&&(s&&(c.end=h+a*l),t.push(c),c=g(e)),s&&(h+=a)}var E=e.length-3;p=e[E],f=e[E+1],m=e[E+2],(w=0===r?p:f)>=n&&w<=i&&y(c,p,f,m),E=c.length-3,o&&E>=3&&(c[E]!==c[0]||c[E+1]!==c[1])&&y(c,c[0],c[1],c[2]),c.length&&t.push(c)}function g(e){var t=[];return t.size=e.size,t.start=e.start,t.end=e.end,t}function v(e,t,n,i,r,o){for(var s=0;s<e.length;s++)m(e[s],t,n,i,r,o,!1)}function y(e,t,n,i){e.push(t),e.push(n),e.push(i)}function x(e,t,n,i,r,o){var s=(o-t)/(i-t);return e.push(o),e.push(n+(r-n)*s),e.push(1),s}function _(e,t,n,i,r,o){var s=(o-n)/(r-n);return e.push(t+(i-t)*s),e.push(o),e.push(1),s}function b(e,t){for(var n=[],i=0;i<e.length;i++){var r,s=e[i],a=s.type;
947if(\"Point\"===a||\"MultiPoint\"===a||\"LineString\"===a)r=w(s.geometry,t);else if(\"MultiLineString\"===a||\"Polygon\"===a){r=[];for(var l=0;l<s.geometry.length;l++)r.push(w(s.geometry[l],t))}else if(\"MultiPolygon\"===a)for(r=[],l=0;l<s.geometry.length;l++){for(var c=[],u=0;u<s.geometry[l].length;u++)c.push(w(s.geometry[l][u],t));r.push(c)}n.push(o(s.id,a,r,s.tags))}return n}function w(e,t){var n=[];n.size=e.size,void 0!==e.start&&(n.start=e.start,n.end=e.end);for(var i=0;i<e.length;i+=3)n.push(e[i]+t,e[i+1],e[i+2]);return n}function M(e,t){if(e.transformed)return e;var n,i,r,o=1<<e.z,s=e.x,a=e.y;for(n=0;n<e.features.length;n++){var l=e.features[n],c=l.geometry,u=l.type;if(l.geometry=[],1===u)for(i=0;i<c.length;i+=2)l.geometry.push(S(c[i],c[i+1],t,o,s,a));else for(i=0;i<c.length;i++){var h=[];for(r=0;r<c[i].length;r+=2)h.push(S(c[i][r],c[i][r+1],t,o,s,a));l.geometry.push(h)}}return e.transformed=!0,e}function S(e,t,n,i,r,o){return[Math.round(n*(e*i-r)),Math.round(n*(t*i-o))]}function E(e,t,n,i,r){for(var o=t===r.maxZoom?0:r.tolerance/((1<<t)*r.extent),s={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:n,y:i,z:t,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},a=0;a<e.length;a++){s.numFeatures++,T(s,e[a],o,r);var l=e[a].minX,c=e[a].minY,u=e[a].maxX,h=e[a].maxY;l<s.minX&&(s.minX=l),c<s.minY&&(s.minY=c),u>s.maxX&&(s.maxX=u),h>s.maxY&&(s.maxY=h)}return s}function T(e,t,n,i){var r=t.geometry,o=t.type,s=[];if(\"Point\"===o||\"MultiPoint\"===o)for(var a=0;a<r.length;a+=3)s.push(r[a]),s.push(r[a+1]),e.numPoints++,e.numSimplified++;else if(\"LineString\"===o)A(s,r,e,n,!1,!1);else if(\"MultiLineString\"===o||\"Polygon\"===o)for(a=0;a<r.length;a++)A(s,r[a],e,n,\"Polygon\"===o,0===a);else if(\"MultiPolygon\"===o)for(var l=0;l<r.length;l++){var c=r[l];for(a=0;a<c.length;a++)A(s,c[a],e,n,!0,0===a)}if(s.length){var u=t.tags||null;if(\"LineString\"===o&&i.lineMetrics){for(var h in u={},t.tags)u[h]=t.tags[h];u.mapbox_clip_start=r.start/r.size,u.mapbox_clip_end=r.end/r.size}var d={geometry:s,type:\"Polygon\"===o||\"MultiPolygon\"===o?3:\"LineString\"===o||\"MultiLineString\"===o?2:1,tags:u};null!==t.id&&(d.id=t.id),e.features.push(d)}}function A(e,t,n,i,r,o){var s=i*i;if(i>0&&t.size<(r?s:i))n.numPoints+=t.length/3;else{for(var a=[],l=0;l<t.length;l+=3)(0===i||t[l+2]>s)&&(n.numSimplified++,a.push(t[l]),a.push(t[l+1])),n.numPoints++;r&&function(e,t){for(var n=0,i=0,r=e.length,o=r-2;i<r;o=i,i+=2)n+=(e[i]-e[o])*(e[i+1]+e[o+1]);if(n>0===t)for(i=0,r=e.length;i<r/2;i+=2){var s=e[i],a=e[i+1];e[i]=e[r-2-i],e[i+1]=e[r-1-i],e[r-2-i]=s,e[r-1-i]=a}}(a,o),e.push(a)}}function L(e,t){return new C(e,t)}function C(e,t){var n=(t=this.options=function(e,t){for(var n in t)e[n]=t[n];return e}(Object.create(this.options),t)).debug;if(n&&console.time(\"preprocess data\"),t.maxZoom<0||t.maxZoom>24)throw new Error(\"maxZoom should be in the 0-24 range\");if(t.promoteId&&t.generateId)throw new Error(\"promoteId and generateId cannot be used together.\");var i=function(e,t){var n=[];if(\"FeatureCollection\"===e.type)for(var i=0;i<e.features.length;i++)a(n,e.features[i],t,i);else\"Feature\"===e.type?a(n,e,t):a(n,{geometry:e},t);return n}(e,t);this.tiles={},this.tileCoords=[],n&&(console.timeEnd(\"preprocess data\"),console.log(\"index: maxZoom: %d, maxPoints: %d\",t.indexMaxZoom,t.indexMaxPoints),console.time(\"generate tiles\"),this.stats={},this.total=0),i=function(e,t){var n=t.buffer/t.extent,i=e,r=p(e,1,-1-n,n,0,-1,2,t),o=p(e,1,1-n,2+n,0,-1,2,t);return(r||o)&&(i=p(e,1,-n,1+n,0,-1,2,t)||[],r&&(i=b(r,1).concat(i)),o&&(i=i.concat(b(o,-1)))),i}(i,t),i.length&&this.splitTile(i,0,0,0),n&&(i.length&&console.log(\"features: %d, points: %d\",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd(\"generate tiles\"),console.log(\"tiles generated:\",this.total,JSON.stringify(this.stats)))}function P(e,t,n){return 32*((1<<e)*n+t)+e}n.r(t),n.d(t,{default:()=>L}),C.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},C.prototype.splitTile=function(e,t,n,i,r,o,s){for(var a=[e,t,n,i],l=this.options,c=l.debug;a.length;){i=a.pop(),n=a.pop(),t=a.pop(),e=a.pop();var u=1<<t,h=P(t,n,i),d=this.tiles[h];if(!d&&(c>1&&console.time(\"creation\"),d=this.tiles[h]=E(e,t,n,i,l),this.tileCoords.push({z:t,x:n,y:i}),c)){c>1&&(console.log(\"tile z%d-%d-%d (features: %d, points: %d, simplified: %d)\",t,n,i,d.numFeatures,d.numPoints,d.numSimplified),console.timeEnd(\"creation\"));var f=\"z\"+t;this.stats[f]=(this.stats[f]||0)+1,this.total++}if(d.source=e,r){if(t===l.maxZoom||t===r)continue;var m=1<<r-t;if(n!==Math.floor(o/m)||i!==Math.floor(s/m))continue}else if(t===l.indexMaxZoom||d.numPoints<=l.indexMaxPoints)continue;if(d.source=null,0!==e.length){c>1&&console.time(\"clipping\");var g,v,y,x,_,b,w=.5*l.buffer/l.extent,M=.5-w,S=.5+w,T=1+w;g=v=y=x=null,_=p(e,u,n-w,n+S,0,d.minX,d.maxX,l),b=p(e,u,n+M,n+T,0,d.minX,d.maxX,l),e=null,_&&(g=p(_,u,i-w,i+S,1,d.minY,d.maxY,l),v=p(_,u,i+M,i+T,1,d.minY,d.maxY,l),_=null),b&&(y=p(b,u,i-w,i+S,1,d.minY,d.maxY,l),x=p(b,u,i+M,i+T,1,d.minY,d.maxY,l),b=null),c>1&&console.timeEnd(\"clipping\"),a.push(g||[],t+1,2*n,2*i),a.push(v||[],t+1,2*n,2*i+1),a.push(y||[],t+1,2*n+1,2*i),a.push(x||[],t+1,2*n+1,2*i+1)}}},C.prototype.getTile=function(e,t,n){var i=this.options,r=i.extent,o=i.debug;if(e<0||e>24)return null;var s=1<<e,a=P(e,t=(t%s+s)%s,n);if(this.tiles[a])return M(this.tiles[a],r);o>1&&console.log(\"drilling down to z%d-%d-%d\",e,t,n);for(var l,c=e,u=t,h=n;!l&&c>0;)c--,u=Math.floor(u/2),h=Math.floor(h/2),l=this.tiles[P(c,u,h)];return l&&l.source?(o>1&&console.log(\"found parent tile z%d-%d-%d\",c,u,h),o>1&&console.time(\"drilling down\"),this.splitTile(l.source,c,u,h,e,t,n),o>1&&console.timeEnd(\"drilling down\"),this.tiles[a]?M(this.tiles[a],r):null):null}},5133:e=>{e.exports=n;var t=null;try{t=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(e){}function n(e,t,n){this.low=0|e,this.high=0|t,this.unsigned=!!n}function i(e){return!0===(e&&e.__isLong__)}n.prototype.__isLong__,Object.defineProperty(n.prototype,\"__isLong__\",{value:!0}),n.isLong=i;var r={},o={};function s(e,t){var n,i,s;return t?(s=0<=(e>>>=0)&&e<256)&&(i=o[e])?i:(n=l(e,(0|e)<0?-1:0,!0),s&&(o[e]=n),n):(s=-128<=(e|=0)&&e<128)&&(i=r[e])?i:(n=l(e,e<0?-1:0,!1),s&&(r[e]=n),n)}function a(e,t){if(isNaN(e))return t?v:g;if(t){if(e<0)return v;if(e>=p)return w}else{if(e<=-f)return M;if(e+1>=f)return b}return e<0?a(-e,t).neg():l(e%d|0,e/d|0,t)}function l(e,t,i){return new n(e,t,i)}n.fromInt=s,n.fromNumber=a,n.fromBits=l;var c=Math.pow;function u(e,t,n){if(0===e.length)throw Error(\"empty string\");if(\"NaN\"===e||\"Infinity\"===e||\"+Infinity\"===e||\"-Infinity\"===e)return g;if(\"number\"==typeof t?(n=t,t=!1):t=!!t,(n=n||10)<2||36<n)throw RangeError(\"radix\");var i;if((i=e.indexOf(\"-\"))>0)throw Error(\"interior hyphen\");if(0===i)return u(e.substring(1),t,n).neg();for(var r=a(c(n,8)),o=g,s=0;s<e.length;s+=8){var l=Math.min(8,e.length-s),h=parseInt(e.substring(s,s+l),n);if(l<8){var d=a(c(n,l));o=o.mul(d).add(a(h))}else o=(o=o.mul(r)).add(a(h))}return o.unsigned=t,o}
947function h(e,t){return\"number\"==typeof e?a(e,t):\"string\"==typeof e?u(e,t):l(e.low,e.high,\"boolean\"==typeof t?t:e.unsigned)}n.fromString=u,n.fromValue=h;var d=4294967296,p=d*d,f=p/2,m=s(1<<24),g=s(0);n.ZERO=g;var v=s(0,!0);n.UZERO=v;var y=s(1);n.ONE=y;var x=s(1,!0);n.UONE=x;var _=s(-1);n.NEG_ONE=_;var b=l(-1,2147483647,!1);n.MAX_VALUE=b;var w=l(-1,-1,!0);n.MAX_UNSIGNED_VALUE=w;var M=l(0,-2147483648,!1);n.MIN_VALUE=M;var S=n.prototype;S.toInt=function(){return this.unsigned?this.low>>>0:this.low},S.toNumber=function(){return this.unsigned?(this.high>>>0)*d+(this.low>>>0):this.high*d+(this.low>>>0)},S.toString=function(e){if((e=e||10)<2||36<e)throw RangeError(\"radix\");if(this.isZero())return\"0\";if(this.isNegative()){if(this.eq(M)){var t=a(e),n=this.div(t),i=n.mul(t).sub(this);return n.toString(e)+i.toInt().toString(e)}return\"-\"+this.neg().toString(e)}for(var r=a(c(e,6),this.unsigned),o=this,s=\"\";;){var l=o.div(r),u=(o.sub(l.mul(r)).toInt()>>>0).toString(e);if((o=l).isZero())return u+s;for(;u.length<6;)u=\"0\"+u;s=\"\"+u+s}},S.getHighBits=function(){return this.high},S.getHighBitsUnsigned=function(){return this.high>>>0},S.getLowBits=function(){return this.low},S.getLowBitsUnsigned=function(){return this.low>>>0},S.getNumBitsAbs=function(){if(this.isNegative())return this.eq(M)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&!(e&1<<t);t--);return 0!=this.high?t+33:t+1},S.isZero=function(){return 0===this.high&&0===this.low},S.eqz=S.isZero,S.isNegative=function(){return!this.unsigned&&this.high<0},S.isPositive=function(){return this.unsigned||this.high>=0},S.isOdd=function(){return!(1&~this.low)},S.isEven=function(){return!(1&this.low)},S.equals=function(e){return i(e)||(e=h(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low},S.eq=S.equals,S.notEquals=function(e){return!this.eq(e)},S.neq=S.notEquals,S.ne=S.notEquals,S.lessThan=function(e){return this.comp(e)<0},S.lt=S.lessThan,S.lessThanOrEqual=function(e){return this.comp(e)<=0},S.lte=S.lessThanOrEqual,S.le=S.lessThanOrEqual,S.greaterThan=function(e){return this.comp(e)>0},S.gt=S.greaterThan,S.greaterThanOrEqual=function(e){return this.comp(e)>=0},S.gte=S.greaterThanOrEqual,S.ge=S.greaterThanOrEqual,S.compare=function(e){if(i(e)||(e=h(e)),this.eq(e))return 0;var t=this.isNegative(),n=e.isNegative();return t&&!n?-1:!t&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},S.comp=S.compare,S.negate=function(){return!this.unsigned&&this.eq(M)?M:this.not().add(y)},S.neg=S.negate,S.add=function(e){i(e)||(e=h(e));var t=this.high>>>16,n=65535&this.high,r=this.low>>>16,o=65535&this.low,s=e.high>>>16,a=65535&e.high,c=e.low>>>16,u=0,d=0,p=0,f=0;return p+=(f+=o+(65535&e.low))>>>16,d+=(p+=r+c)>>>16,u+=(d+=n+a)>>>16,u+=t+s,l((p&=65535)<<16|(f&=65535),(u&=65535)<<16|(d&=65535),this.unsigned)},S.subtract=function(e){return i(e)||(e=h(e)),this.add(e.neg())},S.sub=S.subtract,S.multiply=function(e){if(this.isZero())return g;if(i(e)||(e=h(e)),t)return l(t.mul(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(e.isZero())return g;if(this.eq(M))return e.isOdd()?M:g;if(e.eq(M))return this.isOdd()?M:g;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(m)&&e.lt(m))return a(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,r=65535&this.high,o=this.low>>>16,s=65535&this.low,c=e.high>>>16,u=65535&e.high,d=e.low>>>16,p=65535&e.low,f=0,v=0,y=0,x=0;return y+=(x+=s*p)>>>16,v+=(y+=o*p)>>>16,y&=65535,v+=(y+=s*d)>>>16,f+=(v+=r*p)>>>16,v&=65535,f+=(v+=o*d)>>>16,v&=65535,f+=(v+=s*u)>>>16,f+=n*p+r*d+o*u+s*c,l((y&=65535)<<16|(x&=65535),(f&=65535)<<16|(v&=65535),this.unsigned)},S.mul=S.multiply,S.divide=function(e){if(i(e)||(e=h(e)),e.isZero())throw Error(\"division by zero\");var n,r,o;if(t)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?l((this.unsigned?t.div_u:t.div_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?v:g;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return v;if(e.gt(this.shru(1)))return x;o=v}else{if(this.eq(M))return e.eq(y)||e.eq(_)?M:e.eq(M)?y:(n=this.shr(1).div(e).shl(1)).eq(g)?e.isNegative()?y:_:(r=this.sub(e.mul(n)),o=n.add(r.div(e)));if(e.eq(M))return this.unsigned?v:g;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();o=g}for(r=this;r.gte(e);){n=Math.max(1,Math.floor(r.toNumber()/e.toNumber()));for(var s=Math.ceil(Math.log(n)/Math.LN2),u=s<=48?1:c(2,s-48),d=a(n),p=d.mul(e);p.isNegative()||p.gt(r);)p=(d=a(n-=u,this.unsigned)).mul(e);d.isZero()&&(d=y),o=o.add(d),r=r.sub(p)}return o},S.div=S.divide,S.modulo=function(e){return i(e)||(e=h(e)),t?l((this.unsigned?t.rem_u:t.rem_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},S.mod=S.modulo,S.rem=S.modulo,S.not=function(){return l(~this.low,~this.high,this.unsigned)},S.and=function(e){return i(e)||(e=h(e)),l(this.low&e.low,this.high&e.high,this.unsigned)},S.or=function(e){return i(e)||(e=h(e)),l(this.low|e.low,this.high|e.high,this.unsigned)},S.xor=function(e){return i(e)||(e=h(e)),l(this.low^e.low,this.high^e.high,this.unsigned)},S.shiftLeft=function(e){return i(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?l(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):l(0,this.low<<e-32,this.unsigned)},S.shl=S.shiftLeft,S.shiftRight=function(e){return i(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?l(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):l(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},S.shr=S.shiftRight,S.shiftRightUnsigned=function(e){if(i(e)&&(e=e.toInt()),0==(e&=63))return this;var t=this.high;return e<32?l(this.low>>>e|t<<32-e,t>>>e,this.unsigned):l(32===e?t:t>>>e-32,0,this.unsigned)},S.shru=S.shiftRightUnsigned,S.shr_u=S.shiftRightUnsigned,S.toSigned=function(){return this.unsigned?l(this.low,this.high,!1):this},S.toUnsigned=function(){return this.unsigned?this:l(this.low,this.high,!0)},S.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},S.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},S.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},n.fromBytes=function(e,t,i){return i?n.fromBytesLE(e,t):n.fromBytesBE(e,t)},n.fromBytesLE=function(e,t){return new n(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},n.fromBytesBE=function(e,t){return new n(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}},6918:(e,t,n)=>{\"use strict\";e.exports=n(3729)}
947,3729:(e,t,n)=>{\"use strict\";var i=t;function r(){i.util._configure(),i.Writer._configure(i.BufferWriter),i.Reader._configure(i.BufferReader)}i.build=\"minimal\",i.Writer=n(8116),i.BufferWriter=n(1819),i.Reader=n(2461),i.BufferReader=n(9117),i.util=n(1679),i.rpc=n(8082),i.roots=n(575),i.configure=r,r()},2461:(e,t,n)=>{\"use strict\";e.exports=l;var i,r=n(1679),o=r.LongBits,s=r.utf8;function a(e,t){return RangeError(\"index out of range: \"+e.pos+\" + \"+(t||1)+\" > \"+e.len)}function l(e){this.buf=e,this.pos=0,this.len=e.length}var c,u=\"undefined\"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new l(e);throw Error(\"illegal buffer\")}:function(e){if(Array.isArray(e))return new l(e);throw Error(\"illegal buffer\")},h=function(){return r.Buffer?function(e){return(l.create=function(e){return r.Buffer.isBuffer(e)?new i(e):u(e)})(e)}:u};function d(){var e=new o(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw a(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw a(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error(\"invalid varint encoding\")}function p(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function f(){if(this.pos+8>this.len)throw a(this,8);return new o(p(this.buf,this.pos+=4),p(this.buf,this.pos+=4))}l.create=h(),l.prototype._slice=r.Array.prototype.subarray||r.Array.prototype.slice,l.prototype.uint32=(c=4294967295,function(){if(c=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return c;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return c}),l.prototype.int32=function(){return 0|this.uint32()},l.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)},l.prototype.bool=function(){return 0!==this.uint32()},l.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return p(this.buf,this.pos+=4)},l.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return 0|p(this.buf,this.pos+=4)},l.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var e=r.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},l.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var e=r.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},l.prototype.bytes=function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw a(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,n):t===n?new this.buf.constructor(0):this._slice.call(this.buf,t,n)},l.prototype.string=function(){var e=this.bytes();return s.read(e,0,e.length)},l.prototype.skip=function(e){if(\"number\"==typeof e){if(this.pos+e>this.len)throw a(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw a(this)}while(128&this.buf[this.pos++]);return this},l.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error(\"invalid wire type \"+e+\" at offset \"+this.pos)}return this},l._configure=function(e){i=e,l.create=h(),i._configure();var t=r.Long?\"toLong\":\"toNumber\";r.merge(l.prototype,{int64:function(){return d.call(this)[t](!1)},uint64:function(){return d.call(this)[t](!0)},sint64:function(){return d.call(this).zzDecode()[t](!1)},fixed64:function(){return f.call(this)[t](!0)},sfixed64:function(){return f.call(this)[t](!1)}})}},9117:(e,t,n)=>{\"use strict\";e.exports=o;var i=n(2461);(o.prototype=Object.create(i.prototype)).constructor=o;var r=n(1679);function o(e){i.call(this,e)}o._configure=function(){r.Buffer&&(o.prototype._slice=r.Buffer.prototype.slice)},o.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString(\"utf-8\",this.pos,this.pos=Math.min(this.pos+e,this.len))},o._configure()},575:e=>{\"use strict\";e.exports={}},8082:(e,t,n)=>{\"use strict\";t.Service=n(7927)},7927:(e,t,n)=>{\"use strict\";e.exports=r;var i=n(1679);function r(e,t,n){if(\"function\"!=typeof e)throw TypeError(\"rpcImpl must be a function\");i.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(n)}(r.prototype=Object.create(i.EventEmitter.prototype)).constructor=r,r.prototype.rpcCall=function e(t,n,r,o,s){if(!o)throw TypeError(\"request must be specified\");var a=this;if(!s)return i.asPromise(e,a,t,n,r,o);if(a.rpcImpl)try{return a.rpcImpl(t,n[a.requestDelimited?\"encodeDelimited\":\"encode\"](o).finish(),(function(e,n){if(e)return a.emit(\"error\",e,t),s(e);if(null!==n){if(!(n instanceof r))try{n=r[a.responseDelimited?\"decodeDelimited\":\"decode\"](n)}catch(e){return a.emit(\"error\",e,t),s(e)}return a.emit(\"data\",n,t),s(null,n)}a.end(!0)}))}catch(e){return a.emit(\"error\",e,t),void setTimeout((function(){s(e)}),0)}else setTimeout((function(){s(Error(\"already ended\"))}),0)},r.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit
947(\"end\").off()),this}},8294:(e,t,n)=>{\"use strict\";e.exports=r;var i=n(1679);function r(e,t){this.lo=e>>>0,this.hi=t>>>0}var o=r.zero=new r(0,0);o.toNumber=function(){return 0},o.zzEncode=o.zzDecode=function(){return this},o.length=function(){return 1};var s=r.zeroHash=\"\\0\\0\\0\\0\\0\\0\\0\\0\";r.fromNumber=function(e){if(0===e)return o;var t=e<0;t&&(e=-e);var n=e>>>0,i=(e-n)/4294967296>>>0;return t&&(i=~i>>>0,n=~n>>>0,++n>4294967295&&(n=0,++i>4294967295&&(i=0))),new r(n,i)},r.from=function(e){if(\"number\"==typeof e)return r.fromNumber(e);if(i.isString(e)){if(!i.Long)return r.fromNumber(parseInt(e,10));e=i.Long.fromString(e)}return e.low||e.high?new r(e.low>>>0,e.high>>>0):o},r.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,n=~this.hi>>>0;return t||(n=n+1>>>0),-(t+4294967296*n)}return this.lo+4294967296*this.hi},r.prototype.toLong=function(e){return i.Long?new i.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var a=String.prototype.charCodeAt;r.fromHash=function(e){return e===s?o:new r((a.call(e,0)|a.call(e,1)<<8|a.call(e,2)<<16|a.call(e,3)<<24)>>>0,(a.call(e,4)|a.call(e,5)<<8|a.call(e,6)<<16|a.call(e,7)<<24)>>>0)},r.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},r.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},r.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},r.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return 0===n?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:n<128?9:10}},1679:function(e,t,n){\"use strict\";var i=t;function r(e,t,n){for(var i=Object.keys(t),r=0;r<i.length;++r)void 0!==e[i[r]]&&n||(e[i[r]]=t[i[r]]);return e}function o(e){function t(e,n){if(!(this instanceof t))return new t(e,n);Object.defineProperty(this,\"message\",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,\"stack\",{value:(new Error).stack||\"\"}),n&&r(this,n)}return(t.prototype=Object.create(Error.prototype)).constructor=t,Object.defineProperty(t.prototype,\"name\",{get:function(){return e}}),t.prototype.toString=function(){return this.name+\": \"+this.message},t}
947i.asPromise=n(7018),i.base64=n(2647),i.EventEmitter=n(2922),i.float=n(7955),i.inquire=n(8446),i.utf8=n(5226),i.pool=n(5374),i.LongBits=n(8294),i.isNode=Boolean(void 0!==n.g&&n.g&&n.g.process&&n.g.process.versions&&n.g.process.versions.node),i.global=i.isNode&&n.g||\"undefined\"!=typeof window&&window||\"undefined\"!=typeof self&&self||this,i.emptyArray=Object.freeze?Object.freeze([]):[],i.emptyObject=Object.freeze?Object.freeze({}):{},i.isInteger=Number.isInteger||function(e){return\"number\"==typeof e&&isFinite(e)&&Math.floor(e)===e},i.isString=function(e){return\"string\"==typeof e||e instanceof String},i.isObject=function(e){return e&&\"object\"==typeof e},i.isset=i.isSet=function(e,t){var n=e[t];return!(null==n||!e.hasOwnProperty(t))&&(\"object\"!=typeof n||(Array.isArray(n)?n.length:Object.keys(n).length)>0)},i.Buffer=function(){try{var e=i.inquire(\"buffer\").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),i._Buffer_from=null,i._Buffer_allocUnsafe=null,i.newBuffer=function(e){return\"number\"==typeof e?i.Buffer?i._Buffer_allocUnsafe(e):new i.Array(e):i.Buffer?i._Buffer_from(e):\"undefined\"==typeof Uint8Array?e:new Uint8Array(e)},i.Array=\"undefined\"!=typeof Uint8Array?Uint8Array:Array,i.Long=i.global.dcodeIO&&i.global.dcodeIO.Long||i.global.Long||i.inquire(\"long\"),i.key2Re=/^true|false|0|1$/,i.key32Re=/^-?(?:0|[1-9][0-9]*)$/,i.key64Re=/^(?:[\\\\x00-\\\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,i.longToHash=function(e){return e?i.LongBits.from(e).toHash():i.LongBits.zeroHash},i.longFromHash=function(e,t){var n=i.LongBits.fromHash(e);return i.Long?i.Long.fromBits(n.lo,n.hi,t):n.toNumber(Boolean(t))},i.merge=r,i.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},i.newError=o,i.ProtocolError=o(\"ProtocolError\"),i.oneOfGetter=function(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=1;return function(){for(var e=Object.keys(this),n=e.length-1;n>-1;--n)if(1===t[e[n]]&&void 0!==this[e[n]]&&null!==this[e[n]])return e[n]}},i.oneOfSetter=function(e){return function(t){for(var n=0;n<e.length;++n)e[n]!==t&&delete this[e[n]]}},i.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},i._configure=function(){var e=i.Buffer;e?(i._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,n){return new e(t,n)},i._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}):i._Buffer_from=i._Buffer_allocUnsafe=null}},8116:(e,t,n)=>{\"use strict\";e.exports=h;var i,r=n(1679),o=r.LongBits,s=r.base64,a=r.utf8;function l(e,t,n){this.fn=e,this.len=t,this.next=void 0,this.val=n}function c(){}function u(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function h(){this.len=0,this.head=new l(c,0,0),this.tail=this.head,this.states=null}var d=function(){return r.Buffer?function(){return(h.create=function(){return new i})()}:function(){return new h}};function p(e,t,n){t[n]=255&e}function f(e,t){this.len=e,this.next=void 0,this.val=t}function m(e,t,n){for(;e.hi;)t[n++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[n++]=127&e.lo|128,e.lo=e.lo>>>7;t[n++]=e.lo}function g(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}h.create=d(),h.alloc=function(e){return new r.Array(e)},r.Array!==Array&&(h.alloc=r.pool(h.alloc,r.Array.prototype.subarray)),h.prototype._push=function(e,t,n){return this.tail=this.tail.next=new l(e,t,n),this.len+=t,this},f.prototype=Object.create(l.prototype),f.prototype.fn=function(e,t,n){for(;e>127;)t[n++]=127&e|128,e>>>=7;t[n]=e},h.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new f((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},h.prototype.int32=function(e){return e<0?this._push(m,10,o.fromNumber(e)):this.uint32(e)},h.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},h.prototype.uint64=function(e){var t=o.from(e);return this._push(m,t.length(),t)},h.prototype.int64=h.prototype.uint64,h.prototype.sint64=function(e){var t=o.from(e).zzEncode();return this._push(m,t.length(),t)},h.prototype.bool=function(e){return this._push(p,1,e?1:0)},h.prototype.fixed32=function(e){return this._push(g,4,e>>>0)},h.prototype.sfixed32=h.prototype.fixed32,h.prototype.fixed64=function(e){var t=o.from(e);return this._push(g,4,t.lo)._push(g,4,t.hi)},h.prototype.sfixed64=h.prototype.fixed64,h.prototype.float=function(e){return this._push(r.float.writeFloatLE,4,e)},h.prototype.double=function(e){return this._push(r.float.writeDoubleLE,8,e)};var v=r.Array.prototype.set?function(e,t,n){t.set(e,n)}:function(e,t,n){for(var i=0;i<e.length;++i)t[n+i]=e[i]};h.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(p,1,0);if(r.isString(e)){var n=h.alloc(t=s.length(e));s.decode(e,n,0),e=n}return this.uint32(t)._push(v,t,e)},h.prototype.string=function(e){var t=a.length(e);return t?this.uint32(t)._push(a.write,t,e):this._push(p,1,0)},h.prototype.fork=function(){return this.states=new u(this),this.head=this.tail=new l(c,0,0),this.len=0,this},h.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new l(c,0,0),this.len=0),this},h.prototype.ldelim=function(){var e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=t,this.len+=n),this},h.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),n=0;e;)e.fn(e.val,t,n),n+=e.len,e=e.next;return t},h._configure=function(e){i=e,h.create=d(),i._configure()}},1819:(e,t,n)=>{\"use strict\";e.exports=o;var i=n(8116);(o.prototype=Object.create(i.prototype)).constructor=o;var r=n(1679);function o(){i.call(this)}function s(e,t,n){e.length<40?r.utf8.write(e,t,n):t.utf8Write?t.utf8Write(e,n):t.write(e,n)}o._configure=function(){o.alloc=r._Buffer_allocUnsafe,o.writeBytesBuffer=r.Buffer&&r.Buffer.prototype instanceof Uint8Array&&\"set\"===r.Buffer.prototype.set.name?function(e,t,n){t.set(e,n)}:function(e,t,n){if(e.copy)e.copy(t,n,0,e.length);else for(var i=0;i<e.length;)t[n++]=e[i++]}},o.prototype.bytes=function(e){r.isString(e)&&(e=r._Buffer_from(e,\"base64\"));var t=e.length>>>0;return this.uint32(t),t&&this._push(o.writeBytesBuffer,t,e),this},o.prototype.string=function(e){var t=r.Buffer.byteLength(e);return this.uint32(t),t&&this._push(s,t,e),this},o._configure()},82:(e,t,n)=>{\"use strict\";n.r(t),n.d(t,{ACESFilmicToneMapping:()=>ne,AddEquation:()=>E,AddOperation:()=>$,AdditiveAnimationBlendMode:()=>qt,AdditiveBlending:()=>b,AlphaFormat:()=>Ne,AlwaysDepth:()=>V,AlwaysStencilFunc:()=>Sn,AmbientLight:()=>
947od,AmbientLightProbe:()=>wd,AnimationClip:()=>Ph,AnimationLoader:()=>zh,AnimationMixer:()=>ep,AnimationObjectGroup:()=>Kd,AnimationUtils:()=>vh,ArcCurve:()=>Kc,ArrayCamera:()=>wl,ArrowHelper:()=>Hp,Audio:()=>Od,AudioAnalyser:()=>Bd,AudioContext:()=>xd,AudioListener:()=>Dd,AudioLoader:()=>_d,AxesHelper:()=>jp,AxisHelper:()=>_f,BackSide:()=>m,BasicDepthPacking:()=>on,BasicShadowMap:()=>u,BinaryTextureLoader:()=>Ef,Bone:()=>ac,BooleanKeyframeTrack:()=>Mh,BoundingBoxHelper:()=>bf,Box2:()=>up,Box3:()=>gi,Box3Helper:()=>zp,BoxBufferGeometry:()=>So,BoxGeometry:()=>So,BoxHelper:()=>Up,BufferAttribute:()=>Br,BufferGeometry:()=>io,BufferGeometryLoader:()=>dd,ByteType:()=>Ee,Cache:()=>Dh,Camera:()=>Co,CameraHelper:()=>Ip,CanvasRenderer:()=>Af,CanvasTexture:()=>zc,CatmullRomCurve3:()=>ru,CineonToneMapping:()=>te,CircleBufferGeometry:()=>Gc,CircleGeometry:()=>Gc,ClampToEdgeWrapping:()=>de,Clock:()=>Td,Color:()=>Fr,ColorKeyframeTrack:()=>Sh,CompressedTexture:()=>Uc,CompressedTextureLoader:()=>Bh,ConeBufferGeometry:()=>Vc,ConeGeometry:()=>Vc,CubeCamera:()=>Do,CubeReflectionMapping:()=>oe,CubeRefractionMapping:()=>se,CubeTexture:()=>Oo,CubeTextureLoader:()=>kh,CubeUVReflectionMapping:()=>ce,CubeUVRefractionMapping:()=>ue,CubicBezierCurve:()=>lu,CubicBezierCurve3:()=>cu,CubicInterpolant:()=>xh,CullFaceBack:()=>a,CullFaceFront:()=>l,CullFaceFrontBack:()=>c,CullFaceNone:()=>s,Curve:()=>Zc,CurvePath:()=>gu,CustomBlending:()=>S,CustomToneMapping:()=>ie,CylinderBufferGeometry:()=>kc,CylinderGeometry:()=>kc,Cylindrical:()=>lp,DataTexture:()=>lc,DataTexture2DArray:()=>As,DataTexture3D:()=>Os,DataTextureLoader:()=>Vh,DataUtils:()=>Yp,DecrementStencilOp:()=>pn,DecrementWrapStencilOp:()=>mn,DefaultLoadingManager:()=>Ih,DepthFormat:()=>Ve,DepthStencilFormat:()=>He,DepthTexture:()=>Bc,DirectionalLight:()=>rd,DirectionalLightHelper:()=>Rp,DiscreteInterpolant:()=>bh,DodecahedronBufferGeometry:()=>jc,DodecahedronGeometry:()=>jc,DoubleSide:()=>g,DstAlphaFactor:()=>N,DstColorFactor:()=>z,DynamicBufferAttribute:()=>uf,DynamicCopyUsage:()=>Dn,DynamicDrawUsage:()=>Tn,DynamicReadUsage:()=>Cn,EdgesGeometry:()=>Jc,EdgesHelper:()=>wf,EllipseCurve:()=>$c,EqualDepth:()=>W,EqualStencilFunc:()=>xn,EquirectangularReflectionMapping:()=>ae,EquirectangularRefractionMapping:()=>le,Euler:()=>er,EventDispatcher:()=>Nn,ExtrudeBufferGeometry:()=>qu,ExtrudeGeometry:()=>qu,FaceColors:()=>Kp,FileLoader:()=>Uh,FlatShading:()=>v,Float16BufferAttribute:()=>Xr,Float32Attribute:()=>yf,Float32BufferAttribute:()=>Yr,Float64Attribute:()=>xf,Float64BufferAttribute:()=>Jr,FloatType:()=>Pe,Fog:()=>Rl,FogExp2:()=>Pl,Font:()=>If,FontLoader:()=>Of,FrontSide:()=>f,Frustum:()=>ko,GLBufferAttribute:()=>ip,GLSL1:()=>In,GLSL3:()=>Fn,GammaEncoding:()=>Kt,GreaterDepth:()=>X,GreaterEqualDepth:()=>q,GreaterEqualStencilFunc:()=>Mn,GreaterStencilFunc:()=>bn,GridHelper:()=>Tp,Group:()=>Ml,HalfFloatType:()=>Re,HemisphereLight:()=>Wh,HemisphereLightHelper:()=>Ep,HemisphereLightProbe:()=>bd,IcosahedronBufferGeometry:()=>Yu,IcosahedronGeometry:()=>Yu,ImageBitmapLoader:()=>vd,ImageLoader:()=>Gh,ImageUtils:()=>ri,ImmediateRenderObject:()=>Ff,IncrementStencilOp:()=>dn,IncrementWrapStencilOp:()=>fn,InstancedBufferAttribute:()=>dc,InstancedBufferGeometry:()=>hd,InstancedInterleavedBuffer:()=>np,InstancedMesh:()=>vc,Int16Attribute:()=>ff,Int16BufferAttribute:()=>Hr,Int32Attribute:()=>gf,Int32BufferAttribute:()=>Wr,Int8Attribute:()=>hf,Int8BufferAttribute:()=>Gr,IntType:()=>Le,InterleavedBuffer:()=>Ol,InterleavedBufferAttribute:()=>Fl,Interpolant:()=>yh,InterpolateDiscrete:()=>Bt,InterpolateLinear:()=>Gt,InterpolateSmooth:()=>kt,InvertStencilOp:()=>gn,JSONLoader:()=>Lf,KeepStencilOp:()=>un,KeyframeTrack:()=>wh,LOD:()=>ec,LatheBufferGeometry:()=>Ju,LatheGeometry:()=>Ju,Layers:()=>tr,LensFlare:()=>Pf,LessDepth:()=>H,LessEqualDepth:()=>j,LessEqualStencilFunc:()=>_n,LessStencilFunc:()=>yn,Light:()=>jh,LightProbe:()=>ld,Line:()=>Sc,Line3:()=>pp,LineBasicMaterial:()=>yc,LineCurve:()=>uu,LineCurve3:()=>hu,LineDashedMaterial:()=>mh,LineLoop:()=>Lc,LinePieces:()=>Zp,LineSegments:()=>Ac,LineStrip:()=>Jp,LinearEncoding:()=>Zt,LinearFilter:()=>xe,LinearInterpolant:()=>_h,LinearMipMapLinearFilter:()=>Me,LinearMipMapNearestFilter:()=>be,LinearMipmapLinearFilter:()=>we,LinearMipmapNearestFilter:()=>_e,LinearToneMapping:()=>Q,Loader:()=>Fh,LoaderUtils:()=>ud,LoadingManager:()=>Oh,LogLuvEncoding:()=>en,LoopOnce:()=>Nt,LoopPingPong:()=>zt,LoopRepeat:()=>Ut,LuminanceAlphaFormat:()=>Ge,LuminanceFormat:()=>Be,MOUSE:()=>r,Material:()=>Lr,MaterialLoader:()=>cd,Math:()=>Jn,MathUtils:()=>Jn,Matrix3:()=>$n,Matrix4:()=>ji,MaxEquation:()=>C,Mesh:()=>wo,MeshBasicMaterial:()=>Nr,MeshDepthMaterial:()=>fl,MeshDistanceMaterial:()=>ml,MeshFaceMaterial:()=>ef,MeshLambertMaterial:()=>ph,MeshMatcapMaterial:()=>fh,MeshNormalMaterial:()=>dh,MeshPhongMaterial:()=>uh,MeshPhysicalMaterial:()=>ch,MeshStandardMaterial:()=>lh,MeshToonMaterial:()=>hh,MinEquation:()=>L,MirroredRepeatWrapping:()=>pe,MixOperation:()=>Z,MultiMaterial:()=>tf,MultiplyBlending:()=>M,MultiplyOperation:()=>J,NearestFilter:()=>fe,NearestMipMapLinearFilter:()=>ye,NearestMipMapNearestFilter:()=>ge,NearestMipmapLinearFilter:()=>ve,NearestMipmapNearestFilter:()=>me,NeverDepth:()=>k,NeverStencilFunc:()=>vn,NoBlending:()=>x,NoColors:()=>$p,NoToneMapping:()=>K,NormalAnimationBlendMode:()=>Wt,NormalBlending:()=>_,NotEqualDepth:()=>Y,NotEqualStencilFunc:()=>wn,NumberKeyframeTrack:()=>Eh,Object3D:()=>mr,ObjectLoader:()=>pd,ObjectSpaceNormalMap:()=>ln,OctahedronBufferGeometry:()=>Zu,OctahedronGeometry:()=>Zu,OneFactor:()=>R,OneMinusDstAlphaFactor:()=>U,OneMinusDstColorFactor:()=>B,OneMinusSrcAlphaFactor:()=>F,OneMinusSrcColorFactor:()=>
947O,OrthographicCamera:()=>es,PCFShadowMap:()=>h,PCFSoftShadowMap:()=>d,PMREMGenerator:()=>ms,ParametricGeometry:()=>Rf,Particle:()=>rf,ParticleBasicMaterial:()=>af,ParticleSystem:()=>of,ParticleSystemMaterial:()=>lf,Path:()=>vu,PerspectiveCamera:()=>Po,Plane:()=>zo,PlaneBufferGeometry:()=>jo,PlaneGeometry:()=>jo,PlaneHelper:()=>Bp,PointCloud:()=>nf,PointCloudMaterial:()=>sf,PointLight:()=>nd,PointLightHelper:()=>bp,Points:()=>Ic,PointsMaterial:()=>Cc,PolarGridHelper:()=>Ap,PolyhedronBufferGeometry:()=>Hc,PolyhedronGeometry:()=>Hc,PositionalAudio:()=>zd,PropertyBinding:()=>$d,PropertyMixer:()=>Gd,QuadraticBezierCurve:()=>du,QuadraticBezierCurve3:()=>pu,Quaternion:()=>di,QuaternionKeyframeTrack:()=>Ah,QuaternionLinearInterpolant:()=>Th,REVISION:()=>i,RGBADepthPacking:()=>sn,RGBAFormat:()=>ze,RGBAIntegerFormat:()=>Je,RGBA_ASTC_10x10_Format:()=>yt,RGBA_ASTC_10x5_Format:()=>mt,RGBA_ASTC_10x6_Format:()=>gt,RGBA_ASTC_10x8_Format:()=>vt,RGBA_ASTC_12x10_Format:()=>xt,RGBA_ASTC_12x12_Format:()=>_t,RGBA_ASTC_4x4_Format:()=>at,RGBA_ASTC_5x4_Format:()=>lt,RGBA_ASTC_5x5_Format:()=>ct,RGBA_ASTC_6x5_Format:()=>ut,RGBA_ASTC_6x6_Format:()=>ht,RGBA_ASTC_8x5_Format:()=>dt,RGBA_ASTC_8x6_Format:()=>pt,RGBA_ASTC_8x8_Format:()=>ft,RGBA_BPTC_Format:()=>bt,RGBA_ETC2_EAC_Format:()=>st,RGBA_PVRTC_2BPPV1_Format:()=>it,RGBA_PVRTC_4BPPV1_Format:()=>nt,RGBA_S3TC_DXT1_Format:()=>$e,RGBA_S3TC_DXT3_Format:()=>Ke,RGBA_S3TC_DXT5_Format:()=>Qe,RGBDEncoding:()=>rn,RGBEEncoding:()=>Qt,RGBEFormat:()=>ke,RGBFormat:()=>Ue,RGBIntegerFormat:()=>Ye,RGBM16Encoding:()=>nn,RGBM7Encoding:()=>tn,RGB_ETC1_Format:()=>rt,RGB_ETC2_Format:()=>ot,RGB_PVRTC_2BPPV1_Format:()=>tt,RGB_PVRTC_4BPPV1_Format:()=>et,RGB_S3TC_DXT1_Format:()=>Ze,RGFormat:()=>qe,RGIntegerFormat:()=>Xe,RawShaderMaterial:()=>ts,Ray:()=>Hi,Raycaster:()=>rp,RectAreaLight:()=>sd,RedFormat:()=>je,RedIntegerFormat:()=>We,ReinhardToneMapping:()=>ee,RepeatWrapping:()=>he,ReplaceStencilOp:()=>hn,ReverseSubtractEquation:()=>A,RingBufferGeometry:()=>$u,RingGeometry:()=>$u,SRGB8_ALPHA8_ASTC_10x10_Format:()=>Ot,SRGB8_ALPHA8_ASTC_10x5_Format:()=>Pt,SRGB8_ALPHA8_ASTC_10x6_Format:()=>Rt,SRGB8_ALPHA8_ASTC_10x8_Format:()=>Dt,SRGB8_ALPHA8_ASTC_12x10_Format:()=>It,SRGB8_ALPHA8_ASTC_12x12_Format:()=>Ft,SRGB8_ALPHA8_ASTC_4x4_Format:()=>wt,SRGB8_ALPHA8_ASTC_5x4_Format:()=>Mt,SRGB8_ALPHA8_ASTC_5x5_Format:()=>St,SRGB8_ALPHA8_ASTC_6x5_Format:()=>Et,SRGB8_ALPHA8_ASTC_6x6_Format:()=>Tt,SRGB8_ALPHA8_ASTC_8x5_Format:()=>At,SRGB8_ALPHA8_ASTC_8x6_Format:()=>Lt,SRGB8_ALPHA8_ASTC_8x8_Format:()=>Ct,Scene:()=>Dl,SceneUtils:()=>Cf,ShaderChunk:()=>Wo,ShaderLib:()=>Xo,ShaderMaterial:()=>Lo,ShadowMaterial:()=>ah,Shape:()=>yu,ShapeBufferGeometry:()=>Ku,ShapeGeometry:()=>Ku,ShapePath:()=>Wp,ShapeUtils:()=>Hu,ShortType:()=>Te,Skeleton:()=>hc,SkeletonHelper:()=>xp,SkinnedMesh:()=>sc,SmoothShading:()=>y,Sphere:()=>Fi,SphereBufferGeometry:()=>Qu,SphereGeometry:()=>Qu,Spherical:()=>ap,SphericalHarmonics3:()=>ad,SplineCurve:()=>fu,SpotLight:()=>$h,SpotLightHelper:()=>mp,Sprite:()=>Zl,SpriteMaterial:()=>Nl,SrcAlphaFactor:()=>I,SrcAlphaSaturateFactor:()=>G,SrcColorFactor:()=>D,StaticCopyUsage:()=>Rn,StaticDrawUsage:()=>En,StaticReadUsage:()=>Ln,StereoCamera:()=>Ed,StreamCopyUsage:()=>On,StreamDrawUsage:()=>An,StreamReadUsage:()=>Pn,StringKeyframeTrack:()=>Lh,SubtractEquation:()=>T,SubtractiveBlending:()=>w,TOUCH:()=>o,TangentSpaceNormalMap:()=>an,TetrahedronBufferGeometry:()=>eh,TetrahedronGeometry:()=>eh,TextGeometry:()=>Df,Texture:()=>si,TextureLoader:()=>Hh,TorusBufferGeometry:()=>th,TorusGeometry:()=>th,TorusKnotBufferGeometry:()=>nh,TorusKnotGeometry:()=>nh,Triangle:()=>Tr,TriangleFanDrawMode:()=>Jt,TriangleStripDrawMode:()=>Yt,TrianglesDrawMode:()=>Xt,TubeBufferGeometry:()=>ih,TubeGeometry:()=>ih,UVMapping:()=>re,Uint16Attribute:()=>mf,Uint16BufferAttribute:()=>jr,Uint32Attribute:()=>vf,Uint32BufferAttribute:()=>qr,Uint8Attribute:()=>df,Uint8BufferAttribute:()=>kr,Uint8ClampedAttribute:()=>pf,Uint8ClampedBufferAttribute:()=>Vr,Uniform:()=>tp,UniformsLib:()=>qo,UniformsUtils:()=>Ao,UnsignedByteType:()=>Se,UnsignedInt248Type:()=>Fe,UnsignedIntType:()=>Ce,UnsignedShort4444Type:()=>De,UnsignedShort5551Type:()=>Oe,UnsignedShort565Type:()=>Ie,UnsignedShortType:()=>Ae,VSMShadowMap:()=>p,Vector2:()=>Zn,Vector3:()=>pi,Vector4:()=>li,VectorKeyframeTrack:()=>Ch,Vertex:()=>cf,VertexColors:()=>Qp,VideoTexture:()=>Nc,WebGL1Renderer:()=>
947Cl,WebGLCubeRenderTarget:()=>Io,WebGLMultipleRenderTargets:()=>ui,WebGLMultisampleRenderTarget:()=>hi,WebGLRenderTarget:()=>ci,WebGLRenderTargetCube:()=>Tf,WebGLRenderer:()=>Ll,WebGLUtils:()=>bl,WireframeGeometry:()=>rh,WireframeHelper:()=>Mf,WrapAroundEnding:()=>jt,XHRLoader:()=>Sf,ZeroCurvatureEnding:()=>Vt,ZeroFactor:()=>P,ZeroSlopeEnding:()=>Ht,ZeroStencilOp:()=>cn,sRGBEncoding:()=>$t});const i=\"134\",r={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},o={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},s=0,a=1,l=2,c=3,u=0,h=1,d=2,p=3,f=0,m=1,g=2,v=1,y=2,x=0,_=1,b=2,w=3,M=4,S=5,E=100,T=101,A=102,L=103,C=104,P=200,R=201,D=202,O=203,I=204,F=205,N=206,U=207,z=208,B=209,G=210,k=0,V=1,H=2,j=3,W=4,q=5,X=6,Y=7,J=0,Z=1,$=2,K=0,Q=1,ee=2,te=3,ne=4,ie=5,re=300,oe=301,se=302,ae=303,le=304,ce=306,ue=307,he=1e3,de=1001,pe=1002,fe=1003,me=1004,ge=1004,ve=1005,ye=1005,xe=1006,_e=1007,be=1007,we=1008,Me=1008,Se=1009,Ee=1010,Te=1011,Ae=1012,Le=1013,Ce=1014,Pe=1015,Re=1016,De=1017,Oe=1018,Ie=1019,Fe=1020,Ne=1021,Ue=1022,ze=1023,Be=1024,Ge=1025,ke=ze,Ve=1026,He=1027,je=1028,We=1029,qe=1030,Xe=1031,Ye=1032,Je=1033,Ze=33776,$e=33777,Ke=33778,Qe=33779,et=35840,tt=35841,nt=35842,it=35843,rt=36196,ot=37492,st=37496,at=37808,lt=37809,ct=37810,ut=37811,ht=37812,dt=37813,pt=37814,ft=37815,mt=37816,gt=37817,vt=37818,yt=37819,xt=37820,_t=37821,bt=36492,wt=37840,Mt=37841,St=37842,Et=37843,Tt=37844,At=37845,Lt=37846,Ct=37847,Pt=37848,Rt=37849,Dt=37850,Ot=37851,It=37852,Ft=37853,Nt=2200,Ut=2201,zt=2202,Bt=2300,Gt=2301,kt=2302,Vt=2400,Ht=2401,jt=2402,Wt=2500,qt=2501,Xt=0,Yt=1,Jt=2,Zt=3e3,$t=3001,Kt=3007,Qt=3002,en=3003,tn=3004,nn=3005,rn=3006,on=3200,sn=3201,an=0,ln=1,cn=0,un=7680,hn=7681,dn=7682,pn=7683,fn=34055,mn=34056,gn=5386,vn=512,yn=513,xn=514,_n=515,bn=516,wn=517,Mn=518,Sn=519,En=35044,Tn=35048,An=35040,Ln=35045,Cn=35049,Pn=35041,Rn=35046,Dn=35050,On=35042,In=\"100\",Fn=\"300 es\";class Nn{addEventListener(e,t){void 0===this._listeners&&(this._listeners={});const n=this._listeners;void 0===n[e]&&(n[e]=[]),-1===n[e].indexOf(t)&&n[e].push(t)}hasEventListener(e,t){if(void 0===this._listeners)return!1;const n=this._listeners;return void 0!==n[e]&&-1!==n[e].indexOf(t)}removeEventListener(e,t){if(void 0===this._listeners)return;const n=this._listeners[e];if(void 0!==n){const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}dispatchEvent(e){if(void 0===this._listeners)return;const t=this._listeners[e.type];if(void 0!==t){e.target=this;const n=t.slice(0);for(let t=0,i=n.length;t<i;t++)n[t].call(this,e);e.target=null}}}let Un=1234567;const zn=Math.PI/180,Bn=180/Math.PI,Gn=[];for(let e=0;e<256;e++)Gn[e]=(e<16?\"0\":\"\")+e.toString(16);const kn=\"undefined\"!=typeof crypto&&\"randomUUID\"in crypto;function Vn(){if(kn)return crypto.randomUUID().toUpperCase();const e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,n=4294967295*Math.random()|0,i=4294967295*Math.random()|0;return(Gn[255&e]+Gn[e>>8&255]+Gn[e>>16&255]+Gn[e>>24&255]+\"-\"+Gn[255&t]+Gn[t>>8&255]+\"-\"+Gn[t>>16&15|64]+Gn[t>>24&255]+\"-\"+Gn[63&n|128]+Gn[n>>8&255]+\"-\"+Gn[n>>16&255]+Gn[n>>24&255]+Gn[255&i]+Gn[i>>8&255]+Gn[i>>16&255]+Gn[i>>24&255]).toUpperCase()}function Hn(e,t,n){return Math.max(t,Math.min(n,e))}function jn(e,t){return(e%t+t)%t}function Wn(e,t,n){return(1-n)*e+n*t}function qn(e){return!(e&e-1)&&0!==e}function Xn(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))}function Yn(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))}var Jn=Object.freeze({__proto__:null,DEG2RAD:zn,RAD2DEG:Bn,generateUUID:Vn,clamp:Hn,euclideanModulo:jn,mapLinear:function(e,t,n,i,r){return i+(e-t)*(r-i)/(n-t)},inverseLerp:function(e,t,n){return e!==t?(n-e)/(t-e):0},lerp:Wn,damp:function(e,t,n,i){return Wn(e,t,1-Math.exp(-n*i))},pingpong:function(e,t=1){return t-Math.abs(jn(e,2*t)-t)},smoothstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*(3-2*e)},smootherstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},seededRandom:function(e){return void 0!==e&&(Un=e%2147483647),Un=16807*Un%2147483647,(Un-1)/2147483646},degToRad:function(e){return e*zn},radToDeg:function(e){return e*Bn},isPowerOfTwo:qn,ceilPowerOfTwo:Xn,floorPowerOfTwo:Yn,setQuaternionFromProperEuler:function(e,t,n,i,r){const o=Math.cos,s=Math.sin,a=o(n/2),l=s(n/2),c=o((t+i)/2),u=s((t+i)/2),h=o((t-i)/2),d=s((t-i)/2),p=o((i-t)/2),f=s((i-t)/2);switch(r){case\"XYX\":e.set(a*u,l*h,l*d,a*c);break;case\"YZY\":e.set(l*d,a*u,l*h,a*c);break;case\"ZXZ\":e.set(l*h,l*d,a*u,a*c);break;case\"XZX\":e.set(a*u,l*f,l*p,a*c);break;case\"YXY\":e.set(l*p,a*u,l*f,a*c);break;case\"ZYZ\":e.set(l*f,l*p,a*u,a*c);break;default:console.warn(\"THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: \"+r)}}});class Zn{constructor(e=0,t=0){this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error(\"index is out of range: \"+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error(\"index is out of range: \"+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e,t){return void 0!==t?(console.warn(\"THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead.\"),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e,t){return void 0!==t?(console.warn(\"THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.\"),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.
vendor: 8,525 bytes, line 947
947y,this)}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,n=this.y,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t,n){return void 0!==n&&console.warn(\"THREE.Vector2: offset has been removed from .fromBufferAttribute().\"),this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const n=Math.cos(t),i=Math.sin(t),r=this.x-e.x,o=this.y-e.y;return this.x=r*n-o*i+e.x,this.y=r*i+o*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}Zn.prototype.isVector2=!0;class $n{constructor(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error(\"THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.\")}set(e,t,n,i,r,o,s,a,l){const c=this.elements;return c[0]=e,c[1]=i,c[2]=s,c[3]=t,c[4]=r,c[5]=a,c[6]=n,c[7]=o,c[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,i=t.elements,r=this.elements,o=n[0],s=n[3],a=n[6],l=n[1],c=n[4],u=n[7],h=n[2],d=n[5],p=n[8],f=i[0],m=i[3],g=i[6],v=i[1],y=i[4],x=i[7],_=i[2],b=i[5],w=i[8];return r[0]=o*f+s*v+a*_,r[3]=o*m+s*y+a*b,r[6]=o*g+s*x+a*w,r[1]=l*f+c*v+u*_,r[4]=l*m+c*y+u*b,r[7]=l*g+c*x+u*w,r[2]=h*f+d*v+p*_,r[5]=h*m+d*y+p*b,r[8]=h*g+d*x+p*w,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[1],i=e[2],r=e[3],o=e[4],s=e[5],a=e[6],l=e[7],c=e[8];return t*o*c-t*s*l-n*r*c+n*s*a+i*r*l-i*o*a}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],r=e[3],o=e[4],s=e[5],a=e[6],l=e[7],c=e[8],u=c*o-s*l,h=s*a-c*r,d=l*r-o*a,p=t*u+n*h+i*d;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);const f=1/p;return e[0]=u*f,e[1]=(i*l-c*n)*f,e[2]=(s*n-i*o)*f,e[3]=h*f,e[4]=(c*t-i*a)*f,e[5]=(i*r-s*t)*f,e[6]=d*f,e[7]=(n*a-l*t)*f,e[8]=(o*t-n*r)*f,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,i,r,o,s){const a=Math.cos(r),l=Math.sin(r);return this.set(n*a,n*l,-n*(a*o+l*s)+o+e,-i*l,i*a,-i*(-l*o+a*s)+s+t,0,0,1),this}scale(e,t){const n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=t,n[4]*=t,n[7]*=t,this}rotate(e){const t=Math.cos(e),n=Math.sin(e),i=this.elements,r=i[0],o=i[3],s=i[6],a=i[1],l=i[4],c=i[7];return i[0]=t*r+n*a,i[3]=t*o+n*l,i[6]=t*s+n*c,i[1]=-n*r+t*a,i[4]=-n*o+t*l,i[7]=-n*s+t*c,this}translate(e,t){const n=this.elements;return n[0]+=e*n[2],n[3]+=e*n[5],n[6]+=e*n[8],n[1]+=t*n[2],n[4]+=t*n[5],n[7]+=t*n[8],this}equals(e){const t=this.elements,n=e.elements;for(let e=0;e<9;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return(new this.constructor).fromArray(this.elements)}}function Kn(e){if(0===e.length)return-1/0;let t=e[0];for(let n=1,i=e.length;n<i;++n)e[n]>t&&(t=e[n]);return t}$n.prototype.isMatrix3=!0;const Qn={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function ei(e,t){return new Qn[e](t)}function ti(e){return document.createElementNS(\"http://www.w3.org/1999/xhtml\",e)}function ni(e,t=0){let n=3735928559^t,i=1103547991^t;for(let t,r=0;r<e.length;r++)t=e.charCodeAt(r),n=Math.imul(n^t,2654435761),i=Math.imul(i^t,1597334677);return n=Math.imul(n^n>>>16,2246822507)^Math.imul(i^i>>>13,3266489909),i=Math.imul(i^i>>>16,2246822507)^Math.imul(n^n>>>13,3266489909),4294967296*(2097151&i)+(n>>>0)}let ii;class ri{static getDataURL(e){if(/^data:/i.test(e.src))return e.src;if(\"undefined\"==typeof HTMLCanvasElement)return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{void 0===ii&&(ii=ti(\"canvas\")),ii.width=e.width,ii.height=e.height;const n=ii.getContext(\"2d\");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=ii}return t.width>2048||t.height>2048?(console.warn(\"THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons\",e),t.toDataURL(\"image/jpeg\",.6)):t.toDataURL(\"image/png\")}}let oi=0;class si extends Nn{constructor(e=si.DEFAULT_IMAGE,t=si.DEFAULT_MAPPING,n=de,i=de,r=xe,o=we,s=ze,a=Se,l=1,c=Zt){super(),Object.defineProperty(this,\"id\",{value:oi++}),this.uuid=Vn(),this.name=\"\",this.image=e,this.mipmaps=[],this.mapping=t,this.wrapS=n,this.wrapT=i,this.magFilter=r,this.minFilter=o,this.anisotropy=l,this.format=s,this.internalFormat=null,this.type=a,this.offset=new Zn(0,0),this.repeat=new Zn(1,1),this.center=new Zn(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new $n,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=c,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return(new this.constructor).copy(this)}copy(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this.userData=JSON.parse(JSON.stringify(e.userData)),this}
947toJSON(e){const t=void 0===e||\"string\"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];const n={metadata:{version:4.5,type:\"Texture\",generator:\"Texture.toJSON\"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(void 0!==this.image){const i=this.image;if(void 0===i.uuid&&(i.uuid=Vn()),!t&&void 0===e.images[i.uuid]){let t;if(Array.isArray(i)){t=[];for(let e=0,n=i.length;e<n;e++)i[e].isDataTexture?t.push(ai(i[e].image)):t.push(ai(i[e]))}else t=ai(i);e.images[i.uuid]={uuid:i.uuid,url:t}}n.image=i.uuid}return\"{}\"!==JSON.stringify(this.userData)&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:\"dispose\"})}transformUv(e){if(this.mapping!==re)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case he:e.x=e.x-Math.floor(e.x);break;case de:e.x=e.x<0?0:1;break;case pe:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case he:e.y=e.y-Math.floor(e.y);break;case de:e.y=e.y<0?0:1;break;case pe:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){!0===e&&this.version++}}function ai(e){return\"undefined\"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||\"undefined\"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||\"undefined\"!=typeof ImageBitmap&&e instanceof ImageBitmap?ri.getDataURL(e):e.data?{data:Array.prototype.slice.call(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(console.warn(\"THREE.Texture: Unable to serialize Texture.\"),{})}si.DEFAULT_IMAGE=void 0,si.DEFAULT_MAPPING=re,si.prototype.isTexture=!0;class li{constructor(e=0,t=0,n=0,i=1){this.x=e,this.y=t,this.z=n,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error(\"index is out of range: \"+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error(\"index is out of range: \"+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}add(e,t){return void 0!==t?(console.warn(\"THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead.\"),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e,t){return void 0!==t?(console.warn(\"THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.\"),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,r=this.w,o=e.elements;return this.x=o[0]*t+o[4]*n+o[8]*i+o[12]*r,this.y=o[1]*t+o[5]*n+o[9]*i+o[13]*r,this.z=o[2]*t+o[6]*n+o[10]*i+o[14]*r,this.w=o[3]*t+o[7]*n+o[11]*i+o[15]*r,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,i,r;const o=.01,s=.1,a=e.elements,l=a[0],c=a[4],u=a[8],h=a[1],d=a[5],p=a[9],f=a[2],m=a[6],g=a[10];if(Math.abs(c-h)<o&&Math.abs(u-f)<o&&Math.abs(p-m)<o){if(Math.abs(c+h)<s&&Math.abs(u+f)<s&&Math.abs(p+m)<s&&Math.abs(l+d+g-3)<s)return this.set(1,0,0,0),this;t=Math.PI;const e=(l+1)/2,a=(d+1)/2,v=(g+1)/2,y=(c+h)/4,x=(u+f)/4,_=(p+m)/4;return e>a&&e>v?e<o?(n=0,i=.707106781,r=.707106781):(n=Math.sqrt(e),i=y/n,r=x/n):a>v?a<o?(n=.707106781,i=0,r=.707106781):(i=Math.sqrt(a),n=y/i,r=_/i):v<o?(n=.707106781,i=.707106781,r=0):(r=Math.sqrt(v),n=x/r,i=_/r),this.set(n,i,r,t),this}let v=Math.sqrt((m-p)*(m-p)+(u-f)*(u-f)+(h-c)*(h-c));return Math.abs(v)<.001&&(v=1),this.x=(m-p)/v,this.y=(u-f)/v,this.z=(h-c)/v,this.w=Math.acos((l+d+g-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}
vendor: 30,808 bytes, line 947
947round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t,n){return void 0!==n&&console.warn(\"THREE.Vector4: offset has been removed from .fromBufferAttribute().\"),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}li.prototype.isVector4=!0;class ci extends Nn{constructor(e,t,n={}){super(),this.width=e,this.height=t,this.depth=1,this.scissor=new li(0,0,e,t),this.scissorTest=!1,this.viewport=new li(0,0,e,t),this.texture=new si(void 0,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.isRenderTargetTexture=!0,this.texture.image={width:e,height:t,depth:1},this.texture.generateMipmaps=void 0!==n.generateMipmaps&&n.generateMipmaps,this.texture.internalFormat=void 0!==n.internalFormat?n.internalFormat:null,this.texture.minFilter=void 0!==n.minFilter?n.minFilter:xe,this.depthBuffer=void 0===n.depthBuffer||n.depthBuffer,this.stencilBuffer=void 0!==n.stencilBuffer&&n.stencilBuffer,this.depthTexture=void 0!==n.depthTexture?n.depthTexture:null}setTexture(e){e.image={width:this.width,height:this.height,depth:this.depth},this.texture=e}setSize(e,t,n=1){this.width===e&&this.height===t&&this.depth===n||(this.width=e,this.height=t,this.depth=n,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=n,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return(new this.constructor).copy(this)}copy(e){return this.width=e.width,this.height=e.height,this.depth=e.depth,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.image={...this.texture.image},this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this}dispose(){this.dispatchEvent({type:\"dispose\"})}}ci.prototype.isWebGLRenderTarget=!0;class ui extends ci{constructor(e,t,n){super(e,t);const i=this.texture;this.texture=[];for(let e=0;e<n;e++)this.texture[e]=i.clone()}setSize(e,t,n=1){if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(let i=0,r=this.texture.length;i<r;i++)this.texture[i].image.width=e,this.texture[i].image.height=t,this.texture[i].image.depth=n;this.dispose()}return this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t),this}copy(e){this.dispose(),this.width=e.width,this.height=e.height,this.depth=e.depth,this.viewport.set(0,0,this.width,this.height),this.scissor.set(0,0,this.width,this.height),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this.texture.length=0;for(let t=0,n=e.texture.length;t<n;t++)this.texture[t]=e.texture[t].clone();return this}}ui.prototype.isWebGLMultipleRenderTargets=!0;class hi extends ci{constructor(e,t,n){super(e,t,n),this.samples=4}copy(e){return super.copy.call(this,e),this.samples=e.samples,this}}hi.prototype.isWebGLMultisampleRenderTarget=!0;class di{constructor(e=0,t=0,n=0,i=1){this._x=e,this._y=t,this._z=n,this._w=i}static slerp(e,t,n,i){return console.warn(\"THREE.Quaternion: Static .slerp() has been deprecated. Use qm.slerpQuaternions( qa, qb, t ) instead.\"),n.slerpQuaternions(e,t,i)}static slerpFlat(e,t,n,i,r,o,s){let a=n[i+0],l=n[i+1],c=n[i+2],u=n[i+3];const h=r[o+0],d=r[o+1],p=r[o+2],f=r[o+3];if(0===s)return e[t+0]=a,e[t+1]=l,e[t+2]=c,void(e[t+3]=u);if(1===s)return e[t+0]=h,e[t+1]=d,e[t+2]=p,void(e[t+3]=f);if(u!==f||a!==h||l!==d||c!==p){let e=1-s;const t=a*h+l*d+c*p+u*f,n=t>=0?1:-1,i=1-t*t;if(i>Number.EPSILON){const r=Math.sqrt(i),o=Math.atan2(r,t*n);e=Math.sin(e*o)/r,s=Math.sin(s*o)/r}const r=s*n;if(a=a*e+h*r,l=l*e+d*r,c=c*e+p*r,u=u*e+f*r,e===1-s){const e=1/Math.sqrt(a*a+l*l+c*c+u*u);a*=e,l*=e,c*=e,u*=e}}e[t]=a,e[t+1]=l,e[t+2]=c,e[t+3]=u}static multiplyQuaternionsFlat(e,t,n,i,r,o){const s=n[i],a=n[i+1],l=n[i+2],c=n[i+3],u=r[o],h=r[o+1],d=r[o+2],p=r[o+3];return e[t]=s*p+c*u+a*d-l*h,e[t+1]=a*p+c*h+l*u-s*d,e[t+2]=l*p+c*d+s*h-a*u,e[t+3]=c*p-s*u-a*h-l*d,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){if(!e||!e.isEuler)throw new Error(\"THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.\");const n=e._x,i=e._y,r=e._z,o=e._order,s=Math.cos,a=Math.sin,l=s(n/2),c=s(i/2),u=s(r/2),h=a(n/2),d=a(i/2),p=a(r/2);switch(o){case\"XYZ\":this._x=h*c*u+l*d*p,this._y=l*d*u-h*c*p,this._z=l*c*p+h*d*u,this._w=l*c*u-h*d*p;break;case\"YXZ\":this._x=h*c*u+l*d*p,this._y=l*d*u-h*c*p,this._z=l*c*p-h*d*u,this._w=l*c*u+h*d*p;break;case\"ZXY\":this._x=h*c*u-l*d*p,this._y=l*d*u+h*c*p,this._z=l*c*p+h*d*u,this._w=l*c*u-h*d*p;break;case\"ZYX\":this._x=h*c*u-l*d*p,this._y=l*d*u+h*c*p,this._z=l*c*p-h*d*u,this._w=l*c*u+h*d*p;break;case\"YZX\":this._x=h*c*u+l*d*p,this._y=l*d*u+h*c*p,this._z=l*c*p-h*d*u,this._w=l*c*u-h*d*p;break;case\"XZY\":this._x=h*c*u-l*d*p,this._y=l*d*u-h*c*p,this._z=l*c*p+h*d*u,this._w=l*c*u+h*d*p;break;default:console.warn(\"THREE.Quaternion: .setFromEuler() encountered an unknown order: \"+o)}return!1!==t&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],i=t[4],r=t[8],o=t[1],s=t[5],a=t[9],l=t[2],c=t[6],u=t[10],h=n+s+u;if(h>0){const e=.5/Math.sqrt(h+1);this._w=.25/e,this._x=(c-a)*e,this._y=(r-l)*e,this._z=(o-i)*e}else if(n>s&&n>u){const e=2*Math.sqrt(1+n-s-u);this._w=(c-a)/e,this._x=.25*e,this._y=(i+o)/e,this._z=(r+l)/e}else if(s>u){const e=2*Math.sqrt(1+s-n-u);this._w=(r-l)/e,this._x=(i+o)/e,this._y=.25*e,this._z=(a+c)/e}else{const e=2*Math.sqrt(1+u-n-s);this._w=(o-i)/e,this._x=(r+l)/e,this._y=(a+c)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<Number.EPSILON?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Hn(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(0===n)return this;const i=Math.min(1,t/n);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e,t){return void 0!==t?(console.warn(\"THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead.\"),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,i=e._y,r=e._z,o=e._w,s=t._x,a=t._y,l=t._z,c=t._w;return this._x=n*c+o*s+i*l-r*a,this._y=i*c+o*a+r*s-n*l,this._z=r*c+o*l+n*a-i*s,this._w=o*c-n*s-i*a-r*l,this._onChangeCallback(),this}slerp(e,t){if(0===t)return this;if(1===t)return this.copy(e);const n=this._x,i=this._y,r=this._z,o=this._w;let s=o*e._w+n*e._x+i*e._y+r*e._z;if(s<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,s=-s):this.copy(e),s>=1)return this._w=o,this._x=n,this._y=i,this._z=r,this;const a=1-s*s;if(a<=Number.EPSILON){const e=1-t;return this._w=e*o+t*this._w,this._x=e*n+t*this._x,this._y=e*i+t*this._y,this._z=e*r+t*this._z,this.normalize(),this._onChangeCallback(),this}const l=Math.sqrt(a),c=Math.atan2(l,s),u=Math.sin((1-t)*c)/l,h=Math.sin(t*c)/l;return this._w=o*u+this._w*h,this._x=n*u+this._x*h,this._y=i*u+this._y*h,this._z=r*u+this._z*h,this._onChangeCallback(),this}slerpQuaternions(e,t,n){this.copy(e).slerp(t,n)}random(){const e=Math.random(),t=Math.sqrt(1-e),n=Math.sqrt(e),i=2*Math.PI*Math.random(),r=2*Math.PI*Math.random();return this.set(t*Math.cos(i),n*Math.sin(r),n*Math.cos(r),t*Math.sin(i))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}}di.prototype.isQuaternion=!0;class pi{constructor(e=0,t=0,n=0){this.x=e,this.y=t,this.z=n}set(e,t,n){return void 0===n&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error(\"index is out of range: \"+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error(\"index is out of range: \"+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e,t){return void 0!==t?(console.warn(\"THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead.\"),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e,t){return void 0!==t?(console.warn(\"THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.\"),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e,t){return void 0!==t?(console.warn(\"THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead.\"),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return e&&e.isEuler||console.error(\"THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order.\"),this.applyQuaternion(mi.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(mi.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,i=this.z,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6]*i,this.y=r[1]*t+r[4]*n+r[7]*i,this.z=r[2]*t+r[5]*n+r[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,r=e.elements,o=1/(r[3]*t+r[7]*n+r[11]*i+r[15]);return this.x=(r[0]*t+r[4]*n+r[8]*i+r[12])*o,this.y=(r[1]*t+r[5]*n+r[9]*i+r[13])*o,this.z=(r[2]*t+r[6]*n+r[10]*i+r[14])*o,this}applyQuaternion(e){const t=this.x,n=this.y,i=this.z,r=e.x,o=e.y,s=e.z,a=e.w,l=a*t+o*i-s*n,c=a*n+s*t-r*i,u=a*i+r*n-o*t,h=-r*t-o*n-s*i;return this.x=l*a+h*-r+c*-s-u*-o,this.y=c*a+h*-o+u*-r-l*-s,this.z=u*a+h*-s+l*-o-c*-r,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,n=this.y,i=this.z,r=e.elements;return this.x=r[0]*t+r[4]*n+r[8]*i,this.y=r[1]*t+r[5]*n+r[9]*i,this.z=r[2]*t+r[6]*n+r[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e,t){return void 0!==t?(console.warn(\"THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead.\"),this.crossVectors(e,t)):this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,i=e.y,r=e.z,o=t.x,s=t.y,a=t.z;return this.x=i*a-r*s,this.y=r*o-n*a,this.z=n*s-i*o,this}projectOnVector(e){const t=e.lengthSq();if(0===t)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return fi.copy(this).projectOnVector(e),this.sub(fi)}reflect(e){return this.sub(fi.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(Hn(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){const i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,4*t)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,3*t)}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t,n){return void 0!==n&&console.warn(\"THREE.Vector3: offset has been removed from .fromBufferAttribute().\"),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=2*(Math.random()-.5),t=Math.random()*Math.PI*2,n=Math.sqrt(1-e**2);return this.x=n*Math.cos(t),this.y=n*Math.sin(t),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}pi.prototype.isVector3=!0;const fi=new pi,mi=new di;class gi{constructor(e=new pi(1/0,1/0,1/0),t=new pi(-1/0,-1/0,-1/0)){this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){let t=1/0,n=1/0,i=1/0,r=-1/0,o=-1/0,s=-1/0;for(let a=0,l=e.length;a<l;a+=3){const l=e[a],c=e[a+1],u=e[a+2];l<t&&(t=l),c<n&&(n=c),u<i&&(i=u),l>r&&(r=l),c>o&&(o=c),u>s&&(s=u)}return this.min.set(t,n,i),this.max.set(r,o,s),this}setFromBufferAttribute(e){let t=1/0,n=1/0,i=1/0,r=-1/0,o=-1/0,s=-1/0;for(let a=0,l=e.count;a<l;a++){const l=e.getX(a),c=e.getY(a),u=e.getZ(a);l<t&&(t=l),c<n&&(n=c),u<i&&(i=u),l>r&&(r=l),c>o&&(o=c),u>s&&(s=u)}return this.min.set(t,n,i),this.max.set(r,o,s),this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=yi.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}setFromObject(e){return this.makeEmpty(),this.expandByObject(e)}clone(){return(new this.constructor).copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e){e.updateWorldMatrix(!1,!1);const t=e.geometry;void 0!==t&&(null===t.boundingBox&&t.computeBoundingBox(),xi.copy(t.boundingBox),xi.applyMatrix4(e.matrixWorld),this.union(xi));const n=e.children;for(let e=0,t=n.length;e<t;e++)this.expandByObject(n[e]);return this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)}intersectsSphere(e){return this.clampPoint(e.center,yi),yi.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Ti),Ai.subVectors(this.max,Ti),_i.subVectors(e.a,Ti),bi.subVectors(e.b,Ti),wi.subVectors(e.c,Ti),Mi.subVectors(bi,_i),Si.subVectors(wi,bi),Ei.subVectors(_i,wi);let t=[0,-Mi.z,Mi.y,0,-Si.z,Si.y,0,-Ei.z,Ei.y,Mi.z,0,-Mi.x,Si.z,0,-Si.x,Ei.z,0,-Ei.x,-Mi.y,Mi.x,0,-Si.y,Si.x,0,-Ei.y,Ei.x,0];return!!Pi(t,_i,bi,wi,Ai)&&(t=[1,0,0,0,1,0,0,0,1],!!Pi(t,_i,bi,wi,Ai)&&(Li.crossVectors(Mi,Si),t=[Li.x,Li.y,Li.z],Pi(t,_i,bi,wi,Ai)))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return yi.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return this.getCenter(e.center),e.radius=.5*this.getSize(yi).length(),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()||(vi[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),vi[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),vi[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),vi[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),vi[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),vi[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),vi[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),vi[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(vi)),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}gi.prototype.isBox3=!0;const vi=[new pi,new pi,new pi,new pi,new pi,new pi,new pi,new pi],yi=new pi,xi=new gi,_i=new pi,bi=new pi,wi=new pi,Mi=new pi,Si=new pi,Ei=new pi,Ti=new pi,Ai=new pi,Li=new pi,Ci=new pi;function Pi(e,t,n,i,r){for(let o=0,s=e.length-3;o<=s;o+=3){Ci.fromArray(e,o);const s=r.x*Math.abs(Ci.x)+r.y*Math.abs(Ci.y)+r.z*Math.abs(Ci.z),a=t.dot(Ci),l=n.dot(Ci),c=i.dot(Ci);if(Math.max(-Math.max(a,l,c),Math.min(a,l,c))>s)return!1}return!0}const Ri=new gi,Di=new pi,Oi=new pi,Ii=new pi;class Fi{constructor(e=new pi,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;void 0!==t?n.copy(t):Ri.setFromPoints(e).getCenter(n);let i=0;for(let t=0,r=e.length;t<r;t++)i=Math.max(i,n.distanceToSquared(e[t]));return this.radius=Math.sqrt(i),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const n=this.center.distanceToSquared(e);return t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){Ii.subVectors(e,this.center);const t=Ii.lengthSq();if(t>this.radius*this.radius){const e=Math.sqrt(t),n=.5*(e-this.radius);this.center.add(Ii.multiplyScalar(n/e)),this.radius+=n}return this}union(e){return Oi.subVectors(e.center,this.center).normalize().multiplyScalar(e.radius),this.expandByPoint(Di.copy(e.center).add(Oi)),this.expandByPoint(Di.copy(e.center).sub(Oi)),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const Ni=new pi,Ui=new pi,zi=new pi,Bi=new pi,Gi=new pi,ki=new pi,Vi=new pi;class Hi{constructor(e=new pi,t=new pi(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.direction).multiplyScalar(e).add(this.origin)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Ni)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(n).add(this.origin)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=Ni.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Ni.copy(this.direction).multiplyScalar(t).add(this.origin),Ni.distanceToSquared(e))}distanceSqToSegment(e,t,n,i){Ui.copy(e).add(t).multiplyScalar(.5),zi.copy(t).sub(e).normalize(),Bi.copy(this.origin).sub(Ui);const r=.5*e.distanceTo(t),o=-this.direction.dot(zi),s=Bi.dot(this.direction),a=-Bi.dot(zi),l=Bi.lengthSq(),c=Math.abs(1-o*o);let u,h,d,p;if(c>0)if(u=o*a-s,h=o*s-a,p=r*c,u>=0)if(h>=-p)if(h<=p){const e=1/c;u*=e,h*=e,d=u*(u+o*h+2*s)+h*(o*u+h+2*a)+l}else h=r,u=Math.max(0,-(o*h+s)),d=-u*u+h*(h+2*a)+l;else h=-r,u=Math.max(0,-(o*h+s)),d=-u*u+h*(h+2*a)+l;else h<=-p?(u=Math.max(0,-(-o*r+s)),h=u>0?-r:Math.min(Math.max(-r,-a),r),d=-u*u+h*(h+2*a)+l):h<=p?(u=0,h=Math.min(Math.max(-r,-a),r),d=h*(h+2*a)+l):(u=Math.max(0,-(o*r+s)),h=u>0?r:Math.min(Math.max(-r,-a),r),d=-u*u+h*(h+2*a)+l);else h=o>0?-r:r,u=Math.max(0,-(o*h+s)),d=-u*u+h*(h+2*a)+l;return n&&n.copy(this.direction).multiplyScalar(u).add(this.origin),i&&i.copy(zi).multiplyScalar(h).add(Ui),d}intersectSphere(e,t){Ni.subVectors(e.center,this.origin);const n=Ni.dot(this.direction),i=Ni.dot(Ni)-n*n,r=e.radius*e.radius;if(i>r)return null;const o=Math.sqrt(r-i),s=n-o,a=n+o;return s<0&&a<0?null:s<0?this.at(a,t):this.at(s,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;const n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return null===n?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return 0===t||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,i,r,o,s,a;const l=1/this.direction.x,c=1/this.direction.y,u=1/this.direction.z,h=this.origin;return l>=0?(n=(e.min.x-h.x)*l,i=(e.max.x-h.x)*l):(n=(e.max.x-h.x)*l,i=(e.min.x-h.x)*l),c>=0?(r=(e.min.y-h.y)*c,o=(e.max.y-h.y)*c):(r=(e.max.y-h.y)*c,o=(e.min.y-h.y)*c),n>o||r>i?null:((r>n||n!=n)&&(n=r),(o<i||i!=i)&&(i=o),u>=0?(s=(e.min.z-h.z)*u,a=(e.max.z-h.z)*u):(s=(e.max.z-h.z)*u,a=(e.min.z-h.z)*u),n>a||s>i?null:((s>n||n!=n)&&(n=s),(a<i||i!=i)&&(i=a),i<0?null:this.at(n>=0?n:i,t)))}intersectsBox(e){return null!==this.intersectBox(e,Ni)}intersectTriangle(e,t,n,i,r){Gi.subVectors(t,e),ki.subVectors(n,e),Vi.crossVectors(Gi,ki);let o,s=this.direction.dot(Vi);if(s>0){if(i)return null;o=1}else{if(!(s<0))return null;o=-1,s=-s}Bi.subVectors(this.origin,e);const a=o*this.direction.dot(ki.crossVectors(Bi,ki));if(a<0)return null;const l=o*this.direction.dot(Gi.cross(Bi));if(l<0)return null;if(a+l>s)return null;const c=-o*Bi.dot(Vi);return c<0?null:this.at(c/s,r)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}}class ji{constructor(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error(\"THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.\")}set(e,t,n,i,r,o,s,a,l,c,u,h,d,p,f,m){const g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=i,g[1]=r,g[5]=o,g[9]=s,g[13]=a,g[2]=l,g[6]=c,g[10]=u,g[14]=h,g[3]=d,g[7]=p,g[11]=f,g[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new ji).fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,n=e.elements,i=1/Wi.setFromMatrixColumn(e,0).length(),r=1/Wi.setFromMatrixColumn(e,1).length(),o=1/Wi.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*r,t[5]=n[5]*r,t[6]=n[6]*r,t[7]=0,t[8]=n[8]*o,t[9]=n[9]*o,t[10]=n[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){e&&e.isEuler||console.error(\"THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.\");const t=this.elements,n=e.x,i=e.y,r=e.z,o=Math.cos(n),s=Math.sin(n),a=Math.cos(i),l=Math.sin(i),c=Math.cos(r),u=Math.sin(r);if(\"XYZ\"===e.order){const e=o*c,n=o*u,i=s*c,r=s*u;t[0]=a*c,t[4]=-a*u,t[8]=l,t[1]=n+i*l,t[5]=e-r*l,t[9]=-s*a,t[2]=r-e*l,t[6]=i+n*l,t[10]=o*a}else if(\"YXZ\"===e.order){const e=a*c,n=a*u,i=l*c,r=l*u;t[0]=e+r*s,t[4]=i*s-n,t[8]=o*l,t[1]=o*u,t[5]=o*c,t[9]=-s,t[2]=n*s-i,t[6]=r+e*s,t[10]=o*a}else if(\"ZXY\"===e.order){const e=a*c,n=a*u,i=l*c,r=l*u;t[0]=e-r*s,t[4]=-o*u,t[8]=i+n*s,t[1]=n+i*s,t[5]=o*c,t[9]=r-e*s,t[2]=-o*l,t[6]=s,t[10]=o*a}else if(\"ZYX\"===e.order){const e=o*c,n=o*u,i=s*c,r=s*u;t[0]=a*c,t[4]=i*l-n,t[8]=e*l+r,t[1]=a*u,t[5]=r*l+e,t[9]=n*l-i,t[2]=-l,t[6]=s*a,t[10]=o*a}
947else if(\"YZX\"===e.order){const e=o*a,n=o*l,i=s*a,r=s*l;t[0]=a*c,t[4]=r-e*u,t[8]=i*u+n,t[1]=u,t[5]=o*c,t[9]=-s*c,t[2]=-l*c,t[6]=n*u+i,t[10]=e-r*u}else if(\"XZY\"===e.order){const e=o*a,n=o*l,i=s*a,r=s*l;t[0]=a*c,t[4]=-u,t[8]=l*c,t[1]=e*u+r,t[5]=o*c,t[9]=n*u-i,t[2]=i*u-n,t[6]=s*c,t[10]=r*u+e}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(Xi,e,Yi)}lookAt(e,t,n){const i=this.elements;return $i.subVectors(e,t),0===$i.lengthSq()&&($i.z=1),$i.normalize(),Ji.crossVectors(n,$i),0===Ji.lengthSq()&&(1===Math.abs(n.z)?$i.x+=1e-4:$i.z+=1e-4,$i.normalize(),Ji.crossVectors(n,$i)),Ji.normalize(),Zi.crossVectors($i,Ji),i[0]=Ji.x,i[4]=Zi.x,i[8]=$i.x,i[1]=Ji.y,i[5]=Zi.y,i[9]=$i.y,i[2]=Ji.z,i[6]=Zi.z,i[10]=$i.z,this}multiply(e,t){return void 0!==t?(console.warn(\"THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead.\"),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,i=t.elements,r=this.elements,o=n[0],s=n[4],a=n[8],l=n[12],c=n[1],u=n[5],h=n[9],d=n[13],p=n[2],f=n[6],m=n[10],g=n[14],v=n[3],y=n[7],x=n[11],_=n[15],b=i[0],w=i[4],M=i[8],S=i[12],E=i[1],T=i[5],A=i[9],L=i[13],C=i[2],P=i[6],R=i[10],D=i[14],O=i[3],I=i[7],F=i[11],N=i[15];return r[0]=o*b+s*E+a*C+l*O,r[4]=o*w+s*T+a*P+l*I,r[8]=o*M+s*A+a*R+l*F,r[12]=o*S+s*L+a*D+l*N,r[1]=c*b+u*E+h*C+d*O,r[5]=c*w+u*T+h*P+d*I,r[9]=c*M+u*A+h*R+d*F,r[13]=c*S+u*L+h*D+d*N,r[2]=p*b+f*E+m*C+g*O,r[6]=p*w+f*T+m*P+g*I,r[10]=p*M+f*A+m*R+g*F,r[14]=p*S+f*L+m*D+g*N,r[3]=v*b+y*E+x*C+_*O,r[7]=v*w+y*T+x*P+_*I,r[11]=v*M+y*A+x*R+_*F,r[15]=v*S+y*L+x*D+_*N,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[4],i=e[8],r=e[12],o=e[1],s=e[5],a=e[9],l=e[13],c=e[2],u=e[6],h=e[10],d=e[14];return e[3]*(+r*a*u-i*l*u-r*s*h+n*l*h+i*s*d-n*a*d)+e[7]*(+t*a*d-t*l*h+r*o*h-i*o*d+i*l*c-r*a*c)+e[11]*(+t*l*u-t*s*d-r*o*u+n*o*d+r*s*c-n*l*c)+e[15]*(-i*s*c-t*a*u+t*s*h+i*o*u-n*o*h+n*a*c)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){const i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],r=e[3],o=e[4],s=e[5],a=e[6],l=e[7],c=e[8],u=e[9],h=e[10],d=e[11],p=e[12],f=e[13],m=e[14],g=e[15],v=u*m*l-f*h*l+f*a*d-s*m*d-u*a*g+s*h*g,y=p*h*l-c*m*l-p*a*d+o*m*d+c*a*g-o*h*g,x=c*f*l-p*u*l+p*s*d-o*f*d-c*s*g+o*u*g,_=p*u*a-c*f*a-p*s*h+o*f*h+c*s*m-o*u*m,b=t*v+n*y+i*x+r*_;if(0===b)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const w=1/b;return e[0]=v*w,e[1]=(f*h*r-u*m*r-f*i*d+n*m*d+u*i*g-n*h*g)*w,e[2]=(s*m*r-f*a*r+f*i*l-n*m*l-s*i*g+n*a*g)*w,e[3]=(u*a*r-s*h*r-u*i*l+n*h*l+s*i*d-n*a*d)*w,e[4]=y*w,e[5]=(c*m*r-p*h*r+p*i*d-t*m*d-c*i*g+t*h*g)*w,e[6]=(p*a*r-o*m*r-p*i*l+t*m*l+o*i*g-t*a*g)*w,e[7]=(o*h*r-c*a*r+c*i*l-t*h*l-o*i*d+t*a*d)*w,e[8]=x*w,e[9]=(p*u*r-c*f*r-p*n*d+t*f*d+c*n*g-t*u*g)*w,e[10]=(o*f*r-p*s*r+p*n*l-t*f*l-o*n*g+t*s*g)*w,e[11]=(c*s*r-o*u*r-c*n*l+t*u*l+o*n*d-t*s*d)*w,e[12]=_*w,e[13]=(c*f*i-p*u*i+p*n*h-t*f*h-c*n*m+t*u*m)*w,e[14]=(p*s*i-o*f*i-p*n*a+t*f*a+o*n*m-t*s*m)*w,e[15]=(o*u*i-c*s*i+c*n*a-t*u*a-o*n*h+t*s*h)*w,this}scale(e){const t=this.elements,n=e.x,i=e.y,r=e.z;return t[0]*=n,t[4]*=i,t[8]*=r,t[1]*=n,t[5]*=i,t[9]*=r,t[2]*=n,t[6]*=i,t[10]*=r,t[3]*=n,t[7]*=i,t[11]*=r,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,i))}makeTranslation(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),i=Math.sin(t),r=1-n,o=e.x,s=e.y,a=e.z,l=r*o,c=r*s;return this.set(l*o+n,l*s-i*a,l*a+i*s,0,l*s+i*a,c*s+n,c*a-i*o,0,l*a-i*s,c*a+i*o,r*a*a+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,i,r,o){return this.set(1,n,r,0,e,1,o,0,t,i,1,0,0,0,0,1),this}compose(e,t,n){const i=this.elements,r=t._x,o=t._y,s=t._z,a=t._w,l=r+r,c=o+o,u=s+s,h=r*l,d=r*c,p=r*u,f=o*c,m=o*u,g=s*u,v=a*l,y=a*c,x=a*u,_=n.x,b=n.y,w=n.z;return i[0]=(1-(f+g))*_,i[1]=(d+x)*_,i[2]=(p-y)*_,i[3]=0,i[4]=(d-x)*b,i[5]=(1-(h+g))*b,i[6]=(m+v)*b,i[7]=0,i[8]=(p+y)*w,i[9]=(m-v)*w,i[10]=(1-(h+f))*w,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,n){const i=this.elements;let r=Wi.set(i[0],i[1],i[2]).length();const o=Wi.set(i[4],i[5],i[6]).length(),s=Wi.set(i[8],i[9],i[10]).length();
947this.determinant()<0&&(r=-r),e.x=i[12],e.y=i[13],e.z=i[14],qi.copy(this);const a=1/r,l=1/o,c=1/s;return qi.elements[0]*=a,qi.elements[1]*=a,qi.elements[2]*=a,qi.elements[4]*=l,qi.elements[5]*=l,qi.elements[6]*=l,qi.elements[8]*=c,qi.elements[9]*=c,qi.elements[10]*=c,t.setFromRotationMatrix(qi),n.x=r,n.y=o,n.z=s,this}makePerspective(e,t,n,i,r,o){void 0===o&&console.warn(\"THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.\");const s=this.elements,a=2*r/(t-e),l=2*r/(n-i),c=(t+e)/(t-e),u=(n+i)/(n-i),h=-(o+r)/(o-r),d=-2*o*r/(o-r);return s[0]=a,s[4]=0,s[8]=c,s[12]=0,s[1]=0,s[5]=l,s[9]=u,s[13]=0,s[2]=0,s[6]=0,s[10]=h,s[14]=d,s[3]=0,s[7]=0,s[11]=-1,s[15]=0,this}makeOrthographic(e,t,n,i,r,o){const s=this.elements,a=1/(t-e),l=1/(n-i),c=1/(o-r),u=(t+e)*a,h=(n+i)*l,d=(o+r)*c;return s[0]=2*a,s[4]=0,s[8]=0,s[12]=-u,s[1]=0,s[5]=2*l,s[9]=0,s[13]=-h,s[2]=0,s[6]=0,s[10]=-2*c,s[14]=-d,s[3]=0,s[7]=0,s[11]=0,s[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let e=0;e<16;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}ji.prototype.isMatrix4=!0;const Wi=new pi,qi=new ji,Xi=new pi(0,0,0),Yi=new pi(1,1,1),Ji=new pi,Zi=new pi,$i=new pi,Ki=new ji,Qi=new di;class er{constructor(e=0,t=0,n=0,i=er.DefaultOrder){this._x=e,this._y=t,this._z=n,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,i=this._order){return this._x=e,this._y=t,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){const i=e.elements,r=i[0],o=i[4],s=i[8],a=i[1],l=i[5],c=i[9],u=i[2],h=i[6],d=i[10];switch(t){case\"XYZ\":this._y=Math.asin(Hn(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-c,d),this._z=Math.atan2(-o,r)):(this._x=Math.atan2(h,l),this._z=0);break;case\"YXZ\":this._x=Math.asin(-Hn(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(s,d),this._z=Math.atan2(a,l)):(this._y=Math.atan2(-u,r),this._z=0);break;case\"ZXY\":this._x=Math.asin(Hn(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(-u,d),this._z=Math.atan2(-o,l)):(this._y=0,this._z=Math.atan2(a,r));break;case\"ZYX\":this._y=Math.asin(-Hn(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(h,d),this._z=Math.atan2(a,r)):(this._x=0,this._z=Math.atan2(-o,l));break;case\"YZX\":this._z=Math.asin(Hn(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-c,l),this._y=Math.atan2(-u,r)):(this._x=0,this._y=Math.atan2(s,d));break;case\"XZY\":this._z=Math.asin(-Hn(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(h,l),this._y=Math.atan2(s,r)):(this._x=Math.atan2(-c,d),this._y=0);break;default:console.warn(\"THREE.Euler: .setFromRotationMatrix() encountered an unknown order: \"+t)}return this._order=t,!0===n&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return Ki.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Ki,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return Qi.setFromEuler(this),this.setFromQuaternion(Qi,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}toVector3(e){return e?e.set(this._x,this._y,this._z):new pi(this._x,this._y,this._z)}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}}er.prototype.isEuler=!0,er.DefaultOrder=\"XYZ\",er.RotationOrders=[\"XYZ\",\"YZX\",\"ZXY\",\"XZY\",\"YXZ\",\"ZYX\"];class tr{constructor(){this.mask=1}set(e){this.mask=1<<e}enable(e){this.mask|=1<<e}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e}disable(e){this.mask&=~(1<<e)}disableAll(){this.mask=0}test(e){return!!(this.mask&e.mask)}}let nr=0;const ir=new pi,rr=new di,or=new ji,sr=new pi,ar=new pi,lr=new pi,cr=new di,ur=new pi(1,0,0),hr=new pi(0,1,0),dr=new pi(0,0,1),pr={type:\"added\"},fr={type:\"removed\"};class mr extends Nn{constructor(){super(),Object.defineProperty(this,\"id\",{value:nr++}),this.uuid=Vn(),this.name=\"\",this.type=\"Object3D\",this.parent=null,this.children=[],this.up=mr.DefaultUp.clone();const e=new pi,t=new er,n=new di,i=new pi(1,1,1);t._onChange((function(){n.setFromEuler(t,!1)})),n._onChange((function(){t.setFromQuaternion(n,void 0,!1)})),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new ji},normalMatrix:{value:new $n}}),this.matrix=new ji,this.matrixWorld=new ji,this.matrixAutoUpdate=mr.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new tr,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}
vendor: 4,083 bytes, line 947
947setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return rr.setFromAxisAngle(e,t),this.quaternion.multiply(rr),this}rotateOnWorldAxis(e,t){return rr.setFromAxisAngle(e,t),this.quaternion.premultiply(rr),this}rotateX(e){return this.rotateOnAxis(ur,e)}rotateY(e){return this.rotateOnAxis(hr,e)}rotateZ(e){return this.rotateOnAxis(dr,e)}translateOnAxis(e,t){return ir.copy(e).applyQuaternion(this.quaternion),this.position.add(ir.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(ur,e)}translateY(e){return this.translateOnAxis(hr,e)}translateZ(e){return this.translateOnAxis(dr,e)}localToWorld(e){return e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return e.applyMatrix4(or.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?sr.copy(e):sr.set(e,t,n);const i=this.parent;this.updateWorldMatrix(!0,!1),ar.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?or.lookAt(ar,sr,this.up):or.lookAt(sr,ar,this.up),this.quaternion.setFromRotationMatrix(or),i&&(or.extractRotation(i.matrixWorld),rr.setFromRotationMatrix(or),this.quaternion.premultiply(rr.invert()))}add(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return e===this?(console.error(\"THREE.Object3D.add: object can't be added as a child of itself.\",e),this):(e&&e.isObject3D?(null!==e.parent&&e.parent.remove(e),e.parent=this,this.children.push(e),e.dispatchEvent(pr)):console.error(\"THREE.Object3D.add: object not an instance of THREE.Object3D.\",e),this)}remove(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.remove(arguments[e]);return this}const t=this.children.indexOf(e);return-1!==t&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(fr)),this}removeFromParent(){const e=this.parent;return null!==e&&e.remove(this),this}clear(){for(let e=0;e<this.children.length;e++){const t=this.children[e];t.parent=null,t.dispatchEvent(fr)}return this.children.length=0,this}attach(e){return this.updateWorldMatrix(!0,!1),or.copy(this.matrixWorld).invert(),null!==e.parent&&(e.parent.updateWorldMatrix(!0,!1),or.multiply(e.parent.matrixWorld)),e.applyMatrix4(or),this.add(e),e.updateWorldMatrix(!1,!0),this}getObjectById(e){return this.getObjectByProperty(\"id\",e)}getObjectByName(e){return this.getObjectByProperty(\"name\",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let n=0,i=this.children.length;n<i;n++){const i=this.children[n].getObjectByProperty(e,t);if(void 0!==i)return i}}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(ar,e,lr),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(ar,cr,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].traverse(e)}traverseVisible(e){if(!1===this.visible)return;e(this);const t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].traverseVisible(e)}traverseAncestors(e){const t=this.parent;null!==t&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].updateMatrixWorld(e)}updateWorldMatrix(e,t){const n=this.parent;if(!0===e&&null!==n&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===t){const e=this.children;for(let t=0,n=e.length;t<n;t++)e[t].updateWorldMatrix(!1,!0)}}
947toJSON(e){const t=void 0===e||\"string\"==typeof e,n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{}},n.metadata={version:4.5,type:\"Object\",generator:\"Object3D.toJSON\"});const i={};function r(t,n){return void 0===t[n.uuid]&&(t[n.uuid]=n.toJSON(e)),n.uuid}if(i.uuid=this.uuid,i.type=this.type,\"\"!==this.name&&(i.name=this.name),!0===this.castShadow&&(i.castShadow=!0),!0===this.receiveShadow&&(i.receiveShadow=!0),!1===this.visible&&(i.visible=!1),!1===this.frustumCulled&&(i.frustumCulled=!1),0!==this.renderOrder&&(i.renderOrder=this.renderOrder),\"{}\"!==JSON.stringify(this.userData)&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),!1===this.matrixAutoUpdate&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type=\"InstancedMesh\",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(i.instanceColor=this.instanceColor.toJSON())),this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=r(e.geometries,this.geometry);const t=this.geometry.parameters;if(void 0!==t&&void 0!==t.shapes){const n=t.shapes;if(Array.isArray(n))for(let t=0,i=n.length;t<i;t++){const i=n[t];r(e.shapes,i)}else r(e.shapes,n)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(r(e.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){const t=[];for(let n=0,i=this.material.length;n<i;n++)t.push(r(e.materials,this.material[n]));i.material=t}else i.material=r(e.materials,this.material);if(this.children.length>0){i.children=[];for(let t=0;t<this.children.length;t++)i.children.push(this.children[t].toJSON(e).object)}if(this.animations.length>0){i.animations=[];for(let t=0;t<this.animations.length;t++){const n=this.animations[t];i.animations.push(r(e.animations,n))}}if(t){const t=o(e.geometries),i=o(e.materials),r=o(e.textures),s=o(e.images),a=o(e.shapes),l=o(e.skeletons),c=o(e.animations);t.length>0&&(n.geometries=t),i.length>0&&(n.materials=i),r.length>0&&(n.textures=r),s.length>0&&(n.images=s),a.length>0&&(n.shapes=a),l.length>0&&(n.skeletons=l),c.length>0&&(n.animations=c)}return n.object=i,n;function o(e){const t=[];for(const n in e){const i=e[n];delete i.metadata,t.push(i)}return t}}clone(e){return(new this.constructor).copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(let t=0;t<e.children.length;t++){const n=e.children[t];this.add(n.clone())}return this}}mr.DefaultUp=new pi(0,1,0),mr.DefaultMatrixAutoUpdate=!0,mr.prototype.isObject3D=!0;const gr=new pi,vr=new pi,yr=new pi,xr=new pi,_r=new pi,br=new pi,wr=new pi,Mr=new pi,Sr=new pi,Er=new pi;class Tr{constructor(e=new pi,t=new pi,n=new pi){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,i){i.subVectors(n,t),gr.subVectors(e,t),i.cross(gr);const r=i.lengthSq();return r>0?i.multiplyScalar(1/Math.sqrt(r)):i.set(0,0,0)}static getBarycoord(e,t,n,i,r){gr.subVectors(i,t),vr.subVectors(n,t),yr.subVectors(e,t);const o=gr.dot(gr),s=gr.dot(vr),a=gr.dot(yr),l=vr.dot(vr),c=vr.dot(yr),u=o*l-s*s;if(0===u)return r.set(-2,-1,-1);const h=1/u,d=(l*a-s*c)*h,p=(o*c-s*a)*h;return r.set(1-d-p,p,d)}static containsPoint(e,t,n,i){return this.getBarycoord(e,t,n,i,xr),xr.x>=0&&xr.y>=0&&xr.x+xr.y<=1}static getUV(e,t,n,i,r,o,s,a){return this.getBarycoord(e,t,n,i,xr),a.set(0,0),a.addScaledVector(r,xr.x),a.addScaledVector(o,xr.y),a.addScaledVector(s,xr.z),a}static isFrontFacing(e,t,n,i){return gr.subVectors(n,t),vr.subVectors(e,t),gr.cross(vr).dot(i)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,t,n,i){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,i),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return gr.subVectors(this.c,this.b),vr.subVectors(this.a,this.b),.5*gr.cross(vr).length()}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Tr.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Tr.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,n,i,r){return Tr.getUV(e,this.a,this.b,this.c,t,n,i,r)}containsPoint(e){return Tr.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Tr.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,i=this.b,r=this.c;let o,s;_r.subVectors(i,n),br.subVectors(r,n),Mr.subVectors(e,n);const a=_r.dot(Mr),l=br.dot(Mr);if(a<=0&&l<=0)return t.copy(n);Sr.subVectors(e,i);const c=_r.dot(Sr),u=br.dot(Sr);if(c>=0&&u<=c)return t.copy(i);const h=a*u-c*l;if(h<=0&&a>=0&&c<=0)return o=a/(a-c),t.copy(n).addScaledVector(_r,o);Er.subVectors(e,r);const d=_r.dot(Er),p=br.dot(Er);if(p>=0&&d<=p)return t.copy(r);const f=d*l-a*p;if(f<=0&&l>=0&&p<=0)return s=l/(l-p),t.copy(n).addScaledVector(br,s);const m=c*p-d*u;if(m<=0&&u-c>=0&&d-p>=0)return wr.subVectors(r,i),s=(u-c)/(u-c+(d-p)),t.copy(i).addScaledVector(wr,s);const g=1/(m+f+h);return o=f*g,s=h*g,t.copy(n).addScaledVector(_r,o).addScaledVector(br,s)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}let Ar=0;class Lr extends Nn{constructor(){super(),Object.defineProperty(this,\"id\",{value:Ar++}),this.uuid=Vn(),this.name=\"\",this.type=\"Material\",this.fog=!0,this.blending=_,this.side=f,this.vertexColors=!1,this.opacity=1,this.format=ze,this.transparent=!1,this.blendSrc=I,this.blendDst=F,this.blendEquation=E,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=j,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=Sn,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=un,this.stencilZFail=un,this.stencilZPass=un,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(void 0!==e)for(const t in e){const n=e[t];if(void 0===n){console.warn(\"THREE.Material: '\"+t+\"' parameter is undefined.\");continue}if(\"shading\"===t){console.warn(\"THREE.\"+this.type+\": .shading has been removed. Use the boolean .flatShading instead.\"),this.flatShading=n===v;continue}const i=this[t];void 0!==i?i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[t]=n:console.warn(\"THREE.\"+this.type+\": '\"+t+\"' is not a property of this material.\")}}
947toJSON(e){const t=void 0===e||\"string\"==typeof e;t&&(e={textures:{},images:{}});const n={metadata:{version:4.5,type:\"Material\",generator:\"Material.toJSON\"}};function i(e){const t=[];for(const n in e){const i=e[n];delete i.metadata,t.push(i)}return t}if(n.uuid=this.uuid,n.type=this.type,\"\"!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),void 0!==this.sheen&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,void 0!==this.combine&&(n.combine=this.combine)),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(n.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.transmission&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),void 0!==this.thickness&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),void 0!==this.attenuationDistance&&(n.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(n.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(n.size=this.size),null!==this.shadowSide&&(n.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==_&&(n.blending=this.blending),this.side!==f&&(n.side=this.side),this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.format!==ze&&(n.format=this.format),!0===this.transparent&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.colorWrite=this.colorWrite,n.stencilWrite=this.stencilWrite,n.stencilWriteMask=this.stencilWriteMask,n.stencilFunc=this.stencilFunc,n.stencilRef=this.stencilRef,n.stencilFuncMask=this.stencilFuncMask,n.stencilFail=this.stencilFail,n.stencilZFail=this.stencilZFail,n.stencilZPass=this.stencilZPass,this.rotation&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.alphaToCoverage&&(n.alphaToCoverage=this.alphaToCoverage),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),\"round\"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),\"round\"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(n.flatShading=this.flatShading),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),\"{}\"!==JSON.stringify(this.userData)&&(n.userData=this.userData),t){const t=i(e.textures),r=i(e.images);t.length>0&&(n.textures=t),r.length>0&&(n.images=r)}return n}clone(){return(new this.constructor).copy(this)}copy(e){this.name=e.name,this.fog=e.fog,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.format=e.format,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let n=null;if(null!==t){const e=t.length;n=new Array(e);for(let i=0;i!==e;++i)n[i]=t[i].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipSh
947adows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:\"dispose\"})}set needsUpdate(e){!0===e&&this.version++}}Lr.prototype.isMaterial=!0;const Cr={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Pr={h:0,s:0,l:0},Rr={h:0,s:0,l:0};function Dr(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+6*(t-e)*(2/3-n):e}function Or(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function Ir(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}class Fr{constructor(e,t,n){return void 0===t&&void 0===n?this.set(e):this.setRGB(e,t,n)}set(e){return e&&e.isColor?this.copy(e):\"number\"==typeof e?this.setHex(e):\"string\"==typeof e&&this.setStyle(e),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,this}setRGB(e,t,n){return this.r=e,this.g=t,this.b=n,this}setHSL(e,t,n){if(e=jn(e,1),t=Hn(t,0,1),n=Hn(n,0,1),0===t)this.r=this.g=this.b=n;else{const i=n<=.5?n*(1+t):n+t-n*t,r=2*n-i;this.r=Dr(r,i,e+1/3),this.g=Dr(r,i,e),this.b=Dr(r,i,e-1/3)}return this}setStyle(e){function t(t){void 0!==t&&parseFloat(t)<1&&console.warn(\"THREE.Color: Alpha component of \"+e+\" will be ignored.\")}let n;if(n=/^((?:rgb|hsl)a?)\\(([^\\)]*)\\)/.exec(e)){let e;const i=n[1],r=n[2];switch(i){case\"rgb\":case\"rgba\":if(e=/^\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec(r))return this.r=Math.min(255,parseInt(e[1],10))/255,this.g=Math.min(255,parseInt(e[2],10))/255,this.b=Math.min(255,parseInt(e[3],10))/255,t(e[4]),this;if(e=/^\\s*(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec(r))return this.r=Math.min(100,parseInt(e[1],10))/100,this.g=Math.min(100,parseInt(e[2],10))/100,this.b=Math.min(100,parseInt(e[3],10))/100,t(e[4]),this;break;case\"hsl\":case\"hsla\":if(e=/^\\s*(\\d*\\.?\\d+)\\s*,\\s*(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec(r)){const n=parseFloat(e[1])/360,i=parseInt(e[2],10)/100,r=parseInt(e[3],10)/100;return t(e[4]),this.setHSL(n,i,r)}}}else if(n=/^\\#([A-Fa-f\\d]+)$/.exec(e)){const e=n[1],t=e.length;if(3===t)return this.r=parseInt(e.charAt(0)+e.charAt(0),16)/255,this.g=parseInt(e.charAt(1)+e.charAt(1),16)/255,this.b=parseInt(e.charAt(2)+e.charAt(2),16)/255,this;if(6===t)return this.r=parseInt(e.charAt(0)+e.charAt(1),16)/255,this.g=parseInt(e.charAt(2)+e.charAt(3),16)/255,this.b=parseInt(e.charAt(4)+e.charAt(5),16)/255,this}return e&&e.length>0?this.setColorName(e):this}setColorName(e){const t=Cr[e.toLowerCase()];return void 0!==t?this.setHex(t):console.warn(\"THREE.Color: Unknown color \"+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copyGammaToLinear(e,t=2){return this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this}copyLinearToGamma(e,t=2){const n=t>0?1/t:1;return this.r=Math.pow(e.r,n),this.g=Math.pow(e.g,n),this.b=Math.pow(e.b,n),this}convertGammaToLinear(e){return this.copyGammaToLinear(this,e),this}convertLinearToGamma(e){return this.copyLinearToGamma(this,e),this}copySRGBToLinear(e){return this.r=Or(e.r),this.g=Or(e.g),this.b=Or(e.b),this}copyLinearToSRGB(e){return this.r=Ir(e.r),this.g=Ir(e.g),this.b=Ir(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){return 255*this.r<<16^255*this.g<<8^255*this.b}getHexString(){return(\"000000\"+this.getHex().toString(16)).slice(-6)}getHSL(e){const t=this.r,n=this.g,i=this.b,r=Math.max(t,n,i),o=Math.min(t,n,i);let s,a;const l=(o+r)/2;if(o===r)s=0,a=0;else{const e=r-o;switch(a=l<=.5?e/(r+o):e/(2-r-o),r){case t:s=(n-i)/e+(n<i?6:0);break;case n:s=(i-t)/e+2;break;case i:s=(t-n)/e+4}s/=6}return e.h=s,e.s=a,e.l=l,e}getStyle(){return\"rgb(\"+(255*this.r|0)+\",\"+(255*this.g|0)+\",\"+(255*this.b|0)+\")\"}offsetHSL(e,t,n){return this.getHSL(Pr),Pr.h+=e,Pr.s+=t,Pr.l+=n,this.setHSL(Pr.h,Pr.s,Pr.l),this}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}
vendor: 4,958 bytes, line 947
947lerpColors(e,t,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){this.getHSL(Pr),e.getHSL(Rr);const n=Wn(Pr.h,Rr.h,t),i=Wn(Pr.s,Rr.s,t),r=Wn(Pr.l,Rr.l,t);return this.setHSL(n,i,r),this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),!0===e.normalized&&(this.r/=255,this.g/=255,this.b/=255),this}toJSON(){return this.getHex()}}Fr.NAMES=Cr,Fr.prototype.isColor=!0,Fr.prototype.r=1,Fr.prototype.g=1,Fr.prototype.b=1;class Nr extends Lr{constructor(e){super(),this.type=\"MeshBasicMaterial\",this.color=new Fr(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=J,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap=\"round\",this.wireframeLinejoin=\"round\",this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this}}Nr.prototype.isMeshBasicMaterial=!0;const Ur=new pi,zr=new Zn;class Br{constructor(e,t,n){if(Array.isArray(e))throw new TypeError(\"THREE.BufferAttribute: array should be a Typed Array.\");this.name=\"\",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=!0===n,this.usage=En,this.updateRange={offset:0,count:-1},this.version=0}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let i=0,r=this.itemSize;i<r;i++)this.array[e+i]=t.array[n+i];return this}copyArray(e){return this.array.set(e),this}copyColorsArray(e){const t=this.array;let n=0;for(let i=0,r=e.length;i<r;i++){let r=e[i];void 0===r&&(console.warn(\"THREE.BufferAttribute.copyColorsArray(): color is undefined\",i),r=new Fr),t[n++]=r.r,t[n++]=r.g,t[n++]=r.b}return this}copyVector2sArray(e){const t=this.array;let n=0;for(let i=0,r=e.length;i<r;i++){let r=e[i];void 0===r&&(console.warn(\"THREE.BufferAttribute.copyVector2sArray(): vector is undefined\",i),r=new Zn),t[n++]=r.x,t[n++]=r.y}return this}copyVector3sArray(e){const t=this.array;let n=0;for(let i=0,r=e.length;i<r;i++){let r=e[i];void 0===r&&(console.warn(\"THREE.BufferAttribute.copyVector3sArray(): vector is undefined\",i),r=new pi),t[n++]=r.x,t[n++]=r.y,t[n++]=r.z}return this}copyVector4sArray(e){const t=this.array;let n=0;for(let i=0,r=e.length;i<r;i++){let r=e[i];void 0===r&&(console.warn(\"THREE.BufferAttribute.copyVector4sArray(): vector is undefined\",i),r=new li),t[n++]=r.x,t[n++]=r.y,t[n++]=r.z,t[n++]=r.w}return this}applyMatrix3(e){if(2===this.itemSize)for(let t=0,n=this.count;t<n;t++)zr.fromBufferAttribute(this,t),zr.applyMatrix3(e),this.setXY(t,zr.x,zr.y);else if(3===this.itemSize)for(let t=0,n=this.count;t<n;t++)Ur.fromBufferAttribute(this,t),Ur.applyMatrix3(e),this.setXYZ(t,Ur.x,Ur.y,Ur.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)Ur.x=this.getX(t),Ur.y=this.getY(t),Ur.z=this.getZ(t),Ur.applyMatrix4(e),this.setXYZ(t,Ur.x,Ur.y,Ur.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)Ur.x=this.getX(t),Ur.y=this.getY(t),Ur.z=this.getZ(t),Ur.applyNormalMatrix(e),this.setXYZ(t,Ur.x,Ur.y,Ur.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)Ur.x=this.getX(t),Ur.y=this.getY(t),Ur.z=this.getZ(t),Ur.transformDirection(e),this.setXYZ(t,Ur.x,Ur.y,Ur.z);return this}set(e,t=0){return this.array.set(e,t),this}getX(e){return this.array[e*this.itemSize]}setX(e,t){return this.array[e*this.itemSize]=t,this}getY(e){return this.array[e*this.itemSize+1]}setY(e,t){return this.array[e*this.itemSize+1]=t,this}getZ(e){return this.array[e*this.itemSize+2]}setZ(e,t){return this.array[e*this.itemSize+2]=t,this}getW(e){return this.array[e*this.itemSize+3]}setW(e,t){return this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,i){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this}setXYZW(e,t,n,i,r){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this.array[e+3]=r,this}
947onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.prototype.slice.call(this.array),normalized:this.normalized};return\"\"!==this.name&&(e.name=this.name),this.usage!==En&&(e.usage=this.usage),0===this.updateRange.offset&&-1===this.updateRange.count||(e.updateRange=this.updateRange),e}}Br.prototype.isBufferAttribute=!0;class Gr extends Br{constructor(e,t,n){super(new Int8Array(e),t,n)}}class kr extends Br{constructor(e,t,n){super(new Uint8Array(e),t,n)}}class Vr extends Br{constructor(e,t,n){super(new Uint8ClampedArray(e),t,n)}}class Hr extends Br{constructor(e,t,n){super(new Int16Array(e),t,n)}}class jr extends Br{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class Wr extends Br{constructor(e,t,n){super(new Int32Array(e),t,n)}}class qr extends Br{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class Xr extends Br{constructor(e,t,n){super(new Uint16Array(e),t,n)}}Xr.prototype.isFloat16BufferAttribute=!0;class Yr extends Br{constructor(e,t,n){super(new Float32Array(e),t,n)}}class Jr extends Br{constructor(e,t,n){super(new Float64Array(e),t,n)}}let Zr=0;const $r=new ji,Kr=new mr,Qr=new pi,eo=new gi,to=new gi,no=new pi;class io extends Nn{constructor(){super(),Object.defineProperty(this,\"id\",{value:Zr++}),this.uuid=Vn(),this.name=\"\",this.type=\"BufferGeometry\",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(Kn(e)>65535?qr:jr)(e,1):this.index=e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return void 0!==this.attributes[e]}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);const n=this.attributes.normal;if(void 0!==n){const t=(new $n).getNormalMatrix(e);n.applyNormalMatrix(t),n.needsUpdate=!0}const i=this.attributes.tangent;return void 0!==i&&(i.transformDirection(e),i.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(e){return $r.makeRotationFromQuaternion(e),this.applyMatrix4($r),this}rotateX(e){return $r.makeRotationX(e),this.applyMatrix4($r),this}rotateY(e){return $r.makeRotationY(e),this.applyMatrix4($r),this}rotateZ(e){return $r.makeRotationZ(e),this.applyMatrix4($r),this}translate(e,t,n){return $r.makeTranslation(e,t,n),this.applyMatrix4($r),this}scale(e,t,n){return $r.makeScale(e,t,n),this.applyMatrix4($r),this}lookAt(e){return Kr.lookAt(e),Kr.updateMatrix(),this.applyMatrix4(Kr.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Qr).negate(),this.translate(Qr.x,Qr.y,Qr.z),this}setFromPoints(e){const t=[];for(let n=0,i=e.length;n<i;n++){const i=e[n];t.push(i.x,i.y,i.z||0)}return this.setAttribute(\"position\",new Yr(t,3)),this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new gi);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set \"mesh.frustumCulled\" to \"false\".',this),void this.boundingBox.set(new pi(-1/0,-1/0,-1/0),new pi(1/0,1/0,1/0));if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e<n;e++){const n=t[e];eo.setFromBufferAttribute(n),this.morphTargetsRelative?(no.addVectors(this.boundingBox.min,eo.min),this.boundingBox.expandByPoint(no),no.addVectors(this.boundingBox.max,eo.max),this.boundingBox.expandByPoint(no)):(this.boundingBox.expandByPoint(eo.min),this.boundingBox.expandByPoint(eo.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The \"position\" attribute is likely to have NaN values.',this)}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new Fi);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set \"mesh.frustumCulled\" to \"false\".',this),void this.boundingSphere.set(new pi,1/0);if(e){const n=this.boundingSphere.center;if(eo.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e<n;e++){const n=t[e];to.setFromBufferAttribute(n),this.morphTargetsRelative?(no.addVectors(eo.min,to.min),eo.exp
vendor: 4,894 bytes, line 947
947andByPoint(no),no.addVectors(eo.max,to.max),eo.expandByPoint(no)):(eo.expandByPoint(to.min),eo.expandByPoint(to.max))}eo.getCenter(n);let i=0;for(let t=0,r=e.count;t<r;t++)no.fromBufferAttribute(e,t),i=Math.max(i,n.distanceToSquared(no));if(t)for(let r=0,o=t.length;r<o;r++){const o=t[r],s=this.morphTargetsRelative;for(let t=0,r=o.count;t<r;t++)no.fromBufferAttribute(o,t),s&&(Qr.fromBufferAttribute(e,t),no.add(Qr)),i=Math.max(i,n.distanceToSquared(no))}this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The \"position\" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(null===e||void 0===t.position||void 0===t.normal||void 0===t.uv)return void console.error(\"THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)\");const n=e.array,i=t.position.array,r=t.normal.array,o=t.uv.array,s=i.length/3;void 0===t.tangent&&this.setAttribute(\"tangent\",new Br(new Float32Array(4*s),4));const a=t.tangent.array,l=[],c=[];for(let e=0;e<s;e++)l[e]=new pi,c[e]=new pi;const u=new pi,h=new pi,d=new pi,p=new Zn,f=new Zn,m=new Zn,g=new pi,v=new pi;function y(e,t,n){u.fromArray(i,3*e),h.fromArray(i,3*t),d.fromArray(i,3*n),p.fromArray(o,2*e),f.fromArray(o,2*t),m.fromArray(o,2*n),h.sub(u),d.sub(u),f.sub(p),m.sub(p);const r=1/(f.x*m.y-m.x*f.y);isFinite(r)&&(g.copy(h).multiplyScalar(m.y).addScaledVector(d,-f.y).multiplyScalar(r),v.copy(d).multiplyScalar(f.x).addScaledVector(h,-m.x).multiplyScalar(r),l[e].add(g),l[t].add(g),l[n].add(g),c[e].add(v),c[t].add(v),c[n].add(v))}let x=this.groups;0===x.length&&(x=[{start:0,count:n.length}]);for(let e=0,t=x.length;e<t;++e){const t=x[e],i=t.start;for(let e=i,r=i+t.count;e<r;e+=3)y(n[e+0],n[e+1],n[e+2])}const _=new pi,b=new pi,w=new pi,M=new pi;function S(e){w.fromArray(r,3*e),M.copy(w);const t=l[e];_.copy(t),_.sub(w.multiplyScalar(w.dot(t))).normalize(),b.crossVectors(M,t);const n=b.dot(c[e])<0?-1:1;a[4*e]=_.x,a[4*e+1]=_.y,a[4*e+2]=_.z,a[4*e+3]=n}for(let e=0,t=x.length;e<t;++e){const t=x[e],i=t.start;for(let e=i,r=i+t.count;e<r;e+=3)S(n[e+0]),S(n[e+1]),S(n[e+2])}}computeVertexNormals(){const e=this.index,t=this.getAttribute(\"position\");if(void 0!==t){let n=this.getAttribute(\"normal\");if(void 0===n)n=new Br(new Float32Array(3*t.count),3),this.setAttribute(\"normal\",n);else for(let e=0,t=n.count;e<t;e++)n.setXYZ(e,0,0,0);const i=new pi,r=new pi,o=new pi,s=new pi,a=new pi,l=new pi,c=new pi,u=new pi;if(e)for(let h=0,d=e.count;h<d;h+=3){const d=e.getX(h+0),p=e.getX(h+1),f=e.getX(h+2);i.fromBufferAttribute(t,d),r.fromBufferAttribute(t,p),o.fromBufferAttribute(t,f),c.subVectors(o,r),u.subVectors(i,r),c.cross(u),s.fromBufferAttribute(n,d),a.fromBufferAttribute(n,p),l.fromBufferAttribute(n,f),s.add(c),a.add(c),l.add(c),n.setXYZ(d,s.x,s.y,s.z),n.setXYZ(p,a.x,a.y,a.z),n.setXYZ(f,l.x,l.y,l.z)}else for(let e=0,s=t.count;e<s;e+=3)i.fromBufferAttribute(t,e+0),r.fromBufferAttribute(t,e+1),o.fromBufferAttribute(t,e+2),c.subVectors(o,r),u.subVectors(i,r),c.cross(u),n.setXYZ(e+0,c.x,c.y,c.z),n.setXYZ(e+1,c.x,c.y,c.z),n.setXYZ(e+2,c.x,c.y,c.z);this.normalizeNormals(),n.needsUpdate=!0}}merge(e,t){if(!e||!e.isBufferGeometry)return void console.error(\"THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.\",e);void 0===t&&(t=0,console.warn(\"THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge.\"));const n=this.attributes;for(const i in n){if(void 0===e.attributes[i])continue;const r=n[i].array,o=e.attributes[i],s=o.array,a=o.itemSize*t,l=Math.min(s.length,r.length-a);for(let e=0,t=a;e<l;e++,t++)r[t]=s[e]}return this}normalizeNormals(){const e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)no.fromBufferAttribute(e,t),no.normalize(),e.setXYZ(t,no.x,no.y,no.z)}toNonIndexed(){function e(e,t){const n=e.array,i=e.itemSize,r=e.normalized,o=new n.constructor(t.length*i);let s=0,a=0;for(let r=0,l=t.length;r<l;r++){s=e.isInterleavedBufferAttribute?t[r]*e.data.stride+e.offset:t[r]*i;for(let e=0;e<i;e++)o[a++]=n[s++]}return new Br(o,i,r)}if(null===this.index)return console.warn(\"THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed.\"),this;const t=new io,n=this.index.array,i=this.attributes;for(const r in i){const o=e(i[r],n);t.setAttribute(r,o)}const r=this.morphAttributes;for(const i in r){const o=[],s=r[i];for(let t=0,i=s.length;t<i;t++){const i=e(s[t],n);o.push(i)}t.morphAttributes[i]=o}t.morphTargetsRelative=this.morphTargetsRelative;const o=this.groups;for(let e=0,n=o.length;e<n;e++){const n=o[e];t.addGroup(n.start,n.count,n.materialIndex)}return t}toJSON(){const e={metadata:{version:4.5,type:\"BufferGeometry\",generator:\"BufferGeometry.toJSON\"}};
947if(e.uuid=this.uuid,e.type=this.type,\"\"!==this.name&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),void 0!==this.parameters){const t=this.parameters;for(const n in t)void 0!==t[n]&&(e[n]=t[n]);return e}e.data={attributes:{}};const t=this.index;null!==t&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const n=this.attributes;for(const t in n){const i=n[t];e.data.attributes[t]=i.toJSON(e.data)}const i={};let r=!1;for(const t in this.morphAttributes){const n=this.morphAttributes[t],o=[];for(let t=0,i=n.length;t<i;t++){const i=n[t];o.push(i.toJSON(e.data))}o.length>0&&(i[t]=o,r=!0)}r&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const s=this.boundingSphere;return null!==s&&(e.data.boundingSphere={center:s.center.toArray(),radius:s.radius}),e}clone(){return(new this.constructor).copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const n=e.index;null!==n&&this.setIndex(n.clone(t));const i=e.attributes;for(const e in i){const n=i[e];this.setAttribute(e,n.clone(t))}const r=e.morphAttributes;for(const e in r){const n=[],i=r[e];for(let e=0,r=i.length;e<r;e++)n.push(i[e].clone(t));this.morphAttributes[e]=n}this.morphTargetsRelative=e.morphTargetsRelative;const o=e.groups;for(let e=0,t=o.length;e<t;e++){const t=o[e];this.addGroup(t.start,t.count,t.materialIndex)}const s=e.boundingBox;null!==s&&(this.boundingBox=s.clone());const a=e.boundingSphere;return null!==a&&(this.boundingSphere=a.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,void 0!==e.parameters&&(this.parameters=Object.assign({},e.parameters)),this}dispose(){this.dispatchEvent({type:\"dispose\"})}}io.prototype.isBufferGeometry=!0;const ro=new ji,oo=new Hi,so=new Fi,ao=new pi,lo=new pi,co=new pi,uo=new pi,ho=new pi,po=new pi,fo=new pi,mo=new pi,go=new pi,vo=new Zn,yo=new Zn,xo=new Zn,_o=new pi,bo=new pi;class wo extends mr{constructor(e=new io,t=new Nr){super(),this.type=\"Mesh\",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=e.material,this.geometry=e.geometry,this}updateMorphTargets(){const e=this.geometry;if(e.isBufferGeometry){const t=e.morphAttributes,n=Object.keys(t);if(n.length>0){const e=t[n[0]];if(void 0!==e){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,n=e.length;t<n;t++){const n=e[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=t}}}}else{const t=e.morphTargets;void 0!==t&&t.length>0&&console.error(\"THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.\")}}raycast(e,t){const n=this.geometry,i=this.material,r=this.matrixWorld;if(void 0===i)return;if(null===n.boundingSphere&&n.computeBoundingSphere(),so.copy(n.boundingSphere),so.applyMatrix4(r),!1===e.ray.intersectsSphere(so))return;if(ro.copy(r).invert(),oo.copy(e.ray).applyMatrix4(ro),null!==n.boundingBox&&!1===oo.intersectsBox(n.boundingBox))return;let o;if(n.isBufferGeometry){const r=n.index,s=n.attributes.position,a=n.morphAttributes.position,l=n.morphTargetsRelative,c=n.attributes.uv,u=n.attributes.uv2,h=n.groups,d=n.drawRange;if(null!==r)if(Array.isArray(i))for(let n=0,p=h.length;n<p;n++){const p=h[n],f=i[p.materialIndex];for(let n=Math.max(p.start,d.start),i=Math.min(r.count,Math.min(p.start+p.count,d.start+d.count));n<i;n+=3){const i=r.getX(n),h=r.getX(n+1),d=r.getX(n+2);o=Mo(this,f,e,oo,s,a,l,c,u,i,h,d),o&&(o.faceIndex=Math.floor(n/3),o.face.materialIndex=p.materialIndex,t.push(o))}}else for(let n=Math.max(0,d.start),h=Math.min(r.count,d.start+d.count);n<h;n+=3){const h=r.getX(n),d=r.getX(n+1),p=r.getX(n+2);o=Mo(this,i,e,oo,s,a,l,c,u,h,d,p),o&&(o.faceIndex=Math.floor(n/3),t.pu
vendor: 5,846 bytes, line 947
947sh(o))}else if(void 0!==s)if(Array.isArray(i))for(let n=0,r=h.length;n<r;n++){const r=h[n],p=i[r.materialIndex];for(let n=Math.max(r.start,d.start),i=Math.min(s.count,Math.min(r.start+r.count,d.start+d.count));n<i;n+=3)o=Mo(this,p,e,oo,s,a,l,c,u,n,n+1,n+2),o&&(o.faceIndex=Math.floor(n/3),o.face.materialIndex=r.materialIndex,t.push(o))}else for(let n=Math.max(0,d.start),r=Math.min(s.count,d.start+d.count);n<r;n+=3)o=Mo(this,i,e,oo,s,a,l,c,u,n,n+1,n+2),o&&(o.faceIndex=Math.floor(n/3),t.push(o))}else n.isGeometry&&console.error(\"THREE.Mesh.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.\")}}function Mo(e,t,n,i,r,o,s,a,l,c,u,h){ao.fromBufferAttribute(r,c),lo.fromBufferAttribute(r,u),co.fromBufferAttribute(r,h);const d=e.morphTargetInfluences;if(o&&d){fo.set(0,0,0),mo.set(0,0,0),go.set(0,0,0);for(let e=0,t=o.length;e<t;e++){const t=d[e],n=o[e];0!==t&&(uo.fromBufferAttribute(n,c),ho.fromBufferAttribute(n,u),po.fromBufferAttribute(n,h),s?(fo.addScaledVector(uo,t),mo.addScaledVector(ho,t),go.addScaledVector(po,t)):(fo.addScaledVector(uo.sub(ao),t),mo.addScaledVector(ho.sub(lo),t),go.addScaledVector(po.sub(co),t)))}ao.add(fo),lo.add(mo),co.add(go)}e.isSkinnedMesh&&(e.boneTransform(c,ao),e.boneTransform(u,lo),e.boneTransform(h,co));const p=function(e,t,n,i,r,o,s,a){let l;if(l=t.side===m?i.intersectTriangle(s,o,r,!0,a):i.intersectTriangle(r,o,s,t.side!==g,a),null===l)return null;bo.copy(a),bo.applyMatrix4(e.matrixWorld);const c=n.ray.origin.distanceTo(bo);return c<n.near||c>n.far?null:{distance:c,point:bo.clone(),object:e}}(e,t,n,i,ao,lo,co,_o);if(p){a&&(vo.fromBufferAttribute(a,c),yo.fromBufferAttribute(a,u),xo.fromBufferAttribute(a,h),p.uv=Tr.getUV(_o,ao,lo,co,vo,yo,xo,new Zn)),l&&(vo.fromBufferAttribute(l,c),yo.fromBufferAttribute(l,u),xo.fromBufferAttribute(l,h),p.uv2=Tr.getUV(_o,ao,lo,co,vo,yo,xo,new Zn));const e={a:c,b:u,c:h,normal:new pi,materialIndex:0};Tr.getNormal(ao,lo,co,e.normal),p.face=e}return p}wo.prototype.isMesh=!0;class So extends io{constructor(e=1,t=1,n=1,i=1,r=1,o=1){super(),this.type=\"BoxGeometry\",this.parameters={width:e,height:t,depth:n,widthSegments:i,heightSegments:r,depthSegments:o};const s=this;i=Math.floor(i),r=Math.floor(r),o=Math.floor(o);const a=[],l=[],c=[],u=[];let h=0,d=0;function p(e,t,n,i,r,o,p,f,m,g,v){const y=o/m,x=p/g,_=o/2,b=p/2,w=f/2,M=m+1,S=g+1;let E=0,T=0;const A=new pi;for(let o=0;o<S;o++){const s=o*x-b;for(let a=0;a<M;a++){const h=a*y-_;A[e]=h*i,A[t]=s*r,A[n]=w,l.push(A.x,A.y,A.z),A[e]=0,A[t]=0,A[n]=f>0?1:-1,c.push(A.x,A.y,A.z),u.push(a/m),u.push(1-o/g),E+=1}}for(let e=0;e<g;e++)for(let t=0;t<m;t++){const n=h+t+M*e,i=h+t+M*(e+1),r=h+(t+1)+M*(e+1),o=h+(t+1)+M*e;a.push(n,i,o),a.push(i,r,o),T+=6}s.addGroup(d,T,v),d+=T,h+=E}p(\"z\",\"y\",\"x\",-1,-1,n,t,e,o,r,0),p(\"z\",\"y\",\"x\",1,-1,n,t,-e,o,r,1),p(\"x\",\"z\",\"y\",1,1,e,n,t,i,o,2),p(\"x\",\"z\",\"y\",1,-1,e,n,-t,i,o,3),p(\"x\",\"y\",\"z\",1,-1,e,t,n,i,r,4),p(\"x\",\"y\",\"z\",-1,-1,e,t,-n,i,r,5),this.setIndex(a),this.setAttribute(\"position\",new Yr(l,3)),this.setAttribute(\"normal\",new Yr(c,3)),this.setAttribute(\"uv\",new Yr(u,2))}static fromJSON(e){return new So(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function Eo(e){const t={};for(const n in e){t[n]={};for(const i in e[n]){const r=e[n][i];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?t[n][i]=r.clone():Array.isArray(r)?t[n][i]=r.slice():t[n][i]=r}}return t}function To(e){const t={};for(let n=0;n<e.length;n++){const i=Eo(e[n]);for(const e in i)t[e]=i[e]}return t}const Ao={clone:Eo,merge:To};class Lo extends Lr{constructor(e){super(),this.type=\"ShaderMaterial\",this.defines={},this.uniforms={},this.vertexShader=\"void main() {\\n\\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\\n}\",this.fragmentShader=\"void main() {\\n\\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\\n}\",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,void 0!==e&&(void 0!==e.attributes&&console.error(\"THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead.\"),this.setValues(e))}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=Eo(e.uniforms),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const n in this.uniforms){const i=this.uniforms[n].value;i&&i.isTexture?t.uniforms[n]={type:\"t\",value:i.toJSON(e).uuid}:i&&i.isColor?t.uniforms[n]={type:\"c\",value:i.getHex()}:i&&i.isVector2?t.uniforms[n]={type:\"v2\",value:i.toArray()}:i&&i.isVector3?t.uniforms[n]={type:\"v3\",value:i.toArray()}:i&&i.isVector4?t.uniforms[n]={type:\"v4\",value:i.toArray()}:i&&i.isMatrix3?t.uniforms[n]={type:\"m3\",value:i.toArray()}:i&&i.isMatrix4?t.uniforms[n]={type:\"m4\",value:i.toArray()}:t.uniforms[n]={value:i}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;const n={};for(const e in this.extensions)!0===this.extensions[e]&&(n[e]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}}Lo.prototype.isShaderMaterial=!0;class Co extends mr{constructor(){super(),this.type=\"Camera\",this.matrixWorldInverse=new ji,this.projectionMatrix=new ji,this.projectionMatrixInverse=new ji}
vendor: 4,420 bytes, line 947
947copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}}Co.prototype.isCamera=!0;class Po extends Co{constructor(e=50,t=1,n=.1,i=2e3){super(),this.type=\"PerspectiveCamera\",this.fov=e,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=2*Bn*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(.5*zn*this.fov);return.5*this.getFilmHeight()/e}getEffectiveFOV(){return 2*Bn*Math.atan(Math.tan(.5*zn*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,n,i,r,o){this.aspect=e/t,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(.5*zn*this.fov)/this.zoom,n=2*t,i=this.aspect*n,r=-.5*i;const o=this.view;if(null!==this.view&&this.view.enabled){const e=o.fullWidth,s=o.fullHeight;r+=o.offsetX*i/e,t-=o.offsetY*n/s,i*=o.width/e,n*=o.height/s}const s=this.filmOffset;0!==s&&(r+=e*s/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+i,t,t-n,e,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}Po.prototype.isPerspectiveCamera=!0;const Ro=90;class Do extends mr{constructor(e,t,n){if(super(),this.type=\"CubeCamera\",!0!==n.isWebGLCubeRenderTarget)return void console.error(\"THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.\");this.renderTarget=n;const i=new Po(Ro,1,e,t);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new pi(1,0,0)),this.add(i);const r=new Po(Ro,1,e,t);r.layers=this.layers,r.up.set(0,-1,0),r.lookAt(new pi(-1,0,0)),this.add(r);const o=new Po(Ro,1,e,t);o.layers=this.layers,o.up.set(0,0,1),o.lookAt(new pi(0,1,0)),this.add(o);const s=new Po(Ro,1,e,t);s.layers=this.layers,s.up.set(0,0,-1),s.lookAt(new pi(0,-1,0)),this.add(s);const a=new Po(Ro,1,e,t);a.layers=this.layers,a.up.set(0,-1,0),a.lookAt(new pi(0,0,1)),this.add(a);const l=new Po(Ro,1,e,t);l.layers=this.layers,l.up.set(0,-1,0),l.lookAt(new pi(0,0,-1)),this.add(l)}update(e,t){null===this.parent&&this.updateMatrixWorld();const n=this.renderTarget,[i,r,o,s,a,l]=this.children,c=e.xr.enabled,u=e.getRenderTarget();e.xr.enabled=!1;const h=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0),e.render(t,i),e.setRenderTarget(n,1),e.render(t,r),e.setRenderTarget(n,2),e.render(t,o),e.setRenderTarget(n,3),e.render(t,s),e.setRenderTarget(n,4),e.render(t,a),n.texture.generateMipmaps=h,e.setRenderTarget(n,5),e.render(t,l),e.setRenderTarget(u),e.xr.enabled=c}}class Oo extends si{constructor(e,t,n,i,r,o,s,a,l,c){super(e=void 0!==e?e:[],t=void 0!==t?t:oe,n,i,r,o,s,a,l,c),this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}Oo.prototype.isCubeTexture=!0;class Io extends ci{constructor(e,t,n){Number.isInteger(t)&&(console.warn(\"THREE.WebGLCubeRen
947derTarget: constructor signature is now WebGLCubeRenderTarget( size, options )\"),t=n),super(e,e,t),t=t||{},this.texture=new Oo(void 0,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.encoding),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==t.generateMipmaps&&t.generateMipmaps,this.texture.minFilter=void 0!==t.minFilter?t.minFilter:xe,this.texture._needsFlipEnvMap=!1}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.format=ze,this.texture.encoding=t.encoding,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const n={tEquirect:{value:null}},i=\"\\n\\n\\t\\t\\t\\tvarying vec3 vWorldDirection;\\n\\n\\t\\t\\t\\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\\n\\n\\t\\t\\t\\t\\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\\n\\n\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\tvoid main() {\\n\\n\\t\\t\\t\\t\\tvWorldDirection = transformDirection( position, modelMatrix );\\n\\n\\t\\t\\t\\t\\t#include <begin_vertex>\\n\\t\\t\\t\\t\\t#include <project_vertex>\\n\\n\\t\\t\\t\\t}\\n\\t\\t\\t\",r=\"\\n\\n\\t\\t\\t\\tuniform sampler2D tEquirect;\\n\\n\\t\\t\\t\\tvarying vec3 vWorldDirection;\\n\\n\\t\\t\\t\\t#include <common>\\n\\n\\t\\t\\t\\tvoid main() {\\n\\n\\t\\t\\t\\t\\tvec3 direction = normalize( vWorldDirection );\\n\\n\\t\\t\\t\\t\\tvec2 sampleUV = equirectUv( direction );\\n\\n\\t\\t\\t\\t\\tgl_FragColor = texture2D( tEquirect, sampleUV );\\n\\n\\t\\t\\t\\t}\\n\\t\\t\\t\",o=new So(5,5,5),s=new Lo({name:\"CubemapFromEquirect\",uniforms:Eo(n),vertexShader:i,fragmentShader:r,side:m,blending:x});s.uniforms.tEquirect.value=t;const a=new wo(o,s),l=t.minFilter;return t.minFilter===we&&(t.minFilter=xe),new Do(1,10,this).update(e,a),t.minFilter=l,a.geometry.dispose(),a.material.dispose(),this}clear(e,t,n,i){const r=e.getRenderTarget();for(let r=0;r<6;r++)e.setRenderTarget(this,r),e.clear(t,n,i);e.setRenderTarget(r)}}Io.prototype.isWebGLCubeRenderTarget=!0;const Fo=new pi,No=new pi,Uo=new $n;class zo{constructor(e=new pi(1,0,0),t=0){this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,i){return this.normal.set(e,t,n),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){const i=Fo.subVectors(n,t).cross(No.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)}intersectLine(e,t){const n=e.delta(Fo),i=this.normal.dot(n);if(0===i)return 0===this.distanceToPoint(e.start)?t.copy(e.start):null;const r=-(e.start.dot(this.normal)+this.constant)/i;return r<0||r>1?null:t.copy(n).multiplyScalar(r).add(e.start)}intersectsLine(e){const t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const n=t||Uo.getNormalMatrix(e),i=this.coplanarPoint(Fo).applyMatrix4(e),r=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(r),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return(new this.constructor).copy(this)}}zo.prototype.isPlane=!0;const Bo=new Fi,Go=new pi;class ko{constructor(e=new zo,t=new zo,n=new zo,i=new zo,r=new zo,o=new zo){this.planes=[e,t,n,i,r,o]}set(e,t,n,i,r,o){const s=this.planes;return s[0].copy(e),s[1].copy(t),s[2].copy(n),s[3].copy(i),s[4].copy(r),s[5].copy(o),this}copy(e){const t=this.planes;for(let n=0;n<6;
vendor: 4,561 bytes, line 947
947n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e){const t=this.planes,n=e.elements,i=n[0],r=n[1],o=n[2],s=n[3],a=n[4],l=n[5],c=n[6],u=n[7],h=n[8],d=n[9],p=n[10],f=n[11],m=n[12],g=n[13],v=n[14],y=n[15];return t[0].setComponents(s-i,u-a,f-h,y-m).normalize(),t[1].setComponents(s+i,u+a,f+h,y+m).normalize(),t[2].setComponents(s+r,u+l,f+d,y+g).normalize(),t[3].setComponents(s-r,u-l,f-d,y-g).normalize(),t[4].setComponents(s-o,u-c,f-p,y-v).normalize(),t[5].setComponents(s+o,u+c,f+p,y+v).normalize(),this}intersectsObject(e){const t=e.geometry;return null===t.boundingSphere&&t.computeBoundingSphere(),Bo.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(Bo)}intersectsSprite(e){return Bo.center.set(0,0,0),Bo.radius=.7071067811865476,Bo.applyMatrix4(e.matrixWorld),this.intersectsSphere(Bo)}intersectsSphere(e){const t=this.planes,n=e.center,i=-e.radius;for(let e=0;e<6;e++)if(t[e].distanceToPoint(n)<i)return!1;return!0}intersectsBox(e){const t=this.planes;for(let n=0;n<6;n++){const i=t[n];if(Go.x=i.normal.x>0?e.max.x:e.min.x,Go.y=i.normal.y>0?e.max.y:e.min.y,Go.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(Go)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}function Vo(){let e=null,t=!1,n=null,i=null;function r(t,o){n(t,o),i=e.requestAnimationFrame(r)}return{start:function(){!0!==t&&null!==n&&(i=e.requestAnimationFrame(r),t=!0)},stop:function(){e.cancelAnimationFrame(i),t=!1},setAnimationLoop:function(e){n=e},setContext:function(t){e=t}}}function Ho(e,t){const n=t.isWebGL2,i=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),i.get(e)},remove:function(t){t.isInterleavedBufferAttribute&&(t=t.data);const n=i.get(t);n&&(e.deleteBuffer(n.buffer),i.delete(t))},update:function(t,r){if(t.isGLBufferAttribute){const e=i.get(t);return void((!e||e.version<t.version)&&i.set(t,{buffer:t.buffer,type:t.type,bytesPerElement:t.elementSize,version:t.version}))}t.isInterleavedBufferAttribute&&(t=t.data);const o=i.get(t);void 0===o?i.set(t,function(t,i){const r=t.array,o=t.usage,s=e.createBuffer();e.bindBuffer(i,s),e.bufferData(i,r,o),t.onUploadCallback();let a=5126;return r instanceof Float32Array?a=5126:r instanceof Float64Array?console.warn(\"THREE.WebGLAttributes: Unsupported data buffer format: Float64Array.\"):r instanceof Uint16Array?t.isFloat16BufferAttribute?n?a=5131:console.warn(\"THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.\"):a=5123:r instanceof Int16Array?a=5122:r instanceof Uint32Array?a=5125:r instanceof Int32Array?a=5124:r instanceof Int8Array?a=5120:(r instanceof Uint8Array||r instanceof Uint8ClampedArray)&&(a=5121),{buffer:s,type:a,bytesPerElement:r.BYTES_PER_ELEMENT,version:t.version}}(t,r)):o.version<t.version&&(function(t,i,r){const o=i.array,s=i.updateRange;e.bindBuffer(r,t),-1===s.count?e.bufferSubData(r,0,o):(n?e.bufferSubData(r,s.offset*o.BYTES_PER_ELEMENT,o,s.offset,s.count):e.bufferSubData(r,s.offset*o.BYTES_PER_ELEMENT,o.subarray(s.offset,s.offset+s.count)),s.count=-1)}(o.buffer,t,r),o.version=t.version)}}}class jo extends io{constructor(e=1,t=1,n=1,i=1){super(),this.type=\"PlaneGeometry\",this.parameters={width:e,height:t,widthSegments:n,heightSegments:i};const r=e/2,o=t/2,s=Math.floor(n),a=Math.floor(i),l=s+1,c=a+1,u=e/s,h=t/a,d=[],p=[],f=[],m=[];for(let e=0;e<c;e++){const t=e*h-o;for(let n=0;n<l;n++){const i=n*u-r;p.push(i,-t,0),f.push(0,0,1),m.push(n/s),m.push(1-e/a)}}for(let e=0;e<a;e++)for(let t=0;t<s;t++){const n=t+l*e,i=t+l*(e+1),r=t+1+l*(e+1),o=t+1+l*e;d.push(n,i,o),d.push(i,r,o)}this.setIndex(d),this.setAttribute(\"position\",new Yr(p,3)),this.setAttribute(\"normal\",new Yr(f,3)),this.setAttribute(\"uv\",new Yr(m,2))}static fromJSON(e){return new jo(e.width,e.height,e.widthSegments,e.heightSegments)}}const Wo={alphamap_fragment:\"#ifdef USE_ALPHAMAP\\n\\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\\n#endif\",alphamap_pars_fragment:\"#ifdef USE_ALPHAMAP\\n\\tuniform sampler2D alphaMap;\\n#endif\",alphatest_fragment:\"#ifdef USE_ALPHATEST\\n\\tif ( diffuseColor.a < alphaTest ) discard;\\n#endif\",alphatest_pars_fragment:\"#ifdef USE_ALPHATEST\\n\\tuniform float alphaTest;\\n#endif\",aomap_fragment:\"#ifdef USE_AOMAP\\n\\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\\n\\treflectedLight.indirectDiffuse *= ambientOcclusion;\\n\\t#if defined( USE_ENVMAP ) && defined( STANDARD )\\n\\t\\tfloat dotNV = saturate( dot
947( geometry.normal, geometry.viewDir ) );\\n\\t\\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\\n\\t#endif\\n#endif\",aomap_pars_fragment:\"#ifdef USE_AOMAP\\n\\tuniform sampler2D aoMap;\\n\\tuniform float aoMapIntensity;\\n#endif\",begin_vertex:\"vec3 transformed = vec3( position );\",beginnormal_vertex:\"vec3 objectNormal = vec3( normal );\\n#ifdef USE_TANGENT\\n\\tvec3 objectTangent = vec3( tangent.xyz );\\n#endif\",bsdfs:\"vec3 BRDF_Lambert( const in vec3 diffuseColor ) {\\n\\treturn RECIPROCAL_PI * diffuseColor;\\n}\\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\\n\\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\\n\\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\\n}\\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\\n\\tfloat a2 = pow2( alpha );\\n\\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\\n\\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\\n\\treturn 0.5 / max( gv + gl, EPSILON );\\n}\\nfloat D_GGX( const in float alpha, const in float dotNH ) {\\n\\tfloat a2 = pow2( alpha );\\n\\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\\n\\treturn RECIPROCAL_PI * a2 / pow2( denom );\\n}\\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float roughness ) {\\n\\tfloat alpha = pow2( roughness );\\n\\tvec3 halfDir = normalize( lightDir + viewDir );\\n\\tfloat dotNL = saturate( dot( normal, lightDir ) );\\n\\tfloat dotNV = saturate( dot( normal, viewDir ) );\\n\\tfloat dotNH = saturate( dot( normal, halfDir ) );\\n\\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\\n\\tvec3 F = F_Schlick( f0, f90, dotVH );\\n\\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\\n\\tfloat D = D_GGX( alpha, dotNH );\\n\\treturn F * ( V * D );\\n}\\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\\n\\tconst float LUT_SIZE = 64.0;\\n\\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\\n\\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\\n\\tfloat dotNV = saturate( dot( N, V ) );\\n\\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\\n\\tuv = uv * LUT_SCALE + LUT_BIAS;\\n\\treturn uv;\\n}\\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\\n\\tfloat l = length( f );\\n\\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\\n}\\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\\n\\tfloat x = dot( v1, v2 );\\n\\tfloat y = abs( x );\\n\\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\\n\\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\\n\\tfloat v = a / b;\\n\\tfloat theta_sintheta = ( x >
947 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\\n\\treturn cross( v1, v2 ) * theta_sintheta;\\n}\\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\\n\\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\\n\\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\\n\\tvec3 lightNormal = cross( v1, v2 );\\n\\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\\n\\tvec3 T1, T2;\\n\\tT1 = normalize( V - N * dot( V, N ) );\\n\\tT2 = - cross( N, T1 );\\n\\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\\n\\tvec3 coords[ 4 ];\\n\\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\\n\\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\\n\\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\\n\\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\\n\\tcoords[ 0 ] = normalize( coords[ 0 ] );\\n\\tcoords[ 1 ] = normalize( coords[ 1 ] );\\n\\tcoords[ 2 ] = normalize( coords[ 2 ] );\\n\\tcoords[ 3 ] = normalize( coords[ 3 ] );\\n\\tvec3 vectorFormFactor = vec3( 0.0 );\\n\\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\\n\\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\\n\\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\\n\\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\\n\\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\\n\\treturn vec3( result );\\n}\\nfloat G_BlinnPhong_Implicit( ) {\\n\\treturn 0.25;\\n}\\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\\n\\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\\n}\\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\\n\\tvec3 halfDir = normalize( lightDir + viewDir );\\n\\tfloat dotNH = saturate( dot( normal, halfDir ) );\\n\\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\\n\\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\\n\\tfloat G = G_BlinnPhong_Implicit( );\\n\\tfloat D = D_BlinnPhong( shininess, dotNH );\\n\\treturn F * ( G * D );\\n}\\n#if defined( USE_SHEEN )\\nfloat D_Charlie( float roughness, float dotNH ) {\\n\\tfloat alpha = pow2( roughness );\\n\\tfloat invAlpha = 1.0 / alpha;\\n\\tfloat cos2h = dotNH * dotNH;\\n\\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\\n\\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\\n}\\nfloat V_Neubelt( float dotNV, float dotNL ) {\\n\\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\\n}\\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\\n\\tvec3 halfDir = normalize( lightDir + viewDir );\\n\\tfloat dotNL = saturate( dot( normal, lightDir ) );\\n\\tfloat dotNV = saturate( dot( normal, viewDir ) );\\n\\tfloat dotNH = saturate( dot( normal, halfDir ) );\\n\\tfloat D = D_Charlie( sheenRoughness, dotNH );\\n\\tfloat V = V_Neubelt( dotNV, dotNL );\\n\\treturn sheenColor * ( D * V );\\n}\\n#endif\",bumpmap_pars_fragment:\"#ifdef USE_BUMPMAP\\n\\tuniform sampler2D bumpMap;\\n\\tuniform float bumpScale;\\n\\tvec2 dHdxy_fwd() {\\n\\t\\tvec2 dSTdx = dFdx( vUv );\\n\\t\\tvec2 dSTdy = dFdy( vUv );\\n\\t\\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\\n\\t\\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\\n\\t\\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\\n\\t\\treturn vec2( dBx, dBy );\\n\\t}\\n\\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\\n\\t\\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\\n\\t\\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\\n\\t\\tvec3 vN = surf_norm;\\n\\t\\tvec3 R1 = cross( vSigmaY, vN );\\n\\t\\tvec3 R2 = cross( vN, vSigmaX );\\n\\t\\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\\n\\t\\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\\n\\t\\treturn normalize( abs( fDet ) * surf_norm - vGrad );\\n\\t}\\n#endif\",clipping_planes_fragment:\"#if NUM_CLIPPING_PLANES > 0\\n\\tvec4 plane;\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\\n\\t\\tplane = clippingPlanes[ i ];\\n\\t\\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\\n\\t}\\n\\t#pragma unroll_loop_end\\n\\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\\n\\t\\tbool clipped = true;\\n\\t\\t#pragma unroll_loop_start\\n\\t\\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\\n\\t\\t\\tplane = clippingPlanes[ i ];\\n\\t\\t\\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\\n\\t\\t}\\n\\t\\t#pragma unroll_loop_end\\n\\t\\tif ( clipped ) discard;\\n\\t#endif\\n#endif\",clipping_planes_pars_fragment:\"#if NUM_CLIPPING_PLANES > 0\\n\\tvarying vec3 vClipPosition;\\n\\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\\n#endif\",clipping_planes_pars_vertex:\"#if NUM_CLIPPING_PLANES > 0\\n\\tvarying vec3 vClipPosition;\\n#endif\",clipping_planes_vertex:\"#if NUM_CLIPPING_PLANES > 0\\n\\tvClipPosition = - mvPosition.xyz;\\n#endif\",color_fragment:\"#if defined( USE_COLOR_ALPHA )\\n\\tdiffuseColor *= vColor;\\n#elif defined( USE_COLOR )\\n\\tdiffuseColor.rgb *= vColor;\\n#endif\",color_pars_fragment:\"#if defined( USE_COLOR_ALPHA )\\n\\tvarying vec4 vColor;\\n#elif defined( USE_COLOR )\\n\\tvarying vec3 vColor;\\n#endif\",color_pars_vertex:\"#if defined( USE_COLOR_ALPHA )\\n\\tvarying vec4 vColor;\\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\\n\\tvarying vec3 vColor;\\n#endif\",color_vertex:\"#if defined( USE_COLOR_ALPHA )\\n\\tvC
947olor = vec4( 1.0 );\\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\\n\\tvColor = vec3( 1.0 );\\n#endif\\n#ifdef USE_COLOR\\n\\tvColor *= color;\\n#endif\\n#ifdef USE_INSTANCING_COLOR\\n\\tvColor.xyz *= instanceColor.xyz;\\n#endif\",common:\"#define PI 3.141592653589793\\n#define PI2 6.283185307179586\\n#define PI_HALF 1.5707963267948966\\n#define RECIPROCAL_PI 0.3183098861837907\\n#define RECIPROCAL_PI2 0.15915494309189535\\n#define EPSILON 1e-6\\n#ifndef saturate\\n#define saturate( a ) clamp( a, 0.0, 1.0 )\\n#endif\\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\\nfloat pow2( const in float x ) { return x*x; }\\nfloat pow3( const in float x ) { return x*x*x; }\\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\\nhighp float rand( const in vec2 uv ) {\\n\\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\\n\\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\\n\\treturn fract( sin( sn ) * c );\\n}\\n#ifdef HIGH_PRECISION\\n\\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\\n#else\\n\\tfloat precisionSafeLength( vec3 v ) {\\n\\t\\tfloat maxComponent = max3( abs( v ) );\\n\\t\\treturn length( v / maxComponent ) * maxComponent;\\n\\t}\\n#endif\\nstruct IncidentLight {\\n\\tvec3 color;\\n\\tvec3 direction;\\n\\tbool visible;\\n};\\nstruct ReflectedLight {\\n\\tvec3 directDiffuse;\\n\\tvec3 directSpecular;\\n\\tvec3 indirectDiffuse;\\n\\tvec3 indirectSpecular;\\n};\\nstruct GeometricContext {\\n\\tvec3 position;\\n\\tvec3 normal;\\n\\tvec3 viewDir;\\n#ifdef USE_CLEARCOAT\\n\\tvec3 clearcoatNormal;\\n#endif\\n};\\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\\n\\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\\n}\\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\\n\\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\\n}\\nmat3 transposeMat3( const in mat3 m ) {\\n\\tmat3 tmp;\\n\\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\\n\\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\\n\\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\\n\\treturn tmp;\\n}\\nfloat linearToRelativeLuminance( const in vec3 color ) {\\n\\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\\n\\treturn dot( weights, color.rgb );\\n}\\nbool isPerspectiveMatrix( mat4 m ) {\\n\\treturn m[ 2 ][ 3 ] == - 1.0;\\n}\\nvec2 equirectUv( in vec3 dir ) {\\n\\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\\n\\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\\n\\treturn vec2( u, v );\\n}\",cube_uv_reflection_fragment:\"#ifdef ENVMAP_TYPE_CUBE_UV\\n\\t#define cubeUV_maxMipLevel 8.0\\n\\t#define cubeUV_minMipLevel 4.0\\n\\t#define cubeUV_maxTileSize 256.0\\n\\t#define cubeUV_minTileSize 16.0\\n\\tfloat getFace( vec3 direction ) {\\n\\t\\tvec3 absDirection = abs( direction );\\n\\t\\tfloat face = - 1.0;\\n\\t\\tif ( absDirection.x > absDirection.z ) {\\n\\t\\t\\tif ( absDirection.x > absDirection.y )\\n\\t\\t\\t\\tface = direction.x > 0.0 ? 0.0 : 3.0;\\n\\t\\t\\telse\\n\\t\\t\\t\\tface = direction.y > 0.0 ? 1.0 : 4.0;\\n\\t\\t} else {\\n\\t\\t\\tif ( absDirection.z > absDirection.y )\\n\\t\\t\\t\\tface = direction.z > 0.0 ? 2.0 : 5.0;\\n\\t\\t\\telse\\n\\t\\t\\t\\tface = direction.y > 0.0 ? 1.0 : 4.0;\\n\\t\\t}\\n\\t\\treturn face;\\n\\t}\\n\\tvec2 getUV( vec3 direction, float face ) {\\n\\t\\tvec2 uv;\\n\\t\\tif ( face == 0.0 ) {\\n\\t\\t\\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\\n\\t\\t} else if ( face == 1.0 ) {\\n\\t\\t\\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\\n\\t\\t} else if ( face == 2.0 ) {\\n\\t\\t\\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\\n\\t\\t} else if ( face == 3.0 ) {\\n\\t\\t\\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\\n\\t\\t} else if ( face == 4.0 ) {\\n\\t\\t\\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\\n\\t\\t} else {\\n\\t\\t\\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\\n\\t\\t}\\n\\t\\treturn 0.5 * ( uv + 1.0 );\\n\\t}\\n\\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\\n\\t\\tfloat face = getFace( direction );\\n\\t\\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\\n\\t\\tmipInt = max( mipInt, cubeUV_minMipLevel );\\n\\t\\tfloat faceSize = exp2( mipInt );\\n\\t\\tfloat texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize );\\n\\t\\tvec2 uv = getUV( direction, face ) * ( faceSize - 1.0 );\\n\\t\\tvec2 f = fract( uv );\\n\\t\\tuv += 0.5 - f;\\n\\t\\tif ( face > 2.0 ) {\\n\\t\\t\\tuv.y += faceSize;\\n\\t\\t\\tface -= 3.0;\\n\\t\\t}\\n\\t\\tuv.x += face * faceSize;\\n\\t\\tif ( mipInt < cubeUV_maxMipLevel ) {\\n\\t\\t\\tuv.y += 2.0 * cubeUV_maxTileSize;\\n\\t\\t}\\n\\t\\tuv.y += filterInt * 2.0 * cubeUV_minTileSize;\\n\\t\\tuv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize );\\n\\t\\tuv *= texelSize;\\n\\t\\tvec3 tl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\\n\\t\\tuv.x += texelSize;\\n\\t\\tvec3 tr = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\\n\\t\\tuv.y += texelSize;\\n\\t\\tvec3 br = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\\n\\t\\tuv.x -= texelSize;\\n\\t\\tvec3 bl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\\n\\t\\tvec3 tm = mix( tl, tr, f.x );\\n\\t\\tvec3 bm = mix( bl, br, f.x );\\n\\t\\treturn mix( tm, bm, f.y );\\n\\t}\\n\\t#define r0 1.0\\n\\t#define v0 0.339\\n\\t#define m0 - 2.0\\n\\t#define r1 0.8\\n\\t#define v1 0.276\\n\\t#define m1 - 1.0\\n\\t#define r4 0.4\\n\\t#define v4 0.046\\n\\t#define m4 2.0\\n\\t#define r5 0.305\\n\\t#define v5 0.016\\n\\t#define m5 3.0\\n\\t#define r6 0.21\\n\\t#define v6 0.0038\\n\\t#define m6 4.0\\n\\tfloat roughnessToMip( float roughness ) {\\n\\t\\tfloat mip = 0.0;\\n\\t\\tif ( roughness >= r1 ) {\\n\\t\\t\\tmip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0;\\n\\t\\t} else if ( roughness >= r4 ) {\\n\\t\\t\\tmip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1;\\n\\t\\t} else if ( roughness >= r5 ) {\\n\\t\\t\\tmip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4;\\n\\t\\t} else if ( roughness >= r6 ) {\\n\\t\\t\\tmip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5;\\n\\t\\t} else {\\n\\t\\t\\tmip = - 2.0 * log2( 1.16 * roughness );\\t\\t}\\n\\t\\treturn mip;\\n\\t}\\n\\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\\n\\t\\tfloat mip = clamp( roughnessToMip( roughness ), m0, cubeUV_maxMipLevel );\\n\\t\\tfloat mipF = fract( mip );\\n\\t\\tfloat mipInt = floor( mip );\\n\\t\\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\\n\\t\\tif ( mipF == 0.0 ) {\\n\\t\\t\\treturn vec4( color0, 1.0 );\\n\\t\\t} else {\\n\\t\\t\\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\\n\\t\\t\\treturn vec4( mix( color0, color1, mipF ), 1.0 );\\n\\t\\t}\\n\\t}\\n#endif\",defaultnormal_vertex:\"vec3 transformedNormal = objectNormal;\\n#ifdef USE_INSTANCING\\n\\tmat3 m = mat3( instanceMatrix );\\n\\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\\n\\ttransformedNormal = m * transformedNormal;\\n#endif\\ntransformedNormal = normalMatrix * transformedNormal;\\n#ifdef FLIP_SIDED\\n\\ttransformedNormal = - transformedNormal;\\n#endif\\n#ifdef USE_TANGENT\\n\\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\\n\\t#ifdef FLIP_SIDED\\n\\t\\ttransformedTangent = - transformedTangent;\\n\\t#endif\\n#endif\",displacementmap_pars_vertex:\"#ifdef USE_DISPLACEMENTMAP\\n\\tuniform sampler2D displacementMap;\\n\\tuniform float displacementScale;\\n\\tuniform float displacementBias;\\n#endif\",displacementmap_vertex:\"#ifdef USE_DISPLACEMENTMAP\\n\\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + dis
947placementBias );\\n#endif\",emissivemap_fragment:\"#ifdef USE_EMISSIVEMAP\\n\\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\\n\\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\\n\\ttotalEmissiveRadiance *= emissiveColor.rgb;\\n#endif\",emissivemap_pars_fragment:\"#ifdef USE_EMISSIVEMAP\\n\\tuniform sampler2D emissiveMap;\\n#endif\",encodings_fragment:\"gl_FragColor = linearToOutputTexel( gl_FragColor );\",encodings_pars_fragment:\"\\nvec4 LinearToLinear( in vec4 value ) {\\n\\treturn value;\\n}\\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\\n\\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\\n}\\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\\n\\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\\n}\\nvec4 sRGBToLinear( in vec4 value ) {\\n\\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\\n}\\nvec4 LinearTosRGB( in vec4 value ) {\\n\\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\\n}\\nvec4 RGBEToLinear( in vec4 value ) {\\n\\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\\n}\\nvec4 LinearToRGBE( in vec4 value ) {\\n\\tfloat maxComponent = max( max( value.r, value.g ), value.b );\\n\\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\\n\\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\\n}\\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\\n\\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\\n}\\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\\n\\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\\n\\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\\n\\tM = ceil( M * 255.0 ) / 255.0;\\n\\treturn vec4( value.rgb / ( M * maxRange ), M );\\n}\\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\\n\\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\\n}\\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\\n\\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\\n\\tfloat D = max( maxRange / maxRGB, 1.0 );\\n\\tD = clamp( floor( D ) / 255.0, 0.0, 1.0 );\\n\\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\\n}\\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\\nvec4 LinearToLogLuv( in vec4 value ) {\\n\\tvec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\\n\\tXp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\\n\\tvec4 vResult;\\n\\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\\n\\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\\n\\tvResult.w = fract( Le );\\n\\tvResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\\n\\treturn vResult;\\n}\\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\\nvec4 LogLuvToLinear( in vec4 value ) {\\n\\tfloat Le = value.z * 255.0 + value.w;\\n\\tvec3 Xp_Y_XYZp;\\n\\tXp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\\n\\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\\n\\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\\n\\tvec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\\n\\treturn vec4( max( vRGB, 0.0 ), 1.0 );\\n}\",envmap_fragment:\"#ifdef USE_ENVMAP\\n\\t#ifdef ENV_WORLDPOS\\n\\t\\tvec3 cameraToFrag;\\n\\t\\tif ( isOrthographic ) {\\n\\t\\t\\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\\n\\t\\t} else {\\n\\t\\t\\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\\n\\t\\t}\\n\\t\\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\\n\\t\\t#ifdef ENVMAP_MODE_REFLECTION\\n\\t\\t\\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\\n\\t\\t#else\\n\\t\\t\\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\\n\\t\\t#endif\\n\\t#else\\n\\t\\tvec3 reflectVec = vReflect;\\n\\t#endif\\n\\t#ifdef ENVMAP_TYPE_CUBE\\n\\t\\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\\n\\t\\tenvColor = envMapTexelToLinear( envColor );\\n\\t#elif defined( ENVMAP_TYPE_CUBE_UV )\\n\\t\\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\\n\\t#else\\n\\t\\tvec4 envColor = vec4( 0.0 );\\n\\t#endif\\n\\t#ifdef ENVMAP_BLENDING_MULTIPLY\\n\\t\\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\\n\\t#elif defined( ENVMAP_BLENDING_MIX )\\n\\t\\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\\n\\t#elif defined( ENVMAP_BLENDING_ADD )\\n\\t\\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\\n\\t#endif\\n#endif\",envmap_common_pars_fragment:\"#ifdef USE_ENVMAP\\n\\tuniform float envMapIntensity;\\n\\tuniform float flipEnvMap;\\n\\tuniform int maxMipLevel;\\n\\t#ifdef ENVMAP_TYPE_CUBE\\n\\t\\tuniform samplerCube envMap;\\n\\t#else\\n\\t\\tuniform sampler2D envMap;\\n\\t#endif\\n\\t\\n#endif\",envmap_pars_fragment:\"#ifdef USE_ENVMAP\\n\\tuniform float reflectivity;\\n\\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\\n\\t\\t#define ENV_WORLDPOS\\n\\t#endif\\n\\t#ifdef ENV_WORLDPOS\\n\\t\\tvarying vec3 vWorldPosition;\\n\\t\\tuniform float refractionRatio;\\n\\t#else\\n\\t\\tvarying vec3 vReflect;\\n\\t#endif\\n#endif\",envmap_pars_vertex:\"#ifdef USE_ENVMAP\\n\\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\\n\\t\\t#define ENV_WORLDPOS\\n\\t#endif\\n\\t#ifdef ENV_WORLDPOS\\n\\t\\t\\n\\t\\tvarying vec3 vWorldPosition;\\n\\t#else\\n\\t\\tvarying vec3 vReflect;\\n\\t\\tuniform float refractionRatio;\\n\\t#endif\\n#endif\",envmap_physical_pars_fragment:\"#if defined( USE_ENVMAP )\\n\\t#ifdef ENVMAP_MODE_REFRACTION\\n\\t\\tuniform float refractionRatio;\\n\\t#endif\\n\\tvec3 getIBLIrradiance( const in vec3 normal ) {\\n\\t\\t#if defined( ENVMAP_TYPE_CUBE_UV )\\n\\t\\t\\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\\n\\t\\t\\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\\n\\t\\t\\treturn PI * envMapColor.rgb * envMapIntensity;\\n\\t\\t#else\\n\\t\\t\\treturn vec3( 0.0 );\\n\\t\\t#endif\\n\\t}\\n\\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\\n\\t\\t#if defined( ENVMAP_TYPE_CUBE_UV )\\n\\t\\t\\tvec3 reflectVec;\\n\\t\\t\\t#ifdef ENVMAP_MODE_REFLECTION\\n\\t\\t\\t\\treflectVec = reflect( - viewDir, normal );\\n\\t\\t\\t\\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\\n\\t\\t\\t#else\\n\\t\\t\\t\\treflectVec = refract( - viewDir, normal, refractionRatio );\\n\\t\\t\\t#endif\\n\\t\\t\\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\\n\\t\\t\\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\\n\\t\\t\\treturn envMapColor.rgb * envMapIntensity;\\n\\t\\t#else\\n\\t\\t\\treturn vec3( 0.0 );\\n\\t\\t#endif\\n\\t}\\n#endif\",envmap_vertex:\"#ifdef USE_ENVMAP\\n\\t#ifdef ENV_WORLDPOS\\n\\t\\tvWorldPosition = worldPosition.xyz;\\n\\t#else\\n\\t\\tvec3 cameraToVertex;\\n\\t\\tif ( isOrthographic ) {\\n\\t\\t\\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\\n\\t\\t}
947 else {\\n\\t\\t\\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\\n\\t\\t}\\n\\t\\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\\n\\t\\t#ifdef ENVMAP_MODE_REFLECTION\\n\\t\\t\\tvReflect = reflect( cameraToVertex, worldNormal );\\n\\t\\t#else\\n\\t\\t\\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\\n\\t\\t#endif\\n\\t#endif\\n#endif\",fog_vertex:\"#ifdef USE_FOG\\n\\tvFogDepth = - mvPosition.z;\\n#endif\",fog_pars_vertex:\"#ifdef USE_FOG\\n\\tvarying float vFogDepth;\\n#endif\",fog_fragment:\"#ifdef USE_FOG\\n\\t#ifdef FOG_EXP2\\n\\t\\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\\n\\t#else\\n\\t\\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\\n\\t#endif\\n\\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\\n#endif\",fog_pars_fragment:\"#ifdef USE_FOG\\n\\tuniform vec3 fogColor;\\n\\tvarying float vFogDepth;\\n\\t#ifdef FOG_EXP2\\n\\t\\tuniform float fogDensity;\\n\\t#else\\n\\t\\tuniform float fogNear;\\n\\t\\tuniform float fogFar;\\n\\t#endif\\n#endif\",gradientmap_pars_fragment:\"#ifdef USE_GRADIENTMAP\\n\\tuniform sampler2D gradientMap;\\n#endif\\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\\n\\tfloat dotNL = dot( normal, lightDirection );\\n\\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\\n\\t#ifdef USE_GRADIENTMAP\\n\\t\\treturn texture2D( gradientMap, coord ).rgb;\\n\\t#else\\n\\t\\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\\n\\t#endif\\n}\",lightmap_fragment:\"#ifdef USE_LIGHTMAP\\n\\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\\n\\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\\n\\t#ifndef PHYSICALLY_CORRECT_LIGHTS\\n\\t\\tlightMapIrradiance *= PI;\\n\\t#endif\\n\\treflectedLight.indirectDiffuse += lightMapIrradiance;\\n#endif\",lightmap_pars_fragment:\"#ifdef USE_LIGHTMAP\\n\\tuniform sampler2D lightMap;\\n\\tuniform float lightMapIntensity;\\n#endif\",lights_lambert_vertex:\"vec3 diffuse = vec3( 1.0 );\\nGeometricContext geometry;\\ngeometry.position = mvPosition.xyz;\\ngeometry.normal = normalize( transformedNormal );\\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\\nGeometricContext backGeometry;\\nbackGeometry.position = geometry.position;\\nbackGeometry.normal = -geometry.normal;\\nbackGeometry.viewDir = geometry.viewDir;\\nvLightFront = vec3( 0.0 );\\nvIndirectFront = vec3( 0.0 );\\n#ifdef DOUBLE_SIDED\\n\\tvLightBack = vec3( 0.0 );\\n\\tvIndirectBack = vec3( 0.0 );\\n#endif\\nIncidentLight directLight;\\nfloat dotNL;\\nvec3 directLightColor_Diffuse;\\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry.normal );\\n#ifdef DOUBLE_SIDED\\n\\tvIndirectBack += getAmbientLightIrradiance( ambientLightColor );\\n\\tvIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry.normal );\\n#endif\\n#if NUM_POINT_LIGHTS > 0\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\\n\\t\\tgetPointLightInfo( pointLights[ i ], geometry, directLight );\\n\\t\\tdotNL = dot( geometry.normal, directLight.direction );\\n\\t\\tdirectLightColor_Diffuse = directLight.color;\\n\\t\\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\\n\\t\\t#ifdef DOUBLE_SIDED\\n\\t\\t\\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\\n\\t\\t#endif\\n\\t}\\n\\t#pragma unroll_loop_end\\n#endif\\n#if NUM_SPOT_LIGHTS > 0\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\\n\\t\\tgetSpotLightInfo( spotLights[ i ], geometry, directLight );\\n\\t\\tdotNL = dot( geometry.normal, directLight.direction );\\n\\t\\tdirectLightColor_Diffuse = directLight.color;\\n\\t\\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\\n\\t\\t#ifdef DOUBLE_SIDED\\n\\t\\t\\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\\n\\t\\t#endif\\n\\t}\\n\\t#pragma unroll_loop_end\\n#endif\\n#if NUM_DIR_LIGHTS > 0\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\\n\\t\\tgetDirectionalLightInfo( directionalLights[ i ], geometry, directLight );\\n\\t\\tdotNL = dot( geometry.normal, directLight.direction );\\n\\t\\tdirectLightColor_Diffuse = directLight.color;\\n\\t\\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\\n\\t\\t#ifdef DOUBLE_SIDED\\n\\t\\t\\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\\n\\t\\t#endif\\n\\t}\\n\\t#pragma unroll_loop_end\\n#endif\\n#if NUM_HEMI_LIGHTS > 0\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\\n\\t\\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\\n\\t\\t#ifdef DOUBLE_SIDED\\n\\t\\t\\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry.normal );\\n\\t\\t#endif\\n\\t}\\n\\t#pragma unroll_loop_end\\n#endif\",lights_pars_begin:\"uniform bool receiveShadow;\\nuniform vec3 ambientLightColor;\\nuniform vec3 lightProbe[ 9 ];\\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\\n\\tfloat x = normal.x, y = normal.y, z = normal.z;\\n\\tvec3 result = shCoefficients[ 0 ] * 0.886227;\\n\\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\\n\\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\\n\\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\\n\\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\\n\\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\\n\\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\\n\\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\\n\\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\\n\\treturn result;\\n}\\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\\n\\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\\n\\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\\n\\treturn irradiance;\\n}\\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\\n\\tvec3 irradiance = ambientLightColor;\\n\\treturn irradiance;\\n}\\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\\n\\t#if defined ( PHYSICALLY_CORRECT_LIGHTS )\\n\\t\\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\\n\\t\\tif ( cutoffDistance > 0.0 ) {\\n\\t\\t\\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\\n\\t\\t}\\n\\t\\treturn distanceFalloff;\\n\\t#else\\n\\t\\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\\n\\t\\t\\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\\n\\t\\t}\\n\\t\\treturn 1.0;\\n\\t#endif\\n}\\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\\n\\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\\n}\\n#if NUM_DIR_LIGHTS > 0\\n\\tstruct DirectionalLight {\\n\\t\\tvec3 direction;\\n\\t\\tvec3 color;\\n\\t};\\n\\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\\n\\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight light ) {\\n\\t\\tlight.color = directionalLight.color;\\n\\t\\tlight.direction = directionalLight.direction;\\n\\t\\tlight.visible = true;\\n\\t}\\n#endif\\n#if NUM_POINT_LIGHTS > 0\\n\\tstruct PointLight {\\n\\t\\tvec3 position;\\n\\t\\tvec3 color;\\n\\t\\tfloat distance;\\n\\t\\tfloat decay;\\n\\t};\\n\\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\\n\\tvoid getPointLightInfo( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight light ) {\\n\\t\\tvec3 lVector = pointLight.position - geometry.position;\\n\\t\\tlight.direction = normalize( lVector );\\n\\t\\tfloat lightDistance = length( lVector );\\n\\t\\tlight.color = pointLight.color;\\n\\t\\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\\n\\t\\tlight.visible = ( light.color != vec3( 0.0 ) );\\n\\t}
947\\n#endif\\n#if NUM_SPOT_LIGHTS > 0\\n\\tstruct SpotLight {\\n\\t\\tvec3 position;\\n\\t\\tvec3 direction;\\n\\t\\tvec3 color;\\n\\t\\tfloat distance;\\n\\t\\tfloat decay;\\n\\t\\tfloat coneCos;\\n\\t\\tfloat penumbraCos;\\n\\t};\\n\\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\\n\\tvoid getSpotLightInfo( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight light ) {\\n\\t\\tvec3 lVector = spotLight.position - geometry.position;\\n\\t\\tlight.direction = normalize( lVector );\\n\\t\\tfloat angleCos = dot( light.direction, spotLight.direction );\\n\\t\\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\\n\\t\\tif ( spotAttenuation > 0.0 ) {\\n\\t\\t\\tfloat lightDistance = length( lVector );\\n\\t\\t\\tlight.color = spotLight.color * spotAttenuation;\\n\\t\\t\\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\\n\\t\\t\\tlight.visible = ( light.color != vec3( 0.0 ) );\\n\\t\\t} else {\\n\\t\\t\\tlight.color = vec3( 0.0 );\\n\\t\\t\\tlight.visible = false;\\n\\t\\t}\\n\\t}\\n#endif\\n#if NUM_RECT_AREA_LIGHTS > 0\\n\\tstruct RectAreaLight {\\n\\t\\tvec3 color;\\n\\t\\tvec3 position;\\n\\t\\tvec3 halfWidth;\\n\\t\\tvec3 halfHeight;\\n\\t};\\n\\tuniform sampler2D ltc_1;\\tuniform sampler2D ltc_2;\\n\\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\\n#endif\\n#if NUM_HEMI_LIGHTS > 0\\n\\tstruct HemisphereLight {\\n\\t\\tvec3 direction;\\n\\t\\tvec3 skyColor;\\n\\t\\tvec3 groundColor;\\n\\t};\\n\\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\\n\\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\\n\\t\\tfloat dotNL = dot( normal, hemiLight.direction );\\n\\t\\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\\n\\t\\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\\n\\t\\treturn irradiance;\\n\\t}\\n#endif\",lights_toon_fragment:\"ToonMaterial material;\\nmaterial.diffuseColor = diffuseColor.rgb;\",lights_toon_pars_fragment:\"varying vec3 vViewPosition;\\nstruct ToonMaterial {\\n\\tvec3 diffuseColor;\\n};\\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\\n\\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\\n\\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\\n}\\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\\n\\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\\n}\\n#define RE_Direct\\t\\t\\t\\tRE_Direct_Toon\\n#define RE_IndirectDiffuse\\t\\tRE_IndirectDiffuse_Toon\\n#define Material_LightProbeLOD( material )\\t(0)\",lights_phong_fragment:\"BlinnPhongMaterial material;\\nmaterial.diffuseColor = diffuseColor.rgb;\\nmaterial.specularColor = specular;\\nmaterial.specularShininess = shininess;\\nmaterial.specularStrength = specularStrength;\",lights_phong_pars_fragment:\"varying vec3 vViewPosition;\\nstruct BlinnPhongMaterial {\\n\\tvec3 diffuseColor;\\n\\tvec3 specularColor;\\n\\tfloat specularShininess;\\n\\tfloat specularStrength;\\n};\\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\\n\\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\\n\\tvec3 irradiance = dotNL * directLight.color;\\n\\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\\n\\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength;\\n}\\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\\n\\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\\n}\\n#define RE_Direct\\t\\t\\t\\tRE_Direct_BlinnPhong\\n#define RE_IndirectDiffuse\\t\\tRE_IndirectDiffuse_BlinnPhong\\n#define Material_LightProbeLOD( material )\\t(0)\",lights_physical_fragment:\"PhysicalMaterial material;\\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\\nmaterial.roughness = min( material.roughness, 1.0 );\\n#ifdef IOR\\n\\t#ifdef SPECULAR\\n\\t\\tfloat specularIntensityFactor = specularIntensity;\\n\\t\\tvec3 specularColorFactor = specularColor;\\n\\t\\t#ifdef USE_SPECULARINTENSITYMAP\\n\\t\\t\\tspecularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a;\\n\\t\\t#endif\\n\\t\\t#ifdef USE_SPECULARCOLORMAP\\n\\t\\t\\tspecularColorFactor *= specularColorMapTexelToLinear( texture2D( specularColorMap, vUv ) ).rgb;\\n\\t\\t#endif\\n\\t\\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\\n\\t#else\\n\\t\\tfloat specularIntensityFactor = 1.0;\\n\\t\\tvec3 specularColorFactor = vec3( 1.0 );\\n\\t\\tmaterial.specularF90 = 1.0;\\n\\t#endif\\n\\tmaterial.specularColor = mix( min( pow2( ( ior - 1.0 ) / ( ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\\n#else\\n\\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\\n\\tmaterial.specularF90 = 1.0;\\n#endif\\n#ifdef USE_CLEARCOAT\\n\\tmaterial.clearcoat = clearcoat;\\n\\tmaterial.clearcoatRoughness = clearcoatRoughness;\\n\\tmaterial.clearcoatF0 = vec3( 0.04 );\\n\\tmaterial.clearcoatF90 = 1.0;\\n\\t#ifdef USE_CLEARCOATMAP\\n\\t\\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\\n\\t#endif\\n\\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\\n\\t\\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\\n\\t#endif\\n\\tmaterial.clearcoat = saturate( material.clearcoat );\\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\\n\\tmaterial.clearcoatRoughness += geometryRoughness;\\n\\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\\n#endif\\n#ifdef USE_SHEEN\\n\\tmaterial.sheenColor = sheenColor;\\n\\t#ifdef USE_SHEENCOLORMAP\\n\\t\\tmaterial.sheenColor *= sheenColorMapTexelToLinear( texture2D( sheenColorMap, vUv ) ).rgb;\\n\\t#endif\\n\\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\\n\\t#ifdef USE_SHEENROUGHNESSMAP\\n\\t\\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vUv ).a;\\n\\t#endif\\n#endif\",lights_physical_pars_fragment:\"struct PhysicalMaterial {\\n\\tvec3 diffuseColor;\\n\\tfloat roughness;\\n\\tvec3 specularColor;\\n\\tfloat specularF90;\\n\\t#ifdef USE_CLEARCOAT\\n\\t\\tfloat clearcoat;\\n\\t\\tfloat clearcoatRoughness;\\n\\t\\tvec3 clearcoatF0;\\n\\t\\tfloat clearcoatF90;\\n\\t#endif\\n\\t#ifdef USE_SHEEN\\n\\t\\tvec3 sheenColor;\\n\\t\\tfloat sheenRoughness;\\n\\t#endif\\n};
947\\nvec3 clearcoatSpecular = vec3( 0.0 );\\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\\n\\tfloat dotNV = saturate( dot( normal, viewDir ) );\\n\\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\\n\\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\\n\\tvec4 r = roughness * c0 + c1;\\n\\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\\n\\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\\n\\treturn fab;\\n}\\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\\n\\tvec2 fab = DFGApprox( normal, viewDir, roughness );\\n\\treturn specularColor * fab.x + specularF90 * fab.y;\\n}\\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\\n\\tvec2 fab = DFGApprox( normal, viewDir, roughness );\\n\\tvec3 FssEss = specularColor * fab.x + specularF90 * fab.y;\\n\\tfloat Ess = fab.x + fab.y;\\n\\tfloat Ems = 1.0 - Ess;\\n\\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\\n\\tsingleScatter += FssEss;\\n\\tmultiScatter += Fms * Ems;\\n}\\n#if NUM_RECT_AREA_LIGHTS > 0\\n\\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\\n\\t\\tvec3 normal = geometry.normal;\\n\\t\\tvec3 viewDir = geometry.viewDir;\\n\\t\\tvec3 position = geometry.position;\\n\\t\\tvec3 lightPos = rectAreaLight.position;\\n\\t\\tvec3 halfWidth = rectAreaLight.halfWidth;\\n\\t\\tvec3 halfHeight = rectAreaLight.halfHeight;\\n\\t\\tvec3 lightColor = rectAreaLight.color;\\n\\t\\tfloat roughness = material.roughness;\\n\\t\\tvec3 rectCoords[ 4 ];\\n\\t\\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\\t\\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\\n\\t\\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\\n\\t\\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\\n\\t\\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\\n\\t\\tvec4 t1 = texture2D( ltc_1, uv );\\n\\t\\tvec4 t2 = texture2D( ltc_2, uv );\\n\\t\\tmat3 mInv = mat3(\\n\\t\\t\\tvec3( t1.x, 0, t1.y ),\\n\\t\\t\\tvec3( 0, 1, 0 ),\\n\\t\\t\\tvec3( t1.z, 0, t1.w )\\n\\t\\t);\\n\\t\\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\\n\\t\\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\\n\\t\\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\\n\\t}\\n#endif\\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\\n\\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\\n\\tvec3 irradiance = dotNL * directLight.color;\\n\\t#ifdef USE_CLEARCOAT\\n\\t\\tfloat dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\\n\\t\\tvec3 ccIrradiance = dotNLcc * directLight.color;\\n\\t\\tclearcoatSpecular += ccIrradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\\n\\t#endif\\n\\t#ifdef USE_SHEEN\\n\\t\\treflectedLight.directSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenColor, material.sheenRoughness );\\n\\t#endif\\n\\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.roughness );\\n\\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\\n}\\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\\n\\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\\n}\\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\\n\\t#ifdef USE_CLEARCOAT\\n\\t\\tclearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\\n\\t#endif\\n\\tvec3 singleScattering = vec3( 0.0 );\\n\\tvec3 multiScattering = vec3( 0.0 );\\n\\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\\n\\tcomputeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\\n\\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\\n\\treflectedLight.indirectSpecular += radiance * singleScattering;\\n\\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\\n\\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\\n}\\n#define RE_Direct\\t\\t\\t\\tRE_Direct_Physical\\n#define RE_Direct_RectArea\\t\\tRE_Direct_RectArea_Physical\\n#define RE_IndirectDiffuse\\t\\tRE_IndirectDiffuse_Physical\\n#define RE_IndirectSpecular\\t\\tRE_IndirectSpecular_Physical\\nfloat c
947omputeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\\n\\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\\n}\",lights_fragment_begin:\"\\nGeometricContext geometry;\\ngeometry.position = - vViewPosition;\\ngeometry.normal = normal;\\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\\n#ifdef USE_CLEARCOAT\\n\\tgeometry.clearcoatNormal = clearcoatNormal;\\n#endif\\nIncidentLight directLight;\\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\\n\\tPointLight pointLight;\\n\\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\\n\\tPointLightShadow pointLightShadow;\\n\\t#endif\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\\n\\t\\tpointLight = pointLights[ i ];\\n\\t\\tgetPointLightInfo( pointLight, geometry, directLight );\\n\\t\\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\\n\\t\\tpointLightShadow = pointLightShadows[ i ];\\n\\t\\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\\n\\t\\t#endif\\n\\t\\tRE_Direct( directLight, geometry, material, reflectedLight );\\n\\t}\\n\\t#pragma unroll_loop_end\\n#endif\\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\\n\\tSpotLight spotLight;\\n\\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\\n\\tSpotLightShadow spotLightShadow;\\n\\t#endif\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\\n\\t\\tspotLight = spotLights[ i ];\\n\\t\\tgetSpotLightInfo( spotLight, geometry, directLight );\\n\\t\\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\\n\\t\\tspotLightShadow = spotLightShadows[ i ];\\n\\t\\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\\n\\t\\t#endif\\n\\t\\tRE_Direct( directLight, geometry, material, reflectedLight );\\n\\t}\\n\\t#pragma unroll_loop_end\\n#endif\\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\\n\\tDirectionalLight directionalLight;\\n\\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\\n\\tDirectionalLightShadow directionalLightShadow;\\n\\t#endif\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\\n\\t\\tdirectionalLight = directionalLights[ i ];\\n\\t\\tgetDirectionalLightInfo( directionalLight, geometry, directLight );\\n\\t\\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\\n\\t\\tdirectionalLightShadow = directionalLightShadows[ i ];\\n\\t\\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\\n\\t\\t#endif\\n\\t\\tRE_Direct( directLight, geometry, material, reflectedLight );\\n\\t}\\n\\t#pragma unroll_loop_end\\n#endif\\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\\n\\tRectAreaLight rectAreaLight;\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\\n\\t\\trectAreaLight = rectAreaLights[ i ];\\n\\t\\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\\n\\t}\\n\\t#pragma unroll_loop_end\\n#endif\\n#if defined( RE_IndirectDiffuse )\\n\\tvec3 iblIrradiance = vec3( 0.0 );\\n\\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\\n\\tirradiance += getLightProbeIrradiance( lightProbe, geometry.normal );\\n\\t#if ( NUM_HEMI_LIGHTS > 0 )\\n\\t\\t#pragma unroll_loop_start\\n\\t\\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\\n\\t\\t\\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\\n\\t\\t}\\n\\t\\t#pragma unroll_loop_end\\n\\t#endif\\n#endif\\n#if defined( RE_IndirectSpecular )\\n\\tvec3 radiance = vec3( 0.0 );\\n\\tvec3 clearcoatRadiance = vec3( 0.0 );\\n#endif\",lights_fragment_maps:\"#if defined( RE_IndirectDiffuse )\\n\\t#ifdef USE_LIGHTMAP\\n\\t\\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\\n\\t\\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\\n\\t\\t#ifndef PHYSICALLY_CORRECT_LIGHTS\\n\\t\\t\\tlightMapIrradiance *= PI;\\n\\t\\t#endif\\n\\t\\tirradiance += lightMapIrradiance;\\n\\t#endif\\n\\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\\n\\t\\tiblIrradiance += getIBLIrradiance( geometry.normal );\\n\\t#endif\\n#endif\\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\\n\\tradiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );\\n\\t#ifdef USE_CLEARCOAT\\n\\t\\tclearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness );\\n\\t#endif\\n#endif\",lights_fragment_end:\"#if defined( RE_IndirectDiffuse )\\n\\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\\n#endif\\n#if defined( RE_IndirectSpecular )\\n\\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\\n#endif\",logdepthbuf_fragment:\"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\\n\\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\\n#endif\",logdepthbuf_pars_fragment:\"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\\n\\tuniform float logDepthBufFC;\\n\\tvarying float vFragDepth;\\n\\tvarying float vIsPerspective;
947\\n#endif\",logdepthbuf_pars_vertex:\"#ifdef USE_LOGDEPTHBUF\\n\\t#ifdef USE_LOGDEPTHBUF_EXT\\n\\t\\tvarying float vFragDepth;\\n\\t\\tvarying float vIsPerspective;\\n\\t#else\\n\\t\\tuniform float logDepthBufFC;\\n\\t#endif\\n#endif\",logdepthbuf_vertex:\"#ifdef USE_LOGDEPTHBUF\\n\\t#ifdef USE_LOGDEPTHBUF_EXT\\n\\t\\tvFragDepth = 1.0 + gl_Position.w;\\n\\t\\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\\n\\t#else\\n\\t\\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\\n\\t\\t\\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\\n\\t\\t\\tgl_Position.z *= gl_Position.w;\\n\\t\\t}\\n\\t#endif\\n#endif\",map_fragment:\"#ifdef USE_MAP\\n\\tvec4 texelColor = texture2D( map, vUv );\\n\\ttexelColor = mapTexelToLinear( texelColor );\\n\\tdiffuseColor *= texelColor;\\n#endif\",map_pars_fragment:\"#ifdef USE_MAP\\n\\tuniform sampler2D map;\\n#endif\",map_particle_fragment:\"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\\n\\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\\n#endif\\n#ifdef USE_MAP\\n\\tvec4 mapTexel = texture2D( map, uv );\\n\\tdiffuseColor *= mapTexelToLinear( mapTexel );\\n#endif\\n#ifdef USE_ALPHAMAP\\n\\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\\n#endif\",map_particle_pars_fragment:\"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\\n\\tuniform mat3 uvTransform;\\n#endif\\n#ifdef USE_MAP\\n\\tuniform sampler2D map;\\n#endif\\n#ifdef USE_ALPHAMAP\\n\\tuniform sampler2D alphaMap;\\n#endif\",metalnessmap_fragment:\"float metalnessFactor = metalness;\\n#ifdef USE_METALNESSMAP\\n\\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\\n\\tmetalnessFactor *= texelMetalness.b;\\n#endif\",metalnessmap_pars_fragment:\"#ifdef USE_METALNESSMAP\\n\\tuniform sampler2D metalnessMap;\\n#endif\",morphnormal_vertex:\"#ifdef USE_MORPHNORMALS\\n\\tobjectNormal *= morphTargetBaseInfluence;\\n\\t#ifdef MORPHTARGETS_TEXTURE\\n\\t\\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\\n\\t\\t\\tif ( morphTargetInfluences[ i ] > 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1, 2 ) * morphTargetInfluences[ i ];\\n\\t\\t}\\n\\t#else\\n\\t\\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\\n\\t\\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\\n\\t\\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\\n\\t\\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\\n\\t#endif\\n#endif\",morphtarget_pars_vertex:\"#ifdef USE_MORPHTARGETS\\n\\tuniform float morphTargetBaseInfluence;\\n\\t#ifdef MORPHTARGETS_TEXTURE\\n\\t\\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\\n\\t\\tuniform sampler2DArray morphTargetsTexture;\\n\\t\\tuniform vec2 morphTargetsTextureSize;\\n\\t\\tvec3 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset, const in int stride ) {\\n\\t\\t\\tfloat texelIndex = float( vertexIndex * stride + offset );\\n\\t\\t\\tfloat y = floor( texelIndex / morphTargetsTextureSize.x );\\n\\t\\t\\tfloat x = texelIndex - y * morphTargetsTextureSize.x;\\n\\t\\t\\tvec3 morphUV = vec3( ( x + 0.5 ) / morphTargetsTextureSize.x, y / morphTargetsTextureSize.y, morphTargetIndex );\\n\\t\\t\\treturn texture( morphTargetsTexture, morphUV ).xyz;\\n\\t\\t}\\n\\t#else\\n\\t\\t#ifndef USE_MORPHNORMALS\\n\\t\\t\\tuniform float morphTargetInfluences[ 8 ];\\n\\t\\t#else\\n\\t\\t\\tuniform float morphTargetInfluences[ 4 ];\\n\\t\\t#endif\\n\\t#endif\\n#endif\",morphtarget_vertex:\"#ifdef USE_MORPHTARGETS\\n\\ttransformed *= morphTargetBaseInfluence;\\n\\t#ifdef MORPHTARGETS_TEXTURE\\n\\t\\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\\n\\t\\t\\t#ifndef USE_MORPHNORMALS\\n\\t\\t\\t\\tif ( morphTargetInfluences[ i ] > 0.0 ) transformed += getMorph( gl_VertexID, i, 0, 1 ) * morphTargetInfluences[ i ];\\n\\t\\t\\t#else\\n\\t\\t\\t\\tif ( morphTargetInfluences[ i ] > 0.0 ) transformed += getMorph( gl_VertexID, i, 0, 2 ) * morphTargetInfluences[ i ];\\n\\t\\t\\t#endif\\n\\t\\t}\\n\\t#else\\n\\t\\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\\n\\t\\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\\n\\t\\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\\n\\t\\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\\n\\t\\t#ifndef USE_MORPHNORMALS\\n\\t\\t\\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\\n\\t\\t\\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\\n\\t\\t\\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\\n\\t\\t\\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\\n\\t\\t#endif\\n\\t#endif\\n#endif\",normal_fragment_begin:\"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\\n#ifdef FLAT_SHADED\\n\\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\\n\\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\\n\\tvec3 normal = normalize( cross( fdx, fdy ) );\\n#else\\n\\tvec3 normal = normalize( vNormal );\\n\\t#ifdef DOUBLE_SIDED\\n\\t\\tnormal = normal * faceDirection;\\n\\t#endif\\n\\t#ifdef USE_TANGENT\\n\\t\\tvec3 tangent = normalize( vTangent );\\n\\t\\tvec3 bitangent = normalize( vBitangent );\\n\\t\\t#ifdef DOUBLE_SIDED\\n\\t\\t\\ttangent = tangent * faceDirection;\\n\\t\\t\\tbitangent = bitangent * faceDirection;\\n\\t\\t#endif\\n\\t\\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\\n\\t\\t\\tmat3 vTBN = mat3( tangent, bitangent, normal );\\n\\t\\t#endif\\n\\t#endif\\n#endif\\nvec3 geometryNormal = normal;\",normal_fragment_maps:\"#ifdef OBJECTSPACE_NORMALMAP\\n\\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\\n\\t#ifdef FLIP_SIDED\\n\\t\\tnormal = - normal;\\n\\t#endif\\n\\t#ifdef DOUBLE_SIDED\\n\\t\\tnormal = normal * faceDirection;\\n\\t#endif\\n\\tnormal = normalize( normalMatrix * normal );\\n#elif defined( TANGENTSPACE_NORMALMAP )\\n\\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\\n\\tmapN.xy *= normalScale;\\n\\t#ifdef USE_TANGENT\\n\\t\\tnormal = normalize( vTBN * mapN );
947\\n\\t#else\\n\\t\\tnormal = perturbNormal2Arb( - vViewPosition, normal, mapN, faceDirection );\\n\\t#endif\\n#elif defined( USE_BUMPMAP )\\n\\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\\n#endif\",normal_pars_fragment:\"#ifndef FLAT_SHADED\\n\\tvarying vec3 vNormal;\\n\\t#ifdef USE_TANGENT\\n\\t\\tvarying vec3 vTangent;\\n\\t\\tvarying vec3 vBitangent;\\n\\t#endif\\n#endif\",normal_pars_vertex:\"#ifndef FLAT_SHADED\\n\\tvarying vec3 vNormal;\\n\\t#ifdef USE_TANGENT\\n\\t\\tvarying vec3 vTangent;\\n\\t\\tvarying vec3 vBitangent;\\n\\t#endif\\n#endif\",normal_vertex:\"#ifndef FLAT_SHADED\\n\\tvNormal = normalize( transformedNormal );\\n\\t#ifdef USE_TANGENT\\n\\t\\tvTangent = normalize( transformedTangent );\\n\\t\\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\\n\\t#endif\\n#endif\",normalmap_pars_fragment:\"#ifdef USE_NORMALMAP\\n\\tuniform sampler2D normalMap;\\n\\tuniform vec2 normalScale;\\n#endif\\n#ifdef OBJECTSPACE_NORMALMAP\\n\\tuniform mat3 normalMatrix;\\n#endif\\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\\n\\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) {\\n\\t\\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\\n\\t\\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\\n\\t\\tvec2 st0 = dFdx( vUv.st );\\n\\t\\tvec2 st1 = dFdy( vUv.st );\\n\\t\\tvec3 N = surf_norm;\\n\\t\\tvec3 q1perp = cross( q1, N );\\n\\t\\tvec3 q0perp = cross( N, q0 );\\n\\t\\tvec3 T = q1perp * st0.x + q0perp * st1.x;\\n\\t\\tvec3 B = q1perp * st0.y + q0perp * st1.y;\\n\\t\\tfloat det = max( dot( T, T ), dot( B, B ) );\\n\\t\\tfloat scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det );\\n\\t\\treturn normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z );\\n\\t}\\n#endif\",clearcoat_normal_fragment_begin:\"#ifdef USE_CLEARCOAT\\n\\tvec3 clearcoatNormal = geometryNormal;\\n#endif\",clearcoat_normal_fragment_maps:\"#ifdef USE_CLEARCOAT_NORMALMAP\\n\\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\\n\\tclearcoatMapN.xy *= clearcoatNormalScale;\\n\\t#ifdef USE_TANGENT\\n\\t\\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\\n\\t#else\\n\\t\\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection );\\n\\t#endif\\n#endif\",clearcoat_pars_fragment:\"#ifdef USE_CLEARCOATMAP\\n\\tuniform sampler2D clearcoatMap;\\n#endif\\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\\n\\tuniform sampler2D clearcoatRoughnessMap;\\n#endif\\n#ifdef USE_CLEARCOAT_NORMALMAP\\n\\tuniform sampler2D clearcoatNormalMap;\\n\\tuniform vec2 clearcoatNormalScale;\\n#endif\",output_fragment:\"#ifdef OPAQUE\\ndiffuseColor.a = 1.0;\\n#endif\\n#ifdef USE_TRANSMISSION\\ndiffuseColor.a *= transmissionAlpha + 0.1;\\n#endif\\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );\",packing:\"vec3 packNormalToRGB( const in vec3 normal ) {\\n\\treturn normalize( normal ) * 0.5 + 0.5;\\n}\\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\\n\\treturn 2.0 * rgb.xyz - 1.0;\\n}\\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\\nconst float ShiftRight8 = 1. / 256.;\\nvec4 packDepthToRGBA( const in float v ) {\\n\\tvec4 r = vec4( fract( v * PackFactors ), v );\\n\\tr.yzw -= r.xyz * ShiftRight8;\\treturn r * PackUpscale;\\n}\\nfloat unpackRGBAToDepth( const in vec4 v ) {\\n\\treturn dot( v, UnpackFactors );\\n}\\nvec4 pack2HalfToRGBA( vec2 v ) {\\n\\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\\n\\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\\n}\\nvec2 unpackRGBATo2Half( vec4 v ) {\\n\\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\\n}\\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\\n\\treturn ( viewZ + near ) / ( near - far );\\n}\\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\\n\\treturn linearClipZ * ( near - far ) - near;\\n}\\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\\n\\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\\n}\\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\\n\\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\\n}\",premultiplied_alpha_fragment:\"#ifdef PREMULTIPLIED_ALPHA\\n\\tgl_FragColor.rgb *= gl_FragColor.a;\\n#endif\",project_vertex:\"vec4 mvPosition = vec4( transformed, 1.0 );\\n#ifdef USE_INSTANCING\\n\\tmvPosition = instanceMatrix * mvPosition;\\n#endif\\nmvPosition = modelViewMatrix * mvPosition;\\ngl_Position = projectionMatrix * mvPosition;\",dithering_fragment:\"#ifdef DITHERING\\n\\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\\n#endif\",dithering_pars_fragment:\"#ifdef DITHERING\\n\\tvec3 dithering( vec3 color ) {\\n\\t\\tfloat grid_position = rand( gl_FragCoord.xy );\\n\\t\\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\\n\\t\\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\\n\\t\\treturn color + dither_shift_RGB;\\n\\t}\\n#endif\",roughnessmap_fragment:\"float roughnessFactor = roughness;\\n#ifdef USE_ROUGHNESSMAP\\n\\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\\n\\troughnessFactor *= texelRoughness.g;\\n#endif\",roughnessmap_pars_fragment:\"#ifdef USE_ROUGHNESSMAP\\n\\tuniform sampler2D roughnessMap;\\n#endif\",shadowmap_pars_fragment:\"#ifdef USE_SHADOWMAP\\n\\t#if NUM_DIR_LIGHT_SHADOWS > 0\\n\\t\\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\\n\\t\\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
947\\n\\t\\tstruct DirectionalLightShadow {\\n\\t\\t\\tfloat shadowBias;\\n\\t\\t\\tfloat shadowNormalBias;\\n\\t\\t\\tfloat shadowRadius;\\n\\t\\t\\tvec2 shadowMapSize;\\n\\t\\t};\\n\\t\\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\\n\\t#endif\\n\\t#if NUM_SPOT_LIGHT_SHADOWS > 0\\n\\t\\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\\n\\t\\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\\n\\t\\tstruct SpotLightShadow {\\n\\t\\t\\tfloat shadowBias;\\n\\t\\t\\tfloat shadowNormalBias;\\n\\t\\t\\tfloat shadowRadius;\\n\\t\\t\\tvec2 shadowMapSize;\\n\\t\\t};\\n\\t\\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\\n\\t#endif\\n\\t#if NUM_POINT_LIGHT_SHADOWS > 0\\n\\t\\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\\n\\t\\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\\n\\t\\tstruct PointLightShadow {\\n\\t\\t\\tfloat shadowBias;\\n\\t\\t\\tfloat shadowNormalBias;\\n\\t\\t\\tfloat shadowRadius;\\n\\t\\t\\tvec2 shadowMapSize;\\n\\t\\t\\tfloat shadowCameraNear;\\n\\t\\t\\tfloat shadowCameraFar;\\n\\t\\t};\\n\\t\\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\\n\\t#endif\\n\\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\\n\\t\\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\\n\\t}\\n\\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\\n\\t\\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\\n\\t}\\n\\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\\n\\t\\tfloat occlusion = 1.0;\\n\\t\\tvec2 distribution = texture2DDistribution( shadow, uv );\\n\\t\\tfloat hard_shadow = step( compare , distribution.x );\\n\\t\\tif (hard_shadow != 1.0 ) {\\n\\t\\t\\tfloat distance = compare - distribution.x ;\\n\\t\\t\\tfloat variance = max( 0.00000, distribution.y * distribution.y );\\n\\t\\t\\tfloat softness_probability = variance / (variance + distance * distance );\\t\\t\\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\\t\\t\\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\\n\\t\\t}\\n\\t\\treturn occlusion;\\n\\t}\\n\\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\\n\\t\\tfloat shadow = 1.0;\\n\\t\\tshadowCoord.xyz /= shadowCoord.w;
947\\n\\t\\tshadowCoord.z += shadowBias;\\n\\t\\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\\n\\t\\tbool inFrustum = all( inFrustumVec );\\n\\t\\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\\n\\t\\tbool frustumTest = all( frustumTestVec );\\n\\t\\tif ( frustumTest ) {\\n\\t\\t#if defined( SHADOWMAP_TYPE_PCF )\\n\\t\\t\\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\\n\\t\\t\\tfloat dx0 = - texelSize.x * shadowRadius;\\n\\t\\t\\tfloat dy0 = - texelSize.y * shadowRadius;\\n\\t\\t\\tfloat dx1 = + texelSize.x * shadowRadius;\\n\\t\\t\\tfloat dy1 = + texelSize.y * shadowRadius;\\n\\t\\t\\tfloat dx2 = dx0 / 2.0;\\n\\t\\t\\tfloat dy2 = dy0 / 2.0;\\n\\t\\t\\tfloat dx3 = dx1 / 2.0;\\n\\t\\t\\tfloat dy3 = dy1 / 2.0;\\n\\t\\t\\tshadow = (\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\\n\\t\\t\\t) * ( 1.0 / 17.0 );\\n\\t\\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\\n\\t\\t\\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\\n\\t\\t\\tfloat dx = texelSize.x;\\n\\t\\t\\tfloat dy = texelSize.y;\\n\\t\\t\\tvec2 uv = shadowCoord.xy;\\n\\t\\t\\tvec2 f = fract( uv * shadowMapSize + 0.5 );\\n\\t\\t\\tuv -= f * texelSize;\\n\\t\\t\\tshadow = (\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\\n\\t\\t\\t\\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \\n\\t\\t\\t\\t\\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\\n\\t\\t\\t\\t\\t f.x ) +\\n\\t\\t\\t\\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \\n\\t\\t\\t\\t\\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\\n\\t\\t\\t\\t\\t f.x ) +\\n\\t\\t\\t\\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \\n\\t\\t\\t\\t\\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\\n\\t\\t\\t\\t\\t f.y ) +\\n\\t\\t\\t\\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \\n\\t\\t\\t\\t\\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\\n\\t\\t\\t\\t\\t f.y ) +\\n\\t\\t\\t\\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \\n\\t\\t\\t\\t\\t\\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\\n\\t\\t\\t\\t\\t\\t f.x ),\\n\\t\\t\\t\\t\\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \\n\\t\\t\\t\\t\\t\\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\\n\\t\\t\\t\\t\\t\\t f.x ),\\n\\t\\t\\t\\t\\t f.y )\\n\\t\\t\\t) * ( 1.0 / 9.0 );\\n\\t\\t#elif defined( SHADOWMAP_TYPE_VSM )\\n\\t\\t\\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\\n\\t\\t#else\\n\\t\\t\\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\\n\\t\\t#endif\\n\\t\\t}\\n\\t\\treturn shadow;\\n\\t}\\n\\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\\n\\t\\tvec3 absV = abs( v );\\n\\t\\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\\n\\t\\tabsV *= scaleToCube;\\n\\t\\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\\n\\t\\tvec2 planar = v.xy;\\n\\t\\tfloat almostATexel = 1.5 * texelSizeY;\\n\\t\\tfloat almostOne = 1.0 - almostATexel;\\n\\t\\tif ( absV.z >= almostOne ) {\\n\\t\\t\\tif ( v.z > 0.0 )\\n\\t\\t\\t\\tplanar.x = 4.0 - v.x;\\n\\t\\t} else if ( absV.x >= almostOne ) {\\n\\t\\t\\tfloat signX = sign( v.x );\\n\\t\\t\\tplanar.x = v.z * signX + 2.0 * signX;\\n\\t\\t} else if ( absV.y >= almostOne ) {\\n\\t\\t\\tfloat signY = sign( v.y );\\n\\t\\t\\tplanar.x = v.x + 2.0 * signY + 2.0;\\n\\t\\t\\tplanar.y = v.z * signY - 2.0;\\n\\t\\t}\\n\\t\\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\\n\\t}\\n\\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\\n\\t\\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\\n\\t\\tvec3 lightToPosition = shadowCoord.xyz;\\n\\t\\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\\t\\tdp += shadowBias;\\n\\t\\tvec3 bd3D = normalize( lightToPosition );\\n\\t\\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\\n\\t\\t\\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\\n\\t\\t\\treturn (\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\\n\\t\\t\\t) * ( 1.0 / 9.0 );\\n\\t\\t#else\\n\\t\\t\\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\\n\\t\\t#endif\\n\\t}\\n#endif\",shadowmap_pars_vertex:\"#ifdef USE_SHADOWMAP\\n\\t#if NUM_DIR_LIGHT_SHADOWS > 0\\n\\t\\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\\n\\t\\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
947\\n\\t\\tstruct DirectionalLightShadow {\\n\\t\\t\\tfloat shadowBias;\\n\\t\\t\\tfloat shadowNormalBias;\\n\\t\\t\\tfloat shadowRadius;\\n\\t\\t\\tvec2 shadowMapSize;\\n\\t\\t};\\n\\t\\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\\n\\t#endif\\n\\t#if NUM_SPOT_LIGHT_SHADOWS > 0\\n\\t\\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\\n\\t\\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\\n\\t\\tstruct SpotLightShadow {\\n\\t\\t\\tfloat shadowBias;\\n\\t\\t\\tfloat shadowNormalBias;\\n\\t\\t\\tfloat shadowRadius;\\n\\t\\t\\tvec2 shadowMapSize;\\n\\t\\t};\\n\\t\\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\\n\\t#endif\\n\\t#if NUM_POINT_LIGHT_SHADOWS > 0\\n\\t\\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\\n\\t\\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\\n\\t\\tstruct PointLightShadow {\\n\\t\\t\\tfloat shadowBias;\\n\\t\\t\\tfloat shadowNormalBias;\\n\\t\\t\\tfloat shadowRadius;\\n\\t\\t\\tvec2 shadowMapSize;\\n\\t\\t\\tfloat shadowCameraNear;\\n\\t\\t\\tfloat shadowCameraFar;\\n\\t\\t};\\n\\t\\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\\n\\t#endif\\n#endif\",shadowmap_vertex:\"#ifdef USE_SHADOWMAP\\n\\t#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\\n\\t\\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\\n\\t\\tvec4 shadowWorldPosition;\\n\\t#endif\\n\\t#if NUM_DIR_LIGHT_SHADOWS > 0\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\\n\\t\\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\\n\\t\\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\\n\\t}\\n\\t#pragma unroll_loop_end\\n\\t#endif\\n\\t#if NUM_SPOT_LIGHT_SHADOWS > 0\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\\n\\t\\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 );\\n\\t\\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition;\\n\\t}\\n\\t#pragma unroll_loop_end\\n\\t#endif\\n\\t#if NUM_POINT_LIGHT_SHADOWS > 0\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\\n\\t\\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\\n\\t\\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\\n\\t}\\n\\t#pragma unroll_loop_end\\n\\t#endif\\n#endif\",shadowmask_pars_fragment:\"float getShadowMask() {\\n\\tfloat shadow = 1.0;\\n\\t#ifdef USE_SHADOWMAP\\n\\t#if NUM_DIR_LIGHT_SHADOWS > 0\\n\\tDirectionalLightShadow directionalLight;\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\\n\\t\\tdirectionalLight = directionalLightShadows[ i ];\\n\\t\\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\\n\\t}\\n\\t#pragma unroll_loop_end\\n\\t#endif\\n\\t#if NUM_SPOT_LIGHT_SHADOWS > 0\\n\\tSpotLightShadow spotLight;\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\\n\\t\\tspotLight = spotLightShadows[ i ];\\n\\t\\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\\n\\t}\\n\\t#pragma unroll_loop_end\\n\\t#endif\\n\\t#if NUM_POINT_LIGHT_SHADOWS > 0\\n\\tPointLightShadow pointLight;\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\\n\\t\\tpointLight = pointLightShadows[ i ];\\n\\t\\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\\n\\t}\\n\\t#pragma unroll_loop_end\\n\\t#endif\\n\\t#endif\\n\\treturn shadow;\\n}\",skinbase_vertex:\"#ifdef USE_SKINNING\\n\\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\\n\\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\\n\\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\\n\\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\\n#endif\",skinning_pars_vertex:\"#ifdef USE_SKINNING\\n\\tuniform mat4 bindMatrix;\\n\\tuniform mat4 bindMatrixInverse;\\n\\t#ifdef BONE_TEXTURE\\n\\t\\tuniform highp sampler2D boneTexture;\\n\\t\\tuniform int boneTextureSize;\\n\\t\\tmat4 getBoneMatrix( const in float i ) {\\n\\t\\t\\tfloat j = i * 4.0;\\n\\t\\t\\tfloat x = mod( j, float( boneTextureSize ) );\\n\\t\\t\\tfloat y = floor( j / float( boneTextureSize ) );\\n\\t\\t\\tfloat dx = 1.0 / float( boneTextureSize );\\n\\t\\t\\tfloat dy = 1.0 / float( boneTextureSize );\\n\\t\\t\\ty = dy * ( y + 0.5 );\\n\\t\\t\\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\\n\\t\\t\\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\\n\\t\\t\\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\\n\\t\\t\\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\\n\\t\\t\\tmat4 bone = mat4( v1, v2, v3, v4 );\\n\\t\\t\\treturn bone;\\n\\t\\t}\\n\\t#else\\n\\t\\tuniform mat4 boneMatrices[ MAX_BONES ];\\n\\t\\tmat4 getBoneMatrix( const in float i ) {\\n\\t\\t\\tmat4 bone = boneMatrices[ int(i) ];\\n\\t\\t\\treturn bone;\\n\\t\\t}\\n\\t#endif\\n#endif\",skinning_vertex:\"#ifdef USE_SKINNING\\n\\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\\n\\tvec4 skinned = vec4( 0.0 );\\n\\tskinned += boneMatX * skinVertex * skinWeight.x;\\n\\tskinned += boneMatY * skinVertex * skinWeight.y;\\n\\tskinned += boneMatZ * skinVertex * skinWeight.z;\\n\\tskinned += boneMatW * skinVertex * skinWeight.w;\\n\\ttransformed = ( bindMatrixInverse * skinned ).xyz;\\n#endif\",skinnormal_vertex:\"#ifdef USE_SKINNING\\n\\tmat4 skinMatrix = mat4( 0.0 );\\n\\tskinMatrix += skinWeight.x * boneMatX;\\n\\tskinMatrix += skinWeight.y * boneMatY;\\n\\tskinMatrix += skinWeight.z * boneMatZ;\\n\\tskinMatrix += skinWeight.w * boneMatW;\\n\\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\\n\\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\\n\\t#ifdef USE_TANGENT\\n\\t\\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\\n\\t#endif\\n#endif\",specularmap_fragment:\"float specularStrength;\\n#ifdef USE_SPECULARMAP\\n\\tvec4 texelSpecular = texture2D( specularMap, vUv );\\n\\tspecularStrength = texelSpecular.r;\\n#else\\n\\tspecularStrength = 1.0;\\n#endif\",specularmap_pars_fragment:\"#ifdef USE_SPECULARMAP\\n\\tuniform sampler2D specularMap;\\n#endif\",tonemapping_fragment:\"#if defined( TONE_MAPPING )\\n\\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\\n#endif\",tonemapping_pars_fragment:\"#ifndef saturate\\n#define saturate( a ) clamp( a, 0.0, 1.0 )\\n#endif\\nuniform float toneMappingExposure;\\nvec3 LinearToneMapping( vec3 color ) {\\n\\treturn toneMappingExposure * color;\\n}\\nvec3 ReinhardToneMapping( vec3 color ) {\\n\\tcolor *= toneMappingExposure;\\n\\treturn saturate( color / ( vec3( 1.0 ) + color ) );\\n}\\nvec3 OptimizedCineonToneMapping( vec3 color ) {\\n\\tcolor *= toneMappingExposure;\\n\\tcolor = max( vec3( 0.0 ), color - 0.004 );\\n\\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\\n}\\nvec3 RRTAndODTFit( vec3 v ) {\\n\\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\\n\\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\\n\\treturn a / b;\\n}\\nvec3 ACESFilmicToneMapping( vec3 color ) {\\n\\tconst mat3 ACESInputMat = mat3(\\n\\t\\tvec3( 0.59719, 0.07600, 0.02840 ),\\t\\tvec3( 0.35458, 0.90834, 0.13383 ),\\n\\t\\tvec3( 0.04823, 0.01566, 0.83777 )\\n\\t);\\n\\tconst mat3 ACESOutputMat = mat3(\\n\\t\\tvec3( 1.60475, -0.10208, -0.00327 ),\\t\\tvec3( -0.53108, 1.10813, -0.07276 ),\\n\\t\\tvec3( -0.07367, -0.00605, 1.07602 )\\n\\t);\\n\\tcolor *= toneMappingExposure / 0.6;\\n\\tcolor = ACESInputMat * color;\\n\\tcolor = RRTAndODTFit( color );\\n\\tcolor = ACESOutputMat * color;\\n\\treturn saturate( color );\\n}\\nvec3 CustomToneMapping( vec3 color ) { return color; }\",transmission_fragment:\"#ifdef USE_TRANSMISSION\\n\\tfloat transmissionAlpha = 1.0;\\n\\tfloat transmissionFactor = transmission;\\n\\tfloat thicknessFactor = thickness;\\n\\t#ifdef USE_TRANSMISSIONMAP\\n\\t\\ttransmissionFactor *= texture2D( transmissionMap, vUv ).r;\\n\\t#endif\\n\\t#ifdef USE_THICKNESSMAP\\n\\t\\tthicknessFactor *= texture2D( thicknessMap, vUv ).g;\\n\\t#endif\\n\\tvec3 pos = vWorldPosition;\\n\\tvec3 v = normalize( cameraPosition - pos );\\n\\tvec3 n = inverseTransformDirection( normal, viewMatrix );\\n\\tvec4 transmission = getIBLVolumeRefraction(\\n\\t\\tn, v, roughnessFactor, material.diffuseColor, material.specularColor, material.specularF90,\\n\\t\\tpos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor,\\n\\t\\tattenuationColor, attenuationDistance );\\n\\ttotalDiffuse = mix( totalDiffuse, transmission.rgb, transmissionFactor );\\n\\ttransmissionAlpha = mix( transmissionAlpha, transmission.a, transmissionFactor );\\n#endif\",transmission_pars_fragment:\"#ifdef USE_TRANSMISSION\\n\\tuniform float transmission;\\n\\tuniform float thickness;\\n\\tuniform float attenuationDistance;\\n\\tuniform vec3 attenuationColor;\\n\\t#ifdef USE_TRANSMISSIONMAP\\n\\t\\tuniform sampler2D transmissionMap;\\n\\t#endif\\n\\t#ifdef USE_THICKNESSMAP\\n\\t\\tuniform sampler2D thicknessMap;\\n\\t#endif\\n\\tuniform vec2 transmissionSamplerSize;\\n\\tuniform sampler2D transmissionSamplerMap;\\n\\tuniform mat4 modelMatrix;\\n\\tuniform mat4 projectionMatrix;\\n\\tvarying vec3 vWorldPosition;\\n\\tvec3 getVolumeTransmissionRay( vec3 n, vec3 v, float thickness, float ior, mat4 modelMatrix ) {\\n\\t\\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\\n\\t\\tvec3 modelScale;\\n\\t\\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\\n\\t\\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\\n\\t\\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\\n\\t\\treturn normalize( refractionVector ) * thickness * modelScale;\\n\\t}\\n\\tfloat applyIorToRoughness( float roughness, float ior ) {\\n\\t\\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\\n\\t}\\n\\tvec4 getTransmissionSample( vec2 fragCoord, float roughness, float ior ) {\\n\\t\\tfloat framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\\n\\t\\t#ifdef TEXTURE_LOD_EXT\\n\\t\\t\\treturn texture2DLodEXT( transmissionSamplerMap, fragCoord.xy, framebufferLod );\\n\\t\\t#else\\n\\t\\t\\treturn texture2D( transmissionSamplerMap, fragCoord.xy, framebufferLod );\\n\\t\\t#endif\\n\\t}\\n\\tvec3 applyVolumeAttenuation( vec3 radiance, float transmissionDistance, vec3 attenuationColor, float attenuationDistance ) {\\n\\t\\tif ( attenuationDistance == 0.0 ) {\\n\\t\\t\\treturn radiance;\\n\\t\\t} else {\\n\\t\\t\\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\\n\\t\\t\\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\\t\\t\\treturn transmittance * radiance;\\n\\t\\t}\\n\\t}\\n\\tvec4 getIBLVolumeRefraction( vec3 n, vec3 v, float roughness, vec3 diffuseColor, vec3 specularColor, float specularF90,\\n\\t\\tvec3 position, mat4 modelMatrix, mat4 viewMatrix, mat4 projMatrix, float ior, float thickness,\\n\\t\\tvec3 attenuationColor, float attenuationDistance ) {\\n\\t\\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\\n\\t\\tvec3 refractedRayExit = position + transmissionRay;\\n\\t\\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\\n\\t\\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\\n\\t\\trefractionCoords += 1.0;\\n\\t\\trefractionCoords /= 2.0;\\n\\t\\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\\n\\t\\tvec3 attenuatedColor = applyVolumeAttenuation( transmittedLight.rgb, length( transmissionRay ), attenuationColor, attenuationDistance );\\n\\t\\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\\n\\t\\treturn vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a );\\n\\t}\\n#endif\",uv_pars_fragment:\"#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\\n\\tvarying vec2 vUv;\\n#endif\",uv_pars_vertex:\"#ifdef USE_UV\\n\\t#ifdef UVS_VERTEX_ONLY\\n\\t\\tvec2 vUv;\\n\\t#else\\n\\t\\tvarying vec2 vUv;\\n\\t#endif\\n\\tuniform mat3 uvTransform;\\n#endif\",uv_vertex:\"#ifdef USE_UV\\n\\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\\n#endif\",uv2_pars_fragment:\"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\\n\\tvarying vec2 vUv2;\\n#endif\",uv2_pars_vertex:\"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\\n\\tattribute vec2 uv2;\\n\\tvarying vec2 vUv2;\\n\\tuniform mat3 uv2Transform;\\n#endif\",uv2_vertex:\"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\\n\\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\\n#endif\",worldpos_vertex:\"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION )\\n\\tvec4 worldPosition = vec4( transformed, 1.0 );\\n\\t#ifdef USE_INSTANCING\\n\\t\\tworldPosition = instanceMatrix * worldPosition;\\n\\t#endif\\n\\tworldPosition = modelMatrix * worldPosition;\\n#endif\",background_vert:\"varying vec2 vUv;\\nuniform mat3 uvTransform;\\nvoid main() {\\n\\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\\n\\tgl_Position = vec4( position.xy, 1.0, 1.0 );\\n}\",background_frag:\"uniform sampler2D t2D;\\nvarying vec2 vUv;\\nvoid main() {\\n\\tvec4 texColor = texture2D( t2D, vUv );\\n\\tgl_FragColor = mapTexelToLinear( texColor );\\n\\t#include <tonemapping_fragment>\\n\\t#include <encodings_fragment>\\n}\",cube_vert:\"varying vec3 vWorldDirection;\\n#include <common>\\nvoid main() {\\n\\tvWorldDirection = transformDirection( position, modelMatrix );\\n\\t#include <begin_vertex>\\n\\t#include <project_vertex>\\n\\tgl_Position.z = gl_Position.w;\\n}\",cube_frag:\"#include <envmap_common_pars_fragment>\\nuniform float opacity;\\nvarying vec3 vWorldDirection;\\n#include <cube_uv_reflection_fragment>\\nvoid main() {\\n\\tvec3 vReflect = vWorldDirection;\\n\\t#include <envmap_fragment>\\n\\tgl_FragColor = envColor;\\n\\tgl_FragColor.a *= opacity;\\n\\t#include <tonemapping_fragment>\\n\\t#include <encodings_fragment>\\n}\",depth_vert:\"#include <common>\\n#include <uv_pars_vertex>\\n#include <displacementmap_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvarying vec2 vHighPrecisionZW;\\nvoid main() {\\n\\t#include <uv_vertex>\\n\\t#include <skinbase_vertex>\\n\\t#ifdef USE_DISPLACEMENTMAP\\n\\t\\t#include <beginnormal_vertex>\\n\\t\\t#include <morphnormal_vertex>\\n\\t\\t#include <skinnormal_vertex>\\n\\t#endif\\n\\t#include <begin_vertex>\\n\\t#include <morphtarget_vertex>\\n\\t#include <skinning_vertex>\\n\\t#include <displacementmap_vertex>\\n\\t#include <project_vertex>\\n\\t#include <logdepthbuf_vertex>\\n\\t#include <clipping_planes_vertex>\\n\\tvHighPrecisionZW = gl_Position.zw;\\n}\",depth_frag:\"#if DEPTH_PACKING == 3200\\n\\tuniform float opacity;\\n#endif\\n#include <common>\\n#include <packing>\\n#include <uv_pars_fragment>\\n#include <map_pars_fragment>\\n#include <alphamap_pars_fragment>\\n#include <alphatest_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvarying vec2 vHighPrecisionZW;\\nvoid main() {\\n\\t#include <clipping_planes_fragment>\\n\\tvec4 diffuseColor = vec4( 1.0 );\\n\\t#if DEPTH_PACKING == 3200\\n\\t\\tdiffuseColor.a = opacity;\\n\\t#endif\\n\\t#include <map_fragment>\\n\\t#include <alphamap_fragment>\\n\\t#include <alphatest_fragment>\\n\\t#include <logdepthbuf_fragment>\\n\\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\\n\\t#if DEPTH_PACKING == 3200\\n\\t\\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\\n\\t#elif DEPTH_PACKING == 3201\\n\\t\\tgl_FragColor = packDepthToRGBA( fragCoordZ );\\n\\t#endif\\n}\",distanceRGBA_vert:\"#define DISTANCE\\nvarying vec3 vWorldPosition;\\n#in
947clude <common>\\n#include <uv_pars_vertex>\\n#include <displacementmap_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\\t#include <uv_vertex>\\n\\t#include <skinbase_vertex>\\n\\t#ifdef USE_DISPLACEMENTMAP\\n\\t\\t#include <beginnormal_vertex>\\n\\t\\t#include <morphnormal_vertex>\\n\\t\\t#include <skinnormal_vertex>\\n\\t#endif\\n\\t#include <begin_vertex>\\n\\t#include <morphtarget_vertex>\\n\\t#include <skinning_vertex>\\n\\t#include <displacementmap_vertex>\\n\\t#include <project_vertex>\\n\\t#include <worldpos_vertex>\\n\\t#include <clipping_planes_vertex>\\n\\tvWorldPosition = worldPosition.xyz;\\n}\",distanceRGBA_frag:\"#define DISTANCE\\nuniform vec3 referencePosition;\\nuniform float nearDistance;\\nuniform float farDistance;\\nvarying vec3 vWorldPosition;\\n#include <common>\\n#include <packing>\\n#include <uv_pars_fragment>\\n#include <map_pars_fragment>\\n#include <alphamap_pars_fragment>\\n#include <alphatest_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main () {\\n\\t#include <clipping_planes_fragment>\\n\\tvec4 diffuseColor = vec4( 1.0 );\\n\\t#include <map_fragment>\\n\\t#include <alphamap_fragment>\\n\\t#include <alphatest_fragment>\\n\\tfloat dist = length( vWorldPosition - referencePosition );\\n\\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\\n\\tdist = saturate( dist );\\n\\tgl_FragColor = packDepthToRGBA( dist );\\n}\",equirect_vert:\"varying vec3 vWorldDirection;\\n#include <common>\\nvoid main() {\\n\\tvWorldDirection = transformDirection( position, modelMatrix );\\n\\t#include <begin_vertex>\\n\\t#include <project_vertex>\\n}\",equirect_frag:\"uniform sampler2D tEquirect;\\nvarying vec3 vWorldDirection;\\n#include <common>\\nvoid main() {\\n\\tvec3 direction = normalize( vWorldDirection );\\n\\tvec2 sampleUV = equirectUv( direction );\\n\\tvec4 texColor = texture2D( tEquirect, sampleUV );\\n\\tgl_FragColor = mapTexelToLinear( texColor );\\n\\t#include <tonemapping_fragment>\\n\\t#include <encodings_fragment>\\n}\",linedashed_vert:\"uniform float scale;\\nattribute float lineDistance;\\nvarying float vLineDistance;\\n#include <common>\\n#include <color_pars_vertex>\\n#include <fog_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\\tvLineDistance = scale * lineDistance;\\n\\t#include <color_vertex>\\n\\t#include <begin_vertex>\\n\\t#include <morphtarget_vertex>\\n\\t#include <project_vertex>\\n\\t#include <logdepthbuf_vertex>\\n\\t#include <clipping_planes_vertex>\\n\\t#include <fog_vertex>\\n}\",linedashed_frag:\"uniform vec3 diffuse;\\nuniform float opacity;\\nuniform float dashSize;\\nuniform float totalSize;\\nvarying float vLineDistance;\\n#include <common>\\n#include <color_pars_fragment>\\n#include <fog_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\\t#include <clipping_planes_fragment>\\n\\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\\n\\t\\tdiscard;\\n\\t}\\n\\tvec3 outgoingLight = vec3( 0.0 );\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\t#include <logdepthbuf_fragment>\\n\\t#include <color_fragment>\\n\\toutgoingLight = diffuseColor.rgb;\\n\\t#include <output_fragment>\\n\\t#include <tonemapping_fragment>\\n\\t#include <encodings_fragment>\\n\\t#include <fog_fragment>\\n\\t#include <premultiplied_alpha_fragment>\\n}\",meshbasic_vert:\"#include <common>\\n#include <uv_pars_vertex>\\n#include <uv2_pars_vertex>\\n#include <envmap_pars_vertex>\\n#include <color_pars_vertex>\\n#include <fog_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\\t#include <uv_vertex>\\n\\t#include <uv2_vertex>\\n\\t#include <color_vertex>\\n\\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\\n\\t\\t#include <beginnormal_vertex>\\n\\t\\t#include <morphnormal_vertex>\\n\\t\\t#include <skinbase_vertex>\\n\\t\\t#include <skinnormal_vertex>\\n\\t\\t#include <defaultnormal_vertex>\\n\\t#endif\\n\\t#include <begin_vertex>\\n\\t#include <morphtarget_vertex>\\n\\t#include <skinning_vertex>\\n\\t#include <project_vertex>\\n\\t#include <logdepthbuf_vertex>\\n\\t#include <clipping_planes_vertex>\\n\\t#include <worldpos_vertex>\\n\\t#include <envmap_vertex>\\n\\t#include <fog_vertex>\\n}\",meshbasic_frag:\"uniform vec3 diffuse;\\nuniform float opacity;\\n#ifndef FLAT_SHADED\\n\\tvarying vec3 vNormal;\\n#endif\\n#include <common>\\n#include <dithering_pars_fragment>\\n#include <color_pars_fragment>\\n#include <uv_pars_fragment>\\n#include <uv2_pars_fragment>\\n#include <map_pars_fragment>\\n#include <alphamap_pars_fragment>\\n#include <alphatest_pars_fragment>\\n#include <aomap_pars_fragment>\\n#include <lightmap_pars_fragment>\\n#include <envmap_common_pars_fragment>\\n#include <envmap_pars_fragment>\\n#include <cube_uv_reflection_fragment>\\n#include <fog_pars_fragment>\\n#include <specularmap_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\\t#include <clipping_planes_fragment>\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\t#include <logdepthbuf_fragment>\\n\\t#include <map_fragment>\\n\\t#include <color_fragment>\\n\\t#include <alphamap_fragment>\\n\\t#include <alphatest_fragment>\\n\\t#include <specularmap_fragment>\\n\\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\\n\\t#ifdef USE_LIGHTMAP\\n\\t\\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\\n\\t\\treflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\\n\\t#else\\n\\t\\treflectedLight.indirectDiffuse += vec3( 1.0 );\\n\\t#endif\\n\\t#include <aomap_fragment>\\n\\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\\n\\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\\n\\t#include <envmap_fragment>\\n\\t#include <output_fragment>\\n\\t#include <tonemapping_fragment>\\n\\t#include <encodings_fragment>\\n\\t#include <fog_fragment>\\n\\t#include <premultiplied_alpha_fragment>\\n\\t#include <dithering_fragment>\\n}\",meshlambert_vert:\"#define LAMBERT\\nvarying vec3 vLightFront;\\nvarying vec3 vIndirectFront;\\n#ifdef DOUBLE_SIDED\\n\\tvarying vec3 vLightBack;\\n\\tvarying vec3 vIndirectBack;\\n#endif\\n#include <common>\\n#include <uv_pars_vertex>\\n#include <uv2_pars_vertex>\\n#include <envmap_pars_vertex>\\n#include <bsdfs>\\n#include <lights_pars_begin>\\n#include <color_pars_vertex>\\n#include <fog_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <shadowmap_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\\t#include <uv_vertex>\\n\\t#include <uv2_vertex>\\n\\t#include <color_vertex>\\n\\t#include <beginnormal_vertex>\\n\\t#include <morphnormal_vertex>\\n\\t#include <skinbase_vertex>\\n\\t#include <skinnormal_vertex>\\n\\t#include <defaultnormal_vertex>\\n\\t#include <begin_vertex>\\n\\t#include <morphtarget_vertex>\\n\\t#include <skinning_vertex>\\n\\t#include <project_vertex>\\n\\t#include <logdepthbuf_vertex>\\n\\t#include <clipping_planes_vertex>\\n\\t#include <worldpos_vertex>\\n\\t#include <envmap_vertex>\\n\\t#include <lights_lambert_vertex>\\n\\t#include <shadowmap_vertex>\\n\\t#include <fog_vertex>\\n}\",meshlambert_frag:\"uniform vec3 diffuse;\\nuniform vec3 emissive;\\nuniform float opacity;\\nvarying vec3 vLightFront;\\nvarying vec3 vIndirectFront;\\n#ifdef DOUBLE_SIDED\\n\\tvarying vec3 vLightBack;\\n\\tvarying vec3 vIndirectBack;\\n#endif\\n#include <common>\\n#include <packing>\\n#include <dithering_pars_fragment>\\n#include <color_pars_fragment>\\n#include <uv_pars_fragment>\\n#include <uv2_pars_fragment>\\n#include <map_pars_fragment>\\n#include <alphamap_pars_fragment>\\n#include <alphatest_pars_fragment>\\n#include <aomap_pars_fragment>\\n#include <lightmap_pars_fragment>\\n#include <emissivemap_pars_fragment>\\n#include <envmap_common_pars_fragment>\\n#include <envmap_pars_fragment>\\n#include <cube_uv_reflection_fragment>\\n#include <bsdfs>\\n#include <lights_pars_begin>\\n#include <fog_pars_fragment>\\n#include <shadowmap_pars_fragment>\\n#include <shadowmask_pars_fragment>\\n#include <specularmap_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\\t#include <clipping_planes_fragment>\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\\n\\tvec3 totalEmissiveRadiance = emissive;\\n\\t#include <logdepthbuf_fragment>\\n\\t#include <map_fragment>\\n\\t#include <color_fragment>\\n\\t#include <alphamap_fragment>\\n\\t#include <alphatest_fragment>\\n\\t#include <specularmap_fragment>\\n\\t#include <emissivemap_fragment>\\n\\t#ifdef DOUBLE_SIDED\\n\\t\\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\\n\\t#else\\n\\t\\treflectedLight.indirectDiffuse += vIndirectFront;\\n\\t#endif\\n\\t#include <lightmap_fragment>\\n\\treflectedLight.indirectDiffuse *= BRDF_Lambert( diffuseColor.rgb );\\n\\t#ifdef DOUBLE_SIDED\\n\\t\\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\\n\\t#else\\n\\t\\treflectedLight.directDiffuse = vLightFront;\\n\\t#endif\\n\\treflectedLight.directDiffuse *= BRDF_Lambert( diffuseColor.rgb ) * getShadowMask();\\n\\t#include <aomap_fragment>\\n\\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\\n\\t#include <envmap_fragment>\\n\\t#include <output_fragment>\\n\\t#include <tonemapping_fragment>\\n\\t#include <encodings_fragment>\\n\\t#include <fog_fragment>\\n\\t#include <premultiplied_alpha_fragment>\\n\\t#include <dithering_fragment>\\n}\",meshmatcap_vert:\"#define MATCAP\\nvarying vec3 vViewPosition;\\n#include <common>\\n#include <uv_pars_vertex>\\n#include <color_pars_vertex>\\n#include <displacementmap_pars_vertex>\\n#include <fog_pars_vertex>\\n#include <normal_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\\t#include <uv_vertex>\\n\\t#include <color_vertex>\\n\\t#include <beginnormal_vertex>\\n\\t#include <morphnormal_vertex>\\n\\t#include <skinbase_vertex>\\n\\t#include <skinnormal_vertex>\\n\\t#include <defaultnormal_vertex>\\n\\t#include <normal_vertex>\\n\\t#include <begin_vertex>\\n\\t#include <morphtarget_vertex>\\n\\t#include <skinning_vertex>\\n\\t#include <displacementmap_vertex>\\n\\t#include <project_vertex>\\n\\t#include <logdepthbuf_vertex>\\n\\t#include <clipping_planes_vertex>\\n\\t#include <fog_vertex>\\n\\tvViewPosition = - mvPosition.xyz;\\n}\",meshmatcap_frag:\"#define MATCAP\\nuniform vec3 diffuse;\\nuniform float opacity;\\nuniform sampler2D matcap;\\nvarying vec3 vViewPosition;\\n#include <common>\\n#include <dithering_pars_fragment>\\n#include <color_pars_fragment>\\n#include <uv_pars_fragment>\\n#include <map_pars_fragment>\\n#include <alphamap_pars_fragment>\\n#include <alphatest_pars_fragment>\\n#include <fog_pars_fragment>\\n#include <normal_pars_fragment>\\n#include <bumpmap_pars_fragment>\\n#include <normalmap_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\\t#include <clipping_planes_fragment>\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\t#include <logdepthbuf_fragment>\\n\\t#include <map_fragment>\\n\\t#include <color_fragment>\\n\\t#include <alphamap_fragment>\\n\\t#include <alphatest_fragment>\\n\\t#include <normal_fragment_begin>\\n\\t#include <normal_fragment_maps>\\n\\tvec3 viewDir = normalize( vViewPosition );\\n\\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\\n\\tvec3 y = cross( viewDir, x );\\n\\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;
947\\n\\t#ifdef USE_MATCAP\\n\\t\\tvec4 matcapColor = texture2D( matcap, uv );\\n\\t\\tmatcapColor = matcapTexelToLinear( matcapColor );\\n\\t#else\\n\\t\\tvec4 matcapColor = vec4( 1.0 );\\n\\t#endif\\n\\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\\n\\t#include <output_fragment>\\n\\t#include <tonemapping_fragment>\\n\\t#include <encodings_fragment>\\n\\t#include <fog_fragment>\\n\\t#include <premultiplied_alpha_fragment>\\n\\t#include <dithering_fragment>\\n}\",meshnormal_vert:\"#define NORMAL\\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\\n\\tvarying vec3 vViewPosition;\\n#endif\\n#include <common>\\n#include <uv_pars_vertex>\\n#include <displacementmap_pars_vertex>\\n#include <normal_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\\t#include <uv_vertex>\\n\\t#include <beginnormal_vertex>\\n\\t#include <morphnormal_vertex>\\n\\t#include <skinbase_vertex>\\n\\t#include <skinnormal_vertex>\\n\\t#include <defaultnormal_vertex>\\n\\t#include <normal_vertex>\\n\\t#include <begin_vertex>\\n\\t#include <morphtarget_vertex>\\n\\t#include <skinning_vertex>\\n\\t#include <displacementmap_vertex>\\n\\t#include <project_vertex>\\n\\t#include <logdepthbuf_vertex>\\n\\t#include <clipping_planes_vertex>\\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\\n\\tvViewPosition = - mvPosition.xyz;\\n#endif\\n}\",meshnormal_frag:\"#define NORMAL\\nuniform float opacity;\\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\\n\\tvarying vec3 vViewPosition;\\n#endif\\n#include <packing>\\n#include <uv_pars_fragment>\\n#include <normal_pars_fragment>\\n#include <bumpmap_pars_fragment>\\n#include <normalmap_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\\t#include <clipping_planes_fragment>\\n\\t#include <logdepthbuf_fragment>\\n\\t#include <normal_fragment_begin>\\n\\t#include <normal_fragment_maps>\\n\\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\\n}\",meshphong_vert:\"#define PHONG\\nvarying vec3 vViewPosition;\\n#include <common>\\n#include <uv_pars_vertex>\\n#include <uv2_pars_vertex>\\n#include <displacementmap_pars_vertex>\\n#include <envmap_pars_vertex>\\n#include <color_pars_vertex>\\n#include <fog_pars_vertex>\\n#include <normal_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <shadowmap_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\\t#include <uv_vertex>\\n\\t#include <uv2_vertex>\\n\\t#include <color_vertex>\\n\\t#include <beginnormal_vertex>\\n\\t#include <morphnormal_vertex>\\n\\t#include <skinbase_vertex>\\n\\t#include <skinnormal_vertex>\\n\\t#include <defaultnormal_vertex>\\n\\t#include <normal_vertex>\\n\\t#include <begin_vertex>\\n\\t#include <morphtarget_vertex>\\n\\t#include <skinning_vertex>\\n\\t#include <displacementmap_vertex>\\n\\t#include <project_vertex>\\n\\t#include <logdepthbuf_vertex>\\n\\t#include <clipping_planes_vertex>\\n\\tvViewPosition = - mvPosition.xyz;\\n\\t#include <worldpos_vertex>\\n\\t#include <envmap_vertex>\\n\\t#include <shadowmap_vertex>\\n\\t#include <fog_vertex>\\n}\",meshphong_frag:\"#define PHONG\\nuniform vec3 diffuse;\\nuniform vec3 emissive;\\nuniform vec3 specular;\\nuniform float shininess;\\nuniform float opacity;\\n#include <common>\\n#include <packing>\\n#include <dithering_pars_fragment>\\n#include <color_pars_fragment>\\n#include <uv_pars_fragment>\\n#include <uv2_pars_fragment>\\n#include <map_pars_fragment>\\n#include <alphamap_pars_fragment>\\n#include <alphatest_pars_fragment>\\n#include <aomap_pars_fragment>\\n#include <lightmap_pars_fragment>\\n#include <emissivemap_pars_fragment>\\n#include <envmap_common_pars_fragment>\\n#include <envmap_pars_fragment>\\n#include <cube_uv_reflection_fragment>\\n#include <fog_pars_fragment>\\n#include <bsdfs>\\n#include <lights_pars_begin>\\n#include <normal_pars_fragment>\\n#include <lights_phong_pars_fragment>\\n#include <shadowmap_pars_fragment>\\n#include <bumpmap_pars_fragment>\\n#include <normalmap_pars_fragment>\\n#include <specularmap_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\\t#include <clipping_planes_fragment>\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\\n\\tvec3 totalEmissiveRadiance = emissive;\\n\\t#include <logdepthbuf_fragment>\\n\\t#include <map_fragment>\\n\\t#include <color_fragment>\\n\\t#include <alphamap_fragment>\\n\\t#include <alphatest_fragment>\\n\\t#include <specularmap_fragment>\\n\\t#include <normal_fragment_begin>\\n\\t#include <normal_fragment_maps>\\n\\t#include <emissivemap_fragment>\\n\\t#include <lights_phong_fragment>\\n\\t#include <lights_fragment_begin>\\n\\t#include <lights_fragment_maps>\\n\\t#include <lights_fragment_end>\\n\\t#include <aomap_fragment>\\n\\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\\n\\t#include <envmap_fragment>\\n\\t#include <output_fragment>\\n\\t#include <tonemapping_fragment>\\n\\t#include <encodings_fragment>\\n\\t#include <fog_fragment>\\n\\t#include <premultiplied_alpha_fragment>\\n\\t#include <dithering_fragment>\\n}\",meshphysical_vert:\"#define STANDARD\\nvarying vec3 vViewPosition;\\n#ifdef USE_TRANSMISSION\\n\\tvarying vec3 vWorldPosition;\\n#endif\\n#include <common>\\n#include <uv_pars_vertex>\\n#include <uv2_pars_vertex>\\n#include <displacementmap_pars_vertex>\\n#include <color_pars_vertex>\\n#include <fog_pars_vertex>\\n#include <normal_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <shadowmap_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\\t#include <uv_vertex>\\n\\t#include <uv2_vertex>\\n\\t#include <color_vertex>\\n\\t#include <beginnormal_vertex>\\n\\t#include <morphnormal_vertex>\\n\\t#include <skinbase_vertex>\\n\\t#include <skinnormal_vertex>\\n\\t#include <defaultnormal_vertex>\\n\\t#include <normal_vertex>\\n\\t#include <begin_vertex>\\n\\t#include <morphtarget_vertex>\\n\\t#include <skinning_vertex>\\n\\t#include <displacementmap_vertex>\\n\\t#include <project_vertex>\\n\\t#include <logdepthbuf_vertex>\\n\\t#include <clipping_planes_vertex>\\n\\tvViewPosition = - mvPosition.xyz;\\n\\t#include <worldpos_vertex>\\n\\t#include <shadowmap_vertex>\\n\\t#include <fog_vertex>\\n#ifdef USE_TRANSMISSION\\n\\tvWorldPosition = worldPosition.xyz;\\n#endif\\n}\",meshphysical_frag:\"#define STANDARD\\n#ifdef PHYSICAL\\n\\t#define IOR\\n\\t#define SPECULAR\\n#endif\\nuniform vec3 diffuse;\\nuniform vec3 emissive;\\nuniform float roughness;\\nuniform float metalness;\\nuniform float opacity;\\n#ifdef IOR\\n\\tuniform float ior;\\n#endif\\n#ifdef SPECULAR\\n\\tuniform float specularIntensity;\\n\\tuniform vec3 specularColor;\\n\\t#ifdef USE_SPECULARINTENSITYMAP\\n\\t\\tuniform sampler2D specularIntensityMap;\\n\\t#endif\\n\\t#ifdef USE_SPECULARCOLORMAP\\n\\t\\tuniform sampler2D specularColorMap;\\n\\t#endif\\n#endif\\n#ifdef USE_CLEARCOAT\\n\\tuniform float clearcoat;\\n\\tuniform float clearcoatRoughness;\\n#endif\\n#ifdef USE_SHEEN\\n\\tuniform vec3 sheenColor;\\n\\tuniform float sheenRoughness;\\n\\t#ifdef USE_SHEENCOLORMAP\\n\\t\\tuniform sampler2D sheenColorMap;\\n\\t#endif\\n\\t#ifdef USE_SHEENROUGHNESSMAP\\n\\t\\tuniform sampler2D sheenRoughnessMap;\\n\\t#endif\\n#endif\\nvarying vec3 vViewPosition;\\n#include <common>\\n#include <packing>\\n#include <dithering_pars_fragment>\\n#include <color_pars_fragment>\\n#include <uv_pars_fragment>\\n#include <uv2_pars_fragment>\\n#include <map_pars_fragment>\\n#include <alphamap_pars_fragment>\\n#include <alphatest_pars_fragment>\\n#include <aomap_pars_fragment>\\n#include <lightmap_pars_fragment>\\n#include <emissivemap_pars_fragment>\\n#include <bsdfs>\\n#include <cube_uv_reflection_fragment>\\n#include <envmap_common_pars_fragment>\\n#include <envmap_physical_pars_fragment>\\n#include <fog_pars_fragment>\\n#include <lights_pars_begin>\\n#include <normal_pars_fragment>\\n#include <lights_physical_pars_fragment>\\n#include <transmission_pars_fragment>\\n#include <shadowmap_pars_fragment>\\n#include <bumpmap_pars_fragment>\\n#include <normalmap_pars_fragment>\\n#include <clearcoat_pars_fragment>\\n#include <roughnessmap_pars_fragment>\\n#include <metalnessmap_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\\t#include <clipping_planes_fragment>\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\\n\\tvec3 totalEmissiveRadiance = emissive;\\n\\t#include <logdepthbuf_fragment>\\n\\t#include <map_fragment>\\n\\t#include <color_fragment>\\n\\t#include <alphamap_fragment>\\n\\t#include <alphatest_fragment>\\n\\t#include <roughnessmap_fragment>\\n\\t#include <metalnessmap_fragment>\\n\\t#include <normal_fragment_begin>\\n\\t#include <normal_fragment_maps>\\n\\t#include <clearcoat_normal_fragment_begin>\\n\\t#include <clearcoat_normal_fragment_maps>\\n\\t#include <emissivemap_fragment>\\n\\t#include <lights_physical_fragment>\\n\\t#include <lights_fragment_begin>\\n\\t#include <lights_fragment_maps>\\n\\t#include <lights_fragment_end>\\n\\t#include <aomap_fragment>\\n\\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\\n\\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\\n\\t#include <transmission_fragment>\\n\\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\\n\\t#ifdef USE_CLEARCOAT\\n\\t\\tfloat dotNVcc = saturate( dot
947( geometry.clearcoatNormal, geometry.viewDir ) );\\n\\t\\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\\n\\t\\toutgoingLight = outgoingLight * ( 1.0 - clearcoat * Fcc ) + clearcoatSpecular * clearcoat;\\n\\t#endif\\n\\t#include <output_fragment>\\n\\t#include <tonemapping_fragment>\\n\\t#include <encodings_fragment>\\n\\t#include <fog_fragment>\\n\\t#include <premultiplied_alpha_fragment>\\n\\t#include <dithering_fragment>\\n}\",meshtoon_vert:\"#define TOON\\nvarying vec3 vViewPosition;\\n#include <common>\\n#include <uv_pars_vertex>\\n#include <uv2_pars_vertex>\\n#include <displacementmap_pars_vertex>\\n#include <color_pars_vertex>\\n#include <fog_pars_vertex>\\n#include <normal_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <shadowmap_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\\t#include <uv_vertex>\\n\\t#include <uv2_vertex>\\n\\t#include <color_vertex>\\n\\t#include <beginnormal_vertex>\\n\\t#include <morphnormal_vertex>\\n\\t#include <skinbase_vertex>\\n\\t#include <skinnormal_vertex>\\n\\t#include <defaultnormal_vertex>\\n\\t#include <normal_vertex>\\n\\t#include <begin_vertex>\\n\\t#include <morphtarget_vertex>\\n\\t#include <skinning_vertex>\\n\\t#include <displacementmap_vertex>\\n\\t#include <project_vertex>\\n\\t#include <logdepthbuf_vertex>\\n\\t#include <clipping_planes_vertex>\\n\\tvViewPosition = - mvPosition.xyz;\\n\\t#include <worldpos_vertex>\\n\\t#include <shadowmap_vertex>\\n\\t#include <fog_vertex>\\n}\",meshtoon_frag:\"#define TOON\\nuniform vec3 diffuse;\\nuniform vec3 emissive;\\nuniform float opacity;\\n#include <common>\\n#include <packing>\\n#include <dithering_pars_fragment>\\n#include <color_pars_fragment>\\n#include <uv_pars_fragment>\\n#include <uv2_pars_fragment>\\n#include <map_pars_fragment>\\n#include <alphamap_pars_fragment>\\n#include <alphatest_pars_fragment>\\n#include <aomap_pars_fragment>\\n#include <lightmap_pars_fragment>\\n#include <emissivemap_pars_fragment>\\n#include <gradientmap_pars_fragment>\\n#include <fog_pars_fragment>\\n#include <bsdfs>\\n#include <lights_pars_begin>\\n#include <normal_pars_fragment>\\n#include <lights_toon_pars_fragment>\\n#include <shadowmap_pars_fragment>\\n#include <bumpmap_pars_fragment>\\n#include <normalmap_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\\t#include <clipping_planes_fragment>\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\\n\\tvec3 totalEmissiveRadiance = emissive;\\n\\t#include <logdepthbuf_fragment>\\n\\t#include <map_fragment>\\n\\t#include <color_fragment>\\n\\t#include <alphamap_fragment>\\n\\t#include <alphatest_fragment>\\n\\t#include <normal_fragment_begin>\\n\\t#include <normal_fragment_maps>\\n\\t#include <emissivemap_fragment>\\n\\t#include <lights_toon_fragment>\\n\\t#include <lights_fragment_begin>\\n\\t#include <lights_fragment_maps>\\n\\t#include <lights_fragment_end>\\n\\t#include <aomap_fragment>\\n\\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\\n\\t#include <output_fragment>\\n\\t#include <tonemapping_fragment>\\n\\t#include <encodings_fragment>\\n\\t#include <fog_fragment>\\n\\t#include <premultiplied_alpha_fragment>\\n\\t#include <dithering_fragment>\\n}\",points_vert:\"uniform float size;\\nuniform float scale;\\n#include <common>\\n#include <color_pars_vertex>\\n#include <fog_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\\t#include <color_vertex>\\n\\t#include <begin_vertex>\\n\\t#include <morphtarget_vertex>\\n\\t#include <project_vertex>\\n\\tgl_PointSize = size;\\n\\t#ifdef USE_SIZEATTENUATION\\n\\t\\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\\n\\t\\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\\n\\t#endif\\n\\t#include <logdepthbuf_vertex>\\n\\t#include <clipping_planes_vertex>\\n\\t#include <worldpos_vertex>\\n\\t#include <fog_vertex>\\n}\",points_frag:\"uniform vec3 diffuse;\\nuniform float opacity;\\n#include <common>\\n#include <color_pars_fragment>\\n#include <map_particle_pars_fragment>\\n#include <alphatest_pars_fragment>\\n#include <fog_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\\t#include <clipping_planes_fragment>\\n\\tvec3 outgoingLight = vec3( 0.0 );\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\t#include <logdepthbuf_fragment>\\n\\t#include <map_particle_fragment>\\n\\t#include <color_fragment>\\n\\t#include <alphatest_fragment>\\n\\toutgoingLight = diffuseColor.rgb;\\n\\t#include <output_fragment>\\n\\t#include <tonemapping_fragment>\\n\\t#include <encodings_fragment>\\n\\t#include <fog_fragment>\\n\\t#include <premultiplied_alpha_fragment>\\n}\",shadow_vert:\"#include <common>\\n#include <fog_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <shadowmap_pars_vertex>\\nvoid main() {\\n\\t#include <beginnormal_vertex>\\n\\t#include <morphnormal_vertex>\\n\\t#include <skinbase_vertex>\\n\\t#include <skinnormal_vertex>\\n\\t#include <defaultnormal_vertex>\\n\\t#include <begin_vertex>\\n\\t#include <morphtarget_vertex>\\n\\t#include <skinning_vertex>\\n\\t#include <project_vertex>\\n\\t#include <worldpos_vertex>\\n\\t#include <shadowmap_vertex>\\n\\t#include <fog_vertex>\\n}\",shadow_frag:\"uniform vec3 color;\\nuniform float opacity;\\n#include <common>\\n#include <packing>\\n#include <fog_pars_fragment>\\n#include <bsdfs>\\n#include <lights_pars_begin>\\n#include <shadowmap_pars_fragment>\\n#include <shadowmask_pars_fragment>\\nvoid main() {\\n\\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\\n\\t#include <tonemapping_fragment>\\n\\t#include <encodings_fragment>\\n\\t#include <fog_fragment>\\n}\",sprite_vert:\"uniform float rotation;\\nuniform vec2 center;\\n#include <common>\\n#include <uv_pars_vertex>\\n#include <fog_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\\t#include <uv_vertex>\\n\\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\\n\\tvec2 scale;\\n\\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\\n\\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\\n\\t#ifndef USE_SIZEATTENUATION\\n\\t\\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\\n\\t\\tif ( isPerspective ) scale *= - mvPosition.z;\\n\\t#endif\\n\\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\\n\\tvec2 rotatedPosition;\\n\\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\\n\\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\\n\\tmvPosition.xy += rotatedPosition;\\n\\tgl_Position = projectionMatrix * mvPosition;\\n\\t#include <logdepthbuf_vertex>\\n\\t#include <clipping_planes_vertex>\\n\\t#include <fog_vertex>\\n}\",sprite_frag:\"uniform vec3 diffuse;\\nuniform float opacity;\\n#include <common>\\n#include <uv_pars_fragment>\\n#include <map_pars_fragment>\\n#include <alphamap_pars_fragment>\\n#include <alphatest_pars_fragment>\\n#include <fog_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\\t#include <clipping_planes_fragment>\\n\\tvec3 outgoingLight = vec3( 0.0 );\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\t#include <logdepthbuf_fragment>\\n\\t#include <map_fragment>\\n\\t#include <alphamap_fragment>\\n\\t#include <alphatest_fragment>\\n\\toutgoingLight = diffuseColor.rgb;\\n\\t#include <output_fragment>\\n\\t#include <tonemapping_fragment>\\n\\t#include <encodings_fragment>\\n\\t#include <fog_fragment>\\n}\"},qo={common:{diffuse:{value:new Fr(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new $n},uv2Transform:{value:new $n}
vendor: 5,703 bytes, line 947
947,alphaMap:{value:null},alphaTest:{value:0}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new Zn(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Fr(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Fr(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new $n}},sprite:{diffuse:{value:new Fr(16777215)},opacity:{value:1},center:{value:new Zn(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new $n}}},Xo={basic:{uniforms:To([qo.common,qo.specularmap,qo.envmap,qo.aomap,qo.lightmap,qo.fog]),vertexShader:Wo.meshbasic_vert,fragmentShader:Wo.meshbasic_frag},lambert:{uniforms:To([qo.common,qo.specularmap,qo.envmap,qo.aomap,qo.lightmap,qo.emissivemap,qo.fog,qo.lights,{emissive:{value:new Fr(0)}}]),vertexShader:Wo.meshlambert_vert,fragmentShader:Wo.meshlambert_frag},phong:{uniforms:To([qo.common,qo.specularmap,qo.envmap,qo.aomap,qo.lightmap,qo.emissivemap,qo.bumpmap,qo.normalmap,qo.displacementmap,qo.fog,qo.lights,{emissive:{value:new Fr(0)},specular:{value:new Fr(1118481)},shininess:{value:30}}]),vertexShader:Wo.meshphong_vert,fragmentShader:Wo.meshphong_frag},standard:{uniforms:To([qo.common,qo.envmap,qo.aomap,qo.lightmap,qo.emissivemap,qo.bumpmap,qo.normalmap,qo.displacementmap,qo.roughnessmap,qo.metalnessmap,qo.fog,qo.lights,{emissive:{value:new Fr(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Wo.meshphysical_vert,fragmentShader:Wo.meshphysical_frag},toon:{uniforms:To([qo.common,qo.aomap,qo.lightmap,qo.emissivemap,qo.bumpmap,qo.normalmap,qo.displacementmap,qo.gradientmap,qo.fog,qo.lights,{emissive:{value:new Fr(0)}}]),vertexShader:Wo.meshtoon_vert,fragmentShader:Wo.meshtoon_frag},matcap:{uniforms:To([qo.common,qo.bumpmap,qo.normalmap,qo.displacementmap,qo.fog,{matcap:{value:null}}]),vertexShader:Wo.meshmatcap_vert,fragmentShader:Wo.meshmatcap_frag},points:{uniforms:To([qo.points,qo.fog]),vertexShader:Wo.points_vert,fragmentShader:Wo.points_frag},dashed:{uniforms:To([qo.common,qo.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Wo.linedashed_vert,fragmentShader:Wo.linedashed_frag},depth:{uniforms:To([qo.common,qo.displacementmap]),vertexShader:Wo.depth_vert,fragmentShader:Wo.depth_frag},normal:{uniforms:To([qo.common,qo.bumpmap,qo.normalmap,qo.displacementmap,{opacity:{value:1}}]),vertexShader:Wo.meshnormal_vert,fragmentShader:Wo.meshnormal_frag},sprite:{uniforms:To([qo.sprite,qo.fog]),vertexShader:Wo.sprite_vert,fragmentShader:Wo.sprite_frag},background:{uniforms:{uvTransform:{value:new $n},t2D:{value:null}},vertexShader:Wo.background_vert,fragmentShader:Wo.background_frag},cube:{uniforms:To([qo.envmap,{opacity:{value:1}}]),vertexShader:Wo.cube_vert,fragmentShader:Wo.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Wo.equirect_vert,fragmentShader:Wo.equirect_frag},distanceRGBA:{uniforms:To([qo.common,qo.displacementmap,{referencePosition:{value:new pi},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Wo.distanceRGBA_vert,fragmentShader:Wo.distanceRGBA_frag},shadow:{uniforms:To([qo.lights,qo.fog,{color:{value:new Fr(0)},opacity:{value:1}}]),vertexShader:Wo.shadow_vert,fragmentShader:Wo.shadow_frag}};function Yo(e,t,n,i,r){const o=new Fr(0);let s,a,l=0,c=null,u=0,h=null;function d(e,t){n.buffers.color.setClear(e.r,e.g,e.b,t,r)}return{getClearColor:function(){return o},setClearColor:function(e,t=1){o.set(e),l=t,d(o,l)},getClearAlpha:function(){return l},setClearAlpha:function(e){l=e,d(o,l)},render:function(n,r){let p=!1,g=!0===r.isScene?r.background:null;g&&g.isTexture&&(g=t.get(g));const v=e.xr,y=v.getSession&&v.getSession();y&&\"additive\"===y.environmentBlendMode&&(g=null),null===g?d(o,l):g&&g.isColor&&(d(g,1),p=!0),(e.autoClear||p)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),g&&(g.isCubeTexture||g.mapping===ce)?(void 0===a&&(a=new wo(new So(1,1,1),new Lo({name:\"Backgroun
947dCubeMaterial\",uniforms:Eo(Xo.cube.uniforms),vertexShader:Xo.cube.vertexShader,fragmentShader:Xo.cube.fragmentShader,side:m,depthTest:!1,depthWrite:!1,fog:!1})),a.geometry.deleteAttribute(\"normal\"),a.geometry.deleteAttribute(\"uv\"),a.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(a.material,\"envMap\",{get:function(){return this.uniforms.envMap.value}}),i.update(a)),a.material.uniforms.envMap.value=g,a.material.uniforms.flipEnvMap.value=g.isCubeTexture&&!1===g.isRenderTargetTexture?-1:1,c===g&&u===g.version&&h===e.toneMapping||(a.material.needsUpdate=!0,c=g,u=g.version,h=e.toneMapping),n.unshift(a,a.geometry,a.material,0,0,null)):g&&g.isTexture&&(void 0===s&&(s=new wo(new jo(2,2),new Lo({name:\"BackgroundMaterial\",uniforms:Eo(Xo.background.uniforms),vertexShader:Xo.background.vertexShader,fragmentShader:Xo.background.fragmentShader,side:f,depthTest:!1,depthWrite:!1,fog:!1})),s.geometry.deleteAttribute(\"normal\"),Object.defineProperty(s.material,\"map\",{get:function(){return this.uniforms.t2D.value}}),i.update(s)),s.material.uniforms.t2D.value=g,!0===g.matrixAutoUpdate&&g.updateMatrix(),s.material.uniforms.uvTransform.value.copy(g.matrix),c===g&&u===g.version&&h===e.toneMapping||(s.material.needsUpdate=!0,c=g,u=g.version,h=e.toneMapping),n.unshift(s,s.geometry,s.material,0,0,null))}}}function Jo(e,t,n,i){const r=e.getParameter(34921),o=i.isWebGL2?null:t.get(\"OES_vertex_array_object\"),s=i.isWebGL2||null!==o,a={},l=d(null);let c=l;function u(t){return i.isWebGL2?e.bindVertexArray(t):o.bindVertexArrayOES(t)}function h(t){return i.isWebGL2?e.deleteVertexArray(t):o.deleteVertexArrayOES(t)}function d(e){const t=[],n=[],i=[];for(let e=0;e<r;e++)t[e]=0,n[e]=0,i[e]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:t,enabledAttributes:n,attributeDivisors:i,object:e,attributes:{},index:null}}function p(){const e=c.newAttributes;for(let t=0,n=e.length;t<n;t++)e[t]=0}function f(e){m(e,0)}function m(n,r){const o=c.newAttributes,s=c.enabledAttributes,a=c.attributeDivisors;o[n]=1,0===s[n]&&(e.enableVertexAttribArray(n),s[n]=1),a[n]!==r&&((i.isWebGL2?e:t.get(\"ANGLE_instanced_arrays\"))[i.isWebGL2?\"vertexAttribDivisor\":\"vertexAttribDivisorANGLE\"](n,r),a[n]=r)}function g(){const t=c.newAttributes,n=c.enabledAttributes;for(let i=0,r=n.length;i<r;i++)n[i]!==t[i]&&(e.disableVertexAttribArray(i),n[i]=0)}function v(t,n,r,o,s,a){!0!==i.isWebGL2||5124!==r&&5125!==r?e.vertexAttribPointer(t,n,r,o,s,a):e.vertexAttribIPointer(t,n,r,s,a)}function y(){x(),c!==l&&(c=l,u(c.object))}function x(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:function(r,l,h,y,x){let _=!1;if(s){const t=function(t,n,r){const s=!0===r.wireframe;let l=a[t.id];void 0===l&&(l={},a[t.id]=l);let c=l[n.id];void 0===c&&(c={},l[n.id]=c);let u=c[s];return void 0===u&&(u=d(i.isWebGL2?e.createVertexArray():o.createVertexArrayOES()),c[s]=u),u}(y,h,l);c!==t&&(c=t,u(c.object)),_=function(e,t){const n=c.attributes,i=e.attributes;let r=0;for(const e in i){const t=n[e],o=i[e];if(void 0===t)return!0;if(t.attribute!==o)return!0;if(t.data!==o.data)return!0;r++}return c.attributesNum!==r||c.index!==t}(y,x),_&&function(e,t){const n={},i=e.attributes;let r=0;for(const e in i){const t=i[e],o={};o.attribute=t,t.data&&(o.data=t.data),n[e]=o,r++}c.attributes=n,c.attributesNum=r,c.index=t}(y,x)}else{const e=!0===l.wireframe;c.geometry===y.id&&c.program===h.id&&c.wireframe===e||(c.geometry=y.id,c.program=h.id,c.wireframe=e,_=!0)}!0===r.isInstancedMesh&&(_=!0),null!==x&&n.update(x,34963),_&&(function(r,o,s,a){if(!1===i.isWebGL2&&(r.isInstancedMesh||a.isInstancedBufferGeometry)&&null===t.get(\"ANGLE_instanced_arrays\"))return;p();const l=a.attributes,c=s.getAttributes(),u=o.defaultAttributeValues;for(const t in c){const i=c[t];if(i.location>=0){let o=l[t];if(void 0===o&&(\"instanceMatrix\"===t&&r.instanceMatrix&&(o=r.instanceMatrix),\"instanceColor\"===t&&r.instanceColor&&(o=r.instanceColor)),void 0!==o){const t=o.normalized,s=o.itemSize,l=n.get(o);if(void 0===l)continue;const c=l.buffer,u=l.type,h=l.bytesPerElement;if(o.isInterleavedBufferAttribute){const n=o.data,l=n.stride,d=o.offset;if(n&&n.isInstancedInterleavedBuffer){for(let e=0;e<i.locationSize;e++)m(i.location+e,n.meshPerAttribute);!0!==r.isInstancedMesh&&void 0===a._maxInstanceCount&&(a._maxInstanceCount=n.meshPerAttribute*n.count)}else for(let e=0;e<i.locationSize;e++)f(i.location+e);e.bindBuffer(34962,c);for(let e=0;e<i.locationSize;e++)v(i.location+e,s/i.locationSize,u,t,l*h,(d+s/i.locationSize*e)*h)}else{if(o.isInstancedBufferAttribute){for(let e=0;e<i.locationSize;e++)m(i.location+e,o.meshPerAttribute);!0!==r.isInstancedMesh&&void 0===a._maxInstanceCount&&(a._maxInstanceCount=o.meshPerAttribute*o.count)}
vendor: 1,075 bytes, line 947
947else for(let e=0;e<i.locationSize;e++)f(i.location+e);e.bindBuffer(34962,c);for(let e=0;e<i.locationSize;e++)v(i.location+e,s/i.locationSize,u,t,s*h,s/i.locationSize*e*h)}}else if(void 0!==u){const n=u[t];if(void 0!==n)switch(n.length){case 2:e.vertexAttrib2fv(i.location,n);break;case 3:e.vertexAttrib3fv(i.location,n);break;case 4:e.vertexAttrib4fv(i.location,n);break;default:e.vertexAttrib1fv(i.location,n)}}}}g()}(r,l,h,y),null!==x&&e.bindBuffer(34963,n.get(x).buffer))},reset:y,resetDefaultState:x,dispose:function(){y();for(const e in a){const t=a[e];for(const e in t){const n=t[e];for(const e in n)h(n[e].object),delete n[e];delete t[e]}delete a[e]}},releaseStatesOfGeometry:function(e){if(void 0===a[e.id])return;const t=a[e.id];for(const e in t){const n=t[e];for(const e in n)h(n[e].object),delete n[e];delete t[e]}delete a[e.id]},releaseStatesOfProgram:function(e){for(const t in a){const n=a[t];if(void 0===n[e.id])continue;const i=n[e.id];for(const e in i)h(i[e].object),delete i[e];delete n[e.id]}},initAttributes:p,enableAttribute:f,disableUnusedAttributes:g}}
947function Zo(e,t,n,i){const r=i.isWebGL2;let o;this.setMode=function(e){o=e},this.render=function(t,i){e.drawArrays(o,t,i),n.update(i,o,1)},this.renderInstances=function(i,s,a){if(0===a)return;let l,c;if(r)l=e,c=\"drawArraysInstanced\";else if(l=t.get(\"ANGLE_instanced_arrays\"),c=\"drawArraysInstancedANGLE\",null===l)return void console.error(\"THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.\");l[c](o,i,s,a),n.update(s,o,a)}}function $o(e,t,n){let i;function r(t){if(\"highp\"===t){if(e.getShaderPrecisionFormat(35633,36338).precision>0&&e.getShaderPrecisionFormat(35632,36338).precision>0)return\"highp\";t=\"mediump\"}return\"mediump\"===t&&e.getShaderPrecisionFormat(35633,36337).precision>0&&e.getShaderPrecisionFormat(35632,36337).precision>0?\"mediump\":\"lowp\"}const o=\"undefined\"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||\"undefined\"!=typeof WebGL2ComputeRenderingContext&&e instanceof WebGL2ComputeRenderingContext;let s=void 0!==n.precision?n.precision:\"highp\";const a=r(s);a!==s&&(console.warn(\"THREE.WebGLRenderer:\",s,\"not supported, using\",a,\"instead.\"),s=a);const l=o||t.has(\"WEBGL_draw_buffers\"),c=!0===n.logarithmicDepthBuffer,u=e.getParameter(34930),h=e.getParameter(35660),d=e.getParameter(3379),p=e.getParameter(34076),f=e.getParameter(34921),m=e.getParameter(36347),g=e.getParameter(36348),v=e.getParameter(36349),y=h>0,x=o||t.has(\"OES_texture_float\");return{isWebGL2:o,drawBuffers:l,getMaxAnisotropy:function(){if(void 0!==i)return i;if(!0===t.has(\"EXT_texture_filter_anisotropic\")){const n=t.get(\"EXT_texture_filter_anisotropic\");i=e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i},getMaxPrecision:r,precision:s,logarithmicDepthBuffer:c,maxTextures:u,maxVertexTextures:h,maxTextureSize:d,maxCubemapSize:p,maxAttributes:f,maxVertexUniforms:m,maxVaryings:g,maxFragmentUniforms:v,vertexTextures:y,floatFragmentTextures:x,floatVertexTextures:y&&x,maxSamples:o?e.getParameter(36183):0}}function Ko(e){const t=this;let n=null,i=0,r=!1,o=!1;const s=new zo,a=new $n,l={value:null,needsUpdate:!1};function c(){l.value!==n&&(l.value=n,l.needsUpdate=i>0),t.numPlanes=i,t.numIntersection=0}function u(e,n,i,r){const o=null!==e?e.length:0;let c=null;if(0!==o){if(c=l.value,!0!==r||null===c){const t=i+4*o,r=n.matrixWorldInverse;a.getNormalMatrix(r),(null===c||c.length<t)&&(c=new Float32Array(t));for(let t=0,n=i;t!==o;++t,n+=4)s.copy(e[t]).applyMatrix4(r,a),s.normal.toArray(c,n),c[n+3]=s.constant}l.value=c,l.needsUpdate=!0}return t.numPlanes=o,t.numIntersection=0,c}this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(e,t,o){const s=0!==e.length||t||0!==i||r;return r=t,n=u(e,o,0),i=e.length,s},this.beginShadows=function(){o=!0,u(null)},this.endShadows=function(){o=!1,c()},this.setState=function(t,s,a){const h=t.clippingPlanes,d=t.clipIntersection,p=t.clipShadows,f=e.get(t);if(!r||null===h||0===h.length||o&&!p)o?u(null):c();else{const e=o?0:i,t=4*e;let r=f.clippingState||null;l.value=r,r=u(h,s,t,a);for(let e=0;e!==t;++e)r[e]=n[e];f.clippingState=r,this.numIntersection=d?this.numPlanes:0,this.numPlanes+=e}}}function Qo(e){let t=new WeakMap;function n(e,t){return t===ae?e.mapping=oe:t===le&&(e.mapping=se),e}function i(e){const n=e.target;n.removeEventListener(\"dispose\",i);const r=t.get(n);void 0!==r&&(t.delete(n),r.dispose())}return{get:function(r){if(r&&r.isTexture&&!1===r.isRenderTargetTexture){const o=r.mapping;if(o===ae||o===le){if(t.has(r))return n(t.get(r).texture,r.mapping);{const o=r.image;if(o&&o.height>0){const s=e.getRenderTarget(),a=new Io(o.height/2);return a.fromEquirectangularTexture(e,r),t.set(r,a),e.setRenderTarget(s),r.addEventListener(\"dispose\",i),n(a.texture,r.mapping)}return null}}}return r},dispose:function(){t=new WeakMap}}}Xo.physical={uniforms:To([Xo.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new Zn(1,1)},clearcoatNormalMap:{value:null},sheen:{value:0},sheenColor:{value:new Fr(0)},sheenColorMap:{value:null},sheenRoughness:{value:0},sheenRoughnessMap:{value:null},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new Zn},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new Fr(0)},specularIntensity:{value:0},specularIntensityMap:{value:null},specularColor:{value:new Fr(1,1,1)},specularColorMap:{value:null}}]),vertexShader:Wo.meshphysical_vert,fragmentShader:Wo.meshphysical_frag};class es extends Co{constructor(e=-1,t=1,n=1,i=-1,r=.1,o=2e3){super(),this.type=\"Orthogra
947phicCamera\",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=i,this.near=r,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=null===e.view?null:Object.assign({},e.view),this}setViewOffset(e,t,n,i,r,o){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let r=n-e,o=n+e,s=i+t,a=i-t;if(null!==this.view&&this.view.enabled){const e=(this.right-this.left)/this.view.fullWidth/this.zoom,t=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=e*this.view.offsetX,o=r+e*this.view.width,s-=t*this.view.offsetY,a=s-t*this.view.height}this.projectionMatrix.makeOrthographic(r,o,s,a,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}}es.prototype.isOrthographicCamera=!0;class ts extends Lo{constructor(e){super(e),this.type=\"RawShaderMaterial\"}}ts.prototype.isRawShaderMaterial=!0;const ns=Math.pow(2,8),is=[.125,.215,.35,.446,.526,.582],rs=5+is.length,os={[Zt]:0,[$t]:1,[Qt]:2,[tn]:3,[nn]:4,[rn]:5,[Kt]:6},ss=new es,{_lodPlanes:as,_sizeLods:ls,_sigmas:cs}=vs(),us=new Fr;let hs=null;const ds=(1+Math.sqrt(5))/2,ps=1/ds,fs=[new pi(1,1,1),new pi(-1,1,1),new pi(1,1,-1),new pi(-1,1,-1),new pi(0,ds,ps),new pi(0,ds,-ps),new pi(ps,0,ds),new pi(-ps,0,ds),new pi(ds,ps,0),new pi(-ds,ps,0)];class ms{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._blurMaterial=function(e){const t=new Float32Array(20),n=new pi(0,1,0);return new ts({name:\"SphericalGaussianBlur\",defines:{n:20},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:t},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:n},inputEncoding:{value:os[Zt]},outputEncoding:{value:os[Zt]}},vertexShader:\"\\n\\n\\t\\tprecision mediump float;\\n\\t\\tprecision mediump int;\\n\\n\\t\\tattribute vec3 position;\\n\\t\\tattribute vec2 uv;\\n\\t\\tattribute float faceIndex;\\n\\n\\t\\tvarying vec3 vOutputDirection;\\n\\n\\t\\t// RH coordinate system; PMREM face-indexing convention\\n\\t\\tvec3 getDirection( vec2 uv, float face ) {\\n\\n\\t\\t\\tuv = 2.0 * uv - 1.0;\\n\\n\\t\\t\\tvec3 direction = vec3( uv, 1.0 );\\n\\n\\t\\t\\tif ( face == 0.0 ) {\\n\\n\\t\\t\\t\\tdirection = direction.zyx; // ( 1, v, u ) pos x\\n\\n\\t\\t\\t} else if ( face == 1.0 ) {\\n\\n\\t\\t\\t\\tdirection = direction.xzy;\\n\\t\\t\\t\\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\\n\\n\\t\\t\\t} else if ( face == 2.0 ) {\\n\\n\\t\\t\\t\\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\\n\\n\\t\\t\\t} else if ( face == 3.0 ) {\\n\\n\\t\\t\\t\\tdirection = direction.zyx;\\n\\t\\t\\t\\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\\n\\n\\t\\t\\t} else if ( face == 4.0 ) {\\n\\n\\t\\t\\t\\tdirection = direction.xzy;\\n\\t\\t\\t\\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\\n\\n\\t\\t\\t} else if ( face == 5.0 ) {\\n\\n\\t\\t\\t\\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\\n\\n\\t\\t\\t}\\n\\n\\t\\t\\treturn direction;\\n\\n\\t\\t}\\n\\n\\t\\tvoid main() {\\n\\n\\t\\t\\tvOutputDirection = getDirection( uv, faceIndex );\\n\\t\\t\\tgl_Position = vec4( position, 1.0 );\\n\\n\\t\\t}\\n\\t\",fragmentShader:\"\\n\\n\\t\\t\\tprecision mediump float;\\n\\t\\t\\tprecision mediump int;\\n\\n\\t\\t\\tvarying vec3 vOutputDirection;\\n\\n\\t\\t\\tuniform sampler2D envMap;\\n\\t\\t\\tuniform int samples;\\n\\t\\t\\tuniform float weights[ n ];\\n\\t\\t\\tuniform bool latitudinal;\\n\\t\\t\\tuniform float dTheta;\\n\\t\\t\\tuniform float mipInt;\\n\\t\\t\\tuniform vec3 poleAxis;\\n\\n\\t\\t\\t\\n\\n\\t\\tuniform int inputEncoding;\\n\\t\\tuniform int outputEncoding;\\n\\n\\t\\t#include <encodings_pars_fragment>\\n\\n\\t\\tvec4 inputTexelToLinear( vec4 value ) {\\n\\n\\t\\t\\tif ( inputEncoding == 0 ) {\\n\\n\\t\\t\\t\\treturn value;\\n\\n\\t\\t\\t} else if ( inputEncoding == 1 ) {\\n\\n\\t\\t\\t\\treturn sRGBToLinear( value );\\n\\n\\t\\t\\t} else if ( inputEncoding == 2 ) {\\n\\n\\t\\t\\t\\treturn RGBEToLinear( value );\\n\\n\\t\\t\\t} else if ( inputEncoding == 3 ) {\\n\\n\\t\\t\\t\\treturn RGBMToLinear( value, 7.0 );\\n\\n\\t\\t\\t} else if ( inputEncoding == 4 ) {\\n\\n\\t\\t\\t\\treturn RGBMToLinear( value, 16.0 );\\n\\n\\t\\t\\t} else if ( inputEncoding == 5 ) {\\n\\n\\t\\t\\t\\treturn RGBDToLinear( value, 256.0 );\\n\\n\\t\\t\\t} else {\\n\\n\\t\\t\\t\\treturn GammaToLinear( value, 2.2 );\\n\\n\\t\\t\\t}\\n\\n\\t\\t}\\n\\n\\t\\tvec4 linearToOutputTexel( vec4 value ) {\\n\\n\\t\\t\\tif ( outputEncoding == 0 ) {\\n\\n\\t\\t\\t\\treturn value;\\n\\n\\t\\t\\t} else if ( outputEncoding == 1 ) {\\n\\n\\t\\t\\t\\treturn LinearTosRGB( value );\\n\\n\\t\\t\\t} else if ( outputEncoding == 2 ) {\\n\\n\\t\\t\\t\\treturn LinearToRGBE( value );\\n\\n\\t\\t\\t} else if ( outputEncoding == 3 ) {\\n\\n\\t\\t\\t\\treturn LinearToRGBM( value, 7.0 );\\n\\n\\t\\t\\t} else if ( outputEncoding == 4 ) {\\n\\n\\t\\t\\t\\treturn LinearToRGBM( value, 16.0 );\\n\\n\\t\\t\\t} else if ( outputEncoding == 5 ) {\\n\\n\\t\\t\\t\\treturn LinearToRGBD( value, 256.0 );\\n\\n\\t\\t\\t} else {\\n\\n\\t\\t\\t\\treturn LinearToGamma( value, 2.2 );\\n\\n\\t\\t\\t}\\n\\n\\t\\t}\\n\\n\\t\\tvec4 envMapTexelToLinear( vec4 color ) {\\n\\n\\t\\t\\treturn inputTexelToLinear( color );\\n\\n\\t\\t}\\n\\t\\n\\n\\t\\t\\t#define ENVMAP_TYPE_CUBE_UV\\n\\t\\t\\t#include <cube_uv_reflection_fragment>\\n\\n\\t\\t\\tvec3 getSample( float theta, vec3 axis ) {\\n\\n\\t\\t\\t\\tfloat cosTheta = cos( theta );\\n\\t\\t\\t\\t// Rodrigues' axis-angle rotation\\n\\t\\t\\t\\tvec3 sampleDirection = vOutputDirection * cosTheta\\n\\t\\t\\t\\t\\t+ cross( axis, vOutputDirection ) * sin( theta )\\n\\t\\t\\t\\t\\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\\n\\n\\t\\t\\t\\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\\n\\n\\t\\t\\t}\\n\\n\\t\\t\\tvoid main() {\\n\\n\\t\\t\\t\\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\\n\\n\\t\\t\\t\\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\\n\\n\\t\\t\\t\\t\\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\\n\\n\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\taxis = normalize( axis );\\n\\n\\t\\t\\t\\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\\n\\t\\t\\t\\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\\n\\n\\t\\t\\t\\tfor ( int i = 1; i < n; i++ ) {\\n\\n\\t\\t\\t\\t\\tif ( i >= samples ) {\\n\\n\\t\\t\\t\\t\\t\\tbreak;\\n\\n\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\tfloat theta = dTheta * float( i );\\n\\t\\t\\t\\t\\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\\n\\t\\t\\t\\t\\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\\n\\n\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\tgl_FragColor = linearToOutputTexel( gl_FragColor );\\n\\n\\t\\t\\t}\\n\\t\\t\",blending:x,depthTest:!1,depthWrite:!1})}(),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,n=.1,i=100){hs=this._renderer.getRenderTarget();const r=this._allocateTargets();return this._sceneToCubeUV(e,n,i,r),t>0&&this._blur(r,0,0,t),this._applyPMREM(r),this._cleanup(r),r}fromEquirectangular(e){return this._fromTexture(e)}fromCubemap(e){return this._fromTexture(e)}compileCubemapShader(){null===this._cubemapShader&&(this._cubemapShader=bs(),this._compileMaterial(this._cubemapShader))}compileEquirectangularShader(){null===this._equirectShader&&(this._equirectShader=_s(),this._compileMaterial(this._equirectShader))}dispose(){this._blurMaterial.dispose(),null!==this._cubemapShader&&this._cubemapShader.dispose(),null!==this._equirectShader&&this._equirectShader.dispose();for(let e=0;e<as.length;e++)as[e].dispose()}_cleanup(e){this._pingPongRenderTarget.dispose(),this._renderer.setRenderTarget(hs),e.scissorTest=!1,xs(e,0,0,e.width,e.height)}_fromTexture(e){hs=this._renderer.getRenderTarget();const t=this._allocateTargets(e);return this._textureToCubeUV(e,t),this._applyPMREM(t),this._cleanup(t),t}_allocateTargets(e){const t={magFilter:fe,minFilter:fe,generateMipmaps:!1,type:Se,format:ke,encoding:gs(e)?e.encoding:Qt,depthBuffer:!1},n=ys(t);return n.depthBuffer=!e,this._pingPongRenderTarget=ys(t),n}_compileMaterial(e){const t=new wo(as[0],e);this._renderer.compile(t,ss)}_sceneToCubeUV(e,t,n,i){const r=new Po(90,1,t,n),o=[1,-1,1,1,1,1],s=[1,1,1,-1,-1,-1],a=this._renderer,l=a.autoClear,c=a.outputEncoding,u=a.toneMapping;a.getClearColor(us),a.toneMapping=K,a.outputEncoding=Zt,a.autoClear=!1;
947const h=new Nr({name:\"PMREM.Background\",side:m,depthWrite:!1,depthTest:!1}),d=new wo(new So,h);let p=!1;const f=e.background;f?f.isColor&&(h.color.copy(f),e.background=null,p=!0):(h.color.copy(us),p=!0);for(let t=0;t<6;t++){const n=t%3;0==n?(r.up.set(0,o[t],0),r.lookAt(s[t],0,0)):1==n?(r.up.set(0,0,o[t]),r.lookAt(0,s[t],0)):(r.up.set(0,o[t],0),r.lookAt(0,0,s[t])),xs(i,n*ns,t>2?ns:0,ns,ns),a.setRenderTarget(i),p&&a.render(d,r),a.render(e,r)}d.geometry.dispose(),d.material.dispose(),a.toneMapping=u,a.outputEncoding=c,a.autoClear=l,e.background=f}_setEncoding(e,t){!0===this._renderer.capabilities.isWebGL2&&t.format===ze&&t.type===Se&&t.encoding===$t?e.value=os[Zt]:e.value=os[t.encoding]}_textureToCubeUV(e,t){const n=this._renderer,i=e.mapping===oe||e.mapping===se;i?null==this._cubemapShader&&(this._cubemapShader=bs()):null==this._equirectShader&&(this._equirectShader=_s());const r=i?this._cubemapShader:this._equirectShader,o=new wo(as[0],r),s=r.uniforms;s.envMap.value=e,i||s.texelSize.value.set(1/e.image.width,1/e.image.height),this._setEncoding(s.inputEncoding,e),this._setEncoding(s.outputEncoding,t.texture),xs(t,0,0,3*ns,2*ns),n.setRenderTarget(t),n.render(o,ss)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;for(let t=1;t<rs;t++){const n=Math.sqrt(cs[t]*cs[t]-cs[t-1]*cs[t-1]),i=fs[(t-1)%fs.length];this._blur(e,t-1,t,n,i)}t.autoClear=n}_blur(e,t,n,i,r){const o=this._pingPongRenderTarget;this._halfBlur(e,o,t,n,i,\"latitudinal\",r),this._halfBlur(o,e,n,n,i,\"longitudinal\",r)}_halfBlur(e,t,n,i,r,o,s){const a=this._renderer,l=this._blurMaterial;\"latitudinal\"!==o&&\"longitudinal\"!==o&&console.error(\"blur direction must be either latitudinal or longitudinal!\");const c=new wo(as[i],l),u=l.uniforms,h=ls[n]-1,d=isFinite(r)?Math.PI/(2*h):2*Math.PI/39,p=r/d,f=isFinite(r)?1+Math.floor(3*p):20;f>20&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${f} samples when the maximum is set to 20`);const m=[];let g=0;for(let e=0;e<20;++e){const t=e/p,n=Math.exp(-t*t/2);m.push(n),0==e?g+=n:e<f&&(g+=2*n)}for(let e=0;e<m.length;e++)m[e]=m[e]/g;u.envMap.value=e.texture,u.samples.value=f,u.weights.value=m,u.latitudinal.value=\"latitudinal\"===o,s&&(u.poleAxis.value=s),u.dTheta.value=d,u.mipInt.value=8-n,this._setEncoding(u.inputEncoding,e.texture),this._setEncoding(u.outputEncoding,e.texture);const v=ls[i];xs(t,3*Math.max(0,ns-2*v),(0===i?0:2*ns)+2*v*(i>4?i-8+4:0),3*v,2*v),a.setRenderTarget(t),a.render(c,ss)}}function gs(e){return void 0!==e&&e.type===Se&&(e.encoding===Zt||e.encoding===$t||e.encoding===Kt)}function vs(){const e=[],t=[],n=[];let i=8;for(let r=0;r<rs;r++){const o=Math.pow(2,i);t.push(o);let s=1/o;r>4?s=is[r-8+4-1]:0==r&&(s=0),n.push(s);const a=1/(o-1),l=-a/2,c=1+a/2,u=[l,l,c,l,c,c,l,l,c,c,l,c],h=6,d=6,p=3,f=2,m=1,g=new Float32Array(p*d*h),v=new Float32Array(f*d*h),y=new Float32Array(m*d*h);for(let e=0;e<h;e++){const t=e%3*2/3-1,n=e>2?0:-1,i=[t,n,0,t+2/3,n,0,t+2/3,n+1,0,t,n,0,t+2/3,n+1,0,t,n+1,0];g.set(i,p*d*e),v.set(u,f*d*e);const r=[e,e,e,e,e,e];y.set(r,m*d*e)}const x=new io;x.setAttribute(\"position\",new Br(g,p)),x.setAttribute(\"uv\",new Br(v,f)),x.setAttribute(\"faceIndex\",new Br(y,m)),e.push(x),i>4&&i--}return{_lodPlanes:e,_sizeLods:t,_sigmas:n}}function ys(e){const t=new ci(3*ns,3*ns,e);return t.texture.mapping=ce,t.texture.name=\"PMREM.cubeUv\",t.scissorTest=!0,t}function xs(e,t,n,i,r){e.viewport.set(t,n,i,r),e.scissor.set(t,n,i,r)}function _s(){const e=new Zn(1,1);return new ts({name:\"EquirectangularToCubeUV\",uniforms:{envMap:{value:null},texelSize:{value:e},inputEncoding:{value:os[Zt]},outputEncoding:{value:os[Zt]}},vertexShader:\"\\n\\n\\t\\tprecision mediump float;\\n\\t\\tprecision mediump int;\\n\\n\\t\\tattribute vec3 position;\\n\\t\\tattribute vec2 uv;\\n\\t\\tattribute float faceIndex;\\n\\n\\t\\tvarying vec3 vOutputDirection;\\n\\n\\t\\t// RH coordinate system; PMREM face-indexing convention\\n\\t\\tvec3 getDirection( vec2 uv, float face ) {\\n\\n\\t\\t\\tuv = 2.0 * uv - 1.0;\\n\\n\\t\\t\\tvec3 direction = vec3( uv, 1.0 );\\n\\n\\t\\t\\tif ( face == 0.0 ) {\\n\\n\\t\\t\\t\\tdirection = direction.zyx; // ( 1, v, u ) pos x\\n\\n\\t\\t\\t} else if ( face == 1.0 ) {\\n\\n\\t\\t\\t\\tdirection = direction.xzy;\\n\\t\\t\\t\\tdirection.xz *= -1.0;
947 // ( -u, 1, -v ) pos y\\n\\n\\t\\t\\t} else if ( face == 2.0 ) {\\n\\n\\t\\t\\t\\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\\n\\n\\t\\t\\t} else if ( face == 3.0 ) {\\n\\n\\t\\t\\t\\tdirection = direction.zyx;\\n\\t\\t\\t\\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\\n\\n\\t\\t\\t} else if ( face == 4.0 ) {\\n\\n\\t\\t\\t\\tdirection = direction.xzy;\\n\\t\\t\\t\\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\\n\\n\\t\\t\\t} else if ( face == 5.0 ) {\\n\\n\\t\\t\\t\\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\\n\\n\\t\\t\\t}\\n\\n\\t\\t\\treturn direction;\\n\\n\\t\\t}\\n\\n\\t\\tvoid main() {\\n\\n\\t\\t\\tvOutputDirection = getDirection( uv, faceIndex );\\n\\t\\t\\tgl_Position = vec4( position, 1.0 );\\n\\n\\t\\t}\\n\\t\",fragmentShader:\"\\n\\n\\t\\t\\tprecision mediump float;\\n\\t\\t\\tprecision mediump int;\\n\\n\\t\\t\\tvarying vec3 vOutputDirection;\\n\\n\\t\\t\\tuniform sampler2D envMap;\\n\\t\\t\\tuniform vec2 texelSize;\\n\\n\\t\\t\\t\\n\\n\\t\\tuniform int inputEncoding;\\n\\t\\tuniform int outputEncoding;\\n\\n\\t\\t#include <encodings_pars_fragment>\\n\\n\\t\\tvec4 inputTexelToLinear( vec4 value ) {\\n\\n\\t\\t\\tif ( inputEncoding == 0 ) {\\n\\n\\t\\t\\t\\treturn value;\\n\\n\\t\\t\\t} else if ( inputEncoding == 1 ) {\\n\\n\\t\\t\\t\\treturn sRGBToLinear( value );\\n\\n\\t\\t\\t} else if ( inputEncoding == 2 ) {\\n\\n\\t\\t\\t\\treturn RGBEToLinear( value );\\n\\n\\t\\t\\t} else if ( inputEncoding == 3 ) {\\n\\n\\t\\t\\t\\treturn RGBMToLinear( value, 7.0 );\\n\\n\\t\\t\\t} else if ( inputEncoding == 4 ) {\\n\\n\\t\\t\\t\\treturn RGBMToLinear( value, 16.0 );\\n\\n\\t\\t\\t} else if ( inputEncoding == 5 ) {\\n\\n\\t\\t\\t\\treturn RGBDToLinear( value, 256.0 );\\n\\n\\t\\t\\t} else {\\n\\n\\t\\t\\t\\treturn GammaToLinear( value, 2.2 );\\n\\n\\t\\t\\t}\\n\\n\\t\\t}\\n\\n\\t\\tvec4 linearToOutputTexel( vec4 value ) {\\n\\n\\t\\t\\tif ( outputEncoding == 0 ) {\\n\\n\\t\\t\\t\\treturn value;\\n\\n\\t\\t\\t} else if ( outputEncoding == 1 ) {\\n\\n\\t\\t\\t\\treturn LinearTosRGB( value );\\n\\n\\t\\t\\t} else if ( outputEncoding == 2 ) {\\n\\n\\t\\t\\t\\treturn LinearToRGBE( value );\\n\\n\\t\\t\\t} else if ( outputEncoding == 3 ) {\\n\\n\\t\\t\\t\\treturn LinearToRGBM( value, 7.0 );\\n\\n\\t\\t\\t} else if ( outputEncoding == 4 ) {\\n\\n\\t\\t\\t\\treturn LinearToRGBM( value, 16.0 );\\n\\n\\t\\t\\t} else if ( outputEncoding == 5 ) {\\n\\n\\t\\t\\t\\treturn LinearToRGBD( value, 256.0 );\\n\\n\\t\\t\\t} else {\\n\\n\\t\\t\\t\\treturn LinearToGamma( value, 2.2 );\\n\\n\\t\\t\\t}\\n\\n\\t\\t}\\n\\n\\t\\tvec4 envMapTexelToLinear( vec4 color ) {\\n\\n\\t\\t\\treturn inputTexelToLinear( color );\\n\\n\\t\\t}\\n\\t\\n\\n\\t\\t\\t#include <common>\\n\\n\\t\\t\\tvoid main() {\\n\\n\\t\\t\\t\\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\\n\\n\\t\\t\\t\\tvec3 outputDirection = normalize( vOutputDirection );\\n\\t\\t\\t\\tvec2 uv = equirectUv( outputDirection );\\n\\n\\t\\t\\t\\tvec2 f = fract( uv / texelSize - 0.5 );\\n\\t\\t\\t\\tuv -= f * texelSize;\\n\\t\\t\\t\\tvec3 tl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\\n\\t\\t\\t\\tuv.x += texelSize.x;\\n\\t\\t\\t\\tvec3 tr = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\\n\\t\\t\\t\\tuv.y += texelSize.y;\\n\\t\\t\\t\\tvec3 br = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\\n\\t\\t\\t\\tuv.x -= texelSize.x;\\n\\t\\t\\t\\tvec3 bl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\\n\\n\\t\\t\\t\\tvec3 tm = mix( tl, tr, f.x );\\n\\t\\t\\t\\tvec3 bm = mix( bl, br, f.x );\\n\\t\\t\\t\\tgl_FragColor.rgb = mix( tm, bm, f.y );\\n\\n\\t\\t\\t\\tgl_FragColor = linearToOutputTexel( gl_FragColor );\\n\\n\\t\\t\\t}\\n\\t\\t\",blending:x,depthTest:!1,depthWrite:!1})}function bs(){return new ts({name:\"CubemapToCubeUV\",uniforms:{envMap:{value:null},inputEncoding:{value:os[Zt]},outputEncoding:{value:os[Zt]}},vertexShader:\"\\n\\n\\t\\tprecision mediump float;\\n\\t\\tprecision mediump int;\\n\\n\\t\\tattribute vec3 position;\\n\\t\\tattribute vec2 uv;\\n\\t\\tattribute float faceIndex;\\n\\n\\t\\tvarying vec3 vOutputDirection;\\n\\n\\t\\t// RH coordinate system; PMREM face-indexing convention\\n\\t\\tvec3 getDirection( vec2 uv, float face ) {\\n\\n\\t\\t\\tuv = 2.0 * uv - 1.0;\\n\\n\\t\\t\\tvec3 direction = vec3( uv, 1.0 );\\n\\n\\t\\t\\tif ( face == 0.0 ) {\\n\\n\\t\\t\\t\\tdirection = direction.zyx; // ( 1, v, u ) pos x\\n\\n\\t\\t\\t} else if ( face == 1.0 ) {\\n\\n\\t\\t\\t\\tdirection = direction.xzy;\\n\\t\\t\\t\\tdirection.xz *= -1.0;
947 // ( -u, 1, -v ) pos y\\n\\n\\t\\t\\t} else if ( face == 2.0 ) {\\n\\n\\t\\t\\t\\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\\n\\n\\t\\t\\t} else if ( face == 3.0 ) {\\n\\n\\t\\t\\t\\tdirection = direction.zyx;\\n\\t\\t\\t\\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\\n\\n\\t\\t\\t} else if ( face == 4.0 ) {\\n\\n\\t\\t\\t\\tdirection = direction.xzy;\\n\\t\\t\\t\\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\\n\\n\\t\\t\\t} else if ( face == 5.0 ) {\\n\\n\\t\\t\\t\\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\\n\\n\\t\\t\\t}\\n\\n\\t\\t\\treturn direction;\\n\\n\\t\\t}\\n\\n\\t\\tvoid main() {\\n\\n\\t\\t\\tvOutputDirection = getDirection( uv, faceIndex );\\n\\t\\t\\tgl_Position = vec4( position, 1.0 );\\n\\n\\t\\t}\\n\\t\",fragmentShader:\"\\n\\n\\t\\t\\tprecision mediump float;\\n\\t\\t\\tprecision mediump int;\\n\\n\\t\\t\\tvarying vec3 vOutputDirection;\\n\\n\\t\\t\\tuniform samplerCube envMap;\\n\\n\\t\\t\\t\\n\\n\\t\\tuniform int inputEncoding;\\n\\t\\tuniform int outputEncoding;\\n\\n\\t\\t#include <encodings_pars_fragment>\\n\\n\\t\\tvec4 inputTexelToLinear( vec4 value ) {\\n\\n\\t\\t\\tif ( inputEncoding == 0 ) {\\n\\n\\t\\t\\t\\treturn value;\\n\\n\\t\\t\\t} else if ( inputEncoding == 1 ) {\\n\\n\\t\\t\\t\\treturn sRGBToLinear( value );\\n\\n\\t\\t\\t} else if ( inputEncoding == 2 ) {\\n\\n\\t\\t\\t\\treturn RGBEToLinear( value );\\n\\n\\t\\t\\t} else if ( inputEncoding == 3 ) {\\n\\n\\t\\t\\t\\treturn RGBMToLinear( value, 7.0 );\\n\\n\\t\\t\\t} else if ( inputEncoding == 4 ) {\\n\\n\\t\\t\\t\\treturn RGBMToLinear( value, 16.0 );\\n\\n\\t\\t\\t} else if ( inputEncoding == 5 ) {\\n\\n\\t\\t\\t\\treturn RGBDToLinear( value, 256.0 );\\n\\n\\t\\t\\t} else {\\n\\n\\t\\t\\t\\treturn GammaToLinear( value, 2.2 );\\n\\n\\t\\t\\t}\\n\\n\\t\\t}\\n\\n\\t\\tvec4 linearToOutputTexel( vec4 value ) {\\n\\n\\t\\t\\tif ( outputEncoding == 0 ) {\\n\\n\\t\\t\\t\\treturn value;\\n\\n\\t\\t\\t} else if ( outputEncoding == 1 ) {\\n\\n\\t\\t\\t\\treturn LinearTosRGB( value );\\n\\n\\t\\t\\t} else if ( outputEncoding == 2 ) {\\n\\n\\t\\t\\t\\treturn LinearToRGBE( value );\\n\\n\\t\\t\\t} else if ( outputEncoding == 3 ) {\\n\\n\\t\\t\\t\\treturn LinearToRGBM( value, 7.0 );\\n\\n\\t\\t\\t} else if ( outputEncoding == 4 ) {\\n\\n\\t\\t\\t\\treturn LinearToRGBM( value, 16.0 );\\n\\n\\t\\t\\t} else if ( outputEncoding == 5 ) {\\n\\n\\t\\t\\t\\treturn LinearToRGBD( value, 256.0 );\\n\\n\\t\\t\\t} else {\\n\\n\\t\\t\\t\\treturn LinearToGamma( value, 2.2 );\\n\\n\\t\\t\\t}\\n\\n\\t\\t}\\n\\n\\t\\tvec4 envMapTexelToLinear( vec4 color ) {\\n\\n\\t\\t\\treturn inputTexelToLinear( color );\\n\\n\\t\\t}\\n\\t\\n\\n\\t\\t\\tvoid main() {\\n\\n\\t\\t\\t\\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\\n\\t\\t\\t\\tgl_FragColor.rgb = envMapTexelToLinear( textureCube( envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ) ) ).rgb;\\n\\t\\t\\t\\tgl_FragColor = linearToOutputTexel( gl_FragColor );\\n\\n\\t\\t\\t}\\n\\t\\t\",blending:x,depthTest:!1,depthWrite:!1})}function ws(e){let t=new WeakMap,n=null;function i(e){const n=e.target;n.removeEventListener(\"dispose\",i);const r=t.get(n);void 0!==r&&(t.delete(n),r.dispose())}return{get:function(r){if(r&&r.isTexture&&!1===r.isRenderTargetTexture){const o=r.mapping,s=o===ae||o===le,a=o===oe||o===se;if(s||a){if(t.has(r))return t.get(r).texture;{const o=r.image;if(s&&o&&o.height>0||a&&o&&function(e){let t=0;for(let n=0;n<6;n++)void 0!==e[n]&&t++;return 6===t}(o)){const o=e.getRenderTarget();null===n&&(n=new ms(e));const a=s?n.fromEquirectangular(r):n.fromCubemap(r);return t.set(r,a),e.setRenderTarget(o),r.addEventListener(\"dispose\",i),a.texture}return null}}}return r},dispose:function(){t=new WeakMap,null!==n&&(n.dispose(),n=null)}}}function Ms(e){const t={};
947function n(n){if(void 0!==t[n])return t[n];let i;switch(n){case\"WEBGL_depth_texture\":i=e.getExtension(\"WEBGL_depth_texture\")||e.getExtension(\"MOZ_WEBGL_depth_texture\")||e.getExtension(\"WEBKIT_WEBGL_depth_texture\");break;case\"EXT_texture_filter_anisotropic\":i=e.getExtension(\"EXT_texture_filter_anisotropic\")||e.getExtension(\"MOZ_EXT_texture_filter_anisotropic\")||e.getExtension(\"WEBKIT_EXT_texture_filter_anisotropic\");break;case\"WEBGL_compressed_texture_s3tc\":i=e.getExtension(\"WEBGL_compressed_texture_s3tc\")||e.getExtension(\"MOZ_WEBGL_compressed_texture_s3tc\")||e.getExtension(\"WEBKIT_WEBGL_compressed_texture_s3tc\");break;case\"WEBGL_compressed_texture_pvrtc\":i=e.getExtension(\"WEBGL_compressed_texture_pvrtc\")||e.getExtension(\"WEBKIT_WEBGL_compressed_texture_pvrtc\");break;default:i=e.getExtension(n)}return t[n]=i,i}return{has:function(e){return null!==n(e)},init:function(e){e.isWebGL2?n(\"EXT_color_buffer_float\"):(n(\"WEBGL_depth_texture\"),n(\"OES_texture_float\"),n(\"OES_texture_half_float\"),n(\"OES_texture_half_float_linear\"),n(\"OES_standard_derivatives\"),n(\"OES_element_index_uint\"),n(\"OES_vertex_array_object\"),n(\"ANGLE_instanced_arrays\")),n(\"OES_texture_float_linear\"),n(\"EXT_color_buffer_half_float\")},get:function(e){const t=n(e);return null===t&&console.warn(\"THREE.WebGLRenderer: \"+e+\" extension not supported.\"),t}}}function Ss(e,t,n,i){const r={},o=new WeakMap;function s(e){const a=e.target;null!==a.index&&t.remove(a.index);for(const e in a.attributes)t.remove(a.attributes[e]);a.removeEventListener(\"dispose\",s),delete r[a.id];const l=o.get(a);l&&(t.remove(l),o.delete(a)),i.releaseStatesOfGeometry(a),!0===a.isInstancedBufferGeometry&&delete a._maxInstanceCount,n.memory.geometries--}function a(e){const n=[],i=e.index,r=e.attributes.position;let s=0;if(null!==i){const e=i.array;s=i.version;for(let t=0,i=e.length;t<i;t+=3){const i=e[t+0],r=e[t+1],o=e[t+2];n.push(i,r,r,o,o,i)}}else{const e=r.array;s=r.version;for(let t=0,i=e.length/3-1;t<i;t+=3){const e=t+0,i=t+1,r=t+2;n.push(e,i,i,r,r,e)}}const a=new(Kn(n)>65535?qr:jr)(n,1);a.version=s;const l=o.get(e);l&&t.remove(l),o.set(e,a)}return{get:function(e,t){return!0===r[t.id]||(t.addEventListener(\"dispose\",s),r[t.id]=!0,n.memory.geometries++),t},update:function(e){const n=e.attributes;for(const e in n)t.update(n[e],34962);const i=e.morphAttributes;for(const e in i){const n=i[e];for(let e=0,i=n.length;e<i;e++)t.update(n[e],34962)}},getWireframeAttribute:function(e){const t=o.get(e);if(t){const n=e.index;null!==n&&t.version<n.version&&a(e)}else a(e);return o.get(e)}}}
947function Es(e,t,n,i){const r=i.isWebGL2;let o,s,a;this.setMode=function(e){o=e},this.setIndex=function(e){s=e.type,a=e.bytesPerElement},this.render=function(t,i){e.drawElements(o,i,s,t*a),n.update(i,o,1)},this.renderInstances=function(i,l,c){if(0===c)return;let u,h;if(r)u=e,h=\"drawElementsInstanced\";else if(u=t.get(\"ANGLE_instanced_arrays\"),h=\"drawElementsInstancedANGLE\",null===u)return void console.error(\"THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.\");u[h](o,l,s,i*a,c),n.update(l,o,c)}}function Ts(e){const t={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:t,programs:null,autoReset:!0,reset:function(){t.frame++,t.calls=0,t.triangles=0,t.points=0,t.lines=0},update:function(e,n,i){switch(t.calls++,n){case 4:t.triangles+=i*(e/3);break;case 1:t.lines+=i*(e/2);break;case 3:t.lines+=i*(e-1);break;case 2:t.lines+=i*e;break;case 0:t.points+=i*e;break;default:console.error(\"THREE.WebGLInfo: Unknown draw mode:\",n)}}}}class As extends si{constructor(e=null,t=1,n=1,i=1){super(null),this.image={data:e,width:t,height:n,depth:i},this.magFilter=fe,this.minFilter=fe,this.wrapR=de,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}function Ls(e,t){return e[0]-t[0]}function Cs(e,t){return Math.abs(t[1])-Math.abs(e[1])}function Ps(e,t){let n=1;const i=t.isInterleavedBufferAttribute?t.data.array:t.array;i instanceof Int8Array?n=127:i instanceof Int16Array?n=32767:i instanceof Int32Array?n=2147483647:console.error(\"THREE.WebGLMorphtargets: Unsupported morph attribute data type: \",i),e.divideScalar(n)}function Rs(e,t,n){const i={},r=new Float32Array(8),o=new WeakMap,s=new pi,a=[];for(let e=0;e<8;e++)a[e]=[e,0];return{update:function(l,c,u,h){const d=l.morphTargetInfluences;if(!0===t.isWebGL2){const i=c.morphAttributes.position.length;let r=o.get(c);if(void 0===r||r.count!==i){void 0!==r&&r.texture.dispose();const e=void 0!==c.morphAttributes.normal,n=c.morphAttributes.position,a=c.morphAttributes.normal||[],l=!0===e?2:1;let u=c.attributes.position.count*l,h=1;u>t.maxTextureSize&&(h=Math.ceil(u/t.maxTextureSize),u=t.maxTextureSize);const d=new Float32Array(u*h*4*i),p=new As(d,u,h,i);p.format=ze,p.type=Pe;const f=4*l;for(let t=0;t<i;t++){const i=n[t],r=a[t],o=u*h*4*t;for(let t=0;t<i.count;t++){s.fromBufferAttribute(i,t),!0===i.normalized&&Ps(s,i);const n=t*f;d[o+n+0]=s.x,d[o+n+1]=s.y,d[o+n+2]=s.z,d[o+n+3]=0,!0===e&&(s.fromBufferAttribute(r,t),!0===r.normalized&&Ps(s,r),d[o+n+4]=s.x,d[o+n+5]=s.y,d[o+n+6]=s.z,d[o+n+7]=0)}}r={count:i,texture:p,size:new Zn(u,h)},o.set(c,r)}let a=0;for(let e=0;e<d.length;e++)a+=d[e];const l=c.morphTargetsRelative?1:1-a;h.getUniforms().setValue(e,\"morphTargetBaseInfluence\",l),h.getUniforms().setValue(e,\"morphTargetInfluences\",d),h.getUniforms().setValue(e,\"morphTargetsTexture\",r.texture,n),h.getUniforms().setValue(e,\"morphTargetsTextureSize\",r.size)}else{const t=void 0===d?0:d.length;let n=i[c.id];if(void 0===n||n.length!==t){n=[];for(let e=0;e<t;e++)n[e]=[e,0];i[c.id]=n}for(let e=0;e<t;e++){const t=n[e];t[0]=e,t[1]=d[e]}n.sort(Cs);for(let e=0;e<8;e++)e<t&&n[e][1]?(a[e][0]=n[e][0],a[e][1]=n[e][1]):(a[e][0]=Number.MAX_SAFE_INTEGER,a[e][1]=0);a.sort(Ls);const o=c.morphAttributes.position,s=c.morphAttributes.normal;let l=0;for(let e=0;e<8;e++){const t=a[e],n=t[0],i=t[1];n!==Number.MAX_SAFE_INTEGER&&i?(o&&c.getAttribute(\"morphTarget\"+e)!==o[n]&&c.setAttribute(\"morphTarget\"+e,o[n]),s&&c.getAttribute(\"morphNormal\"+e)!==s[n]&&c.setAttribute(\"morphNormal\"+e,s[n]),r[e]=i,l+=i):(o&&
947!0===c.hasAttribute(\"morphTarget\"+e)&&c.deleteAttribute(\"morphTarget\"+e),s&&!0===c.hasAttribute(\"morphNormal\"+e)&&c.deleteAttribute(\"morphNormal\"+e),r[e]=0)}const u=c.morphTargetsRelative?1:1-l;h.getUniforms().setValue(e,\"morphTargetBaseInfluence\",u),h.getUniforms().setValue(e,\"morphTargetInfluences\",r)}}}}function Ds(e,t,n,i){let r=new WeakMap;function o(e){const t=e.target;t.removeEventListener(\"dispose\",o),n.remove(t.instanceMatrix),null!==t.instanceColor&&n.remove(t.instanceColor)}return{update:function(e){const s=i.render.frame,a=e.geometry,l=t.get(e,a);return r.get(l)!==s&&(t.update(l),r.set(l,s)),e.isInstancedMesh&&(!1===e.hasEventListener(\"dispose\",o)&&e.addEventListener(\"dispose\",o),n.update(e.instanceMatrix,34962),null!==e.instanceColor&&n.update(e.instanceColor,34962)),l},dispose:function(){r=new WeakMap}}}As.prototype.isDataTexture2DArray=!0;class Os extends si{constructor(e=null,t=1,n=1,i=1){super(null),this.image={data:e,width:t,height:n,depth:i},this.magFilter=fe,this.minFilter=fe,this.wrapR=de,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}Os.prototype.isDataTexture3D=!0;const Is=new si,Fs=new As,Ns=new Os,Us=new Oo,zs=[],Bs=[],Gs=new Float32Array(16),ks=new Float32Array(9),Vs=new Float32Array(4);function Hs(e,t,n){const i=e[0];if(i<=0||i>0)return e;const r=t*n;let o=zs[r];if(void 0===o&&(o=new Float32Array(r),zs[r]=o),0!==t){i.toArray(o,0);for(let i=1,r=0;i!==t;++i)r+=n,e[i].toArray(o,r)}return o}function js(e,t){if(e.length!==t.length)return!1;for(let n=0,i=e.length;n<i;n++)if(e[n]!==t[n])return!1;return!0}function Ws(e,t){for(let n=0,i=t.length;n<i;n++)e[n]=t[n]}function qs(e,t){let n=Bs[t];void 0===n&&(n=new Int32Array(t),Bs[t]=n);for(let i=0;i!==t;++i)n[i]=e.allocateTextureUnit();return n}function Xs(e,t){const n=this.cache;n[0]!==t&&(e.uniform1f(this.addr,t),n[0]=t)}function Ys(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y||(e.uniform2f(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(js(n,t))return;e.uniform2fv(this.addr,t),Ws(n,t)}}function Js(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z||(e.uniform3f(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else if(void 0!==t.r)n[0]===t.r&&n[1]===t.g&&n[2]===t.b||(e.uniform3f(this.addr,t.r,t.g,t.b),n[0]=t.r,n[1]=t.g,n[2]=t.b);else{if(js(n,t))return;e.uniform3fv(this.addr,t),Ws(n,t)}}function Zs(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z&&n[3]===t.w||(e.uniform4f(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(js(n,t))return;e.uniform4fv(this.addr,t),Ws(n,t)}}function $s(e,t){const n=this.cache,i=t.elements;if(void 0===i){if(js(n,t))return;e.uniformMatrix2fv(this.addr,!1,t),Ws(n,t)}else{if(js(n,i))return;Vs.set(i),e.uniformMatrix2fv(this.addr,!1,Vs),Ws(n,i)}}function Ks(e,t){const n=this.cache,i=t.elements;if(void 0===i){if(js(n,t))return;e.uniformMatrix3fv(this.addr,!1,t),Ws(n,t)}else{if(js(n,i))return;ks.set(i),e.uniformMatrix3fv(this.addr,!1,ks),Ws(n,i)}}function Qs(e,t){const n=this.cache,i=t.elements;if(void 0===i){if(js(n,t))return;e.uniformMatrix4fv(this.addr,!1,t),Ws(n,t)}else{if(js(n,i))return;Gs.set(i),e.uniformMatrix4fv(this.addr,!1,Gs),Ws(n,i)}}function ea(e,t){const n=this.cache;n[0]!==t&&(e.uniform1i(this.addr,t),n[0]=t)}function ta(e,t){const n=this.cache;js(n,t)||(e.uniform2iv(this.addr,t),Ws(n,t))}function na(e,t){const n=this.cache;js(n,t)||(e.uniform3iv(this.addr,t),Ws(n,t))}function ia(e,t){const n=this.cache;js(n,t)||(e.uniform4iv(this.addr,t),Ws(n,t))}function ra(e,t){const n=this.cache;n[0]!==t&&(e.uniform1ui(this.addr,t),n[0]=t)}function oa(e,t){const n=this.cache;js(n,t)||(e.uniform2uiv(this.addr,t),Ws(n,t))}function sa(e,t){const n=this.cache;js(n,t)||(e.uniform3uiv(this.addr,t),Ws(n,t))}function aa(e,t){const n=this.cache;js(n,t)||(e.uniform4uiv(this.addr,t),Ws(n,t))}function la(e,t,n){const i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(e.uniform1i(this.addr,r),i[0]=r),n.safeSetTexture2D(t||Is,r)}function ca(e,t,n){const i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(e.uniform1i(this.addr,r),i[0]=r),n.setTexture3D(t||Ns,r)}function ua(e,t,n){const i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(e.uniform1i(this.addr,r),i[0]=r),n.safeSetTextureCube(t||Us,r)}
vendor: 4,391 bytes, line 947
947function ha(e,t,n){const i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(e.uniform1i(this.addr,r),i[0]=r),n.setTexture2DArray(t||Fs,r)}function da(e,t){e.uniform1fv(this.addr,t)}function pa(e,t){const n=Hs(t,this.size,2);e.uniform2fv(this.addr,n)}function fa(e,t){const n=Hs(t,this.size,3);e.uniform3fv(this.addr,n)}function ma(e,t){const n=Hs(t,this.size,4);e.uniform4fv(this.addr,n)}function ga(e,t){const n=Hs(t,this.size,4);e.uniformMatrix2fv(this.addr,!1,n)}function va(e,t){const n=Hs(t,this.size,9);e.uniformMatrix3fv(this.addr,!1,n)}function ya(e,t){const n=Hs(t,this.size,16);e.uniformMatrix4fv(this.addr,!1,n)}function xa(e,t){e.uniform1iv(this.addr,t)}function _a(e,t){e.uniform2iv(this.addr,t)}function ba(e,t){e.uniform3iv(this.addr,t)}function wa(e,t){e.uniform4iv(this.addr,t)}function Ma(e,t){e.uniform1uiv(this.addr,t)}function Sa(e,t){e.uniform2uiv(this.addr,t)}function Ea(e,t){e.uniform3uiv(this.addr,t)}function Ta(e,t){e.uniform4uiv(this.addr,t)}function Aa(e,t,n){const i=t.length,r=qs(n,i);e.uniform1iv(this.addr,r);for(let e=0;e!==i;++e)n.safeSetTexture2D(t[e]||Is,r[e])}function La(e,t,n){const i=t.length,r=qs(n,i);e.uniform1iv(this.addr,r);for(let e=0;e!==i;++e)n.safeSetTextureCube(t[e]||Us,r[e])}function Ca(e,t,n){this.id=e,this.addr=n,this.cache=[],this.setValue=function(e){switch(e){case 5126:return Xs;case 35664:return Ys;case 35665:return Js;case 35666:return Zs;case 35674:return $s;case 35675:return Ks;case 35676:return Qs;case 5124:case 35670:return ea;case 35667:case 35671:return ta;case 35668:case 35672:return na;case 35669:case 35673:return ia;case 5125:return ra;case 36294:return oa;case 36295:return sa;case 36296:return aa;case 35678:case 36198:case 36298:case 36306:case 35682:return la;case 35679:case 36299:case 36307:return ca;case 35680:case 36300:case 36308:case 36293:return ua;case 36289:case 36303:case 36311:case 36292:return ha}}(t.type)}function Pa(e,t,n){this.id=e,this.addr=n,this.cache=[],this.size=t.size,this.setValue=function(e){switch(e){case 5126:return da;case 35664:return pa;case 35665:return fa;case 35666:return ma;case 35674:return ga;case 35675:return va;case 35676:return ya;case 5124:case 35670:return xa;case 35667:case 35671:return _a;case 35668:case 35672:return ba;case 35669:case 35673:return wa;case 5125:return Ma;case 36294:return Sa;case 36295:return Ea;case 36296:return Ta;case 35678:case 36198:case 36298:case 36306:case 35682:return Aa;case 35680:case 36300:case 36308:case 36293:return La}}(t.type)}function Ra(e){this.id=e,this.seq=[],this.map={}}Pa.prototype.updateCache=function(e){const t=this.cache;e instanceof Float32Array&&t.length!==e.length&&(this.cache=new Float32Array(e.length)),Ws(t,e)},Ra.prototype.setValue=function(e,t,n){const i=this.seq;for(let r=0,o=i.length;r!==o;++r){const o=i[r];o.setValue(e,t[o.id],n)}};const Da=/(\\w+)(\\])?(\\[|\\.)?/g;function Oa(e,t){e.seq.push(t),e.map[t.id]=t}function Ia(e,t,n){const i=e.name,r=i.length;for(Da.lastIndex=0;;){const o=Da.exec(i),s=Da.lastIndex;let a=o[1];const l=\"]\"===o[2],c=o[3];if(l&&(a|=0),void 0===c||\"[\"===c&&s+2===r){Oa(n,void 0===c?new Ca(a,e,t):new Pa(a,e,t));break}{let e=n.map[a];void 0===e&&(e=new Ra(a),Oa(n,e)),n=e}}}function Fa(e,t){this.seq=[],this.map={};const n=e.getProgramParameter(t,35718);for(let i=0;i<n;++i){const n=e.getActiveUniform(t,i);Ia(n,e.getUniformLocation(t,n.name),this)}}function Na(e,t,n){const i=e.createShader(t);return e.shaderSource(i,n),e.compileShader(i),i}Fa.prototype.setValue=function(e,t,n,i){const r=this.map[t];void 0!==r&&r.setValue(e,n,i)},Fa.prototype.setOptional=function(e,t,n){const i=t[n];void 0!==i&&this.setValue(e,n,i)},Fa.upload=function(e,t,n,i){for(let r=0,o=t.length;r!==o;++r){const o=t[r],s=n[o.id];!1!==s.needsUpdate&&o.setValue(e,s.value,i)}},Fa.seqWithValue=function(e,t){const n=[];for(let i=0,r=e.length;i!==r;++i){const r=e[i];r.id in t&&n.push(r)}return n};let Ua=0;function za(e){switch(e){case Zt:return[\"Linear\",\"( value )\"];case $t:return[\"sRGB\",\"( value )\"];case Qt:return[\"RGBE\",\"( value )\"];case tn:return[\"RGBM\",\"( value, 7.0 )\"];case nn:return[\"RGBM\",\"( value, 16.0 )\"];case rn:return[\"RGBD\",\"( value, 256.0 )\"];case Kt:return[\"Gamma\",\"( value, float( GAMMA_FACTOR ) )\"];case en:return[\"LogLuv\",\"( value )\"];default:return console.warn(\"THREE.WebGLProgram: Unsupported encoding:\",e),[\"Linear\",\"( value )\"]}}
947function Ba(e,t,n){const i=e.getShaderParameter(t,35713),r=e.getShaderInfoLog(t).trim();return i&&\"\"===r?\"\":n.toUpperCase()+\"\\n\\n\"+r+\"\\n\\n\"+function(e){const t=e.split(\"\\n\");for(let e=0;e<t.length;e++)t[e]=e+1+\": \"+t[e];return t.join(\"\\n\")}(e.getShaderSource(t))}function Ga(e,t){const n=za(t);return\"vec4 \"+e+\"( vec4 value ) { return \"+n[0]+\"ToLinear\"+n[1]+\"; }\"}function ka(e,t){const n=za(t);return\"vec4 \"+e+\"( vec4 value ) { return LinearTo\"+n[0]+n[1]+\"; }\"}function Va(e,t){let n;switch(t){case Q:n=\"Linear\";break;case ee:n=\"Reinhard\";break;case te:n=\"OptimizedCineon\";break;case ne:n=\"ACESFilmic\";break;case ie:n=\"Custom\";break;default:console.warn(\"THREE.WebGLProgram: Unsupported toneMapping:\",t),n=\"Linear\"}return\"vec3 \"+e+\"( vec3 color ) { return \"+n+\"ToneMapping( color ); }\"}function Ha(e){return\"\"!==e}function ja(e,t){return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function Wa(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}const qa=/^[ \\t]*#include +<([\\w\\d./]+)>/gm;function Xa(e){return e.replace(qa,Ya)}function Ya(e,t){const n=Wo[t];if(void 0===n)throw new Error(\"Can not resolve #include <\"+t+\">\");return Xa(n)}const Ja=/#pragma unroll_loop[\\s]+?for \\( int i \\= (\\d+)\\; i < (\\d+)\\; i \\+\\+ \\) \\{([\\s\\S]+?)(?=\\})\\}/g,Za=/#pragma unroll_loop_start\\s+for\\s*\\(\\s*int\\s+i\\s*=\\s*(\\d+)\\s*;\\s*i\\s*<\\s*(\\d+)\\s*;\\s*i\\s*\\+\\+\\s*\\)\\s*{([\\s\\S]+?)}\\s+#pragma unroll_loop_end/g;function $a(e){return e.replace(Za,Qa).replace(Ja,Ka)}function Ka(e,t,n,i){return console.warn(\"WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead.\"),Qa(0,t,n,i)}function Qa(e,t,n,i){let r=\"\";for(let e=parseInt(t);e<parseInt(n);e++)r+=i.replace(/\\[\\s*i\\s*\\]/g,\"[ \"+e+\" ]\").replace(/UNROLLED_LOOP_INDEX/g,e);return r}function el(e){let t=\"precision \"+e.precision+\" float;\\nprecision \"+e.precision+\" int;\";return\"highp\"===e.precision?t+=\"\\n#define HIGH_PRECISION\":\"mediump\"===e.precision?t+=\"\\n#define MEDIUM_PRECISION\":\"lowp\"===e.precision&&(t+=\"\\n#define LOW_PRECISION\"),t}function tl(e,t,n,i){const r=e.getContext(),o=n.defines;let s=n.vertexShader,a=n.fragmentShader;const l=function(e){let t=\"SHADOWMAP_TYPE_BASIC\";return e.shadowMapType===h?t=\"SHADOWMAP_TYPE_PCF\":e.shadowMapType===d?t=\"SHADOWMAP_TYPE_PCF_SOFT\":e.shadowMapType===p&&(t=\"SHADOWMAP_TYPE_VSM\"),t}(n),c=function(e){let t=\"ENVMAP_TYPE_CUBE\";if(e.envMap)switch(e.envMapMode){case oe:case se:t=\"ENVMAP_TYPE_CUBE\";break;case ce:case ue:t=\"ENVMAP_TYPE_CUBE_UV\"}return t}(n),u=function(e){let t=\"ENVMAP_MODE_REFLECTION\";if(e.envMap)switch(e.envMapMode){case se:case ue:t=\"ENVMAP_MODE_REFRACTION\"}return t}(n),f=function(e){let t=\"ENVMAP_BLENDING_NONE\";if(e.envMap)switch(e.combine){case J:t=\"ENVMAP_BLENDING_MULTIPLY\";break;case Z:t=\"ENVMAP_BLENDING_MIX\";break;case $:t=\"ENVMAP_BLENDING_ADD\"}return t}(n),m=e.gammaFactor>
9470?e.gammaFactor:1,g=n.isWebGL2?\"\":function(e){return[e.extensionDerivatives||e.envMapCubeUV||e.bumpMap||e.tangentSpaceNormalMap||e.clearcoatNormalMap||e.flatShading||\"physical\"===e.shaderID?\"#extension GL_OES_standard_derivatives : enable\":\"\",(e.extensionFragDepth||e.logarithmicDepthBuffer)&&e.rendererExtensionFragDepth?\"#extension GL_EXT_frag_depth : enable\":\"\",e.extensionDrawBuffers&&e.rendererExtensionDrawBuffers?\"#extension GL_EXT_draw_buffers : require\":\"\",(e.extensionShaderTextureLOD||e.envMap||e.transmission)&&e.rendererExtensionShaderTextureLod?\"#extension GL_EXT_shader_texture_lod : enable\":\"\"].filter(Ha).join(\"\\n\")}(n),v=function(e){const t=[];for(const n in e){const i=e[n];!1!==i&&t.push(\"#define \"+n+\" \"+i)}return t.join(\"\\n\")}(o),y=r.createProgram();let x,_,b=n.glslVersion?\"#version \"+n.glslVersion+\"\\n\":\"\";n.isRawShaderMaterial?(x=[v].filter(Ha).join(\"\\n\"),x.length>0&&(x+=\"\\n\"),_=[g,v].filter(Ha).join(\"\\n\"),_.length>0&&(_+=\"\\n\")):(x=[el(n),\"#define SHADER_NAME \"+n.shaderName,v,n.instancing?\"#define USE_INSTANCING\":\"\",n.instancingColor?\"#define USE_INSTANCING_COLOR\":\"\",n.supportsVertexTextures?\"#define VERTEX_TEXTURES\":\"\",\"#define GAMMA_FACTOR \"+m,\"#define MAX_BONES \"+n.maxBones,n.useFog&&n.fog?\"#define USE_FOG\":\"\",n.useFog&&n.fogExp2?\"#define FOG_EXP2\":\"\",n.map?\"#define USE_MAP\":\"\",n.envMap?\"#define USE_ENVMAP\":\"\",n.envMap?\"#define \"+u:\"\",n.lightMap?\"#define USE_LIGHTMAP\":\"\",n.aoMap?\"#define USE_AOMAP\":\"\",n.emissiveMap?\"#define USE_EMISSIVEMAP\":\"\",n.bumpMap?\"#define USE_BUMPMAP\":\"\",n.normalMap?\"#define USE_NORMALMAP\":\"\",n.normalMap&&n.objectSpaceNormalMap?\"#define OBJECTSPACE_NORMALMAP\":\"\",n.normalMap&&n.tangentSpaceNormalMap?\"#define TANGENTSPACE_NORMALMAP\":\"\",n.clearcoatMap?\"#define USE_CLEARCOATMAP\":\"\",n.clearcoatRoughnessMap?\"#define USE_CLEARCOAT_ROUGHNESSMAP\":\"\",n.clearcoatNormalMap?\"#define USE_CLEARCOAT_NORMALMAP\":\"\",n.displacementMap&&n.supportsVertexTextures?\"#define USE_DISPLACEMENTMAP\":\"\",n.specularMap?\"#define USE_SPECULARMAP\":\"\",n.specularIntensityMap?\"#define USE_SPECULARINTENSITYMAP\":\"\",n.specularColorMap?\"#define USE_SPECULARCOLORMAP\":\"\",n.roughnessMap?\"#define USE_ROUGHNESSMAP\":\"\",n.metalnessMap?\"#define USE_METALNESSMAP\":\"\",n.alphaMap?\"#define USE_ALPHAMAP\":\"\",n.transmission?\"#define USE_TRANSMISSION\":\"\",n.transmissionMap?\"#define USE_TRANSMISSIONMAP\":\"\",n.thicknessMap?\"#define USE_THICKNESSMAP\":\"\",n.sheenColorMap?\"#define USE_SHEENCOLORMAP\":\"\",n.sheenRoughnessMap?\"#define USE_SHEENROUGHNESSMAP\":\"\",n.vertexTangents?\"#define USE_TANGENT\":\"\",n.vertexColors?\"#define USE_COLOR\":\"\",n.vertexAlphas?\"#define USE_COLOR_ALPHA\":\"\",n.vertexUvs?\"#define USE_UV\":\"\",n.uvsVertexOnly?\"#define UVS_VERTEX_ONLY\":\"\",n.flatShading?\"#define FLAT_SHADED\":\"\",n.skinning?\"#define USE_SKINNING\":\"\",n.useVertexTexture?\"#define BONE_TEXTURE\":\"\",n.morphTargets?\"#define USE_MORPHTARGETS\":\"\",n.morphNormals&&!1===n.flatShading?\"#define USE_MORPHNORMALS\":\"\",n.morphTargets&&n.isWebGL2?\"#define MORPHTARGETS_TEXTURE\":\"\",n.morphTargets&&n.isWebGL2?\"#define MORPHTARGETS_COUNT \"+n.morphTargetsCount:\"\",n.doubleSided?\"#define DOUBLE_SIDED\":\"\",n.flipSided?\"#define FLIP_SIDED\":\"\",n.shadowMapEnabled?\"#define USE_SHADOWMAP\":\"\",n.shadowMapEnabled?\"#define \"+l:\"\",n.sizeAttenuation?\"#define USE_SIZEATTENUATION\":\"\",n.logarithmicDepthBuffer?\"#define USE_LOGDEPTHBUF\":\"\",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?\"#define USE_LOGDEPTHBUF_EXT\":\"\",\"uniform mat4 modelMatrix;\",\"uniform mat4 modelViewMatrix;\",\"uniform mat4 projectionMatrix;\",\"uniform mat4 viewMatrix;\",\"uniform mat3 normalMatrix;\",\"uniform vec3 cameraPosition;\",\"uniform bool isOrthographic;\",\"#ifdef USE_INSTANCING\",\"\\tattribute mat4 instanceMatrix;\",\"#endif\",\"#ifdef USE_INSTANCING_COLOR\",\"\\tattribute vec3 instanceColor;\",\"#endif\",\"attribute vec3 position;\",\"attribute vec3 normal;\",\"attribute vec2 uv;\",\"#ifdef USE_TANGENT\",\"\\tattribute vec4 tangent;\",\"#endif\",\"#if defined( USE_COLOR_ALPHA )\",\"\\tattribute vec4 color;\",\"#elif defined( USE_COLOR )\",\"\\tattribute vec3 color;\",\"#endif\",\"#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )\",\"\\tattribute vec3 morphTarget0;\",\"\\tattribute vec3 morphTarget1;\",\"\\tattribute vec3 morphTarget2;\",\"\\tattribute vec3 morphTarget3;\",\"\\t#ifdef USE_MORPHNORMALS\",\"\\t\\tattribute vec3 morphNormal0;\",\"\\t\\tattribute vec3 morphNormal1;\",\"\\t\\tattribute vec3 morphNormal2;\",\"\\t\\tattribute vec3 morphNormal3;\",\"\\t#else\",\"\\t\\tattribute vec3 morphTarget4;\",\"\\t\\tattribute vec3 morphTarget5;\",\"\\t\\tattribute vec3 morphTarget6;\",\"\\t\\tattribute vec3 morphTarget7;\",\"\\t#endif\",\"#endif\",\"#ifdef USE_SKINNING\",\"\\tattribute vec4 skinIndex;\",\"\\tattribute vec4 skinWeight;\",\"#endif\",\"\\n\"].filter(Ha).join(\"\\n\"),_=[g,el(n),\"#define SHADER_NAME \"+n.shaderName,v,\"#define GAMMA_FACTOR \"+m,n.useFog&&n.fog?\"#define USE_FOG\":\"\",n.useFog&&n.fogExp2?\"#define FOG_EXP2\":\"\",n.map?\"#define USE_MAP\":\"\",n.matcap?\"#define USE_MATCAP\":\"\",n.envMap?\"#define USE_ENVMAP\":\"\",n.envMap?\"#define \"+c:\"\",n.envMap?\"#define \"+u:\"\",n.envMap?\"#define \"+f:\"\",n.lightMap?\"#define USE_LIGHTMAP\":\"\",n.aoMap?\"#define USE_AOMAP\":\"\",n.emissiveMap?\"#define USE_EMISSIVEMAP\":\"\",n.bumpMap?\"#define USE_BUMPMAP\":\"\",n.normalMap?\"#define USE_NORMALMAP\":\"\",n.normalMap&&n.objectSpaceNormalMap?\"#define OBJECTSPACE_NORMALMAP\":\"\",n.normalMap&&n.tangentSpaceNormalMap?\"#define TANGENTSPACE_NORMALMAP\":\"\",n.clearcoat?\"#define USE_CLEARCOAT\":\"\",n.clearcoatMap?\"#define USE_CLEARCOATMAP\":\"\",n.clearcoatRoughnessMap?\"#define USE_CLEARCOAT_ROUGHNESSMAP\":\"\",n.clearcoatNormalMap?\"#define USE_CLEARCOAT_NORMALMAP\":\"\",n.specularMap?\"#define USE_SPECULARMAP\":\"\",n.specularIntensityMap?\"#define USE_SPECULARINTENSITYMAP\":\"\",n.specularColorMap?\"#define USE_SPECULARCOLORMAP\":\"\",n.roughnessMap?\"#define USE_ROUGHNESSMAP\":\"\",n.metalnessMap?\"#define USE_METALNESSMAP\":\"\",n.alph
947aMap?\"#define USE_ALPHAMAP\":\"\",n.alphaTest?\"#define USE_ALPHATEST\":\"\",n.sheen?\"#define USE_SHEEN\":\"\",n.sheenColorMap?\"#define USE_SHEENCOLORMAP\":\"\",n.sheenRoughnessMap?\"#define USE_SHEENROUGHNESSMAP\":\"\",n.transmission?\"#define USE_TRANSMISSION\":\"\",n.transmissionMap?\"#define USE_TRANSMISSIONMAP\":\"\",n.thicknessMap?\"#define USE_THICKNESSMAP\":\"\",n.vertexTangents?\"#define USE_TANGENT\":\"\",n.vertexColors||n.instancingColor?\"#define USE_COLOR\":\"\",n.vertexAlphas?\"#define USE_COLOR_ALPHA\":\"\",n.vertexUvs?\"#define USE_UV\":\"\",n.uvsVertexOnly?\"#define UVS_VERTEX_ONLY\":\"\",n.gradientMap?\"#define USE_GRADIENTMAP\":\"\",n.flatShading?\"#define FLAT_SHADED\":\"\",n.doubleSided?\"#define DOUBLE_SIDED\":\"\",n.flipSided?\"#define FLIP_SIDED\":\"\",n.shadowMapEnabled?\"#define USE_SHADOWMAP\":\"\",n.shadowMapEnabled?\"#define \"+l:\"\",n.premultipliedAlpha?\"#define PREMULTIPLIED_ALPHA\":\"\",n.physicallyCorrectLights?\"#define PHYSICALLY_CORRECT_LIGHTS\":\"\",n.logarithmicDepthBuffer?\"#define USE_LOGDEPTHBUF\":\"\",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?\"#define USE_LOGDEPTHBUF_EXT\":\"\",(n.extensionShaderTextureLOD||n.envMap)&&n.rendererExtensionShaderTextureLod?\"#define TEXTURE_LOD_EXT\":\"\",\"uniform mat4 viewMatrix;\",\"uniform vec3 cameraPosition;\",\"uniform bool isOrthographic;\",n.toneMapping!==K?\"#define TONE_MAPPING\":\"\",n.toneMapping!==K?Wo.tonemapping_pars_fragment:\"\",n.toneMapping!==K?Va(\"toneMapping\",n.toneMapping):\"\",n.dithering?\"#define DITHERING\":\"\",n.format===Ue?\"#define OPAQUE\":\"\",Wo.encodings_pars_fragment,n.map?Ga(\"mapTexelToLinear\",n.mapEncoding):\"\",n.matcap?Ga(\"matcapTexelToLinear\",n.matcapEncoding):\"\",n.envMap?Ga(\"envMapTexelToLinear\",n.envMapEncoding):\"\",n.emissiveMap?Ga(\"emissiveMapTexelToLinear\",n.emissiveMapEncoding):\"\",n.specularColorMap?Ga(\"specularColorMapTexelToLinear\",n.specularColorMapEncoding):\"\",n.sheenColorMap?Ga(\"sheenColorMapTexelToLinear\",n.sheenColorMapEncoding):\"\",n.lightMap?Ga(\"lightMapTexelToLinear\",n.lightMapEncoding):\"\",ka(\"linearToOutputTexel\",n.outputEncoding),n.depthPacking?\"#define DEPTH_PACKING \"+n.depthPacking:\"\",\"\\n\"].filter(Ha).join(\"\\n\")),s=Xa(s),s=ja(s,n),s=Wa(s,n),a=Xa(a),a=ja(a,n),a=Wa(a,n),s=$a(s),a=$a(a),n.isWebGL2&&!0!==n.isRawShaderMaterial&&(b=\"#version 300 es\\n\",x=[\"precision mediump sampler2DArray;\",\"#define attribute in\",\"#define varying out\",\"#define texture2D texture\"].join(\"\\n\")+\"\\n\"+x,_=[\"#define varying in\",n.glslVersion===Fn?\"\":\"out highp vec4 pc_fragColor;\",n.glslVersion===Fn?\"\":\"#define gl_FragColor pc_fragColor\",\"#define gl_FragDepthEXT gl_FragDepth\",\"#define texture2D texture\",\"#define textureCube texture\",\"#define texture2DProj textureProj\",\"#define texture2DLodEXT textureLod\",\"#define texture2DProjLodEXT textureProjLod\",\"#define textureCubeLodEXT textureLod\",\"#define texture2DGradEXT textureGrad\",\"#define texture2DProjGradEXT textureProjGrad\",\"#define textureCubeGradEXT textureGrad\"].join(\"\\n\")+\"\\n\"+_);const w=b+_+a,M=Na(r,35633,b+x+s),S=Na(r,35632,w);if(r.attachShader(y,M),r.attachShader(y,S),void 0!==n.index0AttributeName?r.bindAttribLocation(y,0,n.index0AttributeName):!0===n.morphTargets&&r.bindAttribLocation(y,0,\"position\"),r.linkProgram(y),e.debug.checkShaderErrors){const e=r.getProgramInfoLog(y).trim(),t=r.getShaderInfoLog(M).trim(),n=r.getShaderInfoLog(S).trim();let i=!0,o=!0;if(!1===r.getProgramParameter(y,35714)){i=!1;const t=Ba(r,M,\"vertex\"),n=Ba(r,S,\"fragment\");console.error(\"THREE.WebGLProgram: Shader Error \"+r.getError()+\" - VALIDATE_STATUS \"+r.getProgramParameter(y,35715)+\"\\n\\nProgram Info Log: \"+e+\"\\n\"+t+\"\\n\"+n)}else\"\"!==e?console.warn(\"THREE.WebGLProgram: Program Info Log:\",e):\"\"!==t&&\"\"!==n||(o=!1);o&&(this.diagnostics={runnable:i,programLog:e,vertexShader:{log:t,prefix:x},fragmentShader:{log:n,prefix:_}})}let E,T;return r.deleteShader(M),r.deleteShader(S),this.getUniforms=function(){return void 0===E&&(E=new Fa(r,y)),E},this.getAttributes=function(){return void 0===T&&(T=function(e,t){const n={},i=e.getProgramParameter(t,35721);for(let r=0;r<i;r++){const i=e.getActiveAttrib(t,r),o=i.name;let s=1;
vendor: 7,467 bytes, line 947
94735674===i.type&&(s=2),35675===i.type&&(s=3),35676===i.type&&(s=4),n[o]={type:i.type,location:e.getAttribLocation(t,o),locationSize:s}}return n}(r,y)),T},this.destroy=function(){i.releaseStatesOfProgram(this),r.deleteProgram(y),this.program=void 0},this.name=n.shaderName,this.id=Ua++,this.cacheKey=t,this.usedTimes=1,this.program=y,this.vertexShader=M,this.fragmentShader=S,this}function nl(e,t,n,i,r,o,s){const a=[],l=r.isWebGL2,c=r.logarithmicDepthBuffer,u=r.floatVertexTextures,h=r.maxVertexUniforms,d=r.vertexTextures;let p=r.precision;const f={MeshDepthMaterial:\"depth\",MeshDistanceMaterial:\"distanceRGBA\",MeshNormalMaterial:\"normal\",MeshBasicMaterial:\"basic\",MeshLambertMaterial:\"lambert\",MeshPhongMaterial:\"phong\",MeshToonMaterial:\"toon\",MeshStandardMaterial:\"physical\",MeshPhysicalMaterial:\"physical\",MeshMatcapMaterial:\"matcap\",LineBasicMaterial:\"basic\",LineDashedMaterial:\"dashed\",PointsMaterial:\"points\",ShadowMaterial:\"shadow\",SpriteMaterial:\"sprite\"},v=[\"precision\",\"isWebGL2\",\"supportsVertexTextures\",\"outputEncoding\",\"instancing\",\"instancingColor\",\"map\",\"mapEncoding\",\"matcap\",\"matcapEncoding\",\"envMap\",\"envMapMode\",\"envMapEncoding\",\"envMapCubeUV\",\"lightMap\",\"lightMapEncoding\",\"aoMap\",\"emissiveMap\",\"emissiveMapEncoding\",\"bumpMap\",\"normalMap\",\"objectSpaceNormalMap\",\"tangentSpaceNormalMap\",\"clearcoat\",\"clearcoatMap\",\"clearcoatRoughnessMap\",\"clearcoatNormalMap\",\"displacementMap\",\"specularMap\",,\"roughnessMap\",\"metalnessMap\",\"gradientMap\",\"alphaMap\",\"alphaTest\",\"combine\",\"vertexColors\",\"vertexAlphas\",\"vertexTangents\",\"vertexUvs\",\"uvsVertexOnly\",\"fog\",\"useFog\",\"fogExp2\",\"flatShading\",\"sizeAttenuation\",\"logarithmicDepthBuffer\",\"skinning\",\"maxBones\",\"useVertexTexture\",\"morphTargets\",\"morphNormals\",\"morphTargetsCount\",\"premultipliedAlpha\",\"numDirLights\",\"numPointLights\",\"numSpotLights\",\"numHemiLights\",\"numRectAreaLights\",\"numDirLightShadows\",\"numPointLightShadows\",\"numSpotLightShadows\",\"shadowMapEnabled\",\"shadowMapType\",\"toneMapping\",\"physicallyCorrectLights\",\"doubleSided\",\"flipSided\",\"numClippingPlanes\",\"numClipIntersection\",\"depthPacking\",\"dithering\",\"format\",\"specularIntensityMap\",\"specularColorMap\",\"specularColorMapEncoding\",\"transmission\",\"transmissionMap\",\"thicknessMap\",\"sheen\",\"sheenColorMap\",\"sheenColorMapEncoding\",\"sheenRoughnessMap\"];function y(e){let t;return e&&e.isTexture?t=e.encoding:e&&e.isWebGLRenderTarget?(console.warn(\"THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead.\"),t=e.texture.encoding):t=Zt,l&&e&&e.isTexture&&e.format===ze&&e.type===Se&&e.encoding===$t&&(t=Zt),t}return{getParameters:function(o,a,v,x,_){const b=x.fog,w=o.isMeshStandardMaterial?x.environment:null,M=(o.isMeshStandardMaterial?n:t).get(o.envMap||w),S=f[o.type],E=_.isSkinnedMesh?function(e){const t=e.skeleton.bones;if(u)return 1024;{const e=h,n=Math.floor((e-20)/4),i=Math.min(n,t.length);return i<t.length?(console.warn(\"THREE.WebGLRenderer: Skeleton has \"+t.length+\" bones. This GPU supports \"+i+\".\"),0):i}}(_):0;let T,A;if(null!==o.precision&&(p=r.getMaxPrecision(o.precision),p!==o.precision&&console.warn(\"THREE.WebGLProgram.getParameters:\",o.precision,\"not supported, using\",p,\"instead.\")),S){const e=Xo[S];T=e.vertexShader,A=e.fragmentShader}else T=o.vertexShader,A=o.fragmentShader;const L=e.getRenderTarget(),C=o.alphaTest>0,P=o.clearcoat>0;return{isWebGL2:l,shaderID:S,shaderName:o.type,vertexShader:T,fragmentShader:A,defines:o.defines,isRawShaderMaterial:!0===o.isRawShaderMaterial,glslVersion:o.glslVersion,precision:p,instancing:!0===_.isInstancedMesh,instancingColor:!0===_.isInstancedMesh&&null!==_.instanceColor,supportsVertexTextures:d,outputEncoding:null!==L?y(L.texture):e.outputEncoding,map:!!o.map,mapEncoding:y(o.map),matcap:!!o.matcap,matcapEncoding:y(o.matcap),envMap:!!M,envMapMode:M&&M.mapping,envMapEncoding:y(M),envMapCubeUV:!!M&&(M.mapping===ce||M.mapping===ue),lightMap:!!o.lightMap,lightMapEncoding:y(o.lightMap),aoMap:!!o.aoMap,emissiveMap:!!o.emissiveMap,emissiveMapEncoding:y(o.emissiveMap),bumpMap:!!o.bumpMap,normalMap:!!o.normalMap,objectSpaceNormalMap:o.normalMapType===ln,tangentSpaceNormalMap:o.normalMapType===an,clearcoat:P,clearcoatMap:P&&!!o.clearcoatMap,clearcoatRoughnessMap:P&&!!o.clearcoatRoughnessMap,clearcoatNormalMap:P&&!!o.clearcoatNormalMap,displacementMap:!!o.displacementMap,roughnessMap:!!o.roughnessMap,metalnessMap:!!o.metalnessMap,specularMap:!!o.specularMap,specularIntensityMap:!!o.specularIntensityMap,specularColorMap:!!o.specularColorMap,specularColorMapEncoding:y(o.specularColorMap),alphaMap:!!o.alphaMap,alphaTest:C,gradientMap:!!o.gradientMap,sheen:o.sheen>0,sheenColorMap:!!o.sheenColorMap,sheenColorMapEncoding:y(o.sheenColorMap),sheenRoughnessMap:!!o.sheenRoughnessMap,transmission:o.transmission>0,transmissionMap:!!o.transmissionMap,thicknessMap:!!o.thicknessMap,combine:o.combine,vertexTangents:!!o.normalMap&&!!_.geometry&&!!_.geometry.attributes.tangent,vertexColors:o.vertexColors,vertexAlphas:!0===o.vertexColors&&!!_.geometry&&!!_.geometry.attributes.color&&4===_.geometry.attributes.color.itemSize,vertexUvs:!!o.map||!!o.bumpMap||!!o.normalMap||!!o.specularMap||!!o.alphaMap||!!o.emissiveMap||!!o.roughnessMap||!!o.metalnessMap||!!o.clearcoatMap||!!o.clearcoatRoughnessMap||!!o.clearcoatNormalMap||!!o.displacementMap||!!o.transmissionMap||!!o.thicknessMap||!!o.specularIntensityMap||!!o.specularColorMap||!!o.sheenColorMap||o.sheenRoughnessMap,uvsVertexOnly:!(o.map||o.bumpMap||o.normalMap||o.specularMap||o.alphaMap||o.emissiveMap||o.roughnessMap||o.metalnessMap||o.clearcoatNormalMap||o.transmission>0||o.transmissionMap||o.thicknessMap||o.specularIntensityMap||o.specularColorMap||!!o.sheen>0||o.sheenColorMap||o.sheenRoughnessMap||!o.displacementMap),fog:!!b,useFog:o.fog,fogExp2:b&&b.isFogExp2,flatShading:!!o.flatShading,sizeAttenuation:o.sizeAttenuation,logarithmicDepthBuffer:c,skinning:!0===_.isSkinnedMesh&&E>0,maxBones:E,useVertexTexture:u,morphTargets:!!_.geometry&&!!_.geometry.morphAttributes.position,morphNormals:!!_.geometry&&!!_.geometry.morphAttributes.normal,morphTargetsCount:_.geometry&&_.geometry.morphAttributes.position?_.geometry.morphAttributes.position.length:0,numDirLights:a.directional.length,numPointLights:a.point.length,numSpotLights:a.spot.length,numRectAreaLights:a.rectArea.length,numHemiLights:a.hemi.length,numDirLightShadows:a.directionalShadowMap.length,numPointLightShadows:a.pointShadowMap.length,numSpotLightShadows:a.spotShadowMap.length,numClippingPlanes:s.numPlanes,numClipIntersection:s.numIntersection,format:o.format,dithering:o.dithering,shadowMapEnabled:e.shadowMap.enabled&&v.length>0,shadowMapType:e.shadowMap.type,toneMapping:o.toneMapped?e.toneMapping:K,physicallyCorrectLights:e.physicallyCorrectLights,premultipliedAlpha:o.premultipliedAlpha,doubleSided:o.side===g,flipSided:o.side===m,depthPacking:void 0!==o.depthPacking&&o.depthPacking,index0AttributeName:o.index0AttributeName,extensionDerivatives:o.extensions&&o.extensions.derivatives,extensionFragDepth:o.extensions&&o.extensions.fragDepth,extensionDrawBuffers:o.extensions&&o.extensions.drawBuffers,extensionShaderTextureLOD:o.extensions&&o.extensions.shaderTextureLOD,rendererExtensionFragDepth:l||i.has(\"EXT_frag_depth\"),rendererExtensionDrawBuffers:l||i.has(\"W
947EBGL_draw_buffers\"),rendererExtensionShaderTextureLod:l||i.has(\"EXT_shader_texture_lod\"),customProgramCacheKey:o.customProgramCacheKey()}},getProgramCacheKey:function(t){const n=[];if(t.shaderID?n.push(t.shaderID):(n.push(ni(t.fragmentShader)),n.push(ni(t.vertexShader))),void 0!==t.defines)for(const e in t.defines)n.push(e),n.push(t.defines[e]);if(!1===t.isRawShaderMaterial){for(let e=0;e<v.length;e++)n.push(t[v[e]]);n.push(e.outputEncoding),n.push(e.gammaFactor)}return n.push(t.customProgramCacheKey),n.join()},getUniforms:function(e){const t=f[e.type];let n;if(t){const e=Xo[t];n=Ao.clone(e.uniforms)}else n=e.uniforms;return n},acquireProgram:function(t,n){let i;for(let e=0,t=a.length;e<t;e++){const t=a[e];if(t.cacheKey===n){i=t,++i.usedTimes;break}}return void 0===i&&(i=new tl(e,n,t,o),a.push(i)),i},releaseProgram:function(e){if(0==--e.usedTimes){const t=a.indexOf(e);a[t]=a[a.length-1],a.pop(),e.destroy()}},programs:a}}function il(){let e=new WeakMap;return{get:function(t){let n=e.get(t);return void 0===n&&(n={},e.set(t,n)),n},remove:function(t){e.delete(t)},update:function(t,n,i){e.get(t)[n]=i},dispose:function(){e=new WeakMap}}}function rl(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.program!==t.program?e.program.id-t.program.id:e.material.id!==t.material.id?e.material.id-t.material.id:e.z!==t.z?e.z-t.z:e.id-t.id}function ol(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function sl(e){const t=[];let n=0;const i=[],r=[],o=[],s={id:-1};function a(i,r,o,a,l,c){let u=t[n];const h=e.get(o);return void 0===u?(u={id:i.id,object:i,geometry:r,material:o,program:h.program||s,groupOrder:a,renderOrder:i.renderOrder,z:l,group:c},t[n]=u):(u.id=i.id,u.object=i,u.geometry=r,u.material=o,u.program=h.program||s,u.groupOrder=a,u.renderOrder=i.renderOrder,u.z=l,u.group=c),n++,u}return{opaque:i,transmissive:r,transparent:o,init:function(){n=0,i.length=0,r.length=0,o.length=0},push:function(e,t,n,s,l,c){const u=a(e,t,n,s,l,c);n.transmission>0?r.push(u):!0===n.transparent?o.push(u):i.push(u)},unshift:function(e,t,n,s,l,c){const u=a(e,t,n,s,l,c);n.transmission>0?r.unshift(u):!0===n.transparent?o.unshift(u):i.unshift(u)},finish:function(){for(let e=n,i=t.length;e<i;e++){const n=t[e];if(null===n.id)break;n.id=null,n.object=null,n.geometry=null,n.material=null,n.program=null,n.group=null}},sort:function(e,t){i.length>1&&i.sort(e||rl),r.length>1&&r.sort(t||ol),o.length>1&&o.sort(t||ol)}}}function al(e){let t=new WeakMap;return{get:function(n,i){let r;return!1===t.has(n)?(r=new sl(e),t.set(n,[r])):i>=t.get(n).length?(r=new sl(e),t.get(n).push(r)):r=t.get(n)[i],r},dispose:function(){t=new WeakMap}}}function ll(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let n;switch(t.type){case\"DirectionalLight\":n={direction:new pi,color:new Fr};break;case\"SpotLight\":n={position:new pi,direction:new pi,color:new Fr,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case\"PointLight\":n={position:new pi,color:new Fr,distance:0,decay:0};break;case\"HemisphereLight\":n={direction:new pi,skyColor:new Fr,groundColor:new Fr};break;case\"RectAreaLight\":n={color:new Fr,position:new pi,halfWidth:new pi,halfHeight:new pi}}return e[t.id]=n,n}}}let cl=0;function ul(e,t){return(t.castShadow?1:0)-(e.castShadow?1:0)}function hl(e,t){const n=new ll,i=function(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let n;switch(t.type){case\"DirectionalLight\":case\"SpotLight\":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Zn};break;case\"PointLight\":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Zn,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=n,n}}}(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]};for(let e=0;e<9;e++)r.probe.push(new pi);const o=new pi,s=new ji,a=new ji;return{setup:function(o,s){let a=0,l=0,c=0;for(let e=0;e<9;e++)r.probe[e].set(0,0,0);let u=0,h=0,d=0,p=0,f=0,m=0,g=0,v=0;o.sort(ul);const y=!0!==s?Math.PI:1;for(let e=0,t=o.length;e<t;e++){const t=o[e],s=t.color,x=t.intensity,_=t.distance,b=t.shadow&&t.shadow.map?t.shadow.map.texture:null;if(t.isAmbientLight)a+=s.r*x*y,l+=s.g*x*y,c+=s.b*x*y;else if(t.isLightProbe)for(let e=0;e<9;e++)r.probe[e].addScaledVector(t.sh.coefficients[e],x);else if(t.isDirectionalLight){const e=n.get(t);if(e.color.copy(t.color).multiplyScalar(t.intensity*y),t.castShadow){const e=t.shadow,n=i.get(t);
vendor: 4,258 bytes, line 947
947n.shadowBias=e.bias,n.shadowNormalBias=e.normalBias,n.shadowRadius=e.radius,n.shadowMapSize=e.mapSize,r.directionalShadow[u]=n,r.directionalShadowMap[u]=b,r.directionalShadowMatrix[u]=t.shadow.matrix,m++}r.directional[u]=e,u++}else if(t.isSpotLight){const e=n.get(t);if(e.position.setFromMatrixPosition(t.matrixWorld),e.color.copy(s).multiplyScalar(x*y),e.distance=_,e.coneCos=Math.cos(t.angle),e.penumbraCos=Math.cos(t.angle*(1-t.penumbra)),e.decay=t.decay,t.castShadow){const e=t.shadow,n=i.get(t);n.shadowBias=e.bias,n.shadowNormalBias=e.normalBias,n.shadowRadius=e.radius,n.shadowMapSize=e.mapSize,r.spotShadow[d]=n,r.spotShadowMap[d]=b,r.spotShadowMatrix[d]=t.shadow.matrix,v++}r.spot[d]=e,d++}else if(t.isRectAreaLight){const e=n.get(t);e.color.copy(s).multiplyScalar(x),e.halfWidth.set(.5*t.width,0,0),e.halfHeight.set(0,.5*t.height,0),r.rectArea[p]=e,p++}else if(t.isPointLight){const e=n.get(t);if(e.color.copy(t.color).multiplyScalar(t.intensity*y),e.distance=t.distance,e.decay=t.decay,t.castShadow){const e=t.shadow,n=i.get(t);n.shadowBias=e.bias,n.shadowNormalBias=e.normalBias,n.shadowRadius=e.radius,n.shadowMapSize=e.mapSize,n.shadowCameraNear=e.camera.near,n.shadowCameraFar=e.camera.far,r.pointShadow[h]=n,r.pointShadowMap[h]=b,r.pointShadowMatrix[h]=t.shadow.matrix,g++}r.point[h]=e,h++}else if(t.isHemisphereLight){const e=n.get(t);e.skyColor.copy(t.color).multiplyScalar(x*y),e.groundColor.copy(t.groundColor).multiplyScalar(x*y),r.hemi[f]=e,f++}}p>0&&(t.isWebGL2||!0===e.has(\"OES_texture_float_linear\")?(r.rectAreaLTC1=qo.LTC_FLOAT_1,r.rectAreaLTC2=qo.LTC_FLOAT_2):!0===e.has(\"OES_texture_half_float_linear\")?(r.rectAreaLTC1=qo.LTC_HALF_1,r.rectAreaLTC2=qo.LTC_HALF_2):console.error(\"THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.\")),r.ambient[0]=a,r.ambient[1]=l,r.ambient[2]=c;const x=r.hash;x.directionalLength===u&&x.pointLength===h&&x.spotLength===d&&x.rectAreaLength===p&&x.hemiLength===f&&x.numDirectionalShadows===m&&x.numPointShadows===g&&x.numSpotShadows===v||(r.directional.length=u,r.spot.length=d,r.rectArea.length=p,r.point.length=h,r.hemi.length=f,r.directionalShadow.length=m,r.directionalShadowMap.length=m,r.pointShadow.length=g,r.pointShadowMap.length=g,r.spotShadow.length=v,r.spotShadowMap.length=v,r.directionalShadowMatrix.length=m,r.pointShadowMatrix.length=g,r.spotShadowMatrix.length=v,x.directionalLength=u,x.pointLength=h,x.spotLength=d,x.rectAreaLength=p,x.hemiLength=f,x.numDirectionalShadows=m,x.numPointShadows=g,x.numSpotShadows=v,r.version=cl++)},setupView:function(e,t){let n=0,i=0,l=0,c=0,u=0;const h=t.matrixWorldInverse;for(let t=0,d=e.length;t<d;t++){const d=e[t];if(d.isDirectionalLight){const e=r.directional[n];e.direction.setFromMatrixPosition(d.matrixWorld),o.setFromMatrixPosition(d.target.matrixWorld),e.direction.sub(o),e.direction.transformDirection(h),n++}else if(d.isSpotLight){const e=r.spot[l];e.position.setFromMatrixPosition(d.matrixWorld),e.position.applyMatrix4(h),e.direction.setFromMatrixPosition(d.matrixWorld),o.setFromMatrixPosition(d.target.matrixWorld),e.direction.sub(o),e.direction.transformDirection(h),l++}else if(d.isRectAreaLight){const e=r.rectArea[c];e.position.setFromMatrixPosition(d.matrixWorld),e.position.applyMatrix4(h),a.identity(),s.copy(d.matrixWorld),s.premultiply(h),a.extractRotation(s),e.halfWidth.set(.5*d.width,0,0),e.halfHeight.set(0,.5*d.height,0),e.halfWidth.applyMatrix4(a),e.halfHeight.applyMatrix4(a),c++}else if(d.isPointLight){const e=r.point[i];e.position.setFromMatrixPosition(d.matrixWorld),e.position.applyMatrix4(h),i++}else if(d.isHemisphereLight){const e=r.hemi[u];e.direction.setFromMatrixPosition(d.matrixWorld),e.direction.transformDirection(h),e.direction.normalize(),u++}}},state:r}}function dl(e,t){const n=new hl(e,t),i=[],r=[];return{init:function(){i.length=0,r.length=0},state:{lightsArray:i,shadowsArray:r,lights:n},setupLights:function(e){n.setup(i,e)},setupLightsView:function(e){n.setupView(i,e)},pushLight:function(e){i.push(e)},pushShadow:function(e){r.push(e)}}}function pl(e,t){let n=new WeakMap;return{get:function(i,r=0){let o;return!1===n.has(i)?(o=new dl(e,t),n.set(i,[o])):r>=n.get(i).length?(o=new dl(e,t),n.get(i).push(o)):o=n.get(i)[r],o},dispose:function(){n=new WeakMap}}}
947class fl extends Lr{constructor(e){super(),this.type=\"MeshDepthMaterial\",this.depthPacking=on,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}fl.prototype.isMeshDepthMaterial=!0;class ml extends Lr{constructor(e){super(),this.type=\"MeshDistanceMaterial\",this.referencePosition=new pi,this.nearDistance=1,this.farDistance=1e3,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}ml.prototype.isMeshDistanceMaterial=!0;const gl=\"void main() {\\n\\tgl_Position = vec4( position, 1.0 );\\n}\",vl=\"uniform sampler2D shadow_pass;\\nuniform vec2 resolution;\\nuniform float radius;\\n#include <packing>\\nvoid main() {\\n\\tconst float samples = float( VSM_SAMPLES );\\n\\tfloat mean = 0.0;\\n\\tfloat squared_mean = 0.0;\\n\\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\\n\\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\\n\\tfor ( float i = 0.0; i < samples; i ++ ) {\\n\\t\\tfloat uvOffset = uvStart + i * uvStride;\\n\\t\\t#ifdef HORIZONTAL_PASS\\n\\t\\t\\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\\n\\t\\t\\tmean += distribution.x;\\n\\t\\t\\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\\n\\t\\t#else\\n\\t\\t\\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\\n\\t\\t\\tmean += depth;\\n\\t\\t\\tsquared_mean += depth * depth;\\n\\t\\t#endif\\n\\t}\\n\\tmean = mean / samples;\\n\\tsquared_mean = squared_mean / samples;\\n\\tfloat std_dev = sqrt( squared_mean - mean * mean );\\n\\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\\n}\";function yl(e,t,n){let i=new ko;const r=new Zn,o=new Zn,s=new li,a=new fl({depthPacking:sn}),l=new ml,c={},u=n.maxTextureSize,d={0:m,1:f,2:g},v=new Lo({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Zn},radius:{value:4}},vertexShader:gl,fragmentShader:vl}),y=v.clone();y.defines.HORIZONTAL_PASS=1;const _=new io;_.setAttribute(\"position\",new Br(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const b=new wo(_,v),w=this;function M(n,i){const r=t.update(b);v.defines.VSM_SAMPLES!==n.blurSamples&&(v.defines.VSM_SAMPLES=n.blurSamples,y.defines.VSM_SAMPLES=n.blurSamples,v.needsUpdate=!0,y.needsUpdate=!0),v.uniforms.shadow_pass.value=n.map.texture,v.uniforms.resolution.value=n.mapSize,v.uniforms.radius.value=n.radius,e.setRenderTarget(n.mapPass),e.clear(),e.renderBufferDirect(i,null,r,v,b,null),y.uniforms.shadow_pass.value=n.mapPass.texture,y.uniforms.resolution.value=n.mapSize,y.uniforms.radius.value=n.radius,e.setRenderTarget(n.map),e.clear(),e.renderBufferDirect(i,null,r,y,b,null)}function S(t,n,i,r,o,s,u){let h=null;const f=!0===r.isPointLight?t.customDistanceMaterial:t.customDepthMaterial;if(h=void 0!==f?f:!0===r.isPointLight?l:a,e.localClippingEnabled&&!0===i.clipShadows&&0!==i.clippingPlanes.length||i.displacementMap&&0!==i.displacementScale||i.alphaMap&&i.alphaTest>0){const e=h.uuid,t=i.uuid;let n=c[e];void 0===n&&(n={},c[e]=n);let r=n[t];void 0===r&&(r=h.clone(),n[t]=r),h=r}return h.visible=i.visible,h.wireframe=i.wireframe,h.side=u===p?null!==i.shadowSide?i.shadowSide:i.side:null!==i.shadowSide?i.shadowSide:d[i.side],h.alphaMap=i.alphaMap,h.alphaTest=i.alphaTest,h.clipShadows=i.clipShadows,h.clippingPlanes=i.clippingPlanes,h.clipIntersection=i.clipIntersection,h.displacementMap=i.displacementMap,h.displacementScale=i.displacementScale,h.displacementBias=i.displacementBias,h.wireframeLinewidth=i.wireframeLinewidth,h.linewidth=i.linewidth,!0===r.isPointLight&&!0===h.isMeshDistanceMaterial&&(h.referencePosition.setFromMatrixPosition(r.matrixWorld),h.nearDistance=o,h.farDistance=s),h}function E(n,r,o,s,a){if(!1===n.visible)return;if(n.layers.test(r.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&a===p)&&
vendor: 4,726 bytes, line 947
947(!n.frustumCulled||i.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(o.matrixWorldInverse,n.matrixWorld);const i=t.update(n),r=n.material;if(Array.isArray(r)){const t=i.groups;for(let l=0,c=t.length;l<c;l++){const c=t[l],u=r[c.materialIndex];if(u&&u.visible){const t=S(n,0,u,s,o.near,o.far,a);e.renderBufferDirect(o,null,i,t,n,c)}}}else if(r.visible){const t=S(n,0,r,s,o.near,o.far,a);e.renderBufferDirect(o,null,i,t,n,null)}}const l=n.children;for(let e=0,t=l.length;e<t;e++)E(l[e],r,o,s,a)}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=h,this.render=function(t,n,a){if(!1===w.enabled)return;if(!1===w.autoUpdate&&!1===w.needsUpdate)return;if(0===t.length)return;const l=e.getRenderTarget(),c=e.getActiveCubeFace(),h=e.getActiveMipmapLevel(),d=e.state;d.setBlending(x),d.buffers.color.setClear(1,1,1,1),d.buffers.depth.setTest(!0),d.setScissorTest(!1);for(let l=0,c=t.length;l<c;l++){const c=t[l],h=c.shadow;if(void 0===h){console.warn(\"THREE.WebGLShadowMap:\",c,\"has no shadow.\");continue}if(!1===h.autoUpdate&&!1===h.needsUpdate)continue;r.copy(h.mapSize);const f=h.getFrameExtents();if(r.multiply(f),o.copy(h.mapSize),(r.x>u||r.y>u)&&(r.x>u&&(o.x=Math.floor(u/f.x),r.x=o.x*f.x,h.mapSize.x=o.x),r.y>u&&(o.y=Math.floor(u/f.y),r.y=o.y*f.y,h.mapSize.y=o.y)),null===h.map&&!h.isPointLightShadow&&this.type===p){const e={minFilter:xe,magFilter:xe,format:ze};h.map=new ci(r.x,r.y,e),h.map.texture.name=c.name+\".shadowMap\",h.mapPass=new ci(r.x,r.y,e),h.camera.updateProjectionMatrix()}if(null===h.map){const e={minFilter:fe,magFilter:fe,format:ze};h.map=new ci(r.x,r.y,e),h.map.texture.name=c.name+\".shadowMap\",h.camera.updateProjectionMatrix()}e.setRenderTarget(h.map),e.clear();const m=h.getViewportCount();for(let e=0;e<m;e++){const t=h.getViewport(e);s.set(o.x*t.x,o.y*t.y,o.x*t.z,o.y*t.w),d.viewport(s),h.updateMatrices(c,e),i=h.getFrustum(),E(n,a,h.camera,c,this.type)}h.isPointLightShadow||this.type!==p||M(h,a),h.needsUpdate=!1}w.needsUpdate=!1,e.setRenderTarget(l,c,h)}}function xl(e,t,n){const i=n.isWebGL2,r=new function(){let t=!1;const n=new li;let i=null;const r=new li(0,0,0,0);return{setMask:function(n){i===n||t||(e.colorMask(n,n,n,n),i=n)},setLocked:function(e){t=e},setClear:function(t,i,o,s,a){!0===a&&(t*=s,i*=s,o*=s),n.set(t,i,o,s),!1===r.equals(n)&&(e.clearColor(t,i,o,s),r.copy(n))},reset:function(){t=!1,i=null,r.set(-1,0,0,0)}}},o=new function(){let t=!1,n=null,i=null,r=null;return{setTest:function(e){e?ye(2929):xe(2929)},setMask:function(i){n===i||t||(e.depthMask(i),n=i)},setFunc:function(t){if(i!==t){if(t)switch(t){case k:e.depthFunc(512);break;case V:e.depthFunc(519);break;case H:e.depthFunc(513);break;case j:e.depthFunc(515);break;case W:e.depthFunc(514);break;case q:e.depthFunc(518);break;case X:e.depthFunc(516);break;case Y:e.depthFunc(517);break;default:e.depthFunc(515)}else e.depthFunc(515);i=t}},setLocked:function(e){t=e},setClear:function(t){r!==t&&(e.clearDepth(t),r=t)},reset:function(){t=!1,n=null,i=null,r=null}}},c=new function(){let t=!1,n=null,i=null,r=null,o=null,s=null,a=null,l=null,c=null;return{setTest:function(e){t||(e?ye(2960):xe(2960))},setMask:function(i){n===i||t||(e.stencilMask(i),n=i)},setFunc:function(t,n,s){i===t&&r===n&&o===s||(e.stencilFunc(t,n,s),i=t,r=n,o=s)},setOp:function(t,n,i){s===t&&a===n&&l===i||(e.stencilOp(t,n,i),s=t,a=n,l=i)},setLocked:function(e){t=e},setClear:function(t){c!==t&&(e.clearStencil(t),c=t)},reset:function(){t=!1,n=null,i=null,r=null,o=null,s=null,a=null,l=null,c=null}}};let u={},h=null,d={},p=null,f=!1,v=null,y=null,J=null,Z=null,$=null,K=null,Q=null,ee=!1,te=null,ne=null,ie=null,re=null,oe=null;const se=e.getParameter(35661);let ae=!1,le=0;const ce=e.getParameter(7938);-1!==ce.indexOf(\"WebGL\")?(le=parseFloat(/^WebGL (\\d)/.exec(ce)[1]),ae=le>=1):-1!==ce.indexOf(\"OpenGL ES\")&&(le=parseFloat(/^OpenGL ES (\\d)/.exec(ce)[1]),ae=le>=2);let ue=null,he={};const de=e.getParameter(3088),pe=e.getParameter(2978),fe=(new li).fromArray(de),me=(new li).fromArray(pe);function ge(t,n,i){const r=new Uint8Array(4),o=e.createTexture();e.bindTexture(t,o),e.texParameteri(t,10241,9728),e.texParameteri(t,10240,9728);for(let t=0;t<i;t++)e.texImage2D(n+t,0,6408,1,1,0,6408,5121,r);return o}const ve={};function ye(t){!0!==u[t]&&(e.enable(t),u[t]=!0)}function xe(t){!1!==u[t]&&(e.disable(t),u[t]=!1)}ve[3553]=ge(3553,3553,1),ve[34067]=ge(34067,34069,6),r.setClear(0,0,0,1),o.setClear(1),c.setClear(0),ye(2929),o.setFunc(j),Me(!1),Se(a),ye(2884),we(x);const _e={[E]:32774,[T]:32778,[A]:32779};if(i)_e[L]=32775,_e[C]=32776;else{const e=t.get(\"EXT_blend_minmax\");null!==e&&(_e[L]=e.MIN_EXT,_e[C]=e.MAX_EXT)}const be={[P]:0,[R]:1,[D]:768,[I]:770,[G]:776,[z]:774,[N]:772,[O]:769,[F]:771,[B]:775,[U]:773};
vendor: 4,864 bytes, line 947
947function we(t,n,i,r,o,s,a,l){if(t!==x){if(!1===f&&(ye(3042),f=!0),t===S)o=o||n,s=s||i,a=a||r,n===y&&o===$||(e.blendEquationSeparate(_e[n],_e[o]),y=n,$=o),i===J&&r===Z&&s===K&&a===Q||(e.blendFuncSeparate(be[i],be[r],be[s],be[a]),J=i,Z=r,K=s,Q=a),v=t,ee=null;else if(t!==v||l!==ee){if(y===E&&$===E||(e.blendEquation(32774),y=E,$=E),l)switch(t){case _:e.blendFuncSeparate(1,771,1,771);break;case b:e.blendFunc(1,1);break;case w:e.blendFuncSeparate(0,0,769,771);break;case M:e.blendFuncSeparate(0,768,0,770);break;default:console.error(\"THREE.WebGLState: Invalid blending: \",t)}else switch(t){case _:e.blendFuncSeparate(770,771,1,771);break;case b:e.blendFunc(770,1);break;case w:e.blendFunc(0,769);break;case M:e.blendFunc(0,768);break;default:console.error(\"THREE.WebGLState: Invalid blending: \",t)}J=null,Z=null,K=null,Q=null,v=t,ee=l}}else!0===f&&(xe(3042),f=!1)}function Me(t){te!==t&&(t?e.frontFace(2304):e.frontFace(2305),te=t)}function Se(t){t!==s?(ye(2884),t!==ne&&(t===a?e.cullFace(1029):t===l?e.cullFace(1028):e.cullFace(1032))):xe(2884),ne=t}function Ee(t,n,i){t?(ye(32823),re===n&&oe===i||(e.polygonOffset(n,i),re=n,oe=i)):xe(32823)}function Te(t){void 0===t&&(t=33984+se-1),ue!==t&&(e.activeTexture(t),ue=t)}return{buffers:{color:r,depth:o,stencil:c},enable:ye,disable:xe,bindFramebuffer:function(t,n){return null===n&&null!==h&&(n=h),d[t]!==n&&(e.bindFramebuffer(t,n),d[t]=n,i&&(36009===t&&(d[36160]=n),36160===t&&(d[36009]=n)),!0)},bindXRFramebuffer:function(t){t!==h&&(e.bindFramebuffer(36160,t),h=t)},useProgram:function(t){return p!==t&&(e.useProgram(t),p=t,!0)},setBlending:we,setMaterial:function(e,t){e.side===g?xe(2884):ye(2884);let n=e.side===m;t&&(n=!n),Me(n),e.blending===_&&!1===e.transparent?we(x):we(e.blending,e.blendEquation,e.blendSrc,e.blendDst,e.blendEquationAlpha,e.blendSrcAlpha,e.blendDstAlpha,e.premultipliedAlpha),o.setFunc(e.depthFunc),o.setTest(e.depthTest),o.setMask(e.depthWrite),r.setMask(e.colorWrite);const i=e.stencilWrite;c.setTest(i),i&&(c.setMask(e.stencilWriteMask),c.setFunc(e.stencilFunc,e.stencilRef,e.stencilFuncMask),c.setOp(e.stencilFail,e.stencilZFail,e.stencilZPass)),Ee(e.polygonOffset,e.polygonOffsetFactor,e.polygonOffsetUnits),!0===e.alphaToCoverage?ye(32926):xe(32926)},setFlipSided:Me,setCullFace:Se,setLineWidth:function(t){t!==ie&&(ae&&e.lineWidth(t),ie=t)},setPolygonOffset:Ee,setScissorTest:function(e){e?ye(3089):xe(3089)},activeTexture:Te,bindTexture:function(t,n){null===ue&&Te();let i=he[ue];void 0===i&&(i={type:void 0,texture:void 0},he[ue]=i),i.type===t&&i.texture===n||(e.bindTexture(t,n||ve[t]),i.type=t,i.texture=n)},unbindTexture:function(){const t=he[ue];void 0!==t&&void 0!==t.type&&(e.bindTexture(t.type,null),t.type=void 0,t.texture=void 0)},compressedTexImage2D:function(){try{e.compressedTexImage2D.apply(e,arguments)}catch(e){console.error(\"THREE.WebGLState:\",e)}},texImage2D:function(){try{e.texImage2D.apply(e,arguments)}catch(e){console.error(\"THREE.WebGLState:\",e)}},texImage3D:function(){try{e.texImage3D.apply(e,arguments)}catch(e){console.error(\"THREE.WebGLState:\",e)}},scissor:function(t){!1===fe.equals(t)&&(e.scissor(t.x,t.y,t.z,t.w),fe.copy(t))},viewport:function(t){!1===me.equals(t)&&(e.viewport(t.x,t.y,t.z,t.w),me.copy(t))},reset:function(){e.disable(3042),e.disable(2884),e.disable(2929),e.disable(32823),e.disable(3089),e.disable(2960),e.disable(32926),e.blendEquation(32774),e.blendFunc(1,0),e.blendFuncSeparate(1,0,1,0),e.colorMask(!0,!0,!0,!0),e.clearColor(0,0,0,0),e.depthMask(!0),e.depthFunc(513),e.clearDepth(1),e.stencilMask(4294967295),e.stencilFunc(519,0,4294967295),e.stencilOp(7680,7680,7680),e.clearStencil(0),e.cullFace(1029),e.frontFace(2305),e.polygonOffset(0,0),e.activeTexture(33984),e.bindFramebuffer(36160,null),!0===i&&(e.bindFramebuffer(36009,null),e.bindFramebuffer(36008,null)),e.useProgram(null),e.lineWidth(1),e.scissor(0,0,e.canvas.width,e.canvas.height),e.viewport(0,0,e.canvas.width,e.canvas.height),u={},ue=null,he={},h=null,d={},p=null,f=!1,v=null,y=null,J=null,Z=null,$=null,K=null,Q=null,ee=!1,te=null,ne=null,ie=null,re=null,oe=null,fe.set(0,0,e.canvas.width,e.canvas.height),me.set(0,0,e.canvas.width,e.canvas.height),r.reset(),o.reset(),c.reset()}}}function _l(e,t,n,i,r,o,s){const a=r.isWebGL2,l=r.maxTextures,c=r.maxCubemapSize,u=r.maxTextureSize,h=r.maxSamples,d=new WeakMap;let p,f=!1;try{f=\"undefined\"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext(\"2d\")}catch(e){}function m(e,t){return f?new OffscreenCanvas(e,t):ti(\"canvas\")}function g(e,t,n,i){let r=1;if((e.width>i||e.height>i)&&(r=i/Math.max(e.width,e.height)),r<1||!0===t){if(\"undefined\"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||\"undefined\"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||\"undefined\"!=typeof ImageBitmap&&e instanceof ImageBitmap){const i=t?Yn:Math.floor,o=i(r*e.width),s=i(r*e.he
947ight);void 0===p&&(p=m(o,s));const a=n?m(o,s):p;return a.width=o,a.height=s,a.getContext(\"2d\").drawImage(e,0,0,o,s),console.warn(\"THREE.WebGLRenderer: Texture has been resized from (\"+e.width+\"x\"+e.height+\") to (\"+o+\"x\"+s+\").\"),a}return\"data\"in e&&console.warn(\"THREE.WebGLRenderer: Image in DataTexture is too big (\"+e.width+\"x\"+e.height+\").\"),e}return e}function v(e){return qn(e.width)&&qn(e.height)}function y(e,t){return e.generateMipmaps&&t&&e.minFilter!==fe&&e.minFilter!==xe}function x(t,n,r,o,s=1){e.generateMipmap(t),i.get(n).__maxMipLevel=Math.log2(Math.max(r,o,s))}function _(n,i,r,o){if(!1===a)return i;if(null!==n){if(void 0!==e[n])return e[n];console.warn(\"THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '\"+n+\"'\")}let s=i;return 6403===i&&(5126===r&&(s=33326),5131===r&&(s=33325),5121===r&&(s=33321)),6407===i&&(5126===r&&(s=34837),5131===r&&(s=34843),5121===r&&(s=32849)),6408===i&&(5126===r&&(s=34836),5131===r&&(s=34842),5121===r&&(s=o===$t?35907:32856)),33325!==s&&33326!==s&&34842!==s&&34836!==s||t.get(\"EXT_color_buffer_float\"),s}function b(e){return e===fe||e===me||e===ve?9728:9729}function w(t){const n=t.target;n.removeEventListener(\"dispose\",w),function(t){const n=i.get(t);void 0!==n.__webglInit&&(e.deleteTexture(n.__webglTexture),i.remove(t))}(n),n.isVideoTexture&&d.delete(n),s.memory.textures--}function M(t){const n=t.target;n.removeEventListener(\"dispose\",M),function(t){const n=t.texture,r=i.get(t),o=i.get(n);if(t){if(void 0!==o.__webglTexture&&(e.deleteTexture(o.__webglTexture),s.memory.textures--),t.depthTexture&&t.depthTexture.dispose(),t.isWebGLCubeRenderTarget)for(let t=0;t<6;t++)e.deleteFramebuffer(r.__webglFramebuffer[t]),r.__webglDepthbuffer&&e.deleteRenderbuffer(r.__webglDepthbuffer[t]);else e.deleteFramebuffer(r.__webglFramebuffer),r.__webglDepthbuffer&&e.deleteRenderbuffer(r.__webglDepthbuffer),r.__webglMultisampledFramebuffer&&e.deleteFramebuffer(r.__webglMultisampledFramebuffer),r.__webglColorRenderbuffer&&e.deleteRenderbuffer(r.__webglColorRenderbuffer),r.__webglDepthRenderbuffer&&e.deleteRenderbuffer(r.__webglDepthRenderbuffer);if(t.isWebGLMultipleRenderTargets)for(let t=0,r=n.length;t<r;t++){const r=i.get(n[t]);r.__webglTexture&&(e.deleteTexture(r.__webglTexture),s.memory.textures--),i.remove(n[t])}i.remove(n),i.remove(t)}}(n)}let S=0;function E(e,t){const r=i.get(e);if(e.isVideoTexture&&function(e){const t=s.render.frame;d.get(e)!==t&&(d.set(e,t),e.update())}(e),e.version>0&&r.__version!==e.version){const n=e.image;if(void 0===n)console.warn(\"THREE.WebGLRenderer: Texture marked for update but image is undefined\");else{if(!1!==n.complete)return void R(r,e,t);console.warn(\"THREE.WebGLRenderer: Texture marked for update but image is incomplete\")}}n.activeTexture(33984+t),n.bindTexture(3553,r.__webglTexture)}function T(t,r){const s=i.get(t);t.version>0&&s.__version!==t.version?function(t,i,r){if(6!==i.image.length)return;P(t,i),n.activeTexture(33984+r),n.bindTexture(34067,t.__webglTexture),e.pixelStorei(37440,i.flipY),e.pixelStorei(37441,i.premultiplyAlpha),e.pixelStorei(3317,i.unpackAlignment),e.pixelStorei(37443,0);const s=i&&(i.isCompressedTexture||i.image[0].isCompressedTexture),l=i.image[0]&&i.image[0].isDataTexture,u=[];for(let e=0;e<6;e++)u[e]=s||l?l?i.image[e].image:i.image[e]:g(i.image[e],!1,!0,c);const h=u[0],d=v(h)||a,p=o.convert(i.format),f=o.convert(i.type),m=_(i.internalFormat,p,f,i.encoding);let b;if(C(34067,i,d),s){for(let e=0;e<6;e++){b=u[e].mipmaps;for(let t=0;t<b.length;t++){const r=b[t];i.format!==ze&&i.format!==Ue?null!==p?n.compressedTexImage2D(34069+e,t,m,r.width,r.height,0,r.data):console.warn(\"THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()\"):n.texImage2D(34069+e,t,m,r.width,r.height,0,p,f,r.data)}}t.__maxMipLevel=b.length-1}else{b=i.mipmaps;for(let e=0;e<6;e++)if(l){n.texImage2D(34069+e,0,m,u[e].width,u[e].height,0,p,f,u[e].data);for(let t=0;t<b.length;t++){const i=b[t].image[e].image;n.texImage2D(34069+e,t+1,m,i.width,i.height,0,p,f,i.data)}}else{n.texImage2D(34069+e,0,m,p,f,u[e]);for(let t=0;t<b.length;t++){const i=b[t];n.texImage2D(34069+e,t+1,m,p,f,i.image[e])}}t.__maxMipLevel=b.length}y(i,d)&&x(34067,i,h.width,h.height),t.__version=i.version,i.onUp
vendor: 18,038 bytes, line 947
947date&&i.onUpdate(i)}(s,t,r):(n.activeTexture(33984+r),n.bindTexture(34067,s.__webglTexture))}const A={[he]:10497,[de]:33071,[pe]:33648},L={[fe]:9728,[me]:9984,[ve]:9986,[xe]:9729,[_e]:9985,[we]:9987};function C(n,o,s){if(s?(e.texParameteri(n,10242,A[o.wrapS]),e.texParameteri(n,10243,A[o.wrapT]),32879!==n&&35866!==n||e.texParameteri(n,32882,A[o.wrapR]),e.texParameteri(n,10240,L[o.magFilter]),e.texParameteri(n,10241,L[o.minFilter])):(e.texParameteri(n,10242,33071),e.texParameteri(n,10243,33071),32879!==n&&35866!==n||e.texParameteri(n,32882,33071),o.wrapS===de&&o.wrapT===de||console.warn(\"THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.\"),e.texParameteri(n,10240,b(o.magFilter)),e.texParameteri(n,10241,b(o.minFilter)),o.minFilter!==fe&&o.minFilter!==xe&&console.warn(\"THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.\")),!0===t.has(\"EXT_texture_filter_anisotropic\")){const s=t.get(\"EXT_texture_filter_anisotropic\");if(o.type===Pe&&!1===t.has(\"OES_texture_float_linear\"))return;if(!1===a&&o.type===Re&&!1===t.has(\"OES_texture_half_float_linear\"))return;(o.anisotropy>1||i.get(o).__currentAnisotropy)&&(e.texParameterf(n,s.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(o.anisotropy,r.getMaxAnisotropy())),i.get(o).__currentAnisotropy=o.anisotropy)}}function P(t,n){void 0===t.__webglInit&&(t.__webglInit=!0,n.addEventListener(\"dispose\",w),t.__webglTexture=e.createTexture(),s.memory.textures++)}function R(t,i,r){let s=3553;i.isDataTexture2DArray&&(s=35866),i.isDataTexture3D&&(s=32879),P(t,i),n.activeTexture(33984+r),n.bindTexture(s,t.__webglTexture),e.pixelStorei(37440,i.flipY),e.pixelStorei(37441,i.premultiplyAlpha),e.pixelStorei(3317,i.unpackAlignment),e.pixelStorei(37443,0);const l=function(e){return!a&&(e.wrapS!==de||e.wrapT!==de||e.minFilter!==fe&&e.minFilter!==xe)}(i)&&!1===v(i.image),c=g(i.image,l,!1,u),h=v(c)||a,d=o.convert(i.format);let p,f=o.convert(i.type),m=_(i.internalFormat,d,f,i.encoding);C(s,i,h);const b=i.mipmaps;if(i.isDepthTexture)m=6402,a?m=i.type===Pe?36012:i.type===Ce?33190:i.type===Fe?35056:33189:i.type===Pe&&console.error(\"WebGLRenderer: Floating point depth texture requires WebGL2.\"),i.format===Ve&&6402===m&&i.type!==Ae&&i.type!==Ce&&(console.warn(\"THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture.\"),i.type=Ae,f=o.convert(i.type)),i.format===He&&6402===m&&(m=34041,i.type!==Fe&&(console.warn(\"THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture.\"),i.type=Fe,f=o.convert(i.type))),n.texImage2D(3553,0,m,c.width,c.height,0,d,f,null);else if(i.isDataTexture)if(b.length>0&&h){for(let e=0,t=b.length;e<t;e++)p=b[e],n.texImage2D(3553,e,m,p.width,p.height,0,d,f,p.data);i.generateMipmaps=!1,t.__maxMipLevel=b.length-1}else n.texImage2D(3553,0,m,c.width,c.height,0,d,f,c.data),t.__maxMipLevel=0;else if(i.isCompressedTexture){for(let e=0,t=b.length;e<t;e++)p=b[e],i.format!==ze&&i.format!==Ue?null!==d?n.compressedTexImage2D(3553,e,m,p.width,p.height,0,p.data):console.warn(\"THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()\"):n.texImage2D(3553,e,m,p.width,p.height,0,d,f,p.data);t.__maxMipLevel=b.length-1}else if(i.isDataTexture2DArray)n.texImage3D(35866,0,m,c.width,c.height,c.depth,0,d,f,c.data),t.__maxMipLevel=0;else if(i.isDataTexture3D)n.texImage3D(32879,0,m,c.width,c.height,c.depth,0,d,f,c.data),t.__maxMipLevel=0;else if(b.length>0&&h){for(let e=0,t=b.length;e<t;e++)p=b[e],n.texImage2D(3553,e,m,d,f,p);i.generateMipmaps=!1,t.__maxMipLevel=b.length-1}else n.texImage2D(3553,0,m,d,f,c),t.__maxMipLevel=0;y(i,h)&&x(s,i,c.width,c.height),t.__version=i.version,i.onUpdate&&i.onUpdate(i)}function D(t,r,s,a,l){const c=o.convert(s.format),u=o.convert(s.type),h=_(s.internalFormat,c,u,s.encoding);32879===l||35866===l?n.texImage3D(l,0,h,r.width,r.height,r.depth,0,c,u,null):n.texImage2D(l,0,h,r.width,r.height,0,c,u,null),n.bindFramebuffer(36160,t),e.framebufferTexture2D(36160,a,l,i.get(s).__webglTexture,0),n.bindFramebuffer(36160,null)}function O(t,n,i){if(e.bindRenderbuffer(36161,t),n.depthBuffer&&!n.stencilBuffer){let r=33189;if(i){const t=n.depthTexture;t&&t.isDepthTexture&&(t.type===Pe?r=36012:t.type===Ce&&(r=33190));const i=I(n);e.renderbufferStorageMultisample(36161,i,r,n.width,n.height)}else e.renderbufferStorage(36161,r,n.width,n.height);e.framebufferRenderbuffer(36160,36096,36161,t)}else if(n.depthBuffer&&n.stencilBuffer){if(i){const t=I(n);e.renderbufferStorageMultisample(36161,t,35056,n.width,n.height)}else e.renderbufferStorage(36161,34041,n.width,n.height);e.framebufferRenderbuffer(36160,33306,36161,t)}else{const t=!0===n.isWebGLMultipleRenderTargets?n.texture[0]:n.texture,r=o.convert(t.format),s=o.convert(t.type),a=_(t.internalFormat,r,s,t.encoding);if(i){const t=I(n);e.renderbufferStorageMultisample(36161,t,a,n.width,n.height)}else e.renderbufferStorage(36161,a,n.width,n.height)}e.bindRenderbuffer(36161,null)}function I(e){return a&&e.isWebGLMultisampleRenderTarget?Math.min(h,e.samples):0}let F=!1,N=!1;this.allocateTextureUnit=function(){const e=S;return e>=l&&console.warn(\"THREE.WebGLTextures: Trying to use \"+e+\" texture units while this GPU supports only \"+l),S+=1,e},this.resetTextureUnits=function(){S=0},this.setTexture2D=E,this.setTexture2DArray=function(e,t){const r=i.get(e);e.version>0&&r.__version!==e.version?R(r,e,t):(n.activeTexture(33984+t),n.bindTexture(35866,r.__webglTexture))},this.setTexture3D=function(e,t){const r=i.get(e);e.version>0&&r.__version!==e.version?R(r,e,t):(n.activeTexture(33984+t),n.bindTexture(32879,r.__webglTexture))},this.setTextureCube=T,this.setupRenderTarget=function(t){const l=t.texture,c=i.get(t),u=i.get(l);t.addEventListener(\"dispose\",M),!0!==t.isWebGLMultipleRenderTargets&&(u.__webglTexture=e.createTexture(),u.__version=l.version,s.memory.textures++);const h=!0===t.isWebGLCubeRenderTarget,d=!0===t.isWebGLMultipleRenderTargets,p=!0===t.isWebGLMultisampleRenderTarget,f=l.isDataTexture3D||l.isDataTexture2DArray,m=v(t)||a;if(!a||l.format!==Ue||l.type!==Pe&&l.type!==Re||(l.format=ze,console.warn(\"THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.\")),h){c.__webglFramebuffer=[];for(let t=0;t<6;t++)c.__webglFramebuffer[t]=e.createFramebuffer()}else if(c.__webglFramebuffer=e.createFramebuffer(),d)if(r.drawBuffers){const n=t.texture;for(let t=0,r=n.length;t<r;t++){const r=i.get(n[t]);void 0===r.__webglTexture&&(r.__webglTexture=e.createTexture(),s.memory.textures++)}}else console.warn(\"THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.\");else if(p)if(a){c.__webglMultisampledFramebuffer=e.createFramebuffer(),c.__webglColorRenderbuffer=e.createRenderbuffer(),e.bindRenderbuffer(36161,c.__webglColorRenderbuffer);const i=o.convert(l.format),r=o.convert(l.type),s=_(l.internalFormat,i,r,l.encoding),a=I(t);e.renderbufferStorageMultisample(36161,a,s,t.width,t.height),n.bindFramebuffer(36160,c.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(36160,36064,36161,c.__webglColorRenderbuffer),e.bindRenderbuffer(36161,null),t.depthBuffer&&(c.__webglDepthRenderbuffer=e.createRenderbuffer(),O(c.__webglDepthRenderbuffer,t,!0)),n.bindFramebuffer(36160,null)}else console.warn(\"THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.\");if(h){n.bindTexture(34067,u.__webglTexture),C(34067,l,m);for(let e=0;e<6;e++)D(c.__webglFramebuffer[e],t,l,36064,34069+e);y(l,m)&&x(34067,l,t.width,t.height),n.unbindTexture()}else if(d){const e=t.texture;for(let r=0,o=e.length;r<o;r++){const o=e[r],s=i.get(o);n.bindTexture(3553,s.__webglTexture),C(3553,o,m),D(c.__webglFramebuffer,t,o,36064+r,3553),y(o,m)&&x(3553,o,t.width,t.height)}n.unbindTexture()}else{let e=3553;f&&(a?e=l.isDataTexture3D?32879:35866:console.warn(\"THREE.DataTexture3D and THREE.DataTexture2DArray only supported with WebGL2.\")),n.bindTexture(e,u.__webglTexture),C(e,l,m),D(c.__webglFramebuffer,t,l,36064,e),y(l,m)&&x(e,l,t.width,t.height,t.depth),n.unbindTexture()}t.depthBuffer&&function(t){const r=i.get(t),o=!0===t.isWebGLCubeRenderTarget;if(t.depthTexture){if(o)throw new Error(\"target.depthTexture not supported in Cube render targets\");!function(t,r){if(r&&r.isWebGLCubeRenderTarget)throw new Error(\"Depth Texture with cube render targets is not supported\");if(n.bindFramebuffer(36160,t),!r.depthTexture||!r.depthTexture.isDepthTexture)throw new Error(\"renderTarget.depthTexture must be an instance of THREE.DepthTexture\");i.get(r.depthTexture).__webglTexture&&r.depthTexture.image.width===r.width&&r.depthTexture.image.height===r.height||(r.depthTexture.image.width=r.width,r.depthTexture.image.height=r.height,r.depthTexture.needsUpdate=!0),E(r.depthTexture,0);const o=i.get(r.depthTexture).__webglTexture;if(r.depthTexture.format===Ve)e.framebufferTexture2D(36160,36096,3553,o,0);else{if(r.depthTexture.format!==He)throw new Error(\"Unknown depthTexture format\");e.framebufferTexture2D(36160,33306,3553,o,0)}}(r.__webglFramebuffer,t)}else if(o){r.__webglDepthbuffer=[];for(let i=0;i<6;i++)n.bindFramebuffer(36160,r.__webglFramebuffer[i]),r.__webglDepthbuffer[i]=e.createRenderbuffer(),O(r.__webglDepthbuffer[i],t,!1)}else n.bindFramebuffer(36160,r.__webglFramebuffer),r.__webglDepthbuffer=e.createRenderbuffer(),O(r.__webglDepthbuffer,t,!1);n.bindFramebuffer(36160,null)}(t)},this.updateRenderTargetMipmap=function(e){const t=v(e)||a,r=!0===e.isWebGLMultipleRenderTargets?e.texture:[e.texture];for(let o=0,s=r.length;o<s;o++){const s=r[o];if(y(s,t)){const t=e.isWebGLCubeRenderTarget?34067:3553,r=i.get(s).__webglTexture;n.bindTexture(t,r),x(t,s,e.width,e.height),n.unbindTexture()}}},this.updateMultisampleRenderTarget=function(t){if(t.isWebGLMultisampleRenderTarget)if(a){const r=t.width,o=t.height;let s=16384;t.depthBuffer&&(s|=256),t.stencilBuffer&&(s|=1024);const a=i.get(t);n.bindFramebuffer(36008,a.__webglMultisampledFramebuffer),n.bindFramebuffer(36009,a.__webglFramebuffer),e.blitFramebuffer(0,0,r,o,0,0,r,o,s,9728),n.bindFramebuffer(36008,null),n.bindFramebuffer(36009,a.__webglMultisampledFramebuffer)}else console.warn(\"THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.\")},this.safeSetTexture2D=function(e,t){e&&e.isWebGLRenderTarget&&(!1===F&&(console.warn(\"THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead.\"),F=!0),e=e.texture),E(e,t)},this.safeSetTextureCube=function(e,t){e&&e.isWebGLCubeRenderTarget&&(!1===N&&(console.warn(\"THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead.\"),N=!0),e=e.texture),T(e,t)}}function bl(e,t,n){const i=n.isWebGL2;return{convert:function(e){let n;if(e===Se)return 5121;if(e===De)return 32819;if(e===Oe)return 32820;if(e===Ie)return 33635;if(e===Ee)return 5120;if(e===Te)return 5122;if(e===Ae)return 5123;if(e===Le)return 5124;if(e===Ce)return 5125;if(e===Pe)return 5126;if(e===Re)return i?5131:(n=t.get(\"OES_texture_half_float\"),null!==n?n.HALF_FLOAT_OES:null);if(e===Ne)return 6406;if(e===Ue)return 6407;if(e===ze)return 6408;if(e===Be)return 6409;if(e===Ge)return 6410;if(e===Ve)return 6402;if(e===He)return 34041;if(e===je)return 6403;if(e===We)return 36244;if(e===qe)return 33319;if(e===Xe)return 33320;if(e===Ye)return 36248;if(e===Je)return 36249;if(e===Ze||e===$e||e===Ke||e===Qe){if(n=t.get(\"WEBGL_compressed_texture_s3tc\"),null===n)return null;if(e===Ze)return n.COMPRESSED_RGB_S3TC_DXT1_EXT;if(e===$e)return n.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(e===Ke)return n.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(e===Qe)return n.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(e===et||e===tt||e===nt||e===it){if(n=t.get(\"WEBGL_compressed_texture_pvrtc\"),null===n)return null;if(e===et)return n.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(e===tt)return n.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(e===nt)return n.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(e===it)return n.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(e===rt)return n=t.get(\"WEBGL_compressed_texture_etc1\"),null!==n?n.COMPRESSED_RGB_ETC1_WEBGL:null;if((e===ot||e===st)&&(n=t.get(\"WEBGL_compressed_texture_etc\"),null!==n)){if(e===ot)return n.COMPRESSED_RGB8_ETC2;if(e===st)return n.COMPRESSED_RGBA8_ETC2_EAC}return e===at||e===lt||e===ct||e===ut||e===ht||e===dt||e===pt||e===ft||e===mt||e===gt||e===vt||e===yt||e===xt||e===_t||e===wt||e===Mt||e===St||e===Et||e===Tt||e===At||e===Lt||e===Ct||e===Pt||e===Rt||e===Dt||e===Ot||e===It||e===Ft?(n=t.get(\"WEBGL_compressed_texture_astc\"),null!==n?e:null):e===bt?(n=t.get(\"EXT_texture_compression_bptc\"),null!==n?e:null):e===Fe?i?34042:(n=t.get(\"WEBGL_depth_texture\"),null!==n?n.UNSIGNED_INT_24_8_WEBGL:null):void 0}}}class wl extends Po{constructor(e=[]){super(),this.cameras=e}}wl.prototype.isArrayCamera=!0;class Ml extends mr{constructor(){super(),this.type=\"Group\"}}Ml.prototype.isGroup=!0;const Sl={type:\"move\"};class El{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new Ml,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return null===this._targetRay&&(this._targetRay=new Ml,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new pi,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new pi),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new Ml,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new pi,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new pi),this._grip}dispatchEvent(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),null!==this._hand&&this._hand.dispatchEvent(e),this}disconnect(e){return this.dispatchEvent({type:\"disconnected\",data:e}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(e,t,n){let i=null,r=null,o=null;const s=this._targetRay,a=this._grip,l=this._hand;if(e&&\"visible-blurred\"!==t.session.visibilityState)if(null!==s&&(i=t.getPose(e.targetRaySpace,n),null!==i&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1,this.dispatchEvent(Sl))),l&&e.hand){o=!0;for(const i of e.hand.values()){const e=t.getJointPose(i,n);if(void 0===l.joints[i.jointName]){const e=new Ml;e.matrixAutoUpdate=!1,e.visible=!1,l.joints[i.jointName]=e,l.add(e)}const r=l.joints[i.jointName];null!==e&&(r.matrix.fromArray(e.transform.matrix),r.matrix.decompose(r.position,r.rotation,r.scale),r.jointRadius=e.radius),r.visible=null!==e}const i=l.joints[\"index-finger-tip\"],r=l.joints[\"thumb-tip\"],s=i.position.distanceTo(r.position),a=.02,c=.005;l.inputState.pinching&&s>a+c?(l.inputState.pinching=!1,this.dispatchEvent({type:\"pinchend\",handedness:e.handedness,target:this})):!l.inputState.pinching&&s<=a-c&&(l.inputState.pinching=!0,this.dispatchEvent({type:\"pinchstart\",handedness:e.handedness,target:this}))}else null!==a&&e.gripSpace&&(r=t.getPose(e.gripSpace,n),null!==r&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),r.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(r.linearVelocity)):a.hasLinearVelocity=!1,r.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(r.angularVelocity)):a.hasAngularVelocity=!1));return null!==s&&(s.visible=null!==i),null!==a&&(a.visible=null!==r),null!==l&&(l.visible=null!==o),this}}class Tl extends Nn{constructor(e,t){super();const n=this,i=e.state;let r=null,o=1,s=null,a=\"local-floor\",l=null,c=null,u=null,h=null,d=null,p=!1,f=null,m=null,g=null,v=null,y=null,x=null;const _=[],b=new Map,w=new Po;w.layers.enable(1),w.viewport=new li;const M=new Po;M.layers.enable(2),M.viewport=new li;const S=[w,M],E=new wl;E.layers.enable(1),E.layers.enable(2);let T=null,A=null;function L(e){const t=b.get(e.inputSource);t&&t.dispatchEvent({type:e.type,data:e.inputSource})}function C(){b.forEach((function(e,t){e.disconnect(t)})),b.clear(),T=null,A=null,i.bindXRFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),u&&t.deleteFramebuffer(u),f&&t.deleteFramebuffer(f),m&&t.deleteRenderbuffer(m),g&&t.deleteRenderbuffer(g),u=null,f=null,m=null,g=null,d=null,h=null,c=null,r=null,F.stop(),n.isPresenting=!1,n.dispatchEvent({type:\"sessionend\"})}function P(e){const t=r.inputSources;for(let e=0;e<_.length;e++)b.set(t[e],_[e]);for(let t=0;t<e.removed.length;t++){const n=e.removed[t],i=b.get(n);i&&(i.dispatchEvent({type:\"disconnected\",data:n}),b.delete(n))}for(let t=0;t<e.added.length;t++){const n=e.added[t],i=b.get(n);i&&i.dispatchEvent({type:\"connected\",data:n})}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(e){let t=_[e];return void 0===t&&(t=new El,_[e]=t),t.getTargetRaySpace()},this.getControllerGrip=function(e){let t=_[e];return void 0===t&&(t=new El,_[e]=t),t.getGripSpace()},this.getHand=function(e){let t=_[e];return void 0===t&&(t=new El,_[e]=t),t.getHandSpace()},this.setFramebufferScaleFactor=function(e){o=e,!0===n.isPresenting&&console.warn(\"THREE.WebXRManager: Cannot change framebuffer scale while presenting.\")},this.setReferenceSpaceType=function(e){a=e,!0===n.isPresenting&&console.warn(\"THREE.WebXRManager: Cannot change reference space type while presenting.\")},this.getReferenceSpace=function(){return s},this.getBaseLayer=function(){return null!==h?h:d},this.getBinding=function(){return c},this.getFrame=function(){return v}
947,this.getSession=function(){return r},this.setSession=async function(e){if(r=e,null!==r){r.addEventListener(\"select\",L),r.addEventListener(\"selectstart\",L),r.addEventListener(\"selectend\",L),r.addEventListener(\"squeeze\",L),r.addEventListener(\"squeezestart\",L),r.addEventListener(\"squeezeend\",L),r.addEventListener(\"end\",C),r.addEventListener(\"inputsourceschange\",P);const e=t.getContextAttributes();if(!0!==e.xrCompatible&&await t.makeXRCompatible(),void 0===r.renderState.layers){const n={antialias:e.antialias,alpha:e.alpha,depth:e.depth,stencil:e.stencil,framebufferScaleFactor:o};d=new XRWebGLLayer(r,t,n),r.updateRenderState({baseLayer:d})}else if(t instanceof WebGLRenderingContext){const n={antialias:!0,alpha:e.alpha,depth:e.depth,stencil:e.stencil,framebufferScaleFactor:o};d=new XRWebGLLayer(r,t,n),r.updateRenderState({layers:[d]})}else{p=e.antialias;let n=null;e.depth&&(x=256,e.stencil&&(x|=1024),y=e.stencil?33306:36096,n=e.stencil?35056:33190);const s={colorFormat:e.alpha?32856:32849,depthFormat:n,scaleFactor:o};c=new XRWebGLBinding(r,t),h=c.createProjectionLayer(s),u=t.createFramebuffer(),r.updateRenderState({layers:[h]}),p&&(f=t.createFramebuffer(),m=t.createRenderbuffer(),t.bindRenderbuffer(36161,m),t.renderbufferStorageMultisample(36161,4,32856,h.textureWidth,h.textureHeight),i.bindFramebuffer(36160,f),t.framebufferRenderbuffer(36160,36064,36161,m),t.bindRenderbuffer(36161,null),null!==n&&(g=t.createRenderbuffer(),t.bindRenderbuffer(36161,g),t.renderbufferStorageMultisample(36161,4,n,h.textureWidth,h.textureHeight),t.framebufferRenderbuffer(36160,y,36161,g),t.bindRenderbuffer(36161,null)),i.bindFramebuffer(36160,null))}s=await r.requestReferenceSpace(a),F.setContext(r),F.start(),n.isPresenting=!0,n.dispatchEvent({type:\"sessionstart\"})}};const R=new pi,D=new pi;function O(e,t){null===t?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.copy(e.matrixWorld).invert()}this.updateCamera=function(e){if(null===r)return;E.near=M.near=w.near=e.near,E.far=M.far=w.far=e.far,T===E.near&&A===E.far||(r.updateRenderState({depthNear:E.near,depthFar:E.far}),T=E.near,A=E.far);const t=e.parent,n=E.cameras;O(E,t);for(let e=0;e<n.length;e++)O(n[e],t);E.matrixWorld.decompose(E.position,E.quaternion,E.scale),e.position.copy(E.position),e.quaternion.copy(E.quaternion),e.scale.copy(E.scale),e.matrix.copy(E.matrix),e.matrixWorld.copy(E.matrixWorld);const i=e.children;for(let e=0,t=i.length;e<t;e++)i[e].updateMatrixWorld(!0);2===n.length?function(e,t,n){R.setFromMatrixPosition(t.matrixWorld),D.setFromMatrixPosition(n.matrixWorld);const i=R.distanceTo(D),r=t.projectionMatrix.elements,o=n.projectionMatrix.elements,s=r[14]/(r[10]-1),a=r[14]/(r[10]+1),l=(r[9]+1)/r[5],c=(r[9]-1)/r[5],u=(r[8]-1)/r[0],h=(o[8]+1)/o[0],d=s*u,p=s*h,f=i/(-u+h),m=f*-u;t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(m),e.translateZ(f),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.copy(e.matrixWorld).invert();const g=s+f,v=a+f,y=d-m,x=p+(i-m),_=l*a/v*g,b=c*a/v*g;e.projectionMatrix.makePerspective(y,x,_,b,g,v)}(E,w,M):E.projectionMatrix.copy(w.projectionMatrix)},this.getCamera=function(){return E},this.getFoveation=function(){return null!==h?h.fixedFoveation:null!==d?d.fixedFoveation:void 0},this.setFoveation=function(e){null!==h&&(h.fixedFoveation=e),null!==d&&void 0!==d.fixedFoveation&&(d.fixedFoveation=e)};let I=null;const F=new Vo;F.setAnimationLoop((function(e,n){if(l=n.getViewerPose(s),v=n,null!==l){const e=l.views;null!==d&&i.bindXRFramebuffer(d.framebuffer);let n=!1;e.length!==E.cameras.length&&(E.cameras.length=0,n=!0);for(let r=0;r<e.length;r++){const o=e[r];let s=null;if(null!==d)s=d.getViewport(o);else{const e=c.getViewSubImage(h,o);i.bindXRFramebuffer(u),void 0!==e.depthStencilTexture&&t.framebufferTexture2D(36160,y,3553,e.depthStencilTexture,0),t.framebufferTexture2D(36160,36064,3553,e.colorTexture,0),s=e.viewport}const a=S[r];a.matrix.fromArray(o.transform.matrix),a.projectionMatrix.fromArray(o.projectionMatrix),a.viewport.set(s.x,s.y,s.width,s.height),0===r&&E.matrix.copy(a.matrix),!0===n&&E.cameras.push(a)}
vendor: 4,245 bytes, line 947
947p&&(i.bindXRFramebuffer(f),null!==x&&t.clear(x))}const o=r.inputSources;for(let e=0;e<_.length;e++){const t=_[e],i=o[e];t.update(i,n,s)}if(I&&I(e,n),p){const e=h.textureWidth,n=h.textureHeight;i.bindFramebuffer(36008,f),i.bindFramebuffer(36009,u),t.invalidateFramebuffer(36008,[y]),t.invalidateFramebuffer(36009,[y]),t.blitFramebuffer(0,0,e,n,0,0,e,n,16384,9728),t.invalidateFramebuffer(36008,[36064]),i.bindFramebuffer(36008,null),i.bindFramebuffer(36009,null),i.bindFramebuffer(36160,f)}v=null})),this.setAnimationLoop=function(e){I=e},this.dispose=function(){}}}function Al(e){function t(t,n){t.opacity.value=n.opacity,n.color&&t.diffuse.value.copy(n.color),n.emissive&&t.emissive.value.copy(n.emissive).multiplyScalar(n.emissiveIntensity),n.map&&(t.map.value=n.map),n.alphaMap&&(t.alphaMap.value=n.alphaMap),n.specularMap&&(t.specularMap.value=n.specularMap),n.alphaTest>0&&(t.alphaTest.value=n.alphaTest);const i=e.get(n).envMap;if(i){t.envMap.value=i,t.flipEnvMap.value=i.isCubeTexture&&!1===i.isRenderTargetTexture?-1:1,t.reflectivity.value=n.reflectivity,t.ior.value=n.ior,t.refractionRatio.value=n.refractionRatio;const r=e.get(i).__maxMipLevel;void 0!==r&&(t.maxMipLevel.value=r)}let r,o;n.lightMap&&(t.lightMap.value=n.lightMap,t.lightMapIntensity.value=n.lightMapIntensity),n.aoMap&&(t.aoMap.value=n.aoMap,t.aoMapIntensity.value=n.aoMapIntensity),n.map?r=n.map:n.specularMap?r=n.specularMap:n.displacementMap?r=n.displacementMap:n.normalMap?r=n.normalMap:n.bumpMap?r=n.bumpMap:n.roughnessMap?r=n.roughnessMap:n.metalnessMap?r=n.metalnessMap:n.alphaMap?r=n.alphaMap:n.emissiveMap?r=n.emissiveMap:n.clearcoatMap?r=n.clearcoatMap:n.clearcoatNormalMap?r=n.clearcoatNormalMap:n.clearcoatRoughnessMap?r=n.clearcoatRoughnessMap:n.specularIntensityMap?r=n.specularIntensityMap:n.specularColorMap?r=n.specularColorMap:n.transmissionMap?r=n.transmissionMap:n.thicknessMap?r=n.thicknessMap:n.sheenColorMap?r=n.sheenColorMap:n.sheenRoughnessMap&&(r=n.sheenRoughnessMap),void 0!==r&&(r.isWebGLRenderTarget&&(r=r.texture),!0===r.matrixAutoUpdate&&r.updateMatrix(),t.uvTransform.value.copy(r.matrix)),n.aoMap?o=n.aoMap:n.lightMap&&(o=n.lightMap),void 0!==o&&(o.isWebGLRenderTarget&&(o=o.texture),!0===o.matrixAutoUpdate&&o.updateMatrix(),t.uv2Transform.value.copy(o.matrix))}function n(t,n){t.roughness.value=n.roughness,t.metalness.value=n.metalness,n.roughnessMap&&(t.roughnessMap.value=n.roughnessMap),n.metalnessMap&&(t.metalnessMap.value=n.metalnessMap),n.emissiveMap&&(t.emissiveMap.value=n.emissiveMap),n.bumpMap&&(t.bumpMap.value=n.bumpMap,t.bumpScale.value=n.bumpScale,n.side===m&&(t.bumpScale.value*=-1)),n.normalMap&&(t.normalMap.value=n.normalMap,t.normalScale.value.copy(n.normalScale),n.side===m&&t.normalScale.value.negate()),n.displacementMap&&(t.displacementMap.value=n.displacementMap,t.displacementScale.value=n.displacementScale,t.displacementBias.value=n.displacementBias),e.get(n).envMap&&(t.envMapIntensity.value=n.envMapIntensity)}return{refreshFogUniforms:function(e,t){e.fogColor.value.copy(t.color),t.isFog?(e.fogNear.value=t.near,e.fogFar.value=t.far):t.isFogExp2&&(e.fogDensity.value=t.density)},refreshMaterialUniforms:function(e,i,r,o,s){i.isMeshBasicMaterial?t(e,i):i.isMeshLambertMaterial?(t(e,i),function(e,t){t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap)}(e,i)):i.isMeshToonMaterial?(t(e,i),function(e,t){t.gradientMap&&(e.gradientMap.value=t.gradientMap),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===m&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===m&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(e,i)):i.isMeshPhongMaterial?(t(e,i),function(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===m&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===m&&e.normalScale.value.negate()),t.dis
947placementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(e,i)):i.isMeshStandardMaterial?(t(e,i),i.isMeshPhysicalMaterial?function(e,t,i){n(e,t),e.ior.value=t.ior,t.sheen>0&&(e.sheenColor.value.copy(t.sheenColor).multiplyScalar(t.sheen),e.sheenRoughness.value=t.sheenRoughness,t.sheenColorMap&&(e.sheenColorMap.value=t.sheenColorMap),t.sheenRoughnessMap&&(e.sheenRoughnessMap.value=t.sheenRoughnessMap)),t.clearcoat>0&&(e.clearcoat.value=t.clearcoat,e.clearcoatRoughness.value=t.clearcoatRoughness,t.clearcoatMap&&(e.clearcoatMap.value=t.clearcoatMap),t.clearcoatRoughnessMap&&(e.clearcoatRoughnessMap.value=t.clearcoatRoughnessMap),t.clearcoatNormalMap&&(e.clearcoatNormalScale.value.copy(t.clearcoatNormalScale),e.clearcoatNormalMap.value=t.clearcoatNormalMap,t.side===m&&e.clearcoatNormalScale.value.negate())),t.transmission>0&&(e.transmission.value=t.transmission,e.transmissionSamplerMap.value=i.texture,e.transmissionSamplerSize.value.set(i.width,i.height),t.transmissionMap&&(e.transmissionMap.value=t.transmissionMap),e.thickness.value=t.thickness,t.thicknessMap&&(e.thicknessMap.value=t.thicknessMap),e.attenuationDistance.value=t.attenuationDistance,e.attenuationColor.value.copy(t.attenuationColor)),e.specularIntensity.value=t.specularIntensity,e.specularColor.value.copy(t.specularColor),t.specularIntensityMap&&(e.specularIntensityMap.value=t.specularIntensityMap),t.specularColorMap&&(e.specularColorMap.value=t.specularColorMap)}(e,i,s):n(e,i)):i.isMeshMatcapMaterial?(t(e,i),function(e,t){t.matcap&&(e.matcap.value=t.matcap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===m&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===m&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(e,i)):i.isMeshDepthMaterial?(t(e,i),function(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(e,i)):i.isMeshDistanceMaterial?(t(e,i),function(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias),e.referencePosition.value.copy(t.referencePosition),e.nearDistance.value=t.nearDistance,e.farDistance.value=t.farDistance}(e,i)):i.isMeshNormalMaterial?(t(e,i),function(e,t){t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===m&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===m&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(e,i)):i.isLineBasicMaterial?(function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity}(e,i),i.isLineDashedMaterial&&function(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}(e,i)):i.isPointsMaterial?function(e,t,n,i){let r;e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*n,e.scale.value=.5*i,t.map&&(e.map.value=t.map),t.alphaMap&&(e.alphaMap.value=t.alphaMap),t.alphaTest>0&&(e.alphaTest.value=t.alphaTest),t.map?r=t.map:t.alphaMap&&(r=t.alphaMap),void 0!==r&&(!0===r.matrixAutoUpdate&&r.updateMatrix(),e.uvTransform.value.copy(r.matrix))}(e,i,r,o):i.isSpriteMaterial?function(e,t){let n;e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.rotation.value=t.rotation,t.map&&(e.map.value=t.map),t.alphaMap&&(e.alphaMap.value=t.alphaMap),t.alphaTest>0&&(e.alphaTest.value=t.alphaTest),t.map?n=t.map:t.alphaMap&&(n=t.alphaMap),void 0!==n&&(!0===n.matrixAutoUpdate&&n.updateMatrix(),e.uvTransform.value.copy(n.matrix))}(e,i):i.isShadowMaterial?(e.color.value.copy(i.color),e.opacity.value=i.opacity):i.isShaderMaterial&&(i.uniformsNeedUpdate=!1)}}}function Ll(e={}){const t=void 0!==e.canvas?e.canvas:function(){const e=ti(\"canvas\");return e.style.display=\"block\",e}(),n=void 0!==e.context?e.context:null,i=void 0!==e.alpha&&e.alpha,r=void 0===e.depth||e.depth,o=void 0===e.stencil||e.stencil,s=void 0!==e.antialias&&e.antialias,a=void 0===e.premultipliedAlpha||e.premultipliedAlpha,l=void 0!==e.preserveDrawingBuffer&&e.preserveDrawingBuffer,c=void 0!==e.powerPreference?e.powerPreference:\"default\",u=void 0!==e.failIfMajorPerformanceCaveat&&e.failIfMajorPerformanceCaveat;let h=null,d=null;const p=[],v=[];
vendor: 4,887 bytes, line 947
947this.domElement=t,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.outputEncoding=Zt,this.physicallyCorrectLights=!1,this.toneMapping=K,this.toneMappingExposure=1;const y=this;let x=!1,_=0,b=0,w=null,M=-1,S=null;const E=new li,T=new li;let A=null,L=t.width,C=t.height,P=1,R=null,D=null;const O=new li(0,0,L,C),I=new li(0,0,L,C);let F=!1;const N=[],U=new ko;let z=!1,B=!1,G=null;const k=new ji,V=new pi,H={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function j(){return null===w?P:1}let W,q,X,Y,J,Z,$,Q,ee,te,ne,ie,re,oe,se,ae,le,ce,ue,he,pe,me,ge,ve=n;function ye(e,n){for(let i=0;i<e.length;i++){const r=e[i],o=t.getContext(r,n);if(null!==o)return o}return null}try{const e={alpha:i,depth:r,stencil:o,antialias:s,premultipliedAlpha:a,preserveDrawingBuffer:l,powerPreference:c,failIfMajorPerformanceCaveat:u};if(t.addEventListener(\"webglcontextlost\",be,!1),t.addEventListener(\"webglcontextrestored\",Me,!1),null===ve){const t=[\"webgl2\",\"webgl\",\"experimental-webgl\"];if(!0===y.isWebGL1Renderer&&t.shift(),ve=ye(t,e),null===ve)throw ye(t)?new Error(\"Error creating WebGL context with your selected attributes.\"):new Error(\"Error creating WebGL context.\")}void 0===ve.getShaderPrecisionFormat&&(ve.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(e){throw console.error(\"THREE.WebGLRenderer: \"+e.message),e}function xe(){W=new Ms(ve),q=new $o(ve,W,e),W.init(q),me=new bl(ve,W,q),X=new xl(ve,W,q),N[0]=1029,Y=new Ts(ve),J=new il,Z=new _l(ve,W,X,J,q,me,Y),$=new Qo(y),Q=new ws(y),ee=new Ho(ve,q),ge=new Jo(ve,W,ee,q),te=new Ss(ve,ee,Y,ge),ne=new Ds(ve,te,ee,Y),ue=new Rs(ve,q,Z),ae=new Ko(J),ie=new nl(y,$,Q,W,q,ge,ae),re=new Al(J),oe=new al(J),se=new pl(W,q),ce=new Yo(y,$,X,ne,a),le=new yl(y,ne,q),he=new Zo(ve,W,Y,q),pe=new Es(ve,W,Y,q),Y.programs=ie.programs,y.capabilities=q,y.extensions=W,y.properties=J,y.renderLists=oe,y.shadowMap=le,y.state=X,y.info=Y}xe();const _e=new Tl(y,ve);function be(e){e.preventDefault(),console.log(\"THREE.WebGLRenderer: Context Lost.\"),x=!0}function Me(){console.log(\"THREE.WebGLRenderer: Context Restored.\"),x=!1;const e=Y.autoReset,t=le.enabled,n=le.autoUpdate,i=le.needsUpdate,r=le.type;xe(),Y.autoReset=e,le.enabled=t,le.autoUpdate=n,le.needsUpdate=i,le.type=r}function Ee(e){const t=e.target;t.removeEventListener(\"dispose\",Ee),function(e){(function(e){const t=J.get(e).programs;void 0!==t&&t.forEach((function(e){ie.releaseProgram(e)}))})(e),J.remove(e)}(t)}this.xr=_e,this.getContext=function(){return ve},this.getContextAttributes=function(){return ve.getContextAttributes()},this.forceContextLoss=function(){const e=W.get(\"WEBGL_lose_context\");e&&e.loseContext()},this.forceContextRestore=function(){const e=W.get(\"WEBGL_lose_context\");e&&e.restoreContext()},this.getPixelRatio=function(){return P},this.setPixelRatio=function(e){void 0!==e&&(P=e,this.setSize(L,C,!1))},this.getSize=function(e){return e.set(L,C)},this.setSize=function(e,n,i){_e.isPresenting?console.warn(\"THREE.WebGLRenderer: Can't change size while VR device is presenting.\"):(L=e,C=n,t.width=Math.floor(e*P),t.height=Math.floor(n*P),!1!==i&&(t.style.width=e+\"px\",t.style.height=n+\"px\"),this.setViewport(0,0,e,n))},this.getDrawingBufferSize=function(e){return e.set(L*P,C*P).floor()},this.setDrawingBufferSize=function(e,n,i){L=e,C=n,P=i,t.width=Math.floor(e*i),t.height=Math.floor(n*i),this.setViewport(0,0,e,n)},this.getCurrentViewport=function(e){return e.copy(E)},this.getViewport=function(e){return e.copy(O)},this.setViewport=function(e,t,n,i){e.isVector4?O.set(e.x,e.y,e.z,e.w):O.set(e,t,n,i),X.viewport(E.copy(O).multiplyScalar(P).floor())},this.getScissor=function(e){return e.copy(I)},this.setScissor=function(e,t,n,i){e.isVector4?I.set(e.x,e.y,e.z,e.w):I.set(e,t,n,i),X.scissor(T.copy(I).multiplyScalar(P).floor())},this.getScissorTest=function(){return F},this.setScissorTest=function(e){X.setScissorTest(F=e)},this.setOpaqueSort=function(e){R=e},this.setTransparentSort=function(e){D=e},this.getClearColor=function(e){return e.copy(ce.getClearColor())},this.setClearColor=function(){ce.setClearColor.apply(ce,arguments)},this.getClearAlpha=function(){return ce.getClearAlpha()},this.setClearAlpha=function(){ce.setClearAlpha.apply(ce,arguments)},this.clear=function(e,t,n){let i=0;(void 0===e||e)&&(i|=16384),(void 0===t||t)&&(i|=256),(void 0===n||n)&&(i|=1024),ve.clear(i)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener(\"webglcontextlost\",be,!1),t.removeEventListener(\"webglcontextrestored\",Me,!1),oe.dispose(),se.dispose(),J.dispose(),$.dis
947pose(),Q.dispose(),ne.dispose(),ge.dispose(),_e.dispose(),_e.removeEventListener(\"sessionstart\",Ae),_e.removeEventListener(\"sessionend\",Le),G&&(G.dispose(),G=null),Ce.stop()},this.renderBufferDirect=function(e,t,n,i,r,o){null===t&&(t=H);const s=r.isMesh&&r.matrixWorld.determinant()<0,a=function(e,t,n,i,r){!0!==t.isScene&&(t=H),Z.resetTextureUnits();const o=t.fog,s=i.isMeshStandardMaterial?t.environment:null,a=null===w?y.outputEncoding:w.texture.encoding,l=(i.isMeshStandardMaterial?Q:$).get(i.envMap||s),c=!0===i.vertexColors&&!!n.attributes.color&&4===n.attributes.color.itemSize,u=!!i.normalMap&&!!n.attributes.tangent,h=!!n.morphAttributes.position,p=!!n.morphAttributes.normal,f=n.morphAttributes.position?n.morphAttributes.position.length:0,m=J.get(i),g=d.state.lights;if(!0===z&&(!0===B||e!==S)){const t=e===S&&i.id===M;ae.setState(i,e,t)}let v=!1;i.version===m.__version?m.needsLights&&m.lightsStateVersion!==g.state.version||m.outputEncoding!==a||r.isInstancedMesh&&!1===m.instancing?v=!0:r.isInstancedMesh||!0!==m.instancing?r.isSkinnedMesh&&
vendor: 6,424 bytes, line 947
947!1===m.skinning?v=!0:r.isSkinnedMesh||!0!==m.skinning?m.envMap!==l||i.fog&&m.fog!==o?v=!0:void 0===m.numClippingPlanes||m.numClippingPlanes===ae.numPlanes&&m.numIntersection===ae.numIntersection?(m.vertexAlphas!==c||m.vertexTangents!==u||m.morphTargets!==h||m.morphNormals!==p||!0===q.isWebGL2&&m.morphTargetsCount!==f)&&(v=!0):v=!0:v=!0:v=!0:(v=!0,m.__version=i.version);let x=m.currentProgram;!0===v&&(x=Ne(i,t,r));let _=!1,b=!1,E=!1;const T=x.getUniforms(),A=m.uniforms;if(X.useProgram(x.program)&&(_=!0,b=!0,E=!0),i.id!==M&&(M=i.id,b=!0),_||S!==e){if(T.setValue(ve,\"projectionMatrix\",e.projectionMatrix),q.logarithmicDepthBuffer&&T.setValue(ve,\"logDepthBufFC\",2/(Math.log(e.far+1)/Math.LN2)),S!==e&&(S=e,b=!0,E=!0),i.isShaderMaterial||i.isMeshPhongMaterial||i.isMeshToonMaterial||i.isMeshStandardMaterial||i.envMap){const t=T.map.cameraPosition;void 0!==t&&t.setValue(ve,V.setFromMatrixPosition(e.matrixWorld))}(i.isMeshPhongMaterial||i.isMeshToonMaterial||i.isMeshLambertMaterial||i.isMeshBasicMaterial||i.isMeshStandardMaterial||i.isShaderMaterial)&&T.setValue(ve,\"isOrthographic\",!0===e.isOrthographicCamera),(i.isMeshPhongMaterial||i.isMeshToonMaterial||i.isMeshLambertMaterial||i.isMeshBasicMaterial||i.isMeshStandardMaterial||i.isShaderMaterial||i.isShadowMaterial||r.isSkinnedMesh)&&T.setValue(ve,\"viewMatrix\",e.matrixWorldInverse)}if(r.isSkinnedMesh){T.setOptional(ve,r,\"bindMatrix\"),T.setOptional(ve,r,\"bindMatrixInverse\");const e=r.skeleton;e&&(q.floatVertexTextures?(null===e.boneTexture&&e.computeBoneTexture(),T.setValue(ve,\"boneTexture\",e.boneTexture,Z),T.setValue(ve,\"boneTextureSize\",e.boneTextureSize)):T.setOptional(ve,e,\"boneMatrices\"))}var L,R;return!n||void 0===n.morphAttributes.position&&void 0===n.morphAttributes.normal||ue.update(r,n,i,x),(b||m.receiveShadow!==r.receiveShadow)&&(m.receiveShadow=r.receiveShadow,T.setValue(ve,\"receiveShadow\",r.receiveShadow)),b&&(T.setValue(ve,\"toneMappingExposure\",y.toneMappingExposure),m.needsLights&&(R=E,(L=A).ambientLightColor.needsUpdate=R,L.lightProbe.needsUpdate=R,L.directionalLights.needsUpdate=R,L.directionalLightShadows.needsUpdate=R,L.pointLights.needsUpdate=R,L.pointLightShadows.needsUpdate=R,L.spotLights.needsUpdate=R,L.spotLightShadows.needsUpdate=R,L.rectAreaLights.needsUpdate=R,L.hemisphereLights.needsUpdate=R),o&&i.fog&&re.refreshFogUniforms(A,o),re.refreshMaterialUniforms(A,i,P,C,G),Fa.upload(ve,m.uniformsList,A,Z)),i.isShaderMaterial&&!0===i.uniformsNeedUpdate&&(Fa.upload(ve,m.uniformsList,A,Z),i.uniformsNeedUpdate=!1),i.isSpriteMaterial&&T.setValue(ve,\"center\",r.center),T.setValue(ve,\"modelViewMatrix\",r.modelViewMatrix),T.setValue(ve,\"normalMatrix\",r.normalMatrix),T.setValue(ve,\"modelMatrix\",r.matrixWorld),x}(e,t,n,i,r);X.setMaterial(i,s);let l=n.index;const c=n.attributes.position;if(null===l){if(void 0===c||0===c.count)return}else if(0===l.count)return;let u,h=1;!0===i.wireframe&&(l=te.getWireframeAttribute(n),h=2),ge.setup(r,i,a,n,l);let p=he;null!==l&&(u=ee.get(l),p=pe,p.setIndex(u));const f=null!==l?l.count:c.count,m=n.drawRange.start*h,g=n.drawRange.count*h,v=null!==o?o.start*h:0,x=null!==o?o.count*h:1/0,_=Math.max(m,v),b=Math.min(f,m+g,v+x)-1,E=Math.max(0,b-_+1);if(0!==E){if(r.isMesh)!0===i.wireframe?(X.setLineWidth(i.wireframeLinewidth*j()),p.setMode(1)):p.setMode(4);else if(r.isLine){let e=i.linewidth;void 0===e&&(e=1),X.setLineWidth(e*j()),r.isLineSegments?p.setMode(1):r.isLineLoop?p.setMode(2):p.setMode(3)}else r.isPoints?p.setMode(0):r.isSprite&&p.setMode(4);if(r.isInstancedMesh)p.renderInstances(_,E,r.count);else if(n.isInstancedBufferGeometry){const e=Math.min(n.instanceCount,n._maxInstanceCount);p.renderInstances(_,E,e)}else p.render(_,E)}},this.compile=function(e,t){d=se.get(e),d.init(),v.push(d),e.traverseVisible((function(e){e.isLight&&e.layers.test(t.layers)&&(d.pushLight(e),e.castShadow&&d.pushShadow(e))})),d.setupLights(y.physicallyCorrectLights),e.traverse((function(t){const n=t.material;if(n)if(Array.isArray(n))for(let i=0;i<n.length;i++)Ne(n[i],e,t);else Ne(n,e,t)})),v.pop(),d=null};let Te=null;function Ae(){Ce.stop()}function Le(){Ce.start()}const Ce=new Vo;function De(e,t,n,i){if(!1===e.visible)return;if(e.layers.test(t.layers))if(e.isGroup)n=e.renderOrder;else if(e.isLOD)!0===e.autoUpdate&&e.update(t);else if(e.isLight)d.pushLight(e),e.castShadow&&d.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||U.intersectsSprite(e)){i&&V.setFromMatrixPosition(e.matrixWorld).applyMatrix4(k);const t=ne.update(e),r=e.material;r.visible&&h.push(e,t,r,n,V.z,null)}}else if((e.isMesh||e.isLine||e.isPoints)&&(e.isSkinnedMesh&&e.skeleton.frame!==Y.render.frame&&(e.skeleton.update(),e.skeleton.frame=Y.render.frame),!e.frustumCulled||U.intersectsObject(e))){i&&V.setFromMatrixPosition(e.matrixWorld).applyMatrix4(k);const t=ne.update(e),r=e.material;if(Array.isArray(r)){const i=t.groups;for(let o=0,s=i.length;o<s;o++){const s=i[o],a=r[s.materialIndex];a&&a.visible&&h.push(e,t,a,n,V.z,s)}}else r.visible&&h.push(e,t,r,n,V.z,null)}const r=e.children;for(let e=0,o=r.length;e<o;e++)De(r[e],t,n,i)}function Oe(e,t,n,i){const r=e.opaque,o=e.transmissive,a=e.transparent;d.setupLightsView(n),o.length>0&&function(e,t,n){if(null===G){const e=!0===s&&!0===q.isWebGL2;G=new(e?hi:ci)(1024,1024,{generateMipmaps:!0,type:null!==me.convert(Re)?Re:Se,minFilter:we,magFilter:fe,wrapS:de,wrapT:de})}const i=y.getRenderTarget();y.setRenderTarget(G),y.clear();const r=y.toneMapping;y.toneMapping=K,Ie(e,t,n),y.toneMapping=r,Z.updateMultisampleRenderTarget(G),Z.updateRenderTargetMipmap(G),y.setRenderTarget(i)}(r,t,n),i&&X.viewport(E.copy(i)),r.length>0&&Ie(r,t,n),o.length>0&&Ie(o,t,n),a.length>0&&Ie(a,t,n)}function Ie(e,t,n){const i=!0===t.isScene?t.overrideMaterial:null;for(let r=0,o=e.length;r<o;r++){const o=e[r],s=o.object,a=o.geometry,l=null===i?o.material:i,c=o.group;s.layers.test(n.layers)&&Fe(s,t,n,a,l,c)}}function Fe(e,t,n,i,r,o){e.onBeforeRender(y,t,n,i,r,o),e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix),r.onBeforeRender(y,t,n,i,e,o),!0===r.transparent&&r.side===g?(r.side=m,r.needsUpdate=!0,y.renderBufferDirect(n,t,i,r,e,o),r.side=f,r.needsUpdate=!0,y.renderBufferDirect(n,t,i,r,e,o),r.side=g):y.renderBufferDirect(n,t,i,r,e,o),e.onAfterRender(y,t,n,i,r,o)}function Ne(e,t,n){!0!==t.isScene&&(t=H);const i=J.get(e),r=d.state.lights,o=d.state.shadowsArray,s=r.state.ver
947sion,a=ie.getParameters(e,r.state,o,t,n),l=ie.getProgramCacheKey(a);let c=i.programs;i.environment=e.isMeshStandardMaterial?t.environment:null,i.fog=t.fog,i.envMap=(e.isMeshStandardMaterial?Q:$).get(e.envMap||i.environment),void 0===c&&(e.addEventListener(\"dispose\",Ee),c=new Map,i.programs=c);let u=c.get(l);if(void 0!==u){if(i.currentProgram===u&&i.lightsStateVersion===s)return Ue(e,a),u}else a.uniforms=ie.getUniforms(e),e.onBuild(n,a,y),e.onBeforeCompile(a,y),u=ie.acquireProgram(a,l),c.set(l,u),i.uniforms=a.uniforms;const h=i.uniforms;(e.isShaderMaterial||e.isRawShaderMaterial)&&!0!==e.clipping||(h.clippingPlanes=ae.uniform),Ue(e,a),i.needsLights=function(e){return e.isMeshLambertMaterial||e.isMeshToonMaterial||e.isMeshPhongMaterial||e.isMeshStandardMaterial||e.isShadowMaterial||e.isShaderMaterial&&!0===e.lights}(e),i.lightsStateVersion=s,i.needsLights&&(h.ambientLightColor.value=r.state.ambient,h.lightProbe.value=r.state.probe,h.directionalLights.value=r.state.directional,h.directionalLightShadows.value=r.state.directionalShadow,h.spotLights.value=r.state.spot,h.spotLightShadows.value=r.state.spotShadow,h.rectAreaLights.value=r.state.rectArea,h.ltc_1.value=r.state.rectAreaLTC1,h.ltc_2.value=r.state.rectAreaLTC2,h.pointLights.value=r.state.point,h.pointLightShadows.value=r.state.pointShadow,h.hemisphereLights.value=r.state.hemi,h.directionalShadowMap.value=r.state.directionalShadowMap,h.directionalShadowMatrix.value=r.state.directionalShadowMatrix,h.spotShadowMap.value=r.state.spotShadowMap,h.spotShadowMatrix.value=r.state.spotShadowMatrix,h.pointShadowMap.value=r.state.pointShadowMap,h.pointShadowMatrix.value=r.state.pointShadowMatrix);const p=u.getUniforms(),f=Fa.seqWithValue(p.seq,h);return i.currentProgram=u,i.uniformsList=f,u}function Ue(e,t){const n=J.get(e);n.outputEncoding=t.outputEncoding,n.instancing=t.instancing,n.skinning=t.skinning,n.morphTargets=t.morphTargets,n.morphNormals=t.morphNormals,n.morphTargetsCount=t.morphTargetsCount,n.numClippingPlanes=t.numClippingPlanes,n.numIntersection=t.numClipIntersection,n.vertexAlphas=t.vertexAlphas,n.vertexTangents=t.vertexTangents}Ce.setAnimationLoop((function(e){Te&&Te(e)})),\"undefined\"!=typeof window&&Ce.setContext(window),this.setAnimationLoop=function(e){Te=e,_e.setAnimationLoop(e),null===e?Ce.stop():Ce.start()},_e.addEventListener(\"sessionstart\",Ae),_e.addEventListener(\"sessionend\",Le),this.render=function(e,t){if(void 0!==t&&!0!==t.isCamera)return void console.error(\"THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.\");if(!0===x)return;!0===e.autoUpdate&&e.updateMatrixWorld(),null===t.parent&&t.updateMatrixWorld(),!0===_e.enabled&&!0===_e.isPresenting&&(!0===_e.cameraAutoUpdate&&_e.updateCamera(t),t=_e.getCamera()),!0===e.isScene&&e.onBeforeRender(y,e,t,w),d=se.get(e,v.length),d.init(),v.push(d),k.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),U.setFromProjectionMatrix(k),B=this.localClippingEnabled,z=ae.init(this.clippingPlanes,B,t),h=oe.get(e,p.length),h.init(),p.push(h),De(e,t,0,y.sortObjects),h.finish(),!0===y.sortObjects&&h.sort(R,D),!0===z&&ae.beginShadows();const n=d.state.shadowsArray;if(le.render(n,e,t),!0===z&&ae.endShadows(),!0===this.info.autoReset&&this.info.reset(),ce.render(h,e),d.setupLights(y.physicallyCorrectLights),t.isArrayCamera){const n=t.cameras;for(let t=0,i=n.length;t<i;t++){const i=n[t];Oe(h,e,i,i.viewport)}}else Oe(h,e,t);null!==w&&(Z.updateMultisampleRenderTarget(w),Z.updateRenderTargetMipmap(w)),!0===e.isScene&&e.onAfterRender(y,e,t),X.buffers.depth.setTest(!0),X.buffers.depth.setMask(!0),X.buffers.color.setMask(!0),X.setPolygonOffset(!1),ge.resetDefaultState(),M=-1,S=null,v.pop(),d=v.length>0?v[v.length-1]:null,p.pop(),h=p.length>0?p[p.length-1]:null},this.getActiveCubeFace=function(){return _},this.getActiveMipmapLevel=function(){return b},this.getRenderTarget=function(){return w},this.setRenderTarget=function(e,t=0,n=0){w=e,_=t,b=n,e&&void 0===J.get(e).__webglFramebuffer&&Z.setupRenderTarget(e);let i=null,r=!1,o=!1;if(e){const n=e.texture;(n.isDataTexture3D||n.isDataTexture2DArray)&&(o=!0);const s=J.get(e).__webglFramebuffer;
vendor: 5,390 bytes, line 947
947e.isWebGLCubeRenderTarget?(i=s[t],r=!0):i=e.isWebGLMultisampleRenderTarget?J.get(e).__webglMultisampledFramebuffer:s,E.copy(e.viewport),T.copy(e.scissor),A=e.scissorTest}else E.copy(O).multiplyScalar(P).floor(),T.copy(I).multiplyScalar(P).floor(),A=F;if(X.bindFramebuffer(36160,i)&&q.drawBuffers){let t=!1;if(e)if(e.isWebGLMultipleRenderTargets){const n=e.texture;if(N.length!==n.length||36064!==N[0]){for(let e=0,t=n.length;e<t;e++)N[e]=36064+e;N.length=n.length,t=!0}}else 1===N.length&&36064===N[0]||(N[0]=36064,N.length=1,t=!0);else 1===N.length&&1029===N[0]||(N[0]=1029,N.length=1,t=!0);t&&(q.isWebGL2?ve.drawBuffers(N):W.get(\"WEBGL_draw_buffers\").drawBuffersWEBGL(N))}if(X.viewport(E),X.scissor(T),X.setScissorTest(A),r){const i=J.get(e.texture);ve.framebufferTexture2D(36160,36064,34069+t,i.__webglTexture,n)}else if(o){const i=J.get(e.texture),r=t||0;ve.framebufferTextureLayer(36160,36064,i.__webglTexture,n||0,r)}M=-1},this.readRenderTargetPixels=function(e,t,n,i,r,o,s){if(!e||!e.isWebGLRenderTarget)return void console.error(\"THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.\");let a=J.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==s&&(a=a[s]),a){X.bindFramebuffer(36160,a);try{const s=e.texture,a=s.format,l=s.type;if(a!==ze&&me.convert(a)!==ve.getParameter(35739))return void console.error(\"THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.\");const c=l===Re&&(W.has(\"EXT_color_buffer_half_float\")||q.isWebGL2&&W.has(\"EXT_color_buffer_float\"));if(!(l===Se||me.convert(l)===ve.getParameter(35738)||l===Pe&&(q.isWebGL2||W.has(\"OES_texture_float\")||W.has(\"WEBGL_color_buffer_float\"))||c))return void console.error(\"THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.\");36053===ve.checkFramebufferStatus(36160)?t>=0&&t<=e.width-i&&n>=0&&n<=e.height-r&&ve.readPixels(t,n,i,r,me.convert(a),me.convert(l),o):console.error(\"THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.\")}finally{const e=null!==w?J.get(w).__webglFramebuffer:null;X.bindFramebuffer(36160,e)}}},this.copyFramebufferToTexture=function(e,t,n=0){const i=Math.pow(2,-n),r=Math.floor(t.image.width*i),o=Math.floor(t.image.height*i);let s=me.convert(t.format);q.isWebGL2&&(6407===s&&(s=32849),6408===s&&(s=32856)),Z.setTexture2D(t,0),ve.copyTexImage2D(3553,n,s,e.x,e.y,r,o,0),X.unbindTexture()},this.copyTextureToTexture=function(e,t,n,i=0){const r=t.image.width,o=t.image.height,s=me.convert(n.format),a=me.convert(n.type);Z.setTexture2D(n,0),ve.pixelStorei(37440,n.flipY),ve.pixelStorei(37441,n.premultiplyAlpha),ve.pixelStorei(3317,n.unpackAlignment),t.isDataTexture?ve.texSubImage2D(3553,i,e.x,e.y,r,o,s,a,t.image.data):t.isCompressedTexture?ve.compressedTexSubImage2D(3553,i,e.x,e.y,t.mipmaps[0].width,t.mipmaps[0].height,s,t.mipmaps[0].data):ve.texSubImage2D(3553,i,e.x,e.y,s,a,t.image),0===i&&n.generateMipmaps&&ve.generateMipmap(3553),X.unbindTexture()},this.copyTextureToTexture3D=function(e,t,n,i,r=0){if(y.isWebGL1Renderer)return void console.warn(\"THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.\");const o=e.max.x-e.min.x+1,s=e.max.y-e.min.y+1,a=e.max.z-e.min.z+1,l=me.convert(i.format),c=me.convert(i.type);let u;if(i.isDataTexture3D)Z.setTexture3D(i,0),u=32879;else{if(!i.isDataTexture2DArray)return void console.warn(\"THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.\");Z.setTexture2DArray(i,0),u=35866}ve.pixelStorei(37440,i.flipY),ve.pixelStorei(37441,i.premultiplyAlpha),ve.pixelStorei(3317,i.unpackAlignment);const h=ve.getParameter(3314),d=ve.getParameter(32878),p=ve.getParameter(3316),f=ve.getParameter(3315),m=ve.getParameter(32877),g=n.isCompressedTexture?n.mipmaps[0]:n.image;ve.pixelStorei(3314,g.width),ve.pixelStorei(32878,g.height),ve.pixelStorei(3316,e.min.x),ve.pixelStorei(3315,e.min.y),ve.pixelStorei(32877,e.min.z),n.isDataTexture||n.isDataTexture3D?ve.texSubImage3D(u,r,t.x,t.y,t.z,o,s,a,l,c,g.data):n.isCompressedTexture?(console.warn(\"THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture.\"),ve.compressedTexSubImage3D(u,r,t.x,t.y,t.z,o,s,a,l,g.data)):ve.texSubImage3D(u,r,t.x,t.y,t.z,o,s,a,l,c,g),ve.pixelStorei(3314,h),ve.pixelStorei(32878,d),ve.pixelStorei(3316,p),ve.pixelStorei(3315,f),ve.pixelStorei(32877,m),0===r&&i.generateMipmaps&&ve.generateMipmap(u),X.unbindTexture()},this.initTexture=function(e){Z.setTexture2D(e,0),X.unbindTexture()},this.resetState=function(){_=0,b=0,w=null,X.reset(),ge.reset()},\"undefined\"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent(\"observe\",{detail:this}))}Ll.prototype.isWebGLRenderer=!0;class Cl extends Ll{}Cl.prototype.isWebGL1Renderer=!0;class Pl{constructor(e,t=25e-5){this.name=\"\",this.color=new Fr(e),this.density=t}clone(){return new Pl(this.color,this.density)}toJSON(){return{type:\"FogExp2\",color:this.color.getHex(),density:this.density}}}Pl.prototype.isFogExp2=!0;class Rl{constructor(e,t=1,n=1e3){this.name=\"\",this.color=new Fr(e),this.near=t,this.far=n}clone(){return new Rl(this.color,this.near,this.far)}toJSON(){return{type:\"Fog\",color:this.color.getHex(),near:this.near,far:this.far}}}Rl.prototype.isFog=!0;
947class Dl extends mr{constructor(){super(),this.type=\"Scene\",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,\"undefined\"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent(\"observe\",{detail:this}))}copy(e,t){return super.copy(e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return null!==this.fog&&(t.object.fog=this.fog.toJSON()),t}}Dl.prototype.isScene=!0;class Ol{constructor(e,t){this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=En,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=Vn()}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let i=0,r=this.stride;i<r;i++)this.array[e+i]=t.array[n+i];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=Vn()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(t,this.stride);return n.setUsage(this.usage),n}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=Vn()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=Array.prototype.slice.call(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}Ol.prototype.isInterleavedBuffer=!0;const Il=new pi;class Fl{constructor(e,t,n,i=!1){this.name=\"\",this.data=e,this.itemSize=t,this.offset=n,this.normalized=!0===i}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,n=this.data.count;t<n;t++)Il.x=this.getX(t),Il.y=this.getY(t),Il.z=this.getZ(t),Il.applyMatrix4(e),this.setXYZ(t,Il.x,Il.y,Il.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)Il.x=this.getX(t),Il.y=this.getY(t),Il.z=this.getZ(t),Il.applyNormalMatrix(e),this.setXYZ(t,Il.x,Il.y,Il.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)Il.x=this.getX(t),Il.y=this.getY(t),Il.z=this.getZ(t),Il.transformDirection(e),this.setXYZ(t,Il.x,Il.y,Il.z);return this}setX(e,t){return this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){return this.data.array[e*this.data.stride+this.offset]}getY(e){return this.data.array[e*this.data.stride+this.offset+1]}getZ(e){return this.data.array[e*this.data.stride+this.offset+2]}getW(e){return this.data.array[e*this.data.stride+this.offset+3]}setXY(e,t,n){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this}setXYZ(e,t,n,i){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=i,this}setXYZW(e,t,n,i,r){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=i,this.data.array[e+3]=r,this}clone(e){if(void 0===e){console.log(\"THREE.InterleavedBufferAttribute.clone(): Cloning an interlaved buffer attribute will deinterleave buffer data.\");const e=[];for(let t=0;t<this.count;t++){const n=t*this.data.stride+this.offset;for(let t=0;t<this.itemSize;t++)e.push(this.data.array[n+t])}return new Br(new this.array.constructor(e),this.itemSize,this.normalized)}return void 0===e.interleavedBuffers&&(e.interleavedBuffers={}),void 0===e.interleavedBuffers[this.data.uuid]&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new Fl(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(void 0===e){console.log(\"THREE.InterleavedBufferAttribute.toJSON(): Serializing an interlaved buffer attribute will deinterleave buffer data.\");const e=[];for(let t=0;t<this.count;t++){const n=t*this.data.stride+this.offset;for(let t=0;t<this.itemSize;t++)e.push(this.data.array[n+t])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:e,normalized:this.normalized}}return void 0===e.interleavedBuffers&&(e.interleavedBuffers={}),void 0===e.interleavedBuffers[this.data.uuid]&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}Fl.prototype.isInterleavedBufferAttribute=!0;class Nl extends Lr{constructor(e){super(),this.type=\"SpriteMaterial\",this.color=new Fr(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this}}let Ul;Nl.prototype.isSpriteMaterial=!0;const zl=new pi,Bl=new pi,Gl=new pi,kl=new Zn,Vl=new Zn,Hl=new ji,jl=new pi,Wl=new pi,ql=new pi,Xl=new Zn,Yl=new Zn,Jl=new Zn;class Zl extends mr{constructor(e){if(super(),this.type=\"Sprite\",void 0===Ul){Ul=new io;const e=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),t=new Ol(e,5);Ul.setIndex([0,1,2,0,2,3]),Ul.setAttribute(\"position\",new Fl(t,3,0,!1)),Ul.setAttribute(\"uv\",new Fl(t,2,3,!1))}this.geometry=Ul,this.material=void 0!==e?e:new Nl,this.center=new Zn(.5,.5)}raycast(e,t){null===e.camera&&console.error('THREE.Sprite: \"Raycaster.camera\" needs to be set in order to raycast against sprites.'),Bl.setFromMatrixScale(this.matrixWorld),Hl.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),Gl.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&Bl.multiplyScalar(-Gl.z);const n=this.material.rotation;let i,r;0!==n&&(r=Math.cos(n),i=Math.sin(n));const o=this.center;$l(jl.set(-.5,-.5,0),Gl,o,Bl,i,r),$l(Wl.set(.5,-.5,0),Gl,o,Bl,i,r),$l(ql.set(.5,.5,0),Gl,o,Bl,i,r),Xl.set(0,0),Yl.set(1,0),Jl.set(1,1);let s=e.ray.intersectTriangle(jl,Wl,ql,!1,zl);if(null===s&&($l(Wl.set(-.5,.5,0),Gl,o,Bl,i,r),Yl.set(0,1),s=e.ray.intersectTriangle(jl,ql,Wl,!1,zl),null===s))return;const a=e.ray.origin.distanceTo(zl);a<e.near||a>e.far||t.push({distance:a,point:zl.clone(),uv:Tr.getUV(zl,jl,Wl,ql,Xl,Yl,Jl,new Zn),face:null,object:this})}copy(e){return super.copy(e),void 0!==e.center&&this.center.copy(e.center),this.material=e.material,this}}function $l(e,t,n,i,r,o){kl.subVectors(e,n).addScalar(.5).multiply(i),void 0!==r?(Vl.x=o*kl.x-r*kl.y,Vl.y=r*kl.x+o*kl.y):Vl.copy(kl),e.copy(t),e.x+=Vl.x,e.y+=Vl.y,e.applyMatrix4(Hl)}Zl.prototype.isSprite=!0;const Kl=new pi,Ql=new pi;class ec extends mr{constructor(){super(),this._currentLevel=0,this.type=\"LOD\",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let e=0,n=t.length;e<n;e++){const n=t[e];this.addLevel(n.object.clone(),n.distance)}return this.autoUpdate=e.autoUpdate,this}addLevel(e,t=0){t=Math.abs(t);const n=this.levels;let i;for(i=0;i<n.length&&!(t<n[i].distance);i++);return n.splice(i,0,{distance:t,object:e}),this.add(e),this}getCurrentLevel(){return this._currentLevel}getObjectForDistance(e){const t=this.levels;if(t.length>0){let n,i;for(n=1,i=t.length;n<i&&!(e<t[n].distance);n++);return t[n-1].object}return null}raycast(e,t){if(this.levels.length>0){Kl.setFromMatrixPosition(this.matrixWorld);const n=e.ray.origin.distanceTo(Kl);this.getObjectForDistance(n).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){Kl.setFromMatrixPosition(e.matrixWorld),Ql.setFromMatrixPosition(this.matrixWorld);const n=Kl.distanceTo(Ql)/e.zoom;let i,r;for(t[0].object.visible=!0,i=1,r=t.length;i<r&&n>=t[i].distance;i++)t[i-1].object.visible=!1,t[i].object.visible=!0;for(this._currentLevel=i-1;
vendor: 7,408 bytes, line 947
947i<r;i++)t[i].object.visible=!1}}toJSON(e){const t=super.toJSON(e);!1===this.autoUpdate&&(t.object.autoUpdate=!1),t.object.levels=[];const n=this.levels;for(let e=0,i=n.length;e<i;e++){const i=n[e];t.object.levels.push({object:i.object.uuid,distance:i.distance})}return t}}const tc=new pi,nc=new li,ic=new li,rc=new pi,oc=new ji;class sc extends wo{constructor(e,t){super(e,t),this.type=\"SkinnedMesh\",this.bindMode=\"attached\",this.bindMatrix=new ji,this.bindMatrixInverse=new ji}copy(e){return super.copy(e),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,this}bind(e,t){this.skeleton=e,void 0===t&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new li,t=this.geometry.attributes.skinWeight;for(let n=0,i=t.count;n<i;n++){e.x=t.getX(n),e.y=t.getY(n),e.z=t.getZ(n),e.w=t.getW(n);const i=1/e.manhattanLength();i!==1/0?e.multiplyScalar(i):e.set(1,0,0,0),t.setXYZW(n,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),\"attached\"===this.bindMode?this.bindMatrixInverse.copy(this.matrixWorld).invert():\"detached\"===this.bindMode?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn(\"THREE.SkinnedMesh: Unrecognized bindMode: \"+this.bindMode)}boneTransform(e,t){const n=this.skeleton,i=this.geometry;nc.fromBufferAttribute(i.attributes.skinIndex,e),ic.fromBufferAttribute(i.attributes.skinWeight,e),tc.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let e=0;e<4;e++){const i=ic.getComponent(e);if(0!==i){const r=nc.getComponent(e);oc.multiplyMatrices(n.bones[r].matrixWorld,n.boneInverses[r]),t.addScaledVector(rc.copy(tc).applyMatrix4(oc),i)}}return t.applyMatrix4(this.bindMatrixInverse)}}sc.prototype.isSkinnedMesh=!0;class ac extends mr{constructor(){super(),this.type=\"Bone\"}}ac.prototype.isBone=!0;class lc extends si{constructor(e=null,t=1,n=1,i,r,o,s,a,l=fe,c=fe,u,h){super(null,o,s,a,l,c,i,r,u,h),this.image={data:e,width:t,height:n},this.magFilter=l,this.minFilter=c,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}lc.prototype.isDataTexture=!0;const cc=new ji,uc=new ji;class hc{constructor(e=[],t=[]){this.uuid=Vn(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.boneTextureSize=0,this.frame=-1,this.init()}init(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(16*e.length),0===t.length)this.calculateInverses();else if(e.length!==t.length){console.warn(\"THREE.Skeleton: Number of inverse bone matrices does not match amount of bones.\"),this.boneInverses=[];for(let e=0,t=this.bones.length;e<t;e++)this.boneInverses.push(new ji)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const t=new ji;this.bones[e]&&t.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(t)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){const t=this.bones[e];t&&t.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){const t=this.bones[e];t&&(t.parent&&t.parent.isBone?(t.matrix.copy(t.parent.matrixWorld).invert(),t.matrix.multiply(t.matrixWorld)):t.matrix.copy(t.matrixWorld),t.matrix.decompose(t.position,t.quaternion,t.scale))}}update(){const e=this.bones,t=this.boneInverses,n=this.boneMatrices,i=this.boneTexture;for(let i=0,r=e.length;i<r;i++){const r=e[i]?e[i].matrixWorld:uc;cc.multiplyMatrices(r,t[i]),cc.toArray(n,16*i)}null!==i&&(i.needsUpdate=!0)}clone(){return new hc(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(4*this.bones.length);e=Xn(e),e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const n=new lc(t,e,e,ze,Pe);return this.boneMatrices=t,this.boneTexture=n,this.boneTextureSize=e,this}getBoneByName(e){for(let t=0,n=this.bones.length;t<n;t++){const n=this.bones[t];if(n.name===e)return n}}dispose(){null!==this.boneTexture&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let n=0,i=e.bones.length;n<i;n++){const i=e.bones[n];let r=t[i];void 0===r&&(console.warn(\"THREE.Skeleton: No bone found with UUID:\",i),r=new ac),this.bones.push(r),this.boneInverses.push((new ji).fromArray(e.boneInverses[n]))}return this.init(),this}toJSON(){const e={metadata:{version:4.5,type:\"Skeleton\",generator:\"Skeleton.toJSON\"},bones:[],boneInverses:[]};e.uuid=this.uuid;const t=this.bones,n=this.boneInverses;for(let i=0,r=t.length;i<r;i++){const r=t[i];e.bones.push(r.uuid);const o=n[i];e.boneInverses.push(o.toArray())}return e}}class dc extends Br{constructor(e,t,n,i=1){\"number\"==typeof n&&(i=n,n=!1,console.error(\"THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.\")),super(e,t,n),this.meshPerAttribute=i}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}dc.prototype.isInstancedBufferAttribute=!0;const pc=new ji,fc=new ji,mc=[],gc=new wo;class vc extends wo{constructor(e,t,n){super(e,t),this.instanceMatrix=new dc(new Float32Array(16*n),16),this.instanceColor=null,this.count=n,this.frustumCulled=!1}copy(e){return super.copy(e),this.instanceMatrix.copy(e.instanceMatrix),null!==e.instanceColor&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,this}getColorAt(e,t){t.fromArray(this.instanceColor.array,3*e)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,16*e)}raycast(e,t){const n=this.matrixWorld,i=this.count;if(gc.geometry=this.geometry,gc.material=this.material,void 0!==gc.material)for(let r=0;r<i;r++){this.getMatrixAt(r,pc),fc.multiplyMatrices(n,pc),gc.matrixWorld=fc,gc.raycast(e,mc);for(let e=0,n=mc.length;e<n;e++){const n=mc[e];n.instanceId=r,n.object=this,t.push(n)}mc.length=0}}setColorAt(e,t){null===this.instanceColor&&(this.instanceColor=new dc(new Float32Array(3*this.instanceMatrix.count),3)),t.toArray(this.instanceColor.array,3*e)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,16*e)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:\"dispose\"})}}vc.prototype.isInstancedMesh=!0;class yc extends Lr{constructor(e){super(),this.type=\"LineBasicMaterial\",this.color=new Fr(16777215),this.linewidth=1,this.linecap=\"round\",this.linejoin=\"round\",this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this}}yc.prototype.isLineBasicMaterial=!0;const xc=new pi,_c=new pi,bc=new ji,wc=new Hi,Mc=new Fi;class Sc extends mr{constructor(e=new io,t=new yc){super(),this.type=\"Line\",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),this.material=e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.isBufferGeometry)if(null===e.index){const t=e.attributes.position,n=[0];for(let e=1,i=t.count;e<i;e++)xc.fromBufferAttribute(t,e-1),_c.fromBufferAttribute(t,e),n[e]=n[e-1],n[e]+=xc.distanceTo(_c);e.setAttribute(\"lineDistance\",new Yr(n,1))}else console.warn(\"THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.\");else e.isGeometry&&console.error(\"THREE.Line.computeLineDistances() n
947o longer supports THREE.Geometry. Use THREE.BufferGeometry instead.\");return this}raycast(e,t){const n=this.geometry,i=this.matrixWorld,r=e.params.Line.threshold,o=n.drawRange;if(null===n.boundingSphere&&n.computeBoundingSphere(),Mc.copy(n.boundingSphere),Mc.applyMatrix4(i),Mc.radius+=r,!1===e.ray.intersectsSphere(Mc))return;bc.copy(i).invert(),wc.copy(e.ray).applyMatrix4(bc);const s=r/((this.scale.x+this.scale.y+this.scale.z)/3),a=s*s,l=new pi,c=new pi,u=new pi,h=new pi,d=this.isLineSegments?2:1;if(n.isBufferGeometry){const i=n.index,r=n.attributes.position;if(null!==i)for(let n=Math.max(0,o.start),s=Math.min(i.count,o.start+o.count)-1;n<s;n+=d){const o=i.getX(n),s=i.getX(n+1);if(l.fromBufferAttribute(r,o),c.fromBufferAttribute(r,s),wc.distanceSqToSegment(l,c,h,u)>a)continue;h.applyMatrix4(this.matrixWorld);const d=e.ray.origin.distanceTo(h);d<e.near||d>e.far||t.push({distance:d,point:u.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}else for(let n=Math.max(0,o.start),i=Math.min(r.count,o.start+o.count)-1;n<i;n+=d){if(l.fromBufferAttribute(r,n),c.fromBufferAttribute(r,n+1),wc.distanceSqToSegment(l,c,h,u)>a)continue;h.applyMatrix4(this.matrixWorld);const i=e.ray.origin.distanceTo(h);i<e.near||i>e.far||t.push({distance:i,point:u.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}}else n.isGeometry&&console.error(\"THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.\")}updateMorphTargets(){const e=this.geometry;if(e.isBufferGeometry){const t=e.morphAttributes,n=Object.keys(t);if(n.length>0){const e=t[n[0]];if(void 0!==e){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,n=e.length;t<n;t++){const n=e[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=t}}}}else{const t=e.morphTargets;void 0!==t&&t.length>0&&console.error(\"THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.\")}}}Sc.prototype.isLine=!0;const Ec=new pi,Tc=new pi;class Ac extends Sc{constructor(e,t){super(e,t),this.type=\"LineSegments\"}computeLineDistances(){const e=this.geometry;if(e.isBufferGeometry)if(null===e.index){const t=e.attributes.position,n=[];for(let e=0,i=t.count;e<i;e+=2)Ec.fromBufferAttribute(t,e),Tc.fromBufferAttribute(t,e+1),n[e]=0===e?0:n[e-1],n[e+1]=n[e]+Ec.distanceTo(Tc);e.setAttribute(\"lineDistance\",new Yr(n,1))}else console.warn(\"THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.\");else e.isGeometry&&console.error(\"THREE.LineSegments.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.\");return this}}Ac.prototype.isLineSegments=!0;class Lc extends Sc{constructor(e,t){super(e,t),this.type=\"LineLoop\"}}Lc.prototype.isLineLoop=!0;class Cc extends Lr{constructor(e){super(),this.type=\"PointsMaterial\",this.color=new Fr(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this}}Cc.prototype.isPointsMaterial=!0;const Pc=new ji,Rc=new Hi,Dc=new Fi,Oc=new pi;class Ic extends mr{constructor(e=new io,t=new Cc){super(),this.type=\"Points\",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),this.material=e.material,this.geometry=e.geometry,this}raycast(e,t){const n=this.geometry,i=this.matrixWorld,r=e.params.Points.threshold,o=n.drawRange;if(null===n.boundingSphere&&n.computeBoundingSphere(),Dc.copy(n.boundingSphere),Dc.applyMatrix4(i),Dc.radius+=r,!1===e.ray.intersectsSphere(Dc))return;Pc.copy(i).invert(),Rc.copy(e.ray).applyMatrix4(Pc);const s=r/((this.scale.x+this.scale.y+this.scale.z)/3),a=s*s;if(n.isBufferGeometry){const r=n.index,s=n.attributes.position;if(null!==r)for(let n=Math.max(0,o.start),l=Math.min(r.count,o.start+o.count);n<l;n++){const o=r.getX(n);Oc.fromBufferAttribute(s,o),Fc(Oc,o,a,i,e,t,this)}else for(let n=Math.max(0,o.start),r=Math.min(s.count,o.start+o.count);n<r;n++)Oc.fromBufferAttribute(s,n),Fc(Oc,n,a,i,e,t,this)}else console.error(\"THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.\")}updateMorphTargets(){const e=this.geometry;if(e.isBufferGeometry){const t=e.morphAttributes,n=Object.keys(t);if(n.length>0){const e=t[n[0]];if(void 0!==e){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,n=e.length;t<n;t++){const n=e[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=t}}}}else{const t=e.morphTargets;void 0!==t&&t.length>0&&console.error(\"THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.\")}}}function Fc(e,t,n,i,r,o,s){const a=Rc.distanceSqToPoint(e);if(a<n){const n=new pi;Rc.closestPointToPoint(e,n),n.applyMatrix4(i);const l=r.ray.origin.distanceTo(n);if(l<r.near||l>r.far)return;o.push({distance:l,distanceToRay:Math.sqrt(a),point:n,index:t,face:null,object:s})}}Ic.prototype.isPoints=!0;class Nc extends si{constructor(e,t,n,i,r,o,s,a,l){super(e,t,n,i,r,o,s,a,l),this.format=void 0!==s?s:Ue,this.minFilter=void 0!==o?o:xe,this.magFilter=void 0!==r?r:xe,this.generateMipmaps=!1;const c=this;\"requestVideoFrameCallback\"in e&&e.requestVideoFrameCallback((function t(){c.needsUpdate=!0,e.requestVideoFrameCallback(t)}))}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;!1==\"requestVideoFrameCallback\"in e&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}Nc.prototype.isVideoTexture=!0;class Uc extends si{constructor(e,t,n,i,r,o,s,a,l,c,u,h){super(null,o,s,a,l,c,i,r,u,h),this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}Uc.prototype.isCompressedTexture=!0;class zc extends si{constructor(e,t,n,i,r,o,s,a,l){super(e,t,n,i,r,o,s,a,l),this.needsUpdate=!0}}zc.prototype.isCanvasTexture=!0;class Bc extends si{constructor(e,t,n,i,r,o,s,a,l,c){if((c=void 0!==c?c:Ve)!==Ve&&c!==He)throw new Error(\"DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat\");void 0===n&&c===Ve&&(n=Ae),void 0===n&&c===He&&(n=Fe),super(null,i,r,o,s,a,c,n,l),this.image={width:e,height:t},this.magFilter=void 0!==s?s:fe,this.minFilter=void 0!==a?a:fe,this.flipY=!1,this.generateMipmaps=!1}}Bc.prototype.isDepthTexture=!0;class Gc extends io{constructor(e=1,t=8,n=0,i=2*Math.PI){super(),this.type=\"CircleGeometry\",this.parameters={radiu
vendor: 4,984 bytes, line 947
947s:e,segments:t,thetaStart:n,thetaLength:i},t=Math.max(3,t);const r=[],o=[],s=[],a=[],l=new pi,c=new Zn;o.push(0,0,0),s.push(0,0,1),a.push(.5,.5);for(let r=0,u=3;r<=t;r++,u+=3){const h=n+r/t*i;l.x=e*Math.cos(h),l.y=e*Math.sin(h),o.push(l.x,l.y,l.z),s.push(0,0,1),c.x=(o[u]/e+1)/2,c.y=(o[u+1]/e+1)/2,a.push(c.x,c.y)}for(let e=1;e<=t;e++)r.push(e,e+1,0);this.setIndex(r),this.setAttribute(\"position\",new Yr(o,3)),this.setAttribute(\"normal\",new Yr(s,3)),this.setAttribute(\"uv\",new Yr(a,2))}static fromJSON(e){return new Gc(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class kc extends io{constructor(e=1,t=1,n=1,i=8,r=1,o=!1,s=0,a=2*Math.PI){super(),this.type=\"CylinderGeometry\",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:i,heightSegments:r,openEnded:o,thetaStart:s,thetaLength:a};const l=this;i=Math.floor(i),r=Math.floor(r);const c=[],u=[],h=[],d=[];let p=0;const f=[],m=n/2;let g=0;function v(n){const r=p,o=new Zn,f=new pi;let v=0;const y=!0===n?e:t,x=!0===n?1:-1;for(let e=1;e<=i;e++)u.push(0,m*x,0),h.push(0,x,0),d.push(.5,.5),p++;const _=p;for(let e=0;e<=i;e++){const t=e/i*a+s,n=Math.cos(t),r=Math.sin(t);f.x=y*r,f.y=m*x,f.z=y*n,u.push(f.x,f.y,f.z),h.push(0,x,0),o.x=.5*n+.5,o.y=.5*r*x+.5,d.push(o.x,o.y),p++}for(let e=0;e<i;e++){const t=r+e,i=_+e;!0===n?c.push(i,i+1,t):c.push(i+1,i,t),v+=3}l.addGroup(g,v,!0===n?1:2),g+=v}!function(){const o=new pi,v=new pi;let y=0;const x=(t-e)/n;for(let l=0;l<=r;l++){const c=[],g=l/r,y=g*(t-e)+e;for(let e=0;e<=i;e++){const t=e/i,r=t*a+s,l=Math.sin(r),f=Math.cos(r);v.x=y*l,v.y=-g*n+m,v.z=y*f,u.push(v.x,v.y,v.z),o.set(l,x,f).normalize(),h.push(o.x,o.y,o.z),d.push(t,1-g),c.push(p++)}f.push(c)}for(let e=0;e<i;e++)for(let t=0;t<r;t++){const n=f[t][e],i=f[t+1][e],r=f[t+1][e+1],o=f[t][e+1];c.push(n,i,o),c.push(i,r,o),y+=6}l.addGroup(g,y,0),g+=y}(),!1===o&&(e>0&&v(!0),t>0&&v(!1)),this.setIndex(c),this.setAttribute(\"position\",new Yr(u,3)),this.setAttribute(\"normal\",new Yr(h,3)),this.setAttribute(\"uv\",new Yr(d,2))}static fromJSON(e){return new kc(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class Vc extends kc{constructor(e=1,t=1,n=8,i=1,r=!1,o=0,s=2*Math.PI){super(0,e,t,n,i,r,o,s),this.type=\"ConeGeometry\",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:i,openEnded:r,thetaStart:o,thetaLength:s}}static fromJSON(e){return new Vc(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class Hc extends io{constructor(e=[],t=[],n=1,i=0){super(),this.type=\"PolyhedronGeometry\",this.parameters={vertices:e,indices:t,radius:n,detail:i};const r=[],o=[];function s(e,t,n,i){const r=i+1,o=[];for(let i=0;i<=r;i++){o[i]=[];const s=e.clone().lerp(n,i/r),a=t.clone().lerp(n,i/r),l=r-i;for(let e=0;e<=l;e++)o[i][e]=0===e&&i===r?s:s.clone().lerp(a,e/l)}for(let e=0;e<r;e++)for(let t=0;t<2*(r-e)-1;t++){const n=Math.floor(t/2);t%2==0?(a(o[e][n+1]),a(o[e+1][n]),a(o[e][n])):(a(o[e][n+1]),a(o[e+1][n+1]),a(o[e+1][n]))}}function a(e){r.push(e.x,e.y,e.z)}function l(t,n){const i=3*t;n.x=e[i+0],n.y=e[i+1],n.z=e[i+2]}function c(e,t,n,i){i<0&&1===e.x&&(o[t]=e.x-1),0===n.x&&0===n.z&&(o[t]=i/2/Math.PI+.5)}function u(e){return Math.atan2(e.z,-e.x)}!function(e){const n=new pi,i=new pi,r=new pi;for(let o=0;o<t.length;o+=3)l(t[o+0],n),l(t[o+1],i),l(t[o+2],r),s(n,i,r,e)}(i),function(e){const t=new pi;for(let n=0;n<r.length;n+=3)t.x=r[n+0],t.y=r[n+1],t.z=r[n+2],t.normalize().multiplyScalar(e),r[n+0]=t.x,r[n+1]=t.y,r[n+2]=t.z}(n),function(){const e=new pi;for(let n=0;n<r.length;n+=3){e.x=r[n+0],e.y=r[n+1],e.z=r[n+2];const i=u(e)/2/Math.PI+.5,s=(t=e,Math.atan2(-t.y,Math.sqrt(t.x*t.x+t.z*t.z))/Math.PI+.5);o.push(i,1-s)}var t;(function(){const e=new pi,t=new pi,n=new pi,i=new pi,s=new Zn,a=new Zn,l=new Zn;for(let h=0,d=0;h<r.length;h+=9,d+=6){e.set(r[h+0],r[h+1],r[h+2]),t.set(r[h+3],r[h+4],r[h+5]),n.set(r[h+6],r[h+7],r[h+8]),s.set(o[d+0],o[d+1]),a.set(o[d+2],o[d+3]),l.set(o[d+4],o[d+5]),i.copy(e).add(t).add(n).divideScalar(3);const p=u(i);c(s,d+0,e,p),c(a,d+2,t,p),c(l,d+4,n,p)}})(),function(){for(let e=0;e<o.length;e+=6){const t=o[e+0],n=o[e+2],i=o[e+4],r=Math.max(t,n,i),s=Math.min(t,n,i);r>.9&&s<.1&&(t<.2&&(o[e+0]+=1),n<.2&&(o[e+2]+=1),i<.2&&(o[e+4]+=1))}}()}(),this.setAttribute(\"position\",new Yr(r,3)),this.setAttribute(\"normal\",new Yr(r.slice(),3)),this.setAttribute(\"uv\",new Yr(o,2)),0===i?this.computeVertexNormals():this.normalizeNormals()}static fromJSON(e){return new Hc(e.vertices,e.indices,e.radius,e.details)}}class jc extends Hc{constructor(e=1,t=0){const n=(1+Math.sqrt(5))/2,i=1/n;super([-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-i,-n,0,-i,n,0,i,-n,0,i,n,-i,-n,0,-i,n,0,i,-n,0,i,n,0,-n,0,-i,n,0,-i,-n,0,i,n,0,i],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,
94719,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],e,t),this.type=\"DodecahedronGeometry\",this.parameters={radius:e,detail:t}}static fromJSON(e){return new jc(e.radius,e.detail)}}const Wc=new pi,qc=new pi,Xc=new pi,Yc=new Tr;class Jc extends io{constructor(e=null,t=1){if(super(),this.type=\"EdgesGeometry\",this.parameters={geometry:e,thresholdAngle:t},null!==e){const n=4,i=Math.pow(10,n),r=Math.cos(zn*t),o=e.getIndex(),s=e.getAttribute(\"position\"),a=o?o.count:s.count,l=[0,0,0],c=[\"a\",\"b\",\"c\"],u=new Array(3),h={},d=[];for(let e=0;e<a;e+=3){o?(l[0]=o.getX(e),l[1]=o.getX(e+1),l[2]=o.getX(e+2)):(l[0]=e,l[1]=e+1,l[2]=e+2);const{a:t,b:n,c:a}=Yc;if(t.fromBufferAttribute(s,l[0]),n.fromBufferAttribute(s,l[1]),a.fromBufferAttribute(s,l[2]),Yc.getNormal(Xc),u[0]=`${Math.round(t.x*i)},${Math.round(t.y*i)},${Math.round(t.z*i)}`,u[1]=`${Math.round(n.x*i)},${Math.round(n.y*i)},${Math.round(n.z*i)}`,u[2]=`${Math.round(a.x*i)},${Math.round(a.y*i)},${Math.round(a.z*i)}`,u[0]!==u[1]&&u[1]!==u[2]&&u[2]!==u[0])for(let e=0;e<3;e++){const t=(e+1)%3,n=u[e],i=u[t],o=Yc[c[e]],s=Yc[c[t]],a=`${n}_${i}`,p=`${i}_${n}`;p in h&&h[p]?(Xc.dot(h[p].normal)<=r&&(d.push(o.x,o.y,o.z),d.push(s.x,s.y,s.z)),h[p]=null):a in h||(h[a]={index0:l[e],index1:l[t],normal:Xc.clone()})}}for(const e in h)if(h[e]){const{index0:t,index1:n}=h[e];Wc.fromBufferAttribute(s,t),qc.fromBufferAttribute(s,n),d.push(Wc.x,Wc.y,Wc.z),d.push(qc.x,qc.y,qc.z)}this.setAttribute(\"position\",new Yr(d,3))}}}class Zc{constructor(){this.type=\"Curve\",this.arcLengthDivisions=200}getPoint(){return console.warn(\"THREE.Curve: .getPoint() not implemented.\"),null}getPointAt(e,t){const n=this.getUtoTmapping(e);return this.getPoint(n,t)}getPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return t}getSpacedPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let n,i=this.getPoint(0),r=0;t.push(0);for(let o=1;o<=e;o++)n=this.getPoint(o/e),r+=n.distanceTo(i),t.push(r),i=n;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const n=this.getLengths();let i=0;const r=n.length;let o;o=t||e*n[r-1];let s,a=0,l=r-1;for(;a<=l;)if(i=Math.floor(a+(l-a)/2),s=n[i]-o,s<0)a=i+1;else{if(!(s>0)){l=i;break}l=i-1}if(i=l,n[i]===o)return i/(r-1);const c=n[i];return(i+(o-c)/(n[i+1]-c))/(r-1)}getTangent(e,t){const n=1e-4;let i=e-n,r=e+n;i<0&&(i=0),r>1&&(r=1);const o=this.getPoint(i),s=this.getPoint(r),a=t||(o.isVector2?new Zn:new pi);return a.copy(s).sub(o).normalize(),a}getTangentAt(e,t){const n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t){const n=new pi,i=[],r=[],o=[],s=new pi,a=new ji;for(let t=0;t<=e;t++){const n=t/e;i[t]=this.getTangentAt(n,new pi)}r[0]=new pi,o[0]=new pi;let l=Number.MAX_VALUE;const c=Math.abs(i[0].x),u=Math.abs(i[0].y),h=Math.abs(i[0].z);c<=l&&(l=c,n.set(1,0,0)),u<=l&&(l=u,n.set(0,1,0)),h<=l&&n.set(0,0,1),s.crossVectors(i[0],n).normalize(),r[0].crossVectors(i[0],s),o[0].crossVectors(i[0],r[0]);for(let t=1;t<=e;t++){if(r[t]=r[t-1].clone(),o[t]=o[t-1].clone(),s.crossVectors(i[t-1],i[t]),s.length()>Number.EPSILON){s.normalize();const e=Math.acos(Hn(i[t-1].dot(i[t]),-1,1));r[t].applyMatrix4(a.makeRotationAxis(s,e))}o[t].crossVectors(i[t],r[t])}if(!0===t){let t=Math.acos(Hn(r[0].dot(r[e]),-1,1));t/=e,i[0].dot(s.crossVectors(r[0],r[e]))>0&&(t=-t);for(let n=1;n<=e;n++)r[n].applyMatrix4(a.makeRotationAxis(i[n],t*n)),o[n].crossVectors(i[n],r[n])}return{tangents:i,normals:r,binormals:o}}clone(){return(new this.constructor).copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.5,type:\"Curve\",generator:\"Curve.toJSON\"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class $c extends Zc{constructor(e=0,t=0,n=1,i=1,r=0,o=2*Math.PI,s=!1,a=0){super(),this.type=\"EllipseCurve\",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=i,this.aStartAngle=r,this.aEndAngle=o,this.aClockwise=s,this.aRotation=a}getPoint(e,t){const n=t||new Zn,i=2*Math.PI;let r=this.aEndAngle-this.aStartAngle;const o=Math.abs(r)<Number.EPSILON;for(;r<0;)r+=i;for(;r>i;)r-=i;r<Number.EPSILON&&(r=o?0:i),!0!==this.aClockwise||o||(r===i?r=-i:r-=i);const s=this.aStartAngle+e*r;let a=this.aX+this.xRadius*Math.cos(s),l=this.aY+this.yRadius*Math.sin(s);if(0!==this.aRotation){const e=Math.cos(this.aRotation),t=Math.sin(this.aRotation),n=a-this.aX,i=l-this.aY;a=n*e-i*t+this.aX,l=n*t+i*e+this.aY}return n.set(a,l)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){const e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}}$c.prototype.isEllipseCurve=!0;class Kc extends $c{constructor(e,t,n,i,r,o){super(e,t,n,n,i,r,o),this.type=\"ArcCurve\"}}function Qc(){let e=0,t=0,n=0,i=0;function r(r,o,s,a){e=r,t=s,n=-3*r+3*o-2*s-a,i=2*r-2*o+s+a}return{initCatmullRom:function(e,t,n,i,o){r(t,n,o*(n-e),o*(i-t))},initNonuniformCatmullRom:function(e,t,n,i,o,s,a){let l=(t-e)/o-(n-e)/(o+s)+(n-t)/s,c=(n-t)/s-(i-t)/(s+a)+(i-n)/a;l*=s,c*=s,r(t,n,l,c)},calc:function(r){const o=r*r;return e+t*r+n*o+i*(o*r)}}}Kc.prototype.isArcCurve=!0;const eu=new pi,tu=new Qc,nu=new Qc,iu=new Qc;class ru extends Zc{constructor(e=[],t=!1,n=\"centripetal\",i=.5){super(),this.type=\"CatmullRomCurve3\",this.points=e,this.closed=t,this.curveType=n,this.tension=i}getPoint(e,t=new pi){const n=t,i=this.points,r=i.length,o=(r-(this.closed?0:1))*e;let s,a,l=Math.floor(o),c=o-l;this.closed?l+=l>0?0:(Math.floor(Math.abs(l)/r)+1)*r:0===c&&l===r-1&&(l=r-2,c=1),this.closed||l>0?s=i[(l-1)%r]:(eu.subVectors(i[0],i[1]).add(i[0]),s=eu);const u=i[l%r],h=i[(l+1)%r];
947if(this.closed||l+2<r?a=i[(l+2)%r]:(eu.subVectors(i[r-1],i[r-2]).add(i[r-1]),a=eu),\"centripetal\"===this.curveType||\"chordal\"===this.curveType){const e=\"chordal\"===this.curveType?.5:.25;let t=Math.pow(s.distanceToSquared(u),e),n=Math.pow(u.distanceToSquared(h),e),i=Math.pow(h.distanceToSquared(a),e);n<1e-4&&(n=1),t<1e-4&&(t=n),i<1e-4&&(i=n),tu.initNonuniformCatmullRom(s.x,u.x,h.x,a.x,t,n,i),nu.initNonuniformCatmullRom(s.y,u.y,h.y,a.y,t,n,i),iu.initNonuniformCatmullRom(s.z,u.z,h.z,a.z,t,n,i)}else\"catmullrom\"===this.curveType&&(tu.initCatmullRom(s.x,u.x,h.x,a.x,this.tension),nu.initCatmullRom(s.y,u.y,h.y,a.y,this.tension),iu.initCatmullRom(s.z,u.z,h.z,a.z,this.tension));return n.set(tu.calc(c),nu.calc(c),iu.calc(c)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const n=e.points[t];this.points.push(n.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const n=this.points[t];e.points.push(n.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const n=e.points[t];this.points.push((new pi).fromArray(n))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}function ou(e,t,n,i,r){const o=.5*(i-t),s=.5*(r-n),a=e*e;return(2*n-2*i+o+s)*(e*a)+(-3*n+3*i-2*o-s)*a+o*e+n}function su(e,t,n,i){return function(e,t){const n=1-e;return n*n*t}(e,t)+function(e,t){return 2*(1-e)*e*t}(e,n)+function(e,t){return e*e*t}(e,i)}function au(e,t,n,i,r){return function(e,t){const n=1-e;return n*n*n*t}(e,t)+function(e,t){const n=1-e;return 3*n*n*e*t}(e,n)+function(e,t){return 3*(1-e)*e*e*t}(e,i)+function(e,t){return e*e*e*t}(e,r)}ru.prototype.isCatmullRomCurve3=!0;class lu extends Zc{constructor(e=new Zn,t=new Zn,n=new Zn,i=new Zn){super(),this.type=\"CubicBezierCurve\",this.v0=e,this.v1=t,this.v2=n,this.v3=i}getPoint(e,t=new Zn){const n=t,i=this.v0,r=this.v1,o=this.v2,s=this.v3;return n.set(au(e,i.x,r.x,o.x,s.x),au(e,i.y,r.y,o.y,s.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}lu.prototype.isCubicBezierCurve=!0;class cu extends Zc{constructor(e=new pi,t=new pi,n=new pi,i=new pi){super(),this.type=\"CubicBezierCurve3\",this.v0=e,this.v1=t,this.v2=n,this.v3=i}getPoint(e,t=new pi){const n=t,i=this.v0,r=this.v1,o=this.v2,s=this.v3;return n.set(au(e,i.x,r.x,o.x,s.x),au(e,i.y,r.y,o.y,s.y),au(e,i.z,r.z,o.z,s.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}cu.prototype.isCubicBezierCurve3=!0;class uu extends Zc{constructor(e=new Zn,t=new Zn){super(),this.type=\"LineCurve\",this.v1=e,this.v2=t}getPoint(e,t=new Zn){const n=t;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t){const n=t||new Zn;return n.copy(this.v2).sub(this.v1).normalize(),n}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}uu.prototype.isLineCurve=!0;class hu extends Zc{constructor(e=new pi,t=new pi){super(),this.type=\"LineCurve3\",this.isLineCurve3=!0,this.v1=e,this.v2=t}getPoint(e,t=new pi){const n=t;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}getPointAt(e,t){return this.getPoint(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class du extends Zc{constructor(e=new Zn,t=new Zn,n=new Zn){super(),this.type=\"QuadraticBezierCurve\",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new Zn){const n=t,i=this.v0,r=this.v1,o=this.v2;return n.set(su(e,i.x,r.x,o.x),su(e,i.y,r.y,o.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}du.prototype.isQuadraticBezierCurve=!0;class pu extends Zc{constructor(e=new pi,t=new pi,n=new pi){super(),this.type=\"QuadraticBezierCurve3\",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new pi){const n=t,i=this.v0,r=this.v1,o=this.v2;return n.set(su(e,i.x,r.x,o.x),su(e,i.y,r.y,o.y),su(e,i.z,r.z,o.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}pu.prototype.isQuadraticBezierCurve3=!0;class fu extends Zc{constructor(e=[]){super(),this.type=\"SplineCurve\",this.points=e}getPoint(e,t=new Zn){const n=t,i=this.points,r=(i.length-1)*e,o=Math.floor(r),s=r-o,a=i[0===o?o:o-1],l=i[o],c=i[o>i.length-2?i.length-1:o+1],u=i[o>i.length-3?i.length-1:o+2];return n.set(ou(s,a.x,l.x,c.x,u.x),ou(s,a.y,l.y,c.y,u.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const n=e.points[t];this.points.push(n.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const n=this.points[t];e.points.push(n.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const n=e.points[t];this.points.push((new Zn).fromArray(n))}return this}}fu.prototype.isSplineCurve=!0;var mu=Object.freeze({__proto__:null,ArcCurve:Kc,CatmullRomCurve3:ru,CubicBezierCurve:lu,CubicBezierCurve3:cu,EllipseCurve:$c,LineCurve:uu,LineCurve3:hu,QuadraticBezierCurve:du,QuadraticBezierCurve3:pu,SplineCurve:fu});class gu extends Zc{constructor(){super(),this.type=\"CurvePath\",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){const e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new uu(t,e))}getPoint(e,t){const n=e*this.getLength(),i=this.getCurveLengths();let r=0;for(;r<i.length;){if(i[r]>=n){const e=i[r]-n,o=this.curves[r],s=o.getLength(),a=0===s?0:1-e/s;return o.getPointAt(a,t)}r++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let n=0,i=this.curves.length;n<i;n++)t+=this.curves[n].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(e=40){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return this.autoClose&&t.push(t[0]),t}getPoints(e=12){const t=[];let n;for(let i=0,r=this.curves;i<r.length;i++){const o=r[i],s=o&&o.isEllipseCurve?2*e:o&&(o.isLineCurve||o.isLineCurve3)?1:o&&o.isSplineCurve?e*o.points.length:e,a=o.getPoints(s);for(let e=0;e<a.length;e++){const i=a[e];n&&n.equals(i)||(t.push(i),n=i)}}return this.autoClose&&t.length>
vendor: 15,232 bytes, line 947
9471&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){const n=e.curves[t];this.curves.push(n.clone())}return this.autoClose=e.autoClose,this}toJSON(){const e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,n=this.curves.length;t<n;t++){const n=this.curves[t];e.curves.push(n.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){const n=e.curves[t];this.curves.push((new mu[n.type]).fromJSON(n))}return this}}class vu extends gu{constructor(e){super(),this.type=\"Path\",this.currentPoint=new Zn,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,n=e.length;t<n;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){const n=new uu(this.currentPoint.clone(),new Zn(e,t));return this.curves.push(n),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,n,i){const r=new du(this.currentPoint.clone(),new Zn(e,t),new Zn(n,i));return this.curves.push(r),this.currentPoint.set(n,i),this}bezierCurveTo(e,t,n,i,r,o){const s=new lu(this.currentPoint.clone(),new Zn(e,t),new Zn(n,i),new Zn(r,o));return this.curves.push(s),this.currentPoint.set(r,o),this}splineThru(e){const t=[this.currentPoint.clone()].concat(e),n=new fu(t);return this.curves.push(n),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,n,i,r,o){const s=this.currentPoint.x,a=this.currentPoint.y;return this.absarc(e+s,t+a,n,i,r,o),this}absarc(e,t,n,i,r,o){return this.absellipse(e,t,n,n,i,r,o),this}ellipse(e,t,n,i,r,o,s,a){const l=this.currentPoint.x,c=this.currentPoint.y;return this.absellipse(e+l,t+c,n,i,r,o,s,a),this}absellipse(e,t,n,i,r,o,s,a){const l=new $c(e,t,n,i,r,o,s,a);if(this.curves.length>0){const e=l.getPoint(0);e.equals(this.currentPoint)||this.lineTo(e.x,e.y)}this.curves.push(l);const c=l.getPoint(1);return this.currentPoint.copy(c),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class yu extends vu{constructor(e){super(e),this.uuid=Vn(),this.type=\"Shape\",this.holes=[]}getPointsHoles(e){const t=[];for(let n=0,i=this.holes.length;n<i;n++)t[n]=this.holes[n].getPoints(e);return t}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){const n=e.holes[t];this.holes.push(n.clone())}return this}toJSON(){const e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,n=this.holes.length;t<n;t++){const n=this.holes[t];e.holes.push(n.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){const n=e.holes[t];this.holes.push((new vu).fromJSON(n))}return this}}function xu(e,t,n,i,r){let o,s;if(r===function(e,t,n,i){let r=0;for(let o=t,s=n-i;o<n;o+=i)r+=(e[s]-e[o])*(e[o+1]+e[s+1]),s=o;return r}(e,t,n,i)>0)for(o=t;o<n;o+=i)s=Gu(o,e[o],e[o+1],s);else for(o=n-i;o>=t;o-=i)s=Gu(o,e[o],e[o+1],s);return s&&Iu(s,s.next)&&(ku(s),s=s.next),s}function _u(e,t){if(!e)return e;t||(t=e);let n,i=e;do{if(n=!1,i.steiner||!Iu(i,i.next)&&0!==Ou(i.prev,i,i.next))i=i.next;else{if(ku(i),i=t=i.prev,i===i.next)break;n=!0}}while(n||i!==t);return t}function bu(e,t,n,i,r,o,s){if(!e)return;!s&&o&&function(e,t,n,i){let r=e;do{null===r.z&&(r.z=Cu(r.x,r.y,t,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,function(e){let t,n,i,r,o,s,a,l,c=1;do{for(n=e,e=null,o=null,s=0;n;){for(s++,i=n,a=0,t=0;t<c&&(a++,i=i.nextZ,i);t++);for(l=c;a>0||l>0&&i;)0!==a&&(0===l||!i||n.z<=i.z)?(r=n,n=n.nextZ,a--):(r=i,i=i.nextZ,l--),o?o.nextZ=r:e=r,r.prevZ=o,o=r;n=i}o.nextZ=null,c*=2}while(s>1)}(r)}(e,i,r,o);let a,l,c=e;for(;e.prev!==e.next;)if(a=e.prev,l=e.next,o?Mu(e,i,r,o):wu(e))t.push(a.i/n),t.push(e.i/n),t.push(l.i/n),ku(e),e=l.next,c=l.next;else if((e=l)===c){s?1===s?bu(e=Su(_u(e),t,n),t,n,i,r,o,2):2===s&&Eu(e,t,n,i,r,o):bu(_u(e),t,n,i,r,o,1);break}}function wu(e){const t=e.prev,n=e,i=e.next;if(Ou(t,n,i)>=0)return!1;let r=e.next.next;for(;r!==e.prev;){if(Ru(t.x,t.y,n.x,n.y,i.x,i.y,r.x,r.y)&&Ou(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function Mu(e,t,n,i){const r=e.prev,o=e,s=e.next;if(Ou(r,o,s)>=0)return!1;const a=r.x<o.x?r.x<s.x?r.x:s.x:o.x<s.x?o.x:s.x,l=r.y<o.y?r.y<s.y?r.y:s.y:o.y<s.y?o.y:s.y,c=r.x>o.x?r.x>s.x?r.x:s.x:o.x>s.x?o.x:s.x,u=r.y>o.y?r.y>s.y?r.y:s.y:o.y>s.y?o.y:s.y,h=Cu(a,l,t,n,i),d=Cu(c,u,t,n,i);let p=e.prevZ,f=e.nextZ;for(;p&&p.z>=h&&f&&f.z<=d;){if(p!==e.prev&&p!==e.next&&Ru(r.x,r.y,o.x,o.y,s.x,s.y,p.x,p.y)&&Ou(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,f!==e.prev&&f!==e.next&&Ru(r.x,r.y,o.x,o.y,s.x,s.y,f.x,f.y)&&Ou(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;p&&p.z>=h;){if(p!==e.prev&&p!==e.next&&Ru(r.x,r.y,o.x,o.y,s.x,s.y,p.x,p.y)&&Ou(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;f&&f.z<=d;){if(f!==e.prev&&f!==e.next&&Ru(r.x,r.y,o.x,o.y,s.x,s.y,f.x,f.y)&&Ou(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function Su(e,t,n){let i=e;do{const r=i.prev,o=i.next.next;!Iu(r,o)&&Fu(r,i,i.next,o)&&zu(r,o)&&zu(o,r)&&(t.push(r.i/n),t.push(i.i/n),t.push(o.i/n),ku(i),ku(i.next),i=e=o),i=i.next}while(i!==e);return _u(i)}function Eu(e,t,n,i,r,o){let s=e;do{let e=s.next.next;for(;e!==s.prev;){if(s.i!==e.i&&Du(s,e)){let a=Bu(s,e);return s=_u(s,s.next),a=_u(a,a.next),bu(s,t,n,i,r,o),void bu(a,t,n,i,r,o)}e=e.next}s=s.next}while(s!==e)}function Tu(e,t){return e.x-t.x}function Au(e,t){if(t=function(e,t){let n=t;const i=e.x,r=e.y;let o,s=-1/0;do{if(r<=n.y&&r>=n.next.y&&n.next.y!==n.y){const e=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(e<=i&&e>s){if(s=e,e===i){if(r===n.y)return n;if(r===n.next.y)return n.next}o=n.x<n.next.x?n:n.next}}n=n.next}while(n!==t);if(!o)return null;if(i===s)return o;const a=o,l=o.x,c=o.y;let u,h=1/0;n=o;do{i>=n.x&&n.x>=l&&i!==n.x&&Ru(r<c?i:s,r,l,c,r<c?s:i,r,n.x,n.y)&&(u=Math.abs(r-n.y)/(i-n.x),zu(n,e)&&(u<h||u===h&&(n.x>o.x||n.x===o.x&&Lu(o,n)))&&(o=n,h=u)),n=n.next}while(n!==a);return o}(e,t),t){const n=Bu(t,e);_u(t,t.next),_u(n,n.next)}}function Lu(e,t){return Ou(e.prev,e,t.prev)<0&&Ou(t.next,e,e.next)<0}function Cu(e,t,n,i,r){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*r)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*r)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function Pu(e){let t=e,n=e;do{(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next}while(t!==e);return n}function Ru(e,t,n,i,r,o,s,a){return(r-s)*(t-a)-(e-s)*(o-a)>=0&&(e-s)*(i-a)-(n-s)*(t-a)>=0&&(n-s)*(o-a)-(r-s)*(i-a)>=0}function Du(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&Fu(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(zu(e,t)&&zu(t,e)&&function(e,t){let n=e,i=!1;const r=(e.x+t.x)/2,o=(e.y+t.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&r<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==e);return i}(e,t)&&(Ou(e.prev,e,t.prev)||Ou(e,t.prev,t))||Iu(e,t)&&Ou(e.prev,e,e.next)>0&&Ou(t.prev,t,t.next)>0)}function Ou(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function Iu(e,t){return e.x===t.x&&e.y===t.y}function Fu(e,t,n,i){const r=Uu(Ou(e,t,n)),o=Uu(Ou(e,t,i)),s=Uu(Ou(n,i,e)),a=Uu(Ou(n,i,t));return r!==o&&s!==a||!(0!==r||!Nu(e,n,t))||!(0!==o||!Nu(e,i,t))||!(0!==s||!Nu(n,e,i))||!(0!==a||!Nu(n,t,i))}function Nu(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function Uu(e){return e>0?1:e<0?-1:0}function zu(e,t){return Ou(e.prev,e,e.next)<0?Ou(e,t,e.next)>=0&&Ou(e,e.prev,t)>=0:Ou(e,t,e.prev)<0||Ou(e,e.next,t)<0}function Bu(e,t){const n=new Vu(e.i,e.x,e.y),i=new Vu(t.i,t.x,t.y),r=e.next,o=t.prev;return e.next=t,t.prev=e,n.next=r,r.prev=n,i.next=n,n.prev=i,o.next=i,i.prev=o,i}function Gu(e,t,n,i){const r=new Vu(e,t,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function ku(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 Vu(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}class Hu{static area(e){const t=e.length;let n=0;for(let i=t-1,r=0;r<t;i=r++)n+=e[i].x*e[r].y-e[r].x*e[i].y;return.5*n}static isClockWise(e){return Hu.area(e)<0}static triangulateShape(e,t){const n=[],i=[],r=[];ju(e),Wu(n,e);let o=e.length;t.forEach(ju);for(let e=0;e<t.length;e++)i.push(o),o+=t[e].length,Wu(n,t[e]);const s=function(e,t,n=2){const i=t&&t.length,r=i?t[0]*n:e.length;let o=xu(e,0,r,n,!0);const s=[];if(!o||o.next===o.prev)return s;let a,l,c,u,h,d,p;if(i&&(o=function(e,t,n,i){const r=[];let o,s,a,l,c;for(o=0,s=t.length;o<s;o++)a=t[o]*i,l=o<s-1?t[o+1]*i:e.length,c=xu(e,a,l,i,!1),c===c.next&&(c.steiner=!0),r.push(Pu(c));for(r.sort(Tu),o=0;o<r.length;o++)Au(r[o],n),n=_u(n,n.next);return n}(e,t,o,n)),e.length>80*n){a=c=e[0],l=u=e[1];for(let t=n;t<r;t+=n)h=e[t],d=e[t+1],h<a&&(a=h),d<l&&(l=d),h>c&&(c=h),d>u&&(u=d);p=Math.max(c-a,u-l),p=0!==p?1/p:0}return bu(o,s,n,a,l,p),s}(n,i);for(let e=0;e<s.length;e+=3)r.push(s.slice(e,e+3));return r}}function ju(e){const t=e.length;t>2&&e[t-1].equals(e[0])&&e.pop()}function Wu(e,t){for(let n=0;n<t.length;n++)e.push(t[n].x),e.push(t[n].y)}class qu extends io{constructor(e=new yu([new Zn(.5,.5),new Zn(-.5,.5),new Zn(-.5,-.5),new Zn(.5,-.5)]),t={}){super(),this.type=\"ExtrudeGeometry\",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];const n=this,i=[],r=[];for(let t=0,n=e.length;t<n;t++)o(e[t]);function o(e){const o=[],s=void 0!==t.curveSegments?t.curveSegments:12,a=void 0!==t.steps?t.steps:1;let l=void 0!==t.depth?t.depth:1,c=void 0===t.bevelEnabled||t.bevelEnabled,u=void 0!==t.bevelThickness?t.bevelThickness:.2,h=void 0!==t.bevelSize?t.bevelSize:u-.1,d=void 0!==t.bevelOffset?t.bevelOffset:0,p=void 0!==t.bevelSegments?t.bevelSegments:3;const f=t.extrudePath,m=void 0!==t.UVGenerator?t.UVGenerator:Xu;void 0!==t.amount&&(console.warn(\"THREE.ExtrudeBufferGeometry: amount has been renamed to depth.\"),l=t.amount);let g,v,y,x,_,b=!1;f&&(g=f.getSpacedPoints(a),b=!0,c=!1,v=f.computeFrenetFrames(a,!1),y=new pi,x=new pi,_=new pi),c||(p=0,u=0,h=0,d=0);const w=e.extractPoints(s);let M=w.shape;const S=w.holes;if(!Hu.isClockWise(M)){M=M.reverse();for(let e=0,t=S.length;e<t;e++){const t=S[e];Hu.isClockWise(t)&&(S[e]=t.reverse())}}const E=Hu.triangulateShape(M,S),T=M;for(let e=0,t=S.length;e<t;e++){const t=S[e];M=M.concat(t)}function A(e,t,n){return t||console.error(\"THREE.ExtrudeGeometry: vec does not exist\"),t.clone().multiplyScalar(n).add(e)}const L=M.length,C=E.length;function P(e,t,n){let i,r,o;const s=e.x-t.x,a=e.y-t.y,l=n.x-e.x,c=n.y-e.y,u=s*s+a*a,h=s*c-a*l;if(Math.abs(h)>Number.EPSILON){const h=Math.sqrt(u),d=Math.sqrt(l*l+c*c),p=t.x-a/h,f=t.y+s/h,m=((n.x-c/d-p)*c-(n.y+l/d-f)*l)/(s*c-a*l);i=p+s*m-e.x,r=f+a*m-e.y;const g=i*i+r*r;if(g<=2)return new Zn(i,r);o=Math.sqrt(g/2)}else{let e=!1;s>Number.EPSILON?l>Number.EPSILON&&(e=!0):s<-Number.EPSILON?l<-Number.EPSILON&&(e=!0):Math.sign(a)===Math.sign(c)&&(e=!0),e?(i=-a,r=s,o=Math.sqrt(u)):(i=s,r=a,o=Math.sqrt(u/2))}return new Zn(i/o,r/o)}const R=[];for(let e=0,t=T.length,n=t-1,i=e+1;e<t;e++,n++,i++)n===t&&(n=0),i===t&&(i=0),R[e]=P(T[e],T[n],T[i]);const D=[];let O,I=R.concat();for(let e=0,t=S.length;e<t;e++){const t=S[e];O=[];for(let e=0,n=t.length,i=n-1,r=e+1;e<n;e++,i++,r++)i===n&&(i=0),r===n&&(r=0),O[e]=P(t[e],t[i],t[r]);D.push(O),I=I.concat(O)}for(let e=0;e<p;e++){const t=e/p,n=u*Math.cos(t*Math.PI/2),i=h*Math.sin(t*Math.PI/2)+d;for(let e=0,t=T.length;e<t;e++){const t=A(T[e],R[e],i);U(t.x,t.y,-n)}for(let e=0,t=S.length;e<t;e++){const t=S[e];O=D[e];for(let e=0,r=t.length;e<r;e++){const r=A(t[e],O[e],i);U(r.x,r.y,-n)}}}const F=h+d;for(let e=0;e<L;e++){const t=c?A(M[e],I[e],F):M[e];b?(x.copy(v.normals[0]).multiplyScalar(t.x),y.copy(v.binormals[0]).multiplyScalar(t.y),_.copy(g[0]).add(x).add(y),U(_.x,_.y,_.z)):U(t.x,t.y,0)}for(let e=1;e<=a;e++)for(let t=0;t<L;t++){const n=c?A(M[t],I[t],F):M[t];b?(x.copy(v.normals[e]).multiplyScalar(n.x),y.copy(v.binormals[e]).multiplyScalar(n.y),_.copy(g[e]).add(x).add(y),U(_.x,_.y,_.z)):U(n.x,n.y,l/a*e)}for(let e=p-1;e>=0;e--){const t=e/p,n=u*Math.cos(t*Math.PI/2),i=h*Math.sin(t*Math.PI/2)+d;for(let e=0,t=T.length;e<t;e++){const t=A(T[e],R[e],i);U(t.x,t.y,l+n)}for(let e=0,t=S.length;e<t;e++){const t=S[e];O=D[e];for(let e=0,r=t.length;e<r;e++){const r=A(t[e],O[e],i);b?U(r.x,r.y+g[a-1].y,g[a-1].x+n):U(r.x,r.y,l+n)}}}function N(e,t){let n=e.length;for(;--n>=0;){const i=n;let r=n-1;r<0&&(r=e.length-1);for(let e=0,n=a+2*p;e<n;e++){const n=L*e,o=L*(e+1);B(t+i+n,t+r+n,t+r+o,t+i+o)}}}function U(e,t,n){o.push(e),o.push(t),o.push(n)}function z(e,t,r){G(e),G(t),G(r);const o=i.length/3,s=m.generateTopUV(n,i,o-3,o-2,o-1);k(s[0]),k(s[1]),k(s[2])}function B(e,t,r,o){G(e),G(t),G(o),G(t),G(r),G(o);const s=i.length/3,a=m.generateSideWallUV(n,i,s-6,s-3,s-2,s-1);k(a[0]),k(a[1]),k(a[3]),k(a[1]),k(a[2]),k(a[3])}function G(e){i.push(o[3*e+0]),i.push(o[3*e+1]),i.push(o[3*e+2])}function k(e){r.push(e.x),r.push(e.y)}!function(){const e=i.length/3;if(c){let e=0,t=L*e;for(let e=0;e<C;e++){const n=E[e];z(n[2]+t,n[1]+t,n[0]+t)}e=a+2*p,t=L*e;for(let e=0;e<C;e++){const n=E[e];z(n[0]+t,n[1]+t,n[2]+t)}}else{for(let e=0;e<C;e++){const t=E[e];z(t[2],t[1],t[0])}for(let e=0;e<C;e++){const t=E[e];z(t[0]+L*a,t[1]+L*a,t[2]+L*a)}}n.addGroup(e,i.length/3-e,0)}(),function(){const e=i.length/3;let t=0;N(T,t),t+=T.length;for(let e=0,n=S.length;e<n;e++){const n=S[e];N(n,t),t+=n.length}n.addGroup(e,i.length/3-e,1)}()}this.setAttribute(\"position\",new Yr(i,3)),this.setAttribute(\"uv\",new Yr(r,2)),this.computeVertexNormals()}toJSON(){const e=super.toJSON();return function(e,t,n){if(n.shapes=[],Array.isArray(e))for(let t=0,i=e.length;t<i;t++){const i=e[t];n.shapes.push(i.uuid)}else n.shapes.push(e.uuid);return void 0!==t.extrudePath&&(n.options.extrudePath=t.extrudePath.toJSON()),n}(this.parameters.shapes,this.parameters.options,e)}static fromJSON(e,t){const n=[];for(let i=0,r=e.shapes.length;i<r;i++){const r=t[e.shapes[i]];n.push(r)}const i=e.options.extrudePath;return void 0!==i&&(e.options.extrudePath=(new mu[i.type]).fromJSON(i)),new qu(n,e.options)}}const Xu={generateTopUV:function(e,t,n,i,r){const o=t[3*n],s=t[3*n+1],a=t[3*i],l=t[3*i+1],c=t[3*r],u=t[3*r+1];return[new Zn(o,s),new Zn(a,l),new Zn(c,u)]},generateSideWallUV:function(e,t,n,i,r,o){const s=t[3*n],a=t[3*n+1],l=t[3*n+2],c=t[3*i],u=t[3*i+1],h=t[3*i+2],d=t[3*r],p=t[3*r+1],f=t[3*r+2],m=t[3*o],g=t[3*o+1],v=t[3*o+2];return Math.abs(a-u)<Math.abs(s-c)?[new Zn(s,1-l),new Zn(c,1-h),new Zn(d,1-f),new Zn(m,1-v)]:[new Zn(a,1-l),new Zn(u,1-h),new Zn(p,1-f),new Zn(g,1-v)]}};class Yu extends Hc{constructor(e=1,t=0){const n=(1+Math.sqrt(5))/2;super([-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],e,t),this.type=\"IcosahedronGeometry\",this.parameters={radiu
947s:e,detail:t}}static fromJSON(e){return new Yu(e.radius,e.detail)}}class Ju extends io{constructor(e=[new Zn(0,.5),new Zn(.5,0),new Zn(0,-.5)],t=12,n=0,i=2*Math.PI){super(),this.type=\"LatheGeometry\",this.parameters={points:e,segments:t,phiStart:n,phiLength:i},t=Math.floor(t),i=Hn(i,0,2*Math.PI);const r=[],o=[],s=[],a=1/t,l=new pi,c=new Zn;for(let r=0;r<=t;r++){const u=n+r*a*i,h=Math.sin(u),d=Math.cos(u);for(let n=0;n<=e.length-1;n++)l.x=e[n].x*h,l.y=e[n].y,l.z=e[n].x*d,o.push(l.x,l.y,l.z),c.x=r/t,c.y=n/(e.length-1),s.push(c.x,c.y)}for(let n=0;n<t;n++)for(let t=0;t<e.length-1;t++){const i=t+n*e.length,o=i,s=i+e.length,a=i+e.length+1,l=i+1;r.push(o,s,l),r.push(s,a,l)}if(this.setIndex(r),this.setAttribute(\"position\",new Yr(o,3)),this.setAttribute(\"uv\",new Yr(s,2)),this.computeVertexNormals(),i===2*Math.PI){const n=this.attributes.normal.array,i=new pi,r=new pi,o=new pi,s=t*e.length*3;for(let t=0,a=0;t<e.length;t++,a+=3)i.x=n[a+0],i.y=n[a+1],i.z=n[a+2],r.x=n[s+a+0],r.y=n[s+a+1],r.z=n[s+a+2],o.addVectors(i,r).normalize(),n[a+0]=n[s+a+0]=o.x,n[a+1]=n[s+a+1]=o.y,n[a+2]=n[s+a+2]=o.z}}static fromJSON(e){return new Ju(e.points,e.segments,e.phiStart,e.phiLength)}}class Zu extends Hc{constructor(e=1,t=0){super([1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],e,t),this.type=\"OctahedronGeometry\",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Zu(e.radius,e.detail)}}class $u extends io{constructor(e=.5,t=1,n=8,i=1,r=0,o=2*Math.PI){super(),this.type=\"RingGeometry\",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:i,thetaStart:r,thetaLength:o},n=Math.max(3,n);const s=[],a=[],l=[],c=[];let u=e;const h=(t-e)/(i=Math.max(1,i)),d=new pi,p=new Zn;for(let e=0;e<=i;e++){for(let e=0;e<=n;e++){const i=r+e/n*o;d.x=u*Math.cos(i),d.y=u*Math.sin(i),a.push(d.x,d.y,d.z),l.push(0,0,1),p.x=(d.x/t+1)/2,p.y=(d.y/t+1)/2,c.push(p.x,p.y)}u+=h}for(let e=0;e<i;e++){const t=e*(n+1);for(let e=0;e<n;e++){const i=e+t,r=i,o=i+n+1,a=i+n+2,l=i+1;s.push(r,o,l),s.push(o,a,l)}}this.setIndex(s),this.setAttribute(\"position\",new Yr(a,3)),this.setAttribute(\"normal\",new Yr(l,3)),this.setAttribute(\"uv\",new Yr(c,2))}static fromJSON(e){return new $u(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)}}class Ku extends io{constructor(e=new yu([new Zn(0,.5),new Zn(-.5,-.5),new Zn(.5,-.5)]),t=12){super(),this.type=\"ShapeGeometry\",this.parameters={shapes:e,curveSegments:t};const n=[],i=[],r=[],o=[];let s=0,a=0;if(!1===Array.isArray(e))l(e);else for(let t=0;t<e.length;t++)l(e[t]),this.addGroup(s,a,t),s+=a,a=0;function l(e){const s=i.length/3,l=e.extractPoints(t);let c=l.shape;const u=l.holes;!1===Hu.isClockWise(c)&&(c=c.reverse());for(let e=0,t=u.length;e<t;e++){const t=u[e];!0===Hu.isClockWise(t)&&(u[e]=t.reverse())}const h=Hu.triangulateShape(c,u);for(let e=0,t=u.length;e<t;e++){const t=u[e];c=c.concat(t)}for(let e=0,t=c.length;e<t;e++){const t=c[e];i.push(t.x,t.y,0),r.push(0,0,1),o.push(t.x,t.y)}for(let e=0,t=h.length;e<t;e++){const t=h[e],i=t[0]+s,r=t[1]+s,o=t[2]+s;n.push(i,r,o),a+=3}}this.setIndex(n),this.setAttribute(\"position\",new Yr(i,3)),this.setAttribute(\"normal\",new Yr(r,3)),this.setAttribute(\"uv\",new Yr(o,2))}toJSON(){const e=super.toJSON();return function(e,t){if(t.shapes=[],Array.isArray(e))for(let n=0,i=e.length;n<i;n++){const i=e[n];t.shapes.push(i.uuid)}else t.shapes.push(e.uuid);return t}(this.parameters.shapes,e)}static fromJSON(e,t){const n=[];for(let i=0,r=e.shapes.length;i<r;i++){const r=t[e.shapes[i]];n.push(r)}return new Ku(n,e.curveSegments)}}class Qu extends io{constructor(e=1,t=32,n=16,i=0,r=2*Math.PI,o=0,s=Math.PI){super(),this.type=\"SphereGeometry\",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:i,phiLength:r,thetaStart:o,thetaLength:s},t=Math.max(3,Math.floor(t)),n=Math.max(2,Math.floor(n));const a=Math.min(o+s,Math.PI);let l=0;const c=[],u=new pi,h=new pi,d=[],p=[],f=[],m=[];for(let d=0;d<=n;d++){const g=[],v=d/n;let y=0;0==d&&0==o?y=.5/t:d==n&&a==Math.PI&&(y=-.5/t);for(let n=0;n<=t;n++){const a=n/t;
vendor: 4,876 bytes, line 947
947u.x=-e*Math.cos(i+a*r)*Math.sin(o+v*s),u.y=e*Math.cos(o+v*s),u.z=e*Math.sin(i+a*r)*Math.sin(o+v*s),p.push(u.x,u.y,u.z),h.copy(u).normalize(),f.push(h.x,h.y,h.z),m.push(a+y,1-v),g.push(l++)}c.push(g)}for(let e=0;e<n;e++)for(let i=0;i<t;i++){const t=c[e][i+1],r=c[e][i],s=c[e+1][i],l=c[e+1][i+1];(0!==e||o>0)&&d.push(t,r,l),(e!==n-1||a<Math.PI)&&d.push(r,s,l)}this.setIndex(d),this.setAttribute(\"position\",new Yr(p,3)),this.setAttribute(\"normal\",new Yr(f,3)),this.setAttribute(\"uv\",new Yr(m,2))}static fromJSON(e){return new Qu(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class eh extends Hc{constructor(e=1,t=0){super([1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],e,t),this.type=\"TetrahedronGeometry\",this.parameters={radius:e,detail:t}}static fromJSON(e){return new eh(e.radius,e.detail)}}class th extends io{constructor(e=1,t=.4,n=8,i=6,r=2*Math.PI){super(),this.type=\"TorusGeometry\",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:i,arc:r},n=Math.floor(n),i=Math.floor(i);const o=[],s=[],a=[],l=[],c=new pi,u=new pi,h=new pi;for(let o=0;o<=n;o++)for(let d=0;d<=i;d++){const p=d/i*r,f=o/n*Math.PI*2;u.x=(e+t*Math.cos(f))*Math.cos(p),u.y=(e+t*Math.cos(f))*Math.sin(p),u.z=t*Math.sin(f),s.push(u.x,u.y,u.z),c.x=e*Math.cos(p),c.y=e*Math.sin(p),h.subVectors(u,c).normalize(),a.push(h.x,h.y,h.z),l.push(d/i),l.push(o/n)}for(let e=1;e<=n;e++)for(let t=1;t<=i;t++){const n=(i+1)*e+t-1,r=(i+1)*(e-1)+t-1,s=(i+1)*(e-1)+t,a=(i+1)*e+t;o.push(n,r,a),o.push(r,s,a)}this.setIndex(o),this.setAttribute(\"position\",new Yr(s,3)),this.setAttribute(\"normal\",new Yr(a,3)),this.setAttribute(\"uv\",new Yr(l,2))}static fromJSON(e){return new th(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}class nh extends io{constructor(e=1,t=.4,n=64,i=8,r=2,o=3){super(),this.type=\"TorusKnotGeometry\",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:i,p:r,q:o},n=Math.floor(n),i=Math.floor(i);const s=[],a=[],l=[],c=[],u=new pi,h=new pi,d=new pi,p=new pi,f=new pi,m=new pi,g=new pi;for(let s=0;s<=n;++s){const y=s/n*r*Math.PI*2;v(y,r,o,e,d),v(y+.01,r,o,e,p),m.subVectors(p,d),g.addVectors(p,d),f.crossVectors(m,g),g.crossVectors(f,m),f.normalize(),g.normalize();for(let e=0;e<=i;++e){const r=e/i*Math.PI*2,o=-t*Math.cos(r),p=t*Math.sin(r);u.x=d.x+(o*g.x+p*f.x),u.y=d.y+(o*g.y+p*f.y),u.z=d.z+(o*g.z+p*f.z),a.push(u.x,u.y,u.z),h.subVectors(u,d).normalize(),l.push(h.x,h.y,h.z),c.push(s/n),c.push(e/i)}}for(let e=1;e<=n;e++)for(let t=1;t<=i;t++){const n=(i+1)*(e-1)+(t-1),r=(i+1)*e+(t-1),o=(i+1)*e+t,a=(i+1)*(e-1)+t;s.push(n,r,a),s.push(r,o,a)}function v(e,t,n,i,r){const o=Math.cos(e),s=Math.sin(e),a=n/t*e,l=Math.cos(a);r.x=i*(2+l)*.5*o,r.y=i*(2+l)*s*.5,r.z=i*Math.sin(a)*.5}this.setIndex(s),this.setAttribute(\"position\",new Yr(a,3)),this.setAttribute(\"normal\",new Yr(l,3)),this.setAttribute(\"uv\",new Yr(c,2))}static fromJSON(e){return new nh(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}}class ih extends io{constructor(e=new pu(new pi(-1,-1,0),new pi(-1,1,0),new pi(1,1,0)),t=64,n=1,i=8,r=!1){super(),this.type=\"TubeGeometry\",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:i,closed:r};const o=e.computeFrenetFrames(t,r);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals;const s=new pi,a=new pi,l=new Zn;let c=new pi;const u=[],h=[],d=[],p=[];function f(r){c=e.getPointAt(r/t,c);const l=o.normals[r],d=o.binormals[r];for(let e=0;e<=i;e++){const t=e/i*Math.PI*2,r=Math.sin(t),o=-Math.cos(t);a.x=o*l.x+r*d.x,a.y=o*l.y+r*d.y,a.z=o*l.z+r*d.z,a.normalize(),h.push(a.x,a.y,a.z),s.x=c.x+n*a.x,s.y=c.y+n*a.y,s.z=c.z+n*a.z,u.push(s.x,s.y,s.z)}}!function(){for(let e=0;e<t;e++)f(e);f(!1===r?t:0),function(){for(let e=0;e<=t;e++)for(let n=0;n<=i;n++)l.x=e/t,l.y=n/i,d.push(l.x,l.y)}(),function(){for(let e=1;e<=t;e++)for(let t=1;t<=i;t++){const n=(i+1)*(e-1)+(t-1),r=(i+1)*e+(t-1),o=(i+1)*e+t,s=(i+1)*(e-1)+t;p.push(n,r,s),p.push(r,o,s)}}()}(),this.setIndex(p),this.setAttribute(\"position\",new Yr(u,3)),this.setAttribute(\"normal\",new Yr(h,3)),this.setAttribute(\"uv\",new Yr(d,2))}toJSON(){const e=super.toJSON();return e.path=this.parameters.path.toJSON(),e}static fromJSON(e){return new ih((new mu[e.path.type]).fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class rh extends io{constructor(e=null){if(super(),this.type=\"WireframeGeometry\",this.parameters={geometry:e},null!==e){const t=[],n=new Set,i=new pi,r=new pi;if(null!==e.index){const o=e.attributes.position,s=e.index;let a=e.groups;0===a.length&&(a=[{start:0,count:s.count,materialIndex:0}]);for(let e=0,l=a.length;e<l;++e){const l=a[e],c=l.start;for(let e=c,a=c+l.count;e<a;e+=3)for(let a=0;a<3;a++){const l=s.getX(e+a),c=s.getX(e+(a+1)%3);i.fromBufferAttribute(o,l),r.fromBufferAttribute(o,c),!0===oh(i,r,n)&&(t.push(i.x,i.y,i.z),t.pu
947sh(r.x,r.y,r.z))}}}else{const o=e.attributes.position;for(let e=0,s=o.count/3;e<s;e++)for(let s=0;s<3;s++){const a=3*e+s,l=3*e+(s+1)%3;i.fromBufferAttribute(o,a),r.fromBufferAttribute(o,l),!0===oh(i,r,n)&&(t.push(i.x,i.y,i.z),t.push(r.x,r.y,r.z))}}this.setAttribute(\"position\",new Yr(t,3))}}}function oh(e,t,n){const i=`${e.x},${e.y},${e.z}-${t.x},${t.y},${t.z}`,r=`${t.x},${t.y},${t.z}-${e.x},${e.y},${e.z}`;return!0!==n.has(i)&&!0!==n.has(r)&&(n.add(i,r),!0)}var sh=Object.freeze({__proto__:null,BoxGeometry:So,BoxBufferGeometry:So,CircleGeometry:Gc,CircleBufferGeometry:Gc,ConeGeometry:Vc,ConeBufferGeometry:Vc,CylinderGeometry:kc,CylinderBufferGeometry:kc,DodecahedronGeometry:jc,DodecahedronBufferGeometry:jc,EdgesGeometry:Jc,ExtrudeGeometry:qu,ExtrudeBufferGeometry:qu,IcosahedronGeometry:Yu,IcosahedronBufferGeometry:Yu,LatheGeometry:Ju,LatheBufferGeometry:Ju,OctahedronGeometry:Zu,OctahedronBufferGeometry:Zu,PlaneGeometry:jo,PlaneBufferGeometry:jo,PolyhedronGeometry:Hc,PolyhedronBufferGeometry:Hc,RingGeometry:$u,RingBufferGeometry:$u,ShapeGeometry:Ku,ShapeBufferGeometry:Ku,SphereGeometry:Qu,SphereBufferGeometry:Qu,TetrahedronGeometry:eh,TetrahedronBufferGeometry:eh,TorusGeometry:th,TorusBufferGeometry:th,TorusKnotGeometry:nh,TorusKnotBufferGeometry:nh,TubeGeometry:ih,TubeBufferGeometry:ih,WireframeGeometry:rh});class ah extends Lr{constructor(e){super(),this.type=\"ShadowMaterial\",this.color=new Fr(0),this.transparent=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this}}ah.prototype.isShadowMaterial=!0;class lh extends Lr{constructor(e){super(),this.defines={STANDARD:\"\"},this.type=\"MeshStandardMaterial\",this.color=new Fr(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Fr(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=an,this.normalScale=new Zn(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap=\"round\",this.wireframeLinejoin=\"round\",this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:\"\"},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this}}lh.prototype.isMeshStandardMaterial=!0;class ch extends lh{constructor(e){super(),this.defines={STANDARD:\"\",PHYSICAL:\"\"},this.type=\"MeshPhysicalMaterial\",this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new Zn(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,\"reflectivity\",{get:function(){return Hn(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(e){this.ior=(1+.4*e)/(1-.4*e)}}),this.sheenColor=new Fr(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=.01,this.thicknessMap=null,this.attenuationDistance=0,this.attenuationColor=new Fr(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new Fr(1,1,1),this.specularColorMap=null,this._sheen=0,this._clearcoat=0,this._transmission=0,this.setValues(e)}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:\"\",PHYSICAL:\"\"},this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}ch.prototype.isMeshPhysicalMaterial=!0;
947class uh extends Lr{constructor(e){super(),this.type=\"MeshPhongMaterial\",this.color=new Fr(16777215),this.specular=new Fr(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Fr(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=an,this.normalScale=new Zn(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=J,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap=\"round\",this.wireframeLinejoin=\"round\",this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this}}uh.prototype.isMeshPhongMaterial=!0;class hh extends Lr{constructor(e){super(),this.defines={TOON:\"\"},this.type=\"MeshToonMaterial\",this.color=new Fr(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Fr(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=an,this.normalScale=new Zn(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap=\"round\",this.wireframeLinejoin=\"round\",this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this}}hh.prototype.isMeshToonMaterial=!0;class dh extends Lr{constructor(e){super(),this.type=\"MeshNormalMaterial\",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=an,this.normalScale=new Zn(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}dh.prototype.isMeshNormalMaterial=!0;
947class ph extends Lr{constructor(e){super(),this.type=\"MeshLambertMaterial\",this.color=new Fr(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Fr(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=J,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap=\"round\",this.wireframeLinejoin=\"round\",this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this}}ph.prototype.isMeshLambertMaterial=!0;class fh extends Lr{constructor(e){super(),this.defines={MATCAP:\"\"},this.type=\"MeshMatcapMaterial\",this.color=new Fr(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=an,this.normalScale=new Zn(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:\"\"},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this}}fh.prototype.isMeshMatcapMaterial=!0;class mh extends yc{constructor(e){super(),this.type=\"LineDashedMaterial\",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}mh.prototype.isLineDashedMaterial=!0;var gh=Object.freeze({__proto__:null,ShadowMaterial:ah,SpriteMaterial:Nl,RawShaderMaterial:ts,ShaderMaterial:Lo,PointsMaterial:Cc,MeshPhysicalMaterial:ch,MeshStandardMaterial:lh,MeshPhongMaterial:uh,MeshToonMaterial:hh,MeshNormalMaterial:dh,MeshLambertMaterial:ph,MeshDepthMaterial:fl,MeshDistanceMaterial:ml,MeshBasicMaterial:Nr,MeshMatcapMaterial:fh,LineDashedMaterial:mh,LineBasicMaterial:yc,Material:Lr});const vh={arraySlice:function(e,t,n){return vh.isTypedArray(e)?new e.constructor(e.subarray(t,void 0!==n?n:e.length)):e.slice(t,n)},convertArray:function(e,t,n){return!e||!n&&e.constructor===t?e:\"number\"==typeof t.BYTES_PER_ELEMENT?new t(e):Array.prototype.slice.call(e)},isTypedArray:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)},getKeyframeOrder:function(e){const t=e.length,n=new Array(t);for(let e=0;e!==t;++e)n[e]=e;return n.sort((function(t,n){return e[t]-e[n]})),n},sortedArray:function(e,t,n){const i=e.length,r=new e.constructor(i);for(let o=0,s=0;s!==i;++o){const i=n[o]*t;for(let n=0;n!==t;++n)r[s++]=e[i+n]}return r},flattenJSON:function(e,t,n,i){let r=1,o=e[0];for(;void 0!==o&&void 0===o[i];)o=e[r++];if(void 0===o)return;let s=o[i];if(void 0!==s)if(Array.isArray(s))do{s=o[i],void 0!==s&&(t.push(o.time),n.push.apply(n,s)),o=e[r++]}while(void 0!==o);else if(void 0!==s.toArray)do{s=o[i],void 0!==s&&(t.push(o.time),s.toArray(n,n.length)),o=e[r++]}while(void 0!==o);else do{s=o[i],void 0!==s&&(t.push(o.time),n.push(s)),o=e[r++]}while(void 0!==o)},subclip:function(e,t,n,i,r=30){const o=e.clone();o.name=t;const s=[];for(let e=0;e<o.tracks.length;++e){const t=o.tracks[e],a=t.getValueSize(),l=[],c=[];for(let e=0;e<t.times.length;++e){const o=t.times[e]*r;if(!(o<n||o>=i)){l.push(t.times[e]);for(let n=0;n<a;++n)c.push(t.values[e*a+n])}}0!==l.length&&(t.times=vh.convertArray(l,t.times.constructor),t.values=vh.convertArray(c,t.values.constructor),s.push(t))}o.tracks=s;let a=1/0;for(let e=0;e<o.tracks.length;++e)a>o.tracks[e].times[0]&&(a=o.tracks[e].times[0]);for(let e=0;e<o.tracks.length;++e)o.tracks[e].shift(-1*a);return o.resetDuration(),o},makeClipAdditive:function(e,t=0,n=e,i=30){i<=0&&(i=30);const r=n.tracks.length,o=t/i;for(let t=0;t<r;++t){const i=n.tracks[t],r=i.ValueTypeName;
947if(\"bool\"===r||\"string\"===r)continue;const s=e.tracks.find((function(e){return e.name===i.name&&e.ValueTypeName===r}));if(void 0===s)continue;let a=0;const l=i.getValueSize();i.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(a=l/3);let c=0;const u=s.getValueSize();s.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(c=u/3);const h=i.times.length-1;let d;if(o<=i.times[0]){const e=a,t=l-a;d=vh.arraySlice(i.values,e,t)}else if(o>=i.times[h]){const e=h*l+a,t=e+l-a;d=vh.arraySlice(i.values,e,t)}else{const e=i.createInterpolant(),t=a,n=l-a;e.evaluate(o),d=vh.arraySlice(e.resultBuffer,t,n)}\"quaternion\"===r&&(new di).fromArray(d).normalize().conjugate().toArray(d);const p=s.times.length;for(let e=0;e<p;++e){const t=e*u+c;if(\"quaternion\"===r)di.multiplyQuaternionsFlat(s.values,t,d,0,s.values,t);else{const e=u-2*c;for(let n=0;n<e;++n)s.values[t+n]-=d[n]}}}return e.blendMode=qt,e}};class yh{constructor(e,t,n,i){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=void 0!==i?i:new t.constructor(n),this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let n=this._cachedIndex,i=t[n],r=t[n-1];e:{t:{let o;n:{i:if(!(e<i)){for(let o=n+2;;){if(void 0===i){if(e<r)break i;return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,e,r)}if(n===o)break;if(r=i,i=t[++n],e<i)break t}o=t.length;break n}if(e>=r)break e;{const s=t[1];e<s&&(n=2,r=s);for(let o=n-2;;){if(void 0===r)return this._cachedIndex=0,this.beforeStart_(0,e,i);if(n===o)break;if(i=r,r=t[--n-1],e>=r)break t}o=n,n=0}}for(;n<o;){const i=n+o>>>1;e<t[i]?o=i:n=i+1}if(i=t[n],r=t[n-1],void 0===r)return this._cachedIndex=0,this.beforeStart_(0,e,i);if(void 0===i)return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,r,e)}this._cachedIndex=n,this.intervalChanged_(n,r,i)}return this.interpolate_(n,r,e,i)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,r=e*i;for(let e=0;e!==i;++e)t[e]=n[r+e];return t}interpolate_(){throw new Error(\"call to abstract method\")}intervalChanged_(){}}yh.prototype.beforeStart_=yh.prototype.copySampleValue_,yh.prototype.afterEnd_=yh.prototype.copySampleValue_;class xh extends yh{constructor(e,t,n,i){super(e,t,n,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:Vt,endingEnd:Vt}}intervalChanged_(e,t,n){const i=this.parameterPositions;let r=e-2,o=e+1,s=i[r],a=i[o];if(void 0===s)switch(this.getSettings_().endingStart){case Ht:r=e,s=2*t-n;break;case jt:r=i.length-2,s=t+i[r]-i[r+1];break;default:r=e,s=n}if(void 0===a)switch(this.getSettings_().endingEnd){case Ht:o=e,a=2*n-t;break;case jt:o=1,a=n+i[1]-i[0];break;default:o=e-1,a=t}const l=.5*(n-t),c=this.valueSize;this._weightPrev=l/(t-s),this._weightNext=l/(a-n),this._offsetPrev=r*c,this._offsetNext=o*c}interpolate_(e,t,n,i){const r=this.resultBuffer,o=this.sampleValues,s=this.valueSize,a=e*s,l=a-s,c=this._offsetPrev,u=this._offsetNext,h=this._weightPrev,d=this._weightNext,p=(n-t)/(i-t),f=p*p,m=f*p,g=-h*m+2*h*f-h*p,v=(1+h)*m+(-1.5-2*h)*f+(-.5+h)*p+1,y=(-1-d)*m+(1.5+d)*f+.5*p,x=d*m-d*f;for(let e=0;e!==s;++e)r[e]=g*o[c+e]+v*o[l+e]+y*o[a+e]+x*o[u+e];return r}}class _h extends yh{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const r=this.resultBuffer,o=this.sampleValues,s=this.valueSize,a=e*s,l=a-s,c=(n-t)/(i-t),u=1-c;for(let e=0;e!==s;++e)r[e]=o[l+e]*u+o[a+e]*c;return r}}class bh extends yh{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e){return this.copySampleValue_(e-1)}}class wh{constructor(e,t,n,i){if(void 0===e)throw new Error(\"THREE.KeyframeTrack: track name is undefined\");if(void 0===t||0===t.length)throw new Error(\"THREE.KeyframeTrack: no keyframes in track named \"+e);this.name=e,this.times=vh.convertArray(t,this.TimeBufferType),this.values=vh.convertArray(n,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let n;if(t.toJSON!==this.toJSON)n=t.toJSON(e);else{n={name:e.name,times:vh.convertArray(e.times,Array),values:vh.convertArray(e.values,Array)};const t=e.getInterpolation();t!==e.DefaultInterpolation&&(n.interpolation=t)}return n.type=e.ValueTypeName,n}InterpolantFactoryMethodDiscrete(e){return new bh(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new _h(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new xh(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case Bt:t=this.InterpolantFactoryMethodDiscrete;break;case Gt:t=this.InterpolantFactoryMethodLinear;break;case kt:t=this.InterpolantFactoryMethodSmooth}if(void 0===t){const t=\"unsupported interpolation for \"+this.ValueTypeName+\" keyframe track named \"+this.name;if(void 0===this.createInterpolant){if(e===this.DefaultInterpolation)throw new Error(t);this.setInterpolation(this.DefaultInterpolation)}return console.warn(\"THREE.KeyframeTrack:\",t),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Bt;case this.InterpolantFactoryMethodLinear:return Gt;case this.InterpolantFactoryMethodSmooth:return kt}}getValueSize(){return this.values.length/this.times.length}shift(e){if(0!==e){const t=this.times;for(let n=0,i=t.length;n!==i;++n)t[n]+=e}return this}scale(e){if(1!==e){const t=this.times;for(let n=0,i=t.length;n!==i;++n)t[n]*=e}return this}trim(e,t){const n=this.times,i=n.length;let r=0,o=i-1;for(;r!==i&&n[r]<e;)++r;for(;-1!==o&&n[o]>t;)--o;if(++o,0!==r||o!==i){r>=o&&(o=Math.max(o,1),r=o-1);const e=this.getValueSize();this.times=vh.arraySlice(n,r,o),this.values=vh.arraySlice(this.values,r*e,o*e)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!=0&&(console.error(\"THREE.KeyframeTrack: Invalid value size in track.\",this),e=!1);const n=this.times,i=this.values,r=n.length;0===r&&(console.error(\"THREE.KeyframeTrack: Track is empty.\",this),e=!1);let o=null;for(let t=0;t!==r;t++){const i=n[t];if(\"number\"==typeof i&&isNaN(i)){console.error(\"THREE.KeyframeTrack: Time is not a valid number.\",this,t,i),e=!1;break}if(null!==o&&o>i){console.error(\"THREE.KeyframeTrack: Out of order keys.\",this,t,i,o),e=!1;break}o=i}if(void 0!==i&&vh.isTypedArray(i))for(let t=0,n=i.length;t!==n;++t){const n=i[t];if(isNaN(n)){console.error(\"THREE.KeyframeTrack: Value is not a valid number.\",this,t,n),e=!1;break}}return e}optimize(){const e=vh.arraySlice(this.times),t=vh.arraySlice(this.values),n=this.getValueSize(),i=this.getInterpolation()===kt,r=e.length-1;let o=1;for(let s=1;s<r;++s){let r=!1;const a=e[s];if(a!==e[s+1]&&(1!==s||a!==e[0]))if(i)r=!0;else{const e=s*n,i=e-n,o=e+n;for(let s=0;s!==n;++s){const n=t[e+s];if(n!==t[i+s]||n!==t[o+s]){r=!0;break}}}if(r){if(s!==o){e[o]=e[s];const i=s*n,r=o*n;for(let e=0;e!==n;++e)t[r+e]=t[i+e]}++o}}if(r>0){e[o]=e[r];for(let e=r*n,i=o*n,s=0;s!==n;++s)t[i+s]=t[e+s];++o}return o!==e.length?(this.times=vh.arraySlice(e,0,o),this.values=vh.arraySlice(t,0,o*n)):(this.times=e,this.values=t),this}clone(){const e=vh.arraySlice(this.times,0),t=vh.arraySlice(this.values,0),n=new(0,this.constructor)(this.name,e,t);return n.createInterpolant=this.createInterpolant,n}}wh.prototype.TimeBufferType=Float32Array,wh.prototype.ValueBufferType=Float32Array,wh.prototype.DefaultInterpolation=Gt;class Mh extends wh{}Mh.prototype.ValueTypeName=\"bool\",Mh.prototype.ValueBufferType=Array,Mh.prototype.DefaultInterpolation=Bt,Mh.prototype.InterpolantFactoryMethodLinear=void 0,Mh.prototype.InterpolantFactoryMethodSmooth=void 0;class Sh extends wh{}Sh.prototype.ValueTypeName=\"color\";class Eh extends wh{}Eh.prototype.ValueTypeName=\"number\";class Th extends yh{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const r=this.resultBuffer,o=this.sampleValues,s=this.valueSize,a=(n-t)/(i-t);let l=e*s;for(let e=l+s;
947l!==e;l+=4)di.slerpFlat(r,0,o,l-s,o,l,a);return r}}class Ah extends wh{InterpolantFactoryMethodLinear(e){return new Th(this.times,this.values,this.getValueSize(),e)}}Ah.prototype.ValueTypeName=\"quaternion\",Ah.prototype.DefaultInterpolation=Gt,Ah.prototype.InterpolantFactoryMethodSmooth=void 0;class Lh extends wh{}Lh.prototype.ValueTypeName=\"string\",Lh.prototype.ValueBufferType=Array,Lh.prototype.DefaultInterpolation=Bt,Lh.prototype.InterpolantFactoryMethodLinear=void 0,Lh.prototype.InterpolantFactoryMethodSmooth=void 0;class Ch extends wh{}Ch.prototype.ValueTypeName=\"vector\";class Ph{constructor(e,t=-1,n,i=Wt){this.name=e,this.tracks=n,this.duration=t,this.blendMode=i,this.uuid=Vn(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],n=e.tracks,i=1/(e.fps||1);for(let e=0,r=n.length;e!==r;++e)t.push(Rh(n[e]).scale(i));const r=new this(e.name,e.duration,t,e.blendMode);return r.uuid=e.uuid,r}static toJSON(e){const t=[],n=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let e=0,i=n.length;e!==i;++e)t.push(wh.toJSON(n[e]));return i}static CreateFromMorphTargetSequence(e,t,n,i){const r=t.length,o=[];for(let e=0;e<r;e++){let s=[],a=[];s.push((e+r-1)%r,e,(e+1)%r),a.push(0,1,0);const l=vh.getKeyframeOrder(s);s=vh.sortedArray(s,1,l),a=vh.sortedArray(a,1,l),i||0!==s[0]||(s.push(r),a.push(a[0])),o.push(new Eh(\".morphTargetInfluences[\"+t[e].name+\"]\",s,a).scale(1/n))}return new this(e,-1,o)}static findByName(e,t){let n=e;if(!Array.isArray(e)){const t=e;n=t.geometry&&t.geometry.animations||t.animations}for(let e=0;e<n.length;e++)if(n[e].name===t)return n[e];return null}static CreateClipsFromMorphTargetSequences(e,t,n){const i={},r=/^([\\w-]*?)([\\d]+)$/;for(let t=0,n=e.length;t<n;t++){const n=e[t],o=n.name.match(r);if(o&&o.length>1){const e=o[1];let t=i[e];t||(i[e]=t=[]),t.push(n)}}const o=[];for(const e in i)o.push(this.CreateFromMorphTargetSequence(e,i[e],t,n));return o}static parseAnimation(e,t){if(!e)return console.error(\"THREE.AnimationClip: No animation in JSONLoader data.\"),null;const n=function(e,t,n,i,r){if(0!==n.length){const o=[],s=[];vh.flattenJSON(n,o,s,i),0!==o.length&&r.push(new e(t,o,s))}},i=[],r=e.name||\"default\",o=e.fps||30,s=e.blendMode;let a=e.length||-1;const l=e.hierarchy||[];for(let e=0;e<l.length;e++){const r=l[e].keys;if(r&&0!==r.length)if(r[0].morphTargets){const e={};let t;for(t=0;t<r.length;t++)if(r[t].morphTargets)for(let n=0;n<r[t].morphTargets.length;n++)e[r[t].morphTargets[n]]=-1;for(const n in e){const e=[],o=[];for(let i=0;i!==r[t].morphTargets.length;++i){const i=r[t];e.push(i.time),o.push(i.morphTarget===n?1:0)}i.push(new Eh(\".morphTargetInfluence[\"+n+\"]\",e,o))}a=e.length*(o||1)}else{const o=\".bones[\"+t[e].name+\"]\";n(Ch,o+\".position\",r,\"pos\",i),n(Ah,o+\".quaternion\",r,\"rot\",i),n(Ch,o+\".scale\",r,\"scl\",i)}}return 0===i.length?null:new this(r,a,i,s)}resetDuration(){let e=0;for(let t=0,n=this.tracks.length;t!==n;++t){const n=this.tracks[t];e=Math.max(e,n.times[n.times.length-1])}return this.duration=e,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function Rh(e){if(void 0===e.type)throw new Error(\"THREE.KeyframeTrack: track type undefined, can not parse\");const t=function(e){switch(e.toLowerCase()){case\"scalar\":case\"double\":case\"float\":case\"number\":case\"integer\":return Eh;case\"vector\":case\"vector2\":case\"vector3\":case\"vector4\":return Ch;case\"color\":return Sh;case\"quaternion\":return Ah;case\"bool\":case\"boolean\":return Mh;case\"string\":return Lh}throw new Error(\"THREE.KeyframeTrack: Unsupported typeName: \"+e)}(e.type);if(void 0===e.times){const t=[],n=[];vh.flattenJSON(e.keys,t,n,\"value\"),e.times=t,e.values=n}return void 0!==t.parse?t.parse(e):new t(e.name,e.times,e.values,e.interpolation)}const Dh={enabled:!1,files:{},add:function(e,t){!1!==this.enabled&&(this.files[e]=t)},get:function(e){if(!1!==this.enabled)return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}};class Oh{constructor(e,t,n){const i=this;let r,o=!1,s=0,a=0;const l=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(e){a++,!1===o&&void 0!==i.onStart&&i.onStart(e,s,a),o=!0},this.itemEnd=function(e){s++,void 0!==i.onProgress&&i.onProgress(e,s,a),s===a&&(o=!1,void 0!==i.onLoad&&i.onLoad())},this.itemError=function(e){void 0!==i.onError&&i.onError(e)},this.resolveURL=function(e){return r?r(e):e},this.setURLModifier=function(e){return r=e,this},this.addHandler=function(e,t){return l.push(e,t),this},this.removeHandler=function(e){const t=l.indexOf(e);return-1!==t&&l.splice(t,2),this},this.getHandler=function(e){for(let t=0,n=l.length;t<n;t+=2){const n=l[t],i=l[t+1];if(n.global&&(n.lastIndex=0),n.test(e))return i}return null}}}const Ih=new Oh;class Fh{constructor(e){this.manager=void 0!==e?e:Ih,this.crossOrigin=\"anonymous\",this.withCredentials=!1,this.path=\"\",this.resourcePath=\"\",this.requestHeader={}}load(){}loadAsync(e,t){const n=this;return new Promise((function(i,r){n.load(e,i,t,r)}))}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}const Nh={};class Uh extends Fh{constructor(e){super(e)}load(e,t,n,i){void 0===e&&(e=\"\"),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);const r=Dh.get(e);if(void 0!==r)return this.manager.itemStart(e),setTimeout((()=>{t&&t(r),this.manager.itemEnd(e)}),0),r;if(void 0!==Nh[e])return void Nh[e].push({onLoad:t,onProgress:n,onError:i});Nh[e]=[],Nh[e].push({onLoad:t,onProgress:n,onError:i});
947const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?\"include\":\"same-origin\"});fetch(o).then((t=>{if(200===t.status||0===t.status){0===t.status&&console.warn(\"THREE.FileLoader: HTTP Status 0 received.\");const n=Nh[e],i=t.body.getReader(),r=t.headers.get(\"Content-Length\"),o=r?parseInt(r):0,s=0!==o;let a=0;return new ReadableStream({start(e){!function t(){i.read().then((({done:i,value:r})=>{if(i)e.close();else{a+=r.byteLength;const i=new ProgressEvent(\"progress\",{lengthComputable:s,loaded:a,total:o});for(let e=0,t=n.length;e<t;e++){const t=n[e];t.onProgress&&t.onProgress(i)}e.enqueue(r),t()}}))}()}})}throw Error(`fetch for \"${t.url}\" responded with ${t.status}: ${t.statusText}`)})).then((e=>{const t=new Response(e);switch(this.responseType){case\"arraybuffer\":return t.arrayBuffer();case\"blob\":return t.blob();case\"document\":return t.text().then((e=>(new DOMParser).parseFromString(e,this.mimeType)));case\"json\":return t.json();default:return t.text()}})).then((t=>{Dh.add(e,t);const n=Nh[e];delete Nh[e];for(let e=0,i=n.length;e<i;e++){const i=n[e];i.onLoad&&i.onLoad(t)}this.manager.itemEnd(e)})).catch((t=>{const n=Nh[e];delete Nh[e];for(let e=0,i=n.length;e<i;e++){const i=n[e];i.onError&&i.onError(t)}this.manager.itemError(e),this.manager.itemEnd(e)})),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class zh extends Fh{constructor(e){super(e)}load(e,t,n,i){const r=this,o=new Uh(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,(function(n){try{t(r.parse(JSON.parse(n)))}catch(t){i?i(t):console.error(t),r.manager.itemError(e)}}),n,i)}parse(e){const t=[];for(let n=0;n<e.length;n++){const i=Ph.parse(e[n]);t.push(i)}return t}}class Bh extends Fh{constructor(e){super(e)}load(e,t,n,i){const r=this,o=[],s=new Uc,a=new Uh(this.manager);a.setPath(this.path),a.setResponseType(\"arraybuffer\"),a.setRequestHeader(this.requestHeader),a.setWithCredentials(r.withCredentials);let l=0;function c(c){a.load(e[c],(function(e){const n=r.parse(e,!0);o[c]={width:n.width,height:n.height,format:n.format,mipmaps:n.mipmaps},l+=1,6===l&&(1===n.mipmapCount&&(s.minFilter=xe),s.image=o,s.format=n.format,s.needsUpdate=!0,t&&t(s))}),n,i)}if(Array.isArray(e))for(let t=0,n=e.length;t<n;++t)c(t);else a.load(e,(function(e){const n=r.parse(e,!0);if(n.isCubemap){const e=n.mipmaps.length/n.mipmapCount;for(let t=0;t<e;t++){o[t]={mipmaps:[]};for(let e=0;e<n.mipmapCount;e++)o[t].mipmaps.push(n.mipmaps[t*n.mipmapCount+e]),o[t].format=n.format,o[t].width=n.width,o[t].height=n.height}s.image=o}else s.image.width=n.width,s.image.height=n.height,s.mipmaps=n.mipmaps;1===n.mipmapCount&&(s.minFilter=xe),s.format=n.format,s.needsUpdate=!0,t&&t(s)}),n,i);return s}}class Gh extends Fh{constructor(e){super(e)}load(e,t,n,i){void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);const r=this,o=Dh.get(e);if(void 0!==o)return r.manager.itemStart(e),setTimeout((function(){t&&t(o),r.manager.itemEnd(e)}),0),o;const s=ti(\"img\");function a(){c(),Dh.add(e,this),t&&t(this),r.manager.itemEnd(e)}function l(t){c(),i&&i(t),r.manager.itemError(e),r.manager.itemEnd(e)}function c(){s.removeEventListener(\"load\",a,!1),s.removeEventListener(\"error\",l,!1)}return s.addEventListener(\"load\",a,!1),s.addEventListener(\"error\",l,!1),\"data:\"!==e.substr(0,5)&&void 0!==this.crossOrigin&&(s.crossOrigin=this.crossOrigin),r.manager.itemStart(e),s.src=e,s}}class kh extends Fh{constructor(e){super(e)}load(e,t,n,i){const r=new Oo,o=new Gh(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);let s=0;function a(n){o.load(e[n],(function(e){r.images[n]=e,s++,6===s&&(r.needsUpdate=!0,t&&t(r))}),void 0,i)}for(let t=0;t<e.length;++t)a(t);return r}}class Vh extends Fh{constructor(e){super(e)}load(e,t,n,i){const r=this,o=new lc,s=new Uh(this.manager);return s.setResponseType(\"arraybuffer\"),s.setRequestHeader(this.requestHeader),s.setPath(this.path),s.setWithCredentials(r.withCredentials),s.load(e,(function(e){const n=r.parse(e);n&&(void 0!==n.image?o.image=n.image:void 0!==n.data&&(o.image.width=n.width,o.image.height=n.height,o.image.data=n.data),o.wrapS=void 0!==n.wrapS?n.wrapS:de,o.wrapT=void 0!==n.wrapT?n.wrapT:de,o.magFilter=void 0!==n.magFilter?n.magFilter:xe,o.minFilter=void 0!==n.minFilter?n.minFilter:xe,o.anisotropy=void 0!==n.anisotropy?n.anisotropy:1,void 0!==n.encoding&&(o.encoding=n.encoding),void 0!==n.flipY&&(o.flipY=n.flipY),void 0!==n.format&&(o.format=n.format),void 0!==n.t
vendor: 14,474 bytes, line 947
947ype&&(o.type=n.type),void 0!==n.mipmaps&&(o.mipmaps=n.mipmaps,o.minFilter=we),1===n.mipmapCount&&(o.minFilter=xe),void 0!==n.generateMipmaps&&(o.generateMipmaps=n.generateMipmaps),o.needsUpdate=!0,t&&t(o,n))}),n,i),o}}class Hh extends Fh{constructor(e){super(e)}load(e,t,n,i){const r=new si,o=new Gh(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,(function(e){r.image=e,r.needsUpdate=!0,void 0!==t&&t(r)}),n,i),r}}class jh extends mr{constructor(e,t=1){super(),this.type=\"Light\",this.color=new Fr(e),this.intensity=t}dispose(){}copy(e){return super.copy(e),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,void 0!==this.groundColor&&(t.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(t.object.distance=this.distance),void 0!==this.angle&&(t.object.angle=this.angle),void 0!==this.decay&&(t.object.decay=this.decay),void 0!==this.penumbra&&(t.object.penumbra=this.penumbra),void 0!==this.shadow&&(t.object.shadow=this.shadow.toJSON()),t}}jh.prototype.isLight=!0;class Wh extends jh{constructor(e,t,n){super(e,n),this.type=\"HemisphereLight\",this.position.copy(mr.DefaultUp),this.updateMatrix(),this.groundColor=new Fr(t)}copy(e){return jh.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this}}Wh.prototype.isHemisphereLight=!0;const qh=new ji,Xh=new pi,Yh=new pi;class Jh{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Zn(512,512),this.map=null,this.mapPass=null,this.matrix=new ji,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new ko,this._frameExtents=new Zn(1,1),this._viewportCount=1,this._viewports=[new li(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,n=this.matrix;Xh.setFromMatrixPosition(e.matrixWorld),t.position.copy(Xh),Yh.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(Yh),t.updateMatrixWorld(),qh.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(qh),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(t.projectionMatrix),n.multiply(t.matrixWorldInverse)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return(new this.constructor).copy(this)}toJSON(){const e={};return 0!==this.bias&&(e.bias=this.bias),0!==this.normalBias&&(e.normalBias=this.normalBias),1!==this.radius&&(e.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class Zh extends Jh{constructor(){super(new Po(50,1,.5,500)),this.focus=1}updateMatrices(e){const t=this.camera,n=2*Bn*e.angle*this.focus,i=this.mapSize.width/this.mapSize.height,r=e.distance||t.far;n===t.fov&&i===t.aspect&&r===t.far||(t.fov=n,t.aspect=i,t.far=r,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}Zh.prototype.isSpotLightShadow=!0;class $h extends jh{constructor(e,t,n=0,i=Math.PI/3,r=0,o=1){super(e,t),this.type=\"SpotLight\",this.position.copy(mr.DefaultUp),this.updateMatrix(),this.target=new mr,this.distance=n,this.angle=i,this.penumbra=r,this.decay=o,this.shadow=new Zh}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}$h.prototype.isSpotLight=!0;const Kh=new ji,Qh=new pi,ed=new pi;class td extends Jh{constructor(){super(new Po(90,1,.5,500)),this._frameExtents=new Zn(4,2),this._viewportCount=6,this._viewports=[new li(2,1,1,1),new li(0,1,1,1),new li(3,1,1,1),new li(1,1,1,1),new li(3,0,1,1),new li(1,0,1,1)],this._cubeDirections=[new pi(1,0,0),new pi(-1,0,0),new pi(0,0,1),new pi(0,0,-1),new pi(0,1,0),new pi(0,-1,0)],this._cubeUps=[new pi(0,1,0),new pi(0,1,0),new pi(0,1,0),new pi(0,1,0),new pi(0,0,1),new pi(0,0,-1)]}updateMatrices(e,t=0){const n=this.camera,i=this.matrix,r=e.distance||n.far;r!==n.far&&(n.far=r,n.updateProjectionMatrix()),Qh.setFromMatrixPosition(e.matrixWorld),n.position.copy(Qh),ed.copy(n.position),ed.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(ed),n.updateMatrixWorld(),i.makeTranslation(-Qh.x,-Qh.y,-Qh.z),Kh.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Kh)}}td.prototype.isPointLightShadow=!0;class nd extends jh{constructor(e,t,n=0,i=1){super(e,t),this.type=\"PointLight\",this.distance=n,this.decay=i,this.shadow=new td}get power(){return 4*this.intensity*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}nd.prototype.isPointLight=!0;class id extends Jh{constructor(){super(new es(-5,5,5,-5,.5,500))}}id.prototype.isDirectionalLightShadow=!0;class rd extends jh{constructor(e,t){super(e,t),this.type=\"DirectionalLight\",this.position.copy(mr.DefaultUp),this.updateMatrix(),this.target=new mr,this.shadow=new id}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}rd.prototype.isDirectionalLight=!0;class od extends jh{constructor(e,t){super(e,t),this.type=\"AmbientLight\"}}od.prototype.isAmbientLight=!0;class sd extends jh{constructor(e,t,n=10,i=10){super(e,t),this.type=\"RectAreaLight\",this.width=n,this.height=i}get power(){return this.intensity*this.width*this.height*Math.PI}set power(e){this.intensity=e/(this.width*this.height*Math.PI)}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){const t=super.toJSON(e);return t.object.width=this.width,t.object.height=this.height,t}}sd.prototype.isRectAreaLight=!0;class ad{constructor(){this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new pi)}set(e){for(let t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,t){const n=e.x,i=e.y,r=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.282095),t.addScaledVector(o[1],.488603*i),t.addScaledVector(o[2],.488603*r),t.addScaledVector(o[3],.488603*n),t.addScaledVector(o[4],n*i*1.092548),t.addScaledVector(o[5],i*r*1.092548),t.addScaledVector(o[6],.315392*(3*r*r-1)),t.addScaledVector(o[7],n*r*1.092548),t.addScaledVector(o[8],.546274*(n*n-i*i)),t}getIrradianceAt(e,t){const n=e.x,i=e.y,r=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.886227),t.addScaledVector(o[1],1.023328*i),t.addScaledVector(o[2],1.023328*r),t.addScaledVector(o[3],1.023328*n),t.addScaledVector(o[4],.858086*n*i),t.addScaledVector(o[5],.858086*i*r),t.addScaledVector(o[6],.743125*r*r-.247708),t.addScaledVector(o[7],.858086*n*r),t.addScaledVector(o[8],.429043*(n*n-i*i)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let n=0;n<9;n++)this.coefficients[n].addScaledVector(e.coefficients[n],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let n=0;n<9;n++)this.coefficients[n].lerp(e.coefficients[n],t);return this}equals(e){for(let t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return(new this.constructor).copy(this)}fromArray(e,t=0){const n=this.coefficients;for(let i=0;i<9;i++)n[i].fromArray(e,t+3*i);return this}toArray(e=[],t=0){const n=this.coefficients;for(let i=0;i<9;i++)n[i].toArray(e,t+3*i);return e}static getBasisAt(e,t){const n=e.x,i=e.y,r=e.z;t[0]=.282095,t[1]=.488603*i,t[2]=.488603*r,t[3]=.488603*n,t[4]=1.092548*n*i,t[5]=1.092548*i*r,t[6]=.315392*(3*r*r-1),t[7]=1.092548*n*r,t[8]=.546274*(n*n-i*i)}}ad.prototype.isSphericalHarmonics3=!0;class ld extends jh{constructor(e=new ad,t=1){super(void 0,t),this.sh=e}copy(e){return super.copy(e),this.sh.copy(e.sh),this}fromJSON(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this}toJSON(e){const t=super.toJSON(e);return t.object.sh=this.sh.toArray(),t}}ld.prototype.isLightProbe=!0;class cd extends Fh{constructor(e){super(e),this.textures={}}load(e,t,n,i){const r=this,o=new Uh(r.manager);o.setPath(r.path),o.setRequestHeader(r.requestHeader),o.setWithCredentials(r.withCredentials),o.load(e,(function(n){try{t(r.parse(JSON.parse(n)))}catch(t){i?i(t):console.error(t),r.manager.itemError(e)}}),n,i)}parse(e){const t=this.textures;function n(e){return void 0===t[e]&&console.warn(\"THREE.MaterialLoader: Undefined texture\",e),t[e]}const i=new gh[e.type];if(void 0!==e.uuid&&(i.uuid=e.uuid),void 0!==e.name&&(i.name=e.name),void 0!==e.color&&void 0!==i.color&&i.color.setHex(e.color),void 0!==e.roughness&&(i.roughness=e.roughness),void 0!==e.metalness&&(i.metalness=e.metalness),void 0!==e.sheen&&(i.sheen=e.sheen),void 0!==e.sheenColor&&(i.sheenColor=(new Fr).setHex(e.sheenColor)),void 0!==e.sheenRoughness&&(i.sheenRoughness=e.sheenRoughness),void 0!==e.emissive&&void 0!==i.emissive&&i.emissive.setHex(e.emissive),void 0!==e.specular&&void 0!==i.specular&&i.specular.setHex(e.specular),void 0!==e.specularIntensity&&(i.specularIntensity=e.specularIntensity),void 0!==e.specularColor&&void 0!==i.specularColor&&i.specularColor.setHex(e.specularColor),void 0!==e.shininess&&(i.shininess=e.shininess),void 0!==e.clearcoat&&(i.clearcoat=e.clearcoat),void 0!==e.clearcoatRoughness&&(i.clearcoatRoughness=e.clearcoatRoughness),void 0!==e.transmission&&(i.transmission=e.transmission),void 0!==e.thickness&&(i.thickness=e.thickness),void 0!==e.attenuationDistance&&(i.attenuationDistance=e.attenuationDistance),void 0!==e.attenuationColor&&void 0!==i.attenuationColor&&i.attenuationColor.setHex(e.attenuationColor),void 0!==e.fog&&(i.fog=e.fog),void 0!==e.flatShading&&(i.flatShading=e.flatShading),void 0!==e.blending&&(i.blending=e.blending),void 0!==e.combine&&(i.combine=e.combine),void 0!==e.side&&(i.side=e.side),void 0!==e.shadowSide&&(i.shadowSide=e.shadowSide),void 0!==e.opacity&&(i.opacity=e.opacity),void 0!==e.format&&(i.format=e.format),void 0!==e.transparent&&(i.transparent=e.transparent),void 0!==e.alphaTest&&(i.alphaTest=e.alphaTest),void 0!==e.depthTest&&(i.depthTest=e.depthTest),void 0!==e.depthWrite&&(i.depthWrite=e.depthWrite),void 0!==e.colorWrite&&(i.colorWrite=e.colorWrite),void 0!==e.stencilWrite&&(i.stencilWrite=e.stencilWrite),void 0!==e.stencilWriteMask&&(i.stencilWriteMask=e.stencilWriteMask),void 0!==e.stencilFunc&&(i.stencilFunc=e.stencilFunc),void 0!==e.stencilRef&&(i.stencilRef=e.stencilRef),void 0!==e.stencilFuncMask&&(i.stencilFuncMask=e.stencilFuncMask),void 0!==e.stencilFail&&(i.stencilFail=e.stencilFail),void 0!==e.stencilZFail&&(i.stencilZFail=e.stencilZFail),void 0!==e.stencilZPass&&(i.stencilZPass=e.stencilZPass),void 0!==e.wireframe&&(i.wireframe=e.wireframe),void 0!==e.wireframeLinewidth&&(i.wireframeLinewidth=e.wireframeLinewidth),void 0!==e.wireframeLinecap&&(i.wireframeLinecap=e.wireframeLinecap),void 0!==e.wireframeLinejoin&&(i.wireframeLinejoin=e.wireframeLinejoin),void 0!==e.rotation&&(i.rotation=e.rotation),1!==e.linewidth&&(i.linewidth=e.linewidth),void 0!==e.dashSize&&(i.dashSize=e.dashSize),void 0!==e.gapSize&&(i.gapSize=e.gapSize),void 0!==e.scale&&(i.scale=e.scale),void 0!==e.polygonOffset&&(i.polygonOffset=e.polygonOffset),void 0!==e.polygonOffsetFactor&&(i.polygonOffsetFactor=e.polygonOffsetFactor),void 0!==e.polygonOffsetUnits&&(i.polygonOffsetUnits=e.polygonOffsetUnits),void 0!==e.dithering&&(i.dithering=e.dithering),void 0!==e.alphaToCoverage&&(i.alphaToCoverage=e.alphaToCoverage),void 0!==e.premultipliedAlpha&&(i.premultipliedAlpha=e.premultipliedAlpha),void 0!==e.visible&&(i.visible=e.visible),void 0!==e.toneMapped&&(i.toneMapped=e.toneMapped),void 0!==e.userData&&(i.userData=e.userData),void 0!==e.vertexColors&&(\"number\"==typeof e.vertexColors?i.vertexColors=e.vertexColors>0:i.vertexColors=e.vertexColors),void 0!==e.uniforms)for(const t in e.uniforms){const r=e.uniforms[t];switch(i.uniforms[t]={},r.type){case\"t\":i.uniforms[t].value=n(r.value);break;case\"c\":i.uniforms[t].value=(new Fr).setHex(r.value);break;case\"v2\":i.uniforms[t].value=(new Zn).fromArray(r.value);break;case\"v3\":i.uniforms[t].value=(new pi).fromArray(r.value);break;case\"v4\":i.uniforms[t].value=(new li).fromArray(r.value);break;case\"m3\":i.uniforms[t].value=(new $n).fromArray(r.value);break;case\"m4\":i.uniforms[t].value=(new ji).fromArray(r.value);break;default:i.uniforms[t].value=r.value}}if(void 0!==e.defines&&(i.defines=e.defines),void 0!==e.vertexShader&&(i.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(i.fragmentShader=e.fragmentShader),void 0!==e.extensions)for(const t in e.extensions)i.extensions[t]=e.extensions[t];if(void 0!==e.shading&&(i.flatShading=1===e.shading),void 0!==e.size&&(i.size=e.size),void 0!==e.sizeAttenuation&&(i.sizeAttenuation=e.sizeAttenuation),void 0!==e.map&&(i.map=n(e.map)),void 0!==e.matcap&&(i.matcap=n(e.matcap)),void 0!==e.alphaMap&&(i.alphaMap=n(e.alphaMap)),void 0!==e.bumpMap&&(i.bumpMap=n(e.bumpMap)),void 0!==e.bumpScale&&(i.bumpScale=e.bumpScale),void 0!==e.normalMap&&(i.normalMap=n(e.normalMap)),void 0!==e.normalMapType&&(i.normalMapType=e.normalMapType),void 0!==e.normalScale){let t=e.normalScale;!1===Array.isArray(t)&&(t=[t,t]),i.normalScale=(new Zn).fromArray(t)}return void 0!==e.displacementMap&&(i.displacementMap=n(e.displacementMap)),void 0!==e.displacementScale&&(i.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(i.displacementBias=e.displacementBias),void 0!==e.roughnessMap&&(i.roughnessMap=n(e.roughnessMap)),void 0!==e.metalnessMap&&(i.metalnessMap=n(e.metalnessMap)),void 0!==e.emissiveMap&&(i.emissiveMap=n(e.emissiveMap)),void 0!==e.emissiveIntensity&&(i.emissiveIntensity=e.emissiveIntensity),void 0!==e.specularMap&&(i.specularMap=n(e.specularMap)),void 0!==e.specularIntensityMap&&(i.specularIntensityMap=n(e.specularIntensityMap)),void 0!==e.specularColorMap&&(i.specularColorMap=n(e.specularColorMap)),void 0!==e.envMap&&(i.envMap=n(e.envMap)
947),void 0!==e.envMapIntensity&&(i.envMapIntensity=e.envMapIntensity),void 0!==e.reflectivity&&(i.reflectivity=e.reflectivity),void 0!==e.refractionRatio&&(i.refractionRatio=e.refractionRatio),void 0!==e.lightMap&&(i.lightMap=n(e.lightMap)),void 0!==e.lightMapIntensity&&(i.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(i.aoMap=n(e.aoMap)),void 0!==e.aoMapIntensity&&(i.aoMapIntensity=e.aoMapIntensity),void 0!==e.gradientMap&&(i.gradientMap=n(e.gradientMap)),void 0!==e.clearcoatMap&&(i.clearcoatMap=n(e.clearcoatMap)),void 0!==e.clearcoatRoughnessMap&&(i.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),void 0!==e.clearcoatNormalMap&&(i.clearcoatNormalMap=n(e.clearcoatNormalMap)),void 0!==e.clearcoatNormalScale&&(i.clearcoatNormalScale=(new Zn).fromArray(e.clearcoatNormalScale)),void 0!==e.transmissionMap&&(i.transmissionMap=n(e.transmissionMap)),void 0!==e.thicknessMap&&(i.thicknessMap=n(e.thicknessMap)),void 0!==e.sheenColorMap&&(i.sheenColorMap=n(e.sheenColorMap)),void 0!==e.sheenRoughnessMap&&(i.sheenRoughnessMap=n(e.sheenRoughnessMap)),i}setTextures(e){return this.textures=e,this}}class ud{static decodeText(e){if(\"undefined\"!=typeof TextDecoder)return(new TextDecoder).decode(e);let t=\"\";for(let n=0,i=e.length;n<i;n++)t+=String.fromCharCode(e[n]);try{return decodeURIComponent(escape(t))}catch(e){return t}}static extractUrlBase(e){const t=e.lastIndexOf(\"/\");return-1===t?\"./\":e.substr(0,t+1)}static resolveURL(e,t){return\"string\"!=typeof e||\"\"===e?\"\":(/^https?:\\/\\//i.test(t)&&/^\\//.test(e)&&(t=t.replace(/(^https?:\\/\\/[^\\/]+).*/i,\"$1\")),/^(https?:)?\\/\\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}}class hd extends io{constructor(){super(),this.type=\"InstancedBufferGeometry\",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}clone(){return(new this.constructor).copy(this)}toJSON(){const e=super.toJSON(this);return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}hd.prototype.isInstancedBufferGeometry=!0;class dd extends Fh{constructor(e){super(e)}load(e,t,n,i){const r=this,o=new Uh(r.manager);o.setPath(r.path),o.setRequestHeader(r.requestHeader),o.setWithCredentials(r.withCredentials),o.load(e,(function(n){try{t(r.parse(JSON.parse(n)))}catch(t){i?i(t):console.error(t),r.manager.itemError(e)}}),n,i)}parse(e){const t={},n={};function i(e,i){if(void 0!==t[i])return t[i];const r=e.interleavedBuffers[i],o=function(e,t){if(void 0!==n[t])return n[t];const i=e.arrayBuffers[t],r=new Uint32Array(i).buffer;return n[t]=r,r}(e,r.buffer),s=ei(r.type,o),a=new Ol(s,r.stride);return a.uuid=r.uuid,t[i]=a,a}const r=e.isInstancedBufferGeometry?new hd:new io,o=e.data.index;if(void 0!==o){const e=ei(o.type,o.array);r.setIndex(new Br(e,1))}const s=e.data.attributes;for(const t in s){const n=s[t];let o;if(n.isInterleavedBufferAttribute){const t=i(e.data,n.data);o=new Fl(t,n.itemSize,n.offset,n.normalized)}else{const e=ei(n.type,n.array);o=new(n.isInstancedBufferAttribute?dc:Br)(e,n.itemSize,n.normalized)}void 0!==n.name&&(o.name=n.name),void 0!==n.usage&&o.setUsage(n.usage),void 0!==n.updateRange&&(o.updateRange.offset=n.updateRange.offset,o.updateRange.count=n.updateRange.count),r.setAttribute(t,o)}const a=e.data.morphAttributes;if(a)for(const t in a){const n=a[t],o=[];for(let t=0,r=n.length;t<r;t++){const r=n[t];let s;if(r.isInterleavedBufferAttribute){const t=i(e.data,r.data);s=new Fl(t,r.itemSize,r.offset,r.normalized)}else{const e=ei(r.type,r.array);s=new Br(e,r.itemSize,r.normalized)}void 0!==r.name&&(s.name=r.name),o.push(s)}r.morphAttributes[t]=o}e.data.morphTargetsRelative&&(r.morphTargetsRelative=!0);const l=e.data.groups||e.data.drawcalls||e.data.offsets;if(void 0!==l)for(let e=0,t=l.length;e!==t;++e){const t=l[e];r.addGroup(t.start,t.count,t.materialIndex)}const c=e.data.boundingSphere;if(void 0!==c){const e=new pi;void 0!==c.center&&e.fromArray(c.center),r.boundingSphere=new Fi(e,c.radius)}return e.name&&(r.name=e.name),e.userData&&(r.userData=e.userData),r}}class pd extends Fh{constructor(e){super(e)}load(e,t,n,i){const r=this,o=\"\"===this.path?ud.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||o;const s=new Uh(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,(function(n){let o=null;try{o=JSON.parse(n)}catch(t){return void 0!==i&&i(t),void console.error(\"THREE:ObjectLoader: Can't parse \"+e+\".\",t.message)}const s=o.metadata;void 0!==s&&void 0!==s.type&&\"geometry\"!==s.type.toLowerCase()?r.parse(o,t):console.error(\"THREE.ObjectLoader: Can't load \"+e)}),n,i)}async loadAsync(e,t){const n=\"\"===this.path?ud.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||n;const i=new Uh(this.manager);i.setPath(this.path),i.setRequestHeader(this.requestHeader),i.setWithCredentials(this.withCredentials);const r=await i.loadAsync(e,t),o=JSON.parse(r),s=o.metadata;if(void 0===s||void 0===s.type||\"geometry\"===s.type.toLowerCase())throw new Error(\"THREE.ObjectLoader: Can't load \"+e);return await this.parseAsync(o)}parse(e,t){const n=this.parseAnimations(e.animations),i=this.parseShapes(e.shapes),r=this.parseGeometries(e.geometries,i),o=this.parseImages(e.images,(function(){void 0!==t&&t(l)})),s=this.parseTextures(e.textures,o),a=this.parseMaterials(e.materials,s),l=this.parseObject(e.object,r,a,s,n),c=this.parseSkeletons(e.skeletons,l);if(this.bindSkeletons(l,c),void 0!==t){let e=!1;for(const t in o)if(o[t]instanceof HTMLImageElement){e=!0;break}!1===e&&t(l)}return l}async parseAsync(e){const t=this.parseAnimations(e.animations),n=this.parseShapes(e.shapes),i=this.parseGeometries(e.geometries,n),r=await this.parseImagesAsync(e.images),o=this.parseTextures(e.textures,r),s=this.parseMaterials(e.materials,o),a=this.parseObject(e.object,i,s,o,t),l=this.parseSkeletons(e.skeletons,a);return this.bindSkeletons(a,l),a}parseShapes(e){const t={};if(void 0!==e)for(let n=0,i=e.length;n<i;n++){const i=(new yu).fromJSON(e[n]);t[i.uuid]=i}return t}parseSkeletons(e,t){const n={},i={};if(t.traverse((function(e){e.isBone&&(i[e.uuid]=e)})),void 0!==e)for(let t=0,r=e.length;t<r;t++){const r=(new hc).fromJSON(e[t],i);n[r.uuid]=r}return n}parseGeometries(e,t){const n={};if(void 0!==e){const i=new dd;for(let r=0,o=e.length;r<o;r++){let o;const s=e[r];switch(s.type){case\"BufferGeometry\":case\"InstancedBufferGeometry\":o=i.parse(s);break;case\"Geometry\":console.error(\"THREE.ObjectLoader: The legacy Geometry type is no longer supported.\");break;default:s.type in sh?o=sh[s.type].fromJSON(s,t):console.warn(`THREE.ObjectLoader: Unsupported geometry type \"${s.type}\"`)}o.uuid=s.uuid,void 0!==s.name&&(o.name=s.name),!0===o.isBufferGeometry&&void 0!==s.userData&&(o.userData=s.userData),n[s.uuid]=o}}return n}parseMaterials(e,t){const n={},i={};if(void 0!==e){const r=new cd;r.setTextures(t);for(let t=0,o=e.length;t<o;t++){const o=e[t];if(\"MultiMaterial\"===o.type){const e=[];for(let t=0;t<o.materials.length;t++){const i=o.materials[t];void 0===n[i.uuid]&&(n[i.uuid]=r.parse(i)),e.push(n[i.uuid])}i[o.uuid]=e}else void 0===n[o.uuid]&&(n[o.uuid]=r.parse(o)),i[o.uuid]=n[o.uuid]}}return i}parseAnimations(e){const t={};if(void 0!==e)for(let n=0;n<e.length;n++){const i=e[n],r=Ph.parse(i);t[r.uuid]=r}return t}parseImages(e,t){const n=this,i={};let r;
947function o(e){if(\"string\"==typeof e){const t=e;return function(e){return n.manager.itemStart(e),r.load(e,(function(){n.manager.itemEnd(e)}),void 0,(function(){n.manager.itemError(e),n.manager.itemEnd(e)}))}(/^(\\/\\/)|([a-z]+:(\\/\\/)?)/i.test(t)?t:n.resourcePath+t)}return e.data?{data:ei(e.type,e.data),width:e.width,height:e.height}:null}if(void 0!==e&&e.length>0){const n=new Oh(t);r=new Gh(n),r.setCrossOrigin(this.crossOrigin);for(let t=0,n=e.length;t<n;t++){const n=e[t],r=n.url;if(Array.isArray(r)){i[n.uuid]=[];for(let e=0,t=r.length;e<t;e++){const t=o(r[e]);null!==t&&(t instanceof HTMLImageElement?i[n.uuid].push(t):i[n.uuid].push(new lc(t.data,t.width,t.height)))}}else{const e=o(n.url);null!==e&&(i[n.uuid]=e)}}}return i}async parseImagesAsync(e){const t=this,n={};let i;async function r(e){if(\"string\"==typeof e){const n=e,r=/^(\\/\\/)|([a-z]+:(\\/\\/)?)/i.test(n)?n:t.resourcePath+n;return await i.loadAsync(r)}return e.data?{data:ei(e.type,e.data),width:e.width,height:e.height}:null}if(void 0!==e&&e.length>0){i=new Gh(this.manager),i.setCrossOrigin(this.crossOrigin);for(let t=0,i=e.length;t<i;t++){const i=e[t],o=i.url;if(Array.isArray(o)){n[i.uuid]=[];for(let e=0,t=o.length;e<t;e++){const t=o[e],s=await r(t);null!==s&&(s instanceof HTMLImageElement?n[i.uuid].push(s):n[i.uuid].push(new lc(s.data,s.width,s.height)))}}else{const e=await r(i.url);null!==e&&(n[i.uuid]=e)}}}return n}parseTextures(e,t){function n(e,t){return\"number\"==typeof e?e:(console.warn(\"THREE.ObjectLoader.parseTexture: Constant should be in numeric form.\",e),t[e])}const i={};if(void 0!==e)for(let r=0,o=e.length;r<o;r++){const o=e[r];let s;void 0===o.image&&console.warn('THREE.ObjectLoader: No \"image\" specified for',o.uuid),void 0===t[o.image]&&console.warn(\"THREE.ObjectLoader: Undefined image\",o.image);const a=t[o.image];Array.isArray(a)?(s=new Oo(a),6===a.length&&(s.needsUpdate=!0)):(s=a&&a.data?new lc(a.data,a.width,a.height):new si(a),a&&(s.needsUpdate=!0)),s.uuid=o.uuid,void 0!==o.name&&(s.name=o.name),void 0!==o.mapping&&(s.mapping=n(o.mapping,fd)),void 0!==o.offset&&s.offset.fromArray(o.offset),void 0!==o.repeat&&s.repeat.fromArray(o.repeat),void 0!==o.center&&s.center.fromArray(o.center),void 0!==o.rotation&&(s.rotation=o.rotation),void 0!==o.wrap&&(s.wrapS=n(o.wrap[0],md),s.wrapT=n(o.wrap[1],md)),void 0!==o.format&&(s.format=o.format),void 0!==o.type&&(s.type=o.type),void 0!==o.encoding&&(s.encoding=o.encoding),void 0!==o.minFilter&&(s.minFilter=n(o.minFilter,gd)),void 0!==o.magFilter&&(s.magFilter=n(o.magFilter,gd)),void 0!==o.anisotropy&&(s.anisotropy=o.anisotropy),void 0!==o.flipY&&(s.flipY=o.flipY),void 0!==o.premultiplyAlpha&&(s.premultiplyAlpha=o.premultiplyAlpha),void 0!==o.unpackAlignment&&(s.unpackAlignment=o.unpackAlignment),void 0!==o.userData&&(s.userData=o.userData),i[o.uuid]=s}return i}parseObject(e,t,n,i,r){let o,s,a;function l(e){return void 0===t[e]&&console.warn(\"THREE.ObjectLoader: Undefined geometry\",e),t[e]}function c(e){if(void 0!==e){if(Array.isArray(e)){const t=[];for(let i=0,r=e.length;i<r;i++){const r=e[i];void 0===n[r]&&console.warn(\"THREE.ObjectLoader: Undefined material\",r),t.push(n[r])}return t}return void 0===n[e]&&console.warn(\"THREE.ObjectLoader: Undefined material\",e),n[e]}}function u(e){return void 0===i[e]&&console.warn(\"THREE.ObjectLoader: Undefined texture\",e),i[e]}switch(e.type){case\"Scene\":o=new Dl,void 0!==e.background&&(Number.isInteger(e.background)?o.background=new Fr(e.background):o.background=u(e.background)),void 0!==e.environment&&(o.environment=u(e.environment)),void 0!==e.fog&&(\"Fog\"===e.fog.type?o.fog=new Rl(e.fog.color,e.fog.near,e.fog.far):\"FogExp2\"===e.fog.type&&(o.fog=new Pl(e.fog.color,e.fog.density)));break;case\"PerspectiveCamera\":o=new Po(e.fov,e.aspect,e.near,e.far),void 0!==e.focus&&(o.focus=e.focus),void 0!==e.zoom&&(o.zoom=e.zoom),void 0!==e.filmGauge&&(o.filmGauge=e.filmGauge),void 0!==e.filmOffset&&(o.filmOffset=e.filmOffset),void 0!==e.view&&(o.view=Object.assign({},e.view));break;case\"OrthographicCamera\":o=new es(e.left,e.right,e.top,e.bottom,e.near,e.far),void 0!==e.zoom&&(o.zoom=e.zoom),void 0!==e.view&&(o.view=Object.assign({},e.view));break;case\"AmbientLight\":o=new od(e.color,e.intensity);break;case\"DirectionalLight\":o=new rd(e.color,e.intensity);break;case\"PointLight\":o=new nd(e.color,e.intensity,e.distance,e.decay);break;
947case\"RectAreaLight\":o=new sd(e.color,e.intensity,e.width,e.height);break;case\"SpotLight\":o=new $h(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case\"HemisphereLight\":o=new Wh(e.color,e.groundColor,e.intensity);break;case\"LightProbe\":o=(new ld).fromJSON(e);break;case\"SkinnedMesh\":s=l(e.geometry),a=c(e.material),o=new sc(s,a),void 0!==e.bindMode&&(o.bindMode=e.bindMode),void 0!==e.bindMatrix&&o.bindMatrix.fromArray(e.bindMatrix),void 0!==e.skeleton&&(o.skeleton=e.skeleton);break;case\"Mesh\":s=l(e.geometry),a=c(e.material),o=new wo(s,a);break;case\"InstancedMesh\":s=l(e.geometry),a=c(e.material);const t=e.count,n=e.instanceMatrix,i=e.instanceColor;o=new vc(s,a,t),o.instanceMatrix=new dc(new Float32Array(n.array),16),void 0!==i&&(o.instanceColor=new dc(new Float32Array(i.array),i.itemSize));break;case\"LOD\":o=new ec;break;case\"Line\":o=new Sc(l(e.geometry),c(e.material));break;case\"LineLoop\":o=new Lc(l(e.geometry),c(e.material));break;case\"LineSegments\":o=new Ac(l(e.geometry),c(e.material));break;case\"PointCloud\":case\"Points\":o=new Ic(l(e.geometry),c(e.material));break;case\"Sprite\":o=new Zl(c(e.material));break;case\"Group\":o=new Ml;break;case\"Bone\":o=new ac;break;default:o=new mr}if(o.uuid=e.uuid,void 0!==e.name&&(o.name=e.name),void 0!==e.matrix?(o.matrix.fromArray(e.matrix),void 0!==e.matrixAutoUpdate&&(o.matrixAutoUpdate=e.matrixAutoUpdate),o.matrixAutoUpdate&&o.matrix.decompose(o.position,o.quaternion,o.scale)):(void 0!==e.position&&o.position.fromArray(e.position),void 0!==e.rotation&&o.rotation.fromArray(e.rotation),void 0!==e.quaternion&&o.quaternion.fromArray(e.quaternion),void 0!==e.scale&&o.scale.fromArray(e.scale)),void 0!==e.castShadow&&(o.castShadow=e.castShadow),void 0!==e.receiveShadow&&(o.receiveShadow=e.receiveShadow),e.shadow&&(void 0!==e.shadow.bias&&(o.shadow.bias=e.shadow.bias),void 0!==e.shadow.normalBias&&(o.shadow.normalBias=e.shadow.normalBias),void 0!==e.shadow.radius&&(o.shadow.radius=e.shadow.radius),void 0!==e.shadow.mapSize&&o.shadow.mapSize.fromArray(e.shadow.mapSize),void 0!==e.shadow.camera&&(o.shadow.camera=this.parseObject(e.shadow.camera))),void 0!==e.visible&&(o.visible=e.visible),void 0!==e.frustumCulled&&(o.frustumCulled=e.frustumCulled),void 0!==e.renderOrder&&(o.renderOrder=e.renderOrder),void 0!==e.userData&&(o.userData=e.userData),void 0!==e.layers&&(o.layers.mask=e.layers),void 0!==e.children){const s=e.children;for(let e=0;e<s.length;e++)o.add(this.parseObject(s[e],t,n,i,r))}if(void 0!==e.animations){const t=e.animations;for(let e=0;e<t.length;e++){const n=t[e];o.animations.push(r[n])}}if(\"LOD\"===e.type){void 0!==e.autoUpdate&&(o.autoUpdate=e.autoUpdate);const t=e.levels;for(let e=0;e<t.length;e++){const n=t[e],i=o.getObjectByProperty(\"uuid\",n.object);void 0!==i&&o.addLevel(i,n.distance)}}return o}bindSkeletons(e,t){0!==Object.keys(t).length&&e.traverse((function(e){if(!0===e.isSkinnedMesh&&void 0!==e.skeleton){const n=t[e.skeleton];void 0===n?console.warn(\"THREE.ObjectLoader: No skeleton found with UUID:\",e.skeleton):e.bind(n,e.bindMatrix)}}))}setTexturePath(e){return console.warn(\"THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath().\"),this.setResourcePath(e)}}const fd={UVMapping:re,CubeReflectionMapping:oe,CubeRefractionMapping:se,EquirectangularReflectionMapping:ae,EquirectangularRefractionMapping:le,CubeUVReflectionMapping:ce,CubeUVRefractionMapping:ue},md={RepeatWrapping:he,ClampToEdgeWrapping:de,MirroredRepeatWrapping:pe},gd={NearestFilter:fe,NearestMipmapNearestFilter:me,NearestMipmapLinearFilter:ve,LinearFilter:xe,LinearMipmapNearestFilter:_e,LinearMipmapLinearFilter:we};class vd extends Fh{constructor(e){super(e),\"undefined\"==typeof createImageBitmap&&console.warn(\"THREE.ImageBitmapLoader: createImageBitmap() not supported.\"),\"undefined\"==typeof fetch&&console.warn(\"THREE.ImageBitmapLoader: fetch() not supported.\"),this.options={premultiplyAlpha:\"none\"}}setOptions(e){return this.options=e,this}load(e,t,n,i){void 0===e&&(e=\"\"),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);const r=this,o=Dh.get(e);if(void 0!==o)return r.manager.itemStart(e),setTimeout((function(){t&&t(o),r.manager.itemEnd(e)}),0),o;const s={};s.credentials=\"anonymous\"===this.crossOrigin?\"same-origin\":\"include\",s.headers=this.requestHeader,fetch(e,s).then((function(e){return e.blob()})).then((function(e){return createImageBitmap(e,Object.assign(r.options,{colorSpaceConversion:\"none\"}))})).then((function(n){Dh.add(e,n),t&&t(n),r.manager.itemEnd(e)})).catch((function(t){i&&i(t),r.manager.itemError(e),r.manager.itemEnd(e)})),r.manager.itemStart(e)}}let yd;vd.prototype.isImageBitmapLoader=!0;const xd={getContext:function(){return void 0===yd&&(yd=new(window.AudioContext||window.webkitAudioContext)),yd},setContext:function(e){yd=e}};class _d extends Fh{constructor(e){super(e)}load(e,t,n,i){const r=this,o=new Uh(this.manager);o.setResponseType(\"arraybuffer\"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,(function(n){try{const e=n.slice(0);xd.getContext().decodeAudioData(e,(function(e){t(e)}))}catch(t){i?i(t):console.error(t),r.manager.itemError(e)}}),n,i)}}class bd extends ld{constructor(e,t,n=1){super(void 0,n);const i=(new Fr).set(e),r=(new Fr).set(t),o=new pi(i.r,i.g,i.b),s=new pi(r.r,r.g,r.b),a=Math.sqrt(Math.PI),l=a*Math.sqrt(.75);this.sh.coefficients[0].copy(o).add(s).multiplyScalar(a),this.sh.coefficients[1].copy(o).sub(s).multiplyScalar(l)}}bd.prototype.isHemisphereLightProbe=!0;class wd extends ld{constructor(e,t=1){super(void 0,t);const n=(new Fr).set(e);this.sh.coefficients[0].set(n.r,n.g,n.b).multiplyScalar(2*Math.sqrt(Math.PI))}}wd.prototype.isAmbientLightProbe=!0;const Md=new ji,Sd=new ji;class Ed{constructor(){this.type=\"StereoCamera\",this.aspect=1,this.eyeSep=.064,this.cameraL=new Po,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Po,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep;const n=e.projectionMatrix.clone(),i=t.eyeSep/2,r=i*t.near/t.focus,o=t.near*Math.tan(zn*t.fov*.5)/t.zoom;let s,a;Sd.elements[12]=-i,Md.elements[12]=i,s=-o*t.aspect+r,a=o*t.aspect+r,n.elements[0]=2*t.near/(a-s),n.elements[8]=(a+s)/(a-s),this.cameraL.projectionMatrix.copy(n),s=-o*t.aspect-r,a=o*t.aspect-r,n.elements[0]=2*t.near/(a-s),n.elements[8]=(a+s)/(a-s),this.cameraR.projectionMatrix.copy(n)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Sd),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Md)}}class Td{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=Ad(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=Ad();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function Ad(){return(\"undefined\"==typeof performance?Date:performance).now()}const Ld=new pi,Cd=new di,Pd=new pi,Rd=new pi;class Dd extends mr{constructor(){super(),this.type=\"AudioListener\",this.context=xd.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new Td}getInput(){return this.gain}removeFilter(){return null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener,n=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(Ld,Cd,Pd),Rd.set(0,0,-1).applyQuaternion(Cd),t.positionX){const e=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(Ld.x,e),t.positionY.linearRampToValueAtTime(Ld.y,e),t.positionZ.linearRampToValueAtTime(Ld.z,e),t.forwardX.linearRampToValueAtTime(Rd.x,e),t.forwardY.linearRampToValueAtTime(Rd.y,e),t.forwardZ.linearRampToValueAtTime(Rd.z,e),t.upX.linearRampToValueAtTime(n.x,e),t.upY.linearRampToValueAtTime(n.y,e),t.upZ.linearRampToValueAtTime(n.z,e)}else t.setPosition(Ld.x,Ld.y,Ld.z),t.setOrientation(Rd.x,Rd.y,Rd.z,n.x,n.y,n.z)}}class Od extends mr{constructor(e){super(),this.type=\"Audio\",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl
947=!0,this.source=null,this.sourceType=\"empty\",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType=\"audioNode\",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType=\"mediaNode\",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType=\"mediaStreamNode\",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType=\"buffer\",this.autoplay&&this.play(),this}play(e=0){if(!0===this.isPlaying)return void console.warn(\"THREE.Audio: Audio is already playing.\");if(!1===this.hasPlaybackControl)return void console.warn(\"THREE.Audio: this Audio has no playback control.\");this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,!0===this.loop&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this;console.warn(\"THREE.Audio: this Audio has no playback control.\")}stop(){if(!1!==this.hasPlaybackControl)return this._progress=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this;console.warn(\"THREE.Audio: this Audio has no playback control.\")}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}getFilters(){return this.filters}setFilters(e){return e||(e=[]),!0===this._connected?(this.disconnect(),this.filters=e.slice(),this.connect()):this.filters=e.slice(),this}setDetune(e){if(this.detune=e,void 0!==this.source.detune)return!0===this.isPlaying&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(e){return this.setFilters(e?[e]:[])}setPlaybackRate(e){if(!1!==this.hasPlaybackControl)return this.playbackRate=e,!0===this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this;console.warn(\"THREE.Audio: this Audio has no playback control.\")}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1}getLoop(){return!1===this.hasPlaybackControl?(console.warn(\"THREE.Audio: this Audio has no playback control.\"),!1):this.loop}setLoop(e){if(!1!==this.hasPlaybackControl)return this.loop=e,!0===this.isPlaying&&(this.source.loop=this.loop),this;console.warn(\"THREE.Audio: this Audio has no playback control.\")}setLoopStart(e){return this.loopStart=e,this}setLoopEnd(e){return this.loopEnd=e,this}getVolume(){return this.gain.gain.value}setVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}}const Id=new pi,Fd=new di,Nd=new pi,Ud=new pi;class zd extends Od{constructor(e){super(e),this.panner=this.context.createPanner(),this.panner.panningModel=\"HRTF\",this.panner.connect(this.gain)}getOutput(){return this.panner}getRefDistance(){return this.panner.refDistance}setRefDistance(e){return this.panner.refDistance=e,this}getRolloffFactor(){return this.panner.rolloffFactor}setRolloffFactor(e){return this.panner.rolloffFactor=e,this}getDistanceModel(){return this.panner.distanceModel}setDistanceModel(e){return this.panner.distanceModel=e,this}getMaxDistance(){return this.panner.maxDistance}setMaxDistance(e){return this.panner.maxDistance=e,this}setDirectionalCone(e,t,n){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=t,this.panner.coneOuterGain=n,this}updateMatrixWorld(e){if(super.updateMatrixWorld(e),!0===this.hasPlaybackControl&&!1===this.isPlaying)return;this.matrixWorld.decompose(Id,Fd,Nd),Ud.set(0,0,1).applyQuaternion(Fd);const t=this.panner;if(t.positionX){const e=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(Id.x,e),t.positionY.linearRampToValueAtTime(Id.y,e),t.positionZ.linearRampToValueAtTime(Id.z,e),t.orientationX.linearRampToValueAtTime(Ud.x,e),t.orientationY.linearRampToValueAtTime(Ud.y,e),t.orientationZ.linearRampToValueAtTime(Ud.z,e)}else t.setPosition(Id.x,Id.y,Id.z),t.setOrientation(Ud.x,Ud.y,Ud.z)}}
947class Bd{constructor(e,t=2048){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=t,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let e=0;const t=this.getFrequencyData();for(let n=0;n<t.length;n++)e+=t[n];return e/t.length}}class Gd{constructor(e,t,n){let i,r,o;switch(this.binding=e,this.valueSize=n,t){case\"quaternion\":i=this._slerp,r=this._slerpAdditive,o=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(6*n),this._workIndex=5;break;case\"string\":case\"bool\":i=this._select,r=this._select,o=this._setAdditiveIdentityOther,this.buffer=new Array(5*n);break;default:i=this._lerp,r=this._lerpAdditive,o=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(5*n)}this._mixBufferRegion=i,this._mixBufferRegionAdditive=r,this._setIdentity=o,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(e,t){const n=this.buffer,i=this.valueSize,r=e*i+i;let o=this.cumulativeWeight;if(0===o){for(let e=0;e!==i;++e)n[r+e]=n[e];o=t}else{o+=t;const e=t/o;this._mixBufferRegion(n,r,0,e,i)}this.cumulativeWeight=o}accumulateAdditive(e){const t=this.buffer,n=this.valueSize,i=n*this._addIndex;0===this.cumulativeWeightAdditive&&this._setIdentity(),this._mixBufferRegionAdditive(t,i,0,e,n),this.cumulativeWeightAdditive+=e}apply(e){const t=this.valueSize,n=this.buffer,i=e*t+t,r=this.cumulativeWeight,o=this.cumulativeWeightAdditive,s=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,r<1){const e=t*this._origIndex;this._mixBufferRegion(n,i,e,1-r,t)}o>0&&this._mixBufferRegionAdditive(n,i,this._addIndex*t,1,t);for(let e=t,r=t+t;e!==r;++e)if(n[e]!==n[e+t]){s.setValue(n,i);break}}saveOriginalState(){const e=this.binding,t=this.buffer,n=this.valueSize,i=n*this._origIndex;e.getValue(t,i);for(let e=n,r=i;e!==r;++e)t[e]=t[i+e%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=3*this.valueSize;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let n=e;n<t;n++)this.buffer[n]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const e=this._origIndex*this.valueSize,t=this._addIndex*this.valueSize;for(let n=0;n<this.valueSize;n++)this.buffer[t+n]=this.buffer[e+n]}_select(e,t,n,i,r){if(i>=.5)for(let i=0;i!==r;++i)e[t+i]=e[n+i]}_slerp(e,t,n,i){di.slerpFlat(e,t,e,t,e,n,i)}_slerpAdditive(e,t,n,i,r){const o=this._workIndex*r;di.multiplyQuaternionsFlat(e,o,e,t,e,n),di.slerpFlat(e,t,e,t,e,o,i)}_lerp(e,t,n,i,r){const o=1-i;for(let s=0;s!==r;++s){const r=t+s;e[r]=e[r]*o+e[n+s]*i}}_lerpAdditive(e,t,n,i,r){for(let o=0;o!==r;++o){const r=t+o;e[r]=e[r]+e[n+o]*i}}}const kd=\"\\\\[\\\\]\\\\.:\\\\/\",Vd=new RegExp(\"[\"+kd+\"]\",\"g\"),Hd=\"[^\"+kd+\"]\",jd=\"[^\"+kd.replace(\"\\\\.\",\"\")+\"]\",Wd=/((?:WC+[\\/:])*)/.source.replace(\"WC\",Hd),qd=/(WCOD+)?/.source.replace(\"WCOD\",jd),Xd=/(?:\\.(WC+)(?:\\[(.+)\\])?)?/.source.replace(\"WC\",Hd),Yd=/\\.(WC+)(?:\\[(.+)\\])?/.source.replace(\"WC\",Hd),Jd=new RegExp(\"^\"+Wd+qd+Xd+Yd+\"$\"),Zd=[\"material\",\"materials\",\"bones\"];class $d{constructor(e,t,n){this.path=t,this.parsedPath=n||$d.parseTrackName(t),this.node=$d.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new $d.Composite(e,t,n):new $d(e,t,n)}static sanitizeNodeName(e){return e.replace(/\\s/g,\"_\").replace(Vd,\"\")}static parseTrackName(e){const t=Jd.exec(e);if(!t)throw new Error(\"PropertyBinding: Cannot parse trackName: \"+e);const n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=n.nodeName&&n.nodeName.lastIndexOf(\".\");if(void 0!==i&&-1!==i){const e=n.nodeName.substring(i+1);-1!==Zd.indexOf(e)&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=e)}if(null===n.propertyName||0===n.propertyName.length)throw new Error(\"PropertyBinding: can not parse propertyName from trackName: \"+e);return n}static findNode(e,t){if(!t||\"\"===t||\".\"===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){const n=e.skeleton.getBoneByName(t);if(void 0!==n)return n}if(e.children){const n=function(e){for(let i=0;i<e.length;i++){const r=e[i];if(r.name===t||r.uuid===t)return r;const o=n(r.children);if(o)return o}return null},i=n(e.children);if(i)return i}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){const n=this.resolvedProperty;for(let i=0,r=n.length;i!==r;++i)e[t++]=n[i]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){const n=this.resolvedProperty;for(let i=0,r=n.length;i!==r;++i)n[i]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const n=this.resolvedProperty;for(let i=0,r=n.length;i!==r;++i)n[i]=e[t++];this.targetObject.needsUpdate=!0}
vendor: 9,270 bytes, line 947
947_setValue_array_setMatrixWorldNeedsUpdate(e,t){const n=this.resolvedProperty;for(let i=0,r=n.length;i!==r;++i)n[i]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node;const t=this.parsedPath,n=t.objectName,i=t.propertyName;let r=t.propertyIndex;if(e||(e=$d.findNode(this.rootNode,t.nodeName)||this.rootNode,this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e)return void console.error(\"THREE.PropertyBinding: Trying to update node for track: \"+this.path+\" but it wasn't found.\");if(n){let i=t.objectIndex;switch(n){case\"materials\":if(!e.material)return void console.error(\"THREE.PropertyBinding: Can not bind to material as node does not have a material.\",this);if(!e.material.materials)return void console.error(\"THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.\",this);e=e.material.materials;break;case\"bones\":if(!e.skeleton)return void console.error(\"THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.\",this);e=e.skeleton.bones;for(let t=0;t<e.length;t++)if(e[t].name===i){i=t;break}break;default:if(void 0===e[n])return void console.error(\"THREE.PropertyBinding: Can not bind to objectName of node undefined.\",this);e=e[n]}if(void 0!==i){if(void 0===e[i])return void console.error(\"THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.\",this,e);e=e[i]}}const o=e[i];if(void 0===o){const n=t.nodeName;return void console.error(\"THREE.PropertyBinding: Trying to update property for track: \"+n+\".\"+i+\" but it wasn't found.\",e)}let s=this.Versioning.None;this.targetObject=e,void 0!==e.needsUpdate?s=this.Versioning.NeedsUpdate:void 0!==e.matrixWorldNeedsUpdate&&(s=this.Versioning.MatrixWorldNeedsUpdate);let a=this.BindingType.Direct;if(void 0!==r){if(\"morphTargetInfluences\"===i){if(!e.geometry)return void console.error(\"THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.\",this);if(!e.geometry.isBufferGeometry)return void console.error(\"THREE.PropertyBinding: Can not bind to morphTargetInfluences on THREE.Geometry. Use THREE.BufferGeometry instead.\",this);if(!e.geometry.morphAttributes)return void console.error(\"THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.\",this);void 0!==e.morphTargetDictionary[r]&&(r=e.morphTargetDictionary[r])}a=this.BindingType.ArrayElement,this.resolvedProperty=o,this.propertyIndex=r}else void 0!==o.fromArray&&void 0!==o.toArray?(a=this.BindingType.HasFromToArray,this.resolvedProperty=o):Array.isArray(o)?(a=this.BindingType.EntireArray,this.resolvedProperty=o):this.propertyName=i;this.getValue=this.GetterByBindingType[a],this.setValue=this.SetterByBindingTypeAndVersioning[a][s]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}$d.Composite=class{constructor(e,t,n){const i=n||$d.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();const n=this._targetGroup.nCachedObjects_,i=this._bindings[n];void 0!==i&&i.getValue(e,t)}setValue(e,t){const n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,r=n.length;i!==r;++i)n[i].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}},$d.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},$d.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},$d.prototype.GetterByBindingType=[$d.prototype._getValue_direct,$d.prototype._getValue_array,$d.prototype._getValue_arrayElement,$d.prototype._getValue_toArray],$d.prototype.SetterByBindingTypeAndVersioning=[[$d.prototype._setValue_direct,$d.prototype._setValue_direct_setNeedsUpdate,$d.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[$d.prototype._setValue_array,$d.prototype._setValue_array_setNeedsUpdate,$d.prototype._setValue_array_setMatrixWorldNeedsUpdate],[$d.prototype._setValue_arrayElement,$d.prototype._setValue_arrayElement_setNeedsUpdate,$d.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[$d.prototype._setValue_fromArray,$d.prototype._setValue_fromArray_setNeedsUpdate,$d.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class Kd{constructor(){this.uuid=Vn(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;const e={};this._indicesByUUID=e;for(let t=0,n=arguments.length;t!==n;++t)e[arguments[t].uuid]=t;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};const t=this;this.stats={objects:{get total(){return t._objects.length},get inUse(){return this.total-t.nCachedObjects_}},get bindingsPerObject(){return t._bindings.length}}}add(){const e=this._objects,t=this._indicesByUUID,n=this._paths,i=this._parsedPaths,r=this._bindings,o=r.length;let s,a=e.length,l=this.nCachedObjects_;for(let c=0,u=arguments.length;c!==u;++c){const u=arguments[c],h=u.uuid;let d=t[h];if(void 0===d){d=a++,t[h]=d,e.push(u);for(let e=0,t=o;e!==t;++e)r[e].push(new $d(u,n[e],i[e]))}else if(d<l){s=e[d];const a=--l,c=e[a];t[c.uuid]=d,e[d]=c,t[h]=a,e[a]=u;for(let e=0,t=o;e!==t;++e){const t=r[e],o=t[a];let s=t[d];t[d]=o,void 0===s&&(s=new $d(u,n[e],i[e])),t[a]=s}}else e[d]!==s&&console.error(\"THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.\")}this.nCachedObjects_=l}remove(){const e=this._objects,t=this._indicesByUUID,n=this._bindings,i=n.length;let r=this.nCachedObjects_;for(let o=0,s=arguments.length;o!==s;++o){const s=arguments[o],a=s.uuid,l=t[a];if(void 0!==l&&l>=r){const o=r++,c=e[o];t[c.uuid]=l,e[l]=c,t[a]=o,e[o]=s;for(let e=0,t=i;e!==t;++e){const t=n[e],i=t[o],r=t[l];t[l]=i,t[o]=r}}}this.nCachedObjects_=r}uncache(){const e=this._objects,t=this._indicesByUUID,n=this._bindings,i=n.length;let r=this.nCachedObjects_,o=e.length;for(let s=0,a=arguments.length;s!==a;++s){const a=arguments[s].uuid,l=t[a];if(void 0!==l)if(delete t[a],l<r){const s=--r,a=e[s],c=--o,u=e[c];t[a.uuid]=l,e[l]=a,t[u.uuid]=s,e[s]=u,e.pop();for(let e=0,t=i;e!==t;++e){const t=n[e],i=t[s],r=t[c];t[l]=i,t[s]=r,t.pop()}}else{const r=--o,s=e[r];r>0&&(t[s.uuid]=l),e[l]=s,e.pop();for(let e=0,t=i;e!==t;++e){const t=n[e];t[l]=t[r],t.pop()}}}this.nCachedObjects_=r}subscribe_(e,t){const n=this._bindingsIndicesByPath;let i=n[e];const r=this._bindings;if(void 0!==i)return r[i];const o=this._paths,s=this._parsedPaths,a=this._objects,l=a.length,c=this.nCachedObjects_,u=new Array(l);i=r.length,n[e]=i,o.push(e),s.push(t),r.push(u);for(let n=c,i=a.length;n!==i;++n){const i=a[n];u[n]=new $d(i,e,t)}return u}unsubscribe_(e){const t=this._bindingsIndicesByPath,n=t[e];if(void 0!==n){const i=this._paths,r=this._parsedPaths,o=this._bindings,s=o.length-1,a=o[s];t[e[s]]=n,o[n]=a,o.pop(),r[n]=r[s],r.pop(),i[n]=i[s],i.pop()}}}Kd.prototype.isAnimationObjectGroup=!0;class Qd{constructor(e,t,n=null,i=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=i;const r=t.tracks,o=r.length,s=new Array(o),a={endingStart:Vt,endingEnd:Vt};for(let e=0;e!==o;++e){const t=r[e].createInterpolant(null);s[e]=t,t.settings=a}this._interpolantSettings=a,this._interpolants=s,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=Ut,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}
vendor: 7,935 bytes, line 947
947fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){const n=this._clip.duration,i=e._clip.duration,r=i/n,o=n/i;e.warp(1,r,t),this.warp(o,1,t)}return this}crossFadeTo(e,t,n){return e.crossFadeFrom(this,t,n)}stopFading(){const e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,n){const i=this._mixer,r=i.time,o=this.timeScale;let s=this._timeScaleInterpolant;null===s&&(s=i._lendControlInterpolant(),this._timeScaleInterpolant=s);const a=s.parameterPositions,l=s.sampleValues;return a[0]=r,a[1]=r+n,l[0]=e/o,l[1]=t/o,this}stopWarping(){const e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,n,i){if(!this.enabled)return void this._updateWeight(e);const r=this._startTime;if(null!==r){const i=(e-r)*n;if(i<0||0===n)return;this._startTime=null,t=n*i}t*=this._updateTimeScale(e);const o=this._updateTime(t),s=this._updateWeight(e);if(s>0){const e=this._interpolants,t=this._propertyBindings;if(this.blendMode===qt)for(let n=0,i=e.length;n!==i;++n)e[n].evaluate(o),t[n].accumulateAdditive(s);else for(let n=0,r=e.length;n!==r;++n)e[n].evaluate(o),t[n].accumulate(i,s)}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const n=this._weightInterpolant;if(null!==n){const i=n.evaluate(e)[0];t*=i,e>n.parameterPositions[1]&&(this.stopFading(),0===i&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const n=this._timeScaleInterpolant;null!==n&&(t*=n.evaluate(e)[0],e>n.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t))}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,n=this.loop;let i=this.time+e,r=this._loopCount;const o=n===zt;if(0===e)return-1===r||!o||1&~r?i:t-i;if(n===Nt){-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(i>=t)i=t;else{if(!(i<0)){this.time=i;break e}i=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:\"finished\",action:this,direction:e<0?-1:1})}}else{if(-1===r&&(e>=0?(r=0,this._setEndings(!0,0===this.repetitions,o)):this._setEndings(0===this.repetitions,!0,o)),i>=t||i<0){const n=Math.floor(i/t);i-=t*n,r+=Math.abs(n);const s=this.repetitions-r;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=e>0?t:0,this.time=i,this._mixer.dispatchEvent({type:\"finished\",action:this,direction:e>0?1:-1});else{if(1===s){const t=e<0;this._setEndings(t,!t,o)}else this._setEndings(!1,!1,o);this._loopCount=r,this.time=i,this._mixer.dispatchEvent({type:\"loop\",action:this,loopDelta:n})}}else this.time=i;if(o&&!(1&~r))return t-i}return i}_setEndings(e,t,n){const i=this._interpolantSettings;n?(i.endingStart=Ht,i.endingEnd=Ht):(i.endingStart=e?this.zeroSlopeAtStart?Ht:Vt:jt,i.endingEnd=t?this.zeroSlopeAtEnd?Ht:Vt:jt)}_scheduleFading(e,t,n){const i=this._mixer,r=i.time;let o=this._weightInterpolant;null===o&&(o=i._lendControlInterpolant(),this._weightInterpolant=o);const s=o.parameterPositions,a=o.sampleValues;return s[0]=r,a[0]=t,s[1]=r+e,a[1]=n,this}}class ep extends Nn{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const n=e._localRoot||this._root,i=e._clip.tracks,r=i.length,o=e._propertyBindings,s=e._interpolants,a=n.uuid,l=this._bindingsByRootAndName;let c=l[a];void 0===c&&(c={},l[a]=c);for(let e=0;e!==r;++e){const r=i[e],l=r.name;let u=c[l];if(void 0!==u)o[e]=u;else{if(u=o[e],void 0!==u){null===u._cacheIndex&&(++u.referenceCount,this._addInactiveBinding(u,a,l));continue}const i=t&&t._propertyBindings[e].binding.parsedPath;u=new Gd($d.create(n,l,i),r.ValueTypeName,r.getValueSize()),++u.referenceCount,this._addInactiveBinding(u,a,l),o[e]=u}s[e].resultBuffer=u.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){const t=(e._localRoot||this._root).uuid,n=e._clip.uuid,i=this._actionsByClip[n];this._bindAction(e,i&&i.knownActions[0]),this._addInactiveAction(e,n,t)}const t=e._propertyBindings;for(let e=0,n=t.length;e!==n;++e){const n=t[e];0==n.useCount++&&(this._lendBinding(n),n.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let e=0,n=t.length;e!==n;++e){const n=t[e];0==--n.useCount&&(n.restoreOriginalState(),this._takeBackBinding(n))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return null!==t&&t<this._nActiveActions}_addInactiveAction(e,t,n){const i=this._actions,r=this._actionsByClip;let o=r[t];if(void 0===o)o={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,r[t]=o;else{const t=o.knownActions;e._byClipCacheIndex=t.length,t.push(e)}e._cacheIndex=i.length,i.push(e),o.actionByRoot[n]=e}_removeInactiveAction(e){const t=this._actions,n=t[t.length-1],i=e._cacheIndex;n._cacheIndex=i,t[i]=n,t.pop(),e._cacheIndex=null;const r=e._clip.uuid,o=this._actionsByClip,s=o[r],a=s.knownActions,l=a[a.length-1],c=e._byClipCacheIndex;l._byClipCacheIndex=c,a[c]=l,a.pop(),e._byClipCacheIndex=null,delete s.actionByRoot[(e._localRoot||this._root).uuid],0===a.length&&delete o[r],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){const t=e._propertyBindings;for(let e=0,n=t.length;e!==n;++e){const n=t[e];0==--n.referenceCount&&this._removeInactiveBinding(n)}}_lendAction(e){const t=this._actions,n=e._cacheIndex,i=this._nActiveActions++,r=t[i];e._cacheIndex=i,t[i]=e,r._cacheIndex=n,t[n]=r}_takeBackAction(e){const t=this._actions,n=e._cacheIndex,i=--this._nActiveActions,r=t[i];e._cacheIndex=i,t[i]=e,r._cacheIndex=n,t[n]=r}_addInactiveBinding(e,t,n){const i=this._bindingsByRootAndName,r=this._bindings;let o=i[t];void 0===o&&(o={},i[t]=o),o[n]=e,e._cacheIndex=r.length,r.push(e)}_removeInactiveBinding(e){const t=this._bindings,n=e.binding,i=n.rootNode.uuid,r=n.path,o=this._bindingsByRootAndName,s=o[i],a=t[t.length-1],l=e._cacheIndex;a._cacheIndex=l,t[l]=a,t.pop(),delete s[r],0===Object.keys(s).length&&delete o[i]}_lendBinding(e){const t=this._bindings,n=e._cacheIndex,i=this._nActiveBindings++,r=t[i];e._cacheIndex=i,t[i]=e,r._cacheIndex=n,t[n]=r}_takeBackBinding(e){const t=this._bindings,n=e._cacheIndex,i=--this._nActiveBindings,r=t[i];e._cacheIndex=i,t[i]=e,r._cacheIndex=n,t[n]=r}_lendControlInterpolant(){const e=this._controlInterpolants,t=this._nActiveControlInterpolants++;let n=e[t];return void 0===n&&(n=new _h(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),n.__cacheIndex=t,e[t]=n),n}_takeBackControlInterpolant(e){const t=this._controlInterpolants,n=e.__cacheIndex,i=--this._nActiveControlInterpolants,r=t[i];e.__cacheIndex=i,t[i]=e,r.__cacheIndex=n,t[n]=r}clipAction(e,t,n){const i=t||this._root,r=i.uuid;
947let o=\"string\"==typeof e?Ph.findByName(i,e):e;const s=null!==o?o.uuid:e,a=this._actionsByClip[s];let l=null;if(void 0===n&&(n=null!==o?o.blendMode:Wt),void 0!==a){const e=a.actionByRoot[r];if(void 0!==e&&e.blendMode===n)return e;l=a.knownActions[0],null===o&&(o=l._clip)}if(null===o)return null;const c=new Qd(this,o,t,n);return this._bindAction(c,l),this._addInactiveAction(c,s,r),c}existingAction(e,t){const n=t||this._root,i=n.uuid,r=\"string\"==typeof e?Ph.findByName(n,e):e,o=r?r.uuid:e,s=this._actionsByClip[o];return void 0!==s&&s.actionByRoot[i]||null}stopAllAction(){const e=this._actions;for(let t=this._nActiveActions-1;t>=0;--t)e[t].stop();return this}update(e){e*=this.timeScale;const t=this._actions,n=this._nActiveActions,i=this.time+=e,r=Math.sign(e),o=this._accuIndex^=1;for(let s=0;s!==n;++s)t[s]._update(i,e,r,o);const s=this._bindings,a=this._nActiveBindings;for(let e=0;e!==a;++e)s[e].apply(o);return this}setTime(e){this.time=0;for(let e=0;e<this._actions.length;e++)this._actions[e].time=0;return this.update(e)}getRoot(){return this._root}uncacheClip(e){const t=this._actions,n=e.uuid,i=this._actionsByClip,r=i[n];if(void 0!==r){const e=r.knownActions;for(let n=0,i=e.length;n!==i;++n){const i=e[n];this._deactivateAction(i);const r=i._cacheIndex,o=t[t.length-1];i._cacheIndex=null,i._byClipCacheIndex=null,o._cacheIndex=r,t[r]=o,t.pop(),this._removeInactiveBindingsForAction(i)}delete i[n]}}uncacheRoot(e){const t=e.uuid,n=this._actionsByClip;for(const e in n){const i=n[e].actionByRoot[t];void 0!==i&&(this._deactivateAction(i),this._removeInactiveAction(i))}const i=this._bindingsByRootAndName[t];if(void 0!==i)for(const e in i){const t=i[e];t.restoreOriginalState(),this._removeInactiveBinding(t)}}uncacheAction(e,t){const n=this.existingAction(e,t);null!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}}ep.prototype._controlInterpolantsResultBuffer=new Float32Array(1);class tp{constructor(e){\"string\"==typeof e&&(console.warn(\"THREE.Uniform: Type parameter is no longer needed.\"),e=arguments[1]),this.value=e}clone(){return new tp(void 0===this.value.clone?this.value:this.value.clone())}}class np extends Ol{constructor(e,t,n=1){super(e,t),this.meshPerAttribute=n}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}clone(e){const t=super.clone(e);return t.meshPerAttribute=this.meshPerAttribute,t}toJSON(e){const t=super.toJSON(e);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}}np.prototype.isInstancedInterleavedBuffer=!0;class ip{constructor(e,t,n,i,r){this.buffer=e,this.type=t,this.itemSize=n,this.elementSize=i,this.count=r,this.version=0}set needsUpdate(e){!0===e&&this.version++}setBuffer(e){return this.buffer=e,this}setType(e,t){return this.type=e,this.elementSize=t,this}setItemSize(e){return this.itemSize=e,this}setCount(e){return this.count=e,this}}ip.prototype.isGLBufferAttribute=!0;class rp{constructor(e,t,n=0,i=1/0){this.ray=new Hi(e,t),this.near=n,this.far=i,this.camera=null,this.layers=new tr,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t&&t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t&&t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error(\"THREE.Raycaster: Unsupported camera type: \"+t.type)}intersectObject(e,t=!0,n=[]){return sp(e,this,n,t),n.sort(op),n}intersectObjects(e,t=!0,n=[]){for(let i=0,r=e.length;i<r;i++)sp(e[i],this,n,t);return n.sort(op),n}}function op(e,t){return e.distance-t.distance}function sp(e,t,n,i){if(e.layers.test(t.layers)&&e.raycast(t,n),!0===i){const i=e.children;for(let e=0,r=i.length;e<r;e++)sp(i[e],t,n,!0)}}class ap{constructor(e=1,t=0,n=0){return this.radius=e,this.phi=t,this.theta=n,this}set(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){const e=1e-6;return this.phi=Math.max(e,Math.min(Math.PI-e,this.phi)),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+t*t+n*n),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(Hn(t/this.radius,-1,1))),this}clone(){return(new this.constructor).copy(this)}}class lp{constructor(e=1,t=0,n=0){return this.radius=e,this.theta=t,this.y=n,this}set(e,t,n){return this.radius=e,this.theta=t,this.y=n,this}copy(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+n*n),this.theta=Math.atan2(e,n),this.y=t,this}clone(){return(new this.constructor).copy(this)}}const cp=new Zn;class up{constructor(e=new Zn(1/0,1/0),t=new Zn(-1/0,-1/0)){this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=cp.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(e){return this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return cp.copy(e).clamp(this.min,this.max).sub(e).length()}intersect(e){return this.min.max(e.min),this.max.min(e.max),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}up.prototype.isBox2=!0;const hp=new pi,dp=new pi;class pp{constructor(e=new pi,t=new pi){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){hp.subVectors(e,this.start),dp.subVectors(this.end,this.start);const n=dp.dot(dp);let i=dp.dot(hp)/n;return t&&(i=Hn(i,0,1)),i}closestPointToPoint(e,t,n){const i=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(i).add(this.start)}
vendor: 5,936 bytes, line 947
947applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return(new this.constructor).copy(this)}}const fp=new pi;class mp extends mr{constructor(e,t){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;const n=new io,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let e=0,t=1,n=32;e<n;e++,t++){const r=e/n*Math.PI*2,o=t/n*Math.PI*2;i.push(Math.cos(r),Math.sin(r),1,Math.cos(o),Math.sin(o),1)}n.setAttribute(\"position\",new Yr(i,3));const r=new yc({fog:!1,toneMapped:!1});this.cone=new Ac(n,r),this.add(this.cone),this.update()}dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateMatrixWorld();const e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),fp.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(fp),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}const gp=new pi,vp=new ji,yp=new ji;class xp extends Ac{constructor(e){const t=_p(e),n=new io,i=[],r=[],o=new Fr(0,0,1),s=new Fr(0,1,0);for(let e=0;e<t.length;e++){const n=t[e];n.parent&&n.parent.isBone&&(i.push(0,0,0),i.push(0,0,0),r.push(o.r,o.g,o.b),r.push(s.r,s.g,s.b))}n.setAttribute(\"position\",new Yr(i,3)),n.setAttribute(\"color\",new Yr(r,3)),super(n,new yc({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0})),this.type=\"SkeletonHelper\",this.isSkeletonHelper=!0,this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}updateMatrixWorld(e){const t=this.bones,n=this.geometry,i=n.getAttribute(\"position\");yp.copy(this.root.matrixWorld).invert();for(let e=0,n=0;e<t.length;e++){const r=t[e];r.parent&&r.parent.isBone&&(vp.multiplyMatrices(yp,r.matrixWorld),gp.setFromMatrixPosition(vp),i.setXYZ(n,gp.x,gp.y,gp.z),vp.multiplyMatrices(yp,r.parent.matrixWorld),gp.setFromMatrixPosition(vp),i.setXYZ(n+1,gp.x,gp.y,gp.z),n+=2)}n.getAttribute(\"position\").needsUpdate=!0,super.updateMatrixWorld(e)}}function _p(e){const t=[];e&&e.isBone&&t.push(e);for(let n=0;n<e.children.length;n++)t.push.apply(t,_p(e.children[n]));return t}class bp extends wo{constructor(e,t,n){super(new Qu(t,4,2),new Nr({wireframe:!0,fog:!1,toneMapped:!1})),this.light=e,this.light.updateMatrixWorld(),this.color=n,this.type=\"PointLightHelper\",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}dispose(){this.geometry.dispose(),this.material.dispose()}update(){void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)}}const wp=new pi,Mp=new Fr,Sp=new Fr;class Ep extends mr{constructor(e,t,n){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n;const i=new Zu(t);i.rotateY(.5*Math.PI),this.material=new Nr({wireframe:!0,fog:!1,toneMapped:!1}),void 0===this.color&&(this.material.vertexColors=!0);const r=i.getAttribute(\"position\"),o=new Float32Array(3*r.count);i.setAttribute(\"color\",new Br(o,3)),this.add(new wo(i,this.material)),this.update()}dispose(){this.children[0].geometry.dispose(),this.children[0].material.dispose()}update(){const e=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{const t=e.geometry.getAttribute(\"color\");Mp.copy(this.light.color),Sp.copy(this.light.groundColor);for(let e=0,n=t.count;e<n;e++){const i=e<n/2?Mp:Sp;t.setXYZ(e,i.r,i.g,i.b)}t.needsUpdate=!0}e.lookAt(wp.setFromMatrixPosition(this.light.matrixWorld).negate())}}class Tp extends Ac{constructor(e=10,t=10,n=4473924,i=8947848){n=new Fr(n),i=new Fr(i);const r=t/2,o=e/t,s=e/2,a=[],l=[];for(let e=0,c=0,u=-s;e<=t;e++,u+=o){a.push(-s,0,u,s,0,u),a.push(u,0,-s,u,0,s);const t=e===r?n:i;t.toArray(l,c),c+=3,t.toArray(l,c),c+=3,t.toArray(l,c),c+=3,t.toArray(l,c),c+=3}const c=new io;c.setAttribute(\"position\",new Yr(a,3)),c.setAttribute(\"color\",new Yr(l,3)),super(c,new yc({vertexColors:!0,toneMapped:!1})),this.type=\"GridHelper\"}}class Ap extends Ac{constructor(e=10,t=16,n=8,i=64,r=4473924,o=8947848){r=new Fr(r),o=new Fr(o);const s=[],a=[];for(let n=0;n<=t;n++){const i=n/t*(2*Math.PI),l=Math.sin(i)*e,c=Math.cos(i)*e;s.push(0,0,0),s.push(l,0,c);const u=1&n?r:o;a.push(u.r,u.g,u.b),a.push(u.r,u.g,u.b)}for(let t=0;t<=n;t++){const l=1&t?r:o,c=e-e/n*t;for(let e=0;e<i;e++){let t=e/i*(2*Math.PI),n=Math.sin(t)*c,r=Math.cos(t)*c;s.push(n,0,r),a.push(l.r,l.g,l.b),t=(e+1)/i*(2*Math.PI),n=Math.sin(t)*c,r=Math.cos(t)*c,s.push(n,0,r),a.push(l.r,l.g,l.b)}}const l=new io;l.setAttribute(\"position\",new Yr(s,3)),l.setAttribute(\"color\",new Yr(a,3)),super(l,new yc({vertexColors:!0,toneMapped:!1})),this.type=\"PolarGridHelper\"}}const Lp=new pi,Cp=new pi,Pp=new pi;class Rp extends mr{constructor(e,t,n){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,void 0===t&&(t=1);let i=new io;i.setAttribute(\"position\",new Yr([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));const r=new yc({fog:!1,toneMapped:!1});this.lightPlane=new Sc(i,r),this.add(this.lightPlane),i=new io,i.setAttribute(\"position\",new Yr([0,0,0,0,0,1],3)),this.targetLine=new Sc(i,r),this.add(this.targetLine),this.update()}dispose(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}update(){Lp.setFromMatrixPosition(this.light.matrixWorld),Cp.setFromMatrixPosition(this.light.target.matrixWorld),Pp.subVectors(Cp,Lp),this.lightPlane.lookAt(Cp),void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(Cp),this.targetLine.scale.z
vendor: 5,718 bytes, line 947
947=Pp.length()}}const Dp=new pi,Op=new Co;class Ip extends Ac{constructor(e){const t=new io,n=new yc({color:16777215,vertexColors:!0,toneMapped:!1}),i=[],r=[],o={},s=new Fr(16755200),a=new Fr(16711680),l=new Fr(43775),c=new Fr(16777215),u=new Fr(3355443);function h(e,t,n){d(e,n),d(t,n)}function d(e,t){i.push(0,0,0),r.push(t.r,t.g,t.b),void 0===o[e]&&(o[e]=[]),o[e].push(i.length/3-1)}h(\"n1\",\"n2\",s),h(\"n2\",\"n4\",s),h(\"n4\",\"n3\",s),h(\"n3\",\"n1\",s),h(\"f1\",\"f2\",s),h(\"f2\",\"f4\",s),h(\"f4\",\"f3\",s),h(\"f3\",\"f1\",s),h(\"n1\",\"f1\",s),h(\"n2\",\"f2\",s),h(\"n3\",\"f3\",s),h(\"n4\",\"f4\",s),h(\"p\",\"n1\",a),h(\"p\",\"n2\",a),h(\"p\",\"n3\",a),h(\"p\",\"n4\",a),h(\"u1\",\"u2\",l),h(\"u2\",\"u3\",l),h(\"u3\",\"u1\",l),h(\"c\",\"t\",c),h(\"p\",\"c\",u),h(\"cn1\",\"cn2\",u),h(\"cn3\",\"cn4\",u),h(\"cf1\",\"cf2\",u),h(\"cf3\",\"cf4\",u),t.setAttribute(\"position\",new Yr(i,3)),t.setAttribute(\"color\",new Yr(r,3)),super(t,n),this.type=\"CameraHelper\",this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=o,this.update()}update(){const e=this.geometry,t=this.pointMap;Op.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),Fp(\"c\",t,e,Op,0,0,-1),Fp(\"t\",t,e,Op,0,0,1),Fp(\"n1\",t,e,Op,-1,-1,-1),Fp(\"n2\",t,e,Op,1,-1,-1),Fp(\"n3\",t,e,Op,-1,1,-1),Fp(\"n4\",t,e,Op,1,1,-1),Fp(\"f1\",t,e,Op,-1,-1,1),Fp(\"f2\",t,e,Op,1,-1,1),Fp(\"f3\",t,e,Op,-1,1,1),Fp(\"f4\",t,e,Op,1,1,1),Fp(\"u1\",t,e,Op,.7,1.1,-1),Fp(\"u2\",t,e,Op,-.7,1.1,-1),Fp(\"u3\",t,e,Op,0,2,-1),Fp(\"cf1\",t,e,Op,-1,0,1),Fp(\"cf2\",t,e,Op,1,0,1),Fp(\"cf3\",t,e,Op,0,-1,1),Fp(\"cf4\",t,e,Op,0,1,1),Fp(\"cn1\",t,e,Op,-1,0,-1),Fp(\"cn2\",t,e,Op,1,0,-1),Fp(\"cn3\",t,e,Op,0,-1,-1),Fp(\"cn4\",t,e,Op,0,1,-1),e.getAttribute(\"position\").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}function Fp(e,t,n,i,r,o,s){Dp.set(r,o,s).unproject(i);const a=t[e];if(void 0!==a){const e=n.getAttribute(\"position\");for(let t=0,n=a.length;t<n;t++)e.setXYZ(a[t],Dp.x,Dp.y,Dp.z)}}const Np=new gi;class Up extends Ac{constructor(e,t=16776960){const n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new Float32Array(24),r=new io;r.setIndex(new Br(n,1)),r.setAttribute(\"position\",new Br(i,3)),super(r,new yc({color:t,toneMapped:!1})),this.object=e,this.type=\"BoxHelper\",this.matrixAutoUpdate=!1,this.update()}update(e){if(void 0!==e&&console.warn(\"THREE.BoxHelper: .update() has no longer arguments.\"),void 0!==this.object&&Np.setFromObject(this.object),Np.isEmpty())return;const t=Np.min,n=Np.max,i=this.geometry.attributes.position,r=i.array;r[0]=n.x,r[1]=n.y,r[2]=n.z,r[3]=t.x,r[4]=n.y,r[5]=n.z,r[6]=t.x,r[7]=t.y,r[8]=n.z,r[9]=n.x,r[10]=t.y,r[11]=n.z,r[12]=n.x,r[13]=n.y,r[14]=t.z,r[15]=t.x,r[16]=n.y,r[17]=t.z,r[18]=t.x,r[19]=t.y,r[20]=t.z,r[21]=n.x,r[22]=t.y,r[23]=t.z,i.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(e){return this.object=e,this.update(),this}copy(e){return Ac.prototype.copy.call(this,e),this.object=e.object,this}}class zp extends Ac{constructor(e,t=16776960){const n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new io;i.setIndex(new Br(n,1)),i.setAttribute(\"position\",new Yr([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),super(i,new yc({color:t,toneMapped:!1})),this.box=e,this.type=\"Box3Helper\",this.geometry.computeBoundingSphere()}updateMatrixWorld(e){const t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(e))}}class Bp extends Sc{constructor(e,t=1,n=16776960){const i=n,r=new io;r.setAttribute(\"position\",new Yr([1,-1,1,-1,1,1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,0,0,1,0,0,0],3)),r.computeBoundingSphere(),super(r,new yc({color:i,toneMapped:!1})),this.type=\"PlaneHelper\",this.plane=e,this.size=t;const o=new io;o.setAttribute(\"position\",new Yr([1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],3)),o.computeBoundingSphere(),this.add(new wo(o,new Nr({color:i,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}updateMatrixWorld(e){let t=-this.plane.constant;Math.abs(t)<1e-8&&(t=1e-8),this.scale.set(.5*this.size,.5*this.size,t),this.children[0].material.side=t<0?m:f,this.lookAt(this.plane.normal),super.updateMatrixWorld(e)}}const Gp=new pi;let kp,Vp;class Hp extends mr{constructor(e=new pi(0,0,1),t=new pi(0,0,0),n=1,i=16776960,r=.2*n,o=.2*r){super(),this.type=\"ArrowHelper\",void 0===kp&&(kp=new io,kp.setAttribute(\"position\",new Yr([0,0,0,0,1,0],3)),Vp=new kc(0,.5,1,5,1),Vp.translate(0,-.5,0)),this.position.copy(t),this.line=new Sc(kp,new yc({color:i,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new wo(Vp,new Nr({color:i,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(n,r,o)}setDirection(e){if(e.y>.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{Gp.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(Gp,t)}}setLength(e,t=.2*e,n=.2*t){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}}class jp extends Ac{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],n=new io;n.setAttribute(\"position\",new Yr(t,3)),n.setAttribute(\"color\",new Yr([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3)),super(n,new yc({vertexColors:!0,toneMapped:!1})),this.type=\"AxesHelper\"}
947setColors(e,t,n){const i=new Fr,r=this.geometry.attributes.color.array;return i.set(e),i.toArray(r,0),i.toArray(r,3),i.set(t),i.toArray(r,6),i.toArray(r,9),i.set(n),i.toArray(r,12),i.toArray(r,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class Wp{constructor(){this.type=\"ShapePath\",this.color=new Fr,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new vu,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,n,i){return this.currentPath.quadraticCurveTo(e,t,n,i),this}bezierCurveTo(e,t,n,i,r,o){return this.currentPath.bezierCurveTo(e,t,n,i,r,o),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e,t){function n(e){const t=[];for(let n=0,i=e.length;n<i;n++){const i=e[n],r=new yu;r.curves=i.curves,t.push(r)}return t}function i(e,t){const n=t.length;let i=!1;for(let r=n-1,o=0;o<n;r=o++){let n=t[r],s=t[o],a=s.x-n.x,l=s.y-n.y;if(Math.abs(l)>Number.EPSILON){if(l<0&&(n=t[o],a=-a,s=t[r],l=-l),e.y<n.y||e.y>s.y)continue;if(e.y===n.y){if(e.x===n.x)return!0}else{const t=l*(e.x-n.x)-a*(e.y-n.y);if(0===t)return!0;if(t<0)continue;i=!i}}else{if(e.y!==n.y)continue;if(s.x<=e.x&&e.x<=n.x||n.x<=e.x&&e.x<=s.x)return!0}}return i}const r=Hu.isClockWise,o=this.subPaths;if(0===o.length)return[];if(!0===t)return n(o);let s,a,l;const c=[];if(1===o.length)return a=o[0],l=new yu,l.curves=a.curves,c.push(l),c;let u=!r(o[0].getPoints());u=e?!u:u;const h=[],d=[];let p,f,m=[],g=0;d[g]=void 0,m[g]=[];for(let t=0,n=o.length;t<n;t++)a=o[t],p=a.getPoints(),s=r(p),s=e?!s:s,s?(!u&&d[g]&&g++,d[g]={s:new yu,p},d[g].s.curves=a.curves,u&&g++,m[g]=[]):m[g].push({h:a,p:p[0]});if(!d[0])return n(o);if(d.length>1){let e=!1;const t=[];for(let e=0,t=d.length;e<t;e++)h[e]=[];for(let n=0,r=d.length;n<r;n++){const r=m[n];for(let o=0;o<r.length;o++){const s=r[o];let a=!0;for(let r=0;r<d.length;r++)i(s.p,d[r].p)&&(n!==r&&t.push({froms:n,tos:r,hole:o}),a?(a=!1,h[r].push(s)):e=!0);a&&h[n].push(s)}}t.length>0&&(e||(m=h))}for(let e=0,t=d.length;e<t;e++){l=d[e].s,c.push(l),f=m[e];for(let e=0,t=f.length;e<t;e++)l.holes.push(f[e].h)}return c}}const qp=new Float32Array(1),Xp=new Int32Array(qp.buffer);class Yp{static toHalfFloat(e){e>65504&&(console.warn(\"THREE.DataUtils.toHalfFloat(): value exceeds 65504.\"),e=65504),qp[0]=e;const t=Xp[0];let n=t>>16&32768,i=t>>12&2047;const r=t>>23&255;return r<103?n:r>142?(n|=31744,n|=(255==r?0:1)&&8388607&t,n):r<113?(i|=2048,n|=(i>>114-r)+(i>>113-r&1),n):(n|=r-112<<10|i>>1,n+=1&i,n)}}const Jp=0,Zp=1,$p=0,Kp=1,Qp=2;function ef(e){return console.warn(\"THREE.MeshFaceMaterial has been removed. Use an Array instead.\"),e}function tf(e=[]){return console.warn(\"THREE.MultiMaterial has been removed. Use an Array instead.\"),e.isMultiMaterial=!0,e.materials=e,e.clone=function(){return e.slice()},e}function nf(e,t){return console.warn(\"THREE.PointCloud has been renamed to THREE.Points.\"),new Ic(e,t)}function rf(e){return console.warn(\"THREE.Particle has been renamed to THREE.Sprite.\"),new Zl(e)}function of(e,t){return console.warn(\"THREE.ParticleSystem has been renamed to THREE.Points.\"),new Ic(e,t)}function sf(e){return console.warn(\"THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial.\"),new Cc(e)}function af(e){return console.warn(\"THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial.\"),new Cc(e)}function lf(e){return console.warn(\"THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial.\"),new Cc(e)}function cf(e,t,n){return console.warn(\"THREE.Vertex has been removed. Use THREE.Vector3 instead.\"),new pi(e,t,n)}function uf(e,t){return console.warn(\"THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setUsage( THREE.DynamicDrawUsage ) instead.\"),new Br(e,t).setUsage(Tn)}function hf(e,t){return console.warn(\"THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead.\"),new Gr(e,t)}function df(e,t){return console.warn(\"THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead.\"),new kr(e,t)}function pf(e,t){return console.warn(\"THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead.\"),new Vr(e,t)}function ff(e,t){return console.warn(\"THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead.\"),new Hr(e,t)}function mf(e,t){return console.warn(\"THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead.\"),new jr(e,t)}function gf(e,t){return console.warn(\"THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead.\"),new Wr(e,t)}function vf(e,t){return console.warn(\"THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead.\"),new qr(e,t)}function yf(e,t){return console.warn(\"THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead.\"),new Yr(e,t)}function xf(e,t){return console.warn(\"THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead.\"),new Jr(e,t)}function _f(e){return console.warn(\"THREE.AxisHelper has been renamed to THREE.AxesHelper.\"),new jp(e)}function bf(e,t){return console.warn(\"THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead.\"),new Up(e,t)}function wf(e,t){return console.warn(\"THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead.\"),new Ac(new Jc(e.geometry),new yc({color:void 0!==t?t:16777215}))}function Mf(e,t){return console.warn(\"THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead.\"),new Ac(new rh(e.geometry),new yc({color:void 0!==t?t:16777215}))}function Sf(e){return console.warn(\"THREE.XHRLoader has been renamed to THREE.FileLoader.\"),new Uh(e)}function Ef(e){return console.warn(\"THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader.\"),new Vh(e)}function Tf(e,t,n){return console.warn(\"THREE.WebGLRenderTargetCube( width, height, options ) is now WebGLCubeRen
947derTarget( size, options ).\"),new Io(e,n)}function Af(){console.error(\"THREE.CanvasRenderer has been removed\")}function Lf(){console.error(\"THREE.JSONLoader has been removed.\")}Zc.create=function(e,t){return console.log(\"THREE.Curve.create() has been deprecated\"),e.prototype=Object.create(Zc.prototype),e.prototype.constructor=e,e.prototype.getPoint=t,e},vu.prototype.fromPoints=function(e){return console.warn(\"THREE.Path: .fromPoints() has been renamed to .setFromPoints().\"),this.setFromPoints(e)},Tp.prototype.setColors=function(){console.error(\"THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.\")},xp.prototype.update=function(){console.error(\"THREE.SkeletonHelper: update() no longer needs to be called.\")},Fh.prototype.extractUrlBase=function(e){return console.warn(\"THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead.\"),ud.extractUrlBase(e)},Fh.Handlers={add:function(){console.error(\"THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead.\")},get:function(){console.error(\"THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead.\")}},up.prototype.center=function(e){return console.warn(\"THREE.Box2: .center() has been renamed to .getCenter().\"),this.getCenter(e)},up.prototype.empty=function(){return console.warn(\"THREE.Box2: .empty() has been renamed to .isEmpty().\"),this.isEmpty()},up.prototype.isIntersectionBox=function(e){return console.warn(\"THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox().\"),this.intersectsBox(e)},up.prototype.size=function(e){return console.warn(\"THREE.Box2: .size() has been renamed to .getSize().\"),this.getSize(e)},gi.prototype.center=function(e){return console.warn(\"THREE.Box3: .center() has been renamed to .getCenter().\"),this.getCenter(e)},gi.prototype.empty=function(){return console.warn(\"THREE.Box3: .empty() has been renamed to .isEmpty().\"),this.isEmpty()},gi.prototype.isIntersectionBox=function(e){return console.warn(\"THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox().\"),this.intersectsBox(e)},gi.prototype.isIntersectionSphere=function(e){return console.warn(\"THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere().\"),this.intersectsSphere(e)},gi.prototype.size=function(e){return console.warn(\"THREE.Box3: .size() has been renamed to .getSize().\"),this.getSize(e)},Fi.prototype.empty=function(){return console.warn(\"THREE.Sphere: .empty() has been renamed to .isEmpty().\"),this.isEmpty()},ko.prototype.setFromMatrix=function(e){return console.warn(\"THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix().\"),this.setFromProjectionMatrix(e)},pp.prototype.center=function(e){return console.warn(\"THREE.Line3: .center() has been renamed to .getCenter().\"),this.getCenter(e)},$n.prototype.flattenToArrayOffset=function(e,t){return console.warn(\"THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead.\"),this.toArray(e,t)},$n.prototype.multiplyVector3=function(e){return console.warn(\"THREE.Matrix3: .multiplyVector3(
947) has been removed. Use vector.applyMatrix3( matrix ) instead.\"),e.applyMatrix3(this)},$n.prototype.multiplyVector3Array=function(){console.error(\"THREE.Matrix3: .multiplyVector3Array() has been removed.\")},$n.prototype.applyToBufferAttribute=function(e){return console.warn(\"THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead.\"),e.applyMatrix3(this)},$n.prototype.applyToVector3Array=function(){console.error(\"THREE.Matrix3: .applyToVector3Array() has been removed.\")},$n.prototype.getInverse=function(e){return console.warn(\"THREE.Matrix3: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead.\"),this.copy(e).invert()},ji.prototype.extractPosition=function(e){return console.warn(\"THREE.Matrix4: .extractPosition() has been renamed to .copyPosition().\"),this.copyPosition(e)},ji.prototype.flattenToArrayOffset=function(e,t){return console.warn(\"THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead.\"),this.toArray(e,t)},ji.prototype.getPosition=function(){return console.warn(\"THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead.\"),(new pi).setFromMatrixColumn(this,3)},ji.prototype.setRotationFromQuaternion=function(e){return console.warn(\"THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion().\"),this.makeRotationFromQuaternion(e)},ji.prototype.multiplyToArray=function(){console.warn(\"THREE.Matrix4: .multiplyToArray() has been removed.\")},ji.prototype.multiplyVector3=function(e){return console.warn(\"THREE.Matrix4: .multiplyVector3(
947) has been removed. Use vector.applyMatrix4( matrix ) instead.\"),e.applyMatrix4(this)},ji.prototype.multiplyVector4=function(e){return console.warn(\"THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.\"),e.applyMatrix4(this)},ji.prototype.multiplyVector3Array=function(){console.error(\"THREE.Matrix4: .multiplyVector3Array() has been removed.\")},ji.prototype.rotateAxis=function(e){console.warn(\"THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.\"),e.transformDirection(this)},ji.prototype.crossVector=function(e){return console.warn(\"THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.\"),e.applyMatrix4(this)},ji.prototype.translate=function(){console.error(\"THREE.Matrix4: .translate() has been removed.\")},ji.prototype.rotateX=function(){console.error(\"THREE.Matrix4: .rotateX() has been removed.\")},ji.prototype.rotateY=function(){console.error(\"THREE.Matrix4: .rotateY() has been removed.\")},ji.prototype.rotateZ=function(){console.error(\"THREE.Matrix4: .rotateZ() has been removed.\")},ji.prototype.rotateByAxis=function(){console.error(\"THREE.Matrix4: .rotateByAxis() has been removed.\")},ji.prototype.applyToBufferAttribute=function(e){return console.warn(\"THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead.\"),e.applyMatrix4(this)},ji.prototype.applyToVector3Array=function(){console.error(\"THREE.Matrix4: .applyToVector3Array() has been removed.\")},ji.prototype.makeFrustum=function(e,t,n,i,r,o){return console.warn(\"THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead.\"),this.makePerspective(e,t,i,n,r,o)},ji.prototype.getInverse=function(e){return console.warn(\"THREE.Matrix4: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead.\"),this.copy(e).invert()},zo.prototype.isIntersectionLine=function(e){return console.warn(\"THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine().\"),this.intersectsLine(e)},di.prototype.multiplyVector3=function(e){return console.warn(\"THREE.Quaternion: .multiplyVector3(
947) has been removed. Use is now vector.applyQuaternion( quaternion ) instead.\"),e.applyQuaternion(this)},di.prototype.inverse=function(){return console.warn(\"THREE.Quaternion: .inverse() has been renamed to invert().\"),this.invert()},Hi.prototype.isIntersectionBox=function(e){return console.warn(\"THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox().\"),this.intersectsBox(e)},Hi.prototype.isIntersectionPlane=function(e){return console.warn(\"THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane().\"),this.intersectsPlane(e)},Hi.prototype.isIntersectionSphere=function(e){return console.warn(\"THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere().\"),this.intersectsSphere(e)},Tr.prototype.area=function(){return console.warn(\"THREE.Triangle: .area() has been renamed to .getArea().\"),this.getArea()},Tr.prototype.barycoordFromPoint=function(e,t){return console.warn(\"THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord().\"),this.getBarycoord(e,t)},Tr.prototype.midpoint=function(e){return console.warn(\"THREE.Triangle: .midpoint() has been renamed to .getMidpoint().\"),this.getMidpoint(e)},Tr.prototypenormal=function(e){return console.warn(\"THREE.Triangle: .normal() has been renamed to .getNormal().\"),this.getNormal(e)},Tr.prototype.plane=function(e){return console.warn(\"THREE.Triangle: .plane() has been renamed to .getPlane().\"),this.getPlane(e)},Tr.barycoordFromPoint=function(e,t,n,i,r){return console.warn(\"THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord().\"),Tr.getBarycoord(e,t,n,i,r)},Tr.normal=function(e,t,n,i){return console.warn(\"THREE.Triangle: .normal() has been renamed to .getNormal().\"),Tr.getNormal(e,t,n,i)},yu.prototype.extractAllPoints=function(e){return console.warn(\"THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead.\"),this.extractPoints(e)},yu.prototype.extrude=function(e){return console.warn(\"THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead.\"),new qu(this,e)},yu.prototype.makeGeometry=function(e){return console.warn(\"THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead.\"),new Ku(this,e)},Zn.prototype.fromAttribute=function(e,t,n){return console.warn(\"THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute().\"),this.fromBufferAttribute(e,t,n)},Zn.prototype.distanceToManhattan=function(e){return console.warn(\"THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo().\"),this.manhattanDistanceTo(e)},Zn.prototype.lengthManhattan=function(){return console.warn(\"THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength().\"),this.manhattanLength()},pi.prototype.setEulerFromRotationMatrix=function(){console.error(\"THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.\")},pi.prototype.setEulerFromQuaternion=function(){console.error(\"THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.\")},pi.prototype.getPositionFromMatrix=function(e){return console.warn(\"THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition().\"),this.setFromMatrixPosition(e)},pi.prototype.getScaleFromMatrix=function(e){return console.warn(\"THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale().\"),this.setFromMatrixScale(e)},pi.prototype.getColumnFromMatrix=function(e,t){return console.warn(\"THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn().\"),this.setFromMatrixColumn(t,e)},pi.prototype.applyProjection=function(e){return console.warn(\"THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead.\"),this.applyMatrix4(e)},pi.prototype.fromAttribute=function(e,t,n){return console.warn(\"THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute().\"),this.fromBufferAttribute(e,t,n)},pi.prototype.distanceToManhattan=function(e){return console.warn(\"THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo().\"),this.manhattanDistanceTo(e)},pi.prototype.lengthManhattan=function(){return console.warn(\"THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength().\"),this.manhattanLength()},li.prototype.fromAttribute=function(e,t,n){return console.warn(\"THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute().\"),this.fromBufferAttribute(e,t,n)},li.prototype.lengthManhattan=function(){return console.warn(\"THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength().\"),this.manhattanLength()},mr.prototype.getChildByName=function(e){return console.warn(\"THREE.Object3D: .getChildByName() has been renamed to .getObjectByName().\"),this.getObjectByName(e)},mr.prototype.renderDepth=function(){console.warn(\"THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.\")},mr.prototype.translate=function(e,t){return console.warn(\"THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead.\"),this.translateOnAxis(t,e)},mr.prototype.getWorldRotation=function(){console.error(\"THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.\")}
947,mr.prototype.applyMatrix=function(e){return console.warn(\"THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4().\"),this.applyMatrix4(e)},Object.defineProperties(mr.prototype,{eulerOrder:{get:function(){return console.warn(\"THREE.Object3D: .eulerOrder is now .rotation.order.\"),this.rotation.order},set:function(e){console.warn(\"THREE.Object3D: .eulerOrder is now .rotation.order.\"),this.rotation.order=e}},useQuaternion:{get:function(){console.warn(\"THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.\")},set:function(){console.warn(\"THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.\")}}}),wo.prototype.setDrawMode=function(){console.error(\"THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.\")},Object.defineProperties(wo.prototype,{drawMode:{get:function(){return console.error(\"THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode.\"),Xt},set:function(){console.error(\"THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.\")}}}),sc.prototype.initBones=function(){console.error(\"THREE.SkinnedMesh: initBones() has been removed.\")},Po.prototype.setLens=function(e,t){console.warn(\"THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup.\"),void 0!==t&&(this.filmGauge=t),this.setFocalLength(e)},Object.defineProperties(jh.prototype,{onlyShadow:{set:function(){console.warn(\"THREE.Light: .onlyShadow has been removed.\")}},shadowCameraFov:{set:function(e){console.warn(\"THREE.Light: .shadowCameraFov is now .shadow.camera.fov.\"),this.shadow.camera.fov=e}},shadowCameraLeft:{set:function(e){console.warn(\"THREE.Light: .shadowCameraLeft is now .shadow.camera.left.\"),this.shadow.camera.left=e}},shadowCameraRight:{set:function(e){console.warn(\"THREE.Light: .shadowCameraRight is now .shadow.camera.right.\"),this.shadow.camera.right=e}},shadowCameraTop:{set:function(e){console.warn(\"THREE.Light: .shadowCameraTop is now .shadow.camera.top.\"),this.shadow.camera.top=e}},shadowCameraBottom:{set:function(e){console.warn(\"THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom.\"),this.shadow.camera.bottom=e}},shadowCameraNear:{set:function(e){console.warn(\"THREE.Light: .shadowCameraNear is now .shadow.camera.near.\"),this.shadow.camera.near=e}},shadowCameraFar:{set:function(e){console.warn(\"THREE.Light: .shadowCameraFar is now .shadow.camera.far.\"),this.shadow.camera.far=e}},shadowCameraVisible:{set:function(){console.warn(\"THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.\")}},shadowBias:{set:function(e){console.warn(\"THREE.Light: .shadowBias is now .shadow.bias.\"),this.shadow.bias=e}},shadowDarkness:{set:function(){console.warn(\"THREE.Light: .shadowDarkness has been removed.\")}},shadowMapWidth:{set:function(e){console.warn(\"THREE.Light: .shadowMapWidth is now .shadow.mapSize.width.\"),this.shadow.mapSize.width=e}},shadowMapHeight:{set:function(e){console.warn(\"THREE.Light: .shadowMapHeight is now .shadow.mapSize.height.\"),this.shadow.mapSize.height=e}}}),Object.defineProperties(Br.prototype,{length:{get:function(){return console.warn(\"THREE.BufferAttribute: .length has been deprecated. Use .count instead.\"),this.array.length}},dynamic:{get:function(){return console.warn(\"THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead.\"),this.usage===Tn},set:function(){console.warn(\"THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead.\"),this.setUsage(Tn)}}}),Br.prototype.setDynamic=function(e){return console.warn(\"THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead.\"),this.setUsage(!0===e?Tn:En),this},Br.prototype.copyIndicesArray=function(){console.error(\"THREE.BufferAttribute: .copyIndicesArray() has been removed.\")},Br.prototype.setArray=function(){console.error(\"THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers\")},io.prototype.addIndex=function(e){console.warn(\"THREE.BufferGeometry: .addIndex() has been renamed to .setIndex().\"),this.setIndex(e)},io.prototype.addAttribute=function(e,t){return console.warn(\"THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute().\"),t&&t.isBufferAttribute||t&&t.isInterleavedBufferAttribute?\"index\"===e?(console.warn(\"THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute.\"),this.setIndex(t),this):this.setAttribute(e,t):(console.warn(\"THREE.BufferGeometry: .addAttribute() now expects ( name, attribute ).\"),this.setAttribute(e,new Br(arguments[1],arguments[2])))},io.prototype.addDrawCall=function(e,t,n){void 0!==n&&console.warn(\"THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset.\"),console.warn(\"THREE.BufferGeometry: .addDrawCall() is now .addGroup().\"),this.addGroup(e,t)},io.prototype.clearDrawCalls=function(){console.warn(\"THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups().\"),this.clearGroups()},io.prototype.computeOffsets=function(){console.warn(\"THREE.BufferGeometry: .computeOffsets() has been removed.\")},io.prototype.removeAttribute=function(e){return console.warn(\"THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute().\"),this.deleteAttribute(e)}
947,io.prototype.applyMatrix=function(e){return console.warn(\"THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4().\"),this.applyMatrix4(e)},Object.defineProperties(io.prototype,{drawcalls:{get:function(){return console.error(\"THREE.BufferGeometry: .drawcalls has been renamed to .groups.\"),this.groups}},offsets:{get:function(){return console.warn(\"THREE.BufferGeometry: .offsets has been renamed to .groups.\"),this.groups}}}),Ol.prototype.setDynamic=function(e){return console.warn(\"THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead.\"),this.setUsage(!0===e?Tn:En),this},Ol.prototype.setArray=function(){console.error(\"THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers\")},qu.prototype.getArrays=function(){console.error(\"THREE.ExtrudeGeometry: .getArrays() has been removed.\")},qu.prototype.addShapeList=function(){console.error(\"THREE.ExtrudeGeometry: .addShapeList() has been removed.\")},qu.prototype.addShape=function(){console.error(\"THREE.ExtrudeGeometry: .addShape() has been removed.\")},Dl.prototype.dispose=function(){console.error(\"THREE.Scene: .dispose() has been removed.\")},tp.prototype.onUpdate=function(){return console.warn(\"THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead.\"),this},Object.defineProperties(Lr.prototype,{wrapAround:{get:function(){console.warn(\"THREE.Material: .wrapAround has been removed.\")},set:function(){console.warn(\"THREE.Material: .wrapAround has been removed.\")}},overdraw:{get:function(){console.warn(\"THREE.Material: .overdraw has been removed.\")},set:function(){console.warn(\"THREE.Material: .overdraw has been removed.\")}},wrapRGB:{get:function(){return console.warn(\"THREE.Material: .wrapRGB has been removed.\"),new Fr}},shading:{get:function(){console.error(\"THREE.\"+this.type+\": .shading has been removed. Use the boolean .flatShading instead.\")},set:function(e){console.warn(\"THREE.\"+this.type+\": .shading has been removed. Use the boolean .flatShading instead.\"),this.flatShading=e===v}},stencilMask:{get:function(){return console.warn(\"THREE.\"+this.type+\": .stencilMask has been removed. Use .stencilFuncMask instead.\"),this.stencilFuncMask},set:function(e){console.warn(\"THREE.\"+this.type+\": .stencilMask has been removed. Use .stencilFuncMask instead.\"),this.stencilFuncMask=e}},vertexTangents:{get:function(){console.warn(\"THREE.\"+this.type+\": .vertexTangents has been removed.\")},set:function(){console.warn(\"THREE.\"+this.type+\": .vertexTangents has been removed.\")}}}),Object.defineProperties(Lo.prototype,{derivatives:{get:function(){return console.warn(\"THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives.\"),this.extensions.derivatives},set:function(e){console.warn(\"THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives.\"),this.extensions.derivatives=e}}}),Ll.prototype.clearTarget=function(e,t,n,i){console.warn(\"THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead.\"),this.setRenderTarget(e),this.clear(t,n,i)},Ll.prototype.animate=function(e){console.warn(\"THREE.WebGLRenderer: .animate() is now .setAnimationLoop().\"),this.setAnimationLoop(e)},Ll.prototype.getCurrentRenderTarget=function(){return console.warn(\"THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget().\"),this.getRenderTarget()},Ll.prototype.getMaxAnisotropy=function(){return console.warn(\"THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy().\"),this.capabilities.getMaxAnisotropy()},Ll.prototype.getPrecision=function(){return console.warn(\"THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision.\"),this.capabilities.precision},Ll.prototype.resetGLState=function(){return console.warn(\"THREE.WebGLRenderer: .resetGLState() is now .state.reset().\"),this.state.reset()},Ll.prototype.supportsFloatTextures=function(){return console.warn(\"THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' ).\"),this.extensions.get(\"OES_texture_float\")},Ll.prototype.supportsHalfFloatTextures=function(){return console.warn(\"THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' ).\"),this.extensions.get(\"OES_texture_half_float\")},Ll.prototype.supportsStandardDerivatives=function(){return console.warn(\"THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' ).\"),this.extensions.get(\"OES_standard_derivatives\")},Ll.prototype.supportsCompressedTextureS3TC=function(){return console.warn(\"THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' ).\"),this.extensions.get(\"WEBGL_compressed_texture_s3tc\")},Ll.prototype.supportsCompressedTexturePVRTC=function(){return console.warn(\"THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' ).\"),this.extensions.get(\"WEBGL_compressed_texture_pvrtc\")},Ll.prototype.supportsBlendMinMax=function(){return console.warn(\"THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' ).\"),this.extensions.get(\"EXT_blend_minmax\")},Ll.prototype.supportsVertexTextures=function(){return console.warn(\"THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures.\"),this.capabilities.vertexTextures},Ll.prototype.supportsInstancedArrays=function(){return console.warn(\"THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_
947instanced_arrays' ).\"),this.extensions.get(\"ANGLE_instanced_arrays\")},Ll.prototype.enableScissorTest=function(e){console.warn(\"THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest().\"),this.setScissorTest(e)},Ll.prototype.initMaterial=function(){console.warn(\"THREE.WebGLRenderer: .initMaterial() has been removed.\")},Ll.prototype.addPrePlugin=function(){console.warn(\"THREE.WebGLRenderer: .addPrePlugin() has been removed.\")},Ll.prototype.addPostPlugin=function(){console.warn(\"THREE.WebGLRenderer: .addPostPlugin() has been removed.\")},Ll.prototype.updateShadowMap=function(){console.warn(\"THREE.WebGLRenderer: .updateShadowMap() has been removed.\")},Ll.prototype.setFaceCulling=function(){console.warn(\"THREE.WebGLRenderer: .setFaceCulling() has been removed.\")},Ll.prototype.allocTextureUnit=function(){console.warn(\"THREE.WebGLRenderer: .allocTextureUnit() has been removed.\")},Ll.prototype.setTexture=function(){console.warn(\"THREE.WebGLRenderer: .setTexture() has been removed.\")},Ll.prototype.setTexture2D=function(){console.warn(\"THREE.WebGLRenderer: .setTexture2D() has been removed.\")},Ll.prototype.setTextureCube=function(){console.warn(\"THREE.WebGLRenderer: .setTextureCube() has been removed.\")},Ll.prototype.getActiveMipMapLevel=function(){return console.warn(\"THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel().\"),this.getActiveMipmapLevel()},Object.defineProperties(Ll.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(e){console.warn(\"THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled.\"),this.shadowMap.enabled=e}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(e){console.warn(\"THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type.\"),this.shadowMap.type=e}},shadowMapCullFace:{get:function(){console.warn(\"THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.\")},set:function(){console.warn(\"THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.\")}},context:{get:function(){return console.warn(\"THREE.WebGLRenderer: .context has been removed. Use .getContext() instead.\"),this.getContext()}},vr:{get:function(){return console.warn(\"THREE.WebGLRenderer: .vr has been renamed to .xr\"),this.xr}},gammaInput:{get:function(){return console.warn(\"THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.\"),!1},set:function(){console.warn(\"THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.\")}},gammaOutput:{get:function(){return console.warn(\"THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead.\"),!1},set:function(e){console.warn(\"THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead.\"),this.outputEncoding=!0===e?$t:Zt}},toneMappingWhitePoint:{get:function(){return console.warn(\"THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.\"),1},set:function(){console.warn(\"THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.\")}}}),Object.defineProperties(yl.prototype,{cullFace:{get:function(){console.warn(\"THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.\")},set:function(){console.warn(\"THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.\")}},renderReverseSided:{get:function(){console.warn(\"THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.\")},set:function(){console.warn(\"THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.\")}},renderSingleSided:{get:function(){console.warn(\"THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.\")},set:function(){console.warn(\"THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.\")}}}),Object.defineProperties(ci.prototype,{wrapS:{get:function(){return console.warn(\"THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.\"),this.texture.wrapS},set:function(e){console.warn(\"THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.\"),this.texture.wrapS=e}},wrapT:{get:function(){return console.warn(\"THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.\"),this.texture.wrapT},set:function(e){console.warn(\"THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.\"),this.texture.wrapT=e}},magFilter:{get:function(){return console.warn(\"THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.\"),this.texture.magFilter},set:function(e){console.warn(\"THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.\"),this.texture.magFilter=e}},minFilter:{get:function(){return console.warn(\"THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.\"),this.texture.minFilter},set:function(e){console.warn(\"THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.\"),this.texture.minFilter=e}},anisotropy:{get:function(){return console.warn(\"THREE.WebGLRenderTarget: .anisotropy
947is now .texture.anisotropy.\"),this.texture.anisotropy},set:function(e){console.warn(\"THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.\"),this.texture.anisotropy=e}},offset:{get:function(){return console.warn(\"THREE.WebGLRenderTarget: .offset is now .texture.offset.\"),this.texture.offset},set:function(e){console.warn(\"THREE.WebGLRenderTarget: .offset is now .texture.offset.\"),this.texture.offset=e}},repeat:{get:function(){return console.warn(\"THREE.WebGLRenderTarget: .repeat is now .texture.repeat.\"),this.texture.repeat},set:function(e){console.warn(\"THREE.WebGLRenderTarget: .repeat is now .texture.repeat.\"),this.texture.repeat=e}},format:{get:function(){return console.warn(\"THREE.WebGLRenderTarget: .format is now .texture.format.\"),this.texture.format},set:function(e){console.warn(\"THREE.WebGLRenderTarget: .format is now .texture.format.\"),this.texture.format=e}},type:{get:function(){return console.warn(\"THREE.WebGLRenderTarget: .type is now .texture.type.\"),this.texture.type},set:function(e){console.warn(\"THREE.WebGLRenderTarget: .type is now .texture.type.\"),this.texture.type=e}},generateMipmaps:{get:function(){return console.warn(\"THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.\"),this.texture.generateMipmaps},set:function(e){console.warn(\"THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.\"),this.texture.generateMipmaps=e}}}),Od.prototype.load=function(e){console.warn(\"THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.\");const t=this;return(new _d).load(e,(function(e){t.setBuffer(e)})),this},Bd.prototype.getData=function(){return console.warn(\"THREE.AudioAnalyser: .getData() is now .getFrequencyData().\"),this.getFrequencyData()},Do.prototype.updateCubeMap=function(e,t){return console.warn(\"THREE.CubeCamera: .updateCubeMap() is now .update(
947).\"),this.update(e,t)},Do.prototype.clear=function(e,t,n,i){return console.warn(\"THREE.CubeCamera: .clear() is now .renderTarget.clear().\"),this.renderTarget.clear(e,t,n,i)},ri.crossOrigin=void 0,ri.loadTexture=function(e,t,n,i){console.warn(\"THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.\");const r=new Hh;r.setCrossOrigin(this.crossOrigin);const o=r.load(e,n,void 0,i);return t&&(o.mapping=t),o},ri.loadTextureCube=function(e,t,n,i){console.warn(\"THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.\");const r=new kh;r.setCrossOrigin(this.crossOrigin);const o=r.load(e,n,void 0,i);return t&&(o.mapping=t),o},ri.loadCompressedTexture=function(){console.error(\"THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.\")},ri.loadCompressedTextureCube=function(){console.error(\"THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.\")};const Cf={createMultiMaterialObject:function(){console.error(\"THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js\")},detach:function(){console.error(\"THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js\")},attach:function(){console.error(\"THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js\")}};function Pf(){console.error(\"THREE.LensFlare has been moved to /examples/jsm/objects/Lensflare.js\")}function Rf(){return console.error(\"THREE.ParametricGeometry has been moved to /examples/jsm/geometries/ParametricGeometry.js\"),new io}function Df(){return console.error(\"THREE.TextGeometry has been moved to /examples/jsm/geometries/TextGeometry.js\"),new io}function Of(){console.error(\"THREE.FontLoader has been moved to /examples/jsm/loaders/FontLoader.js\")}function If(){console.error(\"THREE.Font has been moved to /examples/jsm/loaders/FontLoader.js\")}function Ff(){console.error(\"THREE.ImmediateRenderObject has been removed.\")}\"undefined\"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent(\"register\",{detail:{revision:i}})),\"undefined\"!=typeof window&&(window.__THREE__?console.warn(\"WARNING: Multiple instances of Three.js being imported.\"):window.__THREE__=i)},7769:function(e,t,n){\"use strict\";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);
947r&&!(\"get\"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)\"default\"===n||Object.prototype.hasOwnProperty.call(t,n)||i(t,e,n)};Object.defineProperty(t,\"__esModule\",{value:!0}),r(n(5185),t),r(n(6406),t),r(n(6114),t),r(n(8934),t),r(n(1072),t),r(n(7259),t),r(n(8284),t),r(n(1017),t),r(n(1370),t),r(n(1216),t),r(n(8131),t)},8152:function(e,t,n){\"use strict\";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!(\"get\"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)\"default\"===n||Object.prototype.hasOwnProperty.call(t,n)||i(t,e,n)};Object.defineProperty(t,\"__esModule\",{value:!0}),r(n(7395),t),r(n(8920),t),r(n(4835),t),r(n(9421),t),r(n(9362),t),r(n(7980),t),r(n(2286),t),r(n(3253),t),r(n(8770),t),r(n(1072),t)},3253:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.scaleHeight=t.getFeatureText=t.getFeatureName=t.getFeatureId=t.getProjectionName=t.getProjection=t.GeometryType=t.getArrayConstructor=void 0;const i=n(2616),r=n(1984),o=n(3561);function s(e,t,n){var i;let r;if(void 0===t&&(t=\"name\"),void 0!==n)for(const o of n)if(r=null!==(i=e.lookup(`${t}:${o}
947`))&&void 0!==i?i:e.lookup(`${t}_${o}`),\"string\"==typeof r&&r.length>0)return r;if(r=e.lookup(t),\"string\"==typeof r)return r}var a;t.getArrayConstructor=function(e){switch(e){case\"float\":return Float32Array;case\"uint8\":return Uint8Array;case\"uint16\":return Uint16Array;case\"uint32\":return Uint32Array;case\"int8\":return Int8Array;case\"int16\":return Int16Array;case\"int32\":return Int32Array}},(a=t.GeometryType||(t.GeometryType={}))[a.Unspecified=0]=\"Unspecified\",a[a.Point=1]=\"Point\",a[a.Line=2]=\"Line\",a[a.SolidLine=3]=\"SolidLine\",a[a.Text=4]=\"Text\",a[a.TextPath=5]=\"TextPath\",a[a.ExtrudedLine=6]=\"ExtrudedLine\",a[a.Polygon=7]=\"Polygon\",a[a.ExtrudedPolygon=8]=\"ExtrudedPolygon\",a[a.Object3D=9]=\"Object3D\",a[a.Other=1e3]=\"Other\",t.getProjection=function(e){switch(e){case\"mercator\":return i.mercatorProjection;case\"webMercator\":return i.webMercatorProjection;case\"sphere\":return i.sphereProjection;case\"normalizedEquirectangular\":return i.normalizedEquirectangularProjection;case\"equirectangular\":return i.equirectangularProjection;default:throw new Error(`Unknown projection ${e}`)}},t.getProjectionName=function(e){if(e===i.mercatorProjection)return\"mercator\";if(e===i.webMercatorProjection)return\"webMercator\";if(e===i.sphereProjection)return\"sphere\";if(e===i.normalizedEquirectangularProjection)return\"normalizedEquirectangular\";if(e===i.equirectangularProjection)return\"equirectangular\";throw new Error(\"Unknown projection\")},t.getFeatureId=function(e){if(void 0===e)return 0;if(\"string\"==typeof e||\"number\"==typeof e)return e;if(e.hasOwnProperty(\"$id\")){const t=e.$id;if(\"string\"==typeof t||\"number\"==typeof t)return t}return 0},t.getFeatureName=s,t.getFeatureText=function(e,t,n){const i=e instanceof r.Env?e:e.env;if((0,r.isTextTechnique)(t)||(0,r.isIconTextTechnique)(t)||(0,r.isLineMarkerTechnique)(t)){if(void 0!==t.text)return(0,o.evaluateTechniqueAttr)(e,t.text);if((0,r.isIconTextTechnique)(t)||(0,r.isLineMarkerTechnique)(t))return}return s(i,\"name\",n)},t.scaleHeight=function(e,t,n){return!(0,o.evaluateTechniqueAttr)(e,t.constantHeight,n<12)}},1072:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.isFeatureGeometry=void 0,t.isFeatureGeometry=function(e){const t=e.type;return\"Point\"===t||\"MultiPoint\"===t||\"LineString\"===t||\"MultiLineString\"===t||\"Polygon\"===t||\"MultiPolygon\"===t}},6406:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0})},7980:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0})},2286:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0})},6114:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.addPolygonEdges=void 0;const i=n(82),r=new i.Vector2,o=new i.Vector2,s=new i.Vector2,a=new i.Vector2;t.addPolygonEdges=function(e,t,n,i,l,c,u,h){for(let d=0;d<l.length;++d)if(l[d])if(!0===c){const c=t+2*d,p=c+1,f=t+(d+1)%l.length*2,m=f+1;!0===u&&e.push(c,f),e.push(p,m);const g=(0===d?l.length:d)-1;if(l[g])if(void 0!==h){const t=i[d*n],u=i[d*n+1],f=i[(d+1)%l.length*n],m=i[(d+1)%l.length*n+1];r.set(t,u),o.set(f,m),s.set(i[g*n],i[g*n+1]),a.set(r.x,r.y),a.sub(s).normalize().dot(o.sub(r).normalize())<=h&&e.push(c,p)}else e.push(c,p)}else{const n=t+d,i=t+(d+1)%l.length;e.push(n,i)}}},7395:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0})},8920:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.getPropertyValue=void 0;const i=n(1984),r=n(4342).LoggerManager.instance.create(\"PropertyValue\");t.getPropertyValue=function(e,t,n){try{return(0,i.getPropertyValue)(e,t,n)}catch(t){return r.error(\"failed to evaluate expression\",JSON.stringify(e),\"error\",String(t)),null}}},5185:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.makeDecodedTechnique=t.StyleSetEvaluator=void 0;const i=n(1984),r=n(8023),o=n(8797),s=n(8628),a=n(4342),l=n(5535),c=a.LoggerManager.instance.create(\"StyleSetEvaluator\"),u=l.AttrScope.TechniqueGeometry;class h{classify(e){if(e._whenExpr){const t=this.switchStyle(e);e._whenExpr=e._whenExpr.accept(this,void 0),this._style=t}}visitNullLiteralExpr(e,t){return e}visitBooleanLiteralExpr(e,t){return e}visitNumberLiteralExpr(e,t){return e}visitStringLiteralExpr(e,t){return e}visitObjectLiteralExpr(e,t){return e}
947visitVarExpr(e,t){return e}visitHasAttributeExpr(e,t){return e}visitMatchExpr(e,t){return e}visitCaseExpr(e,t){return e}visitCallExpr(e,t){if(\"all\"===e.op){const t=e.args.map((t=>t.accept(this,e))).filter((e=>void 0!==e));return new r.CallExpr(e.op,t)}if(t){const t=this.matchVarStringComparison(e);if(t){if(void 0===this._style.dataLayer&&\"$layer\"===t.name)return void(this._style.dataLayer=t.value);if(void 0===this._style._geometryType&&\"$geometryType\"===t.name)return void(this._style._geometryType=t.value)}}return e}visitLookupExpr(e,t){return this.visitCallExpr(e,t)}visitStepExpr(e,t){return e}visitInterpolateExpr(e,t){return e}matchVarStringComparison(e){if(\"==\"===e.op){const t=e.args[0],n=e.args[1];if(t instanceof r.VarExpr&&n instanceof r.StringLiteralExpr)return{name:t.name,value:n.value};if(n instanceof r.VarExpr&&t instanceof r.StringLiteralExpr)return{name:n.name,value:t.value}}}switchStyle(e){const t=this._style;return this._style=e,t}}class d{constructor(e,t){this.key=\"\",this.set(e,t)}set(e,t,n){let i=!1;if(void 0===e){const t=void 0!==n?n.lookup(\"$layer\"):void 0;e=\"string\"==typeof t?t:void 0}if(this.layer!==e&&(this.layer=e,i=!0),void 0===t){const e=void 0!==n?n.lookup(\"$geometryType\"):void 0;t=\"string\"==typeof e?e:void 0}return this.geometryType!==t&&(this.geometryType=t,i=!0),i&&this.updateKey(),this}updateKey(){void 0!==this.layer?void 0!==this.geometryType?this.key=`${this.layer}:${this.geometryType}`:this.key=`${this.layer}:`:void 0!==this.geometryType?this.key=`:${this.geometryType}`:this.key=\"all\",this.cachedStyleSet=void 0}}function p(e){const t={};for(const n in e){if(!e.hasOwnProperty(n))continue;let i=e[n];\"object\"==typeof i&&(i.isVector2||i.isVector3||i.isVector4)&&(i=r.LiteralExpr.fromValue(i)),r.Expr.isExpr(i)&&(i=i.toJSON()),t[
947n]=i}return t}t.StyleSetEvaluator=class{constructor(e){this.m_options=e,this.styleSet=[],this.m_techniques=[],this.m_exprPool=new o.ExprPool,this.m_cachedResults=new Map,this.m_styleConditionClassifier=new h,this.m_subStyleSetCache=new Map,this.m_areCurrentDefinitionsOverridden=!0,this.m_definitionsContainVerbose=!1,this.m_disabledStyles={byId:new Set,byLayer:new Set},this.m_definitionExprCache=new Map,this.m_tmpOptimizedSubSetKey=new d,this.m_emptyEnv=new i.Env,this.m_featureDependencies=[\"$layer\",\"$geometryType\",\"$zoom\"],this.m_nextArrayBufferId=0,this.m_definitions=this.m_options.definitions;for(const e in this.m_definitions)this.m_definitionsContainVerbose||(this.m_definitionsContainVerbose=(0,i.isVerboseDefinition)(this.m_definitions[e]));this.styleSet=this.m_options.styleSet.map((e=>{const t=Object.assign(Object.assign({},e),{_forceCompile:!0});return e.attr&&(t.attr=Object.assign({},e.attr)),t})),function(e){var t;let n=0,i=0;for(const r of e)r._styleIndex=i++,void 0!==r.technique&&void 0===(null===(t=r.attr)||void 0===t?void 0:t.renderOrder)&&(void 0===r.attr?r.attr={renderOrder:n++}:r.attr.renderOrder=n++)}(this.styleSet),this.m_features=this.validateFeatures(this.m_options.features);const t=[];for(const e in this.m_features)this.m_features[e].modes.forEach((e=>{e.extendedDefinitions&&Array.prototype.push.apply(t,Object.keys(e.extendedDefinitions))}));this.m_modesDefinitions=new Set(t),this.setEnabledFeatures(e.enabledFeatures)}setEnabledFeatures(e){this.applyFeaturesAndModes(null!=e?e:this.getFeaturesEnabledByDefault())}getFeaturesEnabledByDefault(){var e;const t=[];if(this.m_features)for(const n in this.m_features){const i=this.m_features[n];i.enabledByDefault&&t.push({feature:n,mode:null===(e=i.modes[0])||void 0===e?void 0:e.name})}return t}applyFeaturesAndModes(e){if(this.m_disabledStyles.byId.clear(),this.m_disabledStyles.byLayer.clear(),this.resetTechniques(),this.m_areCurrentDefinitionsOverrid
947den&&(this.m_definitionsContainVerbose?this.m_currentDefinitions=JSON.parse(JSON.stringify(this.m_definitions)):this.m_currentDefinitions=Object.assign({},this.m_definitions),this.m_areCurrentDefinitionsOverridden=!1),this.m_features)for(const t in this.m_features){const n=this.m_features[t];let i;const r=e.find((e=>e.feature===t));r?(i=n.modes.find((e=>e.name===r.mode)),i||(i=n.modes[0])):i=n.disabledMode,i.disabledLayers&&i.disabledLayers.forEach((e=>{this.m_disabledStyles.byLayer.add(e)})),i.disabledStyleRules&&i.disabledStyleRules.forEach((e=>{this.m_disabledStyles.byId.add(e)})),this.m_currentDefinitions&&(null==i?void 0:i.extendedDefinitions)&&(this.m_areCurrentDefinitionsOverridden=!0,Object.assign(this.m_currentDefinitions,null==i?void 0:i.extendedDefinitions))}this.m_definitionExprCache.clear(),this.m_cachedResults.clear(),this.m_subStyleSetCache.clear(),this.compileStyleSet()}validateFeatures(e){const t={};for(const n in e){const i=e[n];Array.isArray(i.modes)&&0!==i.modes.length&&void 0!==i.disabledMode?t[n]=i:c.error(`The style configuration is invalid. The feature \"${n}\" must be an array, have at least one mode and specify a value for disabledMode property`)}if(Object.keys(t).length>0)return t}isStyleDisabled(e){if(void 0!==this.m_disabledStyles){if(void 0!==e.layer&&this.m_disabledStyles.byLayer.has(e.layer))return!0;if(void 0!==e.id&&this.m_disabledStyles.byId.has(e.id))return!0}return!1}getMatchingTechniques(e,t,n){if(this.m_previousResult&&this.m_previousEnv&&this.m_featureDependencies.every((t=>{var n;return(null===(n=this.m_previousEnv)||void 0===n?void 0:n.lookup(t))===e.lookup(t)})))return this.m_previousResult;const i=[];this.m_cachedResults.clear();const r=this.m_tmpOptimizedSubSetKey;r.set(t,n,e),this.m_dataLayer=r.layer,this.m_geometryType=r.geometryType,this.m_zoomLevel=e.lookup(\"$zoom\");const o=this.getOptimizedStyleSet(r);for(const t of o)if(this.processStyle(e,t,i))break;return this.m_previousResult=i,this.m_previousEnv=e,i}wantsDataLayer(e){return this.getOptimizedStyleSet(this.m_tmpOptimizedSubSetKey.set(e,void 0)).length>0}wantsFeature(e,t){return this.getOptimizedStyleSet(this.m_tmpOptimizedSubSetKey.set(e,t)).length>0}resetTechniques(){for(const e of this.m_techniques)e._index=void 0;this.m_techniques.length=0,this.m_previousResult=void 0,this.m_previousEnv=void 0}get techniques(){return this.m_techniques}get decodedTechniques(){return this.m_techniques.map(p)}getOptimizedStyleSet(e){if(void 0!==e.cachedStyleSet)return e.cachedStyleSet;let t=this.m_subStyleSetCache.get(e.key);return void 0!==t?(e.cachedStyleSet=t,t):(t=this.createPreFilteredStyleSet(e),this.m_subStyleSetCache.set(e.key,t),e.cachedStyleSet=t,t)}createPreFilteredStyleSet(e){const{layer:t,geometryType:n}=e;return this.styleSet.filter((e=>!(void 0!==t&&void 0!==e.dataLayer&&e.dataLayer!==t||void 0!==n&&void 0!==e._geometryType&&e._geometryType!==n)))}compileStyleSet(){this.styleSet.forEach((e=>this.compileStyle(e))),this.styleSet.forEach((e=>{this.getOptimizedStyleSet(this.m_tmpOptimizedSubSetKey.set(e.dataLayer,e._geometryType))}))}compileStyle(e){var t,n;try{this.compileStyleAttributes(e)}catch(t){c.error(\"failed to evaluate style rule\",e,String(t))}if(void 0!==e.when)try{e._whenExpr=r.Expr.fromJSON(e.when,this.m_currentDefinitions,this.m_definitionExprCache),this.m_styleConditionClassifier.classify(e),void 0!==e._whenExpr&&(e._whenExpr=e._whenExpr.intern(this.m_exprPool));const o=e._whenExpr.dependencies();null==o||o.properties.forEach((e=>{this.m_featureDependencies.includes(e)||this.m_featureDependencies.push(e)})),(0,i.isJsonExpr)(null===(t=e.attr)||void 0===t?void 0:t.minZoomLevel)&&(e._minZoomLevelExpr=r.Expr.fromJSON(e.attr.minZoomLevel,this.m_currentDefinitions).intern(this.m_exprPool)),(0,i.isJsonExpr)(null===(n=e.attr)||void 0===n?void 0:n.maxZoomLevel)&&(e._maxZoomLevelExpr=r.Expr.fromJSON(e.attr.maxZoomLevel,this.m_currentDefinitions).intern(this.m_exprPool))}catch(t){c.error(\"failed to evaluate expression\",JSON.stringify(e.when),String(t))}}processStyle(e,t,n){if(!this.checkZoomLevel(e,t))return!1;if(this.isStyleDisabled(t))return!1;if(void 0!==this.m_dataLayer&&void 0!==t.dataLayer&&t.dataLayer!==this.m_dataLayer)return!1;if(void 0!==this.m_geometryType&&void 0!==t._geometryType&&t._geometryType!==this.m_geometryType)return!1;if(t._whenExpr)try{if(!t._whenExpr.evaluate(e,r.ExprScope.Condition,this.m_cachedResults))return!1}catch(e){return c.error(`failed to evaluate expression '${JSON.stringify(t.when)}': ${e}`),!1}return void 0!==t.technique&&(\"none\"!==t.technique&&n.push(this.getTechniqueForStyleMatch(e,t)),!0===t.final)}checkZoomLevel(e,t){var n,i,o,s,a;const l=this.m_zoomLevel;if(void 0===l||l>=17)return!0;let u=null===(n=t.attr)||void 0===n?void 0:n.minZoomLevel,h=null===(i=t.attr)||void 0===i?void 0:i.maxZoomLevel;if(void 0===u&&void 0===h)return!0;
947if(void 0!==u){if(!1===(null===(o=t._minZoomLevelExpr)||void 0===o?void 0:o.isDynamic()))try{u=t._minZoomLevelExpr.evaluate(e,r.ExprScope.Condition,this.m_cachedResults)}catch(e){c.error(`failed to evaluate expression '${JSON.stringify(t._minZoomLevelExpr)}': ${e}`)}if(\"number\"==typeof u&&l<Math.floor(u))return!1}if(void 0!==(null===(s=t.attr)||void 0===s?void 0:s.maxZoomLevel)){if(!1===(null===(a=t._maxZoomLevelExpr)||void 0===a?void 0:a.isDynamic()))try{h=t._maxZoomLevelExpr.evaluate(e,r.ExprScope.Condition,this.m_cachedResults)}catch(e){c.error(`failed to evaluate expression '${JSON.stringify(t._maxZoomLevelExpr)}': ${e}`)}if(\"number\"==typeof h&&l>=Math.ceil(h))return!1}return!0}getTechniqueForStyleMatch(e,t){let n;if(void 0!==t._dynamicTechniques){const i=this.evaluateTechniqueProperties(t,e),r=this.getDynamicTechniqueKey(t,i);n=t._dynamicTechniques.get(r),void 0===n&&(n=this.createTechnique(t,i),t._dynamicTechniques.set(r,n))}else n=t._staticTechnique,void 0===n&&(t._staticTechnique=n=this.createTechnique(t,[]));return void 0===n._index&&(n._index=this.m_techniques.length,this.m_techniques.push(n)),n}getDynamicTechniqueKey(e,t){const n=t.map((([e,t])=>void 0===t?\"U\":\"object\"==typeof t?JSON.stringify(t,((e,t)=>{if(t instanceof ArrayBuffer){let e=t.id;return void 0===e&&(e=t.id=this.m_nextArrayBufferId++),e}return t})):JSON.stringify(t))).join(\":\");return`${e._styleIndex}:${n}`}compileStyleAttributes(e){var t;if(!e._forceCompile&&(void 0!==e._dynamicTechniqueAttributes||\"none\"===e.technique))return;e._dynamicTechniqueAttributes=[],e._dynamicFeatureAttributes=[],e._dynamicForwardedAttributes=[],e._staticAttributes=[],e._staticTechnique=void 0,e._dynamicTechniques=void 0;const n=e._dynamicFeatureAttributes,o=e._dynamicTechniqueAttributes,a=e._dynamicForwardedAttributes,h=e._staticAttributes,d=(t,d)=>{if(void 0===d)return;const p=new Set;if((0,i.isJsonExpr)(d)?d=r.Expr.fromJSON(d,this.m_currentDefinitions,this.m_definitionExprCache,p).intern(this.m_exprPool):(0,s.isInterpolatedPropertyDefinition)(d)&&(d=r.Expr.fromJSON((0,s.interpolatedPropertyDefinitionToJsonExpr)(d)).intern(this.m_exprPool)),r.Expr.isExpr(d)){const n=d.dependencies();n.featureState&&(\"enabled\"!==t?c.log(\"feature-state is not supported in this context\"):e._usesFeatureState=!0),0!==n.properties.size||d.isDynamic()||(d=d.evaluate(this.m_emptyEnv))}if(r.Expr.isExpr(d)){const i=function(e,t){var n,i,r;return\"extruded-polygon\"===e.technique&&\"color\"===t&&!1!==(null===(n=e.attr)||void 0===n?void 0:n.vertexColors)?u:null!==(r=null===(i=(0,l.getTechniqueAttributeDescriptor)(e.technique,t))||void 0===i?void 0:i.scope)&&void 0!==r?r:u}(e,t),r=d.dependencies();switch(r.properties.forEach((e=>{this.m_featureDependencies.includes(e)||this.m_featureDependencies.push(e)})),i){case l.AttrScope.FeatureGeometry:n.push([t,d]);break;case l.AttrScope.TechniqueGeometry:o.push([t,d]);break;case l.AttrScope.TechniqueRendering:0===r.properties.size?a.push([t,d]):o.push([t,d])}}else null!=d&&h.push([t,d]);for(const t of p.values())if(this.m_modesDefinitions.has(t)){e._forceCompile=!0;break}};e._forceCompile=!1;for(const t in e)e.hasOwnProperty(t)&&(t.startsWith(\"_\")||[\"when\",\"technique\",\"layer\",\"attr\",\"category\",\"description\"].includes(t)||d(t,e[t]));const p=new Map([[\"category\",\"_category\"]]);if(void 0!==e.attr)for(const n in e.attr)e.attr.hasOwnProperty(n)&&d(null!==(t=p.get(n))&&void 0!==t?t:n,e.attr[n]);o.length>0&&(e._dynamicTechniques=new Map)}evaluateTechniqueProperties(e,t){return void 0===e._dynamicTechniqueAttributes?[]:e._dynamicTechniqueAttributes.map((([e,n])=>{try{return[e,n.evaluate(t,r.ExprScope.Value,this.m_cachedResults)]}catch(t){return c.error(`failed to evaluate expression '${n.toJSON()}': ${t}`),[e,null]}}))}createTechnique(e,t){var n,r;const o={};if(o.name=e.technique,void 0!==e._staticAttributes)for(const[t,n]of e._staticAttributes)null!==n&&(o[t]=n);for(const[e,n]of t)null!==n&&(o[e]=n);if(void 0!==e._dynamicFeatureAttributes)for(const[t,n]of e._dynamicFeatureAttributes)o[t]=n;if(void 0!==e._dynamicForwardedAttributes)for(const[t,n]of e._dynamicForwardedAttributes)o[t]=n;return o._index=this.m_techniques.length,o._styleIndex=e._styleIndex,void 0!==e.layer&&(o._layer=e.layer),void 0!==e._usesFeatureState&&(o._usesFeatureState=e._usesFeatureState),(0,i.setTechniqueRenderOrderOrPriority)(o,null!==(n=this.m_options.priorities)&&void 0!==n?n:[],null!==(r=this.m_options.labelPriorities)&&void 0!==r?r:[]),this.m_techniques.push(o),o}},t.makeDecodedTechnique=p},3561:(e,t,n)=>{\"use strict\";
947Object.defineProperty(t,\"__esModule\",{value:!0}),t.evaluateTechniqueAttr=void 0;const i=n(1984),r=n(8920);t.evaluateTechniqueAttr=function(e,t,n){if(void 0===t)return n;const o=i.Env.isEnv(e)?(0,r.getPropertyValue)(t,e):(0,r.getPropertyValue)(t,e.env,e.cachedExprResults);return null!=o?o:n}},5535:(e,t)=>{\"use strict\";var n;function i(...e){const t={attrDescriptors:{}};for(const n of e)void 0!==n.attrTransparencyColor&&(t.attrTransparencyColor=n.attrTransparencyColor),void 0!==n.attrDescriptors&&(t.attrDescriptors=Object.assign(Object.assign({},t.attrDescriptors),n.attrDescriptors));return t}Object.defineProperty(t,\"__esModule\",{value:!0}),t.getTechniqueAutomaticAttrs=t.getTechniqueAttributeDescriptor=t.getTechniqueDescriptor=t.AttrScope=void 0,function(e){e[e.FeatureGeometry=0]=\"FeatureGeometry\",e[e.TechniqueGeometry=1]=\"TechniqueGeometry\",e[e.TechniqueRendering=2]=\"TechniqueRendering\"}(n=t.AttrScope||(t.AttrScope={}));const r={attrTransparencyColor:\"color\",attrDescriptors:{constantHeight:n.FeatureGeometry,enabled:n.FeatureGeometry,fadeFar:n.TechniqueRendering,fadeNear:n.TechniqueRendering,transparent:{scope:n.TechniqueRendering,automatic:!0},side:{scope:n.TechniqueRendering,automatic:!0}}},o=i(r,{attrDescriptors:{color:{scope:n.TechniqueRendering,automatic:!0},size:{scope:n.TechniqueRendering,automatic:!0},opacity:{scope:n.TechniqueRendering,automatic:!0}}}),s=i(r,o),a=i(r,o),l=i(r,{attrDescriptors:{text:n.FeatureGeometry,imageTexture:n.FeatureGeometry,iconColor:n.TechniqueRendering,iconBrightness:n.TechniqueRendering,textBrightness:n.TechniqueRendering,backgroundColor:n.TechniqueRendering,backgroundSize:n.TechniqueRendering,backgroundOpacity:n.TechniqueRendering,color:n.TechniqueRendering,opacity:n.TechniqueRendering,size:n.TechniqueRendering,priority:n.TechniqueRendering,zOrder:n.TechniqueRendering,margin:n.TechniqueRendering,\"check-margin\":n.TechniqueRendering,\"anchor-point-density\":n.TechniqueRendering}}),c={attrDescriptors:{polygonOffset:{scope:n.TechniqueRendering,automatic:!0},polygonOffsetFactor:{scope:n.TechniqueRendering,automatic:!0},polygonOffsetUnits:{scope:n.TechniqueRendering,automatic:!0},depthTest:{scope:n.TechniqueRendering,automatic:!0},transparent:{scope:n.TechniqueRendering,automatic:!0},opacity:{scope:n.TechniqueRendering,automatic:!0},color:{scope:n.TechniqueRendering,automatic:!0},lineColor:n.TechniqueRendering,lineFadeFar:n.TechniqueRendering,lineFadeNear:n.TechniqueRendering}},u=i(r,c,{attrDescriptors:{width:n.TechniqueRendering,cap:{scope:n.TechniqueRendering,automatic:!0},drawRangeStart:{scope:n.TechniqueRendering,automatic:!0},drawRangeEnd:{scope:n.TechniqueRendering,automatic:!0},dashes:{scope:n.TechniqueRendering,automatic:!0},dashColor:{scope:n.TechniqueRendering,automatic:!0},\"dash-pattern\":{scope:n.TechniqueRendering,automatic:!0},\"dash-image\":{scope:n.TechniqueRendering,automatic:!0}}}),h=i(r,{attrDescriptors:{color:{scope:n.TechniqueRendering,automatic:!0},opacity:{scope:n.TechniqueRendering,automatic:!0},width:n.FeatureGeometry}}),d=i(r,c,{attrDescriptors:{wireframe:{scope:n.TechniqueRendering,automatic:!0},color:{scope:n.TechniqueRendering,automatic:!0},opacity:{scope:n.TechniqueRendering,automatic:!0},transparent:{scope:n.TechniqueRendering,automatic:!0},lineWidth:n.TechniqueRendering,map:{scope:n.TechniqueRendering,automatic:!0}}}),p=i(r,{attrDescriptors:{color:{scope:n.TechniqueRendering,automatic:!0},vertexColors:{scope:n.TechniqueRendering,automatic:!0},wireframe:{scope:n.TechniqueRendering,automatic:!0},roughness:{scope:n.TechniqueRendering,automatic:!0},metalness:{scope:n.TechniqueRendering,automatic:!0},alphaTest:{scope:n.TechniqueRendering,automatic:!0},depthTest:{scope:n.TechniqueRendering,automatic:!0},transparent:{scope:n.TechniqueRendering,automatic:!0},opacity:{scope:n.TechniqueRendering,automatic:!0},emissive:{scope:n.TechniqueRendering,automatic:!0},emissiveIntensity:{scope:n.TechniqueRendering,automatic:!0},refractionRatio:{scope:n.TechniqueRendering,automatic:!0},normalMapType:{scope:n.TechniqueRendering,automatic:!0},map:{scope:n.TechniqueRendering,automatic:!0},normalMap:{scope:n.TechniqueRendering,automatic:!0},displacementMap:{scope:n.TechniqueRendering,automatic:!0},roughnessMap:{scope:n.TechniqueRendering,automatic:!0},emissiveMap:{scope:n.TechniqueRendering,automatic:!0},bumpMap:{scope:n.TechniqueRendering,automatic:!0},metalnessMap:{scope:n.TechniqueRendering,automatic:!0},alphaMap:{scope:n.TechniqueRendering,automatic:!0}}}),f={\"extruded-polygon\":i(r,{attrDescriptors:{depthTest:{scope:n.TechniqueRendering,automatic:!0},vertexColors:{scope:n.TechniqueRendering,automatic:!0},opacity:{scope:n.TechniqueRendering,automatic:!0},color:{scope:n.TechniqueRendering,automatic:!0},colorIntensity:{scope:n.TechniqueRendering,automatic:!0},specular:{scope:n.TechniqueRendering,automatic:!0},emissive:{scope:n.TechniqueRendering,automatic:!0},emissiveIntensity:{scope:n.TechniqueRendering,automatic:!0},shininess:{scope:n.TechniqueRendering,automatic:!0},displacementMap:{scope:n.TechniqueRendering,automatic:!0},height:n.FeatureGeometry,floorHeight:n.FeatureGeometry,defaultColor:n.FeatureGeometry,defaultHeight:n.FeatureGeometry,boundaryWalls:n.FeatureGeometry,footprint:n.FeatureGeometry,maxSlope:n.FeatureGeometry,animateExtrusion:n.TechniqueRendering,lineWidth:n.TechniqueRendering,lineFadeNear:n.TechniqueRendering,lineFadeFar:n.TechniqueRendering,lineColor:n.TechniqueRendering}}),\"line-marker\":l,\"labeled-icon\":l,\"solid-line\":u,\"dashed-line\":u,terrain:p,standard:p,squares:s,circles:a,line:h,segments:h,polygon:d,text:i(r,{attrDescriptors:{text:n.FeatureGeometry,backgroundColor:n.TechniqueRendering,backgroundSize:n.TechniqueRendering,backgroundOpacity:n.TechniqueRendering,color:n.TechniqueRendering,opacity:n.TechniqueRendering,size:n.TechniqueRendering,priority:n.TechniqueRendering,zOrder:n.TechniqueRendering}}),raster:i(r,{attrDescriptors:{brightness:{scope:n.TechniqueRendering,automatic:!0},gamma:{scope:n.TechniqueRendering,automatic:!0}}})};function m(e){return\"string\"!=typeof e&&(e=e.name),f[e]}t.getTechniqueDescriptor=m,t.getTechniqueAttributeDescriptor=function(e,t){const n=m(e),i=null==n?void 0:n.attrDescriptors,r=null==i?void 0:i[t];if(void 0!==typeof r)return\"object\"==typeof r?r:{scope:r}};const g=new Map;t.getTechniqueAutomaticAttrs=function(e){var t;if(\"string\"!=typeof e&&(e=e.name),g.has(e))return g.get(e);const n=[],i=null===(t=m(e))||void 0===t?void 0:t.attrDescriptors;if(void 0===i)return n;for(const e in i){if(!i.hasOwnProperty(e))continue;const t=i[e];void 0!==t&&\"number\"!=typeof t&&!0===t.automatic&&n.push(e)}return g.set(e,n),n}},8934:(e,t,n)=>{\"use strict\";
947Object.defineProperty(t,\"__esModule\",{value:!0}),t.ThreeBufferUtils=void 0;const i=n(3253);!function(e){function t(e){if(e instanceof Int8Array)return\"int8\";if(e instanceof Uint8Array)return\"uint8\";if(e instanceof Int16Array)return\"int16\";if(e instanceof Uint16Array)return\"uint16\";if(e instanceof Int32Array)return\"int32\";if(e instanceof Uint32Array)return\"uint32\";if(e instanceof Float32Array)return\"float\";throw new Error(`Unsupported buffer type ${name}`)}function n(e){const n=e.array;return{name:e.name,buffer:n.buffer,type:t(n),itemCount:e.itemSize,normalized:e.normalized}}e.getBufferElementType=t,e.fromThreeBufferAttribute=n,e.fromThreeInterleavedBufferAttribute=function(e){throw new Error(\"Not implemented yet\")},e.fromThreeBufferGeometry=function(e,t){const r=[],o=Object.getOwnPropertyNames(e.attributes);for(const t of o){const i=n(e.attributes[t]);i.name=t,r.push(i)}const s=null!==e.index?n(e.index):void 0;let a=0;if(void 0!==s)a=null===e.index?0:e.index.count;else{const t=e.attributes.position;if(void 0===t)throw new Error(\"Missing position attibute to deduce item count\");a=t.count}return{type:i.GeometryType.Unspecified,vertexAttributes:r,index:s,groups:[{start:0,count:a,technique:t}]}}}(t.ThreeBufferUtils||(t.ThreeBufferUtils={}))},8770:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0})},9362:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.WorkerDecoderProtocol=t.RequestController=void 0,t.RequestController=class{constructor(e=0,t=new AbortController){this.priority=e,this.abortController=t}get signal(){return this.abortController.signal}abort(){this.abortController.abort()}},function(e){let t,n;!function(e){e.Configuration=\"configuration\"}(t=e.DecoderMessageName||(e.DecoderMessageName={})),e.isConfigurationMessage=function(e){return e&&\"string\"==typeof e.service&&\"string\"==typeof e.type&&e.type===t.Configuration},function(e){e.DecodeTileRequest=\"decode-tile-request\",e.TileInfoRequest=\"tile-info-request\"}(n=e.Requests||(e.Requests={})),e.isDecodeTileRequest=function(e){return e&&\"string\"==typeof e.type&&e.type===n.DecodeTileRequest},e.isTileInfoRequest=function(e){return e&&\"string\"==typeof e.type&&e.type===n.TileInfoRequest}}(t.WorkerDecoderProtocol||(t.WorkerDecoderProtocol={}))},4835:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.WorkerServiceProtocol=void 0,function(e){let t,n;e.WORKER_SERVICE_MANAGER_SERVICE_ID=\"worker-service-manager\",function(e){e.Initialized=\"initialized\",e.Request=\"request\",e.Response=\"response\"}(t=e.ServiceMessageName||(e.ServiceMessageName={})),e.isInitializedMessage=function(e){return e&&\"string\"==typeof e.service&&\"string\"==typeof e.type&&e.type===t.Initialized},function(e){e.CreateService=\"create-service\",e.DestroyService=\"destroy-service\"}(n=e.Requests||(e.Requests={})),e.isUnknownServiceError=function(e){return e.message.includes(\"unknown targetServiceType requested: \")},e.isRequestMessage=function(e){return e&&\"string\"==typeof e.service&&\"string\"==typeof e.type&&e.type===t.Request},e.isResponseMessage=function(e){return e&&\"string\"==typeof e.service&&\"string\"==typeof e.type&&e.type===t.Response}}(t.WorkerServiceProtocol||(t.WorkerServiceProtocol={}))},9421:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.WorkerTilerProtocol=void 0,function(e){let t;!function(e){e.RegisterIndex=\"register-index\",e.UpdateIndex=\"update-index\",e.TileRequest=\"tile-request\"}(t=e.Requests||(e.Requests={})),e.isRegisterIndexRequest=function(e){return e&&\"string\"==typeof e.type&&e.type===t.RegisterIndex},e.isUpdateIndexRequest=function(e){return e&&\"string\"==typeof e.type&&e.type===t.UpdateIndex},e.isTileRequest=function(e){return e&&\"string\"==typeof e.type&&e.type===t.TileRequest}}(t.WorkerTilerProtocol||(t.WorkerTilerProtocol={}))},6112:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.wrapLineString=t.clipLineString=void 0;const i=n(82),r=n(2616),o=n(4342);class s{constructor(e,t,n,r,o){this.isInside=o,this.p0=new i.Vector2(e,t),this.p1=new i.Vector2(n,r)}inside(e){return this.isInside(e)}computeIntersection(e,t){const n=new i.Vector2;return o.Math2D.intersectLines(e.x,e.y,t.x,t.y,this.p0.x,this.p0.y,this.p1.x,this.p1.y,n),n}clipLine(e){const t=e,n=[];e=[],n.push(e);const i=t=>{0!==e.length&&e[e.length-1].equals(t)||e.push(t)};for(let r=0;r<t.length;++r){const o=t[r],s=r>0?t[r-1]:void 0;this.inside(o)?(void 0===s||this.inside(s)||(e.length>0&&(e=[],n.push(e)),i(this.computeIntersection(s,o))),i(o)):void 0!==s&&this.inside(s)&&i(this.computeIntersection(s,o))}return 0===n[n.length-1].length&&(n.length=n.length-1),n}clipLines(e){const t=[];return e.forEach((e=>{this.clipLine(e).forEach((e=>{t.push(e)}))})),t}}
947function a(e,t,n){for(const n of t)e=n.clipLines(e);const o=new i.Vector3,s=[];return e.forEach((e=>{if(0===e.length)return;const t=e.map((({x:e,y:t})=>{o.set(e,t,0);const i=r.webMercatorProjection.unprojectPoint(o);return i.longitude+=n,i}));s.push(t)})),s.length>0?s:void 0}t.clipLineString=function(e,t,n,i,r){const o=new s(t,n,t,r,(e=>e.x>t)),a=new s(t,r,i,r,(e=>e.y<r)),l=new s(i,r,i,n,(e=>e.x<i)),c=new s(i,n,t,n,(e=>e.y>n));let u=o.clipLine(e);return u=a.clipLines(u),u=l.clipLines(u),u=c.clipLines(u),u},t.wrapLineString=function(e){const t=new i.Vector3,n=[e.map((e=>{const{x:n,y:o}=r.webMercatorProjection.projectPoint(e,t);return new i.Vector2(n,o)}))];return{left:a(n,u,360),middle:a(n,c,0),right:a(n,h,-360)}};const l=r.EarthConstants.EQUATORIAL_CIRCUMFERENCE,c=[new s(0,l,0,0,(e=>e.x>0)),new s(l+0,0,l+0,l,(e=>e.x<l+0))],u=[new s(-l-0,l,-l-0,0,(e=>e.x>-l-0)),new s(0,0,0,l,(e=>e.x<0))],h=[new s(l-0,l,l-0,0,(e=>e.x>l-0)),new s(2*l+0,0,2*l+0,l,(e=>e.x<2*l+0))]},2982:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.clipPolygon=t.ClippingEdge=void 0;const i=n(82);class r{clipPolygon(e,t){const n=e;e=[];const i=t=>{const n=e[e.length-1];(!(null==n?void 0:n.equals(t))||!0===t.isClipped&&!(null==n?void 0:n.isClipped)||!t.isClipped&&!0===(null==n?void 0:n.isClipped))&&e.push(t)};for(let e=0;e<n.length;++e){const r=n[e],o=n[(e+n.length-1)%n.length];if(this.inside(r,t)){if(!this.inside(o,t)){const e=this.computeIntersection(o,r,t);e.isClipped=!0,i(e)}i(r)}else if(this.inside(o,t)){const e=this.computeIntersection(o,r,t);e.isClipped=!0,i(e)}}return e}}t.ClippingEdge=r;const o=[new class extends r{inside(e){return e.y>=0}computeIntersection(e,t){const{x:n,y:r}=e,{x:o,y:s}=t;return new i.Vector2((n*s-r*o)/-(r-s),0).round()}},new class extends r{inside(e,t){return e.x<=t}computeIntersection(e,t,n){const{x:r,y:o}=e,{x:s,y:a}=t;return new i.Vector2(n,(r*a-o*s-(o-a)*-n)/(r-s)).round()}},new class extends r{inside(e,t){return e.y<=t}computeIntersection(e,t,n){const{x:r,y:o}=e,{x:s,y:a}=t;return new i.Vector2((r*a-o*s-(r-s)*n)/-(o-a),n).round()}},new class extends r{inside(e){return e.x>=0}computeIntersection(e,t){const{x:n,y:r}=e,{x:o,y:s}=t;return new i.Vector2(0,(n*s-r*o)/(n-o)).round()}}];t.clipPolygon=function(e,t){if(0===e.length)return e;e[0].equals(e[e.length-1])||(e=[...e,e[0]]);for(const n of o)e=n.clipPolygon(e,t);return e.length<3?[]:e}},6525:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.EdgeLengthGeometrySubdivisionModifier=t.SubdivisionMode=void 0;const i=n(82),r=n(2616),o=n(4342),s=n(3386),a=[new i.Vector3,new i.Vector3];var l;!function(e){e[e.All=0]=\"All\",e[e.NoDiagonals=1]=\"NoDiagonals\"}(l=t.SubdivisionMode||(t.SubdivisionMode={}));class c extends s.SubdivisionModifier{constructor(e,t,n=l.All,i){super(),this.subdivision=e,this.geoBox=t,this.subdivisionMode=n,this.projection=i,(0,o.assert)(i.type===r.ProjectionType.Planar,\"EdgeLengthGeometrySubdivisionModifier only supports planar projections\");const s=i.projectPoint(t.northEast,a[0]),c=i.projectPoint(t.southWest,a[1]);this.m_projectedBox={min:{x:Math.min(s.x,c.x),y:Math.min(s.y,c.y),z:Math.min(s.z,c.z)},max:{x:Math.max(s.x,c.x),y:Math.max(s.y,c.y),z:Math.max(s.z,c.z)}},this.m_maxLengthX=(this.m_projectedBox.max.x-this.m_projectedBox.min.x)/e,this.m_maxLengthY=(this.m_projectedBox.max.y-this.m_projectedBox.min.y)/e,this.subdivisionMode===l.All&&(this.m_maxLengthX*=1.1,this.m_maxLengthY*=1.1),this.m_maxLength=Math.sqrt(this.m_maxLengthX*this.m_maxLengthX+this.m_maxLengthY*this.m_maxLengthY)}get maxLength(){return this.m_maxLength}get maxLengthX(){return this.m_maxLengthX}get maxLengthY(){return this.m_maxLengthY}shouldSplitTriangle(e,t,n){const i=this.shouldSplitEdge(e,t),r=this.shouldSplitEdge(t,n),o=this.shouldSplitEdge(n,e);if(!(i||r||o))return;const s=e.distanceTo(t),a=t.distanceTo(n),l=n.distanceTo(e),c=Math.max(i?s:0,r?a:0,o?l:0);if(s===c)return 0;if(a===c)return 1;if(l===c)return 2;throw new Error(\"Could not split triangle.\")}shouldSplitEdge(e,t){switch(this.subdivisionMode){case l.All:return e.y===t.y&&Math.abs(e.x-t.x)>this.m_maxLengthX||e.x===t.x&&Math.abs(e.y-t.y)>this.m_maxLengthY||e.distanceTo(t)>this.m_maxLength;case l.NoDiagonals:return e.y===t.y&&Math.abs(e.x-t.x)>this.m_maxLengthX||e.x===t.x&&Math.abs(e.y-t.y)>this.m_maxLengthY}}}t.EdgeLengthGeometrySubdivisionModifier=c}
947,6189:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.SphericalGeometrySubdivisionModifier=void 0;const i=n(82),r=n(2616),o=n(3386),s=[new i.Vector3,new i.Vector3,new i.Vector3];class a extends o.SubdivisionModifier{constructor(e,t=r.sphereProjection){super(),this.angle=e,this.projection=t}shouldSplitTriangle(e,t,n){const i=r.sphereProjection.reprojectPoint(this.projection,e,s[0]),o=r.sphereProjection.reprojectPoint(this.projection,t,s[1]),a=r.sphereProjection.reprojectPoint(this.projection,n,s[2]),l=i.angleTo(o),c=o.angleTo(a),u=a.angleTo(i),h=Math.max(l,Math.max(c,u));if(!(h<this.angle)){if(h===l)return 0;if(h===c)return 1;if(h===u)return 2;throw new Error(\"failed to split triangle\")}}}t.SphericalGeometrySubdivisionModifier=a},3386:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.SubdivisionModifier=void 0;const i=n(82),r=new i.Vector3,o=new i.Vector3,s=new i.Vector3;t.SubdivisionModifier=class{constructor(){}modify(e){const t=e.getAttribute(\"position\"),n=Array.from(t.array),i=e.getAttribute(\"uv\"),a=void 0!==i?Array.from(i.array):void 0,l=e.getAttribute(\"edge\"),c=void 0!==l?Array.from(l.array):void 0,u=e.getAttribute(\"wall\"),h=void 0!==u?Array.from(u.array):void 0,d=e.getIndex(),p=Array.from(d.array),f=new Map;function m(e,t){const i=`${Math.min(e,t)}_${Math.max(e,t)}`,l=f.get(i);if(void 0!==l)return l;r.set(n[3*e],n[3*e+1],n[3*e+2]),o.set(n[3*t],n[3*t+1],n[3*t+2]),s.lerpVectors(r,o,.5);const u=n.length/3;return n.push(...s.toArray()),f.set(i,u),void 0!==a&&(r.set(a[2*e],a[2*e+1],0),o.set(a[2*t],a[2*t+1],0),s.lerpVectors(r,o,.5),a.push(s.x,s.y)),void 0!==c&&(c[e]===t?(c.push(t),c[e]=u):c[t]===e?(c.push(e),c[t]=u):c.push(-1)),void 0!==h&&(h[e]===t?(h.push(t),h[e]=u):h[t]===e?(h.push(e),h[t]=u):h.push(-1)),u}const g=[];for(;p.length>=3;){const e=p.shift(),t=p.shift(),i=p.shift();switch(r.set(n[3*e],n[3*e+1],n[3*e+2]),o.set(n[3*t],n[3*t+1],n[3*t+2]),s.set(n[3*i],n[3*i+1],n[3*i+2]),this.shouldSplitTriangle(r,o,s)){case 0:{const n=m(e,t);p.push(e,n,i,n,t,i);break}case 1:{const n=m(t,i);p.push(e,t,n,e,n,i);break}case 2:{const n=m(i,e);p.push(e,t,n,n,t,i);break}case void 0:g.push(e,t,i);break;default:throw new Error(\"failed to subdivide the given geometry\")}}return t.array=t.array instanceof Float32Array?new Float32Array(n):new Float64Array(n),t.count=n.length/t.itemSize,t.needsUpdate=!0,e.setIndex(g),void 0!==a&&(i.array=new Float32Array(a),i.count=a.length/i.itemSize,i.needsUpdate=!0),void 0!==c&&(l.array=new Float32Array(c),l.count=c.length/l.itemSize,l.needsUpdate=!0),e}}},2616:function(e,t,n){\"use strict\";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);
947r&&!(\"get\"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)\"default\"===n||Object.prototype.hasOwnProperty.call(t,n)||i(t,e,n)};Object.defineProperty(t,\"__esModule\",{value:!0}),r(n(3068),t),r(n(5999),t),r(n(6306),t),r(n(4860),t),r(n(8248),t),r(n(9019),t),r(n(6482),t),r(n(7870),t),r(n(5610),t),r(n(1515),t),r(n(9686),t),r(n(5234),t),r(n(9885),t),r(n(7289),t),r(n(6322),t),r(n(9861),t),r(n(435),t),r(n(9447),t),r(n(7171),t),r(n(3424),t),r(n(4948),t),r(n(6541),t),r(n(7841),t),r(n(2801),t),r(n(6557),t),r(n(4490),t),r(n(2224),t),r(n(1635),t),r(n(1871),t),r(n(2953),t),r(n(1383),t),r(n(9264),t),r(n(58),t),r(n(7523),t),r(n(2683),t),r(n(2334),t)},3068:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.GeoBox=void 0;const i=n(82),r=n(4860);class o{static fromCoordinates(e,t){return new o(e,t)}static fromCenterAndExtents(e,t){return new o(new r.GeoCoordinates(e.latitude-t.latitudeSpan/2,e.longitude-t.longitudeSpan/2),new r.GeoCoordinates(e.latitude+t.latitudeSpan/2,e.longitude+t.longitudeSpan/2))}constructor(e,t){this.southWest=e,this.northEast=t,this.west>this.east&&(this.northEast.longitude+=360)}get minAltitude(){if(void 0!==this.southWest.altitude&&void 0!==this.northEast.altitude)return Math.min(this.southWest.altitude,this.northEast.altitude)}get maxAltitude(){if(void 0!==this.southWest.altitude&&void 0!==this.northEast.altitude)return Math.max(this.southWest.altitude,this.northEast.altitude)}get south(){return this.southWest.latitude}get north(){return this.northEast.latitude}get west(){return this.southWest.longitude}get east(){return this.northEast.longitude}get center(){const e=.5*(this.south+this.north),{west:t,east:n}=this,{minAltitude:i,altitudeSpan:o}=this;let s;if(void 0!==i&&void 0!==o&&(s=i+.5*o),t<=n)return new r.GeoCoordinates(e,.5*(t+n),s);let a=.5*(360+n+t);return a>360&&(a-=360),new r.GeoCoordinates(e,a,s)}get latitudeSpanInRadians(){return i.MathUtils.degToRad(this.latitudeSpan)}get longitudeSpanInRadians(){return i.MathUtils.degToRad(this.longitudeSpan)}get latitudeSpan(){return this.north-this.south}get altitudeSpan(){if(void 0!==this.maxAltitude&&void 0!==this.minAltitude)return this.maxAltitude-this.minAltitude}get longitudeSpan(){let e=this.northEast.longitude-this.southWest.longitude;return e<0&&(e+=360),e}get latitudeSpanInDegrees(){return this.latitudeSpan}get longitudeSpanInDegrees(){return this.longitudeSpan}contains(e){if(void 0===e.altitude||void 0===this.minAltitude||void 0===this.maxAltitude)return this.containsHelper(e);const t=this.minAltitude===this.maxAltitude,n=this.minAltitude===e.altitude,i=this.minAltitude<=e.altitude&&this.maxAltitude>e.altitude;return!!(t?n:i)&&this.containsHelper(e)}clone(){return new o(this.southWest.clone(),this.northEast.clone())}growToContain(e){this.southWest.latitude=Math.min(this.southWest.latitude,e.latitude),this.southWest.longitude=Math.min(this.southWest.longitude,e.longitude),this.southWest.altitude=void 0!==this.southWest.altitude&&void 0!==e.altitude?Math.min(this.southWest.altitude,e.altitude):void 0!==this.southWest.altitude?this.southWest.altitude:void 0!==e.altitude?e.altitude:void 0,this.northEast.latitude=Math.max(this.northEast.latitude,e.latitude),this.northEast.longitude=Math.max(this.northEast.longitude,e.longitude),this.northEast.altitude=void 0!==this.northEast.altitude&&void 0!==e.altitude?Math.max(this.northEast.altitude,e.altitude):void 0!==this.northEast.altitude?this.northEast.altitude:void 0!==e.altitude?e.altitude:void 0}containsHelper(e){if(e.latitude<this.southWest.latitude||e.latitude>=this.northEast.latitude)return!1;const{west:t,east:n}=this;let i=e.longitude;if(n>r.MAX_LONGITUDE)for(;i<t;)i+=360;if(i>n)for(;i>t+360;)i-=360;return i>=t&&i<n}}t.GeoBox=o},5999:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.isGeoBoxExtentLike=void 0,t.isGeoBoxExtentLike=function(e){return e&&\"object\"==typeof e&&\"number\"==typeof e.latitudeSpan&&\"number\"==typeof e.longitudeSpan}},680:(e,t,n)=>{\"use strict\";
947Object.defineProperty(t,\"__esModule\",{value:!0}),t.isGeoCoordLike=t.geoCoordLikeToGeoPointLike=t.geoCoordLikeToGeoCoordinatesLike=void 0;const i=n(6306),r=n(8248),o=n(7870);t.geoCoordLikeToGeoCoordinatesLike=function(e){return(0,i.isGeoCoordinatesLike)(e)?e:(0,o.isLatLngLike)(e)?{latitude:e.lat,longitude:e.lng}:{latitude:e[1],longitude:e[0]}},t.geoCoordLikeToGeoPointLike=function(e){return(0,r.isGeoPointLike)(e)?e:(0,o.isLatLngLike)(e)?[e.lng,e.lat]:[e.longitude,e.latitude]},t.isGeoCoordLike=function(e){return(0,i.isGeoCoordinatesLike)(e)||(0,o.isLatLngLike)(e)||!(0,r.isGeoPointLike)(e)}},4860:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.GeoCoordinates=t.MIN_LONGITUDE=t.MAX_LONGITUDE=t.MIN_LATITUDE=t.MAX_LATITUDE=void 0;const i=n(82),r=n(6306),o=n(8248),s=n(7870);t.MAX_LATITUDE=90,t.MIN_LATITUDE=-90,t.MAX_LONGITUDE=180,t.MIN_LONGITUDE=-180;const a=new i.Vector3,l=new i.Vector3;class c{static fromDegrees(e,t,n){return new c(e,t,n)}static fromRadians(e,t,n){return new c(i.MathUtils.radToDeg(e),i.MathUtils.radToDeg(t),n)}static fromLatLng(e){return new c(e.lat,e.lng)}static fromGeoPoint(e){return new c(e[1],e[0],e[2])}static fromObject(e){if((0,o.isGeoPointLike)(e))return c.fromGeoPoint(e);if((0,r.isGeoCoordinatesLike)(e))return c.fromDegrees(e.latitude,e.longitude,e.altitude);if((0,s.isLatLngLike)(e))return c.fromDegrees(e.lat,e.lng);throw new Error(\"Invalid input coordinate format.\")}static lerp(e,t,n,i=!1,r=!1){var o,s;if(i){if(e.lng<t.lng){const i=e.clone();return i.longitude+=360,this.lerp(t,i,1-n)}{const i=t.clone();return i.longitude+=360,this.lerp(e,i,n)}}const u=a.set(e.lat,e.lng,null!==(o=e.altitude)&&void 0!==o?o:0),h=l.set(t.lat,t.lng,null!==(s=t.altitude)&&void 0!==s?s:0);u.lerp(h,n);const d=new c(u.x,u.y,u.z);return r?d.normalized():d}constructor(e,t,n){this.latitude=e,this.longitude=t,this.altitude=n}get latitudeInRadians(){return i.MathUtils.degToRad(this.latitude)}get longitudeInRadians(){return i.MathUtils.degToRad(this.longitude)}get latitudeInDegrees(){return this.latitude}get longitudeInDegrees(){return this.longitude}get lat(){return this.latitude}get lng(){return this.longitude}isValid(){return!isNaN(this.latitude)&&!isNaN(this.longitude)}normalized(){let{latitude:e,longitude:t}=this;return isNaN(e)||isNaN(t)?this:((t<-180||t>180)&&(t=function(e,t){const n=e%360;return n<0==0?n:n+360}(t+180)-180),e=i.MathUtils.clamp(e,-90,90),new c(e,t,this.altitude))}equals(e){return this.latitude===e.latitude&&this.longitude===e.longitude&&this.altitude===e.altitude}copy(e){return this.latitude=e.latitude,this.longitude=e.longitude,this.altitude=e.altitude,this}clone(){return new c(this.latitude,this.longitude,this.altitude)}toLatLng(){return{lat:this.latitude,lng:this.longitude}}toGeoPoint(){return void 0!==this.altitude?[this.longitude,this.latitude,this.altitude]:[this.longitude,this.latitude]}minLongitudeSpanTo(e){const t=Math.min(this.longitude,e.longitude),n=Math.max(this.longitude,e.longitude);return Math.min(n-t,360+t-n)}}t.GeoCoordinates=c},6306:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.isGeoCoordinatesLike=void 0,t.isGeoCoordinatesLike=function(e){return e&&\"number\"==typeof e.latitude&&\"number\"==typeof e.longitude&&(\"number\"==typeof e.altitude||void 0===e.altitude)}},8248:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.isGeoPointLike=void 0,t.isGeoPointLike=function(e){if(Array.isArray(e)){const[t,n,i]=e;return\"number\"==typeof t&&\"number\"==typeof n&&(void 0===i||\"number\"==typeof i)}return!1}},6482:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.GeoPolygon=t.isAntimeridianCrossing=void 0;const i=n(82),r=n(3068),o=n(4860),s=n(680);function a(e,t){return Math.max(e,t)-Math.min(e,t)}function l(e,t){return e>0&&t<0&&a(e,t)>180}t.isAntimeridianCrossing=function(e,t){return Math.sign(e)===-Math.sign(t)&&a(e,t)>180},t.GeoPolygon=class{constructor(e,t=!1,n=!1){this.m_coordinates=e.map((e=>(0,s.geoCoordLikeToGeoCoordinatesLike)(e))),t&&this.sortCCW(),n&&this.wrapCoordinatesAround()}get coordinates(){return this.m_coordinates}getGeoBoundingBox(){const e=this.getCentroid();if(void 0===e)return r.GeoBox.fromCoordinates(this.coordinates[0],this.coordinates[0]);const{east:t,west:n}=this.getEastAndWest(e),{north:i,south:s}=this.getNorthAndSouth();return r.GeoBox.fromCoordinates(new o.GeoCoordinates(s,n),new o.GeoCoordinates(i,t))}getCentroid(){const e=this.getArea();if(0===e)return;let t,n=0,i=0,r=this.m_coordinates.length-1;
947return this.m_coordinates.forEach(((e,o)=>{const s=this.m_coordinates[r];t=e.latitude*s.longitude-s.latitude*e.longitude,n+=(e.latitude+s.latitude)*t,i+=(e.longitude+s.longitude)*t,r=o})),t=6*e,new o.GeoCoordinates(n/t,e<0?i/t-180:i/t)}sortCCW(){const e=this.getPolyAverageCenter();e&&this.m_coordinates.sort(((t,n)=>{const r=new i.Vector2(t.latitude-e.latitude,t.longitude-e.longitude).normalize();return new i.Vector2(n.latitude-e.latitude,n.longitude-e.longitude).normalize().angle()-r.angle()}))}wrapCoordinatesAround(){const e=this.m_coordinates.findIndex(((e,t)=>{const n=0===t?this.m_coordinates.length-1:t-1;return l(this.m_coordinates[n].longitude,e.longitude)}));if(e<0)return;let t=!0;for(let n=0;n<this.m_coordinates.length;n++){const i=(e+n)%this.m_coordinates.length,r=this.m_coordinates[i].longitude,o=this.m_coordinates[(i+1)%this.m_coordinates.length].longitude;t&&(this.m_coordinates[i].longitude+=360),l(o,r)?t=!1:l(r,o)&&(t=!0)}}getPolyAverageCenter(){const e=this.m_coordinates.reduce(((e,t)=>new o.GeoCoordinates(e.latitude+t.latitude,e.longitude+t.longitude)));return new o.GeoCoordinates(e.latitude/this.m_coordinates.length,e.longitude/this.m_coordinates.length)}getArea(){let e=0,t=this.m_coordinates.length-1;return this.m_coordinates.forEach(((n,i)=>{const r=this.m_coordinates[t];e+=n.latitude*r.longitude,e-=n.longitude*r.latitude,t=i})),e/=2}getEastAndWest(e){let t=e.longitude,n=e.longitude,r=this.m_coordinates.length-1;return this.m_coordinates.forEach(((o,s)=>{const a=this.m_coordinates[r];r=s;const l=new i.Vector2(o.latitude-e.latitude,o.longitude-e.longitude).normalize(),c=new i.Vector2(a.latitude-e.latitude,a.longitude-e.longitude).normalize();let u=1===Math.sign(c.angle()-l.angle());c.y>=0&&l.y<0&&(u=!0);const h=o.longitude;h<e.longitude?u?t=Math.min(t,h):n=Math.min(n,h):u?n=Math.max(n,h):t=Math.max(t,h)})),{east:n,west:t}}getNorthAndSouth(){let e=o.MIN_LATITUDE,t=o.MAX_LATITUDE;return this.m_coordinates.forEach(((n,i)=>{e=Math.max(e,n.latitude),t=Math.min(t,n.latitude)})),{north:e,south:t}}}},9019:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.isGeoPolygonLike=void 0;const i=n(680);t.isGeoPolygonLike=function(e){if(!e||!Array.isArray(e.coordinates)&&e.coordinates.length>2)return!1;let t=!0;return e.coordinates.forEach((n=>{(0,i.isGeoCoordLike)(e)||(t=!1)})),t}},7870:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.isLatLngLike=void 0,t.isLatLngLike=function(e){return e&&\"number\"==typeof e.lat&&\"number\"==typeof e.lng}},9264:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.isBox3Like=void 0,t.isBox3Like=function(e){const t=e;return void 0!==t.min&&void 0!==t.max}},7523:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.MathUtils=void 0;const i=n(82);!function(e){function t(e){return(e%=360)<0&&(e+=360),e}function n(e,n){const i=(e=t(e))-(n=t(n));return i>180?i-360:i<=-180?i+360:i}e.newEmptyBox3=function(){return{min:{x:1/0,y:1/0,z:1/0},max:{x:-1/0,y:-1/0,z:-1/0}}},e.newVector3=function(e,t,n,i){return void 0===i?{x:e,y:t,z:n}:(i.x=e,i.y=t,i.z=n,i)},e.copyVector3=function(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t},e.degToRad=i.MathUtils.degToRad,e.radToDeg=i.MathUtils.radToDeg,e.clamp=i.MathUtils.clamp,e.normalizeAngleDeg=t,e.normalizeLongitudeDeg=function(e){return(e=t(e))>180&&(e-=360),e},e.angleDistanceDeg=n,e.interpolateAnglesDeg=function(e,t,i){return(e+n(t,e)*i)%360}}(t.MathUtils||(t.MathUtils={}))},2334:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.OrientedBox3=void 0;const i=n(82);function r(e,t,n,i,r){const o=n.dot(t),s=n.dot(e);if(Math.abs(s)<1e-20)return Math.abs(o)<=i;const a=1/s,l=(o+i)*a,c=(o-i)*a;return l>c?(c>r.min&&(r.min=c),l<r.max&&(r.max=l)):(l>r.min&&(r.min=l),c<r.max&&(r.max=c)),r.min<=r.max&&r.max>=0}const o=new i.Vector3,s={min:-1/0,max:1/0};class a{constructor(e,t,n){this.position=new i.Vector3,this.xAxis=new i.Vector3(1,0,0),this.yAxis=new i.Vector3(0,1,0),this.zAxis=new i.Vector3(0,0,1),this.extents=new i.Vector3,void 0!==e&&this.position.copy(e),void 0!==t&&t.extractBasis(this.xAxis,this.yAxis,this.zAxis),void 0!==n&&this.extents.copy(n)}clone(){const e=new a;return e.copy(this),e}copy(e){this.position.copy(e.position),this.xAxis.copy(e.xAxis),this.yAxis.copy(e.yAxis),this.zAxis.copy(e.zAxis),this.extents.copy(e.extents)}getCenter(e=new i.Vector3){return e.copy(this.position)}getSize(e=new i.Vector3){return e.copy(this.extents).multiplyScalar(2)}getRotationMatrix(e=new i.Matrix4){return e.makeBasis(this.xAxis,this.yAxis,this.zAxis)}intersects(e){const t=Array.isArray(e)?e:e.planes;for(const e of t){const t=Math.abs(e.normal.dot(this.xAxis)*this.extents.x)+Math.abs(e.normal.dot(this.yAxis)*this.extents.y)+Math.abs(e.normal.dot(this.zAxis)*this.extents.z);if(e.distanceToPoint(this.position)+t<0)return!1}return!0}intersectsRay(e){if(s.min=-1/0,s.max=1/0,o.copy(this.position).sub(e.origin),r(e.direction,o,this.xAxis,this.extents.x,s)&&r(e.direction,o,this.yAxis,this.extents.y,s)&&r(e.direction,o,this.zAxis,this.extents.z,s))return s.min>0?s.min:s.max}contains(e){const t=e.x-this.position.x,n=e.y-this.position.y,i=e.z-this.position.z,r=Math.abs(t*this.xAxis.x+n*this.xAxis.y+i*this.xAxis.z),o=Math.abs(t*this.yAxis.x+n*this.yAxis.y+i*this.yAxis.z),s=Math.abs(t*this.zAxis.x+n*this.zAxis.y+i*this.zAxis.z);return!(r>this.extents.x||o>this.extents.y||s>this.extents.z)}distanceToPoint(e){return Math.sqrt(this.distanceToPointSquared(e))}distanceToPointSquared(e){const t=new i.Vector3;t.subVectors(e,this.position);const n=[t.dot(this.xAxis),t.dot(this.yAxis),t.dot(this.zAxis)];let r=0;for(let e=0;e<3;++e){const t=n[e],i=this.extents.getComponent(e);
947if(t<-i){const e=i+t;r+=e*e}else if(t>i){const e=t-i;r+=e*e}}return r}}t.OrientedBox3=a},58:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.isOrientedBox3Like=void 0,t.isOrientedBox3Like=function(e){const t=e;return void 0!==t.position&&void 0!==t.xAxis&&void 0!==t.yAxis&&void 0!==t.zAxis&&void 0!==t.extents}},2683:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.isTransformLike=void 0,t.isTransformLike=function(e){const t=e;return void 0!==t.position&&void 0!==t.xAxis&&void 0!==t.yAxis&&void 0!==t.zAxis}},2953:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.isVector2Like=void 0,t.isVector2Like=function(e){return e&&\"number\"==typeof e.x&&\"number\"==typeof e.y}},1383:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.isVector3Like=void 0,t.isVector3Like=function(e){return e&&\"number\"==typeof e.x&&\"number\"==typeof e.y&&\"number\"==typeof e.z}},5610:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.EarthConstants=void 0;class n{}t.EarthConstants=n,n.EQUATORIAL_CIRCUMFERENCE=40075016.68557849,n.EQUATORIAL_RADIUS=6378137,n.MIN_ELEVATION=-433,n.MAX_ELEVATION=8848,n.MAX_BUILDING_HEIGHT=828},1515:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.equirectangularProjection=t.normalizedEquirectangularProjection=void 0;const i=n(82),r=n(3068),o=n(4860),s=n(9264),a=n(7523),l=n(58),c=n(5610),u=n(5234);class h extends u.Projection{constructor(){super(...arguments),this.type=u.ProjectionType.Planar}getScaleFactor(e){return 1}worldExtent(e,t,n){return n||(n=new i.Box3),n.min.x=0,n.min.y=0,n.min.z=e,n.max.x=this.unitScale,n.max.y=this.unitScale/2,n.max.z=t,n}projectPoint(e,t){var n;return void 0===t&&(t={x:0,y:0,z:0}),t.x=(i.MathUtils.degToRad(e.longitude)+Math.PI)*h.geoToWorldScale*this.unitScale,t.y=(i.MathUtils.degToRad(e.latitude)+.5*Math.PI)*h.geoToWorldScale*this.unitScale,t.z=null!==(n=e.altitude)&&void 0!==n?n:0,t}unprojectPoint(e){return o.GeoCoordinates.fromRadians(e.y*h.worldToGeoScale/this.unitScale-.5*Math.PI,e.x*h.worldToGeoScale/this.unitScale-Math.PI,e.z)}unprojectAltitude(e){return e.z}projectBox(e,t){const n=this.projectPoint(new o.GeoCoordinates(e.center.latitude,e.center.longitude,0)),{latitudeSpanInRadians:r,longitudeSpanInRadians:c,altitudeSpan:u}=e,d=c*h.geoToWorldScale,p=r*h.geoToWorldScale;return t||(t=new i.Box3),(0,s.isBox3Like)(t)?(t.min.x=n.x-.5*d*this.unitScale,t.min.y=n.y-.5*p*this.unitScale,t.max.x=n.x+.5*d*this.unitScale,t.max.y=n.y+.5*p*this.unitScale,void 0!==u?(t.min.z=n.z-.5*u,t.max.z=n.z+.5*u):(t.min.z=0,t.max.z=0)):(0,l.isOrientedBox3Like)(t)&&(a.MathUtils.newVector3(1,0,0,t.xAxis),a.MathUtils.newVector3(0,1,0,t.yAxis),a.MathUtils.newVector3(0,0,1,t.zAxis),t.position.x=n.x,t.position.y=n.y,t.position.z=n.z,t.extents.x=.5*d*this.unitScale,t.extents.y=.5*p*this.unitScale,t.extents.z=Math.max(Number.EPSILON,.5*(null!=u?u:0))),t}unprojectBox(e){const t=this.unprojectPoint(e.min),n=this.unprojectPoint(e.max);return r.GeoBox.fromCoordinates(t,n)}groundDistance(e){return e.z}scalePointToSurface(e){return e.z=0,e}surfaceNormal(e,t){return void 0===t?t={x:0,y:0,z:1}:(t.x=0,t.y=0,t.z=1),t}}h.geoToWorldScale=1/(2*Math.PI),h.worldToGeoScale=2*Math.PI/1,t.normalizedEquirectangularProjection=new h(1),t.equirectangularProjection=new h(c.EarthConstants.EQUATORIAL_CIRCUMFERENCE)},9686:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.identityProjection=void 0;const i=n(82),r=n(3068),o=n(4860),s=n(9264),a=n(7523),l=n(58),c=n(5234);class u extends c.Projection{constructor(){super(...arguments),this.type=c.ProjectionType.Planar}getScaleFactor(e){return 1}worldExtent(e,t,n){return n||(n=new i.Box3),n.min.x=-Math.PI,n.min.y=.5*-Math.PI,n.min.z=e,n.max.x=Math.PI,n.max.y=.5*Math.PI,n.max.z=t,n}projectPoint(e,t){var n;return t||(t={x:0,y:0,z:0}),t.x=i.MathUtils.degToRad(e.longitude),t.y=i.MathUtils.degToRad(e.latitude),t.z=null!==(n=e.altitude)&&void 0!==n?n:0,t}unprojectPoint(e){return o.GeoCoordinates.fromRadians(e.y,e.x,e.z)}unprojectAltitude(e){return e.z}projectBox(e,t){t||(t=new i.Box3);const n=this.projectPoint(new o.GeoCoordinates(e.south,e.west,e.minAltitude)),r=this.projectPoint(new o.GeoCoordinates(e.north,e.east,e.maxAltitude));return(0,s.isBox3Like)(t)?(t.min.x=n.x,t.min.y=n.y,t.min.z=n.z,t.max.x=r.x,t.max.y=r.y,t.max.z=r.z):(0,l.isOrientedBox3Like)(t)&&(a.MathUtils.newVector3(1,0,0,t.xAxis),a.MathUtils.newVector3(0,1,0,t.yAxis),a.MathUtils.newVector3(0,0,1,t.zAxis),t.position.x=.5*(n.x+r.x),t.position.y=.5*(n.y+r.y),t.position.z=.5*(n.z+r.z),t.extents.x=.5*(r.x-n.x),t.extents.y=.5*(r.y-n.y),t.extents.z=Math.max(Number.EPSILON,.5*(r.z-n.z))),t}unprojectBox(e){const t=this.unprojectPoint(e.min),n=this.unprojectPoint(e.max);return r.GeoBox.fromCoordinates(t,n)}groundDistance(e){return e.z}scalePointToSurface(e){return e.z=0,e}surfaceNormal(e,t){return void 0===t?t={x:0,y:0,z:1}:(t.x=0,t.y=0,t.z=1),t}}t.identityProjection=new u(1)},9885:(e,t,n)=>{\"use strict\";
947Object.defineProperty(t,\"__esModule\",{value:!0}),t.webMercatorProjection=t.mercatorProjection=t.MercatorConstants=void 0;const i=n(82),r=n(3068),o=n(4860),s=n(6306),a=n(9264),l=n(7523),c=n(58),u=n(5610),h=n(5234);class d extends h.Projection{constructor(){super(...arguments),this.type=h.ProjectionType.Planar}static clamp(e,t,n){return Math.min(Math.max(t,e),n)}static latitudeClamp(e){return d.clamp(e,-p.MAXIMUM_LATITUDE,p.MAXIMUM_LATITUDE)}static latitudeProject(e){return Math.log(Math.tan(.25*Math.PI+.5*e))/Math.PI}static latitudeClampProject(e){return d.latitudeProject(d.latitudeClamp(e))}static unprojectLatitude(e){return 2*Math.atan(Math.exp(Math.PI*e))-.5*Math.PI}getScaleFactor(e){return Math.cosh(2*Math.PI*(e.y/this.unitScale-.5))}worldExtent(e,t,n){return n||(n=new i.Box3),n.min.x=0,n.min.y=0,n.min.z=e,n.max.x=this.unitScale,n.max.y=this.unitScale,n.max.z=t,n}projectPoint(e,t){var n;let i;return i=e instanceof o.GeoCoordinates?e:new o.GeoCoordinates(e.latitude,e.longitude,e.altitude),t||(t={x:0,y:0,z:0}),t.x=(i.longitude+180)/360*this.unitScale,t.y=(.5*d.latitudeClampProject(i.latitudeInRadians)+.5)*this.unitScale,t.z=null!==(n=i.altitude)&&void 0!==n?n:0,t}unprojectPoint(e){return o.GeoCoordinates.fromRadians(d.unprojectLatitude(2*(e.y/this.unitScale-.5)),e.x/this.unitScale*2*Math.PI-Math.PI,e.z)}unprojectAltitude(e){return e.z}projectBox(e,t){var n;const r=this.projectPoint(e.center),o=(.5*d.latitudeClampProject(e.northEast.latitudeInRadians)+.5)*this.unitScale,s=(.5*d.latitudeClampProject(e.southWest.latitudeInRadians)+.5)*this.unitScale,u=.5*(o+s);r.y=u;const h=o-s,p=e.longitudeSpan/360*this.unitScale;if(t||(t=new i.Box3),(0,a.isBox3Like)(t)){t.min.x=r.x-.5*p,t.min.y=r.y-.5*h,t.max.x=r.x+.5*p,t.max.y=r.y+.5*h;const n=e.altitudeSpan;void 0!==n?(t.min.z=r.z-.5*n,t.max.z=r.z+.5*n):(t.min.z=0,t.max.z=0)}else{if(!(0,c.isOrientedBox3Like)(t))throw new Error(\"invalid bounding box\");l.MathUtils.newVector3(1,0,0,t.xAxis),l.MathUtils.newVector3(0,1,0,t.yAxis),l.MathUtils.newVector3(0,0,1,t.zAxis),t.position.x=r.x,t.position.y=r.y,t.position.z=r.z,t.extents.x=.5*p,t.extents.y=.5*h,t.extents.z=Math.max(Number.EPSILON,.5*(null!==(n=e.altitudeSpan)&&void 0!==n?n:0))}return t}unprojectBox(e){const t=this.unprojectPoint(e.min),n=this.unprojectPoint(e.max);return r.GeoBox.fromCoordinates(t,n)}groundDistance(e){return e.z}scalePointToSurface(e){return e.z=0,e}surfaceNormal(e,t){return void 0===t?t={x:0,y:0,z:1}:(t.x=0,t.y=0,t.z=1),t}reprojectPoint(e,n,i){return e===this||e!==t.webMercatorProjection&&e!==t.mercatorProjection?super.reprojectPoint(e,n,i):(void 0===i&&(i={}),i.x=n.x,i.y=this.unitScale-n.y,i.z=n.z,i)}}class p{}t.MercatorConstants=p,p.MAXIMUM_LATITUDE=1.4844222297453322,t.mercatorProjection=new d(u.EarthConstants.EQUATORIAL_CIRCUMFERENCE),t.webMercatorProjection=new class extends d{projectPoint(e,t){var n;let i;i=e instanceof o.GeoCoordinates?e:new o.GeoCoordinates(e.latitude,e.longitude,e.altitude),t||(t={x:0,y:0,z:0}),t.x=(i.longitude+180)/360*this.unitScale;const r=Math.sin(d.latitudeClamp(i.latitudeInRadians));return t.y=(.5-Math.log((1+r)/(1-r))/(4*Math.PI))*this.unitScale,t.z=null!==(n=i.altitude)&&void 0!==n?n:0,t}unprojectPoint(e){const t=e.x/this.unitScale-.5,n=.5-e.y/this.unitScale,i=360*t,r=90-360*Math.atan(Math.exp(2*-n*Math.PI))/Math.PI;return new o.GeoCoordinates(r,i,e.z)}projectBox(e,t){const n=super.projectBox(e,t);if((0,a.isBox3Like)(n)){const e=n.max.y;n.max.y=this.unitScale-n.min.y,n.min.y=this.unitScale-e}else(0,c.isOrientedBox3Like)(n)&&(l.MathUtils.newVector3(1,0,0,n.xAxis),l.MathUtils.newVector3(0,-1,0,n.yAxis),l.MathUtils.newVector3(0,0,-1,n.zAxis),n.position.y=this.unitScale-n.position.y);return n}unprojectBox(e){const t=this.unprojectPoint(e.min),n=this.unprojectPoint(e.max);return new r.GeoBox(new o.GeoCoordinates(n.latitude,t.longitude,t.altitude),new o.GeoCoordinates(t.latitude,n.longitude,n.altitude))}surfaceNormal(e,t){return void 0===t?t={x:0,y:0,z:-1}:(t.x=0,t.y=0,t.z=-1),t}localTangentSpace(e,t){return(0,s.isGeoCoordinatesLike)(e)?this.projectPoint(e,t.position):l.MathUtils.copyVector3(e,t.position),l.MathUtils.newVector3(1,0,0,t.xAxis),l.MathUtils.newVector3(0,-1,0,t.yAxis),l.MathUtils.newVector3(0,0,-1,t.zAxis),t}}(u.EarthConstants.EQUATORIAL_CIRCUMFERENCE)},5234:(e,t,n)=>{\"use strict\";
947Object.defineProperty(t,\"__esModule\",{value:!0}),t.Projection=t.ProjectionType=void 0;const i=n(6306),r=n(7523);var o;(o=t.ProjectionType||(t.ProjectionType={}))[o.Planar=0]=\"Planar\",o[o.Spherical=1]=\"Spherical\",t.Projection=class{constructor(e){this.unitScale=e}localTangentSpace(e,t){return(0,i.isGeoCoordinatesLike)(e)?this.projectPoint(e,t.position):r.MathUtils.copyVector3(e,t.position),r.MathUtils.newVector3(1,0,0,t.xAxis),r.MathUtils.newVector3(0,1,0,t.yAxis),r.MathUtils.newVector3(0,0,1,t.zAxis),t}reprojectPoint(e,t,n){return e===this?void 0===n?{x:t.x,y:t.y,z:t.z}:(n.x=t.x,n.y=t.y,n.z=t.z,n):this.projectPoint(e.unprojectPoint(t),n)}}},6322:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.sphereProjection=void 0;const i=n(82),r=n(4860),o=n(6306),s=n(9264),a=n(7523),l=n(58),c=n(5610),u=n(9885),h=n(5234);function d(e){const t=1/Math.PI,n=Math.floor(2*(e*t+1));return i.MathUtils.clamp(n,0,4)}function p(e){return Math.sqrt(e.x*e.x+e.y*e.y+e.z*e.z)}function f(e,t,n){var r;const o=.5*(n+(null!==(r=e.maxAltitude)&&void 0!==r?r:0)),s=i.MathUtils.degToRad(e.west),a=i.MathUtils.degToRad(e.east),l=d(s),c=d(a);let u=Math.cos(s),h=u,p=Math.sin(s),f=p;for(let e=l+1;e<=c;e++){const t=(e+1&1)*((2&e)-1);u=Math.min(t,u),h=Math.max(t,h);const n=(1&e)*((2&e)-1);p=Math.min(n,p),f=Math.max(n,f)}const m=Math.cos(a);u=Math.min(m,u),h=Math.max(m,h);const g=Math.sin(a);p=Math.min(g,p),f=Math.max(g,f);const v=(h+u)*o,y=(h-u)*o,x=(f+p)*o,_=(f-p)*o,b=i.MathUtils.degToRad(e.south),w=i.MathUtils.degToRad(e.north),M=Math.sin(w),S=Math.sin(b),E=(M+S)*o,T=(M-S)*o;return t.min.x=v-y,t.min.y=x-_,t.min.z=E-T,t.max.x=v+y,t.max.y=x+_,t.max.z=E+T,t}class m extends h.Projection{constructor(){super(...arguments),this.type=h.ProjectionType.Spherical}worldExtent(e,t,n=new i.Box3){const r=this.unitScale+t;return n.min.x=-r,n.min.y=-r,n.min.z=-r,n.max.x=r,n.max.y=r,n.max.z=r,n}projectPoint(e,t=a.MathUtils.newVector3(0,0,0)){return function(e,t,n){var r;const o=n+(null!==(r=e.altitude)&&void 0!==r?r:0),s=i.MathUtils.degToRad(e.latitude),a=i.MathUtils.degToRad(e.longitude),l=Math.cos(s);return t.x=o*l*Math.cos(a),t.y=o*l*Math.sin(a),t.z=o*Math.sin(s),t}(e,t,this.unitScale)}unprojectPoint(e){const t=e.x*e.x+e.y*e.y,n=Math.sqrt(t),i=e.z/n;if(isNaN(i))return r.GeoCoordinates.fromRadians(0,0,-this.unitScale);const o=Math.sqrt(t+e.z*e.z);return r.GeoCoordinates.fromRadians(Math.atan(i),Math.atan2(e.y,e.x),o-this.unitScale)}unprojectAltitude(e){const t=e.x*e.x+e.y*e.y+e.z*e.z;return Math.sqrt(t)-c.EarthConstants.EQUATORIAL_RADIUS}projectBox(e,t=new i.Box3){var n,r;if((0,s.isBox3Like)(t))return f(e,t,this.unitScale);if((0,l.isOrientedBox3Like)(t)){if(e.longitudeSpan>=90){const n=f(e,new i.Box3,this.unitScale);return a.MathUtils.newVector3(1,0,0,t.xAxis),a.MathUtils.newVector3(0,1,0,t.yAxis),a.MathUtils.newVector3(0,0,1,t.zAxis),t.position.x=.5*(n.max.x+n.min.x),t.position.y=.5*(n.max.y+n.min.y),t.position.z=.5*(n.max.z+n.min.z),t.extents.x=.5*(n.max.x-n.min.x),t.extents.y=.5*(n.max.y-n.min.y),t.extents.z=.5*(n.max.z-n.min.z),t}const{south:o,west:s,north:l,east:c,center:u}=e,h=u.longitude,d=u.latitude,p=Math.cos(i.MathUtils.degToRad(o)),m=Math.sin(i.MathUtils.degToRad(o)),g=Math.cos(i.MathUtils.degToRad(s)),v=Math.sin(i.MathUtils.degToRad(s)),y=Math.cos(i.MathUtils.degToRad(l)),x=Math.sin(i.MathUtils.degToRad(l)),_=Math.cos(i.MathUtils.degToRad(c)),b=Math.sin(i.MathUtils.degToRad(c)),w=Math.cos(i.MathUtils.degToRad(h)),M=Math.sin(i.MathUtils.degToRad(h)),S=Math.cos(i.MathUtils.degToRad(d)),E=Math.sin(i.MathUtils.degToRad(d));let T,A,L;a.MathUtils.newVector3(w*S,M*S,E,t.zAxis),a.MathUtils.newVector3(-M,w,0,t.xAxis),a.MathUtils.newVector3(-w*E,-M*E,S,t.yAxis),o>=0?(T=Math.abs(p*(w*(v-b)+M*(_-g))),A=S*m-E*p,L=S*x-E*y*(w*_+M*b)):(l<=0?(T=Math.abs(y*(w*(v-b)+M*(_-g))),L=S*x-E*y):(T=Math.abs(w*(v-b)+M*(_-g)),L=S*x-E*y*(M*b+w*_)),A=S*m-E*p*(w*_+M*b));const C=.5*(this.unitScale+(null!==(n=e.maxAltitude)&&void 0!==n?n:0)),P=.5*(this.unitScale+(null!==(r=e.minAltitude)&&void 0!==r?r:0)),R=S*(w*_+M*b),D=Math.min(y*R+x*E,p*R+m*E);return a.MathUtils.newVector3(T*C,(L-A)*C,C-D*P,t.extents),a.MathUtils.newVector3(0,(A+L)*C,C+C,t.position),function(e,t,n,i){const r=e.x*i.x+t.x*i.y+n.x*i.z,o=e.y*i.x+t.y*i.y+n.y*i.z,s=e.z*i.x+t.z*i.y+n.z*i.z;i.x=r,i.y=o,i.z=s}(t.xAxis,t.yAxis,t.zAxis,t.position),t.position.x=t.position.x-t.zAxis.x*t.extents.z,t.position.y=t.position.y-t.zAxis.y*t.extents.z,t.position.z=t.position.z-t.zAxis.z*t.extents.z,t}throw new Error(\"Invalid bounding box\")}unprojectBox(e){throw new Error(\"Method not implemented.\")}getScaleFactor(e){return 1}groundDistance(e){return p(e)-this.unitScale}scalePointToSurface(e){const t=this.unitScale/(p(e)||1);return e.x*=t,e.y*=t,e.z*=t,e}surfaceNormal(e,t){void 0===t&&(t={x:0,y:0,z:0});const n=1/(p(e)||1);return t.x=e.x*n,t.y=e.y*n,t.z=e.z*n,t}reprojectPoint(e,t,n){if(e===u.mercatorProjection||e===u.webMercatorProjection){const{x:i,y:r,z:o}=t,s=this.unitScale,a=i/s-Math.PI,l=r/s-Math.PI,c=Math.exp(l),h=c*c,d=2*c/(h+1),p=(h-1)/(h+1),f=s+o;return void 0===n&&(n={}
947),n.x=Math.cos(a)*d*f,n.y=Math.sin(a)*d*f,n.z=p*f,e===u.webMercatorProjection&&(n.z=-n.z),n}return super.reprojectPoint(e,t,n)}localTangentSpace(e,t){let n;(0,o.isGeoCoordinatesLike)(e)?(this.projectPoint(e,t.position),n=e):(a.MathUtils.copyVector3(e,t.position),n=this.unprojectPoint(e));const r=i.MathUtils.degToRad(n.latitude),s=i.MathUtils.degToRad(n.longitude),l=Math.cos(s),c=Math.sin(s),u=Math.cos(r),h=Math.sin(r);return a.MathUtils.newVector3(l*u,c*u,h,t.zAxis),a.MathUtils.newVector3(-c,l,0,t.xAxis),a.MathUtils.newVector3(-l*h,-c*h,u,t.yAxis),t}}t.sphereProjection=new m(c.EarthConstants.EQUATORIAL_RADIUS)},7289:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.transverseMercatorProjection=t.TransverseMercatorUtils=void 0;const i=n(82),r=n(3068),o=n(4860),s=n(9264),a=n(7523),l=n(58),c=n(5610),u=n(5234);class h extends u.Projection{static clampGeoPoint(e,t){const n=e.latitude,i=e.longitude,r=d.POLE_RADIUS,s=d.POLE_RADIUS_SQ,a=Math.round(i/90),l=90*a-i;if(a%2==0||Math.abs(l)>r)return e;const c=n-0,u=l*l+c*c;if(u<s){const e=Math.sqrt(u),t=(r-e)/e,s=0===l&&0===c?1*r:l;return new o.GeoCoordinates(n+c*t,i+s*t)}return e}constructor(e){super(e),this.unitScale=e,this.type=u.ProjectionType.Planar,this.m_phi0=0,this.m_lambda0=0}getScaleFactor(e){return Math.cosh(2*(e.x/this.unitScale-.5)*Math.PI)}worldExtent(e,t,n){return n||(n=new i.Box3),n.min.x=0,n.min.y=0,n.min.z=e,n.max.x=this.unitScale,n.max.y=this.unitScale,n.max.z=t,n}projectPoint(e,t){var n;t||(t={x:0,y:0,z:0});const r=h.clampGeoPoint(e,this.unitScale),o=r.longitude/360+.5,s=1===o?0:Math.floor(o),a=i.MathUtils.degToRad(r.latitude),l=i.MathUtils.degToRad(r.longitude-360*s)-this.m_lambda0,c=Math.cos(a)*Math.sin(l);t.x=Math.atanh(c),t.y=Math.atan2(Math.tan(a),Math.cos(l))-this.m_phi0;const u=.5/Math.PI;return t.x=this.unitScale*(i.MathUtils.clamp(t.x*u+.5,0,1)+s),t.y=this.unitScale*i.MathUtils.clamp(t.y*u+.5,0,1),t.z=null!==(n=e.altitude)&&void 0!==n?n:0,t}unprojectPoint(e){const t=2*Math.PI,n=e.x/this.unitScale,i=e.y/this.unitScale,r=1===n?0:Math.floor(n),s=t*(n-.5-r),a=t*(i-.5),l=e.z||0,c=a+this.m_phi0,u=Math.asin(Math.sin(c)/Math.cosh(s)),h=this.m_lambda0+Math.atan2(Math.sinh(s),Math.cos(c))+r*t;return o.GeoCoordinates.fromRadians(u,h,l)}projectBox(e,t){const{north:n,south:r,east:c,west:u}=e,h=[e.center,e.northEast,e.southWest,new o.GeoCoordinates(r,c),new o.GeoCoordinates(n,u)],p=d.POLE_EDGE_DEG,f=u<90&&c>90,m=u<0&&c>0,g=u<p&&c>-p&&n>0&&r<0;u<-90&&c>-90&&(h.push(new o.GeoCoordinates(n,-90)),h.push(new o.GeoCoordinates(r,-90))),f&&(h.push(new o.GeoCoordinates(n,90)),h.push(new o.GeoCoordinates(r,90))),m&&(h.push(new o.GeoCoordinates(n,0)),h.push(new o.GeoCoordinates(r,0))),g&&(h.push(new o.GeoCoordinates(0,u)),h.push(new o.GeoCoordinates(0,c))),d.alignLatitude(h,h[0]);const v=h.map((e=>this.projectPoint(e))),y=v.map((e=>e.x)),x=v.map((e=>e.y)),_=v.map((e=>e.z)),b=Math.min(...y),w=Math.min(...x),M=Math.min(..._),S=Math.max(...y),E=Math.max(...x),T=Math.max(..._);if(t||(t=new i.Box3),(0,s.isBox3Like)(t))t.min.x=b,t.min.y=w,t.min.z=M,t.max.x=S,t.max.y=E,t.max.z=T;else{if(!(0,l.isOrientedBox3Like)(t))throw new Error(\"invalid bounding box\");a.MathUtils.newVector3(1,0,0,t.xAxis),a.MathUtils.newVector3(0,1,0,t.yAxis),a.MathUtils.newVector3(0,0,1,t.zAxis),t.position.x=(b+S)/2,t.position.y=(w+E)/2,t.position.z=(M+T)/2,t.extents.x=(S-b)/2,t.extents.y=(E-w)/2,t.extents.z=(T-M)/2}return t}unprojectBox(e){const t=this.unitScale,n=e.min,i=e.max,s=[{x:(n.x+i.x)/2,y:(n.y+i.y)/2,z:0},n,i,{x:n.x,y:i.y,z:0},{x:i.x,y:n.y,z:0}],a=.5*t,l=.25*t,c=.75*t,u=n.x<a&&i.x>a,h=n.y<a&&i.y>a,p=n.y<l&&i.y>l,f=n.y<c&&i.y>c;h&&(s.push({x:n.x,y:a,z:0}),s.push({x:i.x,y:a,z:0}),u&&s.push({x:a,y:a,z:0})),p&&(s.push({x:n.x,y:l,z:0}),s.push({x:i.x,y:l,z:0}),u&&s.push({x:a,y:l,z:0})),f&&(s.push({x:n.x,y:c,z:0}),s.push({x:i.x,y:c,z:0}),u&&s.push({x:a,y:c,z:0}));const m=s.map((e=>this.unprojectPoint(e)));d.alignLongitude(m,m[0]);const g=m.map((e=>e.latitude)),v=m.filter((e=>Math.abs(e.latitude)<90)).map((e=>e.longitude)),y=m.map((e=>{var t;return null!==(t=e.altitude)&&void 0!==t?t:0})),x=new o.GeoCoordinates(Math.min(...g),Math.min(...v),Math.min(...y)),_=new o.GeoCoordinates(Math.max(...g),Math.max(...v),Math.max(...y));return r.GeoBox.fromCoordinates(x,_)}unprojectAltitude(e){return e.z}groundDistance(e){return e.z}scalePointToSurface(e){return e.z=0,e}surfaceNormal(e,t){return void 0===t?t={x:0,y:0,z:-1}:(t.x=0,t.y=0,t.z=-1),t}}class d{static alignLatitude(e,t){for(const n of e)0===n.latitude&&(n.latitude=1e-9*t.latitude)}static alignLongitude(e,t){const n=t.longitude<0?180:-180,i=t.longitude<0?-180:180;for(const t of e)t.longitude===n&&(t.longitude=i)}}t.TransverseMercatorUtils=d,d.POLE_EDGE=1.4844222297453322,d.POLE_EDGE_DEG=i.MathUtils.radToDeg(d.POLE_
947EDGE),d.POLE_RADIUS=90-d.POLE_EDGE_DEG,d.POLE_RADIUS_SQ=Math.pow(d.POLE_RADIUS,2),t.transverseMercatorProjection=new h(c.EarthConstants.EQUATORIAL_CIRCUMFERENCE)},9861:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.FlatTileBoundingBoxGenerator=void 0;const i=n(82);t.FlatTileBoundingBoxGenerator=class{constructor(e,t=0,n=0){this.tilingScheme=e,this.minElevation=t,this.maxElevation=n,this.m_tilingScheme=e,this.m_worldBox=e.projection.worldExtent(t,n);const{min:i,max:r}=this.m_worldBox;this.m_worldDimensions={x:r.x-i.x,y:r.y-i.y,z:r.z-i.z}}get projection(){return this.m_tilingScheme.projection}get subdivisionScheme(){return this.m_tilingScheme.subdivisionScheme}getWorldBox(e,t){const n=e.level,r=this.subdivisionScheme.getLevelDimensionX(n),o=this.subdivisionScheme.getLevelDimensionY(n),s=this.m_worldDimensions.x/r,a=this.m_worldDimensions.y/o,l=this.m_worldBox.min.x+s*e.column,c=this.m_worldBox.min.y+a*e.row;return t||(t=new i.Box3),t.min.x=l,t.min.y=c,t.min.z=this.m_worldBox.min.z,t.max.x=l+s,t.max.y=c+a,t.max.z=this.m_worldBox.max.z,t}getGeoBox(e){const t=this.getWorldBox(e);return this.projection.unprojectBox(t)}}},435:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.halfQuadTreeSubdivisionScheme=void 0,t.halfQuadTreeSubdivisionScheme=new class{getSubdivisionX(){return 2}getSubdivisionY(e){return 0===e?1:2}getLevelDimensionX(e){return 1<<e}getLevelDimensionY(e){return 0!==e?1<<e-1:1}}},4490:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.hereTilingScheme=void 0;const i=n(1515),r=n(435),o=n(6557);t.hereTilingScheme=new o.TilingScheme(r.halfQuadTreeSubdivisionScheme,i.normalizedEquirectangularProjection)},1635:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.mercatorTilingScheme=void 0;const i=n(9885),r=n(9447),o=n(6557);t.mercatorTilingScheme=new o.TilingScheme(r.quadTreeSubdivisionScheme,i.mercatorProjection)},1871:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.polarTilingScheme=void 0;const i=n(7289),r=n(9447),o=n(6557);t.polarTilingScheme=new o.TilingScheme(r.quadTreeSubdivisionScheme,i.transverseMercatorProjection)},7171:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.QuadTree=void 0;const i=n(6541);t.QuadTree=class{constructor(e){this.tilingScheme=e}visit(e){this.visitTileKey(i.TileKey.fromRowColumnLevel(0,0,0),e)}visitTileKey(e,t){if(t(e,this.tilingScheme.getGeoBox(e)))for(const n of this.tilingScheme.getSubTileKeys(e))this.visitTileKey(n,t)}}},9447:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.quadTreeSubdivisionScheme=void 0,t.quadTreeSubdivisionScheme=new class{getSubdivisionX(){return 2}getSubdivisionY(){return 2}getLevelDimensionX(e){return 1<<e}getLevelDimensionY(e){return 1<<e}}},3424:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.SubTiles=void 0;const i=n(6541);class r{constructor(e,t,n){this.tileKey=e,this.sizeX=t,this.sizeY=n}[Symbol.iterator](){return 2===this.sizeX&&2===this.sizeY?r.ZCurveIterator(this.tileKey):r.RowColumnIterator(this.tileKey,this.sizeX,this.sizeY)}}t.SubTiles=r,function(e){e.RowColumnIterator=function*(e,t,n){for(let r=0;r<n;r++)for(let o=0;o<t;o++)yield i.TileKey.fromRowColumnLevel(e.row*n+r,e.column*t+o,e.level+1)},e.ZCurveIterator=function*(e){for(let t=0;t<4;t++)yield i.TileKey.fromRowColumnLevel(e.row<<1|t>>1,e.column<<1|1&t,e.level+1)}}(r=t.SubTiles||(t.SubTiles={}))},4948:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0})},6541:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.TileKey=void 0;const n=[1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384,32768,65536,131072,262144,524288,1048576,2097152,4194304,8388608,16777216,33554432,67108864,134217728,268435456,536870912,1073741824,2147483648,4294967296,8589934592,17179869184,34359738368,68719476736,137438953472,274877906944,549755813888,1099511627776,2199023255552,4398046511104,8796093022208,17592186044416,35184372088832,70368744177664,0x800000000000,281474976710656,562949953421312,0x4000000000000,
9470x8000000000000,4503599627370496];class i{static fromRowColumnLevel(e,t,n){return new i(e,t,n)}static fromQuadKey(e){const t=e.length;let n=0,r=0;for(let i=0;i<e.length;++i){const o=1<<i,s=parseInt(e.charAt(t-i-1),10);1&s&&(r|=o),2&s&&(n|=o)}return i.fromRowColumnLevel(n,r,t)}static fromMortonCode(e){let t=0,n=0,r=0,o=e;for(;o>1;){const e=1<<t;1&o&&(r|=e),2&o&&(n|=e),t++,o=(o-(3&o))/4}const s=i.fromRowColumnLevel(n,r,t);return s.m_mortonCode=e,s}static fromHereTile(e){const t=i.fromMortonCode(parseInt(e,10));return t.m_hereTile=e,t}static columnsAtLevel(e){return Math.pow(2,e)}static rowsAtLevel(e){return Math.pow(2,e)}static atCoords(e,t,n,r,o){return i.fromRowColumnLevel(Math.floor(n/(o/i.rowsAtLevel(e))),Math.floor(t/(r/i.columnsAtLevel(e))),e)}static parentMortonCode(e){return Math.floor(e/4)}constructor(e,t,n){this.row=e,this.column=t,this.level=n}parent(){if(0===this.level)throw new Error(\"Cannot get the parent of the root tile key\");return i.fromRowColumnLevel(this.row>>>1,this.column>>>1,this.level-1)}changedLevelBy(e){const t=Math.max(0,this.level+e);let n=this.row,r=this.column;return e>=0?(n<<=e,r<<=e):(n>>>=-e,r>>>=-e),i.fromRowColumnLevel(n,r,t)}changedLevelTo(e){return this.changedLevelBy(e-this.level)}mortonCode(){if(void 0===this.m_mortonCode){let e=this.column,t=this.row,i=n[this.level<<1];for(let r=0;r<this.level;++r)1&e&&(i+=n[2*r]),1&t&&(i+=n[2*r+1]),e>>>=1,t>>>=1;this.m_mortonCode=i}return this.m_mortonCode}toHereTile(){return void 0===this.m_hereTile&&(this.m_hereTile=this.mortonCode().toString()),this.m_hereTile}toQuadKey(){let e=\"\";for(let t=this.level;t>0;--t){const n=1<<t-1,i=!!(this.column&n),r=!!(this.row&n);e+=i&&r?\"3\":r?\"2\":i?\"1\":\"0\"}return e}equals(e){return this.row===e.row&&this.column===e.column&&this.level===e.level}addedSubKey(e){const t=i.fromQuadKey(0===e.length?\"-\":e),n=this.changedLevelBy(t.level);return i.fromRowColumnLevel(n.row+t.row,n.column+t.column,n.level)}addedSubHereTile(e){const t=i.fromHereTile(e),n=this.changedLevelBy(t.level);return i.fromRowColumnLevel(n.row+t.row,n.column+t.column,n.level)}getSubHereTile(e){const t=1<<2*e;return(this.mortonCode()&t-1|t).toString()}rowCount(){return i.rowsAtLevel(this.level)}columnCount(){return i.columnsAtLevel(this.level)}}t.TileKey=i},7841:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.TileKeyUtils=t.powerOfTwo=void 0;const i=n(4860),r=n(6541);t.powerOfTwo=(()=>{let e=.5;return new Array(53).fill(0).map((()=>e*=2))})(),function(e){function n(e,t,n){const i=e.projection,o=e.subdivisionScheme,s=o.getLevelDimensionX(n),a=o.getLevelDimensionY(n),{min:l,max:c}=i.worldExtent(0,0),u=c.x-l.x,h=c.y-l.y;if(t.x<l.x||t.x>c.x)return null;if(t.y<l.y||t.y>c.y)return null;const d=Math.min(s-1,Math.floor(s*(t.x-l.x)/u)),p=Math.min(a-1,Math.floor(a*(t.y-l.y)/h));return r.TileKey.fromRowColumnLevel(p,d,n)}function o(e,n,i=4){const r=function(e,n=4){let i=0;const r=t.powerOfTwo[n];for(e+=r/2;e<0;)e+=r;for(;e>=r;)e-=r;for(let r=0;r<n&&e>0;r++)1&e&&(i+=t.powerOfTwo[53-n+r]),e>>>=1;return i}(n,i);return e.mortonCode()+r}function s(e,n=4){let i=0,r=e,o=0;for(;o<n;o++){const e=t.powerOfTwo[52-o];r>=e&&(r-=e,i+=t.powerOfTwo[n-1-o])}return i-=t.powerOfTwo[n-1],{offset:i,mortonCode:r}}e.geoCoordinatesToTileKey=function(e,t,i){return n(e,e.projection.projectPoint(t),i)},e.worldCoordinatesToTileKey=n,e.geoRectangleToTileKeys=function(t,n,o){const s=(e,t,n)=>e<t?n-(t-e)%(n-t):t+(e-t)%(n-t),a=(e,t,n)=>Math.min(Math.max(e,t),n),l=s(n.southWest.longitudeInRadians,-Math.PI,Math.PI),c=a(n.southWest.latitudeInRadians,-.5*Math.PI,.5*Math.PI),u=s(n.northEast.longitudeInRadians,-Math.PI,Math.PI),h=a(n.northEast.latitudeInRadians,-.5*Math.PI,.5*Math.PI),d=e.geoCoordinatesToTileKey(t,i.GeoCoordinates.fromRadians(c,l),o),p=e.geoCoordinatesToTileKey(t,i.GeoCoordinates.fromRadians(h,u),o),f=t.subdivisionScheme.getLevelDimensionX(o);if(!d||!p)throw new Error(\"Invalid coordinates\");const m=d.column;let g=p.column;l>u&&(g+=g!==m?f:f-1);const v=Math.min(d.row,p.row),y=Math.max(d.row,p.row),x=new Array;for(let e=v;e<=y;++e)for(let t=m;t<=g;++t)x.push(r.TileKey.fromRowColumnLevel(e,t%f,o));return x},e.getKeyForTileKeyAndOffset=o,e.extractOffsetAndMortonKeyFromKey=s,e.getParentKeyFromKey=function(e,t=4){const{offset:n,mortonCode:i}=s(e,t);return o(r.TileKey.fromMortonCode(r.TileKey.parentMortonCode(i)),n,t)}}(t.TileKeyUtils||(t.TileKeyUtils={}))},2801:(e,t,n)=>{\"use strict\";
947Object.defineProperty(t,\"__esModule\",{value:!0}),t.TileTreeTraverse=void 0;const i=n(3424);t.TileTreeTraverse=class{constructor(e){this.m_subdivisionScheme=e}subTiles(e){const t=this.m_subdivisionScheme.getSubdivisionX(e.level),n=this.m_subdivisionScheme.getSubdivisionY(e.level);return new i.SubTiles(e,t,n)}}},6557:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.TilingScheme=void 0;const i=n(9861),r=n(7841),o=n(2801);t.TilingScheme=class{constructor(e,t){this.subdivisionScheme=e,this.projection=t,this.boundingBoxGenerator=new i.FlatTileBoundingBoxGenerator(this),this.tileTreeTraverse=new o.TileTreeTraverse(e)}getSubTileKeys(e){return this.tileTreeTraverse.subTiles(e)}getTileKey(e,t){return r.TileKeyUtils.geoCoordinatesToTileKey(this,e,t)}getTileKeys(e,t){return r.TileKeyUtils.geoRectangleToTileKeys(this,e,t)}getGeoBox(e){return this.boundingBoxGenerator.getGeoBox(e)}getWorldBox(e,t){return this.boundingBoxGenerator.getWorldBox(e,t)}}},2224:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.webMercatorTilingScheme=void 0;const i=n(9885),r=n(9447),o=n(6557);t.webMercatorTilingScheme=new o.TilingScheme(r.quadTreeSubdivisionScheme,i.webMercatorProjection)},4388:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.LineGroup=t.createSimpleLineGeometry=t.createLineGeometry=t.LineGeometry=void 0;const i=n(82),r=n(4342),o=new i.Vector3,s=new i.Vector3,a=new i.Vector3,l=new i.Vector3,c={attributes:[{name:\"extrusionCoord\",itemSize:3,offset:0},{name:\"position\",itemSize:3,offset:3},{name:\"tangent\",itemSize:3,offset:6},{name:\"biTangent\",itemSize:4,offset:9}],stride:13},u={attributes:[{name:\"uv\",itemSize:2,offset:c.stride},{name:\"normal\",itemSize:3,offset:c.stride+2}],stride:5},h={attributes:[...c.attributes,...u.attributes],stride:c.stride+u.stride},d={attributes:[{name:\"extrusionCoord\",itemSize:2,offset:0},{name:\"position\",itemSize:3,offset:2},{name:\"positionLow\",itemSize:3,offset:5},{name:\"tangent\",itemSize:3,offset:8},{name:\"biTangent\",itemSize:4,offset:11}],stride:15},p={attributes:[...d.attributes,...u.attributes],stride:d.stride+u.stride};class f{constructor(){this.vertices=[],this.vertexColors=[],this.indices=[]}}function m(e,t){return t?e?p:d:e?h:c}function g(e,t,n,c,u,h,d=new f,p=!1){if(0===t.length)return d;const g=m(void 0!==u,p).stride,v=t.length,y=v/3,x=new Array(y),_=new Array(v-3),b=d.vertices.length/g,w=void 0!==c&&c.length>0,M=void 0!==u&&u.length>0,S=void 0!==h&&h.length&&v;(0,r.assert)(!w||c.length===y),(0,r.assert)(!M||u.length/2===y),(0,r.assert)(!S||h.length===v);let E=.1;x[0]=E;for(let e=0;e<y-1;++e){let n=0;for(let i=0;i<3;++i){const r=t[3*(e+1)+i]-t[3*e+i];_[3*e+i]=r,n+=r*r}E+=Math.sqrt(n),x[e+1]=E}const T=w?Math.abs(c[c.length-1]-c[0]):1,A=x[x.length-1]/T;if(w)for(let e=0;e<y;++e)x[e]=c[e]*A+.1;let L=!0;for(let e=0;e<3;++e)L=L&&t[e]===t[t.length-3+e];const C=(r,c,f,m,g)=>{const v=[],y=[];v.push(m,-1*g,A),y.push(m,1*g,A);for(let e=0;e<3;++e){if(p){const n=Math.fround(t[3*r+e]),i=t[3*r+e]-n;v.push(n,i),y.push(n,i)}else v.push(t[3*r+e]),y.push(t[3*r+e]);o.setComponent(e,t[3*r+e]),s.setComponent(e,_[c+e]),a.setComponent(e,_[f+e])}s.normalize(),a.normalize(),v.push(s.x,s.y,s.z),y.push(s.x,s.y,s.z),o.add(e),n.surfaceNormal(o,o);const x=function(e,t,n,r){let o=0;if(!t.equals(n)){o=t.angleTo(n);const r=(new i.Vector3).crossVectors(t,n),s=Math.sign(r.dot(e));0!==s&&(o*=s),Number.isNaN(o)&&(o=0)}return r.copy(t).add(n).normalize().cross(e).normalize(),o}(o,s,a,l);v.push(l.x,l.y,l.z,x),y.push(l.x,l.y,l.z,x),M&&(v.push(u[2*r],u[2*r+1]),y.push(u[2*r],u[2*r+1]),v.push(o.x,o.y,o.z),y.push(o.x,o.y,o.z)),d.vertices.push(...v,...y),S&&(d.vertexColors.push(h[3*r],h[3*r+1],h[3*r+2]),d.vertexColors.push(h[3*r],h[3*r+1],h[3*r+2]))};for(let e=0;e<y;++e){const t=L&&0===e?_.length-3:3*Math.max(0,e-1),n=L&&e===y-1?0:Math.min(3*e,_.length-3);e>0&&C(e,t,n,x[e-1],x[e]),e+1<y&&C(e,t,n,-1*x[Math.min(e,x.length-1)],x[Math.min(e+1,x.length-1)])}for(let e=0;e<y-1;++e){const t=b+4*e;d.indices.push(t,t+1,t+2,t+2,t+1,t+3)}return d}function v(e,t,n=new f){if(0===e.length)return n;const i=e.length/3;let r=n.vertices.length/3;const o=void 0!==t&&t.length&&e.length;for(let s=0;s<i;++s,r++){s>0&&n.indices.push(r),s<i-1&&n.indices.push(r);for(let i=0;i<3;++i)n.vertices.push(e[3*s+i]),o&&n.vertexColors.push(t[3*s+i])}return n}t.LineGeometry=f,t.createLineGeometry=g,t.createSimpleLineGeometry=v;class y{static createGeometry(e,t,n,r,o=!1,s=!1,a=!1){if(a)return r.setAttribute(\"position\",new i.BufferAttribute(new Float32Array(e),3)),t.length===e.length&&r.setAttribute(\"color\",new i.BufferAttribute(new Float32Array(t),3)),r.setIndex(new i.BufferAttribute(new Uint32Array(n),1)),r;{const a=m(o,s),l=new i.InterleavedBuffer(new Float32Array(e),a.stride);
947return a.attributes.forEach((e=>{const t=new i.InterleavedBufferAttribute(l,e.itemSize,e.offset,!1);r.setAttribute(e.name,t)})),t.length===e.length&&r.setAttribute(\"color\",new i.BufferAttribute(new Float32Array(t),3)),r.setIndex(new i.BufferAttribute(new Uint32Array(n),1)),r}}constructor(e=!1,t=!1,n=!1){this.hasNormalsAndUvs=e,this.highPrecision=t,this.isSimple=n,this.m_geometry=new f}clear(){this.m_geometry.vertices=[],this.m_geometry.vertexColors=[],this.m_geometry.indices=[]}add(e,t,n,i,o,s){return this.isSimple?v(t,s,this.m_geometry):((0,r.assert)(!this.hasNormalsAndUvs||void 0!==o),g(e,t,n,i,o,s,this.m_geometry,this.highPrecision)),this}get vertices(){return this.m_geometry.vertices}get vertexColors(){return this.m_geometry.vertexColors}get indices(){return this.m_geometry.indices}get vertexAttributes(){return m(this.hasNormalsAndUvs,this.highPrecision).attributes}get stride(){return m(this.hasNormalsAndUvs,this.highPrecision).stride}createGeometry(e){return void 0===e&&(e=new i.BufferGeometry),y.createGeometry(this.m_geometry.vertices,this.m_geometry.vertexColors,this.m_geometry.indices,e,this.hasNormalsAndUvs,this.highPrecision)}}t.LineGroup=y},3711:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.reconstructLineWidth=t.reconstructLine=t.triangulateLine=t.numCirclePoints=void 0;const i=n(82),r=new i.Vector3(0,0,1),o=[0,1,2,1,3,2],s=[0,1,3,3,1,2,0,3,4,5,4,3],a=Math.PI/8;function l(e,t,n,i,r,o){const s=r.length/3;r.push(e,t,0);for(let l=0;l<9;++l){const c=a*l+Math.PI/2+n;r.push(e+i*Math.cos(c),t+i*Math.sin(c),0),o.push(s,s+l+1,s+(l+1)%9+1)}}t.numCirclePoints=function(e){return 9},t.triangulateLine=function(e,t,n,a,c=!0,u=c){if(e.length<3)return;const h=new i.Vector2;if(c){const i=3!==e.length?h.set(e[3]-e[0],e[4]-e[1]).angle():0;l(e[0],e[1],i,t,n,a)}const d=n.length/3,p=new i.Vector3,f=new i.Vector3,m=new i.Vector3,g=new i.Vector3,v=new i.Vector3,y=new i.Vector3,x=new i.Vector3,_=new i.Vector3,b=new i.Vector3,w=e.length/3;let M=0;for(let i=0;i<w;++i){let l=!1;if(f.set(e[3*i],e[3*i+1],e[3*i+2]),i+1<w){if(m.set(e[3*(i+1)],e[3*(i+1)+1],e[3*(i+1)+2]),g.copy(m).sub(f).normalize().cross(r),v.copy(g),i>0&&(v.add(p).multiplyScalar(1-.5*g.dot(p)),l=p.angleTo(g)>Math.PI/2,l)){const e=t/Math.cos(g.angleTo(p)/2);y.copy(g).add(p).normalize().multiplyScalar(-e).add(f),x.copy(p).multiplyScalar(t).add(f),_.copy(g).add(p).normalize().multiplyScalar(e).add(f),b.copy(g).multiplyScalar(t).add(f)}l?n.push(y.x,y.y,y.z,x.x,x.y,x.z,_.x,_.y,_.z,b.x,b.y,b.z):(y.copy(v).multiplyScalar(-t).add(f),x.copy(v).multiplyScalar(t).add(f),n.push(y.x,y.y,y.z,x.x,x.y,x.z)),p.copy(g)}else y.copy(p).multiplyScalar(-t).add(f),x.copy(p).multiplyScalar(t).add(f),n.push(y.x,y.y,y.z,x.x,x.y,x.z);i!==w-1&&((l?s:o).forEach((e=>a.push(d+M+e))),M+=l?4:2)}if(u){const i=2!==e.length?h.set(e[3*(w-3)]-e[3*(w-2)],e[3*(w-3)+1]-e[3*(w-2)+1]).angle():Math.PI;l(e[3*(w-2)],e[3*(w-2)+1],i,t,n,a)}},t.reconstructLine=function(e,t){const n=new Float32Array(e.length/2);for(let i=3*t,r=2*i;i<n.length;i+=3,r+=6)n[i]=e[r]+.5*(e[r+3]-e[r]),n[i+1]=e[r+1]+.5*(e[r+3+1]-e[r+1]),n[i+2]=e[r+2]+.5*(e[r+3+2]-e[r+2]);return n},t.reconstructLineWidth=function(e,t){const n=e[2*t+3]-e[2*t],i=e[2*t+3+1]-e[2*t+1],r=e[2*t+3+2]-e[2*t+2];return.5*Math.sqrt(n*n+i*i+r*r)}},8263:function(e,t,n){\"use strict\";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);
947r&&!(\"get\"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)\"default\"===n||Object.prototype.hasOwnProperty.call(t,n)||i(t,e,n)};Object.defineProperty(t,\"__esModule\",{value:!0}),r(n(8759),t)},8759:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.LRUCache=t.Entry=void 0;const i=n(4342);class r{constructor(e,t,n,i,r){this.key=e,this.value=t,this.size=n,this.newer=i,this.older=r}}t.Entry=r,t.LRUCache=class{constructor(e,t=(()=>1)){this.m_size=0,this.m_map=new Map,this.m_newest=null,this.m_oldest=null,this.m_capacity=e,this.m_sizeFunction=t}forEach(e,t){let n=this.m_newest;for(;null!==n;){const i=n.older;e.call(t,n.value,n.key,this),n=i}}get size(){return this.m_size}get capacity(){return this.m_capacity}get map(){return this.m_map}get newest(){return this.m_newest}get oldest(){return this.m_oldest}setCapacity(e){this.m_capacity=e,this.evict()}setCapacityAndMeasure(e,t=(()=>1)){this.m_capacity=e,this.m_sizeFunction=t,this.shrinkToCapacity()}shrinkToCapacity(){let e=0;const t=this.m_sizeFunction;let n=this.m_newest;for(;null!==n;){const i=t(n.value);n.size=i,e+=i,n=n.older}this.m_size=e,this.evict()}set(e,t){const n=this.m_sizeFunction(t);let o=this.m_map.get(e);if(void 0!==o)this.m_size=this.m_size-o.size+n,o.value=t,o.size=n,this.promoteEntry(o),this.evict();else{if(n>this.m_capacity)return;if(o=new r(e,t,n,null,null),0===this.m_map.size)this.m_newest=this.m_oldest=o;else{(0,i.assert)(null!==this.m_newest);const e=this.m_newest;o.older=this.m_newest,e.newer=o,this.m_newest=o}this.m_map.set(e,o),this.m_size+=n,this.evict()}}get(e){const t=this.m_map.get(e);if(void 0!==t)return this.promoteEntry(t),t.value}has(e){return this.m_map.has(e)}clear(){this.m_newest=this.m_oldest=null,this.m_size=0,this.m_map.clear()}evictAll(){const e=this.evictionCallback;void 0!==e&&this.forEach(((t,n)=>e(n,t))),this.clear()}evictSelected(e,t){const n=this.evictionCallback;let i=this.m_newest;for(;null!==i;){const r=i.older;e.call(t,i.value,i.key)&&(void 0!==n&&n(i.key,i.value),this.deleteEntry(i),this.m_map.delete(i.key)),i=r}}delete(e){const t=this.m_map.get(e);return void 0!==t&&(this.deleteEntry(t),this.m_map.delete(e))}evict(){for(;null!==this.m_oldest&&this.m_size>this.m_capacity;)if(void 0===this.evictOldest())return}evictOldest(){(0,i.assert)(null!==this.m_oldest);const e=this.m_oldest;(0,i.assert)(null===e.older);let t=e;if(void 0!==this.canEvict)for(;!this.canEvict(t.key,t.value);){if(null===t.newer)return;t=t.newer}if(t===e)this.m_oldest=t.newer,null!==t.newer&&((0,i.assert)(t.newer.older===t),t.newer.older=null);else{if(null===t.newer)return;(0,i.assert)(t.newer.older===t),t.newer.older=t.older,null!==t.older&&(t.older.newer=t.newer)}const n=this.m_map.delete(t.key);return(0,i.assert)(!0===n),n&&void 0!==this.evictionCallback&&this.evictionCallback(t.key,t.value),this.m_size-=t.size,t}deleteEntry(e){e===this.m_newest?this.m_newest=e.older:e.newer?e.newer.older=e.older:(0,i.assert)(!1),e===this.m_oldest?this.m_oldest=e.newer:e.older?e.older.newer=e.newer:(0,i.assert)(!1),this.m_size-=e.size}promoteEntry(e){if(e===this.m_newest)return;e.newer&&((0,i.assert)(e.newer.older===e),e.newer.older=e.older),e.older&&((0,i.assert)(e.older.newer===e),e.older.newer=e.newer),e===this.m_oldest&&(this.m_oldest=e.newer),e.newer=null,e.older=this.m_newest,(0,i.assert)(null!==this.m_newest);const t=this.m_newest;(0,i.assert)(null===t.newer),t.newer=e,this.m_newest=e}}},2626:function(e,t,n){\"use strict\";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);
947r&&!(\"get\"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)\"default\"===n||Object.prototype.hasOwnProperty.call(t,n)||i(t,e,n)};Object.defineProperty(t,\"__esModule\",{value:!0}),r(n(1153),t),r(n(6802),t),r(n(4773),t),r(n(2369),t),r(n(5199),t),r(n(1781),t)},1781:(e,t,n)=>{\"use strict\";var i;Object.defineProperty(t,\"__esModule\",{value:!0}),t.GeoJsonTiler=void 0;const r=n(242),o=n(8152),s=null!==(i=r.default)&&void 0!==i?i:r,a=-(-2&-Math.ceil(204.8));t.GeoJsonTiler=class{constructor(){this.indexes=new Map}dispose(){}async connect(){return await Promise.resolve()}async registerIndex(e,t){if(!this.indexes.has(e))return await this.updateIndex(e,t)}async updateIndex(e,t){if(t instanceof URL){const e=await fetch(t.href);if(!e.ok)throw new Error(`GeoJsonTiler: Unable to fetch ${t.href}: ${e.statusText}`);t=await e.json()}const n=(0,o.isFeatureGeometry)(t)||\"GeometryCollection\"===t.type||\"Feature\"===t.type&&void 0===t.id||\"FeatureCollection\"===t.type&&t.features.length>0&&void 0===t.features[0].id,i=s(t,{maxZoom:20,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:a,lineMetrics:!1,promoteId:null,generateId:n,debug:0});i.geojson=t,this.indexes.set(e,i)}async getTile(e,t){const n=this.indexes.get(e);if(void 0===n)throw new Error(\"Tile not found\");const i=n.getTile(t.level,t.column,t.row);return null!==i&&(i.layer=e),i||{}}}},1153:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.ThemedTileDecoder=void 0;const i=n(7769),r=n(4342).LoggerManager.instance.create(\"ThemedTileDecoder\");t.ThemedTileDecoder=class{constructor(){this.m_storageLevelOffset=0}dispose(){}decodeTile(e,t,n){return void 0===this.m_styleSetEvaluator?(r.info(\"cannot decode tile, as there is not style available\"),Promise.resolve(void 0)):this.decodeThemedTile(e,t,this.m_styleSetEvaluator,n)}getTileInfo(e,t,n){return Promise.resolve(void 0)}configure(e,t){void 0!==(null==e?void 0:e.styleSet)&&(this.m_styleSetEvaluator=new i.StyleSetEvaluator(e)),this.m_styleSetEvaluator&&this.m_styleSetEvaluator.setEnabledFeatures(null==e?void 0:e.enabledFeatures),void 0!==(null==e?void 0:e.languages)&&(this.languages=e.languages),void 0!==t&&void 0!==t.storageLevelOffset&&(this.m_storageLevelOffset=t.storageLevelOffset)}}},6802:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.TileDecoderService=void 0;const i=n(8152),r=n(2616),o=n(1984),s=n(4342),a=n(2369),l=s.LoggerManager.instance.create(\"TileDecoderService\");class c extends a.WorkerService{static start(e,t){return new c(e,t)}constructor(e,t){super(e),this.serviceId=e,this.m_decoder=t,this.m_decoder.connect()}handleRequest(e){return i.WorkerDecoderProtocol.isDecodeTileRequest(e)?this.handleDecodeTileRequest(e):i.WorkerDecoderProtocol.isTileInfoRequest(e)?this.handleTileInfoRequest(e):super.handleRequest(e)}handleMessage(e){i.WorkerDecoderProtocol.isConfigurationMessage(e)?this.handleConfigurationMessage(e):l.error(`[${this.serviceId}]: invalid message ${e.type}`)}async handleDecodeTileRequest(e){const t=r.TileKey.fromMortonCode(e.tileKey),n=(0,i.getProjection)(e.projection),s=await this.m_decoder.decodeTile(e.data,t,n),a=[],l=e=>{void 0!==e&&e.buffer.byteLength>0&&!a.includes(e.buffer)&&a.push(e.buffer)};return null==s||s.geometries.forEach((e=>{var t,n,i;if(null===(t=e.vertexAttributes)||void 0===t||t.forEach((e=>l(e))),null===(n=e.interleavedVertexAttributes)||void 0===n||n.forEach((e=>l(e))),l(e.index),l(e.edgeIndex),Array.isArray(e.objInfos)&&1===e.objInfos.length&&\"object\"==typeof e.objInfos[0]&&(null===(i=e.objInfos[0])||void 0===i?void 0:i.hasOwnProperty(\"displacementMap\"))){const t=e.objInfos[0];l(t.displacementMap)}Array.isArray(e.attachments)&&e.attachments.forEach((e=>{l(e.index),l(e.edgeIndex)}))})),null==s||s.techniques.forEach((e=>{(0,o.addBuffersToTransferList)(e,a)})),{response:s,transferList:a}}handleTileInfoRequest(e){const t=r.TileKey.fromMortonCode(e.tileKey),n=(0,i.getProjection)(e.projection);return this.m_decoder.getTileInfo(e.data,t,n).then((e=>({response:e,transferList:void 0!==e&&void 0!==e.transferList?e.transferList:[]})))}handleConfigurationMessage(e){this.m_decoder.configure(e,e.options)}}t.TileDecoderService=c},4773:(e,t,n)=>{\"use strict\";
947Object.defineProperty(t,\"__esModule\",{value:!0}),t.TilerService=void 0;const i=n(8152),r=n(2616),o=n(1781),s=n(2369);class a extends s.WorkerService{static start(e){return new a(e)}constructor(e){super(e),this.serviceId=e,this.tiler=new o.GeoJsonTiler}handleRequest(e){return i.WorkerTilerProtocol.isRegisterIndexRequest(e)?this.handleRegisterIndexRequest(e):i.WorkerTilerProtocol.isUpdateIndexRequest(e)?this.handleUpdateIndexRequest(e):i.WorkerTilerProtocol.isTileRequest(e)?this.handleTileRequest(e):super.handleRequest(e)}async handleTileRequest(e){const t=r.TileKey.fromMortonCode(e.tileKey);return{response:await this.tiler.getTile(e.index,t)||{}}}async handleRegisterIndexRequest(e){const t=\"string\"==typeof e.input?new URL(e.input):e.input;return await this.tiler.registerIndex(e.id,t),{response:{}}}async handleUpdateIndexRequest(e){const t=\"string\"==typeof e.input?new URL(e.input):e.input;return this.tiler.updateIndex(e.id,t),{response:{}}}}t.TilerService=a},2369:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.WorkerService=void 0;const i=n(8152),r=n(4342).LoggerManager.instance.create(\"WorkerService\",{enabled:!0});t.WorkerService=class{constructor(e){this.serviceId=e,this.m_pendingRequests=new Map,this.onMessage=e=>{if(\"string\"==typeof e.data.service&&e.data.service===this.serviceId)try{if(i.WorkerServiceProtocol.isRequestMessage(e.data)){const t=e.data,n={service:t.service,messageId:t.messageId,responseSent:!1};this.m_pendingRequests.set(t.messageId,n),this.tryHandleRequest(t.request).then((e=>{this.doSendResponse(n,{service:this.serviceId,type:i.WorkerServiceProtocol.ServiceMessageName.Response,messageId:t.messageId,response:e.response},e.transferList)})).catch((e=>{this.doSendResponse(n,{service:this.serviceId,type:i.WorkerServiceProtocol.ServiceMessageName.Response,messageId:t.messageId,errorMessage:e.toString(),errorStack:e.stack})}))}else this.tryHandleMessage(e.data)}catch(t){r.error(`[${this.serviceId}]: Unhandled exception when handling ${e.type}`)}},self.addEventListener(\"message\",this.onMessage);const t={service:e,type:i.WorkerServiceProtocol.ServiceMessageName.Initialized};self.postMessage(t)}destroy(){this.cancelAllPendingRequests(),self.removeEventListener(\"message\",this.onMessage)}handleMessage(e){r.error(`[${this.serviceId}]: Invalid message ${e.type}`)}handleRequest(e){throw new Error(`ServiceAdapter[${this.serviceId}]: Invalid request '${e.type}'`)}tryHandleMessage(e){try{this.handleMessage(e)}catch(t){r.error(`[${this.serviceId}]: Failed, handling message ${e.type}`)}}tryHandleRequest(e){try{return this.handleRequest(e)}catch(e){return r.error(`[${this.serviceId}]: Failure`,e),Promise.reject(e)}}doSendResponse(e,t,n){e.responseSent||(void 0!==n?self.postMessage(t,n):self.postMessage(t),e.responseSent=!0,this.m_pendingRequests.delete(e.messageId))}cancelAllPendingRequests(){this.m_pendingRequests.forEach((e=>{this.doSendResponse(e,{service:this.serviceId,type:i.WorkerServiceProtocol.ServiceMessageName.Response,messageId:e.messageId,errorMessage:\"cancelled\"})}))}}},5199:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.WorkerServiceManager=void 0;const i=n(8152),r=n(2369);class o extends r.WorkerService{static getInstance(){return void 0===this.m_service&&(this.m_service=new o(i.WorkerServiceProtocol.WORKER_SERVICE_MANAGER_SERVICE_ID)),this.m_service}constructor(e=i.WorkerServiceProtocol.WORKER_SERVICE_MANAGER_SERVICE_ID){super(e),this.m_factories=new Map,this.m_services=new Map}register(e){this.m_factories.set(e.serviceType,e.factory)}handleRequest(e){if(e.type===i.WorkerServiceProtocol.Requests.CreateService){if(void 0!==this.m_services.get(e.targetServiceId))throw Error(`error - service with targetServiceId='${e.targetServiceId}' already running, ignoring CreateService request`);const t=this.m_factories.get(e.targetServiceType);if(void 0===t)throw Error(`unknown targetServiceType requested: '${e.targetServiceType}'`);const n=t(e.targetServiceId);this.m_services.set(e.targetServiceId,n)}if(e.type===i.WorkerServiceProtocol.Requests.DestroyService){const t=this.m_services.get(e.targetServiceId);if(void 0===t)throw Error(`unknown targetServiceId '${e.targetServiceId}'`);t.destroy(),this.m_services.delete(e.targetServiceId)}return Promise.resolve({response:{}})}}
947t.WorkerServiceManager=o},4250:function(e,t,n){\"use strict\";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!(\"get\"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)\"default\"===n||Object.prototype.hasOwnProperty.call(t,n)||i(t,e,n)};Object.defineProperty(t,\"__esModule\",{value:!0}),r(n(8583),t),r(n(8014),t),r(n(8955),t),r(n(8177),t),r(n(8878),t),r(n(5997),t),r(n(674),t),r(n(4744),t),r(n(4258),t),r(n(398),t),r(n(4919),t),r(n(5551),t),r(n(4821),t),r(n(4877),t),r(n(8484),t),r(n(460),t),r(n(4121),t),r(n(1549),t),r(n(2462),t),r(n(182),t),r(n(872),t),r(n(9489),t),r(n(4067),t),r(n(71),t),r(n(3224),t),r(n(2141),t),r(n(3298),t),r(n(9528),t),r(n(8578),t)},460:function(e,t,n){\"use strict\";var i=this&&this.__rest||function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&\"function\"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};Object.defineProperty(t,\"__esModule\",{value:!0}),t.CirclePointsMaterial=void 0;const r=n(82),o=n(2141),s=n(8578);class a extends o.RawShaderMaterial{constructor(e){const t=new r.Color;let n,o,l,c;if(e){const{size:s,color:u,opacity:h}=e,d=i(e,[\"size\",\"color\",\"opacity\"]);n=s,o=u,l=h,d.name=\"CirclePointsMaterial\",d.vertexShader=\"\\nuniform float size;\\nuniform mat4 modelViewMatrix;\\nuniform mat4 projectionMatrix;\\n\\nattribute vec3 position;\\n\\nvoid main() {\\n vec3 transformed = vec3(position);\\n vec4 mvPosition = modelViewMatrix * vec4(transformed, 1.0);\\n\\n gl_Position = projectionMatrix * mvPosition;\\n gl_PointSize = size;\\n}\\n\",d.fragmentShader=\"\\nprecision highp float;\\nprecision highp int;\\n\\nuniform vec3 diffuseColor;\\nuniform float opacity;\\n\\nvoid main() {\\n float alpha = opacity;\\n\\n float radius = 0.5;\\n vec2 coords = gl_PointCoord.xy - vec2(0.5);\\n float len = length(coords);\\n float falloff = fwidth(len);\\n float threshold = 1.0 - smoothstep(radius - falloff, radius, len);\\n alpha *= threshold;\\n\\n gl_FragColor = vec4(diffuseColor, alpha);\\n}\",d.uniforms=r.UniformsUtils.merge([{size:new r.Uniform(a.DEFAULT_CIRCLE_SIZE),diffuseColor:new r.Uniform(t),opacity:new r.Uniform(1)},r.UniformsLib.fog]),d.depthTest=!1,d.extensions=Object.assign(Object.assign({},d.extensions),{derivatives:!0}),c=d}super(c),(0,s.enforceBlending)(this),this.type=\"CirclePointsMaterial\",this.setOpacity(1),void 0!==n&&(this.size=n),void 0!==o&&(this.color=o),void 0!==l&&this.setOpacity(l)}get size(){return this.uniforms.size.value}set size(e){this.uniforms.size.value=e}get color(){return this.uniforms.diffuseColor.value}set color(e){this.uniforms.diffuseColor.value.copy(e)}}t.CirclePointsMaterial=a,a.DEFAULT_CIRCLE_SIZE=1},4121:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.CopyMaterial=t.CopyShader=void 0;const i=n(82);t.CopyShader={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:\"\\n varying vec2 vUv;\\n void main() {\\n vUv = uv;\\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\\n }\",fragmentShader:\"\\n uniform float opacity;\\n uniform sampler2D tDiffuse;\\n varying vec2 vUv;\\n void main() {\\n vec4 texel = texture2D( tDiffuse, vUv );\\n gl_FragColor = opacity * texel;\\n }\"};class r extends i.ShaderMaterial{constructor(e){super({name:\"CopyMaterial\",uniforms:e,vertexShader:t.CopyShader.vertexShader,fragmentShader:t.CopyShader.fragmentShader,premultipliedAlpha:!0,transparent:!1,blending:i.NoBlending,depthTest:!1,depthWrite:!1})}}t.CopyMaterial=r}
947,1549:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.EdgeMaterial=void 0;const i=n(82),r=n(8014),o=n(8955),s=n(8177),a=n(2141),l=n(8578);class c extends a.RawShaderMaterial{constructor(e){var t;let n;if(e){const r={},a=void 0!==e.extrusionRatio&&e.extrusionRatio>=o.ExtrusionFeatureDefs.DEFAULT_RATIO_MIN&&e.extrusionRatio<o.ExtrusionFeatureDefs.DEFAULT_RATIO_MAX;e.displacementMap&&(0,l.setShaderDefine)(r,\"USE_DISPLACEMENTMAP\",!0),a&&(0,l.setShaderDefine)(r,\"USE_EXTRUSION\",!0),!0===e.vertexColors&&(0,l.setShaderDefine)(r,\"USE_COLOR\",!0),n={name:\"EdgeMaterial\",vertexShader:\"\\n#define EDGE_DEPTH_OFFSET 0.0001\\n\\n#ifdef USE_COLOR\\nattribute vec4 color;\\n#else\\nuniform vec3 color;\\n#endif\\n\\n// SHADER_NAME may be defined by THREE.JS own shaders in which case these attributes & uniforms are\\n// already defined\\n#ifndef SHADER_NAME\\nattribute vec3 position;\\nuniform mat4 modelViewMatrix;\\nuniform mat4 projectionMatrix;\\nuniform mat3 normalMatrix;\\n#endif\\n\\nuniform vec3 edgeColor;\\nuniform float edgeColorMix;\\n\\n#ifdef USE_DISPLACEMENTMAP\\nattribute vec3 normal;\\nattribute vec2 uv;\\nuniform sampler2D displacementMap;\\n#endif\\n\\nvarying vec3 vColor;\\n\\n#ifdef USE_EXTRUSION\\n#include <extrusion_pars_vertex>\\n#endif\\n\\n#ifdef USE_FADING\\n#include <fading_pars_vertex>\\n#endif\\n\\nvoid main() {\\n\\n vColor = mix(edgeColor.rgb, color.rgb, edgeColorMix);\\n\\n vec3 transformed = vec3( position );\\n\\n #ifdef USE_EXTRUSION\\n #include <extrusion_vertex>\\n #endif\\n\\n #ifdef USE_DISPLACEMENTMAP\\n transformed += normalize( normal ) * texture2D( displacementMap, uv ).x;\\n #endif\\n\\n vec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\\n\\n gl_Position = projectionMatrix * mvPosition;\\n // After projection gl_Position contains clip space coordinates of each vertex\\n // before perspective division (1 / w), thus only vertexes with -w < z < w should\\n // be displayed and offset. We offset only those edges which z coordinate in NDC\\n // space is between: -inf < z < 1\\n float depthOffset = step(-1.0, -gl_Position.z / gl_Position.w) * EDGE_DEPTH_OFFSET;\\n gl_Position.z -= depthOffset;\\n\\n #ifdef USE_FADING\\n #include <fading_vertex>\\n #endif\\n}\",fragmentShader:\"\\nprecision highp float;\\nprecision highp int;\\n\\nvarying vec3 vColor;\\n\\n#ifdef USE_EXTRUSION\\n#include <extrusion_pars_fragment>\\n#endif\\n\\n#ifdef USE_FADING\\n#include <fading_pars_fragment>\\n#endif\\n\\nvoid main() {\\n float alphaValue = 1.0;\\n gl_FragColor = vec4(vColor, alphaValue);\\n\\n #ifdef USE_EXTRUSION\\n #include <extrusion_fragment>\\n #endif\\n\\n #ifdef USE_FADING\\n #include <fading_fragment>\\n #endif\\n}\",uniforms:{color:new i.Uniform(new i.Color(c.DEFAULT_COLOR)),edgeColor:new i.Uniform(new i.Color(c.DEFAULT_COLOR)),edgeColorMix:new i.Uniform(c.DEFAULT_COLOR_MIX),fadeNear:new i.Uniform(s.FadingFeature.DEFAULT_FADE_NEAR),fadeFar:new i.Uniform(s.FadingFeature.DEFAULT_FADE_FAR),extrusionRatio:new i.Uniform(o.ExtrusionFeatureDefs.DEFAULT_RATIO_MAX),displacementMap:new i.Uniform(null!==(t=e.displacementMap)&&void 0!==t?t:new i.Texture)},depthWrite:!1,defines:r,rendererCapabilities:e.rendererCapabilities}}super(n),(0,l.enforceBlending)(this),s.FadingFeature.patchGlobalShaderChunks(),r.ExtrusionFeature.patchGlobalShaderChunks(),void 0!==e&&(void 0!==e.color&&this.color.set(e.color),void 0!==e.colorMix&&(this.colorMix=e.colorMix),void 0!==e.fadeNear&&(this.fadeNear=e.fadeNear),void 0!==e.fadeFar&&(this.fadeFar=e.fadeFar),void 0!==e.displacementMap&&(this.displacementMap=e.displacementMap),void 0!==e.extrusionRatio&&(this.extrusionRatio=e.extrusionRatio))}get objectColor(){return this.uniforms.color.value}set objectColor(e){this.uniforms.color.value.copy(e)}get color(){return this.uniforms.edgeColor.value}set color(e){this.uniforms.edgeColor.value.copy(e)}get lineWidth(){return this.linewidth}set lineWidth(e){this.linewidth=e,this.linewidth<=0?this.visible=!1:this.visible=!0}get colorMix(){return this.uniforms.edgeColorMix.value}set colorMix(e){this.uniforms.edgeColorMix.value!==e&&(this.uniforms.edgeColorMix.value=e)}get fadeNear(){return this.uniforms.fadeNear.value}set fadeNear(e){this.uniforms.fadeNear.value=e}get fadeFar(){return this.uniforms.fadeFar.value}set fadeFar(e){this.uniforms.fadeFar.value!==e&&(this.uniforms.fadeFar.value=e,(0,l.setShaderMaterialDefine)(this,\"USE_FADING\",e>0))}get extrusionRatio(){return this.uniforms.extrusionRatio.value}set extrusionRatio(e){if(this.uniforms.extrusionRatio.value===e)return;this.uniforms.extrusionRatio.value=e;const t=e>=o.ExtrusionFeatureDefs.DEFAULT_RATIO_MIN;(0,l.setShaderMaterialDefine)(this,\"USE_EXTRUSION\",t)}get displacementMap(){return this.uniforms.displacementMap.value}set displacementMap(e){if(this.uniforms.displacementMap.value===e)return;this.uniforms.displacementMap.value=e;const t=null!==e;t&&(this.uniforms.displacementMap.value.needsUpdate=!0),(0,l.setShaderMaterialDefine)(this,\"USE_DISPLACEMENTMAP\",t)}}t.EdgeMaterial=c,c.DEFAULT_COLOR=0,c.DEFAULT_COLOR_MIX=0}
947,2462:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.GroundAtmosphereMaterial=t.GroundAtmosphereShader=void 0;const i=n(82),r=n(2141),o=n(1870),s=n(8578);t.GroundAtmosphereShader={uniforms:{u_eyePositionWorld:new i.Uniform(new i.Vector3),u_lightDirectionWorld:new i.Uniform(new i.Vector3(0,1,0)),u_modelViewProjection:new i.Uniform(new i.Matrix4),u_atmosphereEnv:new i.Uniform(new i.Vector3(6384515.136999999,6537590.425,0)),u_hsvCorrection:new i.Uniform(new i.Vector3(0,0,0)),topColor:new i.Uniform(new i.Color(30719)),bottomColor:new i.Uniform(new i.Color(16777215)),offset:new i.Uniform(33),exponent:new i.Uniform(.6),fogColor:new i.Uniform(new i.Color(30719)),fogNear:new i.Uniform(new i.Color(30719)),fogFar:new i.Uniform(new i.Color(16777215))},vertexShader:`\\n\\n #define IMPROVE_INTERSECT_PRECISION 1\\n #define IMPROVE_DOT_PRECISION 1\\n\\n precision highp float;\\n precision highp int;\\n\\n attribute vec4 position;\\n\\n // Base mandatory uniforms\\n uniform mat4 u_modelViewProjection;\\n uniform vec3 u_eyePositionWorld;\\n uniform vec3 u_lightDirectionWorld;\\n\\n uniform vec3 u_atmosphereEnv; // Atmosphere inner and outer radius, camera height\\n uniform vec3 u_hsvCorrection;\\n\\n const float Pi = 3.141592653589793;\\n const float Kr = 0.0025;\\n const float Km = 0.0015;\\n const float Kr4PI = Kr * 4.0 * Pi;\\n const float Km4PI = Km * 4.0 * Pi;\\n const float ESun = 25.0; // should be 15.0\\n const float KmESun = Km * ESun;\\n const float KrESun = Kr * ESun;\\n const vec3 InvWavelength = vec3(\\n 1.0 / pow(0.650, 4.0), // Red\\n 1.0 / pow(0.570, 4.0), // Green\\n 1.0 / pow(0.475, 4.0)); // Blue\\n\\n const int nSamples = 2;\\n const float fSamples = 2.0;\\n\\n varying vec3 v_rayleighColor;\\n varying vec3 v_mieColor;\\n varying vec3 v_vertToCamera;\\n varying vec3 v_vertToOrigin;\\n\\n ${o.default.atmosphere_vertex_utils}\\n\\n //\\n // Computes rayleight and mia atmosphere factors for ground.\\n //\\n // Code based on GPU Gems article.\\n //\\n // Author: Sean O'Neil\\n //\\n // Copyright (c) 2004 Sean O'Neil\\n //\\n // https://developer.nvidia.com/gpugems/gpugems2/part-ii-shading-lighting-and-shadows/chapter-16-accurate-atmospheric-scattering\\n //\\n // Further modifications by HERE.\\n //\\n AtmosphereColor computeGroundAtmosphere(vec3 v3Pos, vec3 vLightDir)\\n {\\n // Retrieve environment variables\\n float fInnerRadius = u_atmosphereEnv.x;\\n float fOuterRadius = u_atmosphereEnv.y;\\n float fCameraHeight = u_atmosphereEnv.z;\\n\\n // All that may be moved to const or define(s) at further optimizations:\\n float fScale = 1.0 / (fOuterRadius - fInnerRadius);\\n float fScaleOverScaleDepth = fScale / RayleighScaleDepth;\\n float fCameraHeight2 = fCameraHeight * fCameraHeight;\\n float fOuterRadius2 = fOuterRadius * fOuterRadius;\\n\\n // Get the ray from the camera to the vertex and its length (which is the far point of the ray passing through the atmosphere)\\n vec3 v3Ray = v3Pos - u_eyePositionWorld;\\n float fFar = length(v3Ray);\\n v3Ray /= fFar;\\n\\n#if !defined(IMPROVE_DOT_PRECISION)\\n vec3 v3Dir = normalize(v3Pos);\\n#endif\\n\\n#ifdef CAMERA_IN_SPACE\\n\\n // Calculate first point of camera ray and sphere intersection.\\n float fNear = getNearSphereIntersect(u_eyePositionWorld, v3Ray, fCameraHeight2, fOuterRadius2);\\n // Make far relative to first atmosphere intersection, setting it to\\n // the length of ray passed through atmosphere\\n fFar -= fNear;\\n\\n // Compute the ray's starting position within the atmosphere, then\\n // calculate its scattering offset\\n vec3 v3Start = u_eyePositionWorld + v3Ray * fNear;\\n float fDepth = exp((fInnerRadius - fOuterRadius) / RayleighScaleDepth);\\n\\n#else // CAMERA_IN_ATMOSPHERE\\n\\n // The ray starts already in atmosphere\\n vec3 v3Start = u_eyePositionWorld;\\n // Virtually fNear is just at eye position, so ray passing through atmosphere does not shorten\\n // fFar -= 0.0;\\n float fDepth = exp((fInnerRadius - fCameraHeight) / RayleighScaleDepth);\\n#endif\\n\\n#if defined(IMPROVE_DOT_PRECISION)\\n float fCameraAngle = dot(-v3Ray, v3Pos) / length(v3Pos);\\n#else\\n float fCameraAngle = dot(-v3Ray, v3Dir);\\n#endif\\n float fCameraScale = scale(fCameraAngle);\\n\\n#ifdef DYNAMIC_LIGHT\\n // When we want the atmosphere to be uniform over the globe so it is set to 1.0.\\n #if defined(IMPROVE_DOT_PRECISION)\\n // The light angle for given light source may be calculated as:\\n // angle = dot(vLightDir, v3Dir) / length(v3Dir);\\n // where v3Dir holds normalized vertex position, but for precision issues we v3Pos (un-normalized)\\n float fLightAngle = dot(vLightDir, v3Pos) / length(v3Pos);\\n #else\\n float fLightAngle = dot(vLightDir, v3Dir);\\n #endif\\n#else\\n float fLightAngle = 1.0;\\n#endif\\n float fLightScale = scale(fLightAngle);\\n\\n float fCameraOffset = fDepth * fCameraScale;\\n float fTemp = (fLightScale + fCameraScale);\\n\\n // Initialize the scattering loop variables\\n float fSampleLength = fFar / fSamples;\\n float fScaledLength = fSampleLength * fScale;\\n vec3 v3SampleRay = v3Ray * fSampleLength;\\n vec3 v3SamplePoint = v3Start + v3SampleRay * 0.5;\\n\\n // Now loop through the sample rays\\n vec3 v3BaseColor = vec3(0.0);\\n vec3 v3Attenuate = vec3(0.0);\\n for(int i = 0; i < nSamples; i++)\\n {\\n float fHeight = length(v3SamplePoint);\\n float fDepth = exp(fScaleOverScaleDepth * (fInnerRadius - fHeight));\\n float fScatter = fDepth * fTemp - fCameraOffset;\\n // Compute color factors\\n v3Attenuate = exp(-fScatter * (InvWavelength * Kr4PI + Km4PI));\\n v3BaseColor += v3Attenuate * (fDepth * fScaledLength);\\n // Move to the next point\\n v3SamplePoint += v3SampleRay;\\n }\\n\\n AtmosphereColor color;\\n color.mie = v3BaseColor * (InvWavelength * KrESun + KmESun);
947\\n // Calculate the attenuation factor for the ground\\n color.rayleigh = v3Attenuate;\\n\\n return color;\\n }\\n\\n void main(void)\\n {\\n #ifdef DYNAMIC_LIGHT\\n vec3 vLightDir = u_lightDirectionWorld;\\n #else\\n vec3 vLightDir = u_eyePositionWorld;\\n #endif\\n vLightDir = normalize(vLightDir);\\n\\n AtmosphereColor atmColor = computeGroundAtmosphere(position.xyz, vLightDir);\\n v_mieColor = atmColor.mie;\\n v_rayleighColor = atmColor.rayleigh;\\n v_vertToCamera = u_eyePositionWorld - position.xyz;\\n v_vertToOrigin = normalize(position.xyz);\\n\\n gl_Position = u_modelViewProjection * position;\\n }\\n `,fragmentShader:`\\n\\n // Exposure correction gives more subtle gradients on the ground.\\n #define CORRECT_EXPOSURE 1\\n #define FADE_DEPTH 1\\n #define NIGHT_LOCAL 1\\n\\n precision highp float;\\n precision highp int;\\n\\n #ifdef CORRECT_COLOR\\n uniform vec3 u_hsvCorrection; // Hue, saturation, brightness\\n #endif\\n\\n uniform vec3 u_atmosphereEnv; // Atmosphere inner and outer radius, camera height\\n uniform vec3 u_eyePositionWorld;\\n uniform vec3 u_lightDirectionWorld;\\n\\n const float g = -0.95;\\n const float g2 = g * g;\\n\\n varying vec3 v_rayleighColor;\\n varying vec3 v_mieColor;\\n varying vec3 v_vertToCamera;\\n varying vec3 v_vertToOrigin;\\n\\n ${o.default.atmosphere_fragment_utils}\\n\\n void main(void)\\n {\\n float fInnerRadius = u_atmosphereEnv.x;\\n float fOuterRadius = u_atmosphereEnv.y;\\n float fCameraHeight = u_atmosphereEnv.z;\\n\\n #ifdef DYNAMIC_LIGHT\\n vec3 vLightDir = u_lightDirectionWorld;\\n #else\\n vec3 vLightDir = u_eyePositionWorld;\\n #endif\\n vLightDir = normalize(vLightDir);\\n\\n // GPU gems mix of ground solution, with custom alpha settings\\n vec3 cRgb = v_mieColor + 0.25 * v_rayleighColor;\\n\\n // Not needed for HDR frame buffer\\n #if !defined(HDR_FRAME_BUFFER) && defined(CORRECT_EXPOSURE)\\n // Interesting results with exposure factor: 2.0, 3.5, 4.0\\n cRgb = correctExposure(cRgb, 3.0);\\n #endif\\n\\n #ifdef CORRECT_COLOR\\n cRgb = correctColor(cRgb, u_hsvCorrection);\\n #endif\\n\\n // Base atmosphere opacity\\n float fAtmosphereAlpha = 1.0;\\n\\n // Factor based on the distance of camera atmosphere and ground, results are:\\n // 0.0 = camera on the ground surface,\\n // 1.0 = at the outer edge of the atmosphere.\\n float fDepthFactor = clamp((fCameraHeight - fInnerRadius) /\\n (fOuterRadius - fInnerRadius), 0.0, 1.0);\\n #ifdef FADE_DEPTH\\n // Fade alpha based on the distance of camera between atmosphere layers\\n #ifdef FADE_DEPTH_LINEAR\\n fAtmosphereAlpha *= fDepthFactor;\\n #else\\n fAtmosphereAlpha *= pow(fDepthFactor, 1.5);\\n #endif\\n #endif\\n\\n#if defined(FADE_NIGHT) || defined(DARKEN_NIGHT)\\n #ifdef DYNAMIC_LIGHT\\n // Adjust factor based on time of day, results are:\\n // 0.0 = night,\\n // 1.0 = day.\\n #ifdef NIGHT_GLOBAL\\n // Global night fade based on camera and light orientation\\n float fNightFactor = clamp(dot(normalize(u_eyePositionWorld), vLightDir), 0.0, 1.0);\\n fNightFactor = pow(fNightFactor, 0.5);\\n #else // NIGHT_LOCAL\\n float fNightFactor =\\n clamp(dot(v_vertToOrigin, vLightDir) / length(v_vertToOrigin), 0.0, 1.0);\\n fNightFactor = pow(fNightFactor, 0.8);\\n #endif\\n #else\\n float fNightFactor = 1.0;\\n #endif\\n#endif\\n\\n #ifdef FADE_NIGHT\\n // Adjust alpha for night side of the globe\\n fAtmosphereAlpha *= fNightFactor;\\n #endif\\n\\n #ifdef DARKEN_NIGHT\\n // Change the brightness depending on night / day side.\\n // NOTE: Darkening should be rather applied in HSV space, without loss on saturation,\\n // but it is much more GPU consuming.\\n const float minBrightness = 0.5;
947\\n float fDarkenFactor = clamp(fNightFactor, minBrightness, 1.0);\\n cRgb *= fDarkenFactor;\\n #endif\\n\\n #ifdef EXPOSURE_DEPTH\\n // Control exposure depending from ground distance\\n float exposureBoost = 3.0 - fDepthFactor;\\n cRgb = correctExposure(cRgb, exposureBoost);\\n #endif\\n\\n // Experimental fading out of focus point - similar to fresnel effect in top view.\\n // This fade is handy to better expose cartographic/map features in screen center.\\n float fFocusFactor = 1.0 - clamp(dot(normalize(v_vertToCamera), v_vertToOrigin), 0.0, 1.0) + 0.1;\\n fFocusFactor = pow(fFocusFactor, 2.5);\\n fAtmosphereAlpha *= fFocusFactor;\\n\\n // Integrate all features\\n gl_FragColor = vec4(cRgb, fAtmosphereAlpha);\\n }\\n `};class a extends r.RawShaderMaterial{constructor(e){let n;e&&(n={name:\"GroundAtmosphereMaterial\",vertexShader:t.GroundAtmosphereShader.vertexShader,fragmentShader:t.GroundAtmosphereShader.fragmentShader,uniforms:t.GroundAtmosphereShader.uniforms,transparent:!0,depthTest:!1,depthWrite:!1,side:i.FrontSide,blending:i.NormalBlending,fog:!1,rendererCapabilities:e.rendererCapabilities}),super(n)}setDynamicLighting(e){(0,s.setShaderMaterialDefine)(this,\"DYNAMIC_LIGHT\",e)}set outerRadius(e){this.uniforms.u_atmosphereEnv.value.y=e}get outerRadius(){return this.uniforms.u_atmosphereEnv.value.y}set innerRadius(e){this.uniforms.u_atmosphereEnv.value.x=e}get innerRadius(){return this.uniforms.u_atmosphereEnv.value.x}updateUniforms(e,t,n,i){const r=this.getCameraInfo(t,n);if(void 0===e||!e.isMaterial)throw Error(\"Wrong object used, only Material objects are supported\");if(!(e.uniforms&&e.uniforms.u_atmosphereEnv&&e.uniforms.u_hsvCorrection&&e.uniforms.u_eyePositionWorld&&e.uniforms.u_modelViewProjection&&e.uniforms.u_lightDirectionWorld))throw Error(\"Atmosphere material has missing uniforms\");{const t=r.eyePos,n=r.modelViewProjection,o=r.eyeHeight;e.uniforms.u_eyePositionWorld.value.copy(t),e.uniforms.u_modelViewProjection.value.copy(n),e.uniforms.u_atmosphereEnv.value.z=o,e.uniforms.u_lightDirectionWorld.value=i.clone();const a=o>this.outerRadius,l=(0,s.setShaderDefine)(e.defines,\"CAMERA_IN_SPACE\",a),c=(0,s.setShaderDefine)(e.defines,\"CAMERA_IN_ATMOSPHERE\",!a);e.needsUpdate=e.needsUpdate||l||c}}getCameraInfo(e,t,n=!1){if(n){const n=(new i.Matrix4).identity(),r=(new i.Matrix4).copy(e.matrixWorld).invert().transpose(),o=t.projectionMatrix,s=new i.Matrix4;s.multiplyMatrices(r,n),s.multiplyMatrices(o,s);const a=new i.Vector3;e.getWorldPosition(a);const l=new i.Vector3;return t.getWorldPosition(l),{modelViewProjection:s,eyePos:a,eyeHeight:l.distanceTo(a)}}{const n=e.matrixWorld,r=t.matrixWorldInverse,o=t.projectionMatrix,s=new i.Matrix4;s.multiplyMatrices(r,n),s.multiplyMatrices(o,s);const a=new i.Vector3;t.getWorldPosition(a);const l=new i.Vector3;e.getWorldPosition(l);const c=l.distanceTo(a);return a.sub(l),{modelViewProjection:s,eyePos:a,eyeHeight:c}}}}t.GroundAtmosphereMaterial=a},182:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.isHighPrecisionLineMaterial=t.HighPrecisionLineMaterial=void 0;const i=n(82),r=n(2141),o=n(7133);
947class s extends r.RawShaderMaterial{constructor(e){Object.assign(i.ShaderChunk,o.default);const t=e?{name:\"HighPrecisionLineMaterial\",vertexShader:\"\\n#ifdef USE_COLOR\\nattribute vec4 color;\\nvarying vec3 vColor;\\n#endif\\n\\n// uniforms to implement double-precision\\nuniform mat4 u_mvp; // combined modelView and projection matrix\\nuniform vec3 u_eyepos; // eye position major\\nuniform vec3 u_eyepos_lowpart; // eye position minor ((double) eyepos - (float) eyepos)\\n\\n// vertex attributes\\nattribute vec3 position; // high part\\nattribute vec3 positionLow; // low part\\n\\n#include <high_precision_vert_func>\\n\\nvoid main() {\\n #ifdef USE_COLOR\\n vColor = color.rgb;\\n #endif\\n\\n vec3 pos = subtractDblEyePos(position);\\n gl_Position = u_mvp * vec4(pos, 1.0);\\n}\",fragmentShader:\"\\nprecision highp float;\\nprecision highp int;\\n\\nuniform vec3 diffuseColor;\\nuniform float opacity;\\n\\n#ifdef USE_COLOR\\nvarying vec3 color;\\n#endif\\n\\nvoid main() {\\n #ifdef USE_COLOR\\n gl_FragColor = vec4( diffuseColor * vColor, opacity );\\n #else\\n gl_FragColor = vec4( diffuseColor, opacity );\\n #endif\\n}\",uniforms:{diffuseColor:new i.Uniform(new i.Color(s.DEFAULT_COLOR)),opacity:new i.Uniform(s.DEFAULT_OPACITY),u_mvp:new i.Uniform(new i.Matrix4),u_eyepos:new i.Uniform(new i.Vector3),u_eyepos_lowpart:new i.Uniform(new i.Vector3)},rendererCapabilities:e.rendererCapabilities}:void 0;t&&Object.assign(t,e),super(t),this.type=\"HighPrecisionLineMaterial\",this.isHighPrecisionLineMaterial=!0,e&&(void 0!==e.color&&this.color.set(e.color),void 0!==e.opacity&&(this.opacity=e.opacity)),this.updateTransparencyFeature()}get color(){return this.uniforms.diffuseColor.value}set color(e){this.uniforms.diffuseColor.value.copy(e)}updateTransparencyFeature(){this.transparent=this.opacity<1}}t.HighPrecisionLineMaterial=s,s.DEFAULT_COLOR=80,s.DEFAULT_OPACITY=1,t.isHighPrecisionLineMaterial=function(e){return void 0!==e&&!0===e.isHighPrecisionLineMaterial}},872:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.isHighPrecisionPointMaterial=t.HighPrecisionPointMaterial=void 0;const i=n(82),r=n(7133);class o extends i.PointsMaterial{constructor(e){Object.assign(i.ShaderChunk,r.default),super(e),this.type=\"HighPrecisionPointMaterial\",this.vertexShader=\"\\n#ifdef USE_COLOR\\nvarying vec3 vColor;\\n#endif\\n\\nuniform float size;\\n\\n// uniforms to implement double-precision\\nuniform mat4 u_mvp; // combined modelView and projection matrix\\nuniform vec3 u_eyepos; // eye position major\\nuniform vec3 u_eyepos_lowpart; // eye position minor ((double) eyepos - (float) eyepos)\\n\\n// vertex attributes\\nattribute vec3 positionLow; // low part\\n\\n#include <high_precision_vert_func>\\n\\nvoid main() {\\n #ifdef USE_COLOR\\n vColor = color.rgb;\\n #endif\\n\\n vec3 pos = subtractDblEyePos(position);\\n gl_Position = u_mvp * vec4(pos, 1.0);\\n\\n // ignore sizeAttenuation for now!\\n gl_PointSize = size;\\n}\",this.fragmentShader=i.ShaderChunk.points_frag,this.fog=!1,this.uniforms={diffuseColor:new i.Uniform(new i.Color(o.DEFAULT_COLOR)),opacity:new i.Uniform(o.DEFAULT_OPACITY),size:new i.Uniform(o.DEFAULT_SIZE),scale:new i.Uniform(o.DEFAULT_SCALE),map:new i.Uniform(new i.Texture),uvTransform:new i.Uniform(new i.Matrix3),u_mvp:new i.Uniform(new i.Matrix4),u_eyepos:new i.Uniform(new i.Vector3),u_eyepos_lowpart:new i.Uniform(new i.Vector3)},this.isHighPrecisionPointMaterial=!0,void 0!==e&&(void 0!==e.color&&this.color.set(e.color),void 0!==e.opacity&&(this.opacity=e.opacity),void 0!==e.size&&(this.size=e.size),void 0!==e.scale&&(this.scale=e.scale),void 0!==e.uvTransform&&(this.uvTransform=e.uvTransform),void 0!==e.map&&(this.map=e.map))}get scale(){return this.uniforms.scale.value}set scale(e){this.uniforms.scale.value=e}get uvTransform(){return this.uniforms.uvTransform.value}set uvTransform(e){this.uniforms.uvTransform.value=e}}t.HighPrecisionPointMaterial=o,o.DEFAULT_COLOR=80,o.DEFAULT_OPACITY=1,o.DEFAULT_SIZE=1,o.DEFAULT_SCALE=1,t.isHighPrecisionPointMaterial=function(e){return void 0!==e&&!0===e.isHighPrecisionPointMaterial}}
947,9489:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.IconMaterial=void 0;const i=n(82),r=n(2141);class o extends r.RawShaderMaterial{constructor(e){super(e?{name:\"IconMaterial\",vertexShader:\"\\nattribute vec4 position;\\nattribute vec4 color;\\nattribute vec2 uv;\\n\\nuniform mat4 modelViewMatrix;\\nuniform mat4 projectionMatrix;\\n\\nvarying vec4 vColor;\\nvarying vec2 vUv;\\n\\nvoid main() {\\n vUv = uv;\\n vColor = color;\\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position.xyz, 1.0);\\n}\",fragmentShader:\"\\nprecision highp float;\\nprecision highp int;\\n\\nuniform sampler2D map;\\n\\nvarying vec4 vColor;\\nvarying vec2 vUv;\\n\\nvoid main() {\\n\\n vec4 color = texture2D(map, vUv.xy);\\n color *= vColor;\\n if (color.a < 0.05) {\\n discard;\\n }\\n gl_FragColor = color;\\n}\",uniforms:{map:new i.Uniform(e.map)},depthTest:!1,depthWrite:!1,transparent:!0,vertexColors:!0,premultipliedAlpha:!0,rendererCapabilities:e.rendererCapabilities}:void 0)}get map(){return this.uniforms.map.value}}t.IconMaterial=o},3224:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.MSAAMaterial=void 0;const i=n(82),r=n(4121);class o extends i.ShaderMaterial{constructor(e){super({uniforms:e,vertexShader:r.CopyShader.vertexShader,fragmentShader:r.CopyShader.fragmentShader,premultipliedAlpha:!0,transparent:!0,blending:i.AdditiveBlending,depthTest:!1,depthWrite:!1})}}t.MSAAMaterial=o},4821:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.MapMeshBasicMaterial=void 0;const i=n(82),r=n(4342),o=n(4744),s=n(8014),a=n(8955),l=n(8177),c=n(4258),u=n(8878),h=n(5997),d=n(674);class p extends i.MeshBasicMaterial{constructor(e){super(e),l.FadingFeature.patchGlobalShaderChunks(),this.addFadingProperties(),this.applyFadingParameters(e),s.ExtrusionFeature.patchGlobalShaderChunks(),this.addExtrusionProperties(),this.applyExtrusionParameters(Object.assign(Object.assign({},e),{zFightingWorkaround:!0})),this.addDisplacementProperties(),this.applyDisplacementParameters(e),o.ColorCorrectionFeature.patchGlobalShaderChunks(),this.addColorCorrectionProperties(),this.applyColorCorrectionParameters(e)}clone(){return(new p).copy(this)}copy(e){return super.copy(e),this.copyFadingParameters(e),this.copyExtrusionParameters(e),this.copyDisplacementParameters(e),this.copyColorCorrectionParameters(e),this}get fadeNear(){return l.FadingFeature.DEFAULT_FADE_NEAR}set fadeNear(e){}get fadeFar(){return l.FadingFeature.DEFAULT_FADE_FAR}set fadeFar(e){}set brightness(e){}get brightness(){return o.ColorCorrectionFeature.DEFAULT_BRIGHTNESS}set gamma(e){}get gamma(){return o.ColorCorrectionFeature.DEFAULT_GAMMA}get extrusionRatio(){return a.ExtrusionFeatureDefs.DEFAULT_RATIO_MAX}set extrusionRatio(e){}get displacementMap(){return null}set displacementMap(e){}setDisplacementMap(e){}addFadingProperties(){}applyFadingParameters(e){}copyFadingParameters(e){}addExtrusionProperties(){}applyExtrusionParameters(e){}copyExtrusionParameters(e){}addDisplacementProperties(){}copyColorCorrectionParameters(e){}applyDisplacementParameters(e){}copyDisplacementParameters(e){}addColorCorrectionProperties(){}applyColorCorrectionParameters(e){}}t.MapMeshBasicMaterial=p,(0,r.applyMixinsWithoutProperties)(p,[d.FadingFeatureMixin]),(0,r.applyMixinsWithoutProperties)(p,[h.ExtrusionFeatureMixin]),(0,r.applyMixinsWithoutProperties)(p,[u.DisplacementFeatureMixin]),(0,r.applyMixinsWithoutProperties)(p,[c.ColorCorrectionFeatureMixin])},8484:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.MapMeshDepthMaterial=void 0;const i=n(82),r=n(4342),o=n(8014),s=n(8955),a=n(5997);class l extends i.MeshDepthMaterial{constructor(e){super(e),o.ExtrusionFeature.patchGlobalShaderChunks(),this.addExtrusionProperties(),this.applyExtrusionParameters(Object.assign(Object.assign({},e),{zFightingWorkaround:!1}))}get extrusionRatio(){return s.ExtrusionFeatureDefs.DEFAULT_RATIO_MAX}set extrusionRatio(e){}addExtrusionProperties(){}applyExtrusionParameters(e){}copyExtrusionParameters(e){}}t.MapMeshDepthMaterial=l,(0,r.applyMixinsWithoutProperties)(l,[a.ExtrusionFeatureMixin])},4877:(e,t,n)=>{\"use strict\";
947Object.defineProperty(t,\"__esModule\",{value:!0}),t.MapMeshPhongMaterial=void 0;const i=n(82),r=n(4342),o=n(8014),s=n(8955),a=n(8177),l=n(71),c=n(5997),u=n(674),h=n(5089);class d extends i.MeshPhongMaterial{constructor(e){var t;super(e),a.FadingFeature.patchGlobalShaderChunks(),this.addFadingProperties(),this.applyFadingParameters(e),o.ExtrusionFeature.patchGlobalShaderChunks(),this.addExtrusionProperties(),this.applyExtrusionParameters(Object.assign(Object.assign({},e),{zFightingWorkaround:!0})),this.m_colorIntensity=null!==(t=null==e?void 0:e.colorIntensity)&&void 0!==t?t:1,this.onBeforeCompile=(0,r.chainCallbacks)(this.onBeforeCompile,(e=>{(0,l.linkMixinWithShader)(this,e),e.fragmentShader=e.fragmentShader.replace(\"#include <lights_phong_pars_fragment>\",`#include <lights_phong_pars_fragment>\\n ${h.blinnPhongNoSpecular}\\n `)})),(0,l.linkMixinWithMaterial)(this,this),(0,r.assert)(void 0!==this.shaderDefines),(0,r.assert)(void 0!==this.shaderUniforms),this.shaderUniforms.colorIntensity=new i.Uniform(this.colorIntensity)}clone(){return(new d).copy(this)}copy(e){return super.copy(e),this.copyFadingParameters(e),this.copyExtrusionParameters(e),this.colorIntensity=e.colorIntensity,this}get colorIntensity(){return this.m_colorIntensity}set colorIntensity(e){this.m_colorIntensity=e,this.shaderUniforms.colorIntensity.value=e}get fadeNear(){return a.FadingFeature.DEFAULT_FADE_NEAR}set fadeNear(e){}get fadeFar(){return a.FadingFeature.DEFAULT_FADE_FAR}set fadeFar(e){}get extrusionRatio(){return s.ExtrusionFeatureDefs.DEFAULT_RATIO_MAX}set extrusionRatio(e){}addFadingProperties(){}applyFadingParameters(e){}copyFadingParameters(e){}addExtrusionProperties(){}applyExtrusionParameters(e){}copyExtrusionParameters(e){}}t.MapMeshPhongMaterial=d,(0,r.applyMixinsWithoutProperties)(d,[u.FadingFeatureMixin]),(0,r.applyMixinsWithoutProperties)(d,[c.ExtrusionFeatureMixin])},4067:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.MapMeshStandardMaterial=void 0;const i=n(82),r=n(4342),o=n(8014),s=n(8955),a=n(8177),l=n(5997),c=n(674),u=n(759);class h extends i.MeshStandardMaterial{constructor(e){super(e),a.FadingFeature.patchGlobalShaderChunks(),this.addFadingProperties(),this.applyFadingParameters(e),o.ExtrusionFeature.patchGlobalShaderChunks(),this.addExtrusionProperties(),this.applyExtrusionParameters(Object.assign(Object.assign({},e),{zFightingWorkaround:!0})),!0===(null==e?void 0:e.removeDiffuseLight)&&(this.onBeforeCompile=(0,r.chainCallbacks)(this.onBeforeCompile,(e=>{e.fragmentShader=i.ShaderChunk.meshphysical_frag.replace(\"#include <lights_physical_pars_fragment>\",u.simpleLightingShadowChunk)})))}clone(){return(new h).copy(this)}copy(e){return super.copy(e),this.copyFadingParameters(e),this.copyExtrusionParameters(e),this}get fadeNear(){return a.FadingFeature.DEFAULT_FADE_NEAR}set fadeNear(e){}get fadeFar(){return a.FadingFeature.DEFAULT_FADE_FAR}set fadeFar(e){}get extrusionRatio(){return s.ExtrusionFeatureDefs.DEFAULT_RATIO_MAX}set extrusionRatio(e){}get removeDiffuseLight(){return!1}set removeDiffuseLight(e){}addFadingProperties(){}applyFadingParameters(e){}copyFadingParameters(e){}addExtrusionProperties(){}applyExtrusionParameters(e){}copyExtrusionParameters(e){}}t.MapMeshStandardMaterial=h,(0,r.applyMixinsWithoutProperties)(h,[c.FadingFeatureMixin]),(0,r.applyMixinsWithoutProperties)(h,[l.ExtrusionFeatureMixin])},71:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.linkMixinWithShader=t.linkMixinWithMaterial=t.cameraToWorldDistance=void 0,t.cameraToWorldDistance=function(e,t){return e*t.maximum},t.linkMixinWithMaterial=function(e,t){void 0===t.defines&&(t.defines={}),e.shaderDefines=t.defines,void 0===e.shaderUniforms&&(e.shaderUniforms={})},t.linkMixinWithShader=function(e,t){Object.assign(t.uniforms,e.shaderUniforms),e.shaderUniforms=t.uniforms}},2141:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.RawShaderMaterial=void 0;const i=n(82),r=n(4342),o=n(8578);class s extends i.RawShaderMaterial{constructor(e){const t=!0===(null==e?void 0:e.rendererCapabilities.isWebGL2),n=e?Object.assign(Object.assign({},e),{glslVersion:t?i.GLSL3:i.GLSL1,vertexShader:t&&e.vertexShader?(0,r.convertVertexShaderToWebGL2)(e.vertexShader):e.vertexShader,fragmentShader:t&&e.fragmentShader?(0,r.convertFragmentShaderToWebGL2)(e.fragmentShader):e.fragmentShader}):void 0;n&&delete n.rendererCapabilities,super(n),this.invalidateFog(),this.setOpacity(null==n?void 0:n.opacity)}invalidateFog(){void 0!==this.defines&&this.fog!==(0,o.getShaderMaterialDefine)(this,\"USE_FOG\")&&(0,o.setShaderMaterialDefine)(this,\"USE_FOG\",this.fog)}setOpacity(e){var t;void 0!==e&&(this.opacity=e,(null===(t=this.uniforms)||void 0===t?void 0:t.opacity)&&(this.uniforms.opacity.value=e))}}t.RawShaderMaterial=s}
947,3298:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.SkyAtmosphereMaterial=t.SkyAtmosphereShader=void 0;const i=n(82),r=n(2141),o=n(1870),s=n(8578);t.SkyAtmosphereShader={uniforms:{u_eyePositionWorld:new i.Uniform(new i.Vector3),u_lightDirectionWorld:new i.Uniform(new i.Vector3(0,1,0)),u_modelViewProjection:new i.Uniform(new i.Matrix4),u_atmosphereEnv:new i.Uniform(new i.Vector3(6378137,6537590.425,0)),u_hsvCorrection:new i.Uniform(new i.Vector3(0,0,0)),topColor:new i.Uniform(new i.Color(30719)),bottomColor:new i.Uniform(new i.Color(16777215)),offset:new i.Uniform(33),exponent:new i.Uniform(.6),fogColor:new i.Uniform(new i.Color(30719)),fogNear:new i.Uniform(new i.Color(30719)),fogFar:new i.Uniform(new i.Color(16777215))},vertexShader:`\\n precision highp float;\\n precision highp int;\\n\\n attribute vec4 position;\\n\\n uniform mat4 u_modelViewProjection;\\n uniform vec3 u_eyePositionWorld;\\n uniform vec3 u_lightDirectionWorld;\\n\\n uniform vec3 u_atmosphereEnv; // Atmosphere inner and outer radius, camera height\\n uniform vec3 u_hsvCorrection;\\n\\n const float Pi = 3.141592653589793;\\n const float Kr = 0.0025;\\n const float Kr4PI = Kr * 4.0 * Pi;\\n const float Km = 0.0015;\\n const float Km4PI = Km * 4.0 * Pi;\\n const float ESun = 15.0; // should be 15.0\\n const float KmESun = Km * ESun;\\n const float KrESun = Kr * ESun;\\n const vec3 InvWavelength = vec3(\\n 5.60204474633241, // Red = 1.0 / Math.pow(0.650, 4.0)\\n 9.473284437923038, // Green = 1.0 / Math.pow(0.570, 4.0)\\n 19.643802610477206); // Blue = 1.0 / Math.pow(0.475, 4.0)\\n\\n const int nSamples = 2;\\n const float fSamples = 2.0;\\n\\n varying vec3 v_rayleighColor;\\n varying vec3 v_mieColor;\\n varying vec3 v_vertToCamera;\\n\\n ${o.default.atmosphere_vertex_utils}\\n\\n //\\n // Computes rayleight and mia atmosphere factors for sky.\\n //\\n // Code based on GPU Gems article.\\n //\\n // Author: Sean O'Neil\\n //\\n // Copyright (c) 2004 Sean O'Neil\\n //\\n // https://developer.nvidia.com/gpugems/gpugems2/part-ii-shading-lighting-and-shadows/chapter-16-accurate-atmospheric-scattering\\n //\\n // Further modifications by HERE\\n //\\n AtmosphereColor computeSkyAtmosphere(vec3 v3Pos, vec3 vLightDir)\\n {\\n // Unpack attributes\\n float fInnerRadius = u_atmosphereEnv.x;\\n float fOuterRadius = u_atmosphereEnv.y;\\n float fCameraHeight = u_atmosphereEnv.z;\\n\\n // All that may be const or define(s) at further optimization:\\n float fScale = 1.0 / (fOuterRadius - fInnerRadius);\\n float fScaleOverScaleDepth = (fScale / RayleighScaleDepth);\\n float fCameraHeight2 = fCameraHeight * fCameraHeight;\\n float fOuterRadius2 = fOuterRadius * fOuterRadius;\\n\\n // Get the ray from the camera to the vertex and its length (which is the far point of the ray passing through the atmosphere)\\n vec3 v3Ray = v3Pos - u_eyePositionWorld;\\n float fFar = length(v3Ray);\\n v3Ray /= fFar;\\n\\n #ifdef CAMERA_IN_SPACE\\n\\n // Calculate the closest intersection of the ray with the outer\\n // atmosphere, this is the first point of the ray passing through the atmosphere dome.\\n float fNear = getNearSphereIntersect(u_eyePositionWorld, v3Ray, fCameraHeight2, fOuterRadius2);\\n // Make far relative to first atmosphere intersection\\n fFar -= fNear;\\n\\n // Compute the ray's starting position within the atmosphere, then\\n // calculate its scattering offset\\n vec3 v3Start = u_eyePositionWorld + v3Ray * fNear;\\n\\n float fStartAngle = dot(v3Ray, v3Start) / fOuterRadius;\\n float fStartDepth = exp(-1.0 / RayleighScaleDepth );\\n float fStartOffset = fStartDepth * scale(fStartAngle);\\n\\n #else // CAMERA_IN_ATMOSPHERE\\n\\n // The ray starts already in atmosphere\\n vec3 v3Start = u_eyePositionWorld;\\n float height = length(v3Start);\\n float depth = exp(fScaleOverScaleDepth * (fInnerRadius - fCameraHeight));\\n float fStartAngle = dot(v3Ray, v3Start) / height;\\n float fStartOffset = depth * scale(fStartAngle);\\n\\n #endif\\n\\n // Initialize the scattering loop variables\\n float fSampleLength = fFar / fSamples;\\n float fScaledLength = fSampleLength * fScale;\\n vec3 v3SampleRay = v3Ray * fSampleLength;\\n vec3 v3SamplePoint = v3Start + v3SampleRay * 0.5;\\n\\n // Now loop through the sample rays\\n vec3 v3BaseColor = vec3(0.0);\\n vec3 v3Attenuate = vec3(0.0);\\n for(int i=0; i < nSamples; i++)\\n {\\n float height = length(v3SamplePoint);\\n float depth = exp(fScaleOverScaleDepth * (fInnerRadius - height));\\n float fLightAngle = dot(vLightDir, v3SamplePoint) / height;\\n float fCameraAngle = dot(v3Ray, v3SamplePoint) / height;\\n float fScatter = (fStartOffset + depth * (scale(fLightAngle) - scale(fCameraAngle)));\\n v3Attenuate = exp(-fScatter * (InvWavelength * Kr4PI + Km4PI));\\n v3BaseColor += v3Attenuate * (depth * fScaledLength);\\n v3SamplePoint += v3SampleRay;\\n }\\n\\n // Scale the Mie and Rayleigh colors and set up output of the function\\n AtmosphereColor color;\\n color.mie = v3BaseColor * KmESun;\\n color.rayleigh = v3BaseColor * (InvWavelength * KrESun);\\n return color;\\n }\\n\\n void main(void)\\n {\\n #ifdef DYNAMIC_LIGHT\\n vec3 vLightDir = u_lightDirectionWorld;\\n #else\\n vec3 vLightDir = u_eyePositionWorld;\\n #endif\\n vLightDir = normalize(vLightDir);\\n\\n AtmosphereColor atmColor = computeSkyAtmosphere(position.xyz, vLightDir);\\n v_mieColor = atmColor.mie;\\n v_rayleighColor = atmColor.rayleigh;\\n v_vertToCamera = u_eyePositionWorld - position.xyz;\\n\\n gl_Position = u_modelViewProjection * position;\\n }\\n `,fragmentShader:`\\n // Because of harsh light distribution the exposure correction is always enabled for the sky.\\n #define CORRECT_EXPOSURE 1\\n\\n precision highp float;\\n precision highp int;\\n\\n #ifdef CORRECT_COLOR\\n uniform vec3 u_hsvCorrection; // Hue, saturation, brightness\\n #endif\\n\\n uniform vec3 u_atmosphereEnv; // Atmosphere inner and outer radius, camera height\\n uniform vec3 u_eyePositionWorld;\\n uniform vec3 u_lightDirectionWorld;\\n\\n const float g = -0.95;\\n const float g2 = g * g;\\n\\n varying vec3 v_rayleighColor;\\n varying vec3 v_mieColor;\\n varying vec3 v_vertToCamera;\\n\\n ${o.default.atmosphere_fragment_utils}\\n\\n void main(void)\\n {\\n float fInnerRadius = u_atmosphereEnv.x;\\n float fOuterRadius = u_atmosphereEnv.y;\\n float fCameraHeight = u_atmosphereEnv.z;\\n\\n #ifdef DYNAMIC_LIGHT\\n vec3 vLightDir = u_lightDirectionWorld;\\n // Alter alpha based on time of day (0.0 = night , 1.0 = day)\\n float fNightAlpha = clamp(dot(normalize(u_eyePositionWorld), vLightDir), 0.0, 1.0);\\n #else\\n vec3 vLightDir = u_eyePositionWorld;\\n float fNightAlpha = 1.0;\\n #endif\\n vLightDir = normalize(vLightDir);\\n\\n // NOTE:\\n // For better precision normalization may be added on fragment (for mobile devices)\\n // while in vertex shader may be left un-normalized\\n // dot(vLightDir, normalize(v_vertToCamera)) / length(v_vertToCamera);\\n float fCosAngle = dot(vLightDir, v_vertToCamera) / length(v_vertToCamera);\\n float fRayleighPhase = 0.75 * (1.0 + fCosAngle * fCosAngle);\\n float fMiePhase = 1.5 * ((1.0 - g2) / (2.0 + g2)) * (1.0 + fCosAngle * fCosAngle) / pow(1.0 + g2 - 2.0 * g * fCosAngle, 1.5);\\n\\n vec3 cRgb = fRayleighPhase * v_rayleighColor + fMiePhase * v_mieColor;\\n\\n // Sky produces very harsh lighting effect so exposure correction is always enabled.\\n #if !defined(HDR_FRAME_BUFFER) && defined(CORRECT_EXPOSURE)\\n // Exposure factor may be exposed to uniform variable.\\n cRgb = correctExposure(cRgb, 2.0);\\n #endif\\n\\n #ifdef CORRECT_COLOR\\n cRgb = correctColor(cRgb, u_hsvCorrection);\\n #endif\\n\\n // Alter alpha based on how close the viewer is to the ground (1.0 = on ground, 0.0 = at edge of atmosphere)\\n float fAtmosphereAlpha = clamp((fOuterRadius - fCameraHeight) /\\n (fOuterRadius - fInnerRadius), 0.0, 1.0);\\n fAtmosphereAlpha *= pow(fNightAlpha, 0.5);\\n\\n gl_FragColor = vec4(cRgb, mix(cRgb.b, 1.0, fAtmosphereAlpha));\\n }\\n `};
947class a extends r.RawShaderMaterial{constructor(e){let n;e&&(n={name:\"SkyAtmosphereMaterial\",vertexShader:t.SkyAtmosphereShader.vertexShader,fragmentShader:t.SkyAtmosphereShader.fragmentShader,uniforms:t.SkyAtmosphereShader.uniforms,transparent:!0,depthTest:!0,depthWrite:!1,side:i.BackSide,blending:i.NormalBlending,fog:!1,rendererCapabilities:e.rendererCapabilities}),super(n)}setDynamicLighting(e){(0,s.setShaderMaterialDefine)(this,\"DYNAMIC_LIGHT\",e)}set outerRadius(e){this.uniforms.u_atmosphereEnv.value.y=e}get outerRadius(){return this.uniforms.u_atmosphereEnv.value.y}set innerRadius(e){this.uniforms.u_atmosphereEnv.value.x=e}get innerRadius(){return this.uniforms.u_atmosphereEnv.value.x}updateUniforms(e,t,n,i){const r=this.getCameraInfo(t,n);if(void 0===e||!e.isMaterial)throw Error(\"Wrong object used, only Material objects are supported\");if(!(e.uniforms&&e.uniforms.u_atmosphereEnv&&e.uniforms.u_hsvCorrection&&e.uniforms.u_eyePositionWorld&&e.uniforms.u_modelViewProjection&&e.uniforms.u_lightDirectionWorld))throw Error(\"Atmosphere material has missing uniforms\");{const t=r.eyePos,n=r.modelViewProjection,o=r.eyeHeight;e.uniforms.u_eyePositionWorld.value.copy(t),e.uniforms.u_modelViewProjection.value.copy(n),e.uniforms.u_atmosphereEnv.value.z=o,e.uniforms.u_lightDirectionWorld.value=i.clone();const a=o>this.outerRadius,l=(0,s.setShaderDefine)(e.defines,\"CAMERA_IN_SPACE\",a),c=(0,s.setShaderDefine)(e.defines,\"CAMERA_IN_ATMOSPHERE\",!a);e.needsUpdate=e.needsUpdate||l||c}}getCameraInfo(e,t,n=!1){if(n){const n=(new i.Matrix4).identity(),r=(new i.Matrix4).copy(e.matrixWorld).invert().transpose(),o=t.projectionMatrix,s=new i.Matrix4;s.multiplyMatrices(r,n),s.multiplyMatrices(o,s);const a=new i.Vector3;e.getWorldPosition(a);const l=new i.Vector3;return t.getWorldPosition(l),{modelViewProjection:s,eyePos:a,eyeHeight:l.distanceTo(a)}}{const n=e.matrixWorld,r=t.matrixWorldInverse,o=t.projectionMatrix,s=new i.Matrix4;s.multiplyMatrices(r,n),s.multiplyMatrices(o,s);const a=new i.Vector3;t.getWorldPosition(a);const l=new i.Vector3;e.getWorldPosition(l);const c=l.distanceTo(a);return a.sub(l),{modelViewProjection:s,eyePos:a,eyeHeight:c}}}}t.SkyAtmosphereMaterial=a},9528:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.SolidLineMaterial=t.LineDashesModes=t.LineCapsModes=void 0;const i=n(82),r=n(1667),o=n(7610),s=n(8177),a=n(2141),l=n(8578);var c;!function(e){e[e.CAPS_NONE=0]=\"CAPS_NONE\",e[e.CAPS_SQUARE=1]=\"CAPS_SQUARE\",e[e.CAPS_ROUND=2]=\"CAPS_ROUND\",e[e.CAPS_TRIANGLE_IN=3]=\"CAPS_TRIANGLE_IN\",e[e.CAPS_TRIANGLE_OUT=4]=\"CAPS_TRIANGLE_OUT\"}(c=t.LineCapsModes||(t.LineCapsModes={}));const u={butt:c.CAPS_NONE,square:c.CAPS_SQUARE,round:c.CAPS_ROUND},h=Object.keys(u).reduce(((e,t)=>{const n=t;return e[u[n]]=n,e}),{});var d;!function(e){e[e.DASHES_SQUARE=0]=\"DASHES_SQUARE\",e[e.DASHES_ROUND=1]=\"DASHES_ROUND\",e[e.DASHES_DIAMOND=2]=\"DASHES_DIAMOND\"}(d=t.LineDashesModes||(t.LineDashesModes={}));const p={Square:d.DASHES_SQUARE,Round:d.DASHES_ROUND,Diamond:d.DASHES_DIAMOND},f=Object.keys(p).reduce(((e,t)=>{const n=t;return e[p[n]]=n,e}),{}),m=`\\nprecision highp float;\\nprecision highp int;\\n\\nuniform vec4 diffuseColor;\\nuniform float opacity;\\nuniform float extrusionWidth;\\nuniform vec2 tileSize;\\nuniform vec2 drawRange;\\n\\n#ifdef USE_DASH_IMAGE\\n uniform sampler2D dashImage;\\n#endif\\n\\n#ifdef USE_DASHED_LINE\\n uniform vec4 dashPattern;\\n uniform vec4 dashColor;\\n\\n #define DASHES_SQUARE ${d.DASHES_SQUARE}\\n #define DASHES_ROUND ${d.DASHES_ROUND}\\n #define DASHES_DIAMOND ${d.DASHES_DIAMOND}\\n#endif\\n\\n#ifdef USE_TILE_CLIP\\n varying vec3 vPosition;\\n#endif\\n\\nvarying vec3 vRange;\\nvarying vec4 vCoords;\\nvarying vec2 vAAGradient;\\nvarying vec3 vExtrusionNormal;\\n\\n\\nvarying vec3 vBarycentric;\\nvarying float vWireframe;\\nfloat edgeFactor() {\\n float lineWidth = 1.0;\\n vec3 d = fwidth(vBarycentric);\\n vec3 f = step(d * lineWidth, vBarycentric);\\n return min(min(f.x, f.y), f.z);\\n}\\n\\n#ifdef USE_COLOR\\n varying vec3 vColor;
947\\n#endif\\n\\n#define CAPS_NONE ${c.CAPS_NONE}\\n#define CAPS_SQUARE ${c.CAPS_SQUARE}\\n#define CAPS_ROUND ${c.CAPS_ROUND}\\n#define CAPS_TRIANGLE_IN ${c.CAPS_TRIANGLE_IN}\\n#define CAPS_TRIANGLE_OUT ${c.CAPS_TRIANGLE_OUT}\\n\\nfloat roundEdgesAndAddCaps(in vec4 coords, in vec3 range) {\\n // Compute the line's width to length ratio.\\n float widthRatio = range.y / range.x;\\n\\n // Compute the inner segment distance (same for all cap mode).\\n float dist = abs(coords.y);\\n float segmentBeginMask = clamp(ceil(coords.z - coords.x), 0.0, 1.0);\\n float segmentEndMask = clamp(ceil(coords.x - coords.w), 0.0, 1.0);\\n dist = max(dist, segmentBeginMask * length(vec2((coords.x - coords.z) / widthRatio, coords.y)));\\n dist = max(dist, segmentEndMask * length(vec2((coords.x - coords.w) / widthRatio, coords.y)));\\n\\n #if CAPS_MODE != CAPS_ROUND\\n // Compute the caps mask.\\n float capRangeMask = clamp(1.0 - ceil(range.z - drawRange.y), 0.0, 1.0);\\n float beginCapMask = clamp(ceil(drawRange.x - coords.x), 0.0, 1.0);\\n float endCapMask = clamp(ceil(coords.x - drawRange.y), 0.0, 1.0);\\n float capMask = capRangeMask * max(beginCapMask, endCapMask);\\n\\n // Compute the outer segment distance (specific for each cap mode).\\n float capDist = max(coords.x - drawRange.y, drawRange.x - coords.x) / widthRatio;\\n #if CAPS_MODE == CAPS_NONE\\n dist = mix(dist, max(abs(coords.y), (capDist + 0.1) / 0.1), capMask);\\n #elif CAPS_MODE == CAPS_SQUARE\\n dist = mix(dist, max(abs(coords.y), capDist), capMask);\\n #elif CAPS_MODE == CAPS_TRIANGLE_OUT\\n dist = mix(dist, abs(coords.y) + capDist, capMask);\\n #elif CAPS_MODE == CAPS_TRIANGLE_IN\\n dist = mix(dist, max(abs(coords.y), (capDist - abs(coords.y)) + capDist), capMask);\\n #endif\\n #endif // CAPS_MODE != CAPS_ROUND\\n\\n return dist;\\n}\\n\\n#ifdef USE_TILE_CLIP\\n void tileClip(vec2 tilePos, vec2 tileSize) {\\n if (tileSize.x > 0.0 && (tilePos.x < -tileSize.x / 2.0 || tilePos.x > tileSize.x / 2.0))\\n discard;\\n if (tileSize.y > 0.0 && (tilePos.y < -tileSize.y / 2.0 || tilePos.y > tileSize.y / 2.0))\\n discard;\\n }\\n#endif\\n\\n#ifdef USE_FADING\\n #include <fading_pars_fragment>\\n#endif\\n\\n#include <fog_pars_fragment>\\n\\n#ifdef USE_DASHED_LINE\\nvec4 computeDashedLineColor(float distToCenter) {\\n vec4 outputColor;\\n\\n // Calculate distances for both dash patterns\\n float d1 = dashPattern.x / vRange.x;\\n float g1 = dashPattern.y / vRange.x;\\n #ifdef USE_SECOND_DASH\\n float d2 = dashPattern.z / vRange.x;\\n float g2 = dashPattern.w / vRange.x;\\n\\n // Total length of one full pattern (dash1 + gap1 + dash2 + gap2)\\n float totalPatternLength = d1 + g1 + d2 + g2;\\n #else\\n // If only one dash size is used, total length is just dash1 and gap1\\n float totalPatternLength = d1 + g1;\\n #endif\\n\\n // Compute the distance to the dash origin\\n float dashOrigDist = mod(vCoords.x, totalPatternLength);\\n // The resulting function is discontinuous at the start of a dash (dashOrigDist = 0), which causes a spike in the result\\n // of fwidth and artifacts in the interpolation. Transform it so that it reaches its maximum at the middle of a gap and\\n // goes down to 1.0 at the gap end.\\n // Determine the dash state based on the dashOrigDist\\n float dashEdgeDist = 0.0;\\n float gapCenter;\\n if (dashOrigDist <= (d1 + g1)) {\\n // In the first dash\\n gapCenter = 1.0 + 0.5 * g1 / d1; // Center of the gap\\n dashOrigDist = (gapCenter - abs(dashOrigDist - gapCenter)) / d1;\\n // Compute distance to dash edge (0.5: dashCenter, 0.0: dashEdge).\\n dashEdgeDist = 0.5 - abs(dashOrigDist - 0.5);\\n #ifdef USE_SECOND_DASH\\n } else if (dashOrigDist <= (totalPatternLength)) {\\n // In the second dash\\n gapCenter = 1.0 + 0.5 * g2 / d2;\\n dashOrigDist = (gapCenter - abs(dashOrigDist - (d1 + g1) - gapCenter)) / d2;\\n dashEdgeDist = 0.5 - abs((dashOrigDist ) - 0.5);\\n #endif\\n }\\n\\n #if DASHES_MODE == DASHES_ROUND\\n dashEdgeDist = 0.5 - distance(vec2(distToCenter * 0.5, dashEdgeDist), vec2(0.0, 0.5));\\n #elif DASHES_MODE == DASHES_DIAMOND\\n dashEdgeDist -= distToCenter * 0.5;\\n #endif\\n\\n // Blend dash and gap colors using hermitian interpolation (smoothstep) on the interval\\n // [-dashWidth, dashWidth], with 'dashWidth' being the sum of the slope of dashEdgeDist on x and y (fwidth).\\n // That means 'dashWidth' is the dashEdgeDist function delta across 1 pixel, and hence the interpolation interval\\n // is 2 pixels wide and centered on 0 (dash start).\\n float dashWidth = fwidth(dashEdgeDist);\\n float dashBlendFactor = smoothstep(-dashWidth, dashWidth, dashEdgeDist);\\n\\n #ifdef USE_DASH_IMAGE\\n // Dash texture is mapped to the full dash size. Use dashOrigDist as u coordinate (parallel to line segment).\\n // For v coordinate (perpendicular to line), transform vCoords.y (0.0 at line center, +/-1 at edges)\\n // to make them 0 at one edge, 1 at the other and 0.5 at the line center:\\
947n vec2 texCoords = vec2(dashOrigDist, 0.5 + vCoords.y / 2.0);\\n float textureAlpha = texture2D(dashImage, texCoords).a;\\n\\n // Pre-calculate the resulting color of the dash:\\n if (diffuseColor.a == 1.0) {\\n // diffuseColor is fully opaque, use simple mix function with dashColor's alpha as interpolation factor:\\n outputColor = mix(diffuseColor, vec4(dashColor.rgb, 1.0), dashColor.a);\\n } else {\\n // diffuseColor is not fully opaque, perform a custom alpha blending:\\n\\n // Inverse transparency of dashColor:\\n float invDashAlpha = 1.0 - dashColor.a;\\n\\n // Blend RGB channels based on alpha values:\\n outputColor.rgb = diffuseColor.rgb * diffuseColor.a * invDashAlpha + dashColor.rgb * dashColor.a;\\n\\n // Compute final alpha by blending both alphas:\\n outputColor.a = diffuseColor.a * invDashAlpha + dashColor.a;\\n\\n // If alpha is non-zero, normalize the RGB to account for premultiplied alpha:\\n if (outputColor.a != 0.0) {\\n outputColor.rgb /= outputColor.a;\\n }\\n }\\n\\n // Final mix with textureAlpha and dashBlendFactor as interpolation factor:\\n // For a transparent dash color, the dash becomes invisible, and the base (diffuse) color is drawn instead.\\n outputColor = mix(diffuseColor, outputColor, textureAlpha * dashBlendFactor);\\n #else\\n // When a dash texture is not used, dash color's alpha is blended as the other channels with the base color. The base color\\n // won't be visible through transparent dashes. Instead, the resulting color depends on the material's blending configuration.\\n // (typically, materials drawn underneath will be visible).\\n\\n // First alpha is interpolated.\\n outputColor.a = mix(diffuseColor.a, dashColor.a, dashBlendFactor);\\n\\n // Then color channels are premultiplied with the alpha channels, interpolated and finally divided by the interpolated alpha.\\n // This keeps colors with low opacity from bleeding into the other color as the opacity increases.\\n outputColor.rgb = mix(diffuseColor.rgb * diffuseColor.a, dashColor.rgb * dashColor.a, dashBlendFactor) / outputColor.a;\\n #endif\\n\\n return outputColor;\\n}\\n#endif\\n\\nvoid main() {\\n float alpha = opacity * diffuseColor.a;\\n vec4 outputDiffuse = diffuseColor;\\n vec3 baricentricColor = vec3(edgeFactor());\\n vec3 color = min(baricentricColor, gl_FragColor.rgb);\\n\\n #ifdef USE_TILE_CLIP\\n tileClip(vPosition.xy, tileSize);\\n #endif\\n\\n // Calculate distance to center (0.0: lineCenter, 1.0: lineEdge).\\n float distToCenter = roundEdgesAndAddCaps(vCoords, vRange);\\n\\n float s = 0.0;\\n if (vAAGradient.x < vAAGradient.y) {\\n s = smoothstep(vAAGradient.x, vAAGradient.y, distToCenter);\\n }\\n\\n // Drop the fully transparent pixel. It prevents writing to the stencil buffer.\\n // Without this discard we will see line cap overlaps on semi-transparent roads.\\n if (s == 1.0 && all(equal(color, baricentricColor)) == false) {\\n discard;\\n }\\n\\n // Alpha channel in diffuseColor is applied later once it's interpolated
947with dash color's alpha.\\n alpha = opacity * (1.0 - s);\\n\\n #ifdef USE_DASHED_LINE\\n outputDiffuse = computeDashedLineColor(distToCenter);\\n #endif\\n\\n #ifdef USE_COLOR\\n outputDiffuse.rgb *= vColor;\\n #endif\\n\\n // Removing 'alpha' seems fixing MAPSJS-2929\\n gl_FragColor = vec4( outputDiffuse.rgb, outputDiffuse.a * alpha );\\n\\n #include <fog_fragment>\\n\\n #ifdef USE_FADING\\n #include <fading_fragment>\\n #endif\\n\\n\\n\\n if (vWireframe == 1.0) {\\n // Uncomment to see the wireframe only without fill color\\n // gl_FragColor.a = 0.;\\n if (all(equal(color, baricentricColor))) {\\n gl_FragColor = vec4(1.0, 0., 0., 1.0);\\n }\\n }\\n}`;class g extends a.RawShaderMaterial{constructor(e){var t,n,a,u,h;s.FadingFeature.patchGlobalShaderChunks();const p={CAPS_MODE:c.CAPS_ROUND,DASHES_MODE:d.DASHES_SQUARE};let f,v,y=!0,x=1;e&&(y=!0===e.fog,y&&(0,l.setShaderDefine)(p,\"USE_FOG\",!0),x=void 0!==e.opacity?e.opacity:x,f=e.displacementMap,void 0!==f&&(0,l.setShaderDefine)(p,\"USE_DISPLACEMENTMAP\",!0),e[\"dash-image\"]&&(0,l.setShaderDefine)(p,\"USE_DASH_IMAGE\",!0),v={name:\"SolidLineMaterial\",vertexShader:'\\n#define SEGMENT_OFFSET 0.1\\n// The minimum pixel distance prevents huge overscale values. This avoids very blurry lines in\\n// extreme perspectives when multiplied with other variables and interpolated across a long line\\n// segment that intersects the near plane. Clamping to this minimum distance also allows to always\\n// apply the overscale and thus avoid sudden line width \"jumps\". See HARP-13527 for details.\\n#define MIN_DISTANCE 0.1\\n\\n// over-extrusion width on each side (twice in total).\\n#define OVER_EXTRUSION_WIDTH_PIXELS 1.0\\n\\nconst float PI = 3.14159265358979323846;\\nconst float EPSILON = 0.00001;\\n\\nattribute vec3 extrusionCoord;\\nattribute vec3 position;\\nattribute vec4 biTangent;\\nattribute vec3 tangent;\\nattribute vec2 uv;\\nattribute vec3 normal;\\n\\nuniform mat4 modelViewMatrix;\\nuniform mat4 projectionMatrix;\\nuniform float extrusionWidth;\\nuniform float offset;\\nuniform vec2 drawRange;\\nuniform vec2 canvasSize;\\nuniform float wireframe;\\n\\n#ifdef USE_DISPLACEMENTMAP\\n uniform sampler2D displacementMap;\\n#endif\\n\\n#ifdef USE_TILE_CLIP\\n varying vec3 vPosition;\\n#endif\\n\\nvarying vec3 vRange;\\nvarying vec4 vCoords;\\nvarying vec2 vAAGradient;\\n\\nattribute vec3 barycentric;\\nvarying vec3 vBarycentric;\\nvarying float vWireframe;\\n\\n#ifdef USE_COLOR\\n attribute vec3 color;\\n varying vec3 vColor;\\n#endif\\n\\n#ifdef USE_FADING\\n #include <fading_pars_vertex>\\n#endif\\n\\n#include <fog_pars_vertex>\\n\\nvec3 computeExtrusionDirWorld(in float extrusionWidth, in vec2 extrusionSign, in vec4 bitangent, in vec3 tangent) {\\n // Angle between this segment and the previous one.\\n float angle = bitangent.w;\\n vec3 bitangentComponent;\\n\\n /**\\n * WEBSDK-226:\\n * The following logic is to deal with vertices (line join) connecting\\n * 2 legs that are coplanar and opposite in direction.\\n * In such cases the resulting biTangent is 0 so the extrusion is 0 on joins,\\n * causing the vertices to collpase into one.\\n *\\n * For start and end vertices => T0=T1 and angle = 0;\\n * For vertices on joins =>\\n * T0 = leg preceding the vertex\\n * T1 = leg following the vertex\\n * angle = Ï when T0,T1 are coplanar with opposite direction.\\n *\\n * Examples:\\n *\\n * T0 = [0, 1, 0] T0 = [0, -1, 0]\\n * T1 = [0, -1, 0] T1 = [0, 1, 0]\\n * angle = Ï angle = Ï\\n * T0 T1 T0 T1\\n * â² | | â²\\n * | â¼ â¼ |\\n *\\n *\\n * T0 = [1, 0, 0] T0 = [-1, 0, 0]\\n * T1 = [-1, 0, 0] T1 = [1, 0, 0]\\n * angle = Ï angle = Ï\\n *\\n * T0 ----⺠T0 â----\\n * T1 â---- T1 ----âº\\n *\\n */\\n if (abs(angle - PI) < EPSILON) {\\n // Set the angle to 0 as otherwise the cos(pi/2)=0 for the calculation of\\n // the bitangentComponent\\n angle = 0.0;\\n\\n if (tangent.y == 0.) {\\n /**\\n * T0
947/T1 ----âº\\n * T1/T0 â----\\n */\\n bitangent.y = 1.0;\\n } else {\\n /**\\n * T0/T1 T1/T0 T0/T1 T1/T0\\n * â² | or / ⥠⥠/\\n * | ⼠⣠/ / â£\\n */\\n bitangent.x = 1.0;\\n }\\n }\\n\\n bitangentComponent = extrusionSign.y * extrusionWidth * bitangent.xyz / cos(angle / 2.0);\\n\\n // Extrusion component on the tangent direction to cover line caps.\\n vec3 tangentComponent = extrusionSign.x * extrusionWidth * tangent;\\n\\n // Add tangent component only if angle with previous segment is 0, which happens with vertices at line ends (where caps are needed)\\n // or in straight segments (where caps won\\'t be visible).\\n return bitangentComponent + (1.0 - abs(sign(angle))) * tangentComponent;\\n}\\n\\nvec2 computeExtrudedPosLocal(in float linePosition, in float extrusionWidth, in vec2 extrusionSign, in float tanHalfAngle) {\\n // For straight segments and line ends (angle and tanHalfAngle are 0), extrude position forwards (extrusionSign.x positive, for\\n // end caps) or backwards (extrusionSign.x negative, for start caps) by the extrusion width.\\n // For segments at an angle, position must be extruded further by a factor of extrusionSign.y*tanHalfAngle.\\n return vec2(linePosition + extrusionSign.x * extrusionWidth * (1.0 + abs(sign(tanHalfAngle)) * (extrusionSign.y * tanHalfAngle - 1.0)),\\n extrusionSign.y * extrusionWidth);\\n}\\n\\nvec3 transformToScreen(vec3 worldPosition) {\\n vec4 clip = projectionMatrix * modelViewMatrix * vec4(worldPosition,1.0);\\n vec3 ndc = clip.xyz / clip.w;\\n vec3 screen = ndc * 0.5 + 0.5;\\n screen.xy *= canvasSize;\\n return screen;\\n}\\n\\nvoid main() {\\n // Wireframe\\n vBarycentric = barycentric;\\n vWireframe = wireframe;\\n\\n // Calculate the segment.\\n vec2 segment = abs(extrusionCoord.xy) - SEGMENT_OFFSET;\\n float segmentPos = sign(extrusionCoord.x) / 2.0 + 0.5;\\n\\n // Calculate the vertex position inside the line (segment).\\n float linePos = mix(segment.x, segment.y, segmentPos);\\n vec2 extrusionSign = sign(extrusionCoord.xy);\\n // Precompute to avoid computing multiple times\\n float angle = biTangent.w;\\n float tanHalfAngle = tan(angle / 2.0);\\n\\n // Handle the case where the angle is PI, in such case tan(PI/2) is undefined.\\n if (abs(angle - PI) < EPSILON) {\\n tanHalfAngle = 1.;\\n }\\n\\n float extrusionFactor = extrusionSign.y * tanHalfAngle;\\n\\n // Calculate the extrusion to be applied to the vertex position\\n vec3 extrusionDirWorld = computeExtrusionDirWorld(extrusionWidth, extrusionSign, biTangent, tangent);\\n\\n vec3 extrudedPosWorld = position + extrusionDirWorld;\\n vec3 centerPosScreen = transformToScreen(position);\\n vec3 extrudedPosScreen = transformToScreen(extrudedPosWorld);\\n float distanceScreen = max(MIN_DISTANCE, distance(extrudedPosScreen.xy, centerPosScreen.xy));\\n\\n float overscale = (distanceScreen + OVER_EXTRUSION_WIDTH_PIXELS) / distanceScreen;\\n extrusionDirWorld *= overscale;\\n extrudedPosWorld = position + extrusionDirWorld;\\n\\n\\n float totalExtrusionWidth = extrusionWidth*overscale;\\n float aaGradientHalfWidth = totalExtrusionWidth - extrusionWidth;\\n vAAGradient.x = max(0.0, (extrusionWidth - aaGradientHalfWidth)/ totalExtrusionWidth);\\n vAAGradient.y = 1.0;\\n vec2 extrudedPosLocal = computeExtrudedPosLocal(linePos, totalExtrusionWidth, extrusionSign, tanHalfAngle);\\n\\n // Store the normalized extrusion coordinates in vCoords (with their ranges in vRange).\\n vRange = vec3(extrusionCoord.z, totalExtrusionWidth, extrusionFactor);\\n vCoords = vec4(extrudedPosLocal / vRange.xy, segment / vRange.x);\\n\\n // Adjust the segment to fit the drawRange.\\n float capDist = totalExtrusionWidth / extrusionCoord.z;\\n if ((vCoords.w + capDist) < drawRange.x || (vCoords.z - capDist) > drawRange.y) {\\n vCoords.zw += 1.0;\\n }\\n if (vCoords.z < drawRange.x) {\\n vCoords.zw += vec2(drawRange.x - vCoords.z, 0.0);\\n }\\n if (vCoords.w >
947 drawRange.y) {\\n vCoords.zw -= vec2(0.0, vCoords.w - drawRange.y);\\n }\\n\\n // Transform position.\\n #ifdef USE_DISPLACEMENTMAP\\n extrudedPosWorld += normalize( normal ) * texture2D( displacementMap, uv ).x;\\n #endif\\n\\n // Shift the line based on the offset, where the bitangent is the cross product of the average\\n // of the two direction vectors (the previous and next segment directions) and the normal of\\n // the line (facing into the sky). The w component is the angle between the two segments.\\n // Note, we need to take the angle into consideration, so we use trigonometry to calculate how\\n // much we need to extend the offset. Note, orthough this looks complicated we are doing this\\n // in the vertex shader, so it should not cause a performance issue.\\n extrudedPosWorld += biTangent.xyz * offset * sqrt(1.0 + pow(abs(tanHalfAngle), 2.0));\\n\\n vec4 mvPosition = modelViewMatrix * vec4(extrudedPosWorld, 1.0);\\n gl_Position = projectionMatrix * mvPosition;\\n\\n // Pass extruded position to fragment shader.\\n #ifdef USE_TILE_CLIP\\n vPosition = extrudedPosWorld;\\n #endif\\n\\n #ifdef USE_COLOR\\n // Pass vertex color to fragment shader.\\n vColor = color;\\n #endif\\n\\n #ifdef USE_FADING\\n #include <fading_vertex>\\n #endif\\n\\n #include <fog_vertex>\\n}',fragmentShader:m,uniforms:i.UniformsUtils.merge([{diffuseColor:new i.Uniform(g.DEFAULT_COLOR.clone()),dashColor:new i.Uniform(g.DEFAULT_DASH_COLOR.clone()),extrusionWidth:new i.Uniform(g.DEFAULT_WIDTH),offset:new i.Uniform(g.DEFAULT_OFFSET),opacity:new i.Uniform(g.DEFAULT_OPACITY),tileSize:new i.Uniform(new i.Vector2),fadeNear:new i.Uniform(s.FadingFeature.DEFAULT_FADE_NEAR),fadeFar:new i.Uniform(s.FadingFeature.DEFAULT_FADE_FAR),displacementMap:new i.Uniform(void 0!==f?f:new i.Texture),drawRange:new i.Uniform(new i.Vector2(g.DEFAULT_DRAW_RANGE_START,g.DEFAULT_DRAW_RANGE_END)),dashPattern:new i.Uniform(null!==(t=e[\"dash-pattern\"])&&void 0!==t?t:new i.Vector4),dashImage:new i.Uniform(null!==(n=e[\"dash-image\"])&&void 0!==n?n:new i.Texture),canvasSize:new i.Uniform(new i.Vector2),wireframe:new i.Uniform(g.ENABLE_WIREFRAME?1:0)},i.UniformsLib.fog]),defines:p,fog:y,opacity:x,rendererCapabilities:e.rendererCapabilities}),super(v),this.m_color=(new o.RGBA).fromVector(g.DEFAULT_COLOR),this.m_dashColor=(new o.RGBA).fromVector(g.DEFAULT_DASH_COLOR),this.fog=y,this.setOpacity(x),this.stencilFunc=i.NotEqualStencilFunc,this.stencilZPass=i.ReplaceStencilOp,this.stencilRef=1,this.stencilWrite=!1,(0,l.enforceBlending)(this),this.extensions.derivatives=!0,e&&(void 0!==e.color&&(this.color=\"number\"==typeof e.color?r.ColorUtils.getRgbaFromHex(e.color):null!==(a=o.RGBA.parse(e.color))&&void 0!==a?a:this.m_color),void 0!==e.width&&(this.width=e.width),void 0!==e.opacity&&this.setOpacity(e.opacity),void 0!==e.depthTest&&(this.depthTest=e.depthTest),void 0!==e.depthWrite&&(this.depthWrite=e.depthWrite),void 0!==e.fadeNear&&(this.fadeNear=e.fadeNear),void 0!==e.fadeFar&&(this.fadeFar=e.fadeFar),void 0!==e.displacementMap&&(this.displacementMap=e.displacementMap),void 0!==e.cap&&(this.cap=e.cap),void 0!==e.drawRangeStart&&(this.drawRangeStart=e.drawRangeStart),void 0!==e.drawRangeEnd&&(this.drawRangeEnd=e.drawRangeEnd),void 0!==e.dashes&&(this.dashes=e.dashes),void 0!==e.dashColor&&(this.dashColor=\"number\"==typeof e.dashColor?r.ColorUtils.getRgbaFromHex(e.dashColor):null!==(u=o.RGBA.parse(e.dashColor))&&void 0!==u?u:this.m_dashColor),void 0!==e[\"dash-pattern\"]&&(this[\"dash-pattern\"]=e[\"dash-pattern\"]),void 0!==e.fog&&(this.fog=e.fog,this.invalidateFog()),this.offset=null!==(h=e.offset)&&void 0!==h?h:0)}set offset(e){this.uniforms.offset.value=e}get offset(){return this.uniforms.offset.value}setOpacity(e){super.setOpacity(e),void 0!==e&&this.updateStencil()}get color(){return this.m_color}set color(e){this.m_color.copy(e).toVector(this.uniforms.diffuseColor.value),this.updateStencil()}get dashColor(){return this.m_dashColor}set dashColor(e){this.m_dashColor.copy(e).toVector(this.uniforms.dashColor.value)}get width(){return 2*this.uniforms.extrusionWidth.value}set width(e){this.uniforms.extrusionWidth.value=e/2}get\"dash-image\"(){return this.uniforms.dashImage.value}set\"dash-image\"(e){this.uniforms.dashImage.value=e,(0,l.setShaderMaterialDefine)(this,\"USE_DASH_IMAGE\",!0)}get\"dash-pattern\"(){return this.uniforms.dashPattern.value}set\"dash-pattern\"(e){this.uniforms.dashPattern.value=e,e&&((0,l.setShaderMaterialDefine)(this,\"USE_DASHED_LINE\",e.x>0),(0,l.setShaderMaterialDefine)(this,\"USE_SECOND_DASH\",e.z>0))}get cap(){let e=\"round\";const t=(0,l.getShaderMaterialDefine)(this,\"CAPS_MODE\");return\"number\"==typeof t&&h.hasOwnProperty(t)&&(e=h[t]),e}set cap(e){u.hasOwnProperty(e)&&(0,l.setShaderMaterialDefine)(this,\"CAPS_MODE\",u[e])}get dashes(){let e=\"Square\";const t=(0,l.getShaderMaterialDefine)(this,\"DASHES_MODE\");return\"number\"==typeof t&&f.hasOwnProperty(t)&&(e=f[t]),e}set dashes(e){p.hasOwnProperty(e)&&(0,l.setShaderMaterialDefine)(this,\"DASHES_MODE\",p[e])}get fadeNear(){return this.uniforms.fadeNear.value}set fadeNear(e){this.uniforms.fadeNear.value=e}get fadeFar(){return this.uniforms.fadeFar.value}set fadeFar(e){this.uniforms.fadeFar.value=e,(0,l.setShaderMaterialDefine)(this,\"USE_FADING\",e>0)}get displacementMap(){return this.uniforms.displacementMap.value}set displacementMap(e){if(this.uniforms.displacementMap.value===e)return;this.uniforms.displacementMap.value=e;const t=null!==e;t&&(this.uniforms.displacementMap.value.needsUpdate=!0),(0,l.setShaderMaterialDefine)(this,\"USE_DISPLACEMENTMAP\",t)}get drawRangeStart(){return this.uniforms.drawRange.value.x}set drawRangeStart(e){this.uniforms.drawRange.value.x=e}get drawRangeEnd(){return this.uniforms.drawRange.value.y}set drawRangeEnd(e){this.uniforms.drawRange.value.y=e}set clipTileSize(e){this.uniforms.tileSize.value.copy(e);const t=e.x>0&&e.y>0;(0,l.setShaderMaterialDefine)(this,\"USE_TILE_CLIP\",t)}get clipTileSize(){return this.uniforms.tileSize.value}set canvasSize(e){this.uniforms.canvasSize.value.copy(e)}get canvasSize(){return this.uniforms.canvasSize.value}copy(e){return super.copy(e),this.invalidateFog(),this.setOpacity(e.opacity),this}updateStencil(){var e,t;this.stencilWrite=this.opacity*(null!==(t=null===(e=this.color)||void 0===e?void 0:e.a)&&void 0!==t?t:1)<.98}}t.SolidLineMaterial=g,g.DEFAULT_COLOR=new i.Vector4(1,0,0,1),g.DEFAULT_DASH_COLOR=new i.Vector4(1,0,0,0),g.DEFAULT_WIDTH=1,g.DEFAULT_OPACITY=1,g.DEFAULT_DRAW_RANGE_START=0,g.DEFAULT_DRAW_RANGE_END=1,g.DEFAULT_DASH_SIZE=1,g.DEFAULT_GAP_SIZE=1,g.DEFAULT_OFFSET=0,g.ENABLE_WIREFRAME=!1},8578:(e,t,n)=>{\"use strict\";
947Object.defineProperty(t,\"__esModule\",{value:!0}),t.getShaderDefine=t.setShaderDefine=t.getShaderMaterialDefine=t.setShaderMaterialDefine=t.disableBlending=t.enableBlending=t.enforceBlending=t.insertShaderInclude=t.DEFINE_BOOL_FALSE=t.DEFINE_BOOL_TRUE=void 0;const i=n(82),r=n(4342);function o(e){!0!==e.transparent&&!0!==e.forcedBlending&&(e.blending=i.CustomBlending,!0===e.premultipliedAlpha?(e.blendSrc=i.OneFactor,e.blendDst=i.OneMinusSrcAlphaFactor,e.blendSrcAlpha=i.OneFactor,e.blendDstAlpha=i.OneMinusSrcAlphaFactor):(e.blendSrc=i.SrcAlphaFactor,e.blendDst=i.OneMinusSrcAlphaFactor,e.blendSrcAlpha=i.OneFactor,e.blendDstAlpha=i.OneMinusSrcAlphaFactor))}function s(e,t,n=!1){return void 0===e.defines?n:l(e.defines,t)}function a(e,n,i){let r=!1;return\"number\"==typeof i?(r=e[n]!==i,e[n]=i):!0===i?(r=e[n]!==t.DEFINE_BOOL_TRUE,e[n]=t.DEFINE_BOOL_TRUE):!1===i&&void 0!==e[n]&&(delete e[n],r=!0),r}function l(e,n){const i=e[n];return i!==t.DEFINE_BOOL_FALSE&&(i===t.DEFINE_BOOL_TRUE||i)}t.DEFINE_BOOL_TRUE=\"\",t.DEFINE_BOOL_FALSE=void 0,t.insertShaderInclude=function(e,t,n,i){const r=!0===i?\"\\t\":\"\";return e.replace(`#include <${t}>`,`#include <${t}>\\n${r}#include <${n}>`)},t.enforceBlending=function(e){e.transparent||(o(e),e.forcedBlending=!0)},t.enableBlending=o,t.disableBlending=function(e){!0!==e.transparent&&!0!==e.forcedBlending&&(e.blending=i.NormalBlending)},t.setShaderMaterialDefine=function(e,t,n){(0,r.assert)(void 0!==e.defines,\"Do not use this function in ShaderMaterial derived c-tor.\");const i=n!==s(e,t);return!!i&&(a(e.defines,t,n),e.needsUpdate=i,!0)},t.getShaderMaterialDefine=s,t.setShaderDefine=a,t.getShaderDefine=l},4744:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.hasColorCorrectionFeature=t.ColorCorrectionFeature=void 0;const i=n(4342),r=n(71),o=n(4030),s=n(8578),a=n(82);!function(e){function t(e){return void 0!==e.gamma||void 0!==e.brightness}e.DEFAULT_GAMMA=1,e.DEFAULT_BRIGHTNESS=1,e.isEnabled=t,e.patchGlobalShaderChunks=function(){void 0===a.ShaderChunk.color_correction_parts_fragment&&Object.assign(a.ShaderChunk,o.default)},e.updateColorCorrectionFeature=function(n){(0,i.assert)(void 0!==n.shaderDefines),(0,i.assert)(void 0!==n.shaderUniforms);const r=t(n),o=(0,s.setShaderDefine)(n.shaderDefines,\"USE_COLOR_CORRECTION\",r);n.needsUpdate=o,(0,i.assert)(void 0!==n.shaderUniforms.u_gamma),(0,i.assert)(void 0!==n.shaderUniforms.u_brightness),r?(n.shaderUniforms.u_gamma.value=n.gamma>0?n.gamma:0,n.shaderUniforms.u_brightness.value=a.MathUtils.clamp(n.brightness,0,1)):o&&(n.shaderUniforms.u_gamma.value=e.DEFAULT_GAMMA,n.shaderUniforms.u_brightness.value=e.DEFAULT_BRIGHTNESS)},e.onBeforeCompile=function(e,n){t(e)&&((0,i.assert)(void 0!==e.shaderUniforms),(0,r.linkMixinWithShader)(e,n),n.fragmentShader=(0,s.insertShaderInclude)(n.fragmentShader,\"common\",\"color_correction_parts_fragment\"),n.fragmentShader=(0,s.insertShaderInclude)(n.fragmentShader,\"color_fragment\",\"color_correction_fragment\",!0))}}(t.ColorCorrectionFeature||(t.ColorCorrectionFeature={})),t.hasColorCorrectionFeature=function(e){return\"brightness\"in e&&\"gamma\"in e}},8583:(e,t)=>{\"use strict\";function n(e){return\"displacementMap\"in e}Object.defineProperty(t,\"__esModule\",{value:!0}),t.setDisplacementMapToMaterial=t.hasDisplacementFeature=void 0,t.hasDisplacementFeature=n,t.setDisplacementMapToMaterial=function(e,t){n(t)&&t.displacementMap!==e&&(t.displacementMap=e,t.needsUpdate=!0,null!==t.displacementMap&&(t.displacementMap.needsUpdate=!0))}},8014:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.ExtrusionFeature=t.hasExtrusionFeature=void 0;const i=n(82),r=n(4342),o=n(71),s=n(4305),a=n(8578),l=n(8955);t.hasExtrusionFeature=function(e){return\"extrusionRatio\"in e},function(e){function t(e){return void 0!==e.extrusionRatio&&e.extrusionRatio>=l.ExtrusionFeatureDefs.DEFAULT_RATIO_MIN}e.isEnabled=t,e.patchGlobalShaderChunks=function(){void 0===i.ShaderChunk.extrusion_pars_vertex&&Object.assign(i.ShaderChunk,s.default)},e.updateExtrusionFeature=function(e){(0,r.assert)(void 0!==e.shaderDefines),(0,r.assert)(void 0!==e.shaderUniforms);const n=t(e),i=(0,a.setShaderDefine)(e.shaderDefines,\"EXTRUSION_MATERIAL\",n);e.needsUpdate=i,n?e.shaderUniforms.extrusionRatio.value=e.extrusionRatio:i&&(e.shaderUniforms.extrusionRatio.value=l.ExtrusionFeatureDefs.DEFAULT_RATIO_MAX)},e.onBeforeCompile=function(e,n){t(e)&&((0,r.assert)(void 0!==e.shaderUniforms),(0,o.linkMixinWithShader)(e,n),n.vertexShader=(0,a.insertShaderInclude)(n.vertexShader,\"common\",\"extrusion_pars_vertex\"),n.vertexShader=(0,a.insertShaderInclude)(n.vertexShader,\"begin_vertex\",\"extrusion_vertex\",!0),n.fragmentShader=(0,a.insertShaderInclude)(n.fragmentShader,\"fog_pars_fragment\",\"extrusion_pars_fragment\"),n.fragmentShader=n.fragmentShader.replace(\"#include <normal_fragment_begin>\",\"#include <extrusion_normal_fragment_begin>\"),n.fragmentShader=(0,a.insertShaderInclude)(n.fragmentShader,\"fog_fragment\",\"extrusion_fragment\",!0))}}(t.ExtrusionFeature||(t.ExtrusionFeature={}))},8955:(e,t)=>{\"use strict\";var n;
947Object.defineProperty(t,\"__esModule\",{value:!0}),t.ExtrusionFeatureDefs=void 0,(n=t.ExtrusionFeatureDefs||(t.ExtrusionFeatureDefs={})).DEFAULT_RATIO_MIN=0,n.DEFAULT_RATIO_MAX=1,n.MIN_BUILDING_HEIGHT=.1},8177:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.FadingFeature=void 0;const i=n(82),r=n(4342),o=n(71),s=n(3739),a=n(8578);!function(e){function t(e){return void 0!==e.fadeNear&&void 0!==e.fadeFar&&e.fadeFar>0}e.DEFAULT_FADE_NEAR=-1,e.DEFAULT_FADE_FAR=-1,e.isEnabled=t,e.isDefined=function(e){return void 0!==e.fadeNear&&void 0!==e.fadeFar},e.patchGlobalShaderChunks=function(){void 0===i.ShaderChunk.fading_pars_vertex&&Object.assign(i.ShaderChunk,s.default)},e.updateFadingFeature=function(n){(0,r.assert)(void 0!==n.shaderDefines),(0,r.assert)(void 0!==n.shaderUniforms);const i=t(n),o=(0,a.setShaderDefine)(n.shaderDefines,\"FADING_MATERIAL\",i);n.needsUpdate=o,(0,r.assert)(void 0!==n.shaderUniforms.fadeNear&&void 0!==n.shaderUniforms.fadeFar),i?(n.shaderUniforms.fadeNear.value=n.fadeNear,n.shaderUniforms.fadeFar.value=n.fadeFar,o&&(0,a.enableBlending)(n)):o&&(n.shaderUniforms.fadeNear.value=e.DEFAULT_FADE_NEAR,n.shaderUniforms.fadeFar.value=e.DEFAULT_FADE_FAR,(0,a.disableBlending)(n))},e.onBeforeCompile=function(e,n){t(e)&&((0,r.assert)(void 0!==e.shaderUniforms),(0,o.linkMixinWithShader)(e,n),n.vertexShader=(0,a.insertShaderInclude)(n.vertexShader,\"fog_pars_vertex\",\"fading_pars_vertex\"),n.vertexShader=(0,a.insertShaderInclude)(n.vertexShader,\"fog_vertex\",\"fading_vertex\",!0),n.fragmentShader=(0,a.insertShaderInclude)(n.fragmentShader,\"fog_pars_fragment\",\"fading_pars_fragment\"),n.fragmentShader=(0,a.insertShaderInclude)(n.fragmentShader,\"fog_fragment\",\"fading_fragment\",!0))},e.addRenderHelper=function(t,n,i,s,a,l){t.onBeforeRender=(0,r.chainCallbacks)(t.onBeforeRender,((t,r,a,c,u,h)=>{const d=u;d.fadeNear=void 0===i||i===e.DEFAULT_FADE_NEAR?e.DEFAULT_FADE_NEAR:(0,o.cameraToWorldDistance)(i,n),d.fadeFar=void 0===s||s===e.DEFAULT_FADE_FAR?e.DEFAULT_FADE_FAR:(0,o.cameraToWorldDistance)(s,n),void 0!==l&&l(t,u)}))}}(t.FadingFeature||(t.FadingFeature={}))},4258:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.ColorCorrectionFeatureMixin=void 0;const i=n(4342),r=n(9276),o=n(71),s=n(82),a=n(4744);t.ColorCorrectionFeatureMixin=class{constructor(){this.m_brightness=a.ColorCorrectionFeature.DEFAULT_BRIGHTNESS,this.m_gamma=a.ColorCorrectionFeature.DEFAULT_GAMMA}getBrightness(){return this.m_brightness}setBrightness(e){e!==this.m_brightness&&(this.m_brightness=e,a.ColorCorrectionFeature.updateColorCorrectionFeature(this))}getGamma(){return this.m_gamma}setGamma(e){e!==this.m_gamma&&(this.m_gamma=e,a.ColorCorrectionFeature.updateColorCorrectionFeature(this))}addColorCorrectionProperties(){Object.defineProperty(this,\"brightness\",{get:()=>this.getBrightness(),set:e=>{this.setBrightness(e)}}),Object.defineProperty(this,\"gamma\",{get:()=>this.getGamma(),set:e=>{this.setGamma(e)}})}applyColorCorrectionParameters(e){(0,o.linkMixinWithMaterial)(this,this),(0,i.assert)(void 0!==this.shaderDefines),(0,i.assert)(void 0!==this.shaderUniforms),this.shaderUniforms.u_gamma=new s.Uniform(a.ColorCorrectionFeature.DEFAULT_GAMMA),this.shaderUniforms.u_brightness=new s.Uniform(a.ColorCorrectionFeature.DEFAULT_BRIGHTNESS),void 0!==e&&(void 0!==e.brightness&&this.setBrightness(e.brightness),void 0!==e.gamma&&this.setGamma(e.gamma)),this.onBeforeCompile=(0,r.chainCallbacks)(this.onBeforeCompile,(e=>{a.ColorCorrectionFeature.onBeforeCompile(this,e)})),this.needsUpdate=a.ColorCorrectionFeature.isEnabled(this)}copyColorCorrectionParameters(e){return this.setBrightness(void 0===e.brightness?a.ColorCorrectionFeature.DEFAULT_BRIGHTNESS:e.brightness),this.setGamma(void 0===e.gamma?a.ColorCorrectionFeature.DEFAULT_GAMMA:e.gamma),this}}},8878:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.DisplacementFeatureMixin=void 0;const i=n(82),r=n(4342),o=n(71),s=n(8578),a=new i.Texture;var l;!function(e){function t(e){return null!==e.displacementMap}e.isEnabled=t,e.updateDisplacementFeature=function(e){(0,r.assert)(void 0!==e.shaderDefines),(0,r.assert)(void 0!==e.shaderUniforms);const n=t(e),i=(0,s.setShaderDefine)(e.shaderDefines,\"USE_DISPLACEMENTMAP\",n);
947if(e.needsUpdate=i,n){const t=e.displacementMap;t.needsUpdate=!0,e.shaderUniforms.displacementMap.value=t}else i&&(e.shaderUniforms.displacementMap.value=a)},e.onBeforeCompile=function(e,n){t(e)&&((0,r.assert)(void 0!==e.shaderUniforms),(0,o.linkMixinWithShader)(e,n),n.vertexShader=n.vertexShader.replace(\"#include <skinbase_vertex>\",\"#include <skinbase_vertex>\\n#ifndef USE_ENVMAP\\n vec3 objectNormal = vec3( normal );\\n#endif\"),n.vertexShader=(0,s.insertShaderInclude)(n.vertexShader,\"uv2_pars_vertex\",\"displacementmap_pars_vertex\"),n.vertexShader=(0,s.insertShaderInclude)(n.vertexShader,\"skinning_vertex\",\"displacementmap_vertex\",!0))}}(l||(l={})),t.DisplacementFeatureMixin=class{constructor(){this.m_displacementMap=null}get displacementMap(){return this.m_displacementMap}set displacementMap(e){this.setDisplacementMap(e)}getDisplacementMap(){return this.m_displacementMap}setDisplacementMap(e){e!==this.m_displacementMap&&(this.m_displacementMap=e,l.updateDisplacementFeature(this))}addDisplacementProperties(){Object.defineProperty(this,\"displacementMap\",{get:()=>this.getDisplacementMap(),set:e=>{this.setDisplacementMap(e)}})}applyDisplacementParameters(e){(0,o.linkMixinWithMaterial)(this,this),(0,r.assert)(void 0!==this.shaderDefines),(0,r.assert)(void 0!==this.shaderUniforms);const t=this.shaderUniforms;t.displacementMap=new i.Uniform(a),t.displacementScale=new i.Uniform(1),t.displacementBias=new i.Uniform(0),void 0!==e&&void 0!==e.displacementMap&&this.setDisplacementMap(e.displacementMap),this.onBeforeCompile=(0,r.chainCallbacks)(this.onBeforeCompile,(e=>{l.onBeforeCompile(this,e)})),this.needsUpdate=l.isEnabled(this)}copyDisplacementParameters(e){return this.setDisplacementMap(e.displacementMap),this}}},5997:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.ExtrusionFeatureMixin=void 0;const i=n(82),r=n(4342),o=n(8014),s=n(8955),a=n(71);t.ExtrusionFeatureMixin=class{constructor(){this.m_extrusion=s.ExtrusionFeatureDefs.DEFAULT_RATIO_MAX}getExtrusionRatio(){return this.m_extrusion}setExtrusionRatio(e){e!==this.m_extrusion&&(this.m_extrusion=e,o.ExtrusionFeature.updateExtrusionFeature(this))}addExtrusionProperties(){Object.defineProperty(this,\"extrusionRatio\",{get:()=>this.getExtrusionRatio(),set:e=>{this.setExtrusionRatio(e)}})}applyExtrusionParameters(e){(0,a.linkMixinWithMaterial)(this,this),(0,r.assert)(void 0!==this.shaderDefines),(0,r.assert)(void 0!==this.shaderUniforms),e&&!0===e.zFightingWorkaround&&(this.shaderDefines.ZFIGHTING_WORKAROUND=\"\"),this.shaderUniforms.extrusionRatio=new i.Uniform(s.ExtrusionFeatureDefs.DEFAULT_RATIO_MAX),void 0!==e&&void 0!==e.extrusionRatio&&this.setExtrusionRatio(e.extrusionRatio),this.onBeforeCompile=(0,r.chainCallbacks)(this.onBeforeCompile,(e=>{o.ExtrusionFeature.onBeforeCompile(this,e)})),this.needsUpdate=o.ExtrusionFeature.isEnabled(this)}copyExtrusionParameters(e){return void 0!==e.extrusionRatio&&this.setExtrusionRatio(e.extrusionRatio),this}}},674:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.FadingFeatureMixin=void 0;const i=n(82),r=n(4342),o=n(8177),s=n(71);t.FadingFeatureMixin=class{constructor(){this.m_fadeNear=o.FadingFeature.DEFAULT_FADE_NEAR,this.m_fadeFar=o.FadingFeature.DEFAULT_FADE_FAR}getFadeNear(){return this.m_fadeNear}setFadeNear(e){e!==this.m_fadeNear&&(this.m_fadeNear=e,o.FadingFeature.updateFadingFeature(this))}getFadeFar(){return this.m_fadeFar}setFadeFar(e){e!==this.m_fadeFar&&(this.m_fadeFar=e,o.FadingFeature.updateFadingFeature(this))}addFadingProperties(){Object.defineProperty(this,\"fadeNear\",{get:()=>this.getFadeNear(),set:e=>{this.setFadeNear(e)}}),Object.defineProperty(this,\"fadeFar\",{get:()=>this.getFadeFar(),set:e=>{this.setFadeFar(e)}})}applyFadingParameters(e){(0,s.linkMixinWithMaterial)(this,this),(0,r.assert)(void 0!==this.shaderDefines),(0,r.assert)(void 0!==this.shaderUniforms),this.shaderUniforms.fadeNear=new i.Uniform(o.FadingFeature.DEFAULT_FADE_NEAR),this.shaderUniforms.fadeFar=new i.Uniform(o.FadingFeature.DEFAULT_FADE_FAR),void 0!==e&&(void 0!==e.fadeNear&&this.setFadeNear(e.fadeNear),void 0!==e.fadeFar&&this.setFadeFar(e.fadeFar)),this.onBeforeCompile=(0,r.chainCallbacks)(this.onBeforeCompile,(e=>{o.FadingFeature.onBeforeCompile(this,e)})),this.needsUpdate=o.FadingFeature.isEnabled(this)}copyFadingParameters(e){return this.setFadeNear(void 0===e.fadeNear?o.FadingFeature.DEFAULT_FADE_NEAR:e.fadeNear),this.setFadeFar(void 0===e.fadeFar?o.FadingFeature.DEFAULT_FADE_FAR:e.fadeFar),this}}},1870:(e,t)=>{\"use strict\";
947Object.defineProperty(t,\"__esModule\",{value:!0}),t.default={atmosphere_vertex_utils:\"\\n\\n const float RayleighScaleDepth = 0.25;\\n\\n struct AtmosphereColor\\n {\\n vec3 mie;\\n vec3 rayleigh;\\n };\\n\\n float scale(float cosAngle)\\n {\\n float x = 1.0 - cosAngle;\\n return RayleighScaleDepth * exp(-0.00287 + x*(0.459 + x*(3.83 + x*(-6.80 + x*5.25))));\\n }\\n\\n float getNearSphereIntersect(vec3 v3Pos, vec3 v3Ray, float fCameraHeight2, float fOuterRadius2) {\\n // Solve simple square equation for the x0 (first point of intersection).\\n#if defined(IMPROVE_INTERSECT_PRECISION)\\n // To improve precision instead of simple projection: b = 2.0 * dot(vPos, v3Ray),\\n // we change the equation that gives better results especially around the poles.\\n float fB = 2.0 * length(v3Pos) * dot(normalize(v3Pos), v3Ray);\\n#else\\n float fB = 2.0 * dot(v3Pos, v3Ray);\\n#endif\\n float fC = fCameraHeight2 - fOuterRadius2;\\n // det = b^2 - 4*a*c, where a = 1\\n float fDet = max(0.0, fB * fB - 4.0 * fC);\\n // Intersection points distances are defined as follows:\\n // x0 = (-b - sqrt(det)) / 2*a ^ x1 = (-b + sqrt(det)) / 2*a\\n // we search for x0:\\n return 0.5 * (-fB - sqrt(fDet));\\n }\\n\\n float getFarSphereIntersect(vec3 v3Pos, vec3 v3Ray, float fCameraHeight2, float fOuterRadius2) {\\n // Solve simple square equation for the x1 (second point of intersection).\\n#if defined(IMPROVE_INTERSECT_PRECISION)\\n float fB = 2.0 * length(v3Pos) * dot(normalize(v3Pos), v3Ray);\\n#else\\n float fB = 2.0 * dot(v3Pos, v3Ray);\\n#endif\\n float fC = fCameraHeight2 - fOuterRadius2;\\n // det = b^2 - 4*a*c, where a = 1\\n float fDet = max(0.0, fB * fB - 4.0 * fC);\\n // Compute second intersection distance:\\n // x1 = (-b + sqrt(det)) / 2*a\\n return 0.5 * (-fB + sqrt(fDet));\\n }\\n \",atmosphere_fragment_utils:\"\\n\\n // Branch free RGB to HSV conversion.\\n // Based on article:\\n // http://lolengine.net/blog/2013/01/13/fast-rgb-to-hsv\\n // and optimized OpenGL SL algorithm\\n // http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl\\n vec3 rgb2Hsv(vec3 c)\\n {\\n const vec4 RGB_HSV_CONV = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);\\n // Ternary operator may be used explicitly if compiler can use fast conditional move.\\n // vec4 p = c.g < c.b ? vec4(c.bg, RGB_HSV_CONV.wz) : vec4(c.gb, RGB_HSV_CONV.xy);\\n vec4 p = mix(vec4(c.bg, RGB_HSV_CONV.wz), vec4(c.gb, RGB_HSV_CONV.xy), step(c.b, c.g));\\n // vec4 q = c.r < p.x ? vec4(p.xyw, c.r) : vec4(c.r, p.yzx);\\n vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));\\n\\n float d = q.x - min(q.w, q.y);\\n float e = 1.0e-10;\\n return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);\\n }\\n\\n // Branch free HSV to RGB conversion\\n vec3 hsv2Rgb(vec3 c)\\n {\\n const vec4 HSV_RGB_CONV = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\\n vec3 p = abs(fract(c.xxx + HSV_RGB_CONV.xyz) * 6.0 - HSV_RGB_CONV.www);\\n return c.z * mix(HSV_RGB_CONV.xxx, clamp(p - HSV_RGB_CONV.xxx, 0.0, 1.0), c.y);\\n }\\n\\n vec3 correctExposure(vec3 rgb, float exposure)\\n {\\n const vec3 fullColor = vec3(1.0);\\n return fullColor - exp(-exposure * rgb);\\n }\\n\\n vec3 correctColor(vec3 rgb, vec3 hsvShift)\\n {\\n const float e = 0.0000001;\\n // Convert rgb color to hsv\\n vec3 hsv = rgb2Hsv(rgb);\\n // Shift hue value with angle wrapping\\n hsv.x = mod(hsv.x + hsvShift.x, 1.0);\\n // Shift and clamp saturation\\n hsv.y = clamp(hsv.y + hsvShift.y, 0.0, 1.0);\\n // Change value if it is significant (greater then epsilon)\\n hsv.z = hsv.z > e ? clamp(hsv.z + hsvShift.z, 0.0, 1.0) : 0.0;\\n // Convert shifted hsv back to rgb\\n return hsv2Rgb(hsv);\\n }\\n \"}},5089:(e,t)=>
947{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.blinnPhongNoSpecular=void 0,t.blinnPhongNoSpecular=\"\\nuniform float colorIntensity;\\nvoid RE_Direct_BlinnPhong_NoSpecular( const in IncidentLight directLight,\\n const in GeometricContext geometry,\\n const in BlinnPhongMaterial material,\\n inout ReflectedLight reflectedLight ) {\\n\\n float dotNL = saturate( dot( geometry.normal, directLight.direction ) );\\n vec3 irradiance = dotNL * directLight.color;\\n\\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor * colorIntensity);\\n}\\n#undef RE_Direct\\n#define RE_Direct RE_Direct_BlinnPhong_NoSpecular\\n\"},4030:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default={color_correction_parts_fragment:\"\\n #ifdef USE_COLOR_CORRECTION\\n uniform float u_gamma;\\n uniform float u_brightness;\\n #endif\\n \",color_correction_fragment:\"\\n #ifdef USE_COLOR_CORRECTION\\n diffuseColor = vec4( pow( diffuseColor.rgb, vec3( u_gamma ) ) * u_brightness, diffuseColor.a);\\n #endif\\n \"}},4305:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});const i=n(8955),r=i.ExtrusionFeatureDefs.MIN_BUILDING_HEIGHT*i.ExtrusionFeatureDefs.MIN_BUILDING_HEIGHT;t.default={extrusion_pars_vertex:\"\\n// Add define so we can check for it in the outline effect (see Outline.ts).\\n#define HAS_EXTRUSION_PARS_VERTEX\\n// Extrusion axis (xyz: vector, w: factor).\\nattribute vec4 extrusionAxis;\\nuniform float extrusionRatio;\\n#ifdef FLAT_SHADED\\nvarying vec4 vExtrusionAxis;\\n#endif\\n#ifdef ZFIGHTING_WORKAROUND\\nvarying float vExtrusionRatio;\\n#endif\\n\",extrusion_vertex:`\\n#define HAS_EXTRUSION_VERTEX\\n#ifdef ZFIGHTING_WORKAROUND\\n// Cancel extrusionRatio (meaning, force to 1) if extrusionAxisLen < MIN_BUILDING_HEIGHT.\\nconst float MIN_BUILDING_HEIGHT_SQUARED = ${r};\\nfloat extrusionAxisLenSquared = dot(extrusionAxis.xyz, extrusionAxis.xyz);\\nvExtrusionRatio = (extrusionAxisLenSquared < MIN_BUILDING_HEIGHT_SQUARED) ? 1.0 : extrusionRatio;\\n#else\\nfloat vExtrusionRatio = extrusionRatio;\\n#endif\\ntransformed = transformed + extrusionAxis.xyz * (vExtrusionRatio - 1.0);\\n#ifdef FLAT_SHADED\\nvExtrusionAxis = vec4(normalMatrix * extrusionAxis.xyz, extrusionAxis.w);\\n#endif\\n`,extrusion_normal_fragment_begin:\"\\n#ifdef FLAT_SHADED\\n // Flattened this divergent path to prevent undefined behaviour in the following derivatives\\n // functions. For more info:\\n // http://www.aclockworkberry.com/shader-derivative-functions/#Derivatives_and_branches\\n\\n // Workaround for Adreno/Nexus5 not able able to do dFdx( vViewPosition ) ...\\n vec3 fdx = vec3(dFdx(vViewPosition.x), dFdx(vViewPosition.y), dFdx(vViewPosition.z));\\n vec3 fdy = vec3(dFdy(vViewPosition.x), dFdy(vViewPosition.y), dFdy(vViewPosition.z));\\n vec3 normal = cross( fdx, fdy );\\n if (vExtrusionAxis.w > 0.999999) {\\n normal = vExtrusionAxis.xyz;\\n }\\n normal = normalize(normal);\\n#else\\n\\tvec3 normal = normalize( vNormal );\\n\\t#ifdef DOUBLE_SIDED\\n\\t\\tnormal = normal * (float(gl_FrontFacing) * 2.0 - 1.0);\\n\\t#endif\\n\\t#ifdef USE_TANGENT\\n\\t\\tvec3 tangent = normalize( vTangent );\\n\\t\\tvec3 bitangent = normalize( vBitangent );\\n\\t\\t#ifdef DOUBLE_SIDED\\n\\t\\t\\ttangent = tangent * (float(gl_FrontFacing) * 2.0 - 1.0);\\n\\t\\t\\tbitangent = bitangent * (float(gl_FrontFacing) * 2.0 - 1.0);\\n\\t\\t#endif\\n\\t#endif\\n#endif\\n// non perturbed normal for clearcoat among others\\nvec3 geometryNormal = normal;\\n\",extrusion_pars_fragment:\"\\n#ifdef ZFIGHTING_WORKAROUND\\nvarying float vExtrusionRatio;\\n#else\\nuniform float extrusionRatio;\\n#endif\\nvarying vec4 vExtrusionAxis;\\n\",extrusion_fragment:\"\\n#ifndef ZFIGHTING_WORKAROUND\\nfloat vExtrusionRatio = extrusionRatio;\\n#endif\\ngl_FragColor.a *= smoothstep( 0.0, 0.25, vExtrusionRatio );\\n\"}},3739:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default={fading_pars_vertex:\"\\nvarying float fadingDepth;\\n\",fading_vertex:\"\\nfadingDepth = -mvPosition.z;\\n\",fading_pars_fragment:\"\\nvarying float fadingDepth;\\nuniform float fadeNear;\\nuniform float fadeFar;\\n\",fading_fragment:'\\n\\n// lerp with \"hard\" edges\\n//float fadingFactor = 1.0 - clamp((fadingDepth - fadeNear) / (fadeFar - fadeNear), 0.0, 1.0);
947\\n\\n// smooth transitions\\nfloat fadingFactor = smoothstep( fadeNear, fadeFar, fadingDepth );\\n\\ngl_FragColor.a *= 1.0 - fadingFactor;\\n\\n// debugging color:\\n// gl_FragColor = vec4(1., fadingFactor, fadingFactor, 1.0);\\n'}},7133:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default={high_precision_vert_func:\"\\nvec3 subtractDblEyePos( const in vec3 pos ) {\\n vec3 t1 = positionLow - u_eyepos_lowpart;\\n vec3 e = t1 - positionLow;\\n vec3 t2 = ((-u_eyepos_lowpart - e) + (positionLow - (t1 - e))) + pos - u_eyepos;\\n vec3 high_delta = t1 + t2;\\n vec3 low_delta = t2 - (high_delta - t1);\\n return (high_delta + low_delta);\\n}\\n\"}},759:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.simpleLightingShadowChunk=void 0,t.simpleLightingShadowChunk=\"\\n struct PhysicalMaterial {\\n vec3\\tdiffuseColor;\\n float\\tspecularRoughness;\\n vec3\\tspecularColor;\\n };\\n\\n #define DEFAULT_SPECULAR_COEFFICIENT 0.04\\n\\n void RE_Direct_Physical( const in IncidentLight directLight,\\n const in GeometricContext geometry,\\n const in PhysicalMaterial material,\\n inout ReflectedLight reflectedLight ) {\\n // directLight.color is the light color * shadow, internally three.js uses a step function, so\\n // this value is either the light color or black. in order to lighten up the shadows, we\\n // take add 50% of the color to grey (to give us either pure white or grey) and multiply this to\\n // the material's diffuse color.\\n #if defined(USE_SHADOWMAP)\\n reflectedLight.directDiffuse = (0.5 * directLight.color +\\n vec3(0.5,0.5,0.5)) * material.diffuseColor;\\n #else\\n reflectedLight.directDiffuse = material.diffuseColor;\\n #endif\\n }\\n\\n void RE_IndirectDiffuse_Physical( const in vec3 irradiance,\\n const in GeometricContext geometry,\\n const in PhysicalMaterial material,\\n inout ReflectedLight reflectedLight ) {\\n // Disable influence of indirect light (it is handled in the RE_Direct_Physical function)\\n }\\n\\n void RE_IndirectSpecular_Physical( const in vec3 radiance,\\n const in vec3 irradiance,\\n const in vec3 clearcoatRadiance,\\n const in GeometricContext geometry,\\n const in PhysicalMaterial material,\\n inout ReflectedLight reflectedLight) {\\n // Disable specular reflection of light.\\n }\\n\\n #define RE_Direct RE_Direct_Physical\\n #define RE_IndirectDiffuse RE_IndirectDiffuse_Physical\\n #define RE_IndirectSpecular RE_IndirectSpecular_Physical\\n\"},398:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.LuminosityHighPassShader=void 0;const i=n(82);t.LuminosityHighPassShader={uniforms:{tDiffuse:{value:null},luminosityThreshold:{value:1},smoothWidth:{value:1},defaultColor:{value:new i.Color(0)},defaultOpacity:{value:0}},vertexShader:\"\\n varying vec2 vUv;\\n void main() {\\n vUv = uv;\\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\\n }\",fragmentShader:\"\\n uniform sampler2D tDiffuse;\\n uniform vec3 defaultColor;\\n uniform float defaultOpacity;\\n uniform float luminosityThreshold;\\n uniform float smoothWidth;\\n varying vec2 vUv;\\n void main() {\\n vec4 texel = texture2D( tDiffuse, vUv );\\n vec3 luma = vec3( 0.299, 0.587, 0.114 );\\n float v = dot( texel.xyz, luma );\\n vec4 outputColor = vec4( defaultColor.rgb, defaultOpacity );\\n float alpha = smoothstep( luminosityThreshold, luminosityThreshold + smoothWidth, v );\\n gl_FragColor = mix( outputColor, texel, alpha );\\n }\"}},4919:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.SepiaShader=void 0,t.SepiaShader={uniforms:{tDiffuse:{value:null},amount:{value:1}},vertexShader:\"\\n varying vec2 vUv;\\n void main() {\\n vUv = uv;\\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0
947);\\n }\",fragmentShader:\"\\n uniform float amount;\\n uniform sampler2D tDiffuse;\\n varying vec2 vUv;\\n void main() {\\n vec4 color = texture2D( tDiffuse, vUv );\\n vec3 c = color.rgb;\\n color.r = dot( c, vec3( 1.0 - 0.607 * amount, 0.769 * amount, 0.189 * amount ) );\\n color.g = dot( c, vec3( 0.349 * amount, 1.0 - 0.314 * amount, 0.168 * amount ) );\\n color.b = dot( c, vec3( 0.272 * amount, 0.534 * amount, 1.0 - 0.869 * amount ) );\\n gl_FragColor = vec4( min( vec3( 1.0 ), color.rgb ), color.a );\\n }\"}},5551:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.VignetteShader=void 0,t.VignetteShader={uniforms:{tDiffuse:{value:null},offset:{value:1},darkness:{value:1}},vertexShader:\"\\n varying vec2 vUv;\\n void main() {\\n vUv = uv;\\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\\n }\",fragmentShader:\"\\n uniform float offset;\\n uniform float darkness;\\n uniform sampler2D tDiffuse;\\n varying vec2 vUv;\\n void main() {\\n vec4 texel = texture2D( tDiffuse, vUv );\\n vec2 uv = ( vUv - vec2( 0.5 ) ) * vec2( offset );\\n gl_FragColor = vec4( mix( texel.rgb, vec3( 1.0 - darkness ), dot( uv, uv ) ), texel.a );\\n }\"}},1509:function(e,t,n){\"use strict\";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);
947r&&!(\"get\"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)\"default\"===n||Object.prototype.hasOwnProperty.call(t,n)||i(t,e,n)};Object.defineProperty(t,\"__esModule\",{value:!0}),t.OmvTilerService=t.OmvTileDecoder=t.OmvTileDecoderService=t.OmvDecoder=void 0,r(n(952),t);var o=n(952);Object.defineProperty(t,\"OmvDecoder\",{enumerable:!0,get:function(){return o.VectorTileDataProcessor}}),Object.defineProperty(t,\"OmvTileDecoderService\",{enumerable:!0,get:function(){return o.VectorTileDecoderService}}),Object.defineProperty(t,\"OmvTileDecoder\",{enumerable:!0,get:function(){return o.VectorTileDecoder}}),Object.defineProperty(t,\"OmvTilerService\",{enumerable:!0,get:function(){return o.GeoJsonTilerService}})},1984:function(e,t,n){\"use strict\";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);
947r&&!(\"get\"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)\"default\"===n||Object.prototype.hasOwnProperty.call(t,n)||i(t,e,n)};Object.defineProperty(t,\"__esModule\",{value:!0}),r(n(7259),t),r(n(8284),t),r(n(1017),t),r(n(1370),t),r(n(1216),t),r(n(5771),t),r(n(8131),t),r(n(6304),t),r(n(8023),t)},1667:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.ColorUtils=void 0;const i=n(82),r=n(8263),o=n(797),s=n(7610),a=255,l=new i.Color,c={h:0,s:0,l:0};!function(e){function t(e,t){return i.MathUtils.clamp(e+(t<0?e:1-e)*t,0,1)}function n(e,t,n){let i;if(s.RGBA.isRGBA(t))i=e.equals(t)===n;else if(\"string\"==typeof t){const r=u.get(t);if(r)i=e.equals(r)===n;else{const r=s.RGBA.parse(t);void 0!==r&&(u.set(t,r),i=e.equals(r)===n)}}return i}e.getHexFromRgba=function(e,t,n,i){return(0,o.assert)(i>=0&&i<=1),a-Math.floor(i*a)<<24^e*a<<16^t*a<<8^n*a},e.getHexFromRgb=function(e,t,n){return(0,o.assert)(e>=0&&e<=1),(0,o.assert)(t>=0&&t<=1),(0,o.assert)(n>=0&&n<=1),e*a<<16^t*a<<8^n*a},e.getHexFromHsl=function(e,t,n){return(0,o.assert)(e>=0&&e<=1),(0,o.assert)(t>=0&&t<=1),(0,o.assert)(n>=0&&n<=1),l.setHSL(e,t,n).getHex()},e.darken=function(e,t){return l.setRGB(e.r,e.g,e.b),l.getHSL(c),c.l=i.MathUtils.clamp(c.l-t,0,1),l.setHSL(c.h,c.s,c.l),e.r=l.r,e.g=l.g,e.b=l.b,e},e.scaleColor=function(e,n){return l.setRGB(e.r,e.g,e.b),l.getHSL(c),c.s=t(c.s,n.s),c.l=t(c.l,n.l),l.setHSL(c.h,c.s,c.l),e.r=l.r,e.g=l.g,e.b=l.b,e.a=t(e.a,n.a),e},e.getRgbaFromHex=function(e,t=new s.RGBA){return(0,o.assert)(!0,\"Wrong hex format\"),t.r=(e>>16&a)/a,t.g=(e>>8&a)/a,t.b=(e&a)/a,t.a=(a-(e>>24&a))/a,t},e.hasAlphaInHex=function(e){return(0,o.assert)(!0,\"Wrong hex format\"),!!(e>>24)},e.getAlphaFromHex=function(e){return(0,o.assert)(!0,\"Wrong hex format\"),(a-(e>>24)&a)/a},e.removeAlphaFromHex=function(e){return(0,o.assert)(!0,\"Wrong hex format\"),16777215&e},e.comparePotentiallyRGBA=function(e,t,i){let r;return s.RGBA.isRGBA(e)?r=n(e,t,i):s.RGBA.isRGBA(t)&&(r=n(t,e,i)),r}}(t.ColorUtils||(t.ColorUtils={}));const u=new r.LRUCache(500)},7259:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.MapEnv=t.Env=void 0;class n{static isEnv(e){return e instanceof n}lookup(e){}unmap(){return{}}}t.Env=n,t.MapEnv=class extends n{constructor(e,t){super(),this.entries=e,this.parent=t}lookup(e){if(this.entries.hasOwnProperty(e)){const t=this.entries[e];if(void 0!==t)return t}return this.parent?this.parent.lookup(e):void 0}unmap(){const e=this.parent?this.parent.unmap():{};for(const t in this.entries)this.entries.hasOwnProperty(t)&&(e[t]=this.entries[t]);return e}}},8284:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.evaluateJsonExpr=void 0;const i=n(7259),r=n(8023);t.evaluateJsonExpr=function(e,t,n){return r.Expr.fromJSON(e,n).evaluate(new i.MapEnv(t),r.ExprScope.Value)}},8023:function(e,t,n){\"use strict\";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);
947r&&!(\"get\"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)\"default\"===n||Object.prototype.hasOwnProperty.call(t,n)||i(t,e,n)};Object.defineProperty(t,\"__esModule\",{value:!0}),t.InterpolateExpr=t.StepExpr=t.CaseExpr=t.MatchExpr=t.LookupExpr=t.CallExpr=t.HasAttributeExpr=t.ObjectLiteralExpr=t.StringLiteralExpr=t.NumberLiteralExpr=t.BooleanLiteralExpr=t.NullLiteralExpr=t.LiteralExpr=t.VarExpr=t.Expr=t.ExprScope=t.ExprDependencies=void 0;const o=n(82),s=n(2302),a=n(908),l=n(8628),c=n(1017),u=n(1324),h=n(7610),d=n(5771);r(n(7259),t);const p=new s.ExprEvaluator,f=new a.ExprInstantiator;class m{constructor(){this.properties=new Set}}t.ExprDependencies=m;class g{static of(e){const t=new m;return e.accept(this.instance,t),t}visitNullLiteralExpr(e,t){}visitBooleanLiteralExpr(e,t){}visitNumberLiteralExpr(e,t){}visitStringLiteralExpr(e,t){}visitObjectLiteralExpr(e,t){}visitVarExpr(e,t){t.properties.add(e.name)}visitHasAttributeExpr(e,t){t.properties.add(e.name)}visitCallExpr(e,t){switch(e.args.forEach((e=>e.accept(this,t))),e.op){case\"dynamic-properties\":t.volatile=!0;break;case\"feature-state\":t.featureState=!0,t.properties.add(\"$state\"),t.properties.add(\"$id\");break;case\"id\":t.properties.add(\"$id\");break;case\"zoom\":case\"world-ppi-scale\":case\"world-discrete-ppi-scale\":t.properties.add(\"$zoom\");break;case\"pixel-world-scale\":t.properties.add(\"$pixelToMeters\");break;case\"geometry-type\":t.properties.add(\"$geometryType\")}}visitLookupExpr(e,t){return this.visitCallExpr(e,t)}visitMatchExpr(e,t){e.value.accept(this,t),e.branches.forEach((([e,n])=>n.accept(this,t))),e.fallback.accept(this,t)}visitCaseExpr(e,t){e.branches.forEach((([e,n])=>{e.accept(this,t),n.accept(this,t)})),e.fallback.accept(this,t)}visitStepExpr(e,t){e.input.accept(this,t),e.defaultValue.accept(this,t),e.stops.forEach((([e,n])=>n.accept(this,t)))}visitInterpolateExpr(e,t){e.input.accept(this,t),e.stops.forEach((([e,n])=>n.accept(this,t)))}}var v;g.instance=new g,function(e){e[e.Value=0]=\"Value\",e[e.Condition=1]=\"Condition\",e[e.Dynamic=2]=\"Dynamic\"}(v=t.ExprScope||(t.ExprScope={}));class y{static isExpr(e){return e instanceof y}static fromJSON(e,t,n,i){return I(e,void 0!==t?{definitions:t,lockedNames:new Set,cache:null!=n?n:new Map,referencedDefinitions:null!=i?i:new Set}:void 0)}evaluate(e,t=v.Value,n){return this.accept(p,new s.ExprEvaluatorContext(p,e,t,n))}instantiate(e){return this.accept(f,e)}dependencies(){return this.m_dependencies||(this.m_dependencies=g.of(this)),this.m_dependencies}intern(e){return e.add(this)}toJSON(){return(new O).serialize(this)}isDynamic(){return void 0===this.m_isDynamic&&(this.m_isDynamic=this.exprIsDynamic()),this.m_isDynamic}}t.Expr=y;class x extends y{constructor(e){super(),this.name=e}accept(e,t){return e.visitVarExpr(this,t)}exprIsDynamic(){return!1}}t.VarExpr=x;class _ extends y{static fromValue(e){switch(typeof e){case\"boolean\":return new w(e);case\"number\":return new M(e);case\"string\":return new S(e);case\"object\":return null===e?b.instance:new E(e);default:throw new Error(`failed to create a literal from '${e}'`)}}exprIsDynamic(){return!1}}t.LiteralExpr=_;class b extends _{constructor(){super(),this.value=null}accept(e,t){return e.visitNullLiteralExpr(this,t)}exprIsDynamic(){return!1}}t.NullLiteralExpr=b,b.instance=new b;class w extends _{constructor(e){super(),this.value=e}accept(e,t){return e.visitBooleanLiteralExpr(this,t)}}t.BooleanLiteralExpr=w;class M extends _{constructor(e){super(),this.value=e}accept(e,t){return e.visitNumberLiteralExpr(this,t)}}t.NumberLiteralExpr=M;class S extends _{constructor(e){super(),this.value=e}get promotedValue(){var e,t,n;return void 0===this.m_promotedValue&&(this.m_promotedValue=null!==(t=null!==(e=h.RGBA.parse(this.value))&&void 0!==e?e:u.Pixels.parse(this.value))&&void 0!==t?t:null),null!==(n=this.m_promotedValue)&&void 0!==n?n:void 0}accept(e,t){return e.visitStringLiteralExpr(this,t)}}t.StringLiteralExpr=S;class E extends _{constructor(e){super(),this.value=e}get isArrayLiteral(){return Array.isArray(this.value)}accept(e,t){return e.visitObjectLiteralExpr(this,t)}}t.ObjectLiteralExpr=E;class T extends y{constructor(e){super(),this.name=e}accept(e,t){return e.visitHasAttributeExpr(this,t)}exprIsDynamic(){return!1}}t.HasAttributeExpr=T;class A extends y{constructor(e,t){super(),this.op=e,this.args=t}get children(){return this.args}accept(e,t){return e.visitCallExpr(this,t)}exprIsDynamic(){var e;const t=null!==(e=this.descriptor)&&void 0!==e?e:s.ExprEvaluator.getOperator(this.op);return!!(t&&t.isDynamicOperator&&t.isDynamicOperator(this))||this.args.some((e=>e.isDynamic()))}}t.CallExpr=A;class L extends A{static parseArray(e,t){const n=e[1];if(void 0===n)throw new Error(\"missing lookup table in 'lookup' expression\");const i=I(n,t);if(!(Array.isArray(n)&&i instanceof E))throw new Error(\"Invalid lookup table expression for operator 'lookup'. It must be a literal or a ref to one.\");const r=i.value;if(!(Array.isArray(r)||r instanceof Map))throw new Error(`Invalid lookup table type (${typeof r}) for operator 'lookup'`);const o=e.slice(2).map((e=>I(e,t)));return o.unshift(i),new L(o)}constructor(e){super(\"lookup\",e),this.args=e}accept(e,t){return e.visitLookupExpr(this,t)}}t.LookupExpr=L;class C extends y{static isValidMatchLabel(e){switch(typeof e){case\"number\":case\"string\":return!0;case\"object\":if(!Array.isArray(e)||0===e.length)return!1;const t=typeof e[0];
947return(\"number\"===t||\"string\"===t)&&e.every((e=>typeof e===t));default:return!1}}constructor(e,t,n){super(),this.value=e,this.branches=t,this.fallback=n}accept(e,t){return e.visitMatchExpr(this,t)}exprIsDynamic(){return this.value.isDynamic()||this.branches.some((([e,t])=>t.isDynamic()))||this.fallback.isDynamic()}}t.MatchExpr=C;class P extends y{constructor(e,t){super(),this.branches=e,this.fallback=t}accept(e,t){return e.visitCaseExpr(this,t)}exprIsDynamic(){return this.branches.some((([e,t])=>e.isDynamic()||t.isDynamic()))||this.fallback.isDynamic()}}t.CaseExpr=P;class R extends y{constructor(e,t,n){super(),this.input=e,this.defaultValue=t,this.stops=n}accept(e,t){return e.visitStepExpr(this,t)}exprIsDynamic(){return this.input.isDynamic()||this.defaultValue.isDynamic()||this.stops.some((([e,t])=>t.isDynamic()))}}t.StepExpr=R;class D extends y{constructor(e,t,n){super(),this.mode=e,this.input=t,this.stops=n}accept(e,t){return e.visitInterpolateExpr(this,t)}exprIsDynamic(){return this.input.isDynamic()||this.stops.some((([e,t])=>t.isDynamic()))}}t.InterpolateExpr=D;class O{serialize(e){return e.accept(this,void 0)}visitNullLiteralExpr(e,t){return null}visitBooleanLiteralExpr(e,t){return e.value}visitNumberLiteralExpr(e,t){return e.value}visitStringLiteralExpr(e,t){return e.value}visitObjectLiteralExpr(e,t){return e.value instanceof o.Vector2?[\"make-vector\",e.value.x,e.value.y]:e.value instanceof o.Vector3?[\"make-vector\",e.value.x,e.value.y,e.value.z]:e.value instanceof o.Vector4?[\"make-vector\",e.value.x,e.value.y,e.value.z,e.value.w]:[\"literal\",e.value]}visitVarExpr(e,t){return[\"get\",e.name]}visitHasAttributeExpr(e,t){return[\"has\",e.name]}visitCallExpr(e,t){return[e.op,...e.args.map((e=>this.serialize(e)))]}visitLookupExpr(e,t){return this.visitCallExpr(e,t)}visitMatchExpr(e,t){const n=[];for(const[t,i]of e.branches)n.push(t,this.serialize(i));return[\"match\",this.serialize(e.value),...n,this.serialize(e.fallback)]}visitCaseExpr(e,t){const n=[];for(const[t,i]of e.branches)n.push(this.serialize(t),this.serialize(i));return[\"case\",...n,this.serialize(e.fallback)]}visitStepExpr(e,t){const n=[\"step\"];return n.push(this.serialize(e.input)),n.push(this.serialize(e.defaultValue)),e.stops.forEach((([e,t])=>{n.push(e),n.push(this.serialize(t))})),n}visitInterpolateExpr(e,t){const n=[\"interpolate\",e.mode];return n.push(this.serialize(e.input)),e.stops.forEach((([e,t])=>{n.push(e),n.push(this.serialize(t))})),n}}function I(e,t){if(Array.isArray(e))return F(e,t);if(null===e)return b.instance;switch(typeof e){case\"number\":return new M(e);case\"string\":return new S(e);case\"boolean\":return new w(e);default:if(h.RGBA.isRGBA(e))return new E(e);throw new Error(`failed to create expression from: ${JSON.stringify(e)}`)}}function F(e,t){const n=e[0];if(\"string\"!=typeof n)throw new Error(\"expected a builtin function name\");switch(n){case\"!has\":case\"!in\":return new A(\"!\",[F([n.slice(1),...e.slice(1)])]);case\"ref\":return function(e,t){if(\"string\"!=typeof e[1])throw new Error(\"expected the name of an attribute\");if(void 0===t)throw new Error(\"ref used with no definitions\");const n=e[1];if(t.lockedNames.has(n))throw new Error(`circular referene to '${n}'`);if(!(n in t.definitions))throw new Error(`definition '${n}' not found`);t.referencedDefinitions.add(n);const i=t.cache.get(n);if(void 0!==i)return i;let r,o=t.definitions[n];const s=(0,d.getDefinitionValue)(o);if((0,l.isInterpolatedPropertyDefinition)(s))return y.fromJSON((0,l.interpolatedPropertyDefinitionToJsonExpr)(o));if(!(0,c.isJsonExpr)(s))return y.fromJSON(s);if(o=s,!(0,c.isJsonExpr)(o))throw new Error(`unsupported definition ${n}`);t.lockedNames.add(n);try{r=I(o,t)}finally{t.lockedNames.delete(n)}return t.cache.set(n,r),r}(e,t);case\"get\":return function(e,t){if(void 0!==e[2])return N(\"get\",e,t);const n=e[1];if(\"string\"!=typeof n)throw new Error(\"expected the name of an attribute\");return new x(n)}(e,t);case\"has\":return function(e,t){if(void 0!==e[2])return N(\"has\",e,t);const n=e[1];if(\"string\"!=typeof n)throw new Error(\"expected the name of an attribute\");return new T(n)}(e,t);case\"literal\":return function(e){const t=e[1];if(null===t||\"object\"!=typeof t)throw new Error(\"expected an object or array literal\");return new E(t)}(e);case\"match\":return function(e,t){if(e.length<4)throw new Error(\"not enough arguments\");if(!(e.length%2))throw new Error(\"fallback is missing in 'match' expression\");const n=I(e[1],t),i=[];for(let n=2;n<e.length-1;n+=2){const r=e[n];if(!C.isValidMatchLabel(r))throw new Error(`'${JSON.stringify(r)}' is not a valid label for 'match'`);const o=I(e[n+1],t);i.push([r,o])}const r=I(e[e.length-1],t);return new C(n,i,r)}(e,t);case\"case\":return function(e,t){if(e.length<3)throw new Error(\"not enough arguments\");if(e.length%2)throw new Error(\"fallback is missing in 'case' expression\");const n=[];for(let i=1;i<e.length-1;i+=2){const r=I(e[i],t),o=I(e[i+1],t);n.push([r,o])}const i=I(e[e.length-1],t);return new P(n,i)}(e,t);case\"interpolate\":return function(e,t){const n=e[1];if(!function(e){if(!Array.isArray(e))return!1;switch(e[0]){case\"discrete\":case\"linear\":case\"cubic\":case\"exponential\":return!0;default:return!1}}(n))throw new Error(\"expected an interpolation type\");if(\"exponential\"===n[0]&&\"number\"!=typeof n[1])throw new Error(\"expected the base of the exponential interpolation\");const i=void 0!==e[2]?I(e[2],t):void 0;if(!y.isExpr(i))throw new Error(\"expected the input of the interpolation\");if(3===e.length||!(e.length%2))throw new Error(\"invalid number of samples\");const r=[];for(let n=3;n<e.length-1;n+=2){const i=e[n],o=I(e[n+1],t);r.push([i,o])}return new D(n,i,r)}(e,t);case\"step\":return function(e,t){if(e.length<2)throw new Error(\"expected the input of the 'step' operator\");if(e.length<3||!(e.length%2))throw new Error(\"not enough arguments\");const n=I(e[1],t),i=I(e[2],t),r=[];for(let n=3;n<e.length;n+=2){const i=e[n],o=I(e[n+1],t);r.push([i,o])}return new R(n,i,r)}(e,t);case\"lookup\":return L.parseArray(e,t);default:return N(n,e,t)}}function N(e,t,n){return new A(e,t.slice(1).map((e=>I(e,n))))}}
947,2302:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.ExprEvaluator=t.ExprEvaluatorContext=void 0;const i=n(82),r=n(8023),o=n(6073),s=n(7290),a=n(4672),l=n(8998),c=n(1954),u=n(2181),h=n(202),d=n(4054),p=n(9764),f=n(7029),m=n(3501),g=n(5113),v=n(545),y=n(1324),x=n(7610),_=new Map;function b(e,t){var n,i,o;if(t instanceof r.StringLiteralExpr)return null!==(n=t.promotedValue)&&void 0!==n?n:t.value;const s=e.evaluate(t);return\"string\"==typeof s&&null!==(o=null!==(i=x.RGBA.parse(s))&&void 0!==i?i:y.Pixels.parse(s))&&void 0!==o?o:s}t.ExprEvaluatorContext=class{constructor(e,t,n,i){this.evaluator=e,this.env=t,this.scope=n,this.cache=i}evaluate(e){var t,n;if(void 0===e)throw new Error(\"Failed to evaluate expression\");const i=null===(t=this.cache)||void 0===t?void 0:t.get(e);if(void 0!==i)return i;const r=e.accept(this.evaluator,this);return null===(n=this.cache)||void 0===n||n.set(e,r),r}wrapValue(e){return r.Expr.isExpr(e)?e:r.LiteralExpr.fromValue(e)}};class w{static defineOperator(e,t){_.set(e,t)}static defineOperators(e){Object.getOwnPropertyNames(e).forEach((t=>{this.defineOperator(t,e[t])}))}static getOperator(e){return _.get(e)}visitVarExpr(e,t){const n=t.env.lookup(e.name);return void 0!==n?n:null}visitNullLiteralExpr(e,t){return null}visitBooleanLiteralExpr(e,t){return e.value}visitNumberLiteralExpr(e,t){return e.value}visitStringLiteralExpr(e,t){return e.value}visitObjectLiteralExpr(e,t){return e.value}visitHasAttributeExpr(e,t){return void 0!==t.env.lookup(e.name)}visitMatchExpr(e,t){const n=t.evaluate(e.value);for(const[i,r]of e.branches){if(Array.isArray(i)&&i.includes(n))return t.evaluate(r);if(i===n)return t.evaluate(r)}return t.evaluate(e.fallback)}visitCaseExpr(e,t){if(t.scope===r.ExprScope.Value){const n=e.branches.findIndex((([e,t])=>e.isDynamic()));if(-1!==n){let i;for(let o=0;o<e.branches.length;++o){const[s,a]=e.branches[o],l=t.evaluate(s),c=t.evaluate(a);if(o<n&&Boolean(l))return c;if((r.Expr.isExpr(l)||Boolean(l))&&(void 0===i&&(i=[]),null==i||i.push([t.wrapValue(l),t.wrapValue(c)]),!r.Expr.isExpr(l)&&Boolean(l)))return new r.CaseExpr(i,r.LiteralExpr.fromValue(null))}const o=t.evaluate(e.fallback);return void 0===i?o:new r.CaseExpr(i,t.wrapValue(o))}}for(const[n,i]of e.branches)if(t.evaluate(n))return t.evaluate(i);return t.evaluate(e.fallback)}visitCallExpr(e,t){var n;const i=null!==(n=e.descriptor)&&void 0!==n?n:_.get(e.op);if(i){let n;if(e.descriptor=i,t.scope===r.ExprScope.Value&&e.isDynamic()){if(e.descriptor.partialEvaluate)return e.descriptor.partialEvaluate(t,e);const i=e.args.map((e=>t.wrapValue(t.evaluate(e))));if(i.every(((t,n)=>t===e.args[n])))return e;n=new r.CallExpr(e.op,i)}else n=i.call(t,e);return n}throw new Error(`undefined operator '${e.op}'`)}visitLookupExpr(e,t){return this.visitCallExpr(e,t)}visitStepExpr(e,t){if(t.scope===r.ExprScope.Value){const n=t.evaluate(e.input),i=t.evaluate(e.defaultValue);return new r.StepExpr(t.wrapValue(n),t.wrapValue(i),e.stops.map((([e,n])=>{const i=t.evaluate(n);return[e,t.wrapValue(i)]})))}{const n=t.evaluate(e.input);if(\"number\"!=typeof n)throw new Error(`input '${n}' must be a number`);if(n<e.stops[0][0])return t.evaluate(e.defaultValue);let i=e.stops.findIndex((e=>e[0]>n));return-1===i&&(i=e.stops.length),t.evaluate(e.stops[i-1][1])}}visitInterpolateExpr(e,t){if(t.scope===r.ExprScope.Value){const n=t.evaluate(e.input);return new r.InterpolateExpr(e.mode,t.wrapValue(n),e.stops.map((([e,n])=>{const i=t.evaluate(n);return[e,t.wrapValue(i)]})))}{const n=t.evaluate(e.input);if(\"number\"!=typeof n)throw new Error(\"input must be a number\");if(\"cubic\"===e.mode[0])return function(e,t,n){if(n<t.stops[0][0])return b(e,t.stops[0][1]);if(n>=t.stops[t.stops.length-1][0])return b(e,t.stops[t.stops.length-1][1]);const r=t.stops.findIndex((e=>e[0]>n)),o=Math.max(0,r-1),s=0===o?r:o-1,a=r<t.stops.length-1?r+1:r-1,l=t.stops[s][0],c=t.stops[o][0],u=t.stops[r][0],h=.5*(u-c),d=h/(c-l),p=h/(t.stops[a][0]-u),f=(n-c)/(u-c),m=f*f,g=m*f,v=-d*g+2*d*m-d*f,_=(1+d)*g+(-1.5-2*d)*m+(-.5+d)*f+1,w=(-1-p)*g+(1.5+p)*m+.5*f,M=p*g-p*m,S=b(e,t.stops[s][1]),E=b(e,t.stops[o][1]),T=b(e,t.stops[r][1]),A=b(e,t.stops[a][1]);if(\"number\"==typeof S&&\"number\"==typeof E&&\"number\"==typeof T&&\"number\"==typeof A)return v*S+_*E+w*T+M*A;if(S instanceof x.RGBA&&E instanceof x.RGBA&&T instanceof x.RGBA&&A instanceof x.RGBA)return new x.RGBA(i.MathUtils.clamp(v*S.r+_*E.r+w*T.r+M*A.r,0,1),i.MathUtils.clamp(v*S.g+_*E.g+w*T.g+M*A.g,0,1),i.MathUtils.clamp(v*S.b+_*E.b+w*T.b+M*A.b,0,1),i.MathUtils.clamp(v*S.a+_*E.a+w*T.a+M*A.a,0,1));
947if(S instanceof y.Pixels&&E instanceof y.Pixels&&T instanceof y.Pixels&&A instanceof y.Pixels)return new y.Pixels(v*S.value+_*E.value+w*T.value+M*A.value);if(S instanceof i.Color&&E instanceof i.Color&&T instanceof i.Color&&A instanceof i.Color)return new i.Color(v*S.r+_*E.r+w*T.r+M*A.r,v*S.g+_*E.g+w*T.g+M*A.g,v*S.b+_*E.b+w*T.b+M*A.b);if(S instanceof i.Vector2&&E instanceof i.Vector2&&T instanceof i.Vector2&&A instanceof i.Vector2)return new i.Vector2(v*S.x+_*E.x+w*T.x+M*A.x,v*S.y+_*E.y+w*T.y+M*A.y);if(S instanceof i.Vector3&&E instanceof i.Vector3&&T instanceof i.Vector3&&A instanceof i.Vector3)return new i.Vector3(v*S.x+_*E.x+w*T.x+M*A.x,v*S.y+_*E.y+w*T.y+M*A.y,v*S.z+_*E.z+w*T.z+M*A.z);if(S instanceof i.Vector4&&E instanceof i.Vector4&&T instanceof i.Vector4&&A instanceof i.Vector4)return new i.Vector4(v*S.x+_*E.x+w*T.x+M*A.x,v*S.y+_*E.y+w*T.y+M*A.y,v*S.z+_*E.z+w*T.z+M*A.z,v*S.w+_*E.w+w*T.w+M*A.w);if(Array.isArray(S)&&Array.isArray(E)&&Array.isArray(T)&&Array.isArray(A)){const e=S.length,t=[];for(let n=0;n<e;++n)t[n]=v*S[n]+_*E[n]+w*T[n]+M*A[n];return t}throw new Error(\"failed to interpolate values\")}(t,e,n);const r=e.stops.findIndex((e=>e[0]>n));if(-1===r)return t.evaluate(e.stops[e.stops.length-1][1]);if(0===r)return t.evaluate(e.stops[0][1]);const[o,s]=e.stops[r],[a,l]=e.stops[r-1],c=b(t,l);let u=0;switch(e.mode[0]){case\"discrete\":return c;case\"linear\":u=(n-a)/(o-a);break;case\"exponential\":{const t=e.mode[1];u=1===t?(n-a)/(o-a):(Math.pow(t,n-a)-1)/(Math.pow(t,o-a)-1);break}default:throw new Error(`interpolation mode ${JSON.stringify(e.mode)} is not supported`)}const h=b(t,s);if(\"number\"==typeof c&&\"number\"==typeof h)return i.MathUtils.lerp(c,h,u);if(c instanceof x.RGBA&&h instanceof x.RGBA)return c.clone().lerp(h,u);if(c instanceof y.Pixels&&h instanceof y.Pixels)return new y.Pixels(i.MathUtils.lerp(c.value,h.value,u));if(c instanceof i.Color&&h instanceof i.Color)return c.clone().lerp(h,u);if(c instanceof i.Vector2&&h instanceof i.Vector2)return c.clone().lerp(h,u);if(c instanceof i.Vector3&&h instanceof i.Vector3)return c.clone().lerp(h,u);if(c instanceof i.Vector4&&h instanceof i.Vector4)return c.clone().lerp(h,u);if(Array.isArray(c)&&Array.isArray(h)&&c.length===h.length)return c.map(((e,t)=>i.MathUtils.lerp(e,h[t],u)));throw new Error(`todo: mix(${JSON.stringify(c)}, ${JSON.stringify(h)}, ${u})`)}}}t.ExprEvaluator=w,w.defineOperators(s.CastOperators),w.defineOperators(l.ComparisonOperators),w.defineOperators(d.MathOperators),w.defineOperators(m.StringOperators),w.defineOperators(a.ColorOperators),w.defineOperators(g.TypeOperators),w.defineOperators(p.MiscOperators),w.defineOperators(u.FlowOperators),w.defineOperators(o.ArrayOperators),w.defineOperators(f.ObjectOperators),w.defineOperators(c.FeatureOperators),w.defineOperators(h.MapOperators),w.defineOperators(v.VectorOperators)},908:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.ExprInstantiator=void 0;const i=n(7259),r=n(8023),o=new i.Env;t.ExprInstantiator=class{visitNullLiteralExpr(e,t){return e}visitBooleanLiteralExpr(e,t){return e}visitNumberLiteralExpr(e,t){return e}visitStringLiteralExpr(e,t){return e}visitObjectLiteralExpr(e,t){return e}visitVarExpr(e,t){if(t.preserve&&t.preserve.has(e.name))return e;const n=t.env.lookup(e.name);return r.LiteralExpr.fromValue(void 0!==n?n:null)}visitHasAttributeExpr(e,t){if(t.preserve&&t.preserve.has(e.name))return e;const n=void 0!==t.env.lookup(e.name);return r.LiteralExpr.fromValue(n)}visitCallExprImpl(e,t,n){const i=e.args.map((e=>e.accept(this,t)));return i.some(((t,n)=>t!==e.args[n]))?n(e.op,i):e}visitCallExpr(e,t){return this.visitCallExprImpl(e,t,((e,t)=>new r.CallExpr(e,t)))}visitLookupExpr(e,t){return this.visitCallExprImpl(e,t,((e,t)=>new r.LookupExpr(t)))}visitMatchExpr(e,t){const n=e.value.accept(this,t);if(n instanceof r.LiteralExpr){const i=n.value;for(const[n,r]of e.branches){if(Array.isArray(n)&&n.includes(i))return r.accept(this,t);if(n===i)return r.accept(this,t)}return e.fallback.accept(this,t)}let i=e.value!==n;const o=e.branches.map((([e,n])=>{const r=n.accept(this,t);return r!==n&&(i=!0),[e,r]})),s=e.fallback.accept(this,t);return s!==e.fallback&&(i=!0),i?new r.MatchExpr(n,o,s):e}
947visitCaseExpr(e,t){const n=[];let i=!1;for(const[s,a]of e.branches){const e=s.accept(this,t),l=e.dependencies();if(s.isDynamic()||0!==l.properties.size)e!==s&&(i=!0),n.push([e,a]);else if(Boolean(e.evaluate(o,r.ExprScope.Condition)))return a.accept(this,t)}if(0===n.length)return e.fallback.accept(this,t);n.length!==e.branches.length&&(i=!0),n.forEach((e=>{const n=e[1].accept(this,t);n!==e[1]&&(i=!0),e[1]=n}));const s=e.fallback.accept(this,t);return s!==e.fallback&&(i=!0),i?new r.CaseExpr(n,s):e}visitStepExpr(e,t){const n=e.input.accept(this,t),i=e.defaultValue.accept(this,t),o=e.stops.map((([e,n])=>[e,n.accept(this,t)]));return new r.StepExpr(n,i,o)}visitInterpolateExpr(e,t){const n=e.input.accept(this,t),i=e.stops.map((([e,n])=>[e,n.accept(this,t)]));return new r.InterpolateExpr(e.mode,n,i)}}},8797:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.ExprPool=void 0;const i=n(8023);var r;!function(e){e[e.CALL=0]=\"CALL\",e[e.LOOKUP=1]=\"LOOKUP\"}(r||(r={})),t.ExprPool=class{constructor(){this.m_booleanLiterals=new Map,this.m_numberLiterals=new Map,this.m_stringLiterals=new Map,this.m_objectLiterals=new Map,this.m_arrayLiterals=[],this.m_varExprs=new Map,this.m_hasAttributeExprs=new Map,this.m_matchExprs=[],this.m_caseExprs=[],this.m_interpolateExprs=[],this.m_stepExprs=[],this.m_callExprs=new Map}add(e){return e.accept(this,void 0)}clear(){this.m_booleanLiterals.clear(),this.m_numberLiterals.clear(),this.m_stringLiterals.clear(),this.m_objectLiterals.clear(),this.m_arrayLiterals.length=0,this.m_varExprs.clear(),this.m_hasAttributeExprs.clear(),this.m_matchExprs.length=0,this.m_caseExprs.length=0,this.m_interpolateExprs.length=0,this.m_stepExprs.length=0,this.m_callExprs.clear()}visitNullLiteralExpr(e,t){return i.NullLiteralExpr.instance}visitBooleanLiteralExpr(e,t){return this.m_booleanLiterals.get(e.value)||(this.m_booleanLiterals.set(e.value,e),e)}visitNumberLiteralExpr(e,t){return this.m_numberLiterals.get(e.value)||(this.m_numberLiterals.set(e.value,e),e)}visitStringLiteralExpr(e,t){return this.m_stringLiterals.get(e.value)||(this.m_stringLiterals.set(e.value,e),e)}visitObjectLiteralExpr(e,t){const n=this.m_objectLiterals.get(e.value);if(n)return n;if(Array.isArray(e.value)){const t=e.value,n=this.m_arrayLiterals.find((e=>{const n=e.value;return n.length===t.length&&t.every(((e,t)=>e===n[t]))}));if(void 0!==n)return n;this.m_arrayLiterals.push(e)}return this.m_objectLiterals.set(e.value,e),e}visitVarExpr(e,t){return this.m_varExprs.get(e.name)||(this.m_varExprs.set(e.name,e),e)}visitHasAttributeExpr(e,t){return this.m_hasAttributeExprs.get(e.name)||(this.m_hasAttributeExprs.set(e.name,e),e)}visitMatchExpr(e,t){const n=e.value.accept(this,t),r=e.branches.map((([e,n])=>[e,n.accept(this,t)])),o=e.fallback.accept(this,t);for(const e of this.m_matchExprs){if(e.value!==n)continue;if(e.fallback!==o)continue;if(e.branches.length!==r.length)continue;let t=!0;for(let n=0;n<r.length;n++)if(r[n][0]!==e.branches[n][0]||r[n][1]!==e.branches[n][1]){t=!1;break}if(t)return e}const s=new i.MatchExpr(n,r,o);return this.m_matchExprs.push(s),s}visitCaseExpr(e,t){const n=e.branches.map((([e,n])=>[e.accept(this,t),n.accept(this,t)])),r=e.fallback.accept(this,t);for(const e of this.m_caseExprs){if(e.fallback!==r)continue;if(e.branches.length!==n.length)continue;let t=!0;for(let i=0;i<n.length;i++)if(n[i][0]!==e.branches[i][0]||n[i][1]!==e.branches[i][1]){t=!1;break}if(t)return e}const o=new i.CaseExpr(n,r);return this.m_caseExprs.push(o),o}visitCallExprImpl(e,t,n){const o=[];for(let n=0;n<e.args.length;n++)o.push(e.args[n].accept(this,t));this.m_callExprs.has(e.op)||this.m_callExprs.set(e.op,[]);const s=this.m_callExprs.get(e.op);for(const e of s){if(e.args.length!==o.length)continue;let t=0;for(;t<e.args.length&&e.args[t]===o[t];++t);if(t===e.args.length)return e}let a;return a=n===r.CALL?new i.CallExpr(e.op,o):new i.LookupExpr(o),a.descriptor=e.descriptor,s.push(a),a}visitCallExpr(e,t){return this.visitCallExprImpl(e,t,r.CALL)}visitLookupExpr(e,t){return this.visitCallExprImpl(e,t,r.LOOKUP)}visitStepExpr(e,t){if(this.m_stepExprs.includes(e))return e;const n=e.input.accept(this,t),r=e.defaultValue.accept(this,t),o=e.stops.map((e=>{const n=e[0],i=e[1].accept(this,t);return i===e[1]?e:[n,i]}));for(const e of this.m_stepExprs)if(e.input===n&&e.defaultValue===r&&o.length===e.stops.length&&o.every((([t,n],i)=>t===e.stops[i][0]&&n===e.stops[i][1])))return e;const s=new i.StepExpr(n,r,o);return this.m_stepExprs.push(s),s}visitInterpolateExpr(e,t){if(this.m_interpolateExprs.includes(e))return e;const n=e.input.accept(this,t),r=e.stops.map((e=>{const n=e[0],i=e[1].accept(this,t);return i===e[1]?e:[n,i]}));for(const t of this.m_interpolateExprs)if(t.input===n&&t.mode[0]===e.mode[0]&&t.mode[1]===e.mode[1]&&r.length===t.stops.length&&r.every((([e,n],i)=>e===t.stops[i][0]&&n===t.stops[i][1])))return t;const o=new i.InterpolateExpr(e.mode,n,r);return this.m_interpolateExprs.push(o),o}}},8628:(e,t)=>
947{\"use strict\";var n;Object.defineProperty(t,\"__esModule\",{value:!0}),t.interpolatedPropertyDefinitionToJsonExpr=t.isInterpolatedPropertyDefinition=t.InterpolationMode=void 0,(n=t.InterpolationMode||(t.InterpolationMode={}))[n.Discrete=0]=\"Discrete\",n[n.Linear=1]=\"Linear\",n[n.Cubic=2]=\"Cubic\",n[n.Exponential=3]=\"Exponential\",t.isInterpolatedPropertyDefinition=function(e){return!!(e&&void 0===e.interpolationMode&&Array.isArray(e.values)&&e.values.length>0&&void 0!==e.values[0]&&Array.isArray(e.zoomLevels)&&e.zoomLevels.length>0&&void 0!==e.zoomLevels[0]&&e.values.length===e.zoomLevels.length)},t.interpolatedPropertyDefinitionToJsonExpr=function(e){if(void 0===e.interpolation||\"Discrete\"===e.interpolation){const t=[\"step\",[\"zoom\"],e.values[0]];for(let n=1;n<e.zoomLevels.length;++n)t.push(e.zoomLevels[n],e.values[n]);return t}const t=[\"interpolate\"];switch(e.interpolation){case\"Linear\":t.push([\"linear\"]);break;case\"Cubic\":t.push([\"cubic\"]);break;case\"Exponential\":t.push([\"exponential\",void 0!==e.exponent?e.exponent:2]);break;default:throw new Error(`interpolation mode '${e.interpolation}' is not supported`)}t.push([\"zoom\"]);for(let n=0;n<e.zoomLevels.length;++n)t.push(e.zoomLevels[n],e.values[n]);return t}},1017:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.isJsonExpr=void 0,t.isJsonExpr=function(e){return Array.isArray(e)&&e.length>0&&\"string\"==typeof e[0]}},1324:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.Pixels=void 0;const n=/^((?=\\.\\d|\\d)(?:\\d+)?(?:\\.?\\d*))px$/;class i{static parse(e){const t=n.exec(e);if(null!==t)return new i(Number(t[1]))}constructor(e){this.value=e}toJSON(){return`${this.value}px`}}t.Pixels=i},7610:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.RGBA=void 0;const i=n(82),r=n(1667),o=n(6331);class s{static parse(e){const t=(0,o.parseStringEncodedColor)(e);if(void 0!==t)return r.ColorUtils.getRgbaFromHex(t)}static isRGBA(e){return e instanceof s}constructor(e=1,t=1,n=1,i=1,r=!0){this.r=e,this.g=t,this.b=n,this.a=i,this.isRGBA=r}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this.a=e.a,this}equals(e){return this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}clone(){return new s(this.r,this.g,this.b,this.a)}fromVector(e){return this.r=e.x,this.g=e.y,this.b=e.z,this.a=e.w,this}toVector(e){return e||(e=new i.Vector4),e.set(this.r,this.g,this.b,this.a),e}fromHex(e){return r.ColorUtils.getRgbaFromHex(e,this),this}getHex(){return r.ColorUtils.getHexFromRgba(this.r,this.g,this.b,this.a)}lerp(e,t){return this.r=i.MathUtils.lerp(this.r,e.r,t),this.g=i.MathUtils.lerp(this.g,e.g,t),this.b=i.MathUtils.lerp(this.b,e.b,t),this.a=i.MathUtils.lerp(this.a,e.a,t),this}toJSON(){return`rgba(${255*this.r|0}, ${255*this.g|0}, ${255*this.b|0}, ${this.a})`}}t.RGBA=s},6331:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.parseStringEncodedColor=t.parseStringEncodedNumeral=t.StringEncodedNumeralFormatMaxSize=t.StringEncodedNumeralFormats=t.StringEncodedColorFormats=t.StringEncodedMetricFormats=t.StringEncodedNumeralType=void 0;const i=n(6925),r=n(797),o=n(1667);var s;!function(e){e[e.Meters=0]=\"Meters\",e[e.Pixels=1]=\"Pixels\",e[e.Hex=2]=\"Hex\"}(s=t.StringEncodedNumeralType||(t.StringEncodedNumeralType={}));const a={type:s.Meters,size:1,regExp:/^((?=\\.\\d|\\d)(?:\\d+)?(?:\\.?\\d*))m$/,decoder:(e,t)=>{const n=a.regExp.exec(e);return!!n&&void 0!==(t[0]=Number(n[1]))}},l={type:s.Pixels,size:1,mask:1,regExp:/^((?=\\.\\d|\\d)(?:\\d+)?(?:\\.?\\d*))px$/,decoder:(e,t)=>{const n=l.regExp.exec(e);return null!==n&&(t[0]=Number(n[1]),!0)}},c={type:s.Hex,size:4,regExp:/^\\#((?:[0-9A-Fa-f][0-9A-Fa-f]){4}|[0-9A-Fa-f]{4})$/,decoder:(e,t)=>{const n=c.regExp.exec(e);if(null===n)return!1;const i=n[1],o=i.length;return(0,r.assert)(4===o||8===o,\"Matched incorrect hex color format\"),4===o?(t[0]=parseInt(i.charAt(0)+i.charAt(0),16)/255,t[1]=parseInt(i.charAt(1)+i.charAt(1),16)/255,t[2]=parseInt(i.charAt(2)+i.charAt(2),16)/255,t[3]=4===o?parseInt(i.charAt(3)+i.charAt(3),16)/255:1):8===o&&(t[0]=parseInt(i.charAt(0)+i.charAt(1),16)/255,t[1]=parseInt(i.charAt(2)+i.charAt(3),16)/255,t[2]=parseInt(i.charAt(4)+i.charAt(5),16)/255,t[3]=8===o?parseInt(i.charAt(6)+i.charAt(7),16)/255:1),!0}};t.StringEncodedMetricFormats=[a,l];const u=t.StringEncodedMetricFormats.reduce(((e,t)=>Math.max(e,t.size)),0);t.StringEncodedColorFormats=[c];const h=t.StringEncodedColorFormats.reduce(((e,t)=>Math.max(e,t.size)),0);t.StringEncodedNumeralFormats=[...t.StringEncodedMetricFormats,...t.StringEncodedColorFormats],t.StringEncodedNumeralFormatMaxSize=Math.max(h,u);const d=new Array(t.StringEncodedNumeralFormatMaxSize);function p(e,t,n=1){const r=t.find((t=>!!t.decoder(e,d)));if(void 0===r){const t=(0,i.parseCSSColor)(e);return Array.isArray(t)&&!t.some((e=>isNaN(e)))?o.ColorUtils.getHexFromRgba(t[0]/255,t[1]/255,t[2]/255,t[3]):void 0}switch(null==r?void 0:r.type){case s.Pixels:return d[0]*n;case s.Hex:return o.ColorUtils.getHexFromRgba(d[0],d[1],d[2],d[3]);default:return d[0]}}
947t.parseStringEncodedNumeral=function(e,n=1){return p(e,t.StringEncodedNumeralFormats,n)},t.parseStringEncodedColor=function(e){return p(e,t.StringEncodedColorFormats)}},1370:(e,t)=>{\"use strict\";var n,i,r;Object.defineProperty(t,\"__esModule\",{value:!0}),t.isTextureBuffer=t.PlacementToken=t.transientToPickability=t.Pickability=t.TextureCoordinateType=void 0,(r=t.TextureCoordinateType||(t.TextureCoordinateType={})).TileSpace=\"tile-space\",r.EquirectangularSpace=\"equirectangular-space\",r.FeatureSpace=\"feature-space\",function(e){e.onlyVisible=\"only-visible\",e.transient=\"transient\",e.all=\"all\"}(n=t.Pickability||(t.Pickability={})),t.transientToPickability=function(e){let t=n.onlyVisible;return null!=e&&(t=\"string\"==typeof e?e:!0===e?n.transient:n.onlyVisible),t},(i=t.PlacementToken||(t.PlacementToken={})).TopLeft=\"TL\",i.Top=\"T\",i.TopRight=\"TR\",i.Right=\"R\",i.BottomRight=\"BR\",i.Bottom=\"B\",i.BottomLeft=\"BL\",i.Left=\"L\",i.Center=\"C\",i.NorthWest=\"NW\",i.North=\"N\",i.NorthEast=\"NE\",i.East=\"E\",i.SouthEast=\"SE\",i.South=\"S\",i.SouthWest=\"SW\",i.West=\"W\",t.isTextureBuffer=function(e){return e&&e.buffer&&\"string\"==typeof e.type}},1216:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.setTechniqueRenderOrderOrPriority=t.addBuffersToTransferList=t.textureCoordinateType=t.supportsTextures=t.needsVertexNormals=t.isLabelRejectionLineTechnique=t.isTextTechnique=t.isTerrainTechnique=t.isStandardTechnique=t.isExtrudedPolygonTechnique=t.isPolygonTechnique=t.isStandardExtrudedLineTechnique=t.isBasicExtrudedLineTechnique=t.isExtrudedLineTechnique=t.isSegmentsTechnique=t.isSpecialDashesLineTechnique=t.isRasterTechnique=t.isSolidLineTechnique=t.isLineTechnique=t.isLineMarkerTechnique=t.isIconTextTechnique=t.isSquaresTechnique=t.isCirclesTechnique=t.TRANSPARENCY_PROPERTY_KEYS=t.TEXTURE_PROPERTY_KEYS=void 0;const i=n(1370);function r(e){return\"labeled-icon\"===e.name}function o(e){return\"line-marker\"===e.name}function s(e){return\"solid-line\"===e.name||\"dashed-line\"===e.name}function a(e){return\"extruded-line\"===e.name}function l(e){return a(e)&&\"standard\"===e.shading}function c(e){return\"polygon\"===e.name}function u(e){return\"extruded-polygon\"===e.name}function h(e){return\"standard\"===e.name}function d(e){return\"terrain\"===e.name}function p(e){return\"text\"===e.name}function f(e){return c(e)||h(e)||u(e)||d(e)||s(e)}t.TEXTURE_PROPERTY_KEYS=[\"map\",\"normalMap\",\"displacementMap\",\"roughnessMap\",\"emissiveMap\",\"alphaMap\",\"metalnessMap\",\"bumpMap\",\"dash-image\"],t.TRANSPARENCY_PROPERTY_KEYS=[\"opacity\",\"transparent\"],t.isCirclesTechnique=function(e){return\"circles\"===e.name},t.isSquaresTechnique=function(e){return\"squares\"===e.name},t.isIconTextTechnique=r,t.isLineMarkerTechnique=o,t.isLineTechnique=function(e){return\"line\"===e.name},t.isSolidLineTechnique=s,t.isRasterTechnique=function(e){return\"raster\"===e.name},t.isSpecialDashesLineTechnique=function(e){return(\"solid-line\"===e.name||\"dashed-line\"===e.name)&&void 0!==e.dashes&&\"Square\"!==e.dashes},t.isSegmentsTechnique=function(e){return\"segments\"===e.name},t.isExtrudedLineTechnique=a,t.isBasicExtrudedLineTechnique=function(e){return a(e)&&\"basic\"===e.shading},t.isStandardExtrudedLineTechnique=l,t.isPolygonTechnique=c,t.isExtrudedPolygonTechnique=u,t.isStandardTechnique=h,t.isTerrainTechnique=d,t.isTextTechnique=p,t.isLabelRejectionLineTechnique=function(e){return\"label-rejection-line\"===e.name},t.needsVertexNormals=function(e){return u(e)||c(e)||h(e)||d(e)||l(e)},t.supportsTextures=f,t.textureCoordinateType=function(e){return f(e)?e.textureCoordinateType:void 0},t.addBuffersToTransferList=function(e,n){if(h(e)||u(e)||d(e))for(const r of t.TEXTURE_PROPERTY_KEYS){const t=e[r];(0,i.isTextureBuffer)(t)&&t.buffer instanceof ArrayBuffer&&n.push(t.buffer)}},t.setTechniqueRenderOrderOrPriority=function(e,t,n){if(p(e)||r(e)||o(e)){if(n&&\"string\"==typeof e._category){const t=n.indexOf(e._category);-1!==t&&(e.priority=n.length-t)}}else if(t&&void 0!==e._layer){const n=n=>{const i=null==t?void 0:t.findIndex((t=>t.layer===e._layer&&t.category===n));return void 0!==i&&-1!==i?10*(i+1):void 0};
947if(\"string\"==typeof e._category){const t=n(e._category);void 0!==t&&(e.renderOrder=t)}}}},5771:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.isConditionalExtendsEntry=t.isDirectionalLight=t.isAmbientLight=t.getStyles=t.isStylesDictionary=t.isJsonExprReference=t.getDefinitionValue=t.isVerboseDefinition=void 0;const i=n(1017);function r(e){return void 0!==(null==e?void 0:e.value)}function o(e){return void 0!==e&&!Array.isArray(e)}t.isVerboseDefinition=r,t.getDefinitionValue=function(e){return r(e)?e.value:e},t.isJsonExprReference=function(e){return Array.isArray(e)&&2===e.length&&\"ref\"===e[0]&&\"string\"==typeof e[1]},t.isStylesDictionary=o,t.getStyles=function(e){return void 0===e?[]:o(e)?function(e){const t=[];for(const n in e)e[n].forEach((e=>{void 0===e.layer&&(e.layer=n),t.push(e)}));return t}(e):e},t.isAmbientLight=function(e){return\"ambient\"===e.type},t.isDirectionalLight=function(e){return\"directional\"===e.type},t.isConditionalExtendsEntry=function(e){return void 0!==e&&(0,i.isJsonExpr)(e.when)&&/^(object|string)$/.test(typeof e.value)}},8131:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.ThemeVisitor=void 0;const i=n(1017),r=n(5771);t.ThemeVisitor=class{constructor(e){this.theme=e}visitStyles(e){const t=t=>!(0,i.isJsonExpr)(t)&&!!e(t);if(void 0!==this.theme.styles)for(const e of(0,r.getStyles)(this.theme.styles))if(t(e))return!0;return!1}}},797:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.assert=void 0,t.assert=function(e,t){}},6304:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.getPropertyValue=void 0;const i=n(8023),r=n(1324),o=n(7610),s=n(6331);t.getPropertyValue=function(e,t,n){var a,l,c;if(i.Expr.isExpr(e)){let s=e.evaluate(t,i.ExprScope.Dynamic,n);return\"string\"==typeof s&&(s=null!==(l=null!==(a=o.RGBA.parse(s))&&void 0!==a?a:r.Pixels.parse(s))&&void 0!==l?l:s),s instanceof o.RGBA?s.getHex():s instanceof r.Pixels?s.value*(null!==(c=Number(t.lookup(\"$pixelToMeters\")))&&void 0!==c?c:1):s}if(null==e)return null;if(\"string\"!=typeof e)return e;{const n=t.lookup(\"$pixelToMeters\")||1,i=(0,s.parseStringEncodedNumeral)(e,n);return void 0!==i?i:e}}},6073:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.ArrayOperators=void 0;const i=n(8023),r=[\"boolean\",\"number\",\"string\"];function o(e,t){if(!(e instanceof i.StringLiteralExpr&&r.includes(e.value)))throw new Error(`expected \"boolean\", \"number\" or \"string\" instead of '${JSON.stringify(e)}'`);const n=e.value;t.forEach(((e,t)=>{if(typeof e!==n)throw new Error(`expected array element at index ${t} to have type '${n}'`)}))}function s(e,t){const n=e.evaluate(t);if(!Array.isArray(n))throw new Error(`'${n}' is not an array`);return n}const a={array:{call:(e,t)=>{switch(t.args.length){case 0:throw new Error(\"not enough arguments\");case 1:return s(e,t.args[0]);case 2:{const n=s(e,t.args[1]);return o(t.args[0],n),n}case 3:{const n=s(e,t.args[2]);return function(e,t){if(!(e instanceof i.NumberLiteralExpr))throw new Error(\"missing expected number of elements\");const n=e.value;if(t.length!==n)throw new Error(`the array must have ${n} element(s)`)}(t.args[1],n),o(t.args[0],n),n}default:throw new Error(\"too many arguments\")}}},\"make-array\":{call:(e,t)=>{if(0===t.args.length)throw new Error(\"not enough arguments\");return[...t.args.map((t=>e.evaluate(t)))]}},at:{call:(e,t)=>{const n=t.args,i=e.evaluate(n[0]);if(\"number\"!=typeof i)throw new Error(\"expected the index of the element to retrieve\");const r=e.evaluate(n[1]);if(!Array.isArray(r))throw new Error(\"expected an array\");return i>=0&&i<r.length?r[i]:null}},slice:{call:(e,t)=>{if(t.args.length<2)throw new Error(\"not enough arguments\");const n=e.evaluate(t.args[0]);if(\"string\"!=typeof n&&!Array.isArray(n))throw new Error(\"input must be a string or an array\");const i=e.evaluate(t.args[1]);if(\"number\"!=typeof i)throw new Error(\"expected an index\");let r;if(t.args.length>2&&(r=e.evaluate(t.args[2]),\"number\"!=typeof r))throw new Error(\"expected an index\");return n.slice(i,r)}}};t.ArrayOperators=a},7290:(e,t)=>{\"use strict\";
947Object.defineProperty(t,\"__esModule\",{value:!0}),t.CastOperators=void 0;const n={\"to-boolean\":{call:(e,t)=>Boolean(e.evaluate(t.args[0]))},\"to-string\":{call:(e,t)=>String(e.evaluate(t.args[0]))},\"to-number\":{call:(e,t)=>{for(const n of t.args){const t=Number(e.evaluate(n));if(!isNaN(t))return t}throw new Error(\"cannot convert the value to a number\")}}};t.CastOperators=n},4672:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.ColorOperators=void 0;const i=n(82),r=n(1667),o=n(7610),s=n(6331),a={alpha:{call:(e,t)=>{let n=e.evaluate(t.args[0]);return\"string\"==typeof n&&(n=(0,s.parseStringEncodedColor)(n)),\"number\"==typeof n?r.ColorUtils.getAlphaFromHex(n):1}},rgba:{call:(e,t)=>{const n=e.evaluate(t.args[0]),o=e.evaluate(t.args[1]),s=e.evaluate(t.args[2]),a=e.evaluate(t.args[3]);if(\"number\"==typeof n&&\"number\"==typeof o&&\"number\"==typeof s&&\"number\"==typeof a&&n>=0&&o>=0&&s>=0&&a>=0&&a<=1)return function(e,t,n,o){return r.ColorUtils.getHexFromRgba(i.MathUtils.clamp(e,0,255)/255,i.MathUtils.clamp(t,0,255)/255,i.MathUtils.clamp(n,0,255)/255,i.MathUtils.clamp(o,0,1))}(n,o,s,a);throw new Error(`unknown color 'rgba(${n},${o},${s},${a})'`)}},rgb:{call:(e,t)=>{const n=e.evaluate(t.args[0]),o=e.evaluate(t.args[1]),s=e.evaluate(t.args[2]);if(\"number\"==typeof n&&\"number\"==typeof o&&\"number\"==typeof s&&n>=0&&o>=0&&s>=0)return function(e,t,n){return r.ColorUtils.getHexFromRgb(i.MathUtils.clamp(e,0,255)/255,i.MathUtils.clamp(t,0,255)/255,i.MathUtils.clamp(n,0,255)/255)}(n,o,s);throw new Error(`unknown color 'rgb(${n},${o},${s})'`)}},hsl:{call:(e,t)=>{const n=e.evaluate(t.args[0]),o=e.evaluate(t.args[1]),s=e.evaluate(t.args[2]);if(\"number\"==typeof n&&\"number\"==typeof o&&\"number\"==typeof s&&n>=0&&o>=0&&s>=0)return function(e,t,n){return r.ColorUtils.getHexFromHsl(i.MathUtils.euclideanModulo(e,360)/360,i.MathUtils.clamp(t,0,100)/100,i.MathUtils.clamp(n,0,100)/100)}(n,o,s);throw new Error(`unknown color 'hsl(${n},${o}%,${s}%)'`)}},\"to-color\":{call:(e,t)=>u(e.evaluate(t.args[0]))},darken:{call:(e,t)=>{const n=u(e.evaluate(t.args[0])),i=e.evaluate(t.args[1]);if(Number(i)!==i)throw new Error(`invalid darken amount '${i}'`);return r.ColorUtils.darken(n.clone(),i)}},\"scale-color\":{call:(e,t)=>{const n=t.args,i=n.length,o=u(e.evaluate(n[0]));l.h=l.s=l.l=l.a=0;for(let t=1;t<i;){const i=e.evaluate(n[t++]);if(!c.test(i))throw new Error(`invalid component \"${i}\"`);const r=e.evaluate(n[t++]);if(r!==Number(r))throw new Error(`invalid factor \"${r}\"`);l[i]=r}return r.ColorUtils.scaleColor(o.clone(),l)}}},l={h:0,s:0,l:0,a:0},c=/^[sla]$/;function u(e){const t=e;return o.RGBA.isRGBA(e)?e:(null==t?void 0:t.isRGBA)?new o.RGBA(t.r,t.g,t.b,t.a):r.ColorUtils.getRgbaFromHex(function(e){if(\"string\"==typeof e){const t=(0,s.parseStringEncodedColor)(e);if(void 0!==t)return t}throw new Error(`unknown color '${e}'`)}(e))}t.ColorOperators=a},8998:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.ComparisonOperators=void 0;const i=n(1667);function r(e,t,n=!1){const i=e.evaluate(t.args[0]),r=e.evaluate(t.args[1]);if(!(\"number\"==typeof i&&\"number\"==typeof r||\"string\"==typeof i&&\"string\"==typeof r)&&n)throw new Error(`invalid operands '${i}' and '${r}' for operator '${t.op}'`);switch(t.op){case\"<\":return i<r;case\">\":return i>r;case\"<=\":return i<=r;case\">=\":return i>=r;default:throw new Error(`invalid comparison operator '${t.op}'`)}}const o={\"!\":{call:(e,t)=>!e.evaluate(t.args[0])},\"==\":{call:(e,t)=>{var n;const r=e.evaluate(t.args[0]),o=e.evaluate(t.args[1]);return null!==(n=i.ColorUtils.comparePotentiallyRGBA(r,o,!0))&&void 0!==n?n:r===o}},\"!=\":{call:(e,t)=>{var n;const r=e.evaluate(t.args[0]),o=e.evaluate(t.args[1]);return null!==(n=i.ColorUtils.comparePotentiallyRGBA(r,o,!1))&&void 0!==n?n:r!==o}},\"<\":{call:(e,t)=>r(e,t)},\">\":{call:(e,t)=>r(e,t)},\"<=\":{call:(e,t)=>r(e,t)},\">=\":{call:(e,t)=>r(e,t)}};t.ComparisonOperators=o},1954:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.FeatureOperators=void 0;const i=n(7259),r=n(8023),o={\"geometry-type\":{call:(e,t)=>
947{switch(e.env.lookup(\"$geometryType\")){case\"point\":return\"Point\";case\"line\":return\"LineString\";case\"polygon\":return\"Polygon\";default:return null}}},\"feature-state\":{isDynamicOperator:()=>!0,call:(e,t)=>{var n,o;if(e.scope!==r.ExprScope.Dynamic)throw new Error(\"feature-state cannot be used in this context\");const s=e.evaluate(t.args[0]);if(\"string\"!=typeof s)throw new Error(\"expected the name of the property of the feature state\");const a=e.env.lookup(\"$state\");return i.Env.isEnv(a)?null!==(n=a.lookup(s))&&void 0!==n?n:null:a instanceof Map&&null!==(o=a.get(s))&&void 0!==o?o:null}},id:{call:(e,t)=>{var n;return null!==(n=e.env.lookup(\"$id\"))&&void 0!==n?n:null}}};t.FeatureOperators=o},2181:(e,t)=>{\"use strict\";function n(e,t,n){switch(t){case\"boolean\":case\"number\":case\"string\":for(const i of n){const n=e.evaluate(i);if(typeof n===t)return n}throw new Error(`expected a '${t}'`);default:throw new Error(`invalid type '${t}'`)}}Object.defineProperty(t,\"__esModule\",{value:!0}),t.FlowOperators=void 0;const i={all:{call:(e,t)=>{for(const n of t.args)if(!e.evaluate(n))return!1;return!0}},any:{call:(e,t)=>{for(const n of t.args)if(e.evaluate(n))return!0;return!1}},none:{call:(e,t)=>{for(const n of t.args)if(e.evaluate(n))return!1;return!0}},boolean:{call:(e,t)=>n(e,\"boolean\",t.args)},number:{call:(e,t)=>n(e,\"number\",t.args)},string:{call:(e,t)=>n(e,\"string\",t.args)}};t.FlowOperators=i},202:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.MapOperators=void 0;const i=n(8023),r={\"ppi-scale\":{call:(e,t)=>e.evaluate(t.args[0])*(t.args[1]?e.evaluate(t.args[1]):1)},\"world-ppi-scale\":{isDynamicOperator:()=>!0,call:(e,t)=>{const n=e.evaluate(t.args[0]),i=t.args[1]?e.evaluate(t.args[1]):1,r=e.env.lookup(\"$zoom\");return n*(Math.pow(2,17)/Math.pow(2,r))*i}},\"world-discrete-ppi-scale\":{isDynamicOperator:()=>!0,call:(e,t)=>{const n=e.evaluate(t.args[0]),i=e.env.lookup(\"$zoom\");return n*(40075016.68557849/(256*Math.pow(2,Math.floor(i))))}},\"pixel-world-scale\":{isDynamicOperator:()=>!0,call:(e,t)=>e.evaluate(t.args[0])*(e.env.lookup(\"$pixelToMeters\")||1)},ppi:{call:e=>{const t=e.env.lookup(\"$ppi\");return\"number\"==typeof t?t:72}},zoom:{isDynamicOperator:()=>!0,call:(e,t)=>{var n;return e.scope===i.ExprScope.Value?t:null!==(n=e.env.lookup(\"$zoom\"))&&void 0!==n?n:null}}};t.MapOperators=r},4054:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.MathOperators=void 0;const i=n(82),r={\"^\":{call:(e,t)=>{const n=e.evaluate(t.args[0]),i=e.evaluate(t.args[1]);if(\"number\"!=typeof n||\"number\"!=typeof i)throw new Error(`invalid operands '${typeof n}' and '${typeof i}' for operator '^'`);return Math.pow(n,i)}},\"-\":{call:(e,t)=>{if(1===t.args.length){const n=e.evaluate(t.args[0]);if(\"number\"!=typeof n)throw new Error(`ìnvalid operand '${typeof n} for operator '-'`);return-n}const n=e.evaluate(t.args[0]),i=e.evaluate(t.args[1]);if(\"number\"!=typeof n||\"number\"!=typeof i)throw new Error(`invalid operands '${typeof n}' and '${typeof i}' for operator '-'`);return n-i}},\"/\":{call:(e,t)=>{const n=e.evaluate(t.args[0]),i=e.evaluate(t.args[1]);if(\"number\"!=typeof n||\"number\"!=typeof i)throw new Error(`invalid operands '${typeof n}' and '${typeof i}' for operator '/'`);return n/i}},\"%\":{call:(e,t)=>{const n=e.evaluate(t.args[0]),i=e.evaluate(t.args[1]);if(\"number\"!=typeof n||\"number\"!=typeof i)throw new Error(`invalid operands '${typeof n}' and '${typeof i}' for operator '%'`);return n%i}},\"+\":{call:(e,t)=>t.args.reduce(((t,n)=>Number(t)+Number(e.evaluate(n))),0)},\"*\":{call:(e,t)=>{const n=e.evaluate(t.args[0]),r=e.evaluate(t.args[1]),o=\"number\"==typeof n,s=\"number\"==typeof r;let a;if(o&&s)a=n*r;else if(s&&(n instanceof i.Vector2||n instanceof i.Vector3||n instanceof i.Vector4))a=n.clone().multiplyScalar(r);else{if(!o||!(r instanceof i.Vector2||r instanceof i.Vector3||r instanceof i.Vector4))throw new Error(`invalid operands '${typeof n}' and '${typeof r}' for operator '*'`);a=r.clone().multiplyScalar(n)}return a}},abs:{call:(e,t)=>
947{const n=e.evaluate(t.args[0]);if(\"number\"!=typeof n)throw new Error(`invalid operand '${n}' for operator 'abs'`);return Math.abs(n)}},acos:{call:(e,t)=>{const n=e.evaluate(t.args[0]);if(\"number\"!=typeof n)throw new Error(`invalid operand '${n}' for operator 'acos'`);return Math.acos(n)}},asin:{call:(e,t)=>{const n=e.evaluate(t.args[0]);if(\"number\"!=typeof n)throw new Error(`invalid operand '${n}' for operator 'asin'`);return Math.asin(n)}},atan:{call:(e,t)=>{const n=e.evaluate(t.args[0]);if(\"number\"!=typeof n)throw new Error(`invalid operand '${n}' for operator 'atan'`);return Math.atan(n)}},ceil:{call:(e,t)=>{const n=e.evaluate(t.args[0]);if(\"number\"!=typeof n)throw new Error(`invalid operand '${n}' for operator 'ceil'`);return Math.ceil(n)}},cos:{call:(e,t)=>{const n=e.evaluate(t.args[0]);if(\"number\"!=typeof n)throw new Error(`invalid operand '${n}' for operator 'cos'`);return Math.cos(n)}},e:{call:()=>Math.E},floor:{call:(e,t)=>{const n=e.evaluate(t.args[0]);if(\"number\"!=typeof n)throw new Error(`invalid operand '${n}' for operator 'floor'`);return Math.floor(n)}},ln:{call:(e,t)=>{const n=e.evaluate(t.args[0]);if(\"number\"!=typeof n)throw new Error(`invalid operand '${n}' for operator 'ln'`);return Math.log(n)}},ln2:{call:(e,t)=>{const n=e.evaluate(t.args[0]);if(\"number\"!=typeof n)throw new Error(`invalid operand '${n}' for operator 'ln2'`);return Math.log2(n)}},log10:{call:(e,t)=>{const n=e.evaluate(t.args[0]);if(\"number\"!=typeof n)throw new Error(`invalid operand '${n}' for operator 'log10'`);return Math.log10(n)}},max:{call:(e,t)=>Math.max(...t.args.map((t=>Number(e.evaluate(t)))))},min:{call:(e,t)=>Math.min(...t.args.map((t=>Number(e.evaluate(t)))))},clamp:{call:(e,t)=>{const n=e.evaluate(t.args[0]),r=e.evaluate(t.args[1]),o=e.evaluate(t.args[2]);if(\"number\"!=typeof n||\"number\"!=typeof r||\"number\"!=typeof o)throw new Error(`invalid operands '${n}', ${r}, ${o} for operator 'clamp'`);return i.MathUtils.clamp(n,r,o)}},pi:{call:()=>Math.PI}
947,round:{call:(e,t)=>{const n=e.evaluate(t.args[0]);if(\"number\"!=typeof n)throw new Error(`invalid operand '${n}' for operator 'round'`);return Math.round(n)}},sin:{call:(e,t)=>{const n=e.evaluate(t.args[0]);if(\"number\"!=typeof n)throw new Error(`invalid operand '${n}' for operator 'sin'`);return Math.sin(n)}},sqrt:{call:(e,t)=>{const n=e.evaluate(t.args[0]);if(\"number\"!=typeof n)throw new Error(`invalid operand '${n}' for operator 'sqrt'`);return Math.sqrt(n)}},tan:{call:(e,t)=>{const n=e.evaluate(t.args[0]);if(\"number\"!=typeof n)throw new Error(`invalid operand '${n}' for operator 'tan'`);return Math.tan(n)}}};t.MathOperators=r},9764:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.MiscOperators=void 0;const i=n(797),r=n(8023);function o(e){return e.join(\"&\")}function s(e,t){return e+\"=\"+JSON.stringify(t)}function a(e,t=0){if(t>=e.length)return[];const n=a(e,t+1),i=n.length;for(let r=0;r<i;r+=1)n.push([...n[r],e[t]]);return n.push([e[t]]),n}function l(e,t){const n=e.args.slice(1),i=[];for(let e=0;e<n.length;e+=2){const r=t.evaluate(n[e+1]);if(null===r)continue;const o=t.evaluate(n[e]);i.push(s(o,r))}return i.sort().reverse(),function(e){e.sort(((e,t)=>t.length-e.length));const t=e.map((e=>o(e)));return t.push(\"\"),t}(a(i))}const c={length:{call:(e,t)=>{const n=e.evaluate(t.args[0]);if(Array.isArray(n)||\"string\"==typeof n)return n.length;throw new Error(`invalid operand '${n}' for operator 'length'`)}},coalesce:{call:(e,t)=>{for(const n of t.args){const t=e.evaluate(n);if(null!==t)return t}return null}},lookup:{call:(e,t)=>{(0,i.assert)(t.args.length>0,\"missing lookup table\");const n=l(t,e);let a=e.evaluate(t.args[0]);if((0,i.assert)(Array.isArray(a)||a instanceof Map,\"wrong lookup table type\"),Array.isArray(a)){a=function(e){const t=new Map;for(const n of e){if(\"object\"!=typeof n)throw new Error(`Invalid lookup table entry type (${typeof n})`);if(!n.keys)throw new Error(\"Lookup table entry has no 'keys' property.\");if(!n.attributes)throw new Error(\"Lookup table entry has no 'attributes' property.\");const e=o(Object.getOwnPropertyNames(n.keys).sort().map((e=>s(e,n.keys[e]))));t.set(e,n.attributes)}return t}(a);const e=new r.ObjectLiteralExpr(a);t.args[0]=e}return function(e,t){for(const n of e){const e=t.get(n);if(e)return e}return null}(n,a)}},trace:{call:(e,t)=>{const n=[];for(const i of t.args)n.push(e.evaluate(i));return console.error(\"trace: \",...n),n[0]}}};t.MiscOperators=c},7029:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.ObjectOperators=void 0;const i=n(7259),r=n(8023),o=Object.prototype.hasOwnProperty;var s;function a(e,t,n){var r;const a=e.evaluate(t[0]);if(\"string\"!=typeof a)throw new Error(\"expected the name of an attribute\");const l=e.evaluate(t[1]);if(l&&\"object\"==typeof l){if(i.Env.isEnv(l)){const e=null!==(r=l.lookup(a))&&void 0!==r?r:null;return n===s.get?e:null!==e}if(o.call(l,a))return n!==s.get||l[a]}return n===s.get&&null}!function(e){e[e.get=0]=\"get\",e[e.has=1]=\"has\"}(s||(s={}));const l={in:{call:(e,t)=>{const n=e.evaluate(t.args[0]),i=e.evaluate(t.args[1]);return(\"string\"==typeof n&&\"string\"==typeof i||!!Array.isArray(i))&&i.includes(n)}},get:{call:(e,t)=>a(e,t.args,s.get)},has:{call:(e,t)=>a(e,t.args,s.has)},\"dynamic-properties\":{isDynamicOperator:()=>!0,call:(e,t)=>e.scope===r.ExprScope.Dynamic?e.env:t}};t.ObjectOperators=l},3501:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.StringOperators=void 0;const n={concat:{call:(e,t)=>\"\".concat(...t.args.map((t=>String(e.evaluate(t)))))},downcase:{call:(e,t)=>String(e.evaluate(t.args[0])).toLocaleLowerCase()},upcase:{call:(e,t)=>String(e.evaluate(t.args[0])).toLocaleUpperCase()},\"regex-replace\":{call:(e,t)=>{const n=e.evaluate(t.args[0]),i=e.evaluate(t.args[1]),r=e.evaluate(t.args[2]);return\"string\"==typeof n&&\"string\"==typeof i&&\"string\"==typeof r?n.replace(new RegExp(i,\"g\"),r):n}},\"~=\":{call:(e,t)=>{const n=e.evaluate(t.args[0]),i=e.evaluate(t.args[1]);return\"string\"==typeof n&&\"string\"==typeof i&&n.includes(i)}},\"^=\":{call:(e,t)=>
947{const n=e.evaluate(t.args[0]),i=e.evaluate(t.args[1]);return\"string\"==typeof n&&\"string\"==typeof i&&n.startsWith(i)}},\"$=\":{call:(e,t)=>{const n=e.evaluate(t.args[0]),i=e.evaluate(t.args[1]);return\"string\"==typeof n&&\"string\"==typeof i&&n.endsWith(i)}},split:{call:(e,t)=>{const n=e.evaluate(t.args[0]),i=e.evaluate(t.args[1]);if(\"string\"==typeof n&&\"string\"==typeof i)return n.split(i);throw new Error(`expected '${n}' and '${i}' to be a string`)}}};t.StringOperators=n},5113:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.TypeOperators=void 0,t.TypeOperators={typeof:{call:(e,t)=>typeof e.evaluate(t.args[0])}}},545:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.VectorOperators=void 0;const i=n(82),r=n(8023);function o(e,t,n){let r;switch(n){case\"vector2\":r=i.Vector2;break;case\"vector3\":r=i.Vector3;break;case\"vector4\":r=i.Vector4}for(const n of t.args){const t=e.evaluate(n);if(t instanceof r)return t}throw new Error(`expected a \"${n}\"`)}function s(e,t,n){let r,o;switch(n){case\"vector2\":r=i.Vector2,o=2;break;case\"vector3\":r=i.Vector3,o=3;break;case\"vector4\":r=i.Vector4,o=4}for(const n of t.args){const t=e.evaluate(n);if(t instanceof r)return t;if(Array.isArray(t)&&t.length===o&&t.every((e=>\"number\"==typeof e)))return(new r).fromArray(t)}throw new Error(`expected a \"${n}\"`)}const a={\"make-vector\":{call:(e,t)=>{if(void 0!==t._value)return t._value;if(t.args.length<2)throw new Error(\"not enough arguments\");if(t.args.length>4)throw new Error(\"too many arguments\");const n=t.args.map((t=>e.evaluate(t)));let o;switch(n.forEach(((e,t)=>{if(\"number\"!=typeof e)throw new Error(`expected vector component at index ${t} to have type \"number\"`)})),n.length){case 2:o=(new i.Vector2).fromArray(n);break;case 3:o=(new i.Vector3).fromArray(n);break;case 4:o=(new i.Vector4).fromArray(n);break;default:throw new Error(\"too many arguments\")}return t.args.every((e=>e instanceof r.NumberLiteralExpr))&&(t._value=o),o}},vector2:{call:(e,t)=>o(e,t,\"vector2\")},vector3:{call:(e,t)=>o(e,t,\"vector3\")},vector4:{call:(e,t)=>o(e,t,\"vector4\")},\"to-vector2\":{call:(e,t)=>s(e,t,\"vector2\")},\"to-vector3\":{call:(e,t)=>s(e,t,\"vector3\")},\"to-vector4\":{call:(e,t)=>s(e,t,\"vector4\")}};t.VectorOperators=a},6463:function(e,t,n){\"use strict\";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);
947r&&!(\"get\"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)\"default\"===n||Object.prototype.hasOwnProperty.call(t,n)||i(t,e,n)};Object.defineProperty(t,\"__esModule\",{value:!0}),r(n(4992),t),r(n(5337),t),r(n(197),t),r(n(9172),t),r(n(5200),t),r(n(8154),t),r(n(9246),t),r(n(5681),t),r(n(7314),t),r(n(4954),t),r(n(173),t),r(n(34),t),r(n(7250),t),r(n(5177),t),r(n(4713),t),r(n(9276),t),r(n(5704),t),r(n(7427),t),r(n(9206),t)},4342:function(e,t,n){\"use strict\";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!(\"get\"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)\"default\"===n||Object.prototype.hasOwnProperty.call(t,n)||i(t,e,n)};Object.defineProperty(t,\"__esModule\",{value:!0}),r(n(6463),t),r(n(5323),t)},7427:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0})},5681:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0})},7314:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.ContextLogger=void 0,t.ContextLogger=class{constructor(e,t){this.m_logger=e,this.headerMessage=t,this.context=[],this.m_headerLogged=!1,this.warn=this.createLogMethod(\"warn\"),this.info=this.createLogMethod(\"info\"),this.error=this.createLogMethod(\"error\")}pushAttr(e){this.context.push(`${this.context.length>0?\".\":\"\"}${e}`)}pushIndex(e){this.context.push(`[${e}]`)}pop(){this.context.pop()}createLogMethod(e){return(t,...n)=>{this.m_headerLogged||(this.m_logger.info(this.headerMessage),this.m_headerLogged=!0),this.m_logger[e](`${this.context.join(\"\")}: ${t}`,...n)}}}},4992:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.DOMUtils=void 0,function(e){function t(e){return e.substring(0,2)}e.getBrowserLanguages=function(){if(void 0!==navigator.languages&&navigator.languages.length>0){const e=[];for(const n of navigator.languages)e.push(t(n));return e}if(void 0!==navigator.language)return[t(navigator.language)]}}(t.DOMUtils||(t.DOMUtils={}))},9276:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.chainCallbacks=void 0,t.chainCallbacks=function(e,t){return function(...n){return e&&e.apply(this,n),t.apply(this,n)}}},9206:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.convertFragmentShaderToWebGL2=t.convertVertexShaderToWebGL2=void 0,t.convertVertexShaderToWebGL2=function(e){return[\"#define attribute in\",\"#define varying out\",\"#define texture2D texture\"].join(\"\\n\")+\"\\n\"+e},t.convertFragmentShaderToWebGL2=function(e){return[\"#define varying in\",\"out highp vec4 pc_fragColor;\",\"#define gl_FragColor pc_fragColor\",\"#define gl_FragDepthEXT gl_FragDepth\",\"#define texture2D texture\",\"#define textureCube texture\",\"#define texture2DProj textureProj\",\"#define texture2DLodEXT textureLod\",\"#define texture2DProjLodEXT textureProjLod\",\"#define textureCubeLodEXT textureLod\",\"#define texture2DGradEXT textureGrad\",\"#define texture2DProjGradEXT textureProjGrad\",\"#define textureCubeGradEXT textureGrad\"].join(\"\\n\")+\"\\n\"+e}},5337:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.GroupedPriorityList=t.PriorityListGroup=void 0;class n{constructor(e,t,n=new Array){this.priority=e,this.zOrder=t,this.elements=n}}t.PriorityListGroup=n,t.GroupedPriorityList=class{constructor(){this.groups=new Map}getGroupKey(e){return`${e.priority}_${e.zOrder}`}add(e){this.getGroup(e).elements.push(e)}clear(){this.groups.clear()}forEachElement(e){this.forEachGroup((t=>{t.elements.forEach(e)}))}forEachGroup(e){for(const[,t]of this.groups)e(t)}count(){let e=0;for(const[,t]of this.groups)e+=t.elements.length;return e}findGroup(e){return this.groups.get(e)}getGroup(e){const t=this.getGroupKey(e);let i=this.findGroup(t);return void 0===i&&(i=new n(e.priority,e.zOrder),this.groups.set(t,i)),i}}},4015:(e,t)=>{\"use strict\";
947Object.defineProperty(t,\"__esModule\",{value:!0}),t.ConsoleChannel=void 0,t.ConsoleChannel=class{error(e,...t){console.error(e,...t)}debug(e,...t){console.debug(e,...t)}info(e,...t){console.info(e,...t)}log(e,...t){console.log(e,...t)}trace(e,...t){console.trace(e,...t)}warn(e,...t){console.warn(e,...t)}}},3140:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0})},6781:(e,t)=>{\"use strict\";var n;Object.defineProperty(t,\"__esModule\",{value:!0}),t.LoggerOptions=t.LogLevel=void 0,(n=t.LogLevel||(t.LogLevel={}))[n.Trace=0]=\"Trace\",n[n.Debug=1]=\"Debug\",n[n.Log=2]=\"Log\",n[n.Info=3]=\"Info\",n[n.Warn=4]=\"Warn\",n[n.Error=5]=\"Error\",n[n.None=6]=\"None\",t.LoggerOptions=class{}},8648:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.Logger=void 0;const i=n(6781);t.Logger=class{constructor(e,t,n){this.name=e,this.m_channel=t,this.enabled=!0,this.level=i.LogLevel.Trace,void 0!==n&&this.update(n)}error(e,...t){this.enabled&&this.level<=i.LogLevel.Error&&this.m_channel.error(this.prefix,e,...t)}debug(e,...t){this.enabled&&this.level<=i.LogLevel.Debug&&this.m_channel.debug(this.prefix,e,...t)}info(e,...t){this.enabled&&this.level<=i.LogLevel.Info&&this.m_channel.info(this.prefix,e,...t)}log(e,...t){this.enabled&&this.level<=i.LogLevel.Log&&this.m_channel.log(this.prefix,e,...t)}trace(e,...t){this.enabled&&this.level<=i.LogLevel.Trace&&this.m_channel.trace(this.prefix,e,...t)}warn(e,...t){this.enabled&&this.level<=i.LogLevel.Warn&&this.m_channel.warn(this.prefix,e,...t)}update(e){this.enabled=void 0===e.enabled?this.enabled:e.enabled,this.level=void 0===e.level?this.level:e.level}get prefix(){return this.name+\":\"}}},6562:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.LoggerManager=void 0;const i=n(2531);t.LoggerManager=class{static get instance(){return this.m_instance||(this.m_instance=new i.LoggerManagerImpl)}}},2531:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.LoggerManagerImpl=void 0;const i=n(4015),r=n(8648),o=n(7698);t.LoggerManagerImpl=class{constructor(){this.m_loggers=[],this.channel=\"undefined\"==typeof self||void 0!==self.document?new i.ConsoleChannel:new o.WorkerChannel}getLoggerNames(){return this.m_loggers.map((e=>e.name))}getLogger(e){return this.m_loggers.find((t=>t.name===e))}create(e,t={}){void 0!==this.m_levelSetForAll&&(void 0===t.level||t.level<this.m_levelSetForAll)&&(t.level=this.m_levelSetForAll);const n=new r.Logger(e,this.channel,t);return this.m_loggers.push(n),n}dispose(e){const t=this.m_loggers.indexOf(e);if(t<0)throw new Error(`Cannot unregister \"${e}\" : no such logger registered.`);this.m_loggers.splice(t,1)}updateAll(e){for(const t of this.m_loggers)t.update(e)}update(e,t){for(const n of this.m_loggers)n.name===e&&n.update(t)}enableAll(e){for(const t of this.m_loggers)t.enabled=e}enable(e,t){this.update(e,{enabled:t})}setLogLevelForAll(e){this.m_levelSetForAll=e;for(const t of this.m_loggers)t.level=e}setLogLevel(e,t){this.update(e,{level:t})}setChannel(e){this.channel=e}}},3069:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.MultiChannel=void 0,t.MultiChannel=class{constructor(...e){this.channels=[],this.channels=e}error(e,...t){for(const n of this.channels)n.error(e,...t)}debug(e,...t){for(const n of this.channels)n.debug(e,...t)}info(e,...t){for(const n of this.channels)n.info(e,...t)}log(e,...t){for(const n of this.channels)n.log(e,...t)}trace(e,...t){for(const n of this.channels)n.trace(e,...t)}warn(e,...t){for(const n of this.channels)n.warn(e,...t)}}},7698:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.WorkerChannel=t.WORKERCHANNEL_MSG_TYPE=void 0;const i=n(6781);t.WORKERCHANNEL_MSG_TYPE=\"worker-channel-message\",t.WorkerChannel=class{error(e,...n){const r={message:[e,...n],type:t.WORKERCHANNEL_MSG_TYPE,level:i.LogLevel.Error};self.postMessage(r)}debug(e,...n){const r={message:[e,...n],type:t.WORKERCHANNEL_MSG_TYPE,level:i.LogLevel.Debug};self.postMessage(r)}info(e,...n){const r={message:[e,...n],type:t.WORKERCHANNEL_MSG_TYPE,level:i.LogLevel.Info};self.postMessage(r)}log(e,...n){const r={message:[e,...n],type:t.WORKERCHANNEL_MSG_TYPE,level:i.LogLevel.Log};self.postMessage(r)}trace(e,...n){const r={message:[e,...n],type:t.WORKERCHANNEL_MSG_TYPE,level:i.LogLevel.Trace};self.postMessage(r)}warn(e,...n){const r={message:[e,...n],type:t.WORKERCHANNEL_MSG_TYPE,level:i.LogLevel.Warn};self.postMessage(r)}}},197:function(e,t,n){\"use strict\";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);
947r&&!(\"get\"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)\"default\"===n||Object.prototype.hasOwnProperty.call(t,n)||i(t,e,n)};Object.defineProperty(t,\"__esModule\",{value:!0}),r(n(4015),t),r(n(3140),t),r(n(6781),t),r(n(8648),t),r(n(6562),t),r(n(3069),t),r(n(7698),t)},9172:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.Math2D=void 0,function(e){function t(e,t,n,i){return(e-n)*(e-n)+(t-i)*(t-i)}e.Box=class{constructor(e=0,t=0,n=0,i=0){this.x=e,this.y=t,this.w=n,this.h=i}set(e,t,n,i){this.x=e,this.y=t,this.w=n,this.h=i}copy(e){this.x=e.x,this.y=e.y,this.w=e.w,this.h=e.h}contains(e,t){return this.x<=e&&this.x+this.w>=e&&this.y<=t&&this.y+this.h>=t}containsBox(e){const t=e.x+e.w,n=e.y+e.h;return this.contains(e.x,e.y)&&this.contains(t,e.y)&&this.contains(e.x,n)&&this.contains(t,n)}intersects(e){return this.x<=e.x+e.w&&this.x+this.w>=e.x&&this.y<=e.y+e.h&&this.y+this.h>=e.y}},e.distSquared=t,e.computeSquaredLineLength=function(e){let t=0;const n=e.length-4;for(let i=0;i<n;i+=3){const n=e[i+3]-e[i],r=e[i+4]-e[i+1];t+=n*n+r*r}return t},e.distToSegmentSquared=function(e,n,i,r,o,s){const a=t(i,r,o,s);if(0===a)return t(e,n,i,r);let l=((e-i)*(o-i)+(n-r)*(s-r))/a;return l=Math.max(0,Math.min(1,l)),t(e,n,i+l*(o-i),r+l*(s-r))},e.intersectLineAndCircle=function(e,t,n,i,r,o=0,s=0){const a=n-e,l=i-t,c=a*a+l*l,u=e*i-n*t-l*o+a*s,h=r*r*c-u*u;if(h<-1e-10)return;const d=u*l,p=-u*a;if(h<1e-10)return{x1:o+d/c,y1:s+p/c};const f=Math.sqrt(h),m=(l<0?-1:1)*a*f,g=Math.abs(l)*f;return{x1:o+(d+m)/c,y1:s+(p+g)/c,x2:o+(d-m)/c,y2:s+(p-g)/c}},e.intersectLines=function(e,t,n,i,r,o,s,a,l={x:0,y:0}){const c=(e-n)*(o-a)-(t-i)*(r-s);if(0===c)return;const u=((e*i-t*n)*(r-s)-(e-n)*(r*a-o*s))/c,h=((e*i-t*n)*(o-a)-(t-i)*(r*a-o*s))/c;return l.x=u,l.y=h,l}}(t.Math2D||(t.Math2D={}))},5200:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.MathUtils=void 0,function(e){function t(e,t,n){return e<t?t:e>n?n:e}e.clamp=t,e.smoothStep=function(e,n,i){return(i=t((i-e)/(n-e),0,1))*i*(3-2*i)},e.smootherStep=function(e,n,i){return(i=t((i-e)/(n-e),0,1))*i*i*(i*(6*i-15)+10)},e.map=function(e,t,n,i,r){return(e-t)*(r-i)/(n-t)+i},e.min2=function(e,t){let n;return void 0!==e&&(n=e),void 0!==t&&(n=void 0===n?t:Math.min(n,t)),n},e.max2=function(e,t){let n;return void 0!==e&&(n=e),void 0!==t&&(n=void 0===n?t:Math.max(n,t)),n},e.isWithinBounds=function(e,t,n){return!(void 0!==t&&e<t||void 0!==n&&e>n)},e.easeInOutCubic=function(e,t,n){return e+(t-e)*(n<.5?4*n*n*n:(n-1)*(2*n-2)*(2*n-2)+1)}}(t.MathUtils||(t.MathUtils={}))},8154:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.applyMixinsWithoutProperties=t.applyMixins=void 0,t.applyMixins=function(e,t){t.forEach((t=>{Object.getOwnPropertyNames(t.prototype).forEach((n=>{e.prototype[n]=t.prototype[n]}))}))},t.applyMixinsWithoutProperties=function(e,t){t.forEach((t=>{Object.getOwnPropertyNames(t.prototype).forEach((n=>{const i=Object.getOwnPropertyDescriptor(t.prototype,n);void 0!==i&&void 0===i.get&&\"constructor\"!==n&&(e.prototype[n]=t.prototype[n])}))}))}},173:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.pick=t.cloneDeep=void 0,t.cloneDeep=function(e){const t=new Map,n=function e(n){if(null===n)return null;if(\"object\"==typeof n){const i=t.get(n);if(void 0!==i)return i;if(Array.isArray(n)){const i=[];t.set(n,i),i.length=n.length;for(let t=0;t<i.length;++t)i[t]=e(n[t]);return i}if(n instanceof Date){const e=new Date(n.getTime());return t.set(n,e),e}if(n instanceof RegExp){const e=new RegExp(n.source,n.flags);return t.set(n,e),e}if(n.constructor!==Object)throw new Error(\"cloneDeep doesn't support objects with custom prototypes\");{const i={};t.set(n,i);for(const t in n)n.hasOwnProperty(t)&&(i[t]=e(n[t]));return i}}return n}(e);return t.clear(),n},t.pick=function(e,t){const n={};for(const i of t)e.hasOwnProperty(i)&&(n[i]=e[i]);return n}},34:(e,t)=>{\"use strict\";
947Object.defineProperty(t,\"__esModule\",{value:!0}),t.getOptionValue=void 0,t.getOptionValue=function(...e){for(const t of e)if(null!=t)return t}},4954:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.PerformanceTimer=void 0;class n{static now(){return n.nowFunc()}static getNowFunc(){return\"undefined\"!=typeof performance&&void 0!==performance.now?()=>performance.now():()=>(new Date).getTime()}}t.PerformanceTimer=n,n.instance=new n,n.nowFunc=n.getNowFunc()},5704:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.sampleBilinear=void 0,t.sampleBilinear=function(e,t,n,i,r){const o=t-1,s=n-1,a=i*o,l=Math.floor(a),c=r*s,u=Math.floor(c),h=u*t+l,d=l<o?h+1:h,p=u<s?h+t:h,f=l<o?p+1:p,m=e[h],g=e[d],v=e[p],y=e[f],x=Number.isInteger(a)?0:a-l,_=1-x,b=Number.isInteger(c)?0:c-u,w=1-b;return m*_*w+g*x*w+v*_*b+y*x*b}},7250:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.TaskQueue=void 0,t.TaskQueue=class{constructor(e){var t;this.m_options=e,this.m_taskLists=new Map,null===(t=this.m_options.groups)||void 0===t||t.forEach((e=>{this.m_taskLists.set(e,[])})),this.m_options.prioSortFn&&(this.sort=this.m_options.prioSortFn)}update(e){if(void 0===e)this.m_taskLists.forEach((e=>{this.updateTaskList(e)}));else{const t=this.getTaskList(e);t&&this.updateTaskList(t)}}add(e){var t;if(this.m_taskLists.has(e.group)){const n=this.m_taskLists.get(e.group);if(!(null==n?void 0:n.includes(e)))return null===(t=this.m_taskLists.get(e.group))||void 0===t||t.push(e),!0}return!1}remove(e){var t,n;if(this.m_taskLists.has(e.group)){const i=null===(t=this.m_taskLists.get(e.group))||void 0===t?void 0:t.indexOf(e);if(-1!==i)return null===(n=this.m_taskLists.get(e.group))||void 0===n||n.splice(i,1),!0}return!1}numItemsLeft(e){var t,n;let i=0;return void 0===e?this.m_taskLists.forEach((e=>{i+=e.length})):i+=null!==(n=null===(t=this.getTaskList(e))||void 0===t?void 0:t.length)&&void 0!==n?n:0,i}processNext(e,t,n=1){if(!this.getTaskList(e)||this.numItemsLeft(e)<=0)return!1;for(let i=0;i<n&&this.numItemsLeft(e)>0;i++){const n=this.pull(e,!0);void 0!==n&&(!t||(null==t?void 0:t(n))?n.execute():this.add(n))}return!0}clear(){this.m_taskLists.clear()}pull(e,t=!1){var n,i;let r;return this.getTaskList(e)&&(r=null===(n=this.getTaskList(e))||void 0===n?void 0:n.pop(),t&&r&&(null===(i=r.isExpired)||void 0===i?void 0:i.call(r)))?this.pull(e,t):r}sort(e,t){return t.getPriority()-e.getPriority()}getTaskList(e){return this.m_taskLists.get(e)}updateTaskList(e){var t;for(let n=0;n<e.length;n++){const i=e[n];(null===(t=null==i?void 0:i.isExpired)||void 0===t?void 0:t.call(i))&&(e.splice(n,1),n--)}e.sort(this.sort)}}},5177:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0})},5323:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.getAppBaseUrl=void 0;const i=n(4713);t.getAppBaseUrl=function(){return\"undefined\"==typeof window?`file://${process.cwd()}/`:(0,i.baseUrl)(window.location.href)}},4713:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.getUrlHostAndProtocol=t.getUrlOrigin=t.baseUrl=t.resolveReferenceUri=void 0,t.resolveReferenceUri=function(e,t){return n.test(t)?t:t.startsWith(\"/\")?r(e)+t:(t.startsWith(\"./\")&&(t=t.substr(2)),i(e)+t)};const n=new RegExp(\"^(((?:[a-z]+:)?//)|(file:/)|(data:))\",\"i\");function i(e){if(void 0===e)return\"./\";let t=e.indexOf(\"#\");return-1!==t&&(e=e.slice(0,t)),t=e.indexOf(\"?\"),-1!==t&&(e=e.slice(0,t)),t=e.lastIndexOf(\"/\"),-1===t?\"./\":e.substring(0,t+1)}function r(e){if(void 0===e)return\"\";const t=o(e);return\"file:\"===t.protocol?\"file://\":t.host&&t.protocol?t.protocol+\"//\"+t.host:t.host?\"//\"+t.host:t.protocol?t.protocol+\"//\":\"\"}function o(e){const t=new RegExp(/^(?:([a-z]+:))?\\/\\/([^\\/]*)/,\"i\"),n=e.match(t);if(!n)throw new Error(`getUrlHostAndProtocol: unable to parse URL '${e}'`);return{protocol:n[1],host:n[2]}}t.baseUrl=i,t.getUrlOrigin=r,t.getUrlHostAndProtocol=o},9246:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.assertExists=t.assert=void 0,t.assert=function(e,t){},t.assertExists=function(e,t){return e}},952:function(e,t,n){\"use strict\";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);
947r&&!(\"get\"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)\"default\"===n||Object.prototype.hasOwnProperty.call(t,n)||i(t,e,n)};Object.defineProperty(t,\"__esModule\",{value:!0}),r(n(1503),t),r(n(6133),t),r(n(9959),t),r(n(5863),t)},9287:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.computeLineAnchorPoints=t.MAX_SEARCH_DEPTH=void 0;const i=n(82),r=new i.Vector3,o=new i.Vector3;t.MAX_SEARCH_DEPTH=3,t.computeLineAnchorPoints=function(e,n){if(e.count<2)return(new Float64Array).buffer;const i=function(e){const t=[];let n=0;for(let i=0;i<e.count-1;++i)n+=r.fromBufferAttribute(e,i).distanceTo(o.fromBufferAttribute(e,i+1)),t.push(n);return t}(e);if(i[i.length-1]<=Number.EPSILON)return(new Float64Array).buffer;const s=function(e,n,i){const s=[],a=e[e.length-1],l=Math.min(t.MAX_SEARCH_DEPTH+1,Math.floor(Math.log2(a/n))),c=l>0?Math.pow(2,l):0,u=c+1,h=a/c;let d=0;for(let t=0;t<u;t++){const n=1===u?a/2:t*h;let l=e.length-1;for(;l!==d;){const t=Math.floor((l+d)/2);n>=e[t]?d=t+1:l=t}const c=e[d],p=1-(c-n)/(c-(0===d?0:e[d-1])),f=r.fromBufferAttribute(i,d).lerp(o.fromBufferAttribute(i,d+1),p);s.push(...f.toArray())}return s}(i,n,e);return new Float64Array(s).buffer}},5863:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0})},9252:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.DecodeInfo=void 0;const i=n(82),r=n(2616);t.DecodeInfo=class{constructor(e,t,n=0){this.targetProjection=e,this.tileKey=t,this.storageLevelOffset=n,this.projectedBoundingBox=new r.OrientedBox3,this.tileBounds=new i.Box3,this.tileSize=new i.Vector3,this.center=new i.Vector3,this.geoBox=this.tilingScheme.getGeoBox(t),this.targetProjection.projectBox(this.geoBox,this.projectedBoundingBox),this.projectedBoundingBox.getCenter(this.center),this.tilingScheme.getWorldBox(t,this.tileBounds),this.tileBounds.getSize(this.tileSize),this.tileSizeOnScreen=256*Math.pow(2,-this.storageLevelOffset),this.columnCount=r.webMercatorTilingScheme.subdivisionScheme.getLevelDimensionX(this.tileKey.level),this.rowCount=r.webMercatorTilingScheme.subdivisionScheme.getLevelDimensionY(this.tileKey.level)}get tilingScheme(){return r.webMercatorTilingScheme}get sourceProjection(){return this.tilingScheme.projection}}},6133:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.GeoJsonTilerService=void 0;const i=n(2626),r=n(9959);t.GeoJsonTilerService=class{static start(){i.WorkerServiceManager.getInstance().register({serviceType:r.GEOJSON_TILER_SERVICE_TYPE,factory:e=>i.TilerService.start(e)})}}},9959:(e,t)=>{\"use strict\";var n;Object.defineProperty(t,\"__esModule\",{value:!0}),t.GEOJSON_TILER_SERVICE_TYPE=t.VECTOR_TILE_DECODER_SERVICE_TYPE=t.OmvGeometryType=void 0,(n=t.OmvGeometryType||(t.OmvGeometryType={}))[n.UNKNOWN=0]=\"UNKNOWN\",n[n.POINT=1]=\"POINT\",n[n.LINESTRING=2]=\"LINESTRING\",n[n.POLYGON=3]=\"POLYGON\",t.VECTOR_TILE_DECODER_SERVICE_TYPE=\"vector-tile-decoder\",t.GEOJSON_TILER_SERVICE_TYPE=\"geojson-tiler\"},7305:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.OmvPoliticalViewFeatureModifier=void 0,t.OmvPoliticalViewFeatureModifier=class{constructor(e){this.m_countryCode=e}doProcessPointFeature(e,t,n){return this.processFeature(e,t)}doProcessLineFeature(e,t,n){return this.processFeature(e,t)}doProcessPolygonFeature(e,t,n){return!0}rewriteEnvironment(e,t){this.isPoliticalViewLayer(e)&&this.updateEnvironment(t,this.m_countryCode,\"kind\")}updateEnvironment(e,t,n){const i=this.getAlternativePov(e,t,n);void 0!==i&&(e.entries[n]=i)}getAlternativePov(e,t,n){const i=t,r=e.lookup(`${n}:${i}`);return\"string\"==typeof r&&r.length>0?r:void 0}isPoliticalViewLayer(e){return\"boundaries\"===e||\"places\"===e}processFeature(e,t){let n=!1;if(this.isPoliticalViewLayer(e)){const i=Object.keys(t.unmap()).filter((e=>e.includes(\"kind:\"))).length>0,r=!!t.lookup(`kind:${this.m_countryCode}`),o=!!t.lookup(\"kind\"),s=Boolean(this.m_countryCode);
947n=!s&&!o&&i||s&&(!o&&i&&!r||o&&r),!n&&s&&r&&this.rewriteEnvironment(e,t)}return!n}}},6441:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.webMercatorTile2TargetTile=t.webMercatorTile2TargetWorld=t.world2tile=t.tile2world=t.createWorldTileTransformationCookie=t.tile2lat=t.lat2tile=t.isArrayBufferLike=void 0;const i=n(82),r=n(2616);function o(e,t){return Math.round((1-Math.log(Math.tan(e*Math.PI/180)+1/Math.cos(e*Math.PI/180))/Math.PI)/2*Math.pow(2,t))}function s(e,t){const{north:n,west:i}=t.geoBox,r=Math.log2(e),s=Math.pow(2,t.tileKey.level+r);return{extents:e,scale:s,top:o(n,t.tileKey.level+r),left:Math.round((i+180)/360*s)}}function a(e,t,n,i=!1,o){void 0!==t.worldTileProjectionCookie&&t.worldTileProjectionCookie.extents===e||(t.worldTileProjectionCookie=s(e,t));const{top:a,left:l,scale:c}=t.worldTileProjectionCookie,u=r.EarthConstants.EQUATORIAL_CIRCUMFERENCE;return o.x=(l+n.x)/c*u,o.y=(a+(i?-n.y:n.y))/c*u,o.z=(0,r.isVector3Like)(n)?n.z:0,o}function l(e,t,n,o,s,l=!1){a(e,t,n,l,o),t.targetProjection.reprojectPoint(r.webMercatorProjection,o,o),n instanceof i.Vector3&&s&&(o.z*=t.targetProjection.getScaleFactor(o))}t.isArrayBufferLike=function(e){return\"undefined\"!=typeof SharedArrayBuffer?e instanceof ArrayBuffer||e instanceof SharedArrayBuffer:e instanceof ArrayBuffer},t.lat2tile=o,t.tile2lat=function(e,t){const n=Math.PI-2*Math.PI*e/Math.pow(2,t);return 180/Math.PI*Math.atan(.5*(Math.exp(n)-Math.exp(-n)))},t.createWorldTileTransformationCookie=s,t.tile2world=a,t.world2tile=function(e,t,n,i=!1,o){void 0!==t.worldTileProjectionCookie&&t.worldTileProjectionCookie.extents===e||(t.worldTileProjectionCookie=s(e,t));const{top:a,left:l,scale:c}=t.worldTileProjectionCookie,u=r.EarthConstants.EQUATORIAL_CIRCUMFERENCE;return o.x=Math.round(n.x/u*c-l),o.y=Math.round((i?-1:1)*(n.y/u*c-a)),(0,r.isVector3Like)(o)&&(o.z=n.z),o},t.webMercatorTile2TargetWorld=l,t.webMercatorTile2TargetTile=function(e,t,n,i,r,o=!1){l(e,t,n,i,r,o),i.sub(t.center)}},627:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.Ring=void 0;const i=n(82);t.Ring=class{constructor(e,t,n=4096,r=!1){if(this.points=e,this.textureCoords=t,this.extents=n,this.hasClipInfo=r,void 0!==t&&t.length!==e.length)throw new Error(\"the array of texture coordinates must have the same number of elements of the array of points\");this.vertexStride=2,void 0!==t&&(this.vertexStride=this.vertexStride+2),this.area=i.ShapeUtils.area(this.points),this.winding=this.area<0}toArray(e=[],t=0){var n;return this.points.forEach(((n,i)=>n.toArray(e,t+this.vertexStride*i))),null===(n=this.textureCoords)||void 0===n||n.forEach(((n,i)=>n.toArray(e,t+this.vertexStride*i+2))),e}isProperEdge(e){const t=this.extents,n=(e+1)%this.points.length,i=this.points[e],r=this.points[n];if(this.hasClipInfo){if(i.x!==r.x&&i.y!==r.y)return!0;if(i.x%this.extents!=0&&i.y%this.extents!=0)return!0;if(r.x%this.extents!=0&&r.y%this.extents!=0)return!0;const e=!0===i.isClipped,t=!0===r.isClipped;return!e&&!t}return!(i.x<=0&&r.x<=0||i.x>=t&&r.x>=t||i.y<=0&&r.y<=0||i.y>=t&&r.y>=t)}}},1140:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.VectorTileDataEmitter=void 0;const i=n(1874),r=n(82),o=n(8152),s=n(3561),a=n(2982),l=n(6525),c=n(6189),u=n(2616),h=n(4388),d=n(3711),p=n(4250),f=n(1984),m=n(4342),g=n(9287),v=n(6441),y=n(627),x=m.LoggerManager.instance.create(\"OmvDecodedTileEmitter\"),_=new r.Vector3,b=new r.Vector3,w=new r.Vector3,M=new r.Vector3,S=new r.Vector2,E=new r.Vector2,T=new r.Vector3,A=new r.Vector3,L=new r.Vector3,C=new r.Vector2,P=new r.Vector2,R=new r.Vector2,D=new r.Vector3,O=new r.Vector3,I=new r.Vector3,F=new r.Vector3,N=new r.Vector3,U=new r.Line3,z=Math.PI/8;function B(e,t,n=\"index\"){const i=t>65535?\"uint32\":\"uint16\";return{itemCount:1,name:n,buffer:(\"uint32\"===i?new Uint32Array(e):new Uint16Array(e)).buffer,type:i}}class G{constructor(e){this.type=e,this.positions=[],this.normals=[],this.textureCoordinates=[],this.colors=[],this.extrusionAxis=[],this.indices=[],this.edgeIndices=[],this.groups=[],this.texts=[],this.pathLengths=[],this.stringCatalog=[],this.imageTextures=[],this.textBackgroun
947dImageTextures=[],this.featureStarts=[],this.edgeFeatureStarts=[],this.objInfos=[],this.offsetDirections=[]}addText(e){let t=this.stringCatalog.indexOf(e);return t<0&&(t=this.stringCatalog.length,this.stringCatalog.push(e)),t}}var k;!function(e){e[e.Simple=0]=\"Simple\",e[e.Complex=1]=\"Complex\"}(k||(k={}));const V=new r.Color;t.VectorTileDataEmitter=class{constructor(e,t,n={}){var i,r,o;this.m_decodeInfo=e,this.m_styleSetEvaluator=t,this.m_options=n,this.m_meshBuffers=new Map,this.m_geometries=[],this.m_textGeometries=[],this.m_textPathGeometries=[],this.m_pathGeometries=[],this.m_iconTextGeometries=[],this.m_simpleLines=[],this.m_solidLines=[],this.m_sources=[],this.m_maxGeometryHeight=0,this.m_minGeometryHeight=0,this.m_options.gatherFeatureAttributes=null!==(i=n.gatherFeatureAttributes)&&void 0!==i&&i,this.m_options.skipShortLabels=null===(r=n.skipShortLabels)||void 0===r||r,this.m_options.enableElevationOverlay=null!==(o=n.enableElevationOverlay)&&void 0!==o&&o}get projection(){return this.m_decodeInfo.targetProjection}get center(){return this.m_decodeInfo.center}processPointFeature(e,t,n,i,r){var a;const l=i.env;this.processFeatureCommon(l);const{tileKey:c,columnCount:h,rowCount:d}=this.m_decodeInfo,p=c.column+1<h?t-1:t,m=c.row+1<d?t-1:t,g=n.filter((e=>e.x>=0&&e.x<=p&&e.y>=0&&e.y<=m));if(0!==g.length)for(const e of r){if(void 0===e)continue;const n=e._index,r=this.findOrCreateMeshBuffers(n,o.GeometryType.Point);if(void 0===r)continue;const{positions:c,texts:h,imageTextures:d,textBackgroundImageTextures:p,objInfos:m,offsetDirections:y}=r,x=(0,f.isTextTechnique)(e)||(0,f.isIconTextTechnique)(e);let _,b;const w=(0,f.isIconTextTechnique)(e);if(w){const t=e;_=(0,s.evaluateTechniqueAttr)(i,t.imageTexture),void 0!==t[\"background-image\"]&&(b=(0,s.evaluateTechniqueAttr)(i,t[\"background-image\"]))}const M=(0,o.scaleHeight)(i,e,this.m_decodeInfo.tileKey.level),S=(0,o.getFeatureId)(l.entries);for(const n of g){if(x){const t=e,n=(0,o.getFeatureText)(i,t,this.m_options.languages);void 0!==n?h.push(r.addText(n)):h.push(-1)}x?(0,v.webMercatorTile2TargetWorld)(t,this.m_decodeInfo,n,T,M):(0,v.webMercatorTile2TargetTile)(t,this.m_decodeInfo,n,T,M);const s=this.projection.type===u.ProjectionType.Planar?T.z:n.z;s>this.m_maxGeometryHeight?this.m_maxGeometryHeight=s:s<this.m_minGeometryHeight&&(this.m_minGeometryHeight=s),c.push(T.x,T.y,T.z),m.push(this.m_options.gatherFeatureAttributes?l.entries:S),y.push(null!==(a=l.lookup(\"offset_direction\"))&&void 0!==a?a:0),w&&(void 0===_?d.push(-1):d.push(r.addText(_)),void 0===b?p.push(-1):p.push(r.addText(b)))}}}processLineFeature(e,t,n,i,a){var l;const c=i.env;this.processFeatureCommon(c);const u=[],h=[],p=[],y=[],_=this.m_decodeInfo.projectedBoundingBox;let b;const w=2*_.extents.x,M=2*_.extents.y,S=Math.max(w,M);let E,C;const P=void 0!==n[0].untiledPositions,R=!1;let D=!1,O=!1;for(const e of a)if(void 0!==e){if(E){const t=this.getTextureCoordinateType(e);(0,m.assert)(void 0===t||C===t)}else E=this.getComputeTexCoordsFunc(e),C=this.getTextureCoordinateType(e);D=D||(0,f.isSpecialDashesLineTechnique)(e),O=O||!D}for(const e of n){const n=[];let i=0;if(P&&(this.m_decodeInfo.targetProjection.projectPoint(e.untiledPositions[0],A),e.untiledPositions.forEach((e=>{this.m_decodeInfo.targetProjection.projectPoint(e,T),i+=T.distanceTo(A),A.copy(T),this.m_decodeInfo.targetProjection.projectPoint(e.normalized(),T),n.push(T.x,T.y,T.z,i)}))),D){b=[];let r=0;const o=e.positions.length;if(o>1){let s=0;for(let a=0;a<o-1;a++){const o=[],l=[],c=[],u=[],d=e.positions[a],f=e.positions[a+1];if((0,v.webMercatorTile2TargetWorld)(t,this.m_decodeInfo,d,T,R),l.push(T.x,T.y,T.z),(0,v.webMercatorTile2TargetWorld)(t,this.m_decodeInfo,f,L,R),l.push(L.x,L.y,L.z),E&&(E(d,t).toArray(c,c.length),E(f,t).toArray(c,c.length)),P){let e=this.findRelativePositionInLine(T,n)/i;u.push(e),e=this.findRelativePositionInLine(L,n)/i,u.push(e)}else{u.push(s);const e=T.distanceTo(L);r+=e,s+=e,u.push(s)}T.sub(this.m_decodeInfo.center),o.push(T.x,T.y,T.z),L.sub(this.m_decodeInfo.center),o.push(L.x,L.y,L.z),b.push(o),h.push(l),p.push(c),y.push(u)}}if(!P&&r>0)for(const e of y)e.forEach(((t,n)=>{e[n]=t/r}))}if(O){const r=[],o=[],s=[],a=[];e.positions.forEach((e=>{if((0,v.webMercatorTile2TargetWorld)(t,this.m_decodeInfo,e,T,R),o.push(T.x,T.y,T.z),E&&E(e,t).toArray(s,s.length),P){const e=this.findRelativePositionInLine(T,n)/i;a.push(e)}T.sub(this.m_decodeInfo.center),r.push(T.x,T.y,T.z)})),u.push(r),h.push(o),p.push(s),y.push(a)}}const I=this.m_decodeInfo.tileKey.level>=11;for(const e of a){if(void 0===e)continue;const t=e._index,n=e.name;if((0,f.isLineTechnique)(e)||(0,f.isSolidLineTechnique)(e)){const n=(0,f.isLineTechnique)(e)?this.m_simpleLines:this.m_solidLines,r=(0,f.isLineTechnique)(e)?k.Simple:k.Complex;D&&((0,m.assert)(void 0!==b,\"OmvDecodedTileEmitter#processLineFeature: Internal error - No localLineSegments\"),this.applyLineTechnique(n,e,t,r,c.entries,b,i,this.getTextureCoordinateType(e)?p:void 0,y)),u.length>0&&this.applyLineTechnique(n,e,t,r,c.entries,u,i,this.getTextureCoordinateType(e)?p:void 0,P?y:void 0)}else if((0,f.isTextTechnique)(e)||(0,f.isIconTextTechnique)(e)||(0,f.isLineMarkerTechnique)(e)){const n=e,a=(0,o.getFeatureText)(i,n,this.m_options.languages);if(void 0===a&&!(0,f.isIconTextTechnique)(e)&&!(0,f.isLineMarkerTechnique)(e))continue;if((0,f.isTextTechnique)(e)){let e=[];
947if(this.m_options.skipShortLabels){const t=S/this.m_decodeInfo.tileSizeOnScreen,n=5*String(a).length*t*.5,i=n*n;e=this.splitJaggyLines(h,i,z)}else e=h;if(0===e.length)continue;for(const n of e){const e=m.Math2D.computeSquaredLineLength(n);this.m_textPathGeometries.push({technique:t,path:n,pathLengthSqr:e,text:String(a),objInfos:this.m_options.gatherFeatureAttributes?c.entries:(0,o.getFeatureId)(c.entries)})}}else{const n=e,u=(0,s.evaluateTechniqueAttr)(i,n.imageTexture),d=Math.max(Number.EPSILON,null!==(l=(0,s.evaluateTechniqueAttr)(i,n[\"anchor-point-density\"]))&&void 0!==l?l:20),p=this.m_decodeInfo.projectedBoundingBox.extents,f=2*Math.min(p.x,p.y)/d,m=new r.BufferAttribute(new Float64Array,3);for(const e of h)m.array=e,m.count=e.length/m.itemSize,this.m_iconTextGeometries.push({technique:t,positions:{name:\"position\",type:\"float\",buffer:(0,g.computeLineAnchorPoints)(m,f),itemCount:m.itemSize},texts:[0],stringCatalog:[a,u],imageTextures:[1],objInfos:this.m_options.gatherFeatureAttributes?[c.entries]:[(0,o.getFeatureId)(c.entries)]})}}else if((0,f.isLabelRejectionLineTechnique)(e))for(const e of h){const t=[];for(let n=0;n<e.length;n+=3)t.push((new r.Vector3).fromArray(e,n));this.m_pathGeometries.push({path:t})}else if((0,f.isExtrudedLineTechnique)(e)){const n=this.findOrCreateMeshBuffers(t,o.GeometryType.ExtrudedLine);if(void 0===n)continue;const{positions:r,indices:a,groups:l,featureStarts:h,objInfos:p}=n,f=a.length,m=(0,s.evaluateTechniqueAttr)(i,e.width);if(void 0===m)continue;const g=(0,s.evaluateTechniqueAttr)(i,e.cap,\"Circle\"),v=I&&\"Circle\"===g;u.forEach((e=>{(0,d.triangulateLine)(e,m,r,a,v),h.push(f),p.push(this.m_options.gatherFeatureAttributes?c.entries:(0,o.getFeatureId)(c.entries))}));const y=a.length-f;l.push({start:f,count:y,technique:t})}else x.warn(`OmvDecodedTileEmitter#processLineFeature: Invalid line technique\\n ${n} for layer: ${c.entries.$layer} `)}}processPolygonFeature(e,t,n,i,o){const s=i.env;this.processFeatureCommon(s);const l=!1;o.forEach((e=>{if(void 0===e)return;const o=e._index;if(void 0===o)throw new Error(\"OmvDecodedTileEmitter#processPolygonFeature: Internal error - No technique index\");let c;const h=s.lookup(\"bbox\");if(Array.isArray(h)){const[e,t,n,i]=h,o=new u.GeoBox(new u.GeoCoordinates(t,e),new u.GeoCoordinates(i,n));c=new r.Box3,u.webMercatorProjection.projectBox(o,c)}const d=[],p=(0,f.isExtrudedPolygonTechnique)(e),m=(0,f.isPolygonTechnique)(e),g=(0,f.isStandardTechnique)(e),x=p||m||g,_=this.getComputeTexCoordsFunc(e,c),b=x&&!p;for(const e of n){const n=[];for(let i=0;i<e.rings.length;i++){const o=0===i;let s=e.rings[i];b&&s.some((e=>e.x<0||e.x>t||e.y<0||e.y>t))&&(s=(0,a.clipPolygon)(s,t));const l=r.ShapeUtils.area(s);if(o&&0===l)break;if(0!==l){let e;void 0!==_&&(e=s.map((e=>_(e,t)))),n.push(new y.Ring(s,e,t,b))}}n.length>0&&d.push(n)}const w=(0,f.isSolidLineTechnique)(e)||(0,f.isLineTechnique)(e);if(x)this.applyPolygonTechnique(d,e,o,i,t);else if(w){const n=\"line\"===e.name?this.m_simpleLines:this.m_solidLines,r=\"line\"===e.name?k.Simple:k.Complex,a=(0,f.isSpecialDashesLineTechnique)(e);d.forEach((c=>{const u=[],h=a?[]:void 0;c.forEach((e=>{const n=e.points.length;let i=[],r=0,o=0,s=a?[]:void 0;for(let c=0;c<n;++c){a&&i.length>0&&(i=[],s=[]);const d=(c+1)%n,p=e.points[c],f=e.points[d],m=e.isProperEdge(c);if(m||0===i.length){if(m&&0===i.length&&((0,v.webMercatorTile2TargetTile)(t,this.m_decodeInfo,S.copy(p),T,l),i.push(T.x,T.y,T.z),a)){(0,v.webMercatorTile2TargetTile)(t,this.m_decodeInfo,S.copy(f),L,l),i.push(L.x,L.y,L.z),s.push(o);const e=T.distanceTo(L);r+=e,o+=e,s.push(o)}}else u.push(i),i=[];m&&!a&&((0,v.webMercatorTile2TargetTile)(t,this.m_decodeInfo,S.copy(f),T,l),i.push(T.x,T.y,T.z)),a&&i.length>0&&r>0&&(s.forEach(((e,t)=>{s[t]=e/r})),u.push(i),h.push(s))}!a&&i.length>0&&u.push(i)})),0!==u.length&&this.applyLineTechnique(n,e,o,r,s.entries,u,i,void 0,h)}))}}))}getDecodedTile(){this.createGeometries(),this.processSimpleLines(this.m_simpleLines),this.processLines(this.m_solidLines);const e={techniques:this.m_styleSetEvaluator.decodedTechniques,geometries:this.m_geometries,decodeTime:void 0};return this.m_textGeometries.length>0&&(e.textGeometries=this.m_textGeometries),this.m_iconTextGeometries.length>0&&(e.iconTextGeometries=this.m_iconTextGeometries),this.m_textPathGeometries.length>0&&(e.textPathGeometries=this.m_textPathGeometries),this.m_pathGeometries.length>0&&(e.pathGeometries=this.m_pathGeometries),0!==this.m_sources.length&&(e.copyrightHolderIds=this.m_sources),e.maxGeometryHeight=this.m_maxGeometryHeight,e.minGeometryHeight=this.m_minGeometryHeight,e}splitJaggyLines(e,t,n){const i=[],r=(e,t,n)=>{let i=Number.MAX_SAFE_INTEGER,r=Number.MIN_SAFE_INTEGER,o=Number.MAX_SAFE_INTEGER,s=Number.MIN_SAFE_INTEGER;for(let a=t;a<n;a+=3){const t=e[a],n=e[a+1];t<i&&(i=t),t>r&&(r=t),n<o&&(o=n),n>s&&(s=n)}return(r-i)*(r-i)+(s-o)*(s-o)},o=e.slice();for(;o.length>0;){const e=o.pop();if(void 0===e||e.length<6)continue;let s=-1;for(let t=0;t<e.length-3;t+=3){C.set(e[t],e[t+1]),P.set(e[t+3],e[t+4]);const i=P.sub(C).normalize();if(t>0){const e=Math.atan2(R.x*i.y-i.x*R.y,i.dot(R));if(Math.abs(e)>n){s=t;break}}R.set(i.x,i.y)}if(s>0){const n=r(e,0,s+3),a=r(e,s,e.length);n>t&&i.push(e.slice(0,s+3)),a>t&&o.push(e.slice(s))}else r(e,0,e.length)>t&&i.push(e)}return i}getTextureCoordinateType(e){return((0,f.isPolygonTechnique)(e)||(0,f.isSolidLineTechnique)(e)||(0,f.isExtrudedPolygonTechnique)(e))&&this.m_options.enableElevationOverlay?f.TextureCoordinateType.TileSpace:(0,f.textureCoordinateType)(e)}getComputeTexCoordsFunc(e,t){switch(this.getTextureCoordinateType(e)){case f.TextureCoordinateType.TileSpace:return(e,t)=>{const n=e.clone().divideScalar(t);return n.y=1-n.y,n};case f.TextureCoordinateType.EquirectangularSpace:return(e,t)=>{const n=(0,v.tile2world)(t,this.m_decodeInfo,e,!1,A),i=u.normalizedEquirectangularProjection.reprojectPoint(u.webMercatorProjection,n);return new r.Vector2(i.x,i.y)};case f.TextureCoordinateType.FeatureSpace:if(!t)return;return(e,n)=>{const i=(0,v.tile2world)(n,this.m_decodeInfo,e,!1,A),o=new r.Vector2(i.x,i.y);return t&&(o.x-=t.min.x,o.y-=t.min.y,o.x/=t.max.x-t.min.x,o.y/=t.max.y-t.min.y),o.y=1-o.y,o};default:return}}applyLineTechnique(e,t,n,i=k.Complex,r,s,a,l,c){let u;const d=e.find((e=>e.technique===n)),p=void 0!==l;if(void 0===d){u=new h.LineGroup(p,void 0,i===k.Simple);const t={type:i===k.Complex?o.GeometryType.SolidLine:o.GeometryType.Line,technique:n,lines:u};this.m_options.gatherFeatureAttributes&&(t.objInfos=[r],t.featureStarts=[0]),e.push(t)}else u=d.lines,this.m_options.gatherFeatureAttributes&&d.objInfos&&d.featureStarts&&(d.objInfos.push(r),d.featureStarts.push(u.indices.length));let f=0;
947s.forEach((e=>{u.add(this.m_decodeInfo.center,e,this.projection,c?c[f]:void 0,l?l[f]:void 0),f++}))}applyPolygonTechnique(e,t,n,a,h){var d,g;if(0===e.length)return;const y=(0,f.isExtrudedPolygonTechnique)(t),L=y?o.GeometryType.ExtrudedPolygon:o.GeometryType.Polygon,C=this.findOrCreateMeshBuffers(n,L);if(void 0===C)return;const P=t,R=t,D=!0===P.boundaryWalls,O=(0,f.isPolygonTechnique)(t),I=this.getTextureCoordinateType(t);let F=(0,s.evaluateTechniqueAttr)(a,P.height),N=(0,s.evaluateTechniqueAttr)(a,P.floorHeight);if(void 0===F){const e=a.env.lookup(\"height\"),t=(0,s.evaluateTechniqueAttr)(a,P.defaultHeight);F=void 0!==e?e:void 0!==t?t:0}if(void 0===N){const e=a.env.lookup(\"min_height\");N=void 0===e||O?0:e}F=Math.max(N+p.ExtrusionFeatureDefs.MIN_BUILDING_HEIGHT,F);const U=this.m_decodeInfo.tileKey.level,z=y&&(0,o.scaleHeight)(a,P,U);this.m_decodeInfo.tileBounds.getCenter(_);const{positions:G,normals:k,textureCoordinates:H,colors:j,extrusionAxis:W,indices:q,edgeIndices:X,groups:Y}=C,J=this.m_decodeInfo.targetProjection.type===u.ProjectionType.Spherical,Z=y?null!==(d=P.lineWidth)&&void 0!==d?d:0:O&&null!==(g=R.lineWidth)&&void 0!==g?g:0,$=\"number\"!=typeof Z||Z>0;let K;if((0,f.isExtrudedPolygonTechnique)(t)&&(0,m.getOptionValue)(t.vertexColors,!1)){let e=(0,s.evaluateTechniqueAttr)(a,t.color);if(void 0===e){const t=a.env.lookup(\"color\");this.isColorStringValid(t)&&(e=String(t))}void 0===e&&(e=(0,s.evaluateTechniqueAttr)(a,t.defaultColor,0)),void 0===e&&(e=0),V.set(e),K=V}for(const t of e){const e=q.length,o=X.length,s=[],d=G.length/3,p=t[0],f=p.vertexStride,m=f+2;for(let e=0;e<p.points.length;++e){const t=p.points[e];s.push(t.x,-t.y),void 0!==p.textureCoords&&s.push(p.textureCoords[e].x,p.textureCoords[e].y);const n=(e+1)%p.points.length,i=p.isProperEdge(e);s.push(i?n:-1,D||i?n:-1)}const g=[];let _=1;for(;_<t.length;){const e=s.length/m;g.push(e);const n=t[_++];for(let t=0;t<n.points.length;++t){const i=(t+1)%n.points.length,r=n.points[t];s.push(r.x,-r.y),void 0!==n.textureCoords&&s.push(n.textureCoords[t].x,n.textureCoords[t].y);const o=n.isProperEdge(t);s.push(o?e+i:-1,D||o?e+i:-1)}}try{const e=(0,i.default)(s,g,m),t=s.length/m;if(J){const t=new r.BufferGeometry,n=[],i=[],o=[],a=[];for(let e=0;e<s.length;e+=m){const t=(0,v.tile2world)(h,this.m_decodeInfo,S.set(s[e],s[e+1]),!0,A);n.push(t.x,t.y,0),void 0!==I&&i.push(s[e+2],s[e+3]),o.push(s[e+f]),a.push(s[e+f+1])}const d=new r.BufferAttribute(new Float32Array(n),3);let p;t.setAttribute(\"position\",d),void 0!==I&&(p=new r.BufferAttribute(new Float32Array(i),2),t.setAttribute(\"uv\",p));const g=new r.BufferAttribute(new Float32Array(o),1);t.setAttribute(\"edge\",g);const y=new r.BufferAttribute(new Float32Array(a),1);t.setAttribute(\"wall\",g);const x=B(e,d.count-1),_=\"uint32\"===x.type?new r.Uint32BufferAttribute(x.buffer,1):new r.Uint16BufferAttribute(x.buffer,1);t.setIndex(_);const b=this.m_decodeInfo.tileKey.level;if(b>=3&&b<9){const e=Math.pow(2,9-b),{geoBox:n}=this.m_decodeInfo;new l.EdgeLengthGeometrySubdivisionModifier(e,n,l.SubdivisionMode.NoDiagonals,u.webMercatorProjection).modify(t)}new c.SphericalGeometrySubdivisionModifier(r.MathUtils.degToRad(10),u.webMercatorProjection).modify(t),s.length=0,e.length=0;for(let e=0;e<d.array.length;e+=3){const t=(0,v.world2tile)(h,this.m_decodeInfo,T.set(d.array[e],d.array[e+1],0),!0,E);s.push(t.x,t.y),void 0!==I&&(s.push(p.array[e/3*2]),s.push(p.array[e/3*2+1])),s.push(g.array[e/3]),s.push(y.array[e/3])}const w=t.getIndex();null!==w&&e.push(...w.array)}b.set(0,0,1);for(let e=0;e<s.length;e+=m){(0,v.webMercatorTile2TargetWorld)(h,this.m_decodeInfo,S.set(s[e],s[e+1]),T,!1,!0);const t=z?this.m_decodeInfo.targetProjection.getScaleFactor(T):1;this.m_maxGeometryHeight=Math.max(this.m_maxGeometryHeight,t*F),this.m_minGeometryHeight=Math.min(this.m_minGeometryHeight,t*F),J&&b.set(T.x,T.y,T.z).normalize(),T.sub(this.center),w.copy(b).multiplyScalar(N*t),G.push(T.x+w.x,T.y+w.y,T.z+w.z),void 0!==I&&H.push(s[e+2],s[e+3]),this.m_options.enableElevationOverlay&&k.push(...b.toArray()),y&&(M.copy(b).multiplyScalar(F*t),G.push(T.x+M.x,T.y+M.y,T.z+M.z),W.push(0,0,0,0,M.x-w.x,M.y-w.y,M.z-w.z,1),void 0!==I&&H.push(s[e+2],s[e+3]),this.m_options.enableElevationOverlay&&k.push(...b.toArray()),void 0!==K&&j.push(K.r,K.g,K.b,K.r,K.g,K.b))}for(let t=0;t<e.length;t+=3)if(y){const n=d+2*e[t+0]+1,i=d+2*e[t+1]+1,r=d+2*e[t+2]+1;q.push(n,i,r)}else{const n=d+e[t+0],i=d+e[t+1],r=d+e[t+2];q.push(n,i,r)}$&&this.addEdges(d,t,m,f,G,s,X,y,P.footprint,P.maxSlope),y&&this.addWalls(d,t,m,f,s,q)}catch(e){x.error(\"cannot triangulate geometry\",e)}this.m_options.gatherFeatureAttributes&&(C.objInfos.push(a.env.entries),C.featureStarts.push(e),C.edgeFeatureStarts.push(o));const L=q.length-e;L>0&&Y.push({start:e,count:L,technique:n})}}
947createGeometries(){this.m_meshBuffers.forEach(((e,t)=>{if(0===e.positions.length)return;if(!this.m_styleSetEvaluator.techniques||this.m_styleSetEvaluator.techniques.length<=t)throw new Error(\"Invalid technique index\");const n=this.m_styleSetEvaluator.techniques[t];if(void 0===n)return;if(e.texts.length>0){const i={positions:{name:\"position\",type:\"float\",buffer:new Float64Array(e.positions).buffer,itemCount:3},texts:e.texts,technique:t,stringCatalog:e.stringCatalog,objInfos:e.objInfos};if((0,f.isTextTechnique)(n))this.m_textGeometries.push(i);else{(0,m.assert)((0,f.isIconTextTechnique)(n));const t=i;t.imageTextures=e.imageTextures,t.textBackgroundImageTextures=e.textBackgroundImageTextures,t.offsetDirections=e.offsetDirections,this.m_iconTextGeometries.push(t)}return}const i=new Float32Array(e.positions);0===e.groups.length&&e.groups.push({start:0,count:i.length/3,technique:t});const r=[{name:\"position\",buffer:i.buffer,itemCount:3,type:\"float\"}],o={type:e.type,vertexAttributes:r,groups:e.groups};if(e.normals.length>0){const t=new Float32Array(e.normals);(0,m.assert)(t.length===i.length,\"length of normals buffer is different than the length of the position buffer\"),r.push({name:\"normal\",buffer:t.buffer,itemCount:3,type:\"float\"})}if(e.colors.length>0){const t=new Float32Array(e.colors);(0,m.assert)(t.length===i.length,\"length of colors buffer is different than the length of the position buffer\"),r.push({name:\"color\",buffer:t.buffer,itemCount:3,type:\"float\"})}const s=e.positions.length/3;if(e.textureCoordinates.length>0){const t=e.textureCoordinates.length/2;(0,m.assert)(t===s,\"length of textureCoordinates buffer is different than the length of theposition buffer\");const n=new Float32Array(e.textureCoordinates);r.push({name:\"uv\",buffer:n.buffer,itemCount:2,type:\"float\"})}if(e.extrusionAxis.length>0){const t=new Float32Array(e.extrusionAxis);(0,m.assert)(t.length/4==i.length/3,\"length of extrusionAxis buffer is different than the length of the position buffer\"),r.push({name:\"extrusionAxis\",buffer:t.buffer,itemCount:4,type:\"float\"})}e.indices.length>0&&(o.index=B(e.indices,s-1)),e.edgeIndices.length>0&&(o.edgeIndex=B(e.edgeIndices,s-1,\"edgeIndex\")),o.featureStarts=e.featureStarts,o.edgeFeatureStarts=e.edgeFeatureStarts,o.objInfos=e.objInfos,this.m_geometries.push(o)}))}processLines(e){e.forEach((e=>{const{vertices:t,indices:n}=e.lines,i=e.technique,r=new Float32Array(t).buffer,s=B(n,t.length/e.lines.stride-1),a={type:\"float\",stride:e.lines.stride,buffer:r,attributes:e.lines.vertexAttributes},l={type:o.GeometryType.SolidLine,index:s,interleavedVertexAttributes:[a],groups:[{start:0,count:n.length,technique:i}],vertexAttributes:[],featureStarts:e.featureStarts,objInfos:e.objInfos};this.m_geometries.push(l)}))}processSimpleLines(e){e.forEach((e=>{const{vertices:t,indices:n}=e.lines,i=e.technique,r={buffer:new Float32Array(t).buffer,itemCount:3,type:\"float\",name:\"position\"},s={type:o.GeometryType.Line,index:B(n,t.length/r.itemCount-1),vertexAttributes:[r],groups:[{start:0,count:n.length,technique:i}],featureStarts:e.featureStarts,objInfos:e.objInfos};this.m_geometries.push(s)}))}findOrCreateMeshBuffers(e,t){let n=this.m_meshBuffers.get(e);return void 0!==n?n.type!==t?void x.error(`MeshBuffer has been created with wrong type \"${o.GeometryType[t]}\"\\n instead of \"${o.GeometryType[n.type]}\"`):n:(n=new G(t),this.m_meshBuffers.set(e,n),n)}processFeatureCommon(e){const t=e.lookup(\"source\");\"string\"==typeof t&&\"\"!==t&&(this.m_sources.includes(t)||this.m_sources.push(t))}isColorStringValid(e){return\"string\"==typeof e&&e.length>0}addEdges(e,t,n,i,o,s,a,l,c,u){const h=new r.Vector3,d=new r.Vector3;let p,f,m=0,g=0;for(;m<t;){for(;m!==p;){void 0===p&&(p=m),m<t&&(g=Math.max(g,m));const r=s[m*n+i];if(r<0)break;if(l)if(!0===c&&a.push(e+2*m,e+2*r),a.push(e+2*m+1,e+2*r+1),void 0!==u){if(void 0!==f){const t=3*(e+2*f),n=3*(e+2*m),i=3*(e+2*r);h.set(o[n]-o[t],o[n+1]-o[t+1],o[n+2]-o[t+2]).normalize(),d.set(o[i]-o[n],o[i+1]-o[n+1],o[i+2]-o[n+2]).normalize(),h.dot(d)<=u&&a.push(e+2*m,e+2*m+1)}}else a.push(e+2*m,e+2*m+1);else a.push(e+m,e+r);f=m,m=r}m=g+1,p=void 0,f=void 0}}
947addWalls(e,t,n,i,r,o){let s,a=0,l=0;for(;a<t;){for(;a!==s;){void 0===s&&(s=a),a<t&&(l=Math.max(l,a));const c=r[a*n+i+1];if(c<0)break;o.push(e+2*a,e+2*a+1,e+2*c+1,e+2*c+1,e+2*c,e+2*a),a=c}a=l+1,s=void 0}}findRelativePositionInLine(e,t){let n=1/0,i=0;for(let r=0;r<t.length;r+=4){U.set(D.set(t[r],t[r+1],t[r+2]),O.set(t[r+4],t[r+5],t[r+6])),U.closestPointToPoint(e,!0,I);const o=I.distanceTo(e);o<n&&(F.copy(I),N.copy(D),n=o,i=t[r+3])}return i+F.distanceTo(N)}}},1503:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.VectorTileDecoderService=t.VectorTileDecoder=t.VectorTileDataProcessor=void 0;const i=n(7769),r=n(2626),o=n(4342),s=n(5156),a=n(2926),l=n(4585),c=n(9252),u=n(9959),h=n(1140),d=o.LoggerManager.instance.create(\"VectorTileDecoder\",{enabled:!1});class p{constructor(e,t,n,i,r={}){var o,s;this.m_tileKey=e,this.m_projection=t,this.m_styleSetEvaluator=n,this.m_dataAdapter=i,this.m_options=r,r.storageLevelOffset=null!==(o=r.storageLevelOffset)&&void 0!==o?o:0,r.showMissingTechniques=null!==(s=r.showMissingTechniques)&&void 0!==s&&s}getDecodedTile(e){this.m_styleSetEvaluator.resetTechniques();const t=new c.DecodeInfo(this.m_projection,this.m_tileKey,this.m_options.storageLevelOffset);return this.m_decodedTileEmitter=new h.VectorTileDataEmitter(t,this.m_styleSetEvaluator,this.m_options),this.m_dataAdapter.process(e,t,this),this.m_decodedTileEmitter.getDecodedTile()}processPointFeature(e,t,n,i,r){(0,o.assert)(void 0!==this.m_decodedTileEmitter),this.processFeature(e,t,n,\"point\",i,r,this.m_decodedTileEmitter.processPointFeature)}processLineFeature(e,t,n,i,r){(0,o.assert)(void 0!==this.m_decodedTileEmitter),this.processFeature(e,t,n,\"line\",i,r,this.m_decodedTileEmitter.processLineFeature)}processPolygonFeature(e,t,n,i,r){(0,o.assert)(void 0!==this.m_decodedTileEmitter),this.processFeature(e,t,n,\"polygon\",i,r,this.m_decodedTileEmitter.processPolygonFeature)}processFeature(e,t,n,i,r,o,s){const a=this.createMapEnv(r,o,e,i),l=this.m_styleSetEvaluator.getMatchingTechniques(a,e,i);if(0===l.length)return void(this.m_options.showMissingTechniques&&d.log(\"VectorTileDataProcessor#processFeature: no techniques for object:\",JSON.stringify(a.unmap())));const c={env:a,cachedExprResults:new Map};this.m_decodedTileEmitter&&s.apply(this.m_decodedTileEmitter,[e,t,n,c,l])}createMapEnv(e,t,n,r){const o=this.m_tileKey.level;return new i.MapEnv(Object.assign(Object.assign({$layer:n,$id:null!=t?t:null,$level:o,$zoom:Math.max(0,o-this.m_options.storageLevelOffset),$geometryType:r},this.getLocalizedNames(e)),e))}getLocalizedNames(e){var t,n;const[i,r]=null!==(n=null===(t=this.m_options.languages)||void 0===t?void 0:t.map((t=>e[`name:${t}`])))&&void 0!==n?n:[];return{\"$localized-name\":null!=i?i:e.name,\"$secondary-localized-name\":r}}}t.VectorTileDataProcessor=p;class f extends r.ThemedTileDecoder{constructor(e){super(),this.m_dataAdapter=e,this.m_options={map:{},changed:!1},this.m_defaultDataAdapters=[],this.m_defaultDataAdapters.push(new l.OmvDataAdapter,new a.GeoJsonVtDataAdapter,new s.GeoJsonDataAdapter)}connect(){return Promise.resolve()}decodeThemedTile(e,t,n,i){const r=o.PerformanceTimer.now();if(!this.m_dataAdapter&&(this.m_dataAdapter=this.findDefaultDataAdapter(e),!this.m_dataAdapter))return Promise.reject(new Error(\"Unsupported data format.\"));const s=this.m_dataAdapter;if((0,o.assert)(s.canProcess(e)),this.m_options.changed){if(s instanceof l.OmvDataAdapter){const e=this.m_options.map;s.configure(e)}this.m_options.changed=!1}const a=new p(t,i,n,s,this.m_options.map).getDecodedTile(e);return a.decodeTime=o.PerformanceTimer.now()-r,Promise.resolve(a)}configure(e,t){super.configure(e,t),this.m_options.map=Object.assign(Object.assign(Object.assign({},this.m_options.map),e),t),this.m_options.changed=!0}findDefaultDataAdapter(e){for(const t of this.m_defaultDataAdapters)if(t.canProcess(e))return t}}t.VectorTileDecoder=f,t.VectorTileDecoderService=class{static start(){r.WorkerServiceManager.getInstance().register({serviceType:u.VECTOR_TILE_DECODER_SERVICE_TYPE,factory:e=>r.TileDecoderService.start(e,new f)})}}},2926:(e,t,n)=>{\"use strict\";
947Object.defineProperty(t,\"__esModule\",{value:!0}),t.GeoJsonVtDataAdapter=void 0;const i=n(82),r=n(2616),o=n(6441),s=4096;var a;!function(e){e[e.Unknown=0]=\"Unknown\",e[e.Point=1]=\"Point\",e[e.LineString=2]=\"LineString\",e[e.Polygon=3]=\"Polygon\"}(a||(a={}));const l=new i.Vector3;t.GeoJsonVtDataAdapter=class{canProcess(e){if((0,o.isArrayBufferLike)(e))return!1;const t=e;return void 0!==t.features&&void 0!==t.source&&void 0!==t.x&&void 0!==t.y&&void 0!==t.z}process(e,t,n){for(const c of e.features)switch(c.type){case a.Point:for(const t of c.geometry){const r=t[0],o=t[1],a=new i.Vector3(r,o,0);n.processPointFeature(e.layer,s,[a],c.tags,c.id)}break;case a.LineString:{const a=c.geometry;let u;const h=[];a.forEach((e=>{const t=null==u?void 0:u.positions[u.positions.length-1],[n,r]=e[0];if((null==t?void 0:t.x)===n&&(null==t?void 0:t.y)===r)for(let t=1;t<e.length;++t){const[n,r]=e[t];null==u||u.positions.push(new i.Vector2(n,r))}else{const t=e.map((([e,t])=>new i.Vector2(e,t)));h.push({positions:t}),u=h[h.length-1]}})),h.forEach((e=>{e.untiledPositions=e.positions.map((e=>((0,o.tile2world)(s,t,e,!1,l),r.webMercatorProjection.unprojectPoint(l))))})),n.processLineFeature(e.layer,s,h,c.tags,c.id);break}case a.Polygon:{const t=[];let r;for(const e of c.geometry){const n=[];for(const[t,r]of e){const e=new i.Vector2(t,r);n.push(e)}i.ShapeUtils.area(n)>0&&(r={rings:[]},t.push(r)),null==r||r.rings.push(n)}n.processPolygonFeature(e.layer,s,t,c.tags,c.id);break}case a.Unknown:}}}},5156:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.GeoJsonDataAdapter=void 0;const i=n(82),r=n(6112),o=n(2616),s=n(6441),a=4096,l=new i.Vector3;function c(e,t,n){return o.webMercatorProjection.projectPoint(o.GeoCoordinates.fromGeoPoint(e),l),(0,s.world2tile)(a,t,l,!1,n)}function u(e,t){return{untiledPositions:e.map((e=>o.GeoCoordinates.fromGeoPoint(e))),positions:e.map((e=>c(e,t,new i.Vector2)))}}function h(e,t){return\"LineString\"===e.type?[u(e.coordinates,t)]:e.coordinates.map((e=>u(e,t)))}function d(e,t){return{rings:e.map(((e,n)=>{const r=0===n,{positions:o}=u(e,t),s=i.ShapeUtils.area(o)>0;return(r&&!s||!r&&s)&&o.reverse(),o}))}}function p(e,t){return\"Polygon\"===e.type?[d(e.coordinates,t)]:e.coordinates.map((e=>d(e,t)))}function f(e,t){return\"Point\"===e.type?[c(e.coordinates,t,new i.Vector3)]:e.coordinates.map((e=>c(e,t,new i.Vector3)))}t.GeoJsonDataAdapter=class{canProcess(e){return e&&\"FeatureCollection\"===e.type&&Array.isArray(e.features)}process(e,t,n,i=\"geojson\"){if(Array.isArray(e.features)&&0!==e.features.length)for(const o of e.features)switch(o.geometry.type){case\"LineString\":case\"MultiLineString\":{let e=h(o.geometry,t);const s=[],l=100;e.forEach((e=>{(0,r.clipLineString)(e.positions,-l,-l,a+l,a+l).forEach((e=>{s.push({positions:e})}))})),e=s,e.length>0&&n.processLineFeature(i,a,s,o.properties,o.id);break}case\"Polygon\":case\"MultiPolygon\":{const e=p(o.geometry,t);n.processPolygonFeature(i,a,e,o.properties,o.id);break}case\"Point\":case\"MultiPoint\":{const e=f(o.geometry,t);n.processPointFeature(i,a,e,o.properties,o.id);break}}}}},9607:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.GeometryCommands=t.FeatureAttributes=t.visitOmvLayer=t.visitOmv=t.isClosePathCommand=t.isLineToCommand=t.isMoveToCommand=t.CommandKind=void 0;const i=n(82),r=n(3577);var o;function s(e,t){if((!t.visitLayer||t.visitLayer(e))&&e.features)for(const n of e.features)switch(n.type){case r.com.mapbox.pb.Tile.GeomType.UNKNOWN:break;case r.com.mapbox.pb.Tile.GeomType.POINT:t.visitPointFeature&&t.visitPointFeature(n);break;case r.com.mapbox.pb.Tile.GeomType.LINESTRING:t.visitLineFeature&&t.visitLineFeature(n);break;case r.com.mapbox.pb.Tile.GeomType.POLYGON:t.visitPolygonFeature&&t.visitPolygonFeature(n)}t.endVisitLayer&&t.endVisitLayer(e)}!function(e){e[e.MoveTo=1]=\"MoveTo\",e[e.LineTo=2]=\"LineTo\",e[e.ClosePath=7]=\"ClosePath\"}(o=t.CommandKind||(t.CommandKind={})),t.isMoveToCommand=function(e){return e.kind===o.MoveTo},t.isLineToCommand=function(e){return e.kind===o.LineTo},t.isClosePathCommand=function(e){return e.kind===o.ClosePath}
947,t.visitOmv=function(e,t){if(e.layers)for(const n of e.layers)t.visitLayer&&!t.visitLayer(n)||s(n,t),t.endVisitLayer&&t.endVisitLayer(n)},t.visitOmvLayer=s,t.FeatureAttributes=class{accept(e,t,n){const{keys:i,values:r}=e,o=t.tags;if(o&&i&&r)for(let e=0;e<o.length;e+=2){const t=i[o[e]],s=r[o[e+1]];if(!n.visitAttribute(t,s))break}}},t.GeometryCommands=class{accept(e,t){if(!e)return;const n=e.length;let r=0,s=0;const a=[],l=[],c=[];for(let u=0;u<n;){const n=7&e[u],h=e[u]>>3;if(++u,n===o.MoveTo||n===o.LineTo)for(let o=0;o<h;++o){const o=e[u++],h=e[u++];r+=o>>1^-(1&o),s+=h>>1^-(1&h),\"Polygon\"===t.type&&(a.push(r),l.push(s));const d=new i.Vector2(r,s);c.push({kind:n,position:d})}else{for(const e of c)t.visitCommand(e);t.visitCommand({kind:n}),a.length=0,l.length=0,c.length=0}}if(c.length>0)for(const e of c)t.visitCommand(e)}}},4585:(e,t,n)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.OmvDataAdapter=t.asGeometryType=void 0;const i=n(5133),r=n(82),o=n(7769),s=n(4342),a=n(9959),l=n(7305),c=n(6441),u=n(9607),h=n(3577),d=[\"stringValue\",\"floatValue\",\"doubleValue\",\"intValue\",\"uintValue\",\"sintValue\",\"boolValue\"],p=s.LoggerManager.instance.create(\"OmvDataAdapter\",{enabled:!1}),f=i.fromNumber(Number.MAX_SAFE_INTEGER,!0),m=i.fromNumber(Number.MIN_SAFE_INTEGER,!1);function g(e,t,n){if(void 0!==t.id&&null!==t.id)return t.id;if(e.hasOwnProperty(\"id\")){const t=e.id;if(\"number\"==typeof t)return t;if(t)return void 0!==n&&t.greaterThan(Number.MAX_SAFE_INTEGER)&&n.error(\"Invalid ID: Larger than largest available Number in feature: \",e),t.toNumber()}}function v(e){if(void 0===e)return a.OmvGeometryType.UNKNOWN;switch(e.type){case h.com.mapbox.pb.Tile.GeomType.UNKNOWN:return a.OmvGeometryType.UNKNOWN;case h.com.mapbox.pb.Tile.GeomType.POINT:return a.OmvGeometryType.POINT;case h.com.mapbox.pb.Tile.GeomType.LINESTRING:return a.OmvGeometryType.LINESTRING;
947case h.com.mapbox.pb.Tile.GeomType.POLYGON:return a.OmvGeometryType.POLYGON;default:return a.OmvGeometryType.UNKNOWN}}function y(e,t){e.forEach((e=>{e.x===t-1&&(e.x=t)}))}t.asGeometryType=v,t.OmvDataAdapter=class{constructor(){this.m_geometryCommands=new u.GeometryCommands,this.m_roundUpCoordinatesIfNeeded=!1}configure(e){var t;const n=e.politicalView;this.m_dataFilter=void 0,this.m_featureModifiers=[new l.OmvPoliticalViewFeatureModifier(null!=n?n:\"\")],this.m_roundUpCoordinatesIfNeeded=null!==(t=e.roundUpCoordinatesIfNeeded)&&void 0!==t&&t}canProcess(e){return(0,c.isArrayBufferLike)(e)}process(e,t,n){const{tileKey:i}=t,r=new Uint8Array(e),o=h.com.mapbox.pb.Tile.decode(r);this.m_tileKey=i,this.m_processor=n,(0,u.visitOmv)(o,this)}visitLayer(e){this.m_layer=e;const t=this.m_tileKey.level,n=e.name;return!(void 0!==this.m_dataFilter&&!this.m_dataFilter.wantsLayer(n,t))}visitPointFeature(e){var t;if(void 0===e.geometry)return;const n=this.filterAndModifyFeature(e,\"doProcessPointFeature\",\"wantsPointFeature\");if(!n)return;const i=this.m_layer.name,o=null!==(t=this.m_layer.extent)&&void 0!==t?t:4096,s=[];this.m_geometryCommands.accept(e.geometry,{type:\"Point\",visitCommand:e=>{(0,u.isMoveToCommand)(e)&&s.push(new r.Vector3(e.position.x,e.position.y,0))}}),0!==s.length&&this.m_processor.processPointFeature(i,o,s,n,g(e,n,p))}visitLineFeature(e){var t;if(void 0===e.geometry)return;const n=this.filterAndModifyFeature(e,\"doProcessLineFeature\",\"wantsLineFeature\");if(!n)return;const i=this.m_layer.name,r=null!==(t=this.m_layer.extent)&&void 0!==t?t:4096,o=[];let s;this.m_geometryCommands.accept(e.geometry,{type:\"Line\",visitCommand:e=>{(0,u.isMoveToCommand)(e)?(s=[e.position],o.push({positions:s})):(0,u.isLineToCommand)(e)&&s.push(e.position)}}),0!==o.length&&(this.mustRoundUpCoordinates&&function(e,t){e.forEach((e=>y(e.positions,t)))}(o,r),this.m_processor.processLineFeature(i,r,o,n,g(e,n,p)))}visitPolygonFeature(e){var t;if(void 0===e.geometry)return;const n=this.filterAndModifyFeature(e,\"doProcessPolygonFeature\",\"wantsPolygonFeature\");if(!n)return;const i=this.m_layer.name,o=null!==(t=this.m_layer.extent)&&void 0!==t?t:4096,s=[];let a,l,c;this.m_geometryCommands.accept(e.geometry,{type:\"Polygon\",visitCommand:e=>{if((0,u.isMoveToCommand)(e))l=[e.position];else if((0,u.isLineToCommand)(e))l.push(e.position);else if((0,u.isClosePathCommand)(e)&&void 0!==l&&l.length>0){const e=Math.sign(r.ShapeUtils.area(l));void 0===c&&(c=e),e===c&&(a={rings:[]},s.push(a)),l.push(l[0].clone()),null==a||a.rings.push(l)}}}),0!==s.length&&(this.mustRoundUpCoordinates&&function(e,t){e.forEach((e=>e.rings.forEach((e=>y(e,t)))))}(s,o),function(e){const t=e[0];if(void 0!==t&&0!==t.rings.length&&!(r.ShapeUtils.area(t.rings[0])>0))for(const t of e)for(const e of t.rings)e.reverse()}(s),this.m_processor.processPolygonFeature(i,o,s,n,g(e,n,p)))}filterAndModifyFeature(e,t,n){const r=this.m_tileKey.level,s=this.m_layer.name,a=v(e);if(this.m_dataFilter&&!1===this.m_dataFilter[n](s,a,r))return;const l=function(e,t){const n=new u.FeatureAttributes,r={};return n.accept(e,t,{visitAttribute:(e,t)=>(r[e]=function(e){const t=Object.prototype.hasOwnProperty;for(const n of d)if(t.call(e,n)){const t=e[n];if(void 0===t)throw new Error(\"unpexted undefined value\");return i.isLong(t)?t.comp(f)>0||t.comp(m)<0?t.toString():t.toNumber():t}throw new Error(\"not happening\")}(t),!0)}),r}(this.m_layer,e),c=new o.MapEnv(l);return this.m_featureModifiers&&this.m_featureModifiers.find((e=>!e[t](s,c,this.m_tileKey.level)))?void 0:l}get mustRoundUpCoordinates(){return this.m_roundUpCoordinatesIfNeeded&&this.m_tileKey.level<5&&this.m_tileKey.column===this.m_tileKey.columnCount()-1}}}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.exports}__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.g=function(){if(\"object\"==typeof globalThis)return globalThis;try{return this||new Function(\"return this\")()}catch(e){if(\"object\"==typeof window)return window}
vendor: 16,082 bytes, lines 947-949
947}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})};var __webpack_exports__={};(()=>{\"use strict\";const e=__webpack_require__(1509);e.OmvTileDecoderService.start(),e.OmvTilerService.start()})()})();"; 948/*! For license information please see mapsjs-harp.js.LICENSE.txt */ 949(()=>{var __webpack_modules__={3577:(e,t,i)=>{"use strict";const n=i(5133);var r=i(5218),s=i(6918);s.util.Long=n,s.configure(),e.exports=r},5218:(e,t,i)=>{"use strict";var n,r,s,o=i(6918),a=o.Reader,l=o.util,c=o.roots.default||(o.roots.default={});c.com=((s={}).mapbox=((r={}).pb=((n={}).Tile=function(){function e(e){if(this.layers=[],e)for(var t=Object.keys(e),i=0;i<t.length;++i)null!=e[t[i]]&&(this[t[i]]=e[t[i]])}var t,i;return e.prototype.layers=l.emptyArray,e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var i=void 0===t?e.len:e.pos+t,n=new c.com.mapbox.pb.Tile;e.pos<i;){var r=e.uint32();r>>>3==3?(n.layers&&n.layers.length||(n.layers=[]),n.layers.push(c.com.mapbox.pb.Tile.Layer.decode(e,e.uint32()))):e.skipType(7&r)}return n},e.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},e.fromObject=function(e){if(e instanceof c.com.mapbox.pb.Tile)return e;var t=new c.com.mapbox.pb.Tile;if(e.layers){if(!Array.isArray(e.layers))throw TypeError(".com.mapbox.pb.Tile.layers: array expected");t.layers=[];for(var i=0;i<e.layers.length;++i){if("object"!=typeof e.layers[i])throw TypeError(".com.mapbox.pb.Tile.layers: object expected");t.layers[i]=c.com.mapbox.pb.Tile.Layer.fromObject(e.layers[i])}}return t},e.toObject=function(e,t){t||(t={});var i={};if((t.arrays||t.defaults)&&(i.layers=[]),e.layers&&e.layers.length){i.layers=[];for(var n=0;n<e.layers.length;++n)i.layers[n]=c.com.mapbox.pb.Tile.Layer.toObject(e.layers[n],t)}return i},e.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},e.GeomType=(t={},(i=Object.create(t))[t[0]="UNKNOWN"]=0,i[t[1]="POINT"]=1,i[t[2]="LINESTRING"]=2,i[t[3]="POLYGON"]=3,i),e.Value=function(){function e(e){if(e)for(var t=Object.keys(e),i=0;i<t.length;++i)null!=e[t[i]]&&(this[t[i]]=e[t[i]])}return e.prototype.stringValue="",e.prototype.floatValue=0,e.prototype.doubleValue=0,e.prototype.intValue=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.uintValue=l.Long?l.Long.fromBits(0,0,!0):0,e.prototype.sintValue=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.boolValue=!1,e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var i=void 0===t?e.len:e.pos+t,n=new c.com.mapbox.pb.Tile.Value;e.pos<i;){var r=e.uint32();switch(r>>>3){case 1:n.stringValue=e.string();break;case 2:n.floatValue=e.float();break;case 3:n.doubleValue=e.double();break;case 4:n.intValue=e.int64();break;case 5:n.uintValue=e.uint64();break;case 6:n.sintValue=e.sint64();break;case 7:n.boolValue=e.bool();break;default:e.skipType(7&r)}}return n},e.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},e.fromObject=function(e){if(e instanceof c.com.mapbox.pb.Tile.Value)return e;var t=new c.com.mapbox.pb.Tile.Value;return null!=e.stringValue&&(t.stringValue=String(e.stringValue)),null!=e.floatValue&&(t.floatValue=Number(e.floatValue)),null!=e.doubleValue&&(t.doubleValue=Number(e.doubleValue)),null!=e.intValue&&(l.Long?(t.intValue=l.Long.fromValue(e.intValue)).unsigned=!1:"string"==typeof e.intValue?t.intValue=parseInt(e.intValue,10):"number"==typeof e.intValue?t.intValue=e.intValue:"object"==typeof e.intValue&&(t.intValue=new l.LongBits(e.intValue.low>>>0,e.intValue.high>>>0).toNumber())),null!=e.uintValue&&(l.Long?(t.uintValue=l.Long.fromValue(e.uintValue)).unsigned=!0:"string"==typeof e.uintValue?t.uintValue=parseInt(e.uintValue,10):"number"==typeof e.uintValue?t.uintValue=e.uintValue:"object"==typeof e.uintValue&&(t.uintValue=new l.LongBits(e.uintValue.low>>>0,e.uintValue.high>>>0).toNumber(!0))),null!=e.sintValue&&(l.Long?(t.sintValue=l.Long.fromValue(e.sintValue)).unsigned=!1:"string"==typeof e.sintValue?t.sintValue=parseInt(e.sintValue,10):"number"==typeof e.sintValue?t.sintValue=e.sintValue:"object"==typeof e.sintValue&&(t.sintValue=new l.LongBits(e.sintValue.low>>>0,e.sintValue.high>>>0).toNumber())),null!=e.boolValue&&(t.boolValue=Boolean(e.boolValue)),t},e.toObject=function(e,t){t||(t={});var i={};if(t.defaults){if(i.stringValue="",i.floatValue=0,i.doubleValue=0,l.Long){var n=new l.Long(0,0,!1);i.intValue=t.longs===String?n.toString():t.longs===Number?n.toNumber():n}else i.intValue=t.longs===String?"0":0;l.Long?(n=new l.Long(0,0,!0),i.uintValue=t.longs===String?n.toString():t.longs===Number?n.toNumber():n):i.uintValue=t.longs===String?"0":0,l.Long?(n=new l.Long(0,0,!1),i.sintValue=t.longs===String?n.toString():t.longs===Number?n.toNumber():n):i.sintValue=t.longs===String?"0":0,i.boolValue=!1}return null!=e.stringValue&&e.hasOwnProperty("stringValue")&&(i.stringValue=e.stringValue),null!=e.floatValue&&e.hasOwnProperty("floatValue")&&(i.floatValue=t.json&&!isFinite(e.floatValue)?String(e.floatValue):e.floatValue),null!=e.doubleValue&&e.hasOwnProperty("doubleValue")&&(i.doubleValue=t.json&&!isFinite(e.doubleValue)?String(e.doubleValue):e.doubleValue),null!=e.intValue&&e.hasOwnProperty("intValue")&&("number"==typeof e.intValue?i.intValue=t.longs===String?String(e.intValue):e.intValue:i.intValue=t.longs===String?l.Long.prototype.toString.call(e.intValue):t.longs===Number?new l.LongBits(e.intValue.low>>>0,e.intValue.high>>>0).toNumber():e.intValue),null!=e.uintValue&&e.hasOwnProperty("uintValue")&&("number"==typeof e.uintValue?i.uintValue=t.longs===String?String(e.uintValue):e.uintValue:i.uintValue=t.longs===String?l.Long.prototype.toString.call(e.uintValue):t.longs===Number?new l.LongBits(e.uintValue.low>>>0,e.uintValue.high>>>0).toNumber(!0):e.uintValue),null!=e.sintValue&&e.hasOwnProperty("sintValue")&&("number"==typeof e.sintValue?i.sintValue=t.longs===String?String(e.sintValue):e.sintValue:i.sintValue=t.longs===String?l.Long.prototype.toString.call(e.sintValue):t.longs===Number?new l.LongBits(e.sintValue.low>>>0,e.sintValue.high>>>0).toNumber():e.sintValue),null!=e.boolValue&&e.hasOwnProperty("boolValue")&&(i.boolValue=e.boolValue),i},e.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},e}(),e.Feature=function(){function e(e){if(this.tags=[],this.geometry=[],e)for(var t=Object.keys(e),i=0;i<t.length;++i)null!=e[t[i]]&&(this[t[i]]=e[t[i]])}return e.prototype.id=l.Long?l.Long.fromBits(0,0,!0):0,e.prototype.tags=l.emptyArray,e.prototype.type=0,e.prototype.geometry=l.emptyArray,e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var i=void 0===t?e.len:e.pos+t,n=new c.com.mapbox.pb.Tile.Feature;e.pos<i;){var r=e.uint32();switch(r>>>3){case 1:n.id=e.uint64();break;case 2:if(n.tags&&n.tags.length||(n.tags=[]),2==(7&r))for(var s=e.uint32()+e.pos;e.pos<s;)n.tags.push(e.uint32());else n.tags.push(e.uint32());break;case 3:n.type=e.int32();break;case 4:if(n.geometry&&n.geometry.length||(n.geometry=[]),2==(7&r))for(s=e.uint32()+e.pos;e.pos<s;)n.geometry.push(e.uint32());else n.geometry.push(e.uint32());break;default:e.skipType(7&r)}}return n},e.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},e.fromObject=function(e){if(e instanceof c.com.mapbox.pb.Tile.Feature)return e;var t=new c.com.mapbox.pb.Tile.Feature;if(null!=e.id&&(l.Long?(t.id=l.Long.fromValue(e.id)).unsigned=!0:"string"==typeof e.id?t.id=parseInt(e.id,10):"number"==typeof e.id?t.id=e.id:"object"==typeof e.id&&(t.id=new l.LongBits(e.id.low>>>0,e.id.high>>>0).toNumber(!0))),e.tags){if(!Array.isArray(e.tags))throw TypeError(".com.mapbox.pb.Tile.Feature.tags: array expected");t.tags=[];for(var i=0;i<e.tags.length;++i)t.tags[i]=e.tags[i]>>>0}switch(e.type){case"UNKNOWN":case 0:t.type=0;break;case"POINT":case 1:t.type=1;break;case"LINESTRING":case 2:t.type=2;break;case"POLYGON":case 3:t.type=3}if(e.geometry){if(!Array.isArray(e.geometry))throw TypeError(".com.mapbox.pb.Tile.Feature.geometry: array expected");for(t.geometry=[],i=0;i<e.geometry.length;++i)t.geometry[i]=e.geometry[i]>>>0}return t},e.toObject=function(e,t){t||(t={});var i={};if((t.arrays||t.defaults)&&(i.tags=[],i.geometry=[]),t.defaults){if(l.Long){var n=new l.Long(0,0,!0);i.id=t.longs===String?n.toString():t.longs===Number?n.toNumber():n}else i.id=t.longs===String?"0":0;i.type=t.enums===String?"UNKNOWN":0}if(null!=e.id&&e.hasOwnProperty("id")&&("number"==typeof e.id?i.id=t.longs===String?String(e.id):e.id:i.id=t.longs===String?l.Long.prototype.toString.call(e.id):t.longs===Number?new l.LongBits(e.id.low>>>0,e.id.high>>>0).toNumber(!0):e.id),e.tags&&e.tags.length){i.tags=[];for(var r=0;r<e.tags.length;++r)i.tags[r]=e.tags[r]}if(null!=e.type&&e.hasOwnProperty("type")&&(i.type=t.enums===String?c.com.mapbox.pb.Tile.GeomType[e.type]:e.type),e.geometry&&e.geometry.length)for(i.geometry=[],r=0;r<e.geometry.length;++r)i.geometry[r]=e.geometry[r];return i},e.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},e}(),e.Layer=function(){function e(e){if(this.features=[],this.keys=[],this.values=[],e)for(var t=Object.keys(e),i=0;i<t.length;++i)null!=e[t[i]]&&(this[t[i]]=e[t[i]])}return e.prototype.version=1,e.prototype.name="",e.prototype.features=l.emptyArray,e.prototype.keys=l.emptyArray,e.prototype.values=l.emptyArray,e.prototype.extent=4096,e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var i=void 0===t?e.len:e.pos+t,n=new c.com.mapbox.pb.Tile.Layer;e.pos<i;){var r=e.uint32();switch(r>>>3){case 15:n.version=e.uint32();break;case 1:n.name=e.string();break;case 2:n.features&&n.features.length||(n.features=[]),n.features.push(c.com.mapbox.pb.Tile.Feature.decode(e,e.uint32()));break;case 3:n.keys&&n.keys.length||(n.keys=[]),n.keys.push(e.string());break;case 4:n.values&&n.values.length||(n.values=[]),n.values.push(c.com.mapbox.pb.Tile.Value.decode(e,e.uint32()));break;case 5:n.extent=e.uint32();break;default:e.skipType(7&r)}}if(!n.hasOwnProperty("version"))throw l.ProtocolError("missing required 'version'",{instance:n});if(!n.hasOwnProperty("name"))throw l.ProtocolError("missing required 'name'",{instance:n});return n},e.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},e.fromObject=function(e){if(e instanceof c.com.mapbox.pb.Tile.Layer)return e;var t=new c.com.mapbox.pb.Tile.Layer;if(null!=e.version&&(t.version=e.version>>>0),null!=e.name&&(t.name=String(e.name)),e.features){if(!Array.isArray(e.features))throw TypeError(".com.mapbox.pb.Tile.Layer.features: array expected");t.features=[];for(var i=0;i<e.features.length;++i){if("object"!=typeof e.features[i])throw TypeError(".com.mapbox.pb.Tile.Layer.features: object expected");t.features[i]=c.com.mapbox.pb.Tile.Feature.fromObject(e.features[i])}}if(e.keys){if(!Array.isArray(e.keys))throw TypeError(".com.mapbox.pb.Tile.Layer.keys: array expected");for(t.keys=[],i=0;i<e.keys.length;++i)t.keys[i]=String(e.keys[i])}if(e.values){if(!Array.isArray(e.values))throw TypeError(".com.mapbox.pb.Tile.Layer.values: array expected");for(t.values=[],i=0;i<e.values.length;++i){if("object"!=typeof e.values[i])throw TypeError(".com.mapbox.pb.Tile.Layer.values: object expected");t.values[i]=c.com.mapbox.pb.Tile.Value.fromObject(e.values[i])}}return null!=e.extent&&(t.extent=e.extent>>>0),t},e.toObject=function(e,t){t||(t={});var i={};if((t.arrays||t.defaults)&&(i.features=[],i.keys=[],i.values=[]),t.defaults&&(i.name="",i.extent=4096,i.version=1),null!=e.name&&e.hasOwnProperty("name")&&(i.name=e.name),e.features&&e.features.length){i.features=[];for(var n=0;n<e.features.length;++n)i.features[n]=c.com.mapbox.pb.Tile.Feature.toObject(e.features[n],t)}if(e.keys&&e.keys.length)for(i.keys=[],n=0;n<e.keys.length;++n)i.keys[n]=e.keys[n];if(e.values&&e.values.length)for(i.values=[],n=0;n<e.values.length;++n)i.values[n]=c.com.mapbox.pb.Tile.Value.toObject(e.values[n],t);return null!=e.extent&&e.hasOwnProperty("extent")&&(i.extent=e.extent),null!=e.version&&e.hasOwnProperty("version")&&(i.version=e.version),i},e.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},e}(),e}(),n),r),s),e.exports=c},7018:e=>{"use strict";e.exports=function(e,t){for(var i=new Array(arguments.length-1),n=0,r=2,s=!0;r<arguments.length;)i[n++]=arguments[r++];return new Promise((function(r,o){i[n]=function(e){if(s)if(s=!1,e)o(e);else{for(var t=new Array(arguments.length-1),i=0;i<t.length;)t[i++]=arguments[i];r.apply(null,t)}};try{e.apply(t||null,i)}catch(e){s&&(s=!1,o(e))}}))}},2647:(e,t)=>{"use strict";var i=t;i.length=function(e){var t=e.length;if(!t)return 0;for(var i=0;--t%4>1&&"="===e.charAt(t);)++i;return Math.ceil(3*e.length)/4-i};for(var n=new Array(64),r=new Array(123),s=0;s<64;)r[n[s]=s<26?s+65:s<52?s+71:s<62?s-4:s-59|43]=s++;i.encode=function(e,t,i){for(var r,s=null,o=[],a=0,l=0;t<i;){var c=e[t++];switch(l){case 0:o[a++]=n[c>>2],r=(3&c)<<4,l=1;break;case 1:o[a++]=n[r|c>>4],r=(15&c)<<2,l=2;break;case 2:o[a++]=n[r|c>>6],o[a++]=n[63&c],l=0}a>8191&&((s||(s=[])).push(String.fromCharCode.apply(String,o)),a=0)}return l&&(o[a++]=n[r],o[a++]=61,1===l&&(o[a++]=61)),s?(a&&s.push(String.fromCharCode.apply(String,o.slice(0,a))),s.join("")):String.fromCharCode.apply(String,o.slice(0,a))};var o="invalid encoding";i.decode=function(e,t,i){for(var n,s=i,a=0,l=0;l<e.length;){var c=e.charCodeAt(l++);if(61===c&&a>1)break;if(void 0===(c=r[c]))throw Error(o);switch(a){case 0:n=c,a=1;break;case 1:t[i++]=n<<2|(48&c)>>4,n=c,a=2;break;case 2:t[i++]=(15&n)<<4|(60&c)>>2,n=c,a=3;break;case 3:t[i++]=(3&n)<<6|c,a=0}}if(1===a)throw Error(o);return i-s},i.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},2922:e=>{"use strict";function t(){this._listeners={}}e.exports=t,t.prototype.on=function(e,t,i){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:i||this}),this},t.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var i=this._listeners[e],n=0;n<i.length;)i[n].fn===t?i.splice(n,1):++n;return this},t.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var i=[],n=1;n<arguments.length;)i.push(arguments[n++]);for(n=0;n<t.length;)t[n].fn.apply(t[n++].ctx,i)}return this}},7955:e=>{"use strict";function t(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),i=new Uint8Array(t.buffer),n=128===i[3];function r(e,n,r){t[0]=e,n[r]=i[0],n[r+1]=i[1],n[r+2]=i[2],n[r+3]=i[3]}function s(e,n,r){t[0]=e,n[r]=i[3],n[r+1]=i[2],n[r+2]=i[1],n[r+3]=i[0]}function o(e,n){return i[0]=e[n],i[1]=e[n+1],i[2]=e[n+2],i[3]=e[n+3],t[0]}function a(e,n){return i[3]=e[n],i[2]=e[n+1],i[1]=e[n+2],i[0]=e[n+3],t[0]}e.writeFloatLE=n?r:s,e.writeFloatBE=n?s:r,e.readFloatLE=n?o:a,e.readFloatBE=n?a:o}():function(){function t(e,t,i,n){var r=t<0?1:0;if(r&&(t=-t),0===t)e(1/t>0?0:2147483648,i,n);else if(isNaN(t))e(2143289344,i,n);else if(t>34028234663852886e22)e((r<<31|2139095040)>>>0,i,n);else if(t<11754943508222875e-54)e((r<<31|Math.round(t/1401298464324817e-60))>>>0,i,n);else{var s=Math.floor(Math.log(t)/Math.LN2);e((r<<31|s+127<<23|8388607&Math.round(t*Math.pow(2,-s)*8388608))>>>0,i,n)}}function o(e,t,i){var n=e(t,i),r=2*(n>>31)+1,s=n>>>23&255,o=8388607&n;return 255===s?o?NaN:r*(1/0):0===s?1401298464324817e-60*r*o:r*Math.pow(2,s-150)*(o+8388608)}e.writeFloatLE=t.bind(null,i),e.writeFloatBE=t.bind(null,n),e.readFloatLE=o.bind(null,r),e.readFloatBE=o.bind(null,s)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),i=new Uint8Array(t.buffer),n=128===i[7];function r(e,n,r){t[0]=e,n[r]=i[0],n[r+1]=i[1],n[r+2]=i[2],n[r+3]=i[3],n[r+4]=i[4],n[r+5]=i[5],n[r+6]=i[6],n[r+7]=i[7]}function s(e,n,r){t[0]=e,n[r]=i[7],n[r+1]=i[6],n[r+2]=i[5],n[r+3]=i[4],n[r+4]=i[3],n[r+5]=i[2],n[r+6]=i[1],n[r+7]=i[0]}function o(e,n){return i[0]=e[n],i[1]=e[n+1],i[2]=e[n+2],i[3]=e[n+3],i[4]=e[n+4],i[5]=e[n+5],i[
9496]=e[n+6],i[7]=e[n+7],t[0]}function a(e,n){return i[7]=e[n],i[6]=e[n+1],i[5]=e[n+2],i[4]=e[n+3],i[3]=e[n+4],i[2]=e[n+5],i[1]=e[n+6],i[0]=e[n+7],t[0]}e.writeDoubleLE=n?r:s,e.writeDoubleBE=n?s:r,e.readDoubleLE=n?o:a,e.readDoubleBE=n?a:o}():function(){function t(e,t,i,n,r,s){var o=n<0?1:0;if(o&&(n=-n),0===n)e(0,r,s+t),e(1/n>0?0:2147483648,r,s+i);else if(isNaN(n))e(0,r,s+t),e(2146959360,r,s+i);else if(n>17976931348623157e292)e(0,r,s+t),e((o<<31|2146435072)>>>0,r,s+i);else{var a;if(n<22250738585072014e-324)e((a=n/5e-324)>>>0,r,s+t),e((o<<31|a/4294967296)>>>0,r,s+i);else{var l=Math.floor(Math.log(n)/Math.LN2);1024===l&&(l=1023),e(4503599627370496*(a=n*Math.pow(2,-l))>>>0,r,s+t),e((o<<31|l+1023<<20|1048576*a&1048575)>>>0,r,s+i)}}}function o(e,t,i,n,r){var s=e(n,r+t),o=e(n,r+i),a=2*(o>>31)+1,l=o>>>20&2047,c=4294967296*(1048575&o)+s;return 2047===l?c?NaN:a*(1/0):0===l?5e-324*a*c:a*Math.pow(2,l-1075)*(c+4503599627370496)}e.writeDoubleLE=t.bind(null,i,0,4),e.writeDoubleBE=t.bind(null,n,4,0),e.readDoubleLE=o.bind(null,r,0,4),e.readDoubleBE=o.bind(null,s,4,0)}(),e}function i(e,t,i){t[i]=255&e,t[i+1]=e>>>8&255,t[i+2]=e>>>16&255,t[i+3]=e>>>24}function n(e,t,i){t[i]=e>>>24,t[i+1]=e>>>16&255,t[i+2]=e>>>8&255,t[i+3]=255&e}function r(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function s(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}e.exports=t(t)},8446:module=>{"use strict";function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}module.exports=inquire},5374:e=>{"use strict";e.exports=function(e,t,i){var n=i||8192,r=n>>>1,s=null,o=n;return function(i){if(i<1||i>r)return e(i);o+i>n&&(s=e(n),o=0);var a=t.call(s,o,o+=i);return 7&o&&(o=1+(7|o)),a}}},5226:(e,t)=>{"use strict";var i=t;i.length=function(e){for(var t=0,i=0,n=0;n<e.length;++n)(i=e.charCodeAt(n))<128?t+=1:i<2048?t+=2:55296==(64512&i)&&56320==(64512&e.charCodeAt(n+1))?(++n,t+=4):t+=3;return t},i.read=function(e,t,i){if(i-t<1)return"";for(var n,r=null,s=[],o=0;t<i;)(n=e[t++])<128?s[o++]=n:n>191&&n<224?s[o++]=(31&n)<<6|63&e[t++]:n>239&&n<365?(n=((7&n)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,s[o++]=55296+(n>>10),s[o++]=56320+(1023&n)):s[o++]=(15&n)<<12|(63&e[t++])<<6|63&e[t++],o>8191&&((r||(r=[])).push(String.fromCharCode.apply(String,s)),o=0);return r?(o&&r.push(String.fromCharCode.apply(String,s.slice(0,o))),r.join("")):String.fromCharCode.apply(String,s.slice(0,o))},i.write=function(e,t,i){for(var n,r,s=i,o=0;o<e.length;++o)(n=e.charCodeAt(o))<128?t[i++]=n:n<2048?(t[i++]=n>>6|192,t[i++]=63&n|128):55296==(64512&n)&&56320==(64512&(r=e.charCodeAt(o+1)))?(n=65536+((1023&n)<<10)+(1023&r),++o,t[i++]=n>>18|240,t[i++]=n>>12&63|128,t[i++]=n>>6&63|128,t[i++]=63&n|128):(t[i++]=n>>12|224,t[i++]=n>>6&63|128,t[i++]=63&n|128);return i-s}},9761:(e,t,i)=>{"use strict";i.r(t),i.d(t,{Easing:()=>r,Group:()=>o,Interpolation:()=>a,Sequence:()=>l,Tween:()=>h,VERSION:()=>u,add:()=>g,default:()=>_,getAll:()=>p,nextId:()=>d,now:()=>s,remove:()=>v,removeAll:()=>f,update:()=>y});var n,r={Linear:{None:function(e){return e}},Quadratic:{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:{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:{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:{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:{In:function(e){return 1-Math.cos(e*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return.5*(1-Math.cos(Math.PI*e))}},Exponential:{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*(2-Math.pow(2,-10*(e-1)))}},Circular:{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:{In:function(e){return 0===e?0:1===e?1:-Math.pow(2,10*(e-1))*Math.sin(5*(e-1.1)*Math.PI)},Out:function(e){return 0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin(5*(e-.1)*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(5*(e-1.1)*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin(5*(e-1.1)*Math.PI)+1}},Back:{In:function(e){var t=1.70158;return e*e*((t+1)*e-t)},Out:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},InOut:function(e){var t=2.5949095;return(e*=2)<1?e*e*((t+1)*e-t)*.5:.5*((e-=2)*e*((t+1)*e+t)+2)}},Bounce:{In:function(e){return 1-r.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*r.Bounce.In(2*e):.5*r.Bounce.Out(2*e-1)+.5}}},s="undefined"==typeof self&&"undefined"!=typeof process&&process.hrtime?function(){var e=process.hrtime();return 1e3*e[0]+e[1]/1e6}:"undefined"!=typeof self&&void 0!==self.performance&&void 0!==self.performance.now?self.performance.now.bind(self.performance):void 0!==Date.now?Date.now:function(){return(new Date).getTime()},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=s()),void 0===t&&(t=!1);var i=Object.keys(this._tweens);if(0===i.length)return!1;for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var n=0;n<i.length;n++){var r=this._tweens[i[n]],o=!t;r&&!1===r.update(e,o)&&!t&&delete this._tweens[i[n]]}i=Object.keys(this._tweensAddedDuringUpdate)}return!0},e}(),a={Linear:function(e,t){var i=e.length-1,n=i*t,r=Math.floor(n),s=a.Utils.Linear;return t<0?s(e[0],e[1],n):t>1?s(e[i],e[i-1],i-n):s(e[r],e[r+1>i?i:r+1],n-r)},Bezier:function(e,t){for(var i=0,n=e.length-1,r=Math.pow,s=a.Utils.Bernstein,o=0;o<=n;o++)i+=r(1-t,n-o)*r(t,o)*e[o]*s(n,o);return i},CatmullRom:function(e,t){var i=e.length-1,n=i*t,r=Math.floor(n),s=a.Utils.CatmullRom;return e[0]===e[i]?(t<0&&(r=Math.floor(n=i*(1+t))),s(e[(r-1+i)%i],e[r],e[(r+1)%i],e[(r+2)%i],n-r)):t<0?e[0]-(s(e[0],e[0],e[1],e[1],-n)-e[0]):t>1?e[i]-(s(e[i],e[i],e[i-1],e[i-1],n-i)-e[i]):s(e[r?r-1:0],e[r],e[i<r+1?i:r+1],e[i<r+2?i:r+2],n-r)},Utils:{Linear:function(e,t,i){return(t-e)*i+e},Bernstein:function(e,t){var i=a.Utils.Factorial;return i(e)/i(t)/i(e-t)},Factorial:(n=[1],function(e){var t=1;if(n[e])return n[e];for(var i=e;i>1;i--)t*=i;return n[e]=t,t}),CatmullRom:function(e,t,i,n,r){var s=.5*(i-e),o=.5*(n-t),a=r*r;return(2*t-2*i+s+o)*(r*a)+(-3*t+3*i-2*s-o)*a+s*r+t}}},l=function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e}(),c=new o,h=function(){function e(e,t){void 0===t&&(t=c),this._object=e,this._group=t,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=r.Linear.None,this._interpolationFunction=a.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._id=l.nextId(),this._isChainStopped=!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.to=function(e,t){return this._valuesEnd=Object.create(e),void 0!==t&&(this._duration=t),this},e.prototype.duration=function(e){return this._duration=e,this},e.prototype.start=function(e){if(this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed)for(var t in this._reversed=!1,this._valuesStartRepeat)this._swapEndStartRepeatValues(t),this._valuesStart[t]=this._valuesStartRepeat[t];return this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=void 0!==e?"string"==typeof e?s()+parseFloat(e):e:s(),this._startTime+=this._delayTime,this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat),this},e.prototype._setupProperties=function(e,t,i,n){for(var r in i){var s=e[r],o=Array.isArray(s),a=o?"array":typeof s,l=!o&&Array.isArray(i[r]);if("undefined"!==a&&"function"!==a){if(l){var c=i[r];if(0===c.length)continue;c=c.map(this._handleRelativeValue.bind(this,s)),i[r]=[s].concat(c)}if("object"!==a&&!o||!s||l)void 0===t[r]&&(t[r]=s),o||(t[r]*=1),n[r]=l?i[r].slice().reverse():t[r]||0;else{for(var h in t[r]=o?[]:{},s)t[r][h]=s[h];n[r]=o?[]:{},this._setupProperties(s,t[r],i[r],n[r])}}}},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):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},e.prototype.pause=function(e){return void 0===e&&(e=s()),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=s()),this._isPaused&&this._isPlaying?(this._isPaused=!1,this._startTime+=e-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),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 this._group=e,this},e.prototype.delay=function(e){return this._delayTime=e,this},e.prototype.repeat=function(e){return this._initialRepeat=e,this._repeat=e,this},e.prototype.repeatDelay=function(e){return this._repeatDelayTime=e,this},e.prototype.yoyo=function(e){return this._yoyo=e,this},e.prototype.easing=function(e){return this._easingFunction=e,this},e.prototype.interpolation=function(e){return 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.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=s()),void 0===t&&(t=!0),this._isPaused)return!0;var i,n,r=this._startTime+this._duration;if(!this._goToEnd&&!this._isPlaying){if(e>r)return!1;t&&this.start(e)}if(this._goToEnd=!1,e<this._startTime)return!0;!1===this._onStartCallbackFired&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),n=(e-this._startTime)/this._duration,n=0===this._duration||n>1?1:n;var o=this._easingFunction(n);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,o),this._onUpdateCallback&&this._onUpdateCallback(this._object,n),1===n){if(this._repeat>0){for(i in isFinite(this._repeat)&&this._repeat--,this._valuesStartRepeat)this._yoyo||"string"!=typeof this._valuesEnd[i]||(this._valuesStartRepeat[i]=this._valuesStartRepeat[i]+parseFloat(this._valuesEnd[i])),this._yoyo&&this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i];return this._yoyo&&(this._reversed=!this._reversed),void 0!==this._repeatDelayTime?this._startTime=e+this._repeatDelayTime:this._startTime=e+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),!0}this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var a=0,l=this._chainedTweens.length;a<l;a++)this._chainedTweens[a].start(this._startTime+this._duration);return this._isPlaying=!1,!1}return!0},e.prototype._updateProperties=function(e,t,i,n){for(var r in i)if(void 0!==t[r]){var s=t[r]||0,o=i[r],a=Array.isArray(e[r]),l=Array.isArray(o);!a&&l?e[r]=this._interpolationFunction(o,n):"object"==typeof o&&o?this._updateProperties(e[r],s,o,n):"number"==typeof(o=this._handleRelativeValue(s,o))&&(e[r]=s+(o-s)*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],i=this._valuesEnd[e];
vendor: 5,573 bytes, line 949
949this._valuesStartRepeat[e]="string"==typeof i?this._valuesStartRepeat[e]+parseFloat(i):this._valuesEnd[e],this._valuesEnd[e]=t},e}(),u="18.6.4",d=l.nextId,m=c,p=m.getAll.bind(m),f=m.removeAll.bind(m),g=m.add.bind(m),v=m.remove.bind(m),y=m.update.bind(m);const _={Easing:r,Group:o,Interpolation:a,now:s,Sequence:l,nextId:d,Tween:h,VERSION:u,getAll:p,removeAll:f,add:g,remove:v,update:y}},6925:(e,t)=>{var i={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function n(e){return(e=Math.round(e))<0?0:e>255?255:e}function r(e){return e<0?0:e>1?1:e}function s(e){return"%"===e[e.length-1]?n(parseFloat(e)/100*255):n(parseInt(e))}function o(e){return"%"===e[e.length-1]?r(parseFloat(e)/100):r(parseFloat(e))}function a(e,t,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?e+(t-e)*i*6:2*i<1?t:3*i<2?e+(t-e)*(2/3-i)*6:e}try{t.parseCSSColor=function(e){var t,r=e.replace(/ /g,"").toLowerCase();if(r in i)return i[r].slice();if("#"===r[0])return 4===r.length?(t=parseInt(r.substr(1),16))>=0&&t<=4095?[(3840&t)>>4|(3840&t)>>8,240&t|(240&t)>>4,15&t|(15&t)<<4,1]:null:7===r.length&&(t=parseInt(r.substr(1),16))>=0&&t<=16777215?[(16711680&t)>>16,(65280&t)>>8,255&t,1]:null;var l=r.indexOf("("),c=r.indexOf(")");if(-1!==l&&c+1===r.length){var h=r.substr(0,l),u=r.substr(l+1,c-(l+1)).split(","),d=1;switch(h){case"rgba":if(4!==u.length)return null;d=o(u.pop());case"rgb":return 3!==u.length?null:[s(u[0]),s(u[1]),s(u[2]),d];case"hsla":if(4!==u.length)return null;d=o(u.pop());case"hsl":if(3!==u.length)return null;var m=(parseFloat(u[0])%360+360)%360/360,p=o(u[1]),f=o(u[2]),g=f<=.5?f*(p+1):f+p-f*p,v=2*f-g;return[n(255*a(v,g,m+1/3)),n(255*a(v,g,m)),n(255*a(v,g,m-1/3)),d];default:return null}}return null}}catch(e){}},1874:e=>{"use strict";function t(e,t,n){n=n||2;var s,o,a,l,u,d,p,f=t&&t.length,g=f?t[0]*n:e.length,v=i(e,0,g,n,!0),y=[];if(!v||v.next===v.prev)return y;if(f&&(v=function(e,t,n,r){var s,o,a,l=[];for(s=0,o=t.length;s<o;
vendor: 4,150 bytes, line 949
949s++)(a=i(e,t[s]*r,s<o-1?t[s+1]*r:e.length,r,!1))===a.next&&(a.steiner=!0),l.push(m(a));for(l.sort(c),s=0;s<l.length;s++)n=h(l[s],n);return n}(e,t,v,n)),e.length>80*n){s=a=e[0],o=l=e[1];for(var _=n;_<g;_+=n)(u=e[_])<s&&(s=u),(d=e[_+1])<o&&(o=d),u>a&&(a=u),d>l&&(l=d);p=0!==(p=Math.max(a-s,l-o))?32767/p:0}return r(v,y,n,s,o,p,0),y}function i(e,t,i,n,r){var s,o;if(r===E(e,t,i,n)>0)for(s=t;s<i;s+=n)o=M(s,e[s],e[s+1],o);else for(s=i-n;s>=t;s-=n)o=M(s,e[s],e[s+1],o);return o&&v(o,o.next)&&(T(o),o=o.next),o}function n(e,t){if(!e)return e;t||(t=e);var i,n=e;do{if(i=!1,n.steiner||!v(n,n.next)&&0!==g(n.prev,n,n.next))n=n.next;else{if(T(n),(n=t=n.prev)===n.next)break;i=!0}}while(i||n!==t);return t}function r(e,t,i,c,h,u,m){if(e){!m&&u&&function(e,t,i,n){var r=e;do{0===r.z&&(r.z=d(r.x,r.y,t,i,n)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,function(e){var t,i,n,r,s,o,a,l,c=1;do{for(i=e,e=null,s=null,o=0;i;){for(o++,n=i,a=0,t=0;t<c&&(a++,n=n.nextZ);t++);for(l=c;a>0||l>0&&n;)0!==a&&(0===l||!n||i.z<=n.z)?(r=i,i=i.nextZ,a--):(r=n,n=n.nextZ,l--),s?s.nextZ=r:e=r,r.prevZ=s,s=r;i=n}s.nextZ=null,c*=2}while(o>1)}(r)}(e,c,h,u);for(var p,f,g=e;e.prev!==e.next;)if(p=e.prev,f=e.next,u?o(e,c,h,u):s(e))t.push(p.i/i|0),t.push(e.i/i|0),t.push(f.i/i|0),T(e),e=f.next,g=f.next;else if((e=f)===g){m?1===m?r(e=a(n(e),t,i),t,i,c,h,u,2):2===m&&l(e,t,i,c,h,u):r(n(e),t,i,c,h,u,1);break}}}function s(e){var t=e.prev,i=e,n=e.next;if(g(t,i,n)>=0)return!1;for(var r=t.x,s=i.x,o=n.x,a=t.y,l=i.y,c=n.y,h=r<s?r<o?r:o:s<o?s:o,u=a<l?a<c?a:c:l<c?l:c,d=r>s?r>o?r:o:s>o?s:o,m=a>l?a>c?a:c:l>c?l:c,f=n.next;f!==t;){if(f.x>=h&&f.x<=d&&f.y>=u&&f.y<=m&&p(r,a,s,l,o,c,f.x,f.y)&&g(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function o(e,t,i,n){var r=e.prev,s=e,o=e.next;if(g(r,s,o)>=0)return!1;for(var a=r.x,l=s.x,c=o.x,h=r.y,u=s.y,m=o.y,f=a<l?a<c?a:c:l<c?l:c,v=h<u?h<m?h:m:u<m?u:m,y=a>l?a>c?a:c:l>c?l:c,_=h>u?h>m?h:m:u>m?u:m,x=d(f,v,t,i,n),b=d(y,_,t,i,n),w=e.prevZ,M=e.nextZ;w&&w.z>=x&&M&&M.z<=b;){if(w.x>=f&&w.x<=y&&w.y>=v&&w.y<=_&&w!==r&&w!==o&&p(a,h,l,u,c,m,w.x,w.y)&&g(w.prev,w,w.next)>=0)return!1;if(w=w.prevZ,M.x>=f&&M.x<=y&&M.y>=v&&M.y<=_&&M!==r&&M!==o&&p(a,h,l,u,c,m,M.x,M.y)&&g(M.prev,M,M.next)>=0)return!1;M=M.nextZ}for(;w&&w.z>=x;){if(w.x>=f&&w.x<=y&&w.y>=v&&w.y<=_&&w!==r&&w!==o&&p(a,h,l,u,c,m,w.x,w.y)&&g(w.prev,w,w.next)>=0)return!1;w=w.prevZ}for(;M&&M.z<=b;){if(M.x>=f&&M.x<=y&&M.y>=v&&M.y<=_&&M!==r&&M!==o&&p(a,h,l,u,c,m,M.x,M.y)&&g(M.prev,M,M.next)>=0)return!1;M=M.nextZ}return!0}function a(e,t,i){var r=e;do{var s=r.prev,o=r.next.next;!v(s,o)&&y(s,r,r.next,o)&&b(s,o)&&b(o,s)&&(t.push(s.i/i|0),t.push(r.i/i|0),t.push(o.i/i|0),T(r),T(r.next),r=e=o),r=r.next}while(r!==e);return n(r)}function l(e,t,i,s,o,a){var l=e;do{for(var c=l.next.next;c!==l.prev;){if(l.i!==c.i&&f(l,c)){var h=w(l,c);return l=n(l,l.next),h=n(h,h.next),r(l,t,i,s,o,a,0),void r(h,t,i,s,o,a,0)}c=c.next}l=l.next}while(l!==e)}function c(e,t){return e.x-t.x}function h(e,t){var i=function(e,t){var i,n=t,r=e.x,s=e.y,o=-1/0;do{if(s<=n.y&&s>=n.next.y&&n.next.y!==n.y){var a=n.x+(s-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(a<=r&&a>o&&(o=a,i=n.x<n.next.x?n:n.next,a===r))return i}n=n.next}while(n!==t);if(!i)return null;var l,c=i,h=i.x,d=i.y,m=1/0;n=i;do{r>=n.x&&n.x>=h&&r!==n.x&&p(s<d?r:o,s,h,d,s<d?o:r,s,n.x,n.y)&&(l=Math.abs(s-n.y)/(r-n.x),b(n,e)&&(l<m||l===m&&(n.x>i.x||n.x===i.x&&u(i,n)))&&(i=n,m=l)),n=n.next}while(n!==c);return i}(e,t);if(!i)return t;var r=w(i,e);return n(r,r.next),n(i,i.next)}function u(e,t){return g(e.prev,e,t.prev)<0&&g(t.next,e,e.next)<0}function d(e,t,i,n,r){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-i)*r|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*r|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function m(e){var t=e,i=e;do{(t.x<i.x||t.x===i.x&&t.y<i.y)&&(i=t),t=t.next}while(t!==e);return i}function p(e,t,i,n,r,s,o,a){return(r-o)*(t-a)>=(e-o)*(s-a)&&(e-o)*(n-a)>=(i-o)*(t-a)&&(i-o)*(s-a)>=(r-o)*(n-a)}function f(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var i=e;do{if(i.i!==e.i&&i.next.i!==e.i&&i.i!==t.i&&i.next.i!==t.i&&y(i,i.next,e,t))return!0;
vendor: 16,486 bytes, line 949
949i=i.next}while(i!==e);return!1}(e,t)&&(b(e,t)&&b(t,e)&&function(e,t){var i=e,n=!1,r=(e.x+t.x)/2,s=(e.y+t.y)/2;do{i.y>s!=i.next.y>s&&i.next.y!==i.y&&r<(i.next.x-i.x)*(s-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==e);return n}(e,t)&&(g(e.prev,e,t.prev)||g(e,t.prev,t))||v(e,t)&&g(e.prev,e,e.next)>0&&g(t.prev,t,t.next)>0)}function g(e,t,i){return(t.y-e.y)*(i.x-t.x)-(t.x-e.x)*(i.y-t.y)}function v(e,t){return e.x===t.x&&e.y===t.y}function y(e,t,i,n){var r=x(g(e,t,i)),s=x(g(e,t,n)),o=x(g(i,n,e)),a=x(g(i,n,t));return r!==s&&o!==a||!(0!==r||!_(e,i,t))||!(0!==s||!_(e,n,t))||!(0!==o||!_(i,e,n))||!(0!==a||!_(i,t,n))}function _(e,t,i){return t.x<=Math.max(e.x,i.x)&&t.x>=Math.min(e.x,i.x)&&t.y<=Math.max(e.y,i.y)&&t.y>=Math.min(e.y,i.y)}function x(e){return e>0?1:e<0?-1:0}function b(e,t){return g(e.prev,e,e.next)<0?g(e,t,e.next)>=0&&g(e,e.prev,t)>=0:g(e,t,e.prev)<0||g(e,e.next,t)<0}function w(e,t){var i=new S(e.i,e.x,e.y),n=new S(t.i,t.x,t.y),r=e.next,s=t.prev;return e.next=t,t.prev=e,i.next=r,r.prev=i,n.next=i,i.prev=n,s.next=n,n.prev=s,n}function M(e,t,i,n){var r=new S(e,t,i);return n?(r.next=n.next,r.prev=n,n.next.prev=r,n.next=r):(r.prev=r,r.next=r),r}function T(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 S(e,t,i){this.i=e,this.x=t,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function E(e,t,i,n){for(var r=0,s=t,o=i-n;s<i;s+=n)r+=(e[o]-e[s])*(e[s+1]+e[o+1]),o=s;return r}e.exports=t,e.exports.default=t,t.deviation=function(e,t,i,n){var r=t&&t.length,s=r?t[0]*i:e.length,o=Math.abs(E(e,0,s,i));if(r)for(var a=0,l=t.length;a<l;a++){var c=t[a]*i,h=a<l-1?t[a+1]*i:e.length;o-=Math.abs(E(e,c,h,i))}var u=0;for(a=0;a<n.length;a+=3){var d=n[a]*i,m=n[a+1]*i,p=n[a+2]*i;u+=Math.abs((e[d]-e[p])*(e[m+1]-e[d+1])-(e[d]-e[m])*(e[p+1]-e[d+1]))}return 0===o&&0===u?0:Math.abs((u-o)/o)},t.flatten=function(e){for(var t=e[0][0].length,i={vertices:[],holes:[],dimensions:t},n=0,r=0;r<e.length;r++){for(var s=0;s<e[r].length;s++)for(var o=0;o<t;o++)i.vertices.push(e[r][s][o]);r>0&&(n+=e[r-1].length,i.holes.push(n))}return i}},242:(e,t,i)=>{"use strict";function n(e,t,i,s){for(var o,a=s,l=i-t>>1,c=i-t,h=e[t],u=e[t+1],d=e[i],m=e[i+1],p=t+3;p<i;p+=3){var f=r(e[p],e[p+1],h,u,d,m);if(f>a)o=p,a=f;else if(f===a){var g=Math.abs(p-l);g<c&&(o=p,c=g)}}a>s&&(o-t>3&&n(e,t,o,s),e[o+2]=a,i-o>3&&n(e,o,i,s))}function r(e,t,i,n,r,s){var o=r-i,a=s-n;if(0!==o||0!==a){var l=((e-i)*o+(t-n)*a)/(o*o+a*a);l>1?(i=r,n=s):l>0&&(i+=o*l,n+=a*l)}return(o=e-i)*o+(a=t-n)*a}function s(e,t,i,n){var r={id:void 0===e?null:e,type:t,geometry:i,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(e){var t=e.geometry,i=e.type;if("Point"===i||"MultiPoint"===i||"LineString"===i)o(e,t);else if("Polygon"===i||"MultiLineString"===i)for(var n=0;n<t.length;n++)o(e,t[n]);else if("MultiPolygon"===i)for(n=0;n<t.length;n++)for(var r=0;r<t[n].length;r++)o(e,t[n][r])}(r),r}function o(e,t){for(var i=0;i<t.length;i+=3)e.minX=Math.min(e.minX,t[i]),e.minY=Math.min(e.minY,t[i+1]),e.maxX=Math.max(e.maxX,t[i]),e.maxY=Math.max(e.maxY,t[i+1])}function a(e,t,i,n){if(t.geometry){var r=t.geometry.coordinates,o=t.geometry.type,u=Math.pow(i.tolerance/((1<<i.maxZoom)*i.extent),2),d=[],m=t.id;if(i.promoteId?m=t.properties[i.promoteId]:i.generateId&&(m=n||0),"Point"===o)l(r,d);else if("MultiPoint"===o)for(var p=0;p<r.length;p++)l(r[p],d);else if("LineString"===o)c(r,d,u,!1);else if("MultiLineString"===o){if(i.lineMetrics){for(p=0;p<r.length;p++)d=[],c(r[p],d,u,!1),e.push(s(m,"LineString",d,t.properties));return}h(r,d,u,!1)}else if("Polygon"===o)h(r,d,u,!0);else{if("MultiPolygon"!==o){if("GeometryCollection"===o){for(p=0;p<t.geometry.geometries.length;p++)a(e,{id:m,geometry:t.geometry.geometries[p],properties:t.properties},i,n);return}throw new Error("Input data is not a valid GeoJSON object.")}for(p=0;p<r.length;p++){var f=[];h(r[p],f,u,!0),d.push(f)}}e.push(s(m,o,d,t.properties))}}function l(e,t){t.push(u(e[0])),t.push(d(e[1])),t.push(0)}function c(e,t,i,r){for(var s,o,a=0,l=0;l<e.length;l++){var c=u(e[l][0]),h=d(e[l][1]);t.push(c),t.push(h),t.push(0),l>0&&(a+=r?(s*h-c*o)/2:Math.sqrt(Math.pow(c-s,2)+Math.pow(h-o,2))),s=c,o=h}var m=t.length-3;t[2]=1,n(t,0,m,i),t[m+2]=1,t.size=Math.abs(a),t.start=0,t.end=t.size}function h(e,t,i,n){for(var r=0;r<e.length;r++){var s=[];c(e[r],s,i,n),t.push(s)}}function u(e){return e/360+.5}function d(e){var t=Math.sin(e*Math.PI/180),i=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return i<0?0:i>1?1:i}function m(e,t,i,n,r,o,a,l){if(n/=t,o>=(i/=t)&&a<n)return e;if(a<i||o>=n)return null;for(var c=[],h=0;h<e.length;h++){var u=e[h],d=u.geometry,m=u.type,g=0===r?u.minX:u.minY,y=0===r?u.maxX:u.maxY;if(g>=i&&y<n)c.push(u);else if(!(y<i||g>=n)){var _=[];if("Point"===m||"MultiPoint"===m)p(d,_,i,n,r);else if("LineString"===m)f(d,_,i,n,r,!1,l.lineMetrics);else if("MultiLineString"===m)v(d,_,i,n,r,!1);else if("Polygon"===m)v(d,_,i,n,r,!0);else if("MultiPolygon"===m)for(var x=0;x<d.length;x++){var b=[];v(d[x],b,i,n,r,!0),b.length&&_.push(b)}if(_.length){if(l.lineMetrics&&"LineString"===m){for(x=0;x<_.length;x++)c.push(s(u.id,m,_[x],u.tags));continue}"LineString"!==m&&"MultiLineString"!==m||(1===_.length?(m="LineString",_=_[0]):m="MultiLineString"),"Point"!==m&&"MultiPoint"!==m||(m=3===_.length?"Point":"MultiPoint"),c.push(s(u.id,m,_,u.tags))}}}return c.length?c:null}function p(e,t,i,n,r){for(var s=0;s<e.length;s+=3){var o=e[s+r];o>=i&&o<=n&&(t.push(e[s]),t.push(e[s+1]),t.push(e[s+2]))}}function f(e,t,i,n,r,s,o){for(var a,l,c=g(e),h=0===r?_:x,u=e.start,d=0;d<e.length-3;d+=3){var m=e[d],p=e[d+1],f=e[d+2],v=e[d+3],b=e[d+4],w=0===r?m:p,M=0===r?v:b,T=!1;o&&(a=Math.sqrt(Math.pow(m-v,2)+Math.pow(p-b,2))),w<i?M>i&&(l=h(c,m,p,v,b,i),o&&(c.start=u+a*l)):w>n?M<n&&(l=h(c,m,p,v,b,n),o&&(c.start=u+a*l)):y(c,m,p,f),M<i&&w>=i&&(l=h(c,m,p,v,b,i),T=!0),M>n&&w<=n&&(l=h(c,m,p,v,b,n),T=!0),!s&&T&&(o&&(c.end=u+a*l),t.push(c),c=g(e)),o&&(u+=a)}var S=e.length-3;m=e[S],p=e[S+1],f=e[S+2],(w=0===r?m:p)>=i&&w<=n&&y(c,m,p,f),S=c.length-3,s&&S>=3&&(c[S]!==c[0]||c[S+1]!==c[1])&&y(c,c[0],c[1],c[2]),c.length&&t.push(c)}function g(e){var t=[];return t.size=e.size,t.start=e.start,t.end=e.end,t}function v(e,t,i,n,r,s){for(var o=0;o<e.length;o++)f(e[o],t,i,n,r,s,!1)}function y(e,t,i,n){e.push(t),e.push(i),e.push(n)}function _(e,t,i,n,r,s){var o=(s-t)/(n-t);return e.push(s),e.push(i+(r-i)*o),e.push(1),o}function x(e,t,i,n,r,s){var o=(s-i)/(r-i);return e.push(t+(n-t)*o),e.push(s),e.push(1),o}function b(e,t){for(var i=[],n=0;n<e.length;n++){var r,o=e[n],a=o.type;if("Point"===a||"MultiPoint"===a||"LineString"===a)r=w(o.geometry,t);else if("MultiLineString"===a||"Polygon"===a){r=[];for(var l=0;l<o.geometry.length;l++)r.push(w(o.geometry[l],t))}else if("MultiPolygon"===a)for(r=[],l=0;l<o.geometry.length;l++){for(var c=[],h=0;h<o.geometry[l].length;h++)c.push(w(o.geometry[l][h],t));r.push(c)}i.push(s(o.id,a,r,o.tags))}return i}function w(e,t){var i=[];i.size=e.size,void 0!==e.start&&(i.start=e.start,i.end=e.end);for(var n=0;n<e.length;n+=3)i.push(e[n]+t,e[n+1],e[n+2]);return i}function M(e,t){if(e.transformed)return e;var i,n,r,s=1<<e.z,o=e.x,a=e.y;for(i=0;i<e.features.length;i++){var l=e.features[i],c=l.geometry,h=l.type;if(l.geometry=[],1===h)for(n=0;n<c.length;n+=2)l.geometry.push(T(c[n],c[n+1],t,s,o,a));else for(n=0;n<c.length;n++){var u=[];for(r=0;r<c[n].length;r+=2)u.push(T(c[n][r],c[n][r+1],t,s,o,a));l.geometry.push(u)}}return e.transformed=!0,e}function T(e,t,i,n,r,s){return[Math.round(i*(e*n-r)),Math.round(i*(t*n-s))]}function S(e,t,i,n,r){for(var s=t===r.maxZoom?0:r.tolerance/((1<<t)*r.extent),o={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:i,y:n,z:t,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},a=0;a<e.length;a++){o.numFeatures++,E(o,e[a],s,r);var l=e[a].minX,c=e[a].minY,h=e[a].maxX,u=e[a].maxY;l<o.minX&&(o.minX=l),c<o.minY&&(o.minY=c),h>o.maxX&&(o.maxX=h),u>o.maxY&&(o.maxY=u)}return o}function E(e,t,i,n){var r=t.geometry,s=t.type,o=[];if("Point"===s||"MultiPoint"===s)for(var a=0;a<r.length;a+=3)o.push(r[a]),o.push(r[a+1]),e.numPoints++,e.numSimplified++;else if("LineString"===s)A(o,r,e,i,!1,!1);else if("MultiLineString"===s||"Polygon"===s)for(a=0;a<r.length;a++)A(o,r[a],e,i,"Polygon"===s,0===a);else if("MultiPolygon"===s)for(var l=0;l<r.length;l++){var c=r[l];for(a=0;a<c.length;a++)A(o,c[a],e,i,!0,0===a)}if(o.length){var h=t.tags||null;if("LineString"===s&&n.lineMetrics){for(var u in h={},t.tags)h[u]=t.tags[u];h.mapbox_clip_start=r.start/r.size,h.mapbox_clip_end=r.end/r.size}var d={geometry:o,type:"Polygon"===s||"MultiPolygon"===s?3:"LineString"===s||"MultiLineString"===s?2:1,tags:h};null!==t.id&&(d.id=t.id),e.features.push(d)}}function A(e,t,i,n,r,s){var o=n*n;if(n>0&&t.size<(r?o:n))i.numPoints+=t.length/3;else{for(var a=[],l=0;l<t.length;l+=3)(0===n||t[l+2]>o)&&(i.numSimplified++,a.push(t[l]),a.push(t[l+1])),i.numPoints++;r&&function(e,t){for(var i=0,n=0,r=e.length,s=r-2;n<r;s=n,n+=2)i+=(e[n]-e[s])*(e[n+1]+e[s+1]);if(i>0===t)for(n=0,r=e.length;n<r/2;n+=2){var o=e[n],a=e[n+1];e[n]=e[r-2-n],e[n+1]=e[r-1-n],e[r-2-n]=o,e[r-1-n]=a}}(a,s),e.push(a)}}function C(e,t){return new P(e,t)}function P(e,t){var i=(t=this.options=function(e,t){for(var i in t)e[i]=t[i];return e}(Object.create(this.options),t)).debug;if(i&&console.time("preprocess data"),t.maxZoom<0||t.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(t.promoteId&&t.generateId)throw new Error("promoteId and generateId cannot be used together.");var n=function(e,t){var i=[];if("FeatureCollection"===e.type)for(var n=0;n<e.features.length;n++)a(i,e.features[n],t,n);else"Feature"===e.type?a(i,e,t):a(i,{geometry:e},t);return i}(e,t);this.tiles={},this.tileCoords=[],i&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",t.indexMaxZoom,t.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),n=function(e,t){var i=t.buffer/t.extent,n=e,r=m(e,1,-1-i,i,0,-1,2,t),s=m(e,1,1-i,2+i,0,-1,2,t);return(r||s)&&(n=m(e,1,-i,1+i,0,-1,2,t)||[],r&&(n=b(r,1).concat(n)),s&&(n=n.concat(b(s,-1)))),n}(n,t),n.length&&this.splitTile(n,0,0,0),i&&(n.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}function L(e,t,i){return 32*((1<<e)*i+t)+e}i.r(t),i.d(t,{default:()=>C}),P.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},P.prototype.splitTile=function(e,t,i,n,r,s,o){for(var a=[e,t,i,n],l=this.options,c=l.debug;a.length;){n=a.pop(),i=a.pop(),t=a.pop(),e=a.pop();var h=1<<t,u=L(t,i,n),d=this.tiles[u];if(!d&&(c>1&&console.time("creation"),d=this.tiles[u]=S(e,t,i,n,l),this.tileCoords.push({z:t,x:i,y:n}),c)){c>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",t,i,n,d.numFeatures,d.numPoints,d.numSimplified),console.timeEnd("creation"));var p="z"+t;this.stats[p]=(this.stats[p]||0)+1,this.total++}if(d.source=e,r){if(t===l.maxZoom||t===r)continue;var f=1<<r-t;if(i!==Math.floor(s/f)||n!==Math.floor(o/f))continue}else if(t===l.indexMaxZoom||d.numPoints<=l.indexMaxPoints)continue;if(d.source=null,0!==e.length){c>1&&console.time("clipping");var g,v,y,_,x,b,w=.5*l.buffer/l.extent,M=.5-w,T=.5+w,E=1+w;g=v=y=_=null,x=m(e,h,i-w,i+T,0,d.minX,d.maxX,l),b=m(e,h,i+M,i+E,0,d.minX,d.maxX,l),e=null,x&&(g=m(x,h,n-w,n+T,1,d.minY,d.maxY,l),v=m(x,h,n+M,n+E,1,d.minY,d.maxY,l),x=null),b&&(y=m(b,h,n-w,n+T,1,d.minY,d.maxY,l),_=m(b,h,n+M,n+E,1,d.minY,d.maxY,l),b=null),c>1&&console.timeEnd("clipping"),a.push(g||[],t+1,2*i,2*n),a.push(v||[],t+1,2*i,2*n+1),a.push(y||[],t+1,2*i+1,2*n),a.push(_||[],t+1,2*i+1,2*n+1)}}},P.prototype.getTile=function(e,t,i){var n=this.options,r=n.extent,s=n.debug;if(e<0||e>24)return null;var o=1<<e,a=L(e,t=(t%o+o)%o,i);if(this.tiles[a])return M(this.tiles[a],r);s>1&&console.log("drilling down to z%d-%d-%d",e,t,i);for(var l,c=e,h=t,u=i;!l&&c>0;)c--,h=Math.floor(h/2),u=Math.floor(u/2),l=this.tiles[L(c,h,u)];return l&&l.source?(s>1&&console.log("found parent tile z%d-%d-%d",c,h,u),s>1&&console.time("drilling down"),this.splitTile(l.source,c,h,u,e,t,i),s>1&&console.timeEnd("drilling down"),this.tiles[a]?M(this.tiles[a],r):null):null}},5133:e=>{e.exports=i;var t=null;try{t=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(e){}function i(e,t,i){this.low=0|e,this.high=0|t,this.unsigned=!!i}function n(e){return!0===(e&&e.__isLong__)}i.prototype.__isLong__,Object.defineProperty(i.prototype,"__isLong__",{value:!0}),i.isLong=n;var r={},s={};function o(e,t){var i,n,o;return t?(o=0<=(e>>>=0)&&e<256)&&(n=s[e])?n:(i=l(e,(0|e)<0?-1:0,!0),o&&(s[e]=i),i):(o=-128<=(e|=0)&&e<128)&&(n=r[e])?n:(i=l(e,e<0?-1:0,!1),o&&(r[e]=i),i)}function a(e,t){if(isNaN(e))return t?v:g;if(t){if(e<0)return v;if(e>=m)return w}else{if(e<=-p)return M;if(e+1>=p)return b}return e<0?a(-e,t).neg():l(e%d|0,e/d|0,t)}function l(e,t,n){return new i(e,t,n)}i.fromInt=o,i.fromNumber=a,i.fromBits=l;var c=Math.pow;function h(e,t,i){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return g;if("number"==typeof t?(i=t,t=!1):t=!!t,(i=i||10)<2||36<i)throw RangeError("radix");var n;if((n=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===n)return h(e.substring(1),t,i).neg();for(var r=a(c(i,8)),s=g,o=0;o<e.length;o+=8){var l=Math.min(8,e.length-o),u=parseInt(e.substring(o,o+l),i);if(l<8){var d=a(c(i,l));s=s.mul(d).add(a(u))}else s=(s=s.mul(r)).add(a(u))}return s.unsigned=t,s}function u(e,t){return"number"==typeof e?a(e,t):"string"==typeof e?h(e,t):l(e.low,e.high,"boolean"==typeof t?t:e.unsigned)}i.fromString=h,i.fromValue=u;var d=4294967296,m=d*d,p=m/2,f=o(1<<24),g=o(0);i.ZERO=g;var v=o(0,!0);i.UZERO=v;var y=o(1);i.ONE=y;var _=o(1,!0);i.UONE=_;var x=o(-1);i.NEG_ONE=x;var b=l(-1,2147483647,!1);i.MAX_VALUE=b;var w=l(-1,-1,!0);i.MAX_UNSIGNED_VALUE=w;var M=l(0,-2147483648,!1);i.MIN_VALUE=M;var T=i.prototype;T.toInt=function(){return this.unsigned?this.low>>>0:this.low},T.toNumber=function(){return this.unsigned?(this.high>>>0)*d+(this.low>>>0):this.high*d+(this.low>>>0)},T.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(M)){var t=a(e),i=this.div(t),n=i.mul(t).sub(this);return i.toString(e)+n.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var r=a(c(e,6),this.unsigned),s=this,o="";;){var l=s.div(r),h=(s.sub(l.mul(r)).toInt()>>>0).toString(e);if((s=l).isZero())return h+o;for(;h.length<6;)h="0"+h;o=""+h+o}},T.getHighBits=function(){return this.high},T.getHighBitsUnsigned=function(){return this.high>>>0},T.getLowBits=function(){return this.low},T.getLowBitsUnsigned=function(){return this.low>>>0},T.getNumBitsAbs=function(){if(this.isNegative())return this.eq(M)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&!(e&1<<t);t--);return 0!=this.high?t+33:t+1},T.isZero=function(){return 0===this.high&&0===this.low},T.eqz=T.isZero,T.isNegative=function(){return!this.unsigned&&this.high<0},T.isPositive=function(){return this.unsigned||this.high>=0},T.isOdd=function(){return!(1&~this.low)},T.isEven=function(){return!(1&this.low)},T.equals=function(e){return n(e)||(e=u(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low},T.eq=T.equals,T.notEquals=function(e){return!this.eq(e)},T.neq=T.notEquals,T.ne=T.notEquals,T.lessThan=function(e){return this.comp(e)<0}
vendor: 10,057 bytes, line 949
949,T.lt=T.lessThan,T.lessThanOrEqual=function(e){return this.comp(e)<=0},T.lte=T.lessThanOrEqual,T.le=T.lessThanOrEqual,T.greaterThan=function(e){return this.comp(e)>0},T.gt=T.greaterThan,T.greaterThanOrEqual=function(e){return this.comp(e)>=0},T.gte=T.greaterThanOrEqual,T.ge=T.greaterThanOrEqual,T.compare=function(e){if(n(e)||(e=u(e)),this.eq(e))return 0;var t=this.isNegative(),i=e.isNegative();return t&&!i?-1:!t&&i?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},T.comp=T.compare,T.negate=function(){return!this.unsigned&&this.eq(M)?M:this.not().add(y)},T.neg=T.negate,T.add=function(e){n(e)||(e=u(e));var t=this.high>>>16,i=65535&this.high,r=this.low>>>16,s=65535&this.low,o=e.high>>>16,a=65535&e.high,c=e.low>>>16,h=0,d=0,m=0,p=0;return m+=(p+=s+(65535&e.low))>>>16,d+=(m+=r+c)>>>16,h+=(d+=i+a)>>>16,h+=t+o,l((m&=65535)<<16|(p&=65535),(h&=65535)<<16|(d&=65535),this.unsigned)},T.subtract=function(e){return n(e)||(e=u(e)),this.add(e.neg())},T.sub=T.subtract,T.multiply=function(e){if(this.isZero())return g;if(n(e)||(e=u(e)),t)return l(t.mul(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(e.isZero())return g;if(this.eq(M))return e.isOdd()?M:g;if(e.eq(M))return this.isOdd()?M:g;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(f)&&e.lt(f))return a(this.toNumber()*e.toNumber(),this.unsigned);var i=this.high>>>16,r=65535&this.high,s=this.low>>>16,o=65535&this.low,c=e.high>>>16,h=65535&e.high,d=e.low>>>16,m=65535&e.low,p=0,v=0,y=0,_=0;return y+=(_+=o*m)>>>16,v+=(y+=s*m)>>>16,y&=65535,v+=(y+=o*d)>>>16,p+=(v+=r*m)>>>16,v&=65535,p+=(v+=s*d)>>>16,v&=65535,p+=(v+=o*h)>>>16,p+=i*m+r*d+s*h+o*c,l((y&=65535)<<16|(_&=65535),(p&=65535)<<16|(v&=65535),this.unsigned)},T.mul=T.multiply,T.divide=function(e){if(n(e)||(e=u(e)),e.isZero())throw Error("division by zero");var i,r,s;if(t)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?l((this.unsigned?t.div_u:t.div_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?v:g;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return v;if(e.gt(this.shru(1)))return _;s=v}else{if(this.eq(M))return e.eq(y)||e.eq(x)?M:e.eq(M)?y:(i=this.shr(1).div(e).shl(1)).eq(g)?e.isNegative()?y:x:(r=this.sub(e.mul(i)),s=i.add(r.div(e)));if(e.eq(M))return this.unsigned?v:g;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();s=g}for(r=this;r.gte(e);){i=Math.max(1,Math.floor(r.toNumber()/e.toNumber()));for(var o=Math.ceil(Math.log(i)/Math.LN2),h=o<=48?1:c(2,o-48),d=a(i),m=d.mul(e);m.isNegative()||m.gt(r);)m=(d=a(i-=h,this.unsigned)).mul(e);d.isZero()&&(d=y),s=s.add(d),r=r.sub(m)}return s},T.div=T.divide,T.modulo=function(e){return n(e)||(e=u(e)),t?l((this.unsigned?t.rem_u:t.rem_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},T.mod=T.modulo,T.rem=T.modulo,T.not=function(){return l(~this.low,~this.high,this.unsigned)},T.and=function(e){return n(e)||(e=u(e)),l(this.low&e.low,this.high&e.high,this.unsigned)},T.or=function(e){return n(e)||(e=u(e)),l(this.low|e.low,this.high|e.high,this.unsigned)},T.xor=function(e){return n(e)||(e=u(e)),l(this.low^e.low,this.high^e.high,this.unsigned)},T.shiftLeft=function(e){return n(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?l(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):l(0,this.low<<e-32,this.unsigned)},T.shl=T.shiftLeft,T.shiftRight=function(e){return n(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?l(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):l(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},T.shr=T.shiftRight,T.shiftRightUnsigned=function(e){if(n(e)&&(e=e.toInt()),0==(e&=63))return this;var t=this.high;return e<32?l(this.low>>>e|t<<32-e,t>>>e,this.unsigned):l(32===e?t:t>>>e-32,0,this.unsigned)},T.shru=T.shiftRightUnsigned,T.shr_u=T.shiftRightUnsigned,T.toSigned=function(){return this.unsigned?l(this.low,this.high,!1):this},T.toUnsigned=function(){return this.unsigned?this:l(this.low,this.high,!0)},T.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},T.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},T.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},i.fromBytes=function(e,t,n){return n?i.fromBytesLE(e,t):i.fromBytesBE(e,t)},i.fromBytesLE=function(e,t){return new i(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},i.fromBytesBE=function(e,t){return new i(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}},6918:(e,t,i)=>{"use strict";e.exports=i(3729)},3729:(e,t,i)=>{"use strict";var n=t;function r(){n.util._configure(),n.Writer._configure(n.BufferWriter),n.Reader._configure(n.BufferReader)}n.build="minimal",n.Writer=i(8116),n.BufferWriter=i(1819),n.Reader=i(2461),n.BufferReader=i(9117),n.util=i(1679),n.rpc=i(8082),n.roots=i(575),n.configure=r,r()},2461:(e,t,i)=>{"use strict";e.exports=l;var n,r=i(1679),s=r.LongBits,o=r.utf8;function a(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function l(e){this.buf=e,this.pos=0,this.len=e.length}var c,h="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new l(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new l(e);throw Error("illegal buffer")},u=function(){return r.Buffer?function(e){return(l.create=function(e){return r.Buffer.isBuffer(e)?new n(e):h(e)})(e)}:h};function d(){var e=new s(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw a(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw a(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function m(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function p(){if(this.pos+8>this.len)throw a(this,8);return new s(m(this.buf,this.pos+=4),m(this.buf,this.pos+=4))}l.create=u(),l.prototype._slice=r.Array.prototype.subarray||r.Array.prototype.slice,l.prototype.uint32=(c=4294967295,function(){if(c=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return c;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return c}),l.prototype.int32=function(){return 0|this.uint32()},l.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)},l.prototype.bool=function(){return 0!==this.uint32()},l.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return m(this.buf,this.pos+=4)},l.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return 0|m(this.buf,this.pos+=4)},l.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var e=r.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},l.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var e=r.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},l.prototype.bytes=function(){var e=this.uint32(),t=this.pos,i=this.pos+e;if(i>this.len)throw a(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,i):t===i?new this.buf.constructor(0):this._slice.call(this.buf,t,i)},l.prototype.string=function(){var e=this.bytes();return o.read(e,0,e.length)},l.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw a(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw a(this)}while(128&this.buf[this.pos++]);return this},l.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},l._configure=function(e){n=e,l.create=u(),n._configure();var t=r.Long?"toLong":"toNumber";r.merge(l.prototype,{int64:function(){return d.call(this)[t](!1)},uint64:function(){return d.call(this)[t](!0)},sint64:function(){return d.call(this).zzDecode()[t](!1)},fixed64:function(){return p.call(this)[t](!0)},sfixed64:function(){return p.call(this)[t](!1)}})}},9117:(e,t,i)=>{"use strict";e.exports=s;var n=i(2461);(s.prototype=Object.create(n.prototype)).constructor=s;var r=i(1679);function s(e){n.call(this,e)}s._configure=function(){r.Buffer&&(s.prototype._slice=r.Buffer.prototype.slice)},s.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},s._configure()},575:e=>{"use strict";e.exports={}},8082:(e,t,i)=>{"use strict";t.Service=i(7927)},7927:(e,t,i)=>{"use strict";e.exports=r;var n=i(1679);function r(e,t,i){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");n.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(i)}(r.prototype=Object.create(n.EventEmitter.prototype)).constructor=r,r.prototype.rpcCall=function e(t,i,r,s,o){if(!s)throw TypeError("request must be specified");var a=this;
949if(!o)return n.asPromise(e,a,t,i,r,s);if(a.rpcImpl)try{return a.rpcImpl(t,i[a.requestDelimited?"encodeDelimited":"encode"](s).finish(),(function(e,i){if(e)return a.emit("error",e,t),o(e);if(null!==i){if(!(i instanceof r))try{i=r[a.responseDelimited?"decodeDelimited":"decode"](i)}catch(e){return a.emit("error",e,t),o(e)}return a.emit("data",i,t),o(null,i)}a.end(!0)}))}catch(e){return a.emit("error",e,t),void setTimeout((function(){o(e)}),0)}else setTimeout((function(){o(Error("already ended"))}),0)},r.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},8294:(e,t,i)=>{"use strict";e.exports=r;var n=i(1679);function r(e,t){this.lo=e>>>0,this.hi=t>>>0}var s=r.zero=new r(0,0);s.toNumber=function(){return 0},s.zzEncode=s.zzDecode=function(){return this},s.length=function(){return 1};var o=r.zeroHash="\0\0\0\0\0\0\0\0";r.fromNumber=function(e){if(0===e)return s;var t=e<0;t&&(e=-e);var i=e>>>0,n=(e-i)/4294967296>>>0;return t&&(n=~n>>>0,i=~i>>>0,++i>4294967295&&(i=0,++n>4294967295&&(n=0))),new r(i,n)},r.from=function(e){if("number"==typeof e)return r.fromNumber(e);if(n.isString(e)){if(!n.Long)return r.fromNumber(parseInt(e,10));e=n.Long.fromString(e)}return e.low||e.high?new r(e.low>>>0,e.high>>>0):s},r.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,i=~this.hi>>>0;return t||(i=i+1>>>0),-(t+4294967296*i)}return this.lo+4294967296*this.hi},r.prototype.toLong=function(e){return n.Long?new n.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var a=String.prototype.charCodeAt;r.fromHash=function(e){return e===o?s:new r((a.call(e,0)|a.call(e,1)<<8|a.call(e,2)<<16|a.call(e,3)<<24)>>>0,(a.call(e,4)|a.call(e,5)<<8|a.call(e,6)<<16|a.call(e,7)<<24)>>>0)},r.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},r.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},r.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},r.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,i=this.hi>>>24;return 0===i?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:i<128?9:10}},1679:function(e,t,i){"use strict";var n=t;function r(e,t,i){for(var n=Object.keys(t),r=0;r<n.length;++r)void 0!==e[n[r]]&&i||(e[n[r]]=t[n[r]]);return e}function s(e){function t(e,i){if(!(this instanceof t))return new t(e,i);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),i&&r(this,i)}return(t.prototype=Object.create(Error.prototype)).constructor=t,Object.defineProperty(t.prototype,"name",{get:function(){return e}}),t.prototype.toString=function(){return this.name+": "+this.message},t}n.asPromise=i(7018),n.base64=i(2647),n.EventEmitter=i(2922),n.float=i(7955),n.inquire=i(8446),n.utf8=i(5226),n.pool=i(5374),n.LongBits=i(8294),n.isNode=Boolean(void 0!==i.g&&i.g&&i.g.process&&i.g.process.versions&&i.g.process.versions.node),n.global=n.isNode&&i.g||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||this,n.emptyArray=Object.freeze?Object.freeze([]):[],n.emptyObject=Object.freeze?Object.freeze({}):{},n.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},n.isString=function(e){return"string"==typeof e||e instanceof String},n.isObject=function(e){return e&&"object"==typeof e},n.isset=n.isSet=function(e,t){var i=e[t];return!(null==i||!e.hasOwnProperty(t))&&("object"!=typeof i||(Array.isArray(i)?i.length:Object.keys(i).length)>0)},n.Buffer=function(){try{var e=n.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),n._Buffer_from=null,n._Buffer_allocUnsafe=null,n.newBuffer=function(e){return"number"==typeof e?n.Buffer?n._Buffer_allocUnsafe(e):new n.Array(e):n.Buffer?n._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},n.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,n.Long=n.global.dcodeIO&&n.global.dcodeIO.Long||n.global.Long||n.inquire("long"),n.key2Re=/^true|false|0|1$/,n.key32Re=/^-?(?:0|[1-9][0-9]*)$/,n.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,n.longToHash=function(e){return e?n.LongBits.from(e).toHash():n.LongBits.zeroHash},n.longFromHash=function(e,t){var i=n.LongBits.fromHash(e);return n.Long?n.Long.fromBits(i.lo,i.hi,t):i.toNumber(Boolean(t))},n.merge=r,n.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},n.newError=s,n.ProtocolError=s("ProtocolError"),n.oneOfGetter=function(e){for(var t={},i=0;i<e.length;++i)t[e[i]]=1;return function(){for(var e=Object.keys(this),i=e.length-1;i>-1;--i)if(1===t[e[i]]&&void 0!==this[e[i]]&&null!==this[e[i]])return e[i]}},n.oneOfSetter=function(e){return function(t){for(var i=0;i<e.length;++i)e[i]!==t&&delete this[e[i]]}},n.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},n._configure=function(){var e=n.Buffer;e?(n._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,i){return new e(t,i)},n._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}):n._Buffer_from=n._Buffer_allocUnsafe=null}},8116:(e,t,i)=>{"use strict";e.exports=u;var n,r=i(1679),s=r.LongBits,o=r.base64,a=r.utf8;function l(e,t,i){this.fn=e,this.len=t,this.next=void 0,this.val=i}function c(){}function h(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function u(){this.len=0,this.head=new l(c,0,0),this.tail=this.head,this.states=null}var d=function(){return r.Buffer?function(){return(u.create=function(){return new n})()}:function(){return new u}};function m(e,t,i){t[i]=255&e}function p(e,t){this.len=e,this.next=void 0,this.val=t}function f(e,t,i){for(;e.hi;)t[i++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[i++]=127&e.lo|128,e.lo=e.lo>>>7;t[i++]=e.lo}function g(e,t,i){t[i]=255&e,t[i+1]=e>>>8&255,t[i+2]=e>>>16&255,t[i+3]=e>>>24}u.create=d(),u.alloc=function(e){return new r.Array(e)},r.Array!==Array&&(u.alloc=r.pool(u.alloc,r.Array.prototype.subarray)),u.prototype._push=function(e,t,i){return this.tail=this.tail.next=new l(e,t,i),this.len+=t,this},p.prototype=Object.create(l.prototype),p.prototype.fn=function(e,t,i){for(;e>127;)t[i++]=127&e|128,e>>>=7;t[i]=e},u.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new p((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},u.prototype.int32=function(e){return e<0?this._push(f,10,s.fromNumber(e)):this.uint32(e)},u.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},u.prototype.uint64=function(e){var t=s.from(e);return this._push(f,t.length(),t)},u.prototype.int64=u.prototype.uint64,u.prototype.sint64=function(e){var t=s.from(e).zzEncode();return this._push(f,t.length(),t)},u.prototype.bool=function(e){return this._push(m,1,e?1:0)},u.prototype.fixed32=function(e){return this._push(g,4,e>>>0)},u.prototype.sfixed32=u.prototype.fixed32,u.prototype.fixed64=function(e){var t=s.from(e);return this._push(g,4,t.lo)._push(g,4,t.hi)},u.prototype.sfixed64=u.prototype.fixed64,u.prototype.float=function(e){return this._push(r.float.writeFloatLE,4,e)},u.prototype.double=function(e){return this._push(r.float.writeDoubleLE,8,e)};var v=r.Array.prototype.set?function(e,t,i){t.set(e,i)}:function(e,t,i){for(var n=0;n<e.length;++n)t[i+n]=e[n]};u.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(m,1,0);if(r.isString(e)){var i=u.alloc(t=o.length(e));o.decode(e,i,0),e=i}return this.uint32(t)._push(v,t,e)},u.prototype.string=function(e){var t=a.length(e);return t?this.uint32(t)._push(a.write,t,e):this._push(m,1,0)},u.prototype.fork=function(){return this.states=new h(this),this.head=this.tail=new l(c,0,0),this.len=0,this},u.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new l(c,0,0),this.len=0),this},u.prototype.ldelim=function(){var e=this.head,t=this.tail,i=this.len;return this.reset().uint32(i),i&&(this.tail.next=e.next,this.tail=t,this.len+=i),this},u.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),i=0;e;)e.fn(e.val,t,i),i+=e.len,e=e.next;return t},u._configure=function(e){n=e,u.create=d(),n._configure()}},1819:(e,t,i)=>{"use strict";e.exports=s;var n=i(8116);(s.prototype=Object.create(n.prototype)).constructor=s;var r=i(1679);function s(){n.call(this)}function o(e,t,i){e.length<40?r.utf8.write(e,t,i):t.utf8Write?t.utf8Write(e,i):t.write(e,i)}s._configure=function(){s.alloc=r._Buffer_allocUnsafe,s.writeBytesBuffer=r.Buffer&&r.Buffer.prototype instanceof Uint8Array&&"set"===r.Buffer.prototype.set.name?function(e,t,i){t.set(e,i)}:function(e,t,i){if(e.copy)e.copy(t,i,0,e.length);else for(var n=0;n<e.length;)t[i++]=e[n++]}},s.prototype.bytes=function(e){r.isString(e)&&(e=r._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(s.writeBytesBuffer,t,e),this},s.prototype.string=function(e){var t=r.Buffer.byteLength(e);return this.uint32(t),t&&this._push(o,t,e),this},s._configure()},1102:function(e){e.exports=function(){"use strict";function e(e,n,r,s,o){!function e(i,n,r,s,o){for(;s>r;){if(s-r>600){var a=s-r+1,l=n-r+1,c=Math.log(a),h=.5*Math.exp(2*c/3),u=.5*Math.sqrt(c*h*(a-h)/a)*(l-a/2<0?-1:1);e(i,n,Math.max(r,Math.floor(n-l*h/a+u)),Math.min(s,Math.floor(n+(a-l)*h/a+u)),o)}var d=i[n],m=r,p=s;for(t(i,r,n),o(i[s],d)>0&&t(i,r,s);m<p;){for(t(i,m,p),m++,p--;o(i[m],d)<0;)m++;for(;o(i[p],d)>0;)p--}0===o(i[r],d)?t(i,r,p):t(i,++p,s),p<=n&&(r=p+1),n<=p&&(s=p-1)}}(e,n,r||0,s||e.length-1,o||i)}function t(e,t,i){var n=e[t];e[t]=e[i],e[i]=n}function i(e,t){return e<t?-1:e>t?1:0}var n=function(e){void 0===e&&(e=9),this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function r(e,t,i){if(!i)return t.indexOf(e);for(var n=0;n<t.length;n++)if(i(e,t[n]))return n;return-1}function s(e,t){o(e,0,e.children.length,t,e)}function o(e,t,i,n,r){r||(r=p(null)),r.minX=1/0,r.minY=1/0,r.maxX=-1/0,r.maxY=-1/0;for(var s=t;s<i;s++){var o=e.children[s];a(r,e.leaf?n(o):o)}return r}function a(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function l(e,t){return e.minX-t.minX}function c(e,t){return e.minY-t.minY}function h(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function u(e){return e.maxX-e.minX+(e.maxY-e.minY)}function d(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function m(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function p(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function f(t,i,n,r,s){for(var o=[i,n];o.length;)if(!((n=o.pop())-(i=o.pop())<=r)){var a=i+Math.ceil((n-i)/r/2)*r;e(t,a,i,n,s),o.push(i,a,a,n)}}return n.prototype.all=function(){return this._all(this.data,[])},n.prototype.search=function(e){var t=this.data,i=[];if(!m(e,t))return i;for(var n=this.toBBox,r=[];t;){for(var s=0;s<t.children.length;s++){var o=t.children[s],a=t.leaf?n(o):o;m(e,a)&&(t.leaf?i.push(o):d(e,a)?this._all(o,i):r.push(o))}t=r.pop()}return i},n.prototype.collides=function(e){var t=this.data;if(!m(e,t))return!1;for(var i=[];t;){for(var n=0;n<t.children.length;n++){var r=t.children[n],s=t.leaf?this.toBBox(r):r;if(m(e,s)){if(t.leaf||d(e,s))return!0;
vendor: 9,931 bytes, line 949
949i.push(r)}}t=i.pop()}return!1},n.prototype.load=function(e){if(!e||!e.length)return this;if(e.length<this._minEntries){for(var t=0;t<e.length;t++)this.insert(e[t]);return this}var i=this._build(e.slice(),0,e.length-1,0);if(this.data.children.length)if(this.data.height===i.height)this._splitRoot(this.data,i);else{if(this.data.height<i.height){var n=this.data;this.data=i,i=n}this._insert(i,this.data.height-i.height-1,!0)}else this.data=i;return this},n.prototype.insert=function(e){return e&&this._insert(e,this.data.height-1),this},n.prototype.clear=function(){return this.data=p([]),this},n.prototype.remove=function(e,t){if(!e)return this;for(var i,n,s,o=this.data,a=this.toBBox(e),l=[],c=[];o||l.length;){if(o||(o=l.pop(),n=l[l.length-1],i=c.pop(),s=!0),o.leaf){var h=r(e,o.children,t);if(-1!==h)return o.children.splice(h,1),l.push(o),this._condense(l),this}s||o.leaf||!d(o,a)?n?(i++,o=n.children[i],s=!1):o=null:(l.push(o),c.push(i),i=0,n=o,o=o.children[0])}return this},n.prototype.toBBox=function(e){return e},n.prototype.compareMinX=function(e,t){return e.minX-t.minX},n.prototype.compareMinY=function(e,t){return e.minY-t.minY},n.prototype.toJSON=function(){return this.data},n.prototype.fromJSON=function(e){return this.data=e,this},n.prototype._all=function(e,t){for(var i=[];e;)e.leaf?t.push.apply(t,e.children):i.push.apply(i,e.children),e=i.pop();return t},n.prototype._build=function(e,t,i,n){var r,o=i-t+1,a=this._maxEntries;if(o<=a)return s(r=p(e.slice(t,i+1)),this.toBBox),r;n||(n=Math.ceil(Math.log(o)/Math.log(a)),a=Math.ceil(o/Math.pow(a,n-1))),(r=p([])).leaf=!1,r.height=n;var l=Math.ceil(o/a),c=l*Math.ceil(Math.sqrt(a));f(e,t,i,c,this.compareMinX);for(var h=t;h<=i;h+=c){var u=Math.min(h+c-1,i);f(e,h,u,l,this.compareMinY);for(var d=h;d<=u;d+=l){var m=Math.min(d+l-1,u);r.children.push(this._build(e,d,m,n-1))}}return s(r,this.toBBox),r},n.prototype._chooseSubtree=function(e,t,i,n){for(;n.push(t),!t.leaf&&n.length-1!==i;){for(var r=1/0,s=1/0,o=void 0,a=0;a<t.children.length;a++){var l=t.children[a],c=h(l),u=(d=e,m=l,(Math.max(m.maxX,d.maxX)-Math.min(m.minX,d.minX))*(Math.max(m.maxY,d.maxY)-Math.min(m.minY,d.minY))-c);u<s?(s=u,r=c<r?c:r,o=l):u===s&&c<r&&(r=c,o=l)}t=o||t.children[0]}var d,m;return t},n.prototype._insert=function(e,t,i){var n=i?e:this.toBBox(e),r=[],s=this._chooseSubtree(n,this.data,t,r);for(s.children.push(e),a(s,n);t>=0&&r[t].children.length>this._maxEntries;)this._split(r,t),t--;this._adjustParentBBoxes(n,r,t)},n.prototype._split=function(e,t){var i=e[t],n=i.children.length,r=this._minEntries;this._chooseSplitAxis(i,r,n);var o=this._chooseSplitIndex(i,r,n),a=p(i.children.splice(o,i.children.length-o));a.height=i.height,a.leaf=i.leaf,s(i,this.toBBox),s(a,this.toBBox),t?e[t-1].children.push(a):this._splitRoot(i,a)},n.prototype._splitRoot=function(e,t){this.data=p([e,t]),this.data.height=e.height+1,this.data.leaf=!1,s(this.data,this.toBBox)},n.prototype._chooseSplitIndex=function(e,t,i){for(var n,r,s,a,l,c,u,d=1/0,m=1/0,p=t;p<=i-t;p++){var f=o(e,0,p,this.toBBox),g=o(e,p,i,this.toBBox),v=(r=f,s=g,void 0,void 0,void 0,void 0,a=Math.max(r.minX,s.minX),l=Math.max(r.minY,s.minY),c=Math.min(r.maxX,s.maxX),u=Math.min(r.maxY,s.maxY),Math.max(0,c-a)*Math.max(0,u-l)),y=h(f)+h(g);v<d?(d=v,n=p,m=y<m?y:m):v===d&&y<m&&(m=y,n=p)}return n||i-t},n.prototype._chooseSplitAxis=function(e,t,i){var n=e.leaf?this.compareMinX:l,r=e.leaf?this.compareMinY:c;this._allDistMargin(e,t,i,n)<this._allDistMargin(e,t,i,r)&&e.children.sort(n)},n.prototype._allDistMargin=function(e,t,i,n){e.children.sort(n);for(var r=this.toBBox,s=o(e,0,t,r),l=o(e,i-t,i,r),c=u(s)+u(l),h=t;h<i-t;h++){var d=e.children[h];a(s,e.leaf?r(d):d),c+=u(s)}for(var m=i-t-1;m>=t;m--){var p=e.children[m];a(l,e.leaf?r(p):p),c+=u(l)}return c},n.prototype._adjustParentBBoxes=function(e,t,i){for(var n=i;n>=0;n--)a(t[n],e)},n.prototype._condense=function(e){for(var t=e.length-1,i=void 0;t>=0;t--)0===e[t].children.length?t>0?(i=e[t-1].children).splice(i.indexOf(e[t]),1):this.clear():s(e[t],this.toBBox)},n}()},82:(e,t,i)=>{"use strict";i.r(t),i.d(t,{ACESFilmicToneMapping:()=>ie,AddEquation:()=>S,AddOperation:()=>$,AdditiveAnimationBlendMode:()=>qt,AdditiveBlending:()=>b,AlphaFormat:()=>Ve,AlwaysDepth:()=>G,AlwaysStencilFunc:()=>Mi,AmbientLight:()=>sd,AmbientLightProbe:()=>wd,AnimationClip:()=>Lu,AnimationLoader:()=>Bu,AnimationMixer:()=>em,AnimationObjectGroup:()=>Jd,AnimationUtils:()=>vu,ArcCurve:()=>Jc,ArrayCamera:()=>wl,ArrowHelper:()=>jm,Audio:()=>Od,AudioAnalyser:()=>Nd,AudioContext:()=>_d,AudioListener:()=>Dd,AudioLoader:()=>xd,AxesHelper:()=>Hm,AxisHelper:()=>_p,BackSide:()=>f,BasicDepthPacking:()=>ri,BasicShadowMap:()=>h,BinaryTextureLoader:()=>Tp,Bone:()=>ac,BooleanKeyframeTrack:()=>Mu,BoundingBoxHelper:()=>xp,Box2:()=>hm,Box3:()=>gn,Box3Helper:()=>Bm,BoxBufferGeometry:()=>Ms,BoxGeometry:()=>Ms,BoxHelper:()=>Um,BufferAttribute:()=>Nr,BufferGeometry:()=>ns,BufferGeometryLoader:()=>dd,ByteType:()=>Se,Cache:()=>Du,Camera:()=>Cs,CameraHelper:()=>Im,CanvasRenderer:()=>Ep,CanvasTexture:()=>Bc,CatmullRomCurve3:()=>rh,CineonToneMapping:()=>te,CircleBufferGeometry:()=>zc,CircleGeometry:()=>zc,ClampToEdgeWrapping:()=>de,Clock:()=>Ed,Color:()=>Fr,ColorKeyframeTrack:()=>Tu,CompressedTexture:()=>Uc,CompressedTextureLoader:()=>Nu,ConeBufferGeometry:()=>Gc,ConeGeometry:()=>Gc,CubeCamera:()=>Rs,CubeReflectionMapping:()=>se,CubeRefractionMapping:()=>oe,CubeTexture:()=>Ds,CubeTextureLoader:()=>ku,CubeUVReflectionMapping:()=>ce,CubeUVRefractionMapping:()=>he,CubicBezierCurve:()=>lh,CubicBezierCurve3:()=>ch,CubicInterpolant:()=>_u,CullFaceBack:()=>a,CullFaceFront:()=>l,CullFaceFrontBack:()=>c,CullFaceNone:()=>o,Curve:()=>Kc,CurvePath:()=>gh,CustomBlending:()=>T,CustomToneMapping:()=>ne,CylinderBufferGeometry:()=>kc,CylinderGeometry:()=>kc,Cylindrical:()=>lm,DataTexture:()=>lc,DataTexture2DArray:()=>Ao,DataTexture3D:()=>Oo,DataTextureLoader:()=>Gu,DataUtils:()=>Zm,DecrementStencilOp:()=>di,DecrementWrapStencilOp:()=>pi,DefaultLoadingManager:()=>Iu,DepthFormat:()=>Ge,DepthStencilFormat:()=>je,DepthTexture:()=>Nc,DirectionalLight:()=>rd,DirectionalLightHelper:()=>Rm,DiscreteInterpolant:()=>bu,DodecahedronBufferGeometry:()=>Hc,DodecahedronGeometry:()=>Hc,DoubleSide:()=>g,DstAlphaFactor:()=>V,DstColorFactor:()=>B,DynamicBufferAttribute:()=>cp,DynamicCopyUsage:()=>Ri,DynamicDrawUsage:()=>Si,DynamicReadUsage:()=>Ci,EdgesGeometry:()=>Yc,EdgesHelper:()=>bp,EllipseCurve:()=>$c,EqualDepth:()=>W,EqualStencilFunc:()=>yi,EquirectangularReflectionMapping:()=>ae,EquirectangularRefractionMapping:()=>le,Euler:()=>er,EventDispatcher:()=>Fi,ExtrudeBufferGeometry:()=>qh,ExtrudeGeometry:()=>qh,FaceColors:()=>Jm,FileLoader:()=>Uu,FlatShading:()=>v,Float16BufferAttribute:()=>Xr,Float32Attribute:()=>vp,Float32BufferAttribute:()=>Zr,Float64Attribute:()=>yp,Float64BufferAttribute:()=>Yr,FloatType:()=>Le,Fog:()=>Rl,FogExp2:()=>Ll,Font:()=>Op,FontLoader:()=>Dp,FrontSide:()=>p,Frustum:()=>zs,GLBufferAttribute:()=>nm,GLSL1:()=>Oi,GLSL3:()=>Ii,GammaEncoding:()=>Jt,GreaterDepth:()=>X,GreaterEqualDepth:()=>q,GreaterEqualStencilFunc:()=>wi,GreaterStencilFunc:()=>xi,GridHelper:()=>Em,Group:()=>Ml,HalfFloatType:()=>Re,HemisphereLight:()=>Wu,HemisphereLightHelper:()=>Sm,HemisphereLightProbe:()=>bd,IcosahedronBufferGeometry:()=>Zh,IcosahedronGeometry:()=>Zh,ImageBitmapLoader:()=>vd,ImageLoader:()=>zu,ImageUtils:()=>rn,ImmediateRenderObject:()=>Ip,IncrementStencilOp:()=>ui,IncrementWrapStencilOp:()=>mi,InstancedBufferAttribute:()=>dc,InstancedBufferGeometry:()=>ud,InstancedInterleavedBuffer:()=>im,InstancedMesh:()=>vc,Int16Attribute:()=>mp,Int16BufferAttribute:()=>jr,Int32Attribute:()=>fp,Int32BufferAttribute:()=>Wr,Int8Attribute:()=>hp,Int8BufferAttribute:()=>zr,IntType:()=>Ce,InterleavedBuffer:()=>Ol,InterleavedBufferAttribute:()=>Fl,Interpolant:()=>yu,InterpolateDiscrete:()=>Nt,InterpolateLinear:()=>zt,InterpolateSmooth:()=>kt,InvertStencilOp:()=>fi,JSONLoader:()=>Ap,KeepStencilOp:()=>ci,KeyframeTrack:()=>wu,LOD:()=>ec,LatheBufferGeometry:()=>Yh,LatheGeometry:()=>Yh,Layers:()=>tr,LensFlare:()=>Pp,LessDepth:()=>j,LessEqualDepth:()=>H,LessEqualStencilFunc:()=>_i,LessStencilFunc:()=>vi,Light:()=>Hu,LightProbe:()=>ld,Line:()=>Tc,Line3:()=>mm,LineBasicMaterial:()=>yc,LineCurve:()=>hh,LineCurve3:()=>uh,LineDashedMaterial:()=>fu,LineLoop:()=>Cc,LinePieces:()=>Km,LineSegments:()=>Ac,LineStrip:()=>Ym,LinearEncoding:()=>Kt,LinearFilter:()=>_e,LinearInterpolant:()=>xu,LinearMipMapLinearFilter:()=>Me,LinearMipMapNearestFilter:()=>be,LinearMipmapLinearFilter:()=>we,LinearMipmapNearestFilter:()=>xe,LinearToneMapping:()=>Q,Loader:()=>Fu,LoaderUtils:()=>hd,LoadingManager:()=>Ou,LogLuvEncoding:()=>ei,LoopOnce:()=>Vt,LoopPingPong:()=>Bt,LoopRepeat:()=>Ut,LuminanceAlphaFormat:()=>ze,LuminanceFormat:()=>Ne,MOUSE:()=>r,Material:()=>Cr,MaterialLoader:()=>cd,Math:()=>Zi,MathUtils:()=>Zi,Matrix3:()=>Ki,Matrix4:()=>Hn,MaxEquation:()=>P,Mesh:()=>bs,MeshBasicMaterial:()=>Vr,MeshDepthMaterial:()=>pl,MeshDistanceMaterial:()=>fl,MeshFaceMaterial:()=>ep,MeshLambertMaterial:()=>mu,MeshMatcapMaterial:()=>pu,MeshNormalMaterial:()=>du,MeshPhongMaterial:()=>hu,MeshPhysicalMaterial:()=>cu,MeshStandardMaterial:()=>lu,MeshToonMaterial:()=>uu,MinEquation:()=>C,MirroredRepeatWrapping:()=>me,MixOperation:()=>K,MultiMaterial:()=>tp,MultiplyBlending:()=>M,MultiplyOperation:()=>Y,NearestFilter:()=>pe,NearestMipMapLinearFilter:()=>ye,NearestMipMapNearestFilter:()=>ge,NearestMipmapLinearFilter:()=>ve,NearestMipmapNearestFilter:()=>fe,NeverDepth:()=>k,NeverStencilFunc:()=>gi,NoBlending:()=>_,NoColors:()=>$m,NoToneMapping:()=>J,NormalAnimationBlendMode:()=>Wt,NormalBlending:()=>x,NotEqualDepth:()=>Z,NotEqualStencilFunc:()=>bi,NumberKeyframeTrack:()=>Su,Object3D:()=>fr,ObjectLoader:()=>md,ObjectSpaceNormalMap:()=>ai,OctahedronBufferGeometry:()=>Kh,OctahedronGeometry:()=>Kh,OneFactor:()=>R,OneMinusDstAlphaFactor:()=>U,OneMinusDstColorFactor:()=>N,OneMinusSrcAlphaFactor:()=>F,OneMinusSrcColorFactor:()=>
949O,OrthographicCamera:()=>Qs,PCFShadowMap:()=>u,PCFSoftShadowMap:()=>d,PMREMGenerator:()=>fo,ParametricGeometry:()=>Lp,Particle:()=>np,ParticleBasicMaterial:()=>op,ParticleSystem:()=>rp,ParticleSystemMaterial:()=>ap,Path:()=>vh,PerspectiveCamera:()=>Ps,Plane:()=>Us,PlaneBufferGeometry:()=>js,PlaneGeometry:()=>js,PlaneHelper:()=>Nm,PointCloud:()=>ip,PointCloudMaterial:()=>sp,PointLight:()=>id,PointLightHelper:()=>bm,Points:()=>Ic,PointsMaterial:()=>Pc,PolarGridHelper:()=>Am,PolyhedronBufferGeometry:()=>jc,PolyhedronGeometry:()=>jc,PositionalAudio:()=>Bd,PropertyBinding:()=>$d,PropertyMixer:()=>zd,QuadraticBezierCurve:()=>dh,QuadraticBezierCurve3:()=>mh,Quaternion:()=>dn,QuaternionKeyframeTrack:()=>Au,QuaternionLinearInterpolant:()=>Eu,REVISION:()=>n,RGBADepthPacking:()=>si,RGBAFormat:()=>Be,RGBAIntegerFormat:()=>Ye,RGBA_ASTC_10x10_Format:()=>yt,RGBA_ASTC_10x5_Format:()=>ft,RGBA_ASTC_10x6_Format:()=>gt,RGBA_ASTC_10x8_Format:()=>vt,RGBA_ASTC_12x10_Format:()=>_t,RGBA_ASTC_12x12_Format:()=>xt,RGBA_ASTC_4x4_Format:()=>at,RGBA_ASTC_5x4_Format:()=>lt,RGBA_ASTC_5x5_Format:()=>ct,RGBA_ASTC_6x5_Format:()=>ht,RGBA_ASTC_6x6_Format:()=>ut,RGBA_ASTC_8x5_Format:()=>dt,RGBA_ASTC_8x6_Format:()=>mt,RGBA_ASTC_8x8_Format:()=>pt,RGBA_BPTC_Format:()=>bt,RGBA_ETC2_EAC_Format:()=>ot,RGBA_PVRTC_2BPPV1_Format:()=>nt,RGBA_PVRTC_4BPPV1_Format:()=>it,RGBA_S3TC_DXT1_Format:()=>$e,RGBA_S3TC_DXT3_Format:()=>Je,RGBA_S3TC_DXT5_Format:()=>Qe,RGBDEncoding:()=>ni,RGBEEncoding:()=>Qt,RGBEFormat:()=>ke,RGBFormat:()=>Ue,RGBIntegerFormat:()=>Ze,RGBM16Encoding:()=>ii,RGBM7Encoding:()=>ti,RGB_ETC1_Format:()=>rt,RGB_ETC2_Format:()=>st,RGB_PVRTC_2BPPV1_Format:()=>tt,RGB_PVRTC_4BPPV1_Format:()=>et,RGB_S3TC_DXT1_Format:()=>Ke,RGFormat:()=>qe,RGIntegerFormat:()=>Xe,RawShaderMaterial:()=>eo,Ray:()=>jn,Raycaster:()=>rm,RectAreaLight:()=>od,RedFormat:()=>He,RedIntegerFormat:()=>We,ReinhardToneMapping:()=>ee,RepeatWrapping:()=>ue,ReplaceStencilOp:()=>hi,ReverseSubtractEquation:()=>A,RingBufferGeometry:()=>$h,RingGeometry:()=>$h,SRGB8_ALPHA8_ASTC_10x10_Format:()=>Ot,SRGB8_ALPHA8_ASTC_10x5_Format:()=>Lt,SRGB8_ALPHA8_ASTC_10x6_Format:()=>Rt,SRGB8_ALPHA8_ASTC_10x8_Format:()=>Dt,SRGB8_ALPHA8_ASTC_12x10_Format:()=>It,SRGB8_ALPHA8_ASTC_12x12_Format:()=>Ft,SRGB8_ALPHA8_ASTC_4x4_Format:()=>wt,SRGB8_ALPHA8_ASTC_5x4_Format:()=>Mt,SRGB8_ALPHA8_ASTC_5x5_Format:()=>Tt,SRGB8_ALPHA8_ASTC_6x5_Format:()=>St,SRGB8_ALPHA8_ASTC_6x6_Format:()=>Et,SRGB8_ALPHA8_ASTC_8x5_Format:()=>At,SRGB8_ALPHA8_ASTC_8x6_Format:()=>Ct,SRGB8_ALPHA8_ASTC_8x8_Format:()=>Pt,Scene:()=>Dl,SceneUtils:()=>Cp,ShaderChunk:()=>Hs,ShaderLib:()=>qs,ShaderMaterial:()=>As,ShadowMaterial:()=>au,Shape:()=>yh,ShapeBufferGeometry:()=>Jh,ShapeGeometry:()=>Jh,ShapePath:()=>Wm,ShapeUtils:()=>jh,ShortType:()=>Ee,Skeleton:()=>uc,SkeletonHelper:()=>_m,SkinnedMesh:()=>oc,SmoothShading:()=>y,Sphere:()=>Fn,SphereBufferGeometry:()=>Qh,SphereGeometry:()=>Qh,Spherical:()=>am,SphericalHarmonics3:()=>ad,SplineCurve:()=>ph,SpotLight:()=>$u,SpotLightHelper:()=>fm,Sprite:()=>Kl,SpriteMaterial:()=>Vl,SrcAlphaFactor:()=>I,SrcAlphaSaturateFactor:()=>z,SrcColorFactor:()=>D,StaticCopyUsage:()=>Li,StaticDrawUsage:()=>Ti,StaticReadUsage:()=>Ai,StereoCamera:()=>Sd,StreamCopyUsage:()=>Di,StreamDrawUsage:()=>Ei,StreamReadUsage:()=>Pi,StringKeyframeTrack:()=>Cu,SubtractEquation:()=>E,SubtractiveBlending:()=>w,TOUCH:()=>s,TangentSpaceNormalMap:()=>oi,TetrahedronBufferGeometry:()=>eu,TetrahedronGeometry:()=>eu,TextGeometry:()=>Rp,Texture:()=>on,TextureLoader:()=>ju,TorusBufferGeometry:()=>tu,TorusGeometry:()=>tu,TorusKnotBufferGeometry:()=>iu,TorusKnotGeometry:()=>iu,Triangle:()=>Er,TriangleFanDrawMode:()=>Yt,TriangleStripDrawMode:()=>Zt,TrianglesDrawMode:()=>Xt,TubeBufferGeometry:()=>nu,TubeGeometry:()=>nu,UVMapping:()=>re,Uint16Attribute:()=>pp,Uint16BufferAttribute:()=>Hr,Uint32Attribute:()=>gp,Uint32BufferAttribute:()=>qr,Uint8Attribute:()=>up,Uint8BufferAttribute:()=>kr,Uint8ClampedAttribute:()=>dp,Uint8ClampedBufferAttribute:()=>Gr,Uniform:()=>tm,UniformsLib:()=>Ws,UniformsUtils:()=>Es,UnsignedByteType:()=>Te,UnsignedInt248Type:()=>Fe,UnsignedIntType:()=>Pe,UnsignedShort4444Type:()=>De,UnsignedShort5551Type:()=>Oe,UnsignedShort565Type:()=>Ie,UnsignedShortType:()=>Ae,VSMShadowMap:()=>m,Vector2:()=>Yi,Vector3:()=>mn,Vector4:()=>ln,VectorKeyframeTrack:()=>Pu,Vertex:()=>lp,VertexColors:()=>Qm,VideoTexture:()=>Vc,WebGL1Renderer:()=>
vendor: 98,771 bytes, line 949
949Pl,WebGLCubeRenderTarget:()=>Os,WebGLMultipleRenderTargets:()=>hn,WebGLMultisampleRenderTarget:()=>un,WebGLRenderTarget:()=>cn,WebGLRenderTargetCube:()=>Sp,WebGLRenderer:()=>Cl,WebGLUtils:()=>bl,WireframeGeometry:()=>ru,WireframeHelper:()=>wp,WrapAroundEnding:()=>Ht,XHRLoader:()=>Mp,ZeroCurvatureEnding:()=>Gt,ZeroFactor:()=>L,ZeroSlopeEnding:()=>jt,ZeroStencilOp:()=>li,sRGBEncoding:()=>$t});const n="134",r={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},s={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},o=0,a=1,l=2,c=3,h=0,u=1,d=2,m=3,p=0,f=1,g=2,v=1,y=2,_=0,x=1,b=2,w=3,M=4,T=5,S=100,E=101,A=102,C=103,P=104,L=200,R=201,D=202,O=203,I=204,F=205,V=206,U=207,B=208,N=209,z=210,k=0,G=1,j=2,H=3,W=4,q=5,X=6,Z=7,Y=0,K=1,$=2,J=0,Q=1,ee=2,te=3,ie=4,ne=5,re=300,se=301,oe=302,ae=303,le=304,ce=306,he=307,ue=1e3,de=1001,me=1002,pe=1003,fe=1004,ge=1004,ve=1005,ye=1005,_e=1006,xe=1007,be=1007,we=1008,Me=1008,Te=1009,Se=1010,Ee=1011,Ae=1012,Ce=1013,Pe=1014,Le=1015,Re=1016,De=1017,Oe=1018,Ie=1019,Fe=1020,Ve=1021,Ue=1022,Be=1023,Ne=1024,ze=1025,ke=Be,Ge=1026,je=1027,He=1028,We=1029,qe=1030,Xe=1031,Ze=1032,Ye=1033,Ke=33776,$e=33777,Je=33778,Qe=33779,et=35840,tt=35841,it=35842,nt=35843,rt=36196,st=37492,ot=37496,at=37808,lt=37809,ct=37810,ht=37811,ut=37812,dt=37813,mt=37814,pt=37815,ft=37816,gt=37817,vt=37818,yt=37819,_t=37820,xt=37821,bt=36492,wt=37840,Mt=37841,Tt=37842,St=37843,Et=37844,At=37845,Ct=37846,Pt=37847,Lt=37848,Rt=37849,Dt=37850,Ot=37851,It=37852,Ft=37853,Vt=2200,Ut=2201,Bt=2202,Nt=2300,zt=2301,kt=2302,Gt=2400,jt=2401,Ht=2402,Wt=2500,qt=2501,Xt=0,Zt=1,Yt=2,Kt=3e3,$t=3001,Jt=3007,Qt=3002,ei=3003,ti=3004,ii=3005,ni=3006,ri=3200,si=3201,oi=0,ai=1,li=0,ci=7680,hi=7681,ui=7682,di=7683,mi=34055,pi=34056,fi=5386,gi=512,vi=513,yi=514,_i=515,xi=516,bi=517,wi=518,Mi=519,Ti=35044,Si=35048,Ei=35040,Ai=35045,Ci=35049,Pi=35041,Li=35046,Ri=35050,Di=35042,Oi="100",Ii="300 es";class Fi{addEventListener(e,t){void 0===this._listeners&&(this._listeners={});const i=this._listeners;void 0===i[e]&&(i[e]=[]),-1===i[e].indexOf(t)&&i[e].push(t)}hasEventListener(e,t){if(void 0===this._listeners)return!1;const i=this._listeners;return void 0!==i[e]&&-1!==i[e].indexOf(t)}removeEventListener(e,t){if(void 0===this._listeners)return;const i=this._listeners[e];if(void 0!==i){const e=i.indexOf(t);-1!==e&&i.splice(e,1)}}dispatchEvent(e){if(void 0===this._listeners)return;const t=this._listeners[e.type];if(void 0!==t){e.target=this;const i=t.slice(0);for(let t=0,n=i.length;t<n;t++)i[t].call(this,e);e.target=null}}}let Vi=1234567;const Ui=Math.PI/180,Bi=180/Math.PI,Ni=[];for(let e=0;e<256;e++)Ni[e]=(e<16?"0":"")+e.toString(16);const zi="undefined"!=typeof crypto&&"randomUUID"in crypto;function ki(){if(zi)return crypto.randomUUID().toUpperCase();const e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,i=4294967295*Math.random()|0,n=4294967295*Math.random()|0;return(Ni[255&e]+Ni[e>>8&255]+Ni[e>>16&255]+Ni[e>>24&255]+"-"+Ni[255&t]+Ni[t>>8&255]+"-"+Ni[t>>16&15|64]+Ni[t>>24&255]+"-"+Ni[63&i|128]+Ni[i>>8&255]+"-"+Ni[i>>16&255]+Ni[i>>24&255]+Ni[255&n]+Ni[n>>8&255]+Ni[n>>16&255]+Ni[n>>24&255]).toUpperCase()}function Gi(e,t,i){return Math.max(t,Math.min(i,e))}function ji(e,t){return(e%t+t)%t}function Hi(e,t,i){return(1-i)*e+i*t}function Wi(e){return!(e&e-1)&&0!==e}function qi(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))}function Xi(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))}var Zi=Object.freeze({__proto__:null,DEG2RAD:Ui,RAD2DEG:Bi,generateUUID:ki,clamp:Gi,euclideanModulo:ji,mapLinear:function(e,t,i,n,r){return n+(e-t)*(r-n)/(i-t)},inverseLerp:function(e,t,i){return e!==t?(i-e)/(t-e):0},lerp:Hi,damp:function(e,t,i,n){return Hi(e,t,1-Math.exp(-i*n))},pingpong:function(e,t=1){return t-Math.abs(ji(e,2*t)-t)},smoothstep:function(e,t,i){return e<=t?0:e>=i?1:(e=(e-t)/(i-t))*e*(3-2*e)},smootherstep:function(e,t,i){return e<=t?0:e>=i?1:(e=(e-t)/(i-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},seededRandom:function(e){return void 0!==e&&(Vi=e%2147483647),Vi=16807*Vi%2147483647,(Vi-1)/2147483646},degToRad:function(e){return e*Ui},radToDeg:function(e){return e*Bi},isPowerOfTwo:Wi,ceilPowerOfTwo:qi,floorPowerOfTwo:Xi,setQuaternionFromProperEuler:function(e,t,i,n,r){const s=Math.cos,o=Math.sin,a=s(i/2),l=o(i/2),c=s((t+n)/2),h=o((t+n)/2),u=s((t-n)/2),d=o((t-n)/2),m=s((n-t)/2),p=o((n-t)/2);switch(r){case"XYX":e.set(a*h,l*u,l*d,a*c);break;case"YZY":e.set(l*d,a*h,l*u,a*c);break;case"ZXZ":e.set(l*u,l*d,a*h,a*c);break;case"XZX":e.set(a*h,l*p,l*m,a*c);break;case"YXY":e.set(l*m,a*h,l*p,a*c);break;case"ZYZ":e.set(l*p,l*m,a*h,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}});class Yi{constructor(e=0,t=0){this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e,t){return void 0!==t?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e,t){return void 0!==t?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,i=this.y,n=e.elements;return this.x=n[0]*t+n[3]*i+n[6],this.y=n[1]*t+n[4]*i+n[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y;return t*t+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t,i){return void 0!==i&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const i=Math.cos(t),n=Math.sin(t),r=this.x-e.x,s=this.y-e.y;return this.x=r*i-s*n+e.x,this.y=r*n+s*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}Yi.prototype.isVector2=!0;class Ki{constructor(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}set(e,t,i,n,r,s,o,a,l){const c=this.elements;return c[0]=e,c[1]=n,c[2]=o,c[3]=t,c[4]=r,c[5]=a,c[6]=i,c[7]=s,c[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,n=t.elements,r=this.elements,s=i[0],o=i[3],a=i[6],l=i[1],c=i[4],h=i[7],u=i[2],d=i[5],m=i[8],p=n[0],f=n[3],g=n[6],v=n[1],y=n[4],_=n[7],x=n[2],b=n[5],w=n[8];return r[0]=s*p+o*v+a*x,r[3]=s*f+o*y+a*b,r[6]=s*g+o*_+a*w,r[1]=l*p+c*v+h*x,r[4]=l*f+c*y+h*b,r[7]=l*g+c*_+h*w,r[2]=u*p+d*v+m*x,r[5]=u*f+d*y+m*b,r[8]=u*g+d*_+m*w,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[1],n=e[2],r=e[3],s=e[4],o=e[5],a=e[6],l=e[7],c=e[8];return t*s*c-t*o*l-i*r*c+i*o*a+n*r*l-n*s*a}invert(){const e=this.elements,t=e[0],i=e[1],n=e[2],r=e[3],s=e[4],o=e[5],a=e[6],l=e[7],c=e[8],h=c*s-o*l,u=o*a-c*r,d=l*r-s*a,m=t*h+i*u+n*d;if(0===m)return this.set(0,0,0,0,0,0,0,0,0);const p=1/m;return e[0]=h*p,e[1]=(n*l-c*i)*p,e[2]=(o*i-n*s)*p,e[3]=u*p,e[4]=(c*t-n*a)*p,e[5]=(n*r-o*t)*p,e[6]=d*p,e[7]=(i*a-l*t)*p,e[8]=(s*t-i*r)*p,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,i,n,r,s,o){const a=Math.cos(r),l=Math.sin(r);return this.set(i*a,i*l,-i*(a*s+l*o)+s+e,-n*l,n*a,-n*(-l*s+a*o)+o+t,0,0,1),this}scale(e,t){const i=this.elements;return i[0]*=e,i[3]*=e,i[6]*=e,i[1]*=t,i[4]*=t,i[7]*=t,this}rotate(e){const t=Math.cos(e),i=Math.sin(e),n=this.elements,r=n[0],s=n[3],o=n[6],a=n[1],l=n[4],c=n[7];return n[0]=t*r+i*a,n[3]=t*s+i*l,n[6]=t*o+i*c,n[1]=-i*r+t*a,n[4]=-i*s+t*l,n[7]=-i*o+t*c,this}translate(e,t){const i=this.elements;return i[0]+=e*i[2],i[3]+=e*i[5],i[6]+=e*i[8],i[1]+=t*i[2],i[4]+=t*i[5],i[7]+=t*i[8],this}equals(e){const t=this.elements,i=e.elements;for(let e=0;e<9;e++)if(t[e]!==i[e])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return(new this.constructor).fromArray(this.elements)}}function $i(e){if(0===e.length)return-1/0;let t=e[0];for(let i=1,n=e.length;i<n;++i)e[i]>t&&(t=e[i]);return t}Ki.prototype.isMatrix3=!0;const Ji={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function Qi(e,t){return new Ji[e](t)}function en(e){return document.createElementNS("http://www.w3.org/1999/xhtml",e)}function tn(e,t=0){let i=3735928559^t,n=1103547991^t;for(let t,r=0;r<e.length;r++)t=e.charCodeAt(r),i=Math.imul(i^t,2654435761),n=Math.imul(n^t,1597334677);return i=Math.imul(i^i>>>16,2246822507)^Math.imul(n^n>>>13,3266489909),n=Math.imul(n^n>>>16,2246822507)^Math.imul(i^i>>>13,3266489909),4294967296*(2097151&n)+(i>>>0)}let nn;class rn{static getDataURL(e){if(/^data:/i.test(e.src))return e.src;if("undefined"==typeof HTMLCanvasElement)return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{void 0===nn&&(nn=en("canvas")),nn.width=e.width,nn.height=e.height;const i=nn.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),t=nn}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}}let sn=0;class on extends Fi{constructor(e=on.DEFAULT_IMAGE,t=on.DEFAULT_MAPPING,i=de,n=de,r=_e,s=we,o=Be,a=Te,l=1,c=Kt){super(),Object.defineProperty(this,"id",{value:sn++}),this.uuid=ki(),this.name="",this.image=e,this.mipmaps=[],this.mapping=t,this.wrapS=i,this.wrapT=n,this.magFilter=r,this.minFilter=s,this.anisotropy=l,this.format=o,this.internalFormat=null,this.type=a,this.offset=new Yi(0,0),this.repeat=new Yi(1,1),this.center=new Yi(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Ki,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=c,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return(new this.constructor).copy(this)}copy(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this.userData=JSON.parse(JSON.stringify(e.userData)),this}toJSON(e){const t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];const i={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(void 0!==this.image){const n=this.image;if(void 0===n.uuid&&(n.uuid=ki()),!t&&void 0===e.images[n.uuid]){let t;if(Array.isArray(n)){t=[];for(let e=0,i=n.length;e<i;e++)n[e].isDataTexture?t.push(an(n[e].image)):t.push(an(n[e]))}else t=an(n);e.images[n.uuid]={uuid:n.uuid,url:t}}i.image=n.uuid}return"{}"!==JSON.stringify(this.userData)&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==re)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case ue:e.x=e.x-Math.floor(e.x);break;case de:e.x=e.x<0?0:1;break;case me:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case ue:e.y=e.y-Math.floor(e.y);break;case de:e.y=e.y<0?0:1;break;case me:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){!0===e&&this.version++}}function an(e){return"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?rn.getDataURL(e):e.data?{data:Array.prototype.slice.call(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}on.DEFAULT_IMAGE=void 0,on.DEFAULT_MAPPING=re,on.prototype.isTexture=!0;class ln{constructor(e=0,t=0,i=0,n=1){this.x=e,this.y=t,this.z=i,this.w=n}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,i,n){return this.x=e,this.y=t,this.z=i,this.w=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}add(e,t){return void 0!==t?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e,t){return void 0!==t?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,i=this.y,n=this.z,r=this.w,s=e.elements;return this.x=s[0]*t+s[4]*i+s[8]*n+s[12]*r,this.y=s[1]*t+s[5]*i+s[9]*n+s[13]*r,this.z=s[2]*t+s[6]*i+s[10]*n+s[14]*r,this.w=s[3]*t+s[7]*i+s[11]*n+s[15]*r,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,i,n,r;const s=.01,o=.1,a=e.elements,l=a[0],c=a[4],h=a[8],u=a[1],d=a[5],m=a[9],p=a[2],f=a[6],g=a[10];if(Math.abs(c-u)<s&&Math.abs(h-p)<s&&Math.abs(m-f)<s){if(Math.abs(c+u)<o&&Math.abs(h+p)<o&&Math.abs(m+f)<o&&Math.abs(l+d+g-3)<o)return this.set(1,0,0,0),this;t=Math.PI;const e=(l+1)/2,a=(d+1)/2,v=(g+1)/2,y=(c+u)/4,_=(h+p)/4,x=(m+f)/4;return e>a&&e>v?e<s?(i=0,n=.707106781,r=.707106781):(i=Math.sqrt(e),n=y/i,r=_/i):a>v?a<s?(i=.707106781,n=0,r=.707106781):(n=Math.sqrt(a),i=y/n,r=x/n):v<s?(i=.707106781,n=.707106781,r=0):(r=Math.sqrt(v),i=_/r,n=x/r),this.set(i,n,r,t),this}let v=Math.sqrt((f-m)*(f-m)+(h-p)*(h-p)+(u-c)*(u-c));return Math.abs(v)<.001&&(v=1),this.x=(f-m)/v,this.y=(h-p)/v,this.z=(u-c)/v,this.w=Math.acos((l+d+g-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t,i){return void 0!==i&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}ln.prototype.isVector4=!0;class cn extends Fi{constructor(e,t,i={}){super(),this.width=e,this.height=t,this.depth=1,this.scissor=new ln(0,0,e,t),this.scissorTest=!1,this.viewport=new ln(0,0,e,t),this.texture=new on(void 0,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.encoding),this.texture.isRenderTargetTexture=!0,this.texture.image={width:e,height:t,depth:1},this.texture.generateMipmaps=void 0!==i.generateMipmaps&&i.generateMipmaps,this.texture.internalFormat=void 0!==i.internalFormat?i.internalFormat:null,this.texture.minFilter=void 0!==i.minFilter?i.minFilter:_e,this.depthBuffer=void 0===i.depthBuffer||i.depthBuffer,this.stencilBuffer=void 0!==i.stencilBuffer&&i.stencilBuffer,this.depthTexture=void 0!==i.depthTexture?i.depthTexture:null}setTexture(e){e.image={width:this.width,height:this.height,depth:this.depth},this.texture=e}setSize(e,t,i=1){this.width===e&&this.height===t&&this.depth===i||(this.width=e,this.height=t,this.depth=i,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=i,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return(new this.constructor).copy(this)}copy(e){return this.width=e.width,this.height=e.height,this.depth=e.depth,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.image={...this.texture.image},this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this}dispose(){this.dispatchEvent({type:"dispose"})}}cn.prototype.isWebGLRenderTarget=!0;class hn extends cn{constructor(e,t,i){super(e,t);const n=this.texture;this.texture=[];for(let e=0;e<i;e++)this.texture[e]=n.clone()}setSize(e,t,i=1){if(this.width!==e||this.height!==t||this.depth!==i){this.width=e,this.height=t,this.depth=i;for(let n=0,r=this.texture.length;n<r;n++)this.texture[n].image.width=e,this.texture[n].image.height=t,this.texture[n].image.depth=i;this.dispose()}return this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t),this}copy(e){this.dispose(),this.width=e.width,this.height=e.height,this.depth=e.depth,this.viewport.set(0,0,this.width,this.height),this.scissor.set(0,0,this.width,this.height),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this.texture.length=0;for(let t=0,i=e.texture.length;t<i;t++)this.texture[t]=e.texture[t].clone();return this}}hn.prototype.isWebGLMultipleRenderTargets=!0;class un extends cn{constructor(e,t,i){super(e,t,i),this.samples=4}copy(e){return super.copy.call(this,e),this.samples=e.samples,this}}un.prototype.isWebGLMultisampleRenderTarget=!0;class dn{constructor(e=0,t=0,i=0,n=1){this._x=e,this._y=t,this._z=i,this._w=n}static slerp(e,t,i,n){return console.warn("THREE.Quaternion: Static .slerp() has been deprecated. Use qm.slerpQuaternions( qa, qb, t ) instead."),i.slerpQuaternions(e,t,n)}static slerpFlat(e,t,i,n,r,s,o){let a=i[n+0],l=i[n+1],c=i[n+2],h=i[n+3];const u=r[s+0],d=r[s+1],m=r[s+2],p=r[s+3];if(0===o)return e[t+0]=a,e[t+1]=l,e[t+2]=c,void(e[t+3]=h);if(1===o)return e[t+0]=u,e[t+1]=d,e[t+2]=m,void(e[t+3]=p);if(h!==p||a!==u||l!==d||c!==m){let e=1-o;const t=a*u+l*d+c*m+h*p,i=t>=0?1:-1,n=1-t*t;if(n>Number.EPSILON){const r=Math.sqrt(n),s=Math.atan2(r,t*i);e=Math.sin(e*s)/r,o=Math.sin(o*s)/r}const r=o*i;if(a=a*e+u*r,l=l*e+d*r,c=c*e+m*r,h=h*e+p*r,e===1-o){const e=1/Math.sqrt(a*a+l*l+c*c+h*h);a*=e,l*=e,c*=e,h*=e}}e[t]=a,e[t+1]=l,e[t+2]=c,e[t+3]=h}static multiplyQuaternionsFlat(e,t,i,n,r,s){const o=i[n],a=i[n+1],l=i[n+2],c=i[n+3],h=r[s],u=r[s+1],d=r[s+2],m=r[s+3];return e[t]=o*m+c*h+a*d-l*u,e[t+1]=a*m+c*u+l*h-o*d,e[t+2]=l*m+c*d+o*u-a*h,e[t+3]=c*m-o*h-a*u-l*d,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,i,n){return this._x=e,this._y=t,this._z=i,this._w=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){if(!e||!e.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");const i=e._x,n=e._y,r=e._z,s=e._order,o=Math.cos,a=Math.sin,l=o(i/2),c=o(n/2),h=o(r/2),u=a(i/2),d=a(n/2),m=a(r/2);switch(s){case"XYZ":this._x=u*c*h+l*d*m,this._y=l*d*h-u*c*m,this._z=l*c*m+u*d*h,this._w=l*c*h-u*d*m;break;case"YXZ":this._x=u*c*h+l*d*m,this._y=l*d*h-u*c*m,this._z=l*c*m-u*d*h,this._w=l*c*h+u*d*m;break;case"ZXY":this._x=u*c*h-l*d*m,this._y=l*d*h+u*c*m,this._z=l*c*m+u*d*h,this._w=l*c*h-u*d*m;break;case"ZYX":this._x=u*c*h-l*d*m,this._y=l*d*h+u*c*m,this._z=l*c*m-u*d*h,this._w=l*c*h+u*d*m;break;case"YZX":this._x=u*c*h+l*d*m,this._y=l*d*h+u*c*m,this._z=l*c*m-u*d*h,this._w=l*c*h-u*d*m;break;case"XZY":this._x=u*c*h-l*d*m,this._y=l*d*h-u*c*m,this._z=l*c*m+u*d*h,this._w=l*c*h+u*d*m;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return!1!==t&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const i=t/2,n=Math.sin(i);return this._x=e.x*n,this._y=e.y*n,this._z=e.z*n,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,i=t[0],n=t[4],r=t[8],s=t[1],o=t[5],a=t[9],l=t[2],c=t[6],h=t[10],u=i+o+h;if(u>0){const e=.5/Math.sqrt(u+1);this._w=.25/e,this._x=(c-a)*e,this._y=(r-l)*e,this._z=(s-n)*e}else if(i>o&&i>h){const e=2*Math.sqrt(1+i-o-h);this._w=(c-a)/e,this._x=.25*e,this._y=(n+s)/e,this._z=(r+l)/e}else if(o>h){const e=2*Math.sqrt(1+o-i-h);this._w=(r-l)/e,this._x=(n+s)/e,this._y=.25*e,this._z=(a+c)/e}else{const e=2*Math.sqrt(1+h-i-o);this._w=(s-n)/e,this._x=(r+l)/e,this._y=(a+c)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return i<Number.EPSILON?(i=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Gi(this.dot(e),-1,1)))}rotateTowards(e,t){const i=this.angleTo(e);if(0===i)return this;const n=Math.min(1,t/i);return this.slerp(e,n),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e,t){return void 0!==t?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const i=e._x,n=e._y,r=e._z,s=e._w,o=t._x,a=t._y,l=t._z,c=t._w;return this._x=i*c+s*o+n*l-r*a,this._y=n*c+s*a+r*o-i*l,this._z=r*c+s*l+i*a-n*o,this._w=s*c-i*o-n*a-r*l,this._onChangeCallback(),this}slerp(e,t){if(0===t)return this;if(1===t)return this.copy(e);const i=this._x,n=this._y,r=this._z,s=this._w;let o=s*e._w+i*e._x+n*e._y+r*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=s,this._x=i,this._y=n,this._z=r,this;const a=1-o*o;if(a<=Number.EPSILON){const e=1-t;return this._w=e*s+t*this._w,this._x=e*i+t*this._x,this._y=e*n+t*this._y,this._z=e*r+t*this._z,this.normalize(),this._onChangeCallback(),this}const l=Math.sqrt(a),c=Math.atan2(l,o),h=Math.sin((1-t)*c)/l,u=Math.sin(t*c)/l;return this._w=s*h+this._w*u,this._x=i*h+this._x*u,this._y=n*h+this._y*u,this._z=r*h+this._z*u,this._onChangeCallback(),this}slerpQuaternions(e,t,i){this.copy(e).slerp(t,i)}random(){const e=Math.random(),t=Math.sqrt(1-e),i=Math.sqrt(e),n=2*Math.PI*Math.random(),r=2*Math.PI*Math.random();return this.set(t*Math.cos(n),i*Math.sin(r),i*Math.cos(r),t*Math.sin(n))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}}dn.prototype.isQuaternion=!0;class mn{constructor(e=0,t=0,i=0){this.x=e,this.y=t,this.z=i}set(e,t,i){return void 0===i&&(i=this.z),this.x=e,this.y=t,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e,t){return void 0!==t?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e,t){return void 0!==t?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e,t){return void 0!==t?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(fn.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(fn.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,i=this.y,n=this.z,r=e.elements;return this.x=r[0]*t+r[3]*i+r[6]*n,this.y=r[1]*t+r[4]*i+r[7]*n,this.z=r[2]*t+r[5]*i+r[8]*n,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,i=this.y,n=this.z,r=e.elements,s=1/(r[3]*t+r[7]*i+r[11]*n+r[15]);return this.x=(r[0]*t+r[4]*i+r[8]*n+r[12])*s,this.y=(r[1]*t+r[5]*i+r[9]*n+r[13])*s,this.z=(r[2]*t+r[6]*i+r[10]*n+r[14])*s,this}applyQuaternion(e){const t=this.x,i=this.y,n=this.z,r=e.x,s=e.y,o=e.z,a=e.w,l=a*t+s*n-o*i,c=a*i+o*t-r*n,h=a*n+r*i-s*t,u=-r*t-s*i-o*n;return this.x=l*a+u*-r+c*-o-h*-s,this.y=c*a+u*-s+h*-r-l*-o,this.z=h*a+u*-o+l*-s-c*-r,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,i=this.y,n=this.z,r=e.elements;return this.x=r[0]*t+r[4]*i+r[8]*n,this.y=r[1]*t+r[5]*i+r[9]*n,this.z=r[2]*t+r[6]*i+r[10]*n,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e,t){return void 0!==t?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)}crossVectors(e,t){const i=e.x,n=e.y,r=e.z,s=t.x,o=t.y,a=t.z;return this.x=n*a-r*o,this.y=r*s-i*a,this.z=i*o-n*s,this}projectOnVector(e){const t=e.lengthSq();if(0===t)return this.set(0,0,0);const i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return pn.copy(this).projectOnVector(e),this.sub(pn)}reflect(e){return this.sub(pn.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(Gi(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y,n=this.z-e.z;return t*t+i*i+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,i){const n=Math.sin(t)*e;return this.x=n*Math.sin(i),this.y=Math.cos(t)*e,this.z=n*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),n=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=n,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,4*t)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,3*t)}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t,i){return void 0!==i&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=2*(Math.random()-.5),t=Math.random()*Math.PI*2,i=Math.sqrt(1-e**2);return this.x=i*Math.cos(t),this.y=i*Math.sin(t),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}mn.prototype.isVector3=!0;const pn=new mn,fn=new dn;class gn{constructor(e=new mn(1/0,1/0,1/0),t=new mn(-1/0,-1/0,-1/0)){this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){let t=1/0,i=1/0,n=1/0,r=-1/0,s=-1/0,o=-1/0;for(let a=0,l=e.length;a<l;a+=3){const l=e[a],c=e[a+1],h=e[a+2];l<t&&(t=l),c<i&&(i=c),h<n&&(n=h),l>r&&(r=l),c>s&&(s=c),h>o&&(o=h)}return this.min.set(t,i,n),this.max.set(r,s,o),this}setFromBufferAttribute(e){let t=1/0,i=1/0,n=1/0,r=-1/0,s=-1/0,o=-1/0;for(let a=0,l=e.count;a<l;a++){const l=e.getX(a),c=e.getY(a),h=e.getZ(a);l<t&&(t=l),c<i&&(i=c),h<n&&(n=h),l>r&&(r=l),c>s&&(s=c),h>o&&(o=h)}return this.min.set(t,i,n),this.max.set(r,s,o),this}setFromPoints(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const i=yn.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}setFromObject(e){return this.makeEmpty(),this.expandByObject(e)}clone(){return(new this.constructor).copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e){e.updateWorldMatrix(!1,!1);const t=e.geometry;void 0!==t&&(null===t.boundingBox&&t.computeBoundingBox(),_n.copy(t.boundingBox),_n.applyMatrix4(e.matrixWorld),this.union(_n));const i=e.children;for(let e=0,t=i.length;e<t;e++)this.expandByObject(i[e]);return this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)}intersectsSphere(e){return this.clampPoint(e.center,yn),yn.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(En),An.subVectors(this.max,En),xn.subVectors(e.a,En),bn.subVectors(e.b,En),wn.subVectors(e.c,En),Mn.subVectors(bn,xn),Tn.subVectors(wn,bn),Sn.subVectors(xn,wn);let t=[0,-Mn.z,Mn.y,0,-Tn.z,Tn.y,0,-Sn.z,Sn.y,Mn.z,0,-Mn.x,Tn.z,0,-Tn.x,Sn.z,0,-Sn.x,-Mn.y,Mn.x,0,-Tn.y,Tn.x,0,-Sn.y,Sn.x,0];return!!Ln(t,xn,bn,wn,An)&&(t=[1,0,0,0,1,0,0,0,1],!!Ln(t,xn,bn,wn,An)&&(Cn.crossVectors(Mn,Tn),t=[Cn.x,Cn.y,Cn.z],Ln(t,xn,bn,wn,An)))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return yn.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return this.getCenter(e.center),e.radius=.5*this.getSize(yn).length(),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()||(vn[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),vn[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),vn[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),vn[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),vn[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),vn[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),vn[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),vn[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(vn)),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}gn.prototype.isBox3=!0;const vn=[new mn,new mn,new mn,new mn,new mn,new mn,new mn,new mn],yn=new mn,_n=new gn,xn=new mn,bn=new mn,wn=new mn,Mn=new mn,Tn=new mn,Sn=new mn,En=new mn,An=new mn,Cn=new mn,Pn=new mn;function Ln(e,t,i,n,r){for(let s=0,o=e.length-3;s<=o;s+=3){Pn.fromArray(e,s);const o=r.x*Math.abs(Pn.x)+r.y*Math.abs(Pn.y)+r.z*Math.abs(Pn.z),a=t.dot(Pn),l=i.dot(Pn),c=n.dot(Pn);if(Math.max(-Math.max(a,l,c),Math.min(a,l,c))>o)return!1}return!0}const Rn=new gn,Dn=new mn,On=new mn,In=new mn;class Fn{constructor(e=new mn,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const i=this.center;void 0!==t?i.copy(t):Rn.setFromPoints(e).getCenter(i);let n=0;for(let t=0,r=e.length;t<r;t++)n=Math.max(n,i.distanceToSquared(e[t]));return this.radius=Math.sqrt(n),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const i=this.center.distanceToSquared(e);return t.copy(e),i>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){In.subVectors(e,this.center);const t=In.lengthSq();if(t>this.radius*this.radius){const e=Math.sqrt(t),i=.5*(e-this.radius);this.center.add(In.multiplyScalar(i/e)),this.radius+=i}return this}union(e){return On.subVectors(e.center,this.center).normalize().multiplyScalar(e.radius),this.expandByPoint(Dn.copy(e.center).add(On)),this.expandByPoint(Dn.copy(e.center).sub(On)),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const Vn=new mn,Un=new mn,Bn=new mn,Nn=new mn,zn=new mn,kn=new mn,Gn=new mn;class jn{constructor(e=new mn,t=new mn(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.direction).multiplyScalar(e).add(this.origin)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Vn)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(i).add(this.origin)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=Vn.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Vn.copy(this.direction).multiplyScalar(t).add(this.origin),Vn.distanceToSquared(e))}distanceSqToSegment(e,t,i,n){Un.copy(e).add(t).multiplyScalar(.5),Bn.copy(t).sub(e).normalize(),Nn.copy(this.origin).sub(Un);const r=.5*e.distanceTo(t),s=-this.direction.dot(Bn),o=Nn.dot(this.direction),a=-Nn.dot(Bn),l=Nn.lengthSq(),c=Math.abs(1-s*s);let h,u,d,m;if(c>0)if(h=s*a-o,u=s*o-a,m=r*c,h>=0)if(u>=-m)if(u<=m){const e=1/c;h*=e,u*=e,d=h*(h+s*u+2*o)+u*(s*h+u+2*a)+l}else u=r,h=Math.max(0,-(s*u+o)),d=-h*h+u*(u+2*a)+l;else u=-r,h=Math.max(0,-(s*u+o)),d=-h*h+u*(u+2*a)+l;else u<=-m?(h=Math.max(0,-(-s*r+o)),u=h>0?-r:Math.min(Math.max(-r,-a),r),d=-h*h+u*(u+2*a)+l):u<=m?(h=0,u=Math.min(Math.max(-r,-a),r),d=u*(u+2*a)+l):(h=Math.max(0,-(s*r+o)),u=h>0?r:Math.min(Math.max(-r,-a),r),d=-h*h+u*(u+2*a)+l);else u=s>0?-r:r,h=Math.max(0,-(s*u+o)),d=-h*h+u*(u+2*a)+l;return i&&i.copy(this.direction).multiplyScalar(h).add(this.origin),n&&n.copy(Bn).multiplyScalar(u).add(Un),d}intersectSphere(e,t){Vn.subVectors(e.center,this.origin);const i=Vn.dot(this.direction),n=Vn.dot(Vn)-i*i,r=e.radius*e.radius;if(n>r)return null;const s=Math.sqrt(r-n),o=i-s,a=i+s;return o<0&&a<0?null:o<0?this.at(a,t):this.at(o,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;const i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){const i=this.distanceToPlane(e);return null===i?null:this.at(i,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return 0===t||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,n,r,s,o,a;const l=1/this.direction.x,c=1/this.direction.y,h=1/this.direction.z,u=this.origin;return l>=0?(i=(e.min.x-u.x)*l,n=(e.max.x-u.x)*l):(i=(e.max.x-u.x)*l,n=(e.min.x-u.x)*l),c>=0?(r=(e.min.y-u.y)*c,s=(e.max.y-u.y)*c):(r=(e.max.y-u.y)*c,s=(e.min.y-u.y)*c),i>s||r>n?null:((r>i||i!=i)&&(i=r),(s<n||n!=n)&&(n=s),h>=0?(o=(e.min.z-u.z)*h,a=(e.max.z-u.z)*h):(o=(e.max.z-u.z)*h,a=(e.min.z-u.z)*h),i>a||o>n?null:((o>i||i!=i)&&(i=o),(a<n||n!=n)&&(n=a),n<0?null:this.at(i>=0?i:n,t)))}intersectsBox(e){return null!==this.intersectBox(e,Vn)}intersectTriangle(e,t,i,n,r){zn.subVectors(t,e),kn.subVectors(i,e),Gn.crossVectors(zn,kn);let s,o=this.direction.dot(Gn);if(o>0){if(n)return null;s=1}else{if(!(o<0))return null;s=-1,o=-o}Nn.subVectors(this.origin,e);const a=s*this.direction.dot(kn.crossVectors(Nn,kn));if(a<0)return null;const l=s*this.direction.dot(zn.cross(Nn));if(l<0)return null;if(a+l>o)return null;const c=-s*Nn.dot(Gn);return c<0?null:this.at(c/o,r)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}}class Hn{constructor(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}set(e,t,i,n,r,s,o,a,l,c,h,u,d,m,p,f){const g=this.elements;return g[0]=e,g[4]=t,g[8]=i,g[12]=n,g[1]=r,g[5]=s,g[9]=o,g[13]=a,g[2]=l,g[6]=c,g[10]=h,g[14]=u,g[3]=d,g[7]=m,g[11]=p,g[15]=f,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new Hn).fromArray(this.elements)}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){const t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,i=e.elements,n=1/Wn.setFromMatrixColumn(e,0).length(),r=1/Wn.setFromMatrixColumn(e,1).length(),s=1/Wn.setFromMatrixColumn(e,2).length();return t[0]=i[0]*n,t[1]=i[1]*n,t[2]=i[2]*n,t[3]=0,t[4]=i[4]*r,t[5]=i[5]*r,t[6]=i[6]*r,t[7]=0,t[8]=i[8]*s,t[9]=i[9]*s,t[10]=i[10]*s,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");const t=this.elements,i=e.x,n=e.y,r=e.z,s=Math.cos(i),o=Math.sin(i),a=Math.cos(n),l=Math.sin(n),c=Math.cos(r),h=Math.sin(r);if("XYZ"===e.order){const e=s*c,i=s*h,n=o*c,r=o*h;t[0]=a*c,t[4]=-a*h,t[8]=l,t[1]=i+n*l,t[5]=e-r*l,t[9]=-o*a,t[2]=r-e*l,t[6]=n+i*l,t[10]=s*a}else if("YXZ"===e.order){const e=a*c,i=a*h,n=l*c,r=l*h;t[0]=e+r*o,t[4]=n*o-i,t[8]=s*l,t[1]=s*h,t[5]=s*c,t[9]=-o,t[2]=i*o-n,t[6]=r+e*o,t[10]=s*a}else if("ZXY"===e.order){const e=a*c,i=a*h,n=l*c,r=l*h;t[0]=e-r*o,t[4]=-s*h,t[8]=n+i*o,t[1]=i+n*o,t[5]=s*c,t[9]=r-e*o,t[2]=-s*l,t[6]=o,t[10]=s*a}else if("ZYX"===e.order){const e=s*c,i=s*h,n=o*c,r=o*h;t[0]=a*c,t[4]=n*l-i,t[8]=e*l+r,t[1]=a*h,t[5]=r*l+e,t[9]=i*l-n,t[2]=-l,t[6]=o*a,t[10]=s*a}else if("YZX"===e.order){const e=s*a,i=s*l,n=o*a,r=o*l;t[0]=a*c,t[4]=r-e*h,t[8]=n*h+i,t[1]=h,t[5]=s*c,t[9]=-o*c,t[2]=-l*c,t[6]=i*h+n,t[10]=e-r*h}else if("XZY"===e.order){const e=s*a,i=s*l,n=o*a,r=o*l;t[0]=a*c,t[4]=-h,t[8]=l*c,t[1]=e*h+r,t[5]=s*c,t[9]=i*h-n,t[2]=n*h-i,t[6]=o*c,t[10]=r*h+e}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(Xn,e,Zn)}lookAt(e,t,i){const n=this.elements;return $n.subVectors(e,t),0===$n.lengthSq()&&($n.z=1),$n.normalize(),Yn.crossVectors(i,$n),0===Yn.lengthSq()&&(1===Math.abs(i.z)?$n.x+=1e-4:$n.z+=1e-4,$n.normalize(),Yn.crossVectors(i,$n)),Yn.normalize(),Kn.crossVectors($n,Yn),n[0]=Yn.x,n[4]=Kn.x,n[8]=$n.x,n[1]=Yn.y,n[5]=Kn.y,n[9]=$n.y,n[2]=Yn.z,n[6]=Kn.z,n[10]=$n.z,this}multiply(e,t){return void 0!==t?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,n=t.elements,r=this.elements,s=i[0],o=i[4],a=i[8],l=i[12],c=i[1],h=i[5],u=i[9],d=i[13],m=i[2],p=i[6],f=i[10],g=i[14],v=i[3],y=i[7],_=i[11],x=i[15],b=n[0],w=n[4],M=n[8],T=n[12],S=n[1],E=n[5],A=n[9],C=n[13],P=n[2],L=n[6],R=n[10],D=n[14],O=n[3],I=n[7],F=n[11],V=n[15];return r[0]=s*b+o*S+a*P+l*O,r[4]=s*w+o*E+a*L+l*I,r[8]=s*M+o*A+a*R+l*F,r[12]=s*T+o*C+a*D+l*V,r[1]=c*b+h*S+u*P+d*O,r[5]=c*w+h*E+u*L+d*I,r[9]=c*M+h*A+u*R+d*F,r[13]=c*T+h*C+u*D+d*V,r[2]=m*b+p*S+f*P+g*O,r[6]=m*w+p*E+f*L+g*I,r[10]=m*M+p*A+f*R+g*F,r[14]=m*T+p*C+f*D+g*V,r[3]=v*b+y*S+_*P+x*O,r[7]=v*w+y*E+_*L+x*I,r[11]=v*M+y*A+_*R+x*F,r[15]=v*T+y*C+_*D+x*V,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[4],n=e[8],r=e[12],s=e[1],o=e[5],a=e[9],l=e[13],c=e[2],h=e[6],u=e[10],d=e[14];return e[3]*(+r*a*h-n*l*h-r*o*u+i*l*u+n*o*d-i*a*d)+e[7]*(+t*a*d-t*l*u+r*s*u-n*s*d+n*l*c-r*a*c)+e[11]*(+t*l*h-t*o*d-r*s*h+i*s*d+r*o*c-i*l*c)+e[15]*(-n*o*c-t*a*h+t*o*u+n*s*h-i*s*u+i*a*c)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,i){const n=this.elements;return e.isVector3?(n[12]=e.x,n[13]=e.y,n[14]=e.z):(n[12]=e,n[13]=t,n[14]=i),this}invert(){const e=this.elements,t=e[0],i=e[1],n=e[2],r=e[3],s=e[4],o=e[5],a=e[6],l=e[7],c=e[8],h=e[9],u=e[10],d=e[11],m=e[12],p=e[13],f=e[14],g=e[15],v=h*f*l-p*u*l+p*a*d-o*f*d-h*a*g+o*u*g,y=m*u*l-c*f*l-m*a*d+s*f*d+c*a*g-s*u*g,_=c*p*l-m*h*l+m*o*d-s*p*d-c*o*g+s*h*g,x=m*h*a-c*p*a-m*o*u+s*p*u+c*o*f-s*h*f,b=t*v+i*y+n*_+r*x;if(0===b)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const w=1/b;return e[0]=v*w,e[1]=(p*u*r-h*f*r-p*n*d+i*f*d+h*n*g-i*u*g)*w,e[2]=(o*f*r-p*a*r+p*n*l-i*f*l-o*n*g+i*a*g)*w,e[3]=(h*a*r-o*u*r-h*n*l+i*u*l+o*n*d-i*a*d)*w,e[4]=y*w,e[5]=(c*f*r-m*u*r+m*n*d-t*f*d-c*n*g+t*u*g)*w,e[6]=(m*a*r-s*f*r-m*n*l+t*f*l+s*n*g-t*a*g)*w,e[7]=(s*u*r-c*a*r+c*n*l-t*u*l-s*n*d+t*a*d)*w,e[8]=_*w,e[9]=(m*h*r-c*p*r-m*i*d+t*p*d+c*i*g-t*h*g)*w,e[10]=(s*p*r-m*o*r+m*i*l-t*p*l-s*i*g+t*o*g)*w,e[11]=(c*o*r-s*h*r-c*i*l+t*h*l+s*i*d-t*o*d)*w,e[12]=x*w,e[13]=(c*p*n-m*h*n+m*i*u-t*p*u-c*i*f+t*h*f)*w,e[14]=(m*o*n-s*p*n-m*i*a+t*p*a+s*i*f-t*o*f)*w,e[15]=(s*h*n-c*o*n+c*i*a-t*h*a-s*i*u+t*o*u)*w,this}scale(e){const t=this.elements,i=e.x,n=e.y,r=e.z;return t[0]*=i,t[4]*=n,t[8]*=r,t[1]*=i,t[5]*=n,t[9]*=r,t[2]*=i,t[6]*=n,t[10]*=r,t[3]*=i,t[7]*=n,t[11]*=r,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],n=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,n))}makeTranslation(e,t,i){return this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const i=Math.cos(t),n=Math.sin(t),r=1-i,s=e.x,o=e.y,a=e.z,l=r*s,c=r*o;return this.set(l*s+i,l*o-n*a,l*a+n*o,0,l*o+n*a,c*o+i,c*a-n*s,0,l*a-n*o,c*a+n*s,r*a*a+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,n,r,s){return this.set(1,i,r,0,e,1,s,0,t,n,1,0,0,0,0,1),this}compose(e,t,i){const n=this.elements,r=t._x,s=t._y,o=t._z,a=t._w,l=r+r,c=s+s,h=o+o,u=r*l,d=r*c,m=r*h,p=s*c,f=s*h,g=o*h,v=a*l,y=a*c,_=a*h,x=i.x,b=i.y,w=i.z;return n[0]=(1-(p+g))*x,n[1]=(d+_)*x,n[2]=(m-y)*x,n[3]=0,n[4]=(d-_)*b,n[5]=(1-(u+g))*b,n[6]=(f+v)*b,n[7]=0,n[8]=(m+y)*w,n[9]=(f-v)*w,n[10]=(1-(u+p))*w,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,this}decompose(e,t,i){const n=this.elements;let r=Wn.set(n[0],n[1],n[2]).length();const s=Wn.set(n[4],n[5],n[6]).length(),o=Wn.set(n[8],n[9],n[10]).length();this.determinant()<0&&(r=-r),e.x=n[12],e.y=n[13],e.z=n[14],qn.copy(this);const a=1/r,l=1/s,c=1/o;return qn.elements[0]*=a,qn.elements[1]*=a,qn.elements[2]*=a,qn.elements[4]*=l,qn.elements[5]*=l,qn.elements[6]*=l,qn.elements[8]*=c,qn.elements[9]*=c,qn.elements[10]*=c,t.setFromRotationMatrix(qn),i.x=r,i.y=s,i.z=o,this}makePerspective(e,t,i,n,r,s){void 0===s&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");const o=this.elements,a=2*r/(t-e),l=2*r/(i-n),c=(t+e)/(t-e),h=(i+n)/(i-n),u=-(s+r)/(s-r),d=-2*s*r/(s-r);return o[0]=a,o[4]=0,o[8]=c,o[12]=0,o[1]=0,o[5]=l,o[9]=h,o[13]=0,o[2]=0,o[6]=0,o[10]=u,o[14]=d,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this}makeOrthographic(e,t,i,n,r,s){const o=this.elements,a=1/(t-e),l=1/(i-n),c=1/(s-r),h=(t+e)*a,u=(i+n)*l,d=(s+r)*c;return o[0]=2*a,o[4]=0,o[8]=0,o[12]=-h,o[1]=0,o[5]=2*l,o[9]=0,o[13]=-u,o[2]=0,o[6]=0,o[10]=-2*c,o[14]=-d,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this}equals(e){const t=this.elements,i=e.elements;for(let e=0;e<16;e++)if(t[e]!==i[e])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}}Hn.prototype.isMatrix4=!0;const Wn=new mn,qn=new Hn,Xn=new mn(0,0,0),Zn=new mn(1,1,1),Yn=new mn,Kn=new mn,$n=new mn,Jn=new Hn,Qn=new dn;class er{constructor(e=0,t=0,i=0,n=er.DefaultOrder){this._x=e,this._y=t,this._z=i,this._order=n}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,i,n=this._order){return this._x=e,this._y=t,this._z=i,this._order=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,i=!0){const n=e.elements,r=n[0],s=n[4],o=n[8],a=n[1],l=n[5],c=n[9],h=n[2],u=n[6],d=n[10];switch(t){case"XYZ":this._y=Math.asin(Gi(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-c,d),this._z=Math.atan2(-s,r)):(this._x=Math.atan2(u,l),this._z=0);break;case"YXZ":this._x=Math.asin(-Gi(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(o,d),this._z=Math.atan2(a,l)):(this._y=Math.atan2(-h,r),this._z=0);break;case"ZXY":this._x=Math.asin(Gi(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(-h,d),this._z=Math.atan2(-s,l)):(this._y=0,this._z=Math.atan2(a,r));break;case"ZYX":this._y=Math.asin(-Gi(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(u,d),this._z=Math.atan2(a,r)):(this._x=0,this._z=Math.atan2(-s,l));break;case"YZX":this._z=Math.asin(Gi(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-c,l),this._y=Math.atan2(-h,r)):(this._x=0,this._y=Math.atan2(o,d));break;case"XZY":this._z=Math.asin(-Gi(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(u,l),this._y=Math.atan2(o,r)):(this._x=Math.atan2(-c,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!0===i&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return Jn.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Jn,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return Qn.setFromEuler(this),this.setFromQuaternion(Qn,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}toVector3(e){return e?e.set(this._x,this._y,this._z):new mn(this._x,this._y,this._z)}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}}er.prototype.isEuler=!0,er.DefaultOrder="XYZ",er.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];class tr{constructor(){this.mask=1}set(e){this.mask=1<<e}enable(e){this.mask|=1<<e}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e}disable(e){this.mask&=~(1<<e)}disableAll(){this.mask=0}test(e){return!!(this.mask&e.mask)}}let ir=0;const nr=new mn,rr=new dn,sr=new Hn,or=new mn,ar=new mn,lr=new mn,cr=new dn,hr=new mn(1,0,0),ur=new mn(0,1,0),dr=new mn(0,0,1),mr={type:"added"},pr={type:"removed"};class fr extends Fi{constructor(){super(),Object.defineProperty(this,"id",{value:ir++}),this.uuid=ki(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=fr.DefaultUp.clone();const e=new mn,t=new er,i=new dn,n=new mn(1,1,1);t._onChange((function(){i.setFromEuler(t,!1)})),i._onChange((function(){t.setFromQuaternion(i,void 0,!1)})),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:n},modelViewMatrix:{value:new Hn},normalMatrix:{value:new Ki}}),this.matrix=new Hn,this.matrixWorld=new Hn,this.matrixAutoUpdate=fr.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new tr,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return rr.setFromAxisAngle(e,t),this.quaternion.multiply(rr),this}rotateOnWorldAxis(e,t){return rr.setFromAxisAngle(e,t),this.quaternion.premultiply(rr),this}rotateX(e){return this.rotateOnAxis(hr,e)}rotateY(e){return this.rotateOnAxis(ur,e)}rotateZ(e){return this.rotateOnAxis(dr,e)}translateOnAxis(e,t){return nr.copy(e).applyQuaternion(this.quaternion),this.position.add(nr.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(hr,e)}translateY(e){return this.translateOnAxis(ur,e)}translateZ(e){return this.translateOnAxis(dr,e)}localToWorld(e){return e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return e.applyMatrix4(sr.copy(this.matrixWorld).invert())}lookAt(e,t,i){e.isVector3?or.copy(e):or.set(e,t,i);const n=this.parent;this.updateWorldMatrix(!0,!1),ar.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?sr.lookAt(ar,or,this.up):sr.lookAt(or,ar,this.up),this.quaternion.setFromRotationMatrix(sr),n&&(sr.extractRotation(n.matrixWorld),rr.setFromRotationMatrix(sr),this.quaternion.premultiply(rr.invert()))}add(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(null!==e.parent&&e.parent.remove(e),e.parent=this,this.children.push(e),e.dispatchEvent(mr)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.remove(arguments[e]);return this}const t=this.children.indexOf(e);return-1!==t&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(pr)),this}removeFromParent(){const e=this.parent;return null!==e&&e.remove(this),this}clear(){for(let e=0;e<this.children.length;e++){const t=this.children[e];t.parent=null,t.dispatchEvent(pr)}return this.children.length=0,this}attach(e){return this.updateWorldMatrix(!0,!1),sr.copy(this.matrixWorld).invert(),null!==e.parent&&(e.parent.updateWorldMatrix(!0,!1),sr.multiply(e.parent.matrixWorld)),e.applyMatrix4(sr),this.add(e),e.updateWorldMatrix(!1,!0),this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let i=0,n=this.children.length;i<n;i++){const n=this.children[i].getObjectByProperty(e,t);if(void 0!==n)return n}}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(ar,e,lr),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(ar,cr,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let i=0,n=t.length;i<n;i++)t[i].traverse(e)}traverseVisible(e){if(!1===this.visible)return;e(this);const t=this.children;for(let i=0,n=t.length;i<n;i++)t[i].traverseVisible(e)}traverseAncestors(e){const t=this.parent;null!==t&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let i=0,n=t.length;i<n;i++)t[i].updateMatrixWorld(e)}updateWorldMatrix(e,t){const i=this.parent;if(!0===e&&null!==i&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===t){const e=this.children;for(let t=0,i=e.length;t<i;t++)e[t].updateWorldMatrix(!1,!0)}}toJSON(e){const t=void 0===e||"string"==typeof e,i={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{}},i.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});const n={};function r(t,i){return void 0===t[i.uuid]&&(t[i.uuid]=i.toJSON(e)),i.uuid}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),!0===this.castShadow&&(n.castShadow=!0),!0===this.receiveShadow&&(n.receiveShadow=!0),!1===this.visible&&(n.visible=!1),!1===this.frustumCulled&&(n.frustumCulled=!1),0!==this.renderOrder&&(n.renderOrder=this.renderOrder),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),n.layers=this.layers.mask,n.matrix=this.matrix.toArray(),!1===this.matrixAutoUpdate&&(n.matrixAutoUpdate=!1),this.isInstancedMesh&&(n.type="InstancedMesh",n.count=this.count,n.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(n.instanceColor=this.instanceColor.toJSON())),this.isScene)this.background&&(this.background.isColor?n.background=this.background.toJSON():this.background.isTexture&&(n.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&(n.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){n.geometry=r(e.geometries,this.geometry);const t=this.geometry.parameters;if(void 0!==t&&void 0!==t.shapes){const i=t.shapes;if(Array.isArray(i))for(let t=0,n=i.length;t<n;t++){const n=i[t];r(e.shapes,n)}else r(e.shapes,i)}}if(this.isSkinnedMesh&&(n.bindMode=this.bindMode,n.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(r(e.skeletons,this.skeleton),n.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){const t=[];for(let i=0,n=this.material.length;i<n;i++)t.push(r(e.materials,this.material[i]));n.material=t}else n.material=r(e.materials,this.material);if(this.children.length>0){n.children=[];for(let t=0;t<this.children.length;t++)n.children.push(this.children[t].toJSON(e).object)}if(this.animations.length>0){n.animations=[];for(let t=0;t<this.animations.length;t++){const i=this.animations[t];n.animations.push(r(e.animations,i))}}if(t){const t=s(e.geometries),n=s(e.materials),r=s(e.textures),o=s(e.images),a=s(e.shapes),l=s(e.skeletons),c=s(e.animations);t.length>0&&(i.geometries=t),n.length>0&&(i.materials=n),r.length>0&&(i.textures=r),o.length>0&&(i.images=o),a.length>0&&(i.shapes=a),l.length>0&&(i.skeletons=l),c.length>0&&(i.animations=c)}return i.object=n,i;function s(e){const t=[];for(const i in e){const n=e[i];delete n.metadata,t.push(n)}return t}}clone(e){return(new this.constructor).copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(let t=0;t<e.children.length;t++){const i=e.children[t];this.add(i.clone())}return this}}fr.DefaultUp=new mn(0,1,0),fr.DefaultMatrixAutoUpdate=!0,fr.prototype.isObject3D=!0;const gr=new mn,vr=new mn,yr=new mn,_r=new mn,xr=new mn,br=new mn,wr=new mn,Mr=new mn,Tr=new mn,Sr=new mn;class Er{constructor(e=new mn,t=new mn,i=new mn){this.a=e,this.b=t,this.c=i}static getNormal(e,t,i,n){n.subVectors(i,t),gr.subVectors(e,t),n.cross(gr);const r=n.lengthSq();return r>0?n.multiplyScalar(1/Math.sqrt(r)):n.set(0,0,0)}static getBarycoord(e,t,i,n,r){gr.subVectors(n,t),vr.subVectors(i,t),yr.subVectors(e,t);const s=gr.dot(gr),o=gr.dot(vr),a=gr.dot(yr),l=vr.dot(vr),c=vr.dot(yr),h=s*l-o*o;if(0===h)return r.set(-2,-1,-1);const u=1/h,d=(l*a-o*c)*u,m=(s*c-o*a)*u;return r.set(1-d-m,m,d)}static containsPoint(e,t,i,n){return this.getBarycoord(e,t,i,n,_r),_r.x>=0&&_r.y>=0&&_r.x+_r.y<=1}static getUV(e,t,i,n,r,s,o,a){return this.getBarycoord(e,t,i,n,_r),a.set(0,0),a.addScaledVector(r,_r.x),a.addScaledVector(s,_r.y),a.addScaledVector(o,_r.z),a}static isFrontFacing(e,t,i,n){return gr.subVectors(i,t),vr.subVectors(e,t),gr.cross(vr).dot(n)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,n){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[n]),this}setFromAttributeAndIndices(e,t,i,n){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,n),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return gr.subVectors(this.c,this.b),vr.subVectors(this.a,this.b),.5*gr.cross(vr).length()}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Er.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Er.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,i,n,r){return Er.getUV(e,this.a,this.b,this.c,t,i,n,r)}containsPoint(e){return Er.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Er.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const i=this.a,n=this.b,r=this.c;let s,o;xr.subVectors(n,i),br.subVectors(r,i),Mr.subVectors(e,i);const a=xr.dot(Mr),l=br.dot(Mr);if(a<=0&&l<=0)return t.copy(i);Tr.subVectors(e,n);const c=xr.dot(Tr),h=br.dot(Tr);if(c>=0&&h<=c)return t.copy(n);const u=a*h-c*l;if(u<=0&&a>=0&&c<=0)return s=a/(a-c),t.copy(i).addScaledVector(xr,s);Sr.subVectors(e,r);const d=xr.dot(Sr),m=br.dot(Sr);if(m>=0&&d<=m)return t.copy(r);const p=d*l-a*m;if(p<=0&&l>=0&&m<=0)return o=l/(l-m),t.copy(i).addScaledVector(br,o);const f=c*m-d*h;if(f<=0&&h-c>=0&&d-m>=0)return wr.subVectors(r,n),o=(h-c)/(h-c+(d-m)),t.copy(n).addScaledVector(wr,o);const g=1/(f+p+u);return s=p*g,o=u*g,t.copy(i).addScaledVector(xr,s).addScaledVector(br,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}let Ar=0;class Cr extends Fi{constructor(){super(),Object.defineProperty(this,"id",{value:Ar++}),this.uuid=ki(),this.name="",this.type="Material",this.fog=!0,this.blending=x,this.side=p,this.vertexColors=!1,this.opacity=1,this.format=Be,this.transparent=!1,this.blendSrc=I,this.blendDst=F,this.blendEquation=S,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=H,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=Mi,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=ci,this.stencilZFail=ci,this.stencilZPass=ci,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(void 0!==e)for(const t in e){const i=e[t];if(void 0===i){console.warn("THREE.Material: '"+t+"' parameter is undefined.");continue}if("shading"===t){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=i===v;continue}const n=this[t];void 0!==n?n&&n.isColor?n.set(i):n&&n.isVector3&&i&&i.isVector3?n.copy(i):this[t]=i:console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.")}}toJSON(e){const t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});const i={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function n(e){const t=[];for(const i in e){const n=e[i];delete n.metadata,t.push(n)}return t}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),void 0!==this.roughness&&(i.roughness=this.roughness),void 0!==this.metalness&&(i.metalness=this.metalness),void 0!==this.sheen&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(i.shininess=this.shininess),void 0!==this.clearcoat&&(i.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,void 0!==this.combine&&(i.combine=this.combine)),void 0!==this.envMapIntensity&&(i.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(i.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.transmission&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),void 0!==this.thickness&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),void 0!==this.attenuationDistance&&(i.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(i.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(i.size=this.size),null!==this.shadowSide&&(i.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==x&&(i.blending=this.blending),this.side!==p&&(i.side=this.side),this.vertexColors&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.format!==Be&&(i.format=this.format),!0===this.transparent&&(i.transparent=this.transparent),i.depthFunc=this.depthFunc,i.depthTest=this.depthTest,i.depthWrite=this.depthWrite,i.colorWrite=this.colorWrite,i.stencilWrite=this.stencilWrite,i.stencilWriteMask=this.stencilWriteMask,i.stencilFunc=this.stencilFunc,i.stencilRef=this.stencilRef,i.stencilFuncMask=this.stencilFuncMask,i.stencilFail=this.stencilFail,i.stencilZFail=this.stencilZFail,i.stencilZPass=this.stencilZPass,this.rotation&&0!==this.rotation&&(i.rotation=this.rotation),!0===this.polygonOffset&&(i.polygonOffset=!0),0!==this.polygonOffsetFactor&&(i.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&1!==this.linewidth&&(i.linewidth=this.linewidth),void 0!==this.dashSize&&(i.dashSize=this.dashSize),void 0!==this.gapSize&&(i.gapSize=this.gapSize),void 0!==this.scale&&(i.scale=this.scale),!0===this.dithering&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),!0===this.alphaToCoverage&&(i.alphaToCoverage=this.alphaToCoverage),!0===this.premultipliedAlpha&&(i.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(i.wireframe=this.wireframe),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(i.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(i.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(i.flatShading=this.flatShading),!1===this.visible&&(i.visible=!1),!1===this.toneMapped&&(i.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(i.userData=this.userData),t){const t=n(e.textures),r=n(e.images);t.length>0&&(i.textures=t),r.length>0&&(i.images=r)}return i}clone(){return(new this.constructor).copy(this)}copy(e){this.name=e.name,this.fog=e.fog,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.format=e.format,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let i=null;if(null!==t){const e=t.length;i=new Array(e);for(let n=0;n!==e;++n)i[n]=t[n].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){!0===e&&this.version++}}Cr.prototype.isMaterial=!0;const Pr={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Lr={h:0,s:0,l:0},Rr={h:0,s:0,l:0};function Dr(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?e+6*(t-e)*i:i<.5?t:i<2/3?e+6*(t-e)*(2/3-i):e}function Or(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function Ir(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}class Fr{constructor(e,t,i){return void 0===t&&void 0===i?this.set(e):this.setRGB(e,t,i)}set(e){return e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,this}setRGB(e,t,i){return this.r=e,this.g=t,this.b=i,this}setHSL(e,t,i){if(e=ji(e,1),t=Gi(t,0,1),i=Gi(i,0,1),0===t)this.r=this.g=this.b=i;else{const n=i<=.5?i*(1+t):i+t-i*t,r=2*i-n;this.r=Dr(r,n,e+1/3),this.g=Dr(r,n,e),this.b=Dr(r,n,e-1/3)}return this}setStyle(e){function t(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){let e;const n=i[1],r=i[2];switch(n){case"rgb":case"rgba":if(e=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(r))return this.r=Math.min(255,parseInt(e[1],10))/255,this.g=Math.min(255,parseInt(e[2],10))/255,this.b=Math.min(255,parseInt(e[3],10))/255,t(e[4]),this;if(e=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(r))return this.r=Math.min(100,parseInt(e[1],10))/100,this.g=Math.min(100,parseInt(e[2],10))/100,this.b=Math.min(100,parseInt(e[3],10))/100,t(e[4]),this;break;case"hsl":case"hsla":if(e=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(r)){const i=parseFloat(e[1])/360,n=parseInt(e[2],10)/100,r=parseInt(e[3],10)/100;return t(e[4]),this.setHSL(i,n,r)}}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const e=i[1],t=e.length;if(3===t)return this.r=parseInt(e.charAt(0)+e.charAt(0),16)/255,this.g=parseInt(e.charAt(1)+e.charAt(1),16)/255,this.b=parseInt(e.charAt(2)+e.charAt(2),16)/255,this;if(6===t)return this.r=parseInt(e.charAt(0)+e.charAt(1),16)/255,this.g=parseInt(e.charAt(2)+e.charAt(3),16)/255,this.b=parseInt(e.charAt(4)+e.charAt(5),16)/255,this}return e&&e.length>0?this.setColorName(e):this}setColorName(e){const t=Pr[e.toLowerCase()];return void 0!==t?this.setHex(t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copyGammaToLinear(e,t=2){return this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this}copyLinearToGamma(e,t=2){const i=t>0?1/t:1;return this.r=Math.pow(e.r,i),this.g=Math.pow(e.g,i),this.b=Math.pow(e.b,i),this}convertGammaToLinear(e){return this.copyGammaToLinear(this,e),this}convertLinearToGamma(e){return this.copyLinearToGamma(this,e),this}copySRGBToLinear(e){return this.r=Or(e.r),this.g=Or(e.g),this.b=Or(e.b),this}copyLinearToSRGB(e){return this.r=Ir(e.r),this.g=Ir(e.g),this.b=Ir(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){return 255*this.r<<16^255*this.g<<8^255*this.b}getHexString(){return("000000"+this.getHex().toString(16)).slice(-6)}getHSL(e){const t=this.r,i=this.g,n=this.b,r=Math.max(t,i,n),s=Math.min(t,i,n);let o,a;const l=(s+r)/2;if(s===r)o=0,a=0;else{const e=r-s;switch(a=l<=.5?e/(r+s):e/(2-r-s),r){case t:o=(i-n)/e+(i<n?6:0);break;case i:o=(n-t)/e+2;break;case n:o=(t-i)/e+4}o/=6}return e.h=o,e.s=a,e.l=l,e}getStyle(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"}offsetHSL(e,t,i){return this.getHSL(Lr),Lr.h+=e,Lr.s+=t,Lr.l+=i,this.setHSL(Lr.h,Lr.s,Lr.l),this}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,i){return this.r=e.r+(t.r-e.r)*i,this.g=e.g+(t.g-e.g)*i,this.b=e.b+(t.b-e.b)*i,this}lerpHSL(e,t){this.getHSL(Lr),e.getHSL(Rr);const i=Hi(Lr.h,Rr.h,t),n=Hi(Lr.s,Rr.s,t),r=Hi(Lr.l,Rr.l,t);return this.setHSL(i,n,r),this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),!0===e.normalized&&(this.r/=255,this.g/=255,this.b/=255),this}toJSON(){return this.getHex()}}Fr.NAMES=Pr,Fr.prototype.isColor=!0,Fr.prototype.r=1,Fr.prototype.g=1,Fr.prototype.b=1;class Vr extends Cr{constructor(e){super(),this.type="MeshBasicMaterial",this.color=new Fr(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Y,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this}}Vr.prototype.isMeshBasicMaterial=!0;const Ur=new mn,Br=new Yi;class Nr{constructor(e,t,i){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=!0===i,this.usage=Ti,this.updateRange={offset:0,count:-1},this.version=0}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this}copyAt(e,t,i){e*=this.itemSize,i*=t.itemSize;for(let n=0,r=this.itemSize;n<r;n++)this.array[e+n]=t.array[i+n];return this}copyArray(e){return this.array.set(e),this}copyColorsArray(e){const t=this.array;let i=0;for(let n=0,r=e.length;n<r;n++){let r=e[n];void 0===r&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",n),r=new Fr),t[i++]=r.r,t[i++]=r.g,t[i++]=r.b}return this}copyVector2sArray(e){const t=this.array;let i=0;for(let n=0,r=e.length;n<r;n++){let r=e[n];void 0===r&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",n),r=new Yi),t[i++]=r.x,t[i++]=r.y}return this}copyVector3sArray(e){const t=this.array;let i=0;for(let n=0,r=e.length;n<r;n++){let r=e[n];void 0===r&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",n),r=new mn),t[i++]=r.x,t[i++]=r.y,t[i++]=r.z}return this}copyVector4sArray(e){const t=this.array;let i=0;for(let n=0,r=e.length;n<r;n++){let r=e[n];void 0===r&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",n),r=new ln),t[i++]=r.x,t[i++]=r.y,t[i++]=r.z,t[i++]=r.w}return this}applyMatrix3(e){if(2===this.itemSize)for(let t=0,i=this.count;t<i;t++)Br.fromBufferAttribute(this,t),Br.applyMatrix3(e),this.setXY(t,Br.x,Br.y);else if(3===this.itemSize)for(let t=0,i=this.count;t<i;t++)Ur.fromBufferAttribute(this,t),Ur.applyMatrix3(e),this.setXYZ(t,Ur.x,Ur.y,Ur.z);return this}applyMatrix4(e){for(let t=0,i=this.count;t<i;t++)Ur.x=this.getX(t),Ur.y=this.getY(t),Ur.z=this.getZ(t),Ur.applyMatrix4(e),this.setXYZ(t,Ur.x,Ur.y,Ur.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)Ur.x=this.getX(t),Ur.y=this.getY(t),Ur.z=this.getZ(t),Ur.applyNormalMatrix(e),this.setXYZ(t,Ur.x,Ur.y,Ur.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)Ur.x=this.getX(t),Ur.y=this.getY(t),Ur.z=this.getZ(t),Ur.transformDirection(e),this.setXYZ(t,Ur.x,Ur.y,Ur.z);return this}set(e,t=0){return this.array.set(e,t),this}getX(e){return this.array[e*this.itemSize]}setX(e,t){return this.array[e*this.itemSize]=t,this}getY(e){return this.array[e*this.itemSize+1]}setY(e,t){return this.array[e*this.itemSize+1]=t,this}getZ(e){return this.array[e*this.itemSize+2]}setZ(e,t){return this.array[e*this.itemSize+2]=t,this}getW(e){return this.array[e*this.itemSize+3]}setW(e,t){return this.array[e*this.itemSize+3]=t,this}setXY(e,t,i){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=i,this}setXYZ(e,t,i,n){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=n,this}setXYZW(e,t,i,n,r){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=n,this.array[e+3]=r,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.prototype.slice.call(this.array),normalized:this.normalized};return""!==this.name&&(e.name=this.name),this.usage!==Ti&&(e.usage=this.usage),0===this.updateRange.offset&&-1===this.updateRange.count||(e.updateRange=this.updateRange),e}}Nr.prototype.isBufferAttribute=!0;class zr extends Nr{constructor(e,t,i){super(new Int8Array(e),t,i)}}class kr extends Nr{constructor(e,t,i){super(new Uint8Array(e),t,i)}}class Gr extends Nr{constructor(e,t,i){super(new Uint8ClampedArray(e),t,i)}}class jr extends Nr{constructor(e,t,i){super(new Int16Array(e),t,i)}}class Hr extends Nr{constructor(e,t,i){super(new Uint16Array(e),t,i)}}class Wr extends Nr{constructor(e,t,i){super(new Int32Array(e),t,i)}}class qr extends Nr{constructor(e,t,i){super(new Uint32Array(e),t,i)}}class Xr extends Nr{constructor(e,t,i){super(new Uint16Array(e),t,i)}}Xr.prototype.isFloat16BufferAttribute=!0;class Zr extends Nr{constructor(e,t,i){super(new Float32Array(e),t,i)}}class Yr extends Nr{constructor(e,t,i){super(new Float64Array(e),t,i)}}let Kr=0;const $r=new Hn,Jr=new fr,Qr=new mn,es=new gn,ts=new gn,is=new mn;class ns extends Fi{constructor(){super(),Object.defineProperty(this,"id",{value:Kr++}),this.uuid=ki(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new($i(e)>65535?qr:Hr)(e,1):this.index=e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return void 0!==this.attributes[e]}addGroup(e,t,i=0){this.groups.push({start:e,count:t,materialIndex:i})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);const i=this.attributes.normal;if(void 0!==i){const t=(new Ki).getNormalMatrix(e);i.applyNormalMatrix(t),i.needsUpdate=!0}const n=this.attributes.tangent;return void 0!==n&&(n.transformDirection(e),n.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(e){return $r.makeRotationFromQuaternion(e),this.applyMatrix4($r),this}rotateX(e){return $r.makeRotationX(e),this.applyMatrix4($r),this}rotateY(e){return $r.makeRotationY(e),this.applyMatrix4($r),this}rotateZ(e){return $r.makeRotationZ(e),this.applyMatrix4($r),this}translate(e,t,i){return $r.makeTranslation(e,t,i),this.applyMatrix4($r),this}scale(e,t,i){return $r.makeScale(e,t,i),this.applyMatrix4($r),this}lookAt(e){return Jr.lookAt(e),Jr.updateMatrix(),this.applyMatrix4(Jr.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Qr).negate(),this.translate(Qr.x,Qr.y,Qr.z),this}setFromPoints(e){const t=[];for(let i=0,n=e.length;i<n;i++){const n=e[i];t.push(n.x,n.y,n.z||0)}return this.setAttribute("position",new Zr(t,3)),this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new gn);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".',this),void this.boundingBox.set(new mn(-1/0,-1/0,-1/0),new mn(1/0,1/0,1/0));if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),t)for(let e=0,i=t.length;e<i;e++){const i=t[e];es.setFromBufferAttribute(i),this.morphTargetsRelative?(is.addVectors(this.boundingBox.min,es.min),this.boundingBox.expandByPoint(is),is.addVectors(this.boundingBox.max,es.max),this.boundingBox.expandByPoint(is)):(this.boundingBox.expandByPoint(es.min),this.boundingBox.expandByPoint(es.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new Fn);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "fal
949se".',this),void this.boundingSphere.set(new mn,1/0);if(e){const i=this.boundingSphere.center;if(es.setFromBufferAttribute(e),t)for(let e=0,i=t.length;e<i;e++){const i=t[e];ts.setFromBufferAttribute(i),this.morphTargetsRelative?(is.addVectors(es.min,ts.min),es.expandByPoint(is),is.addVectors(es.max,ts.max),es.expandByPoint(is)):(es.expandByPoint(ts.min),es.expandByPoint(ts.max))}es.getCenter(i);let n=0;for(let t=0,r=e.count;t<r;t++)is.fromBufferAttribute(e,t),n=Math.max(n,i.distanceToSquared(is));if(t)for(let r=0,s=t.length;r<s;r++){const s=t[r],o=this.morphTargetsRelative;for(let t=0,r=s.count;t<r;t++)is.fromBufferAttribute(s,t),o&&(Qr.fromBufferAttribute(e,t),is.add(Qr)),n=Math.max(n,i.distanceToSquared(is))}this.boundingSphere.radius=Math.sqrt(n),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(null===e||void 0===t.position||void 0===t.normal||void 0===t.uv)return void console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");const i=e.array,n=t.position.array,r=t.normal.array,s=t.uv.array,o=n.length/3;void 0===t.tangent&&this.setAttribute("tangent",new Nr(new Float32Array(4*o),4));const a=t.tangent.array,l=[],c=[];for(let e=0;e<o;e++)l[e]=new mn,c[e]=new mn;const h=new mn,u=new mn,d=new mn,m=new Yi,p=new Yi,f=new Yi,g=new mn,v=new mn;function y(e,t,i){h.fromArray(n,3*e),u.fromArray(n,3*t),d.fromArray(n,3*i),m.fromArray(s,2*e),p.fromArray(s,2*t),f.fromArray(s,2*i),u.sub(h),d.sub(h),p.sub(m),f.sub(m);const r=1/(p.x*f.y-f.x*p.y);isFinite(r)&&(g.copy(u).multiplyScalar(f.y).addScaledVector(d,-p.y).multiplyScalar(r),v.copy(d).multiplyScalar(p.x).addScaledVector(u,-f.x).multiplyScalar(r),l[e].add(g),l[t].add(g),l[i].add(g),c[e].add(v),c[t].add(v),c[i].add(v))}let _=this.groups;0===_.length&&(_=[{start:0,count:i.length}]);for(let e=0,t=_.length;e<t;++e){const t=_[e],n=t.start;for(let e=n,r=n+t.count;e<r;e+=3)y(i[e+0],i[e+1],i[e+2])}const x=new mn,b=new mn,w=new mn,M=new mn;function T(e){w.fromArray(r,3*e),M.copy(w);const t=l[e];x.copy(t),x.sub(w.multiplyScalar(w.dot(t))).normalize(),b.crossVectors(M,t);const i=b.dot(c[e])<0?-1:1;a[4*e]=x.x,a[4*e+1]=x.y,a[4*e+2]=x.z,a[4*e+3]=i}for(let e=0,t=_.length;e<t;++e){const t=_[e],n=t.start;for(let e=n,r=n+t.count;e<r;e+=3)T(i[e+0]),T(i[e+1]),T(i[e+2])}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(void 0!==t){let i=this.getAttribute("normal");if(void 0===i)i=new Nr(new Float32Array(3*t.count),3),this.setAttribute("normal",i);else for(let e=0,t=i.count;e<t;e++)i.setXYZ(e,0,0,0);const n=new mn,r=new mn,s=new mn,o=new mn,a=new mn,l=new mn,c=new mn,h=new mn;if(e)for(let u=0,d=e.count;u<d;u+=3){const d=e.getX(u+0),m=e.getX(u+1),p=e.getX(u+2);n.fromBufferAttribute(t,d),r.fromBufferAttribute(t,m),s.fromBufferAttribute(t,p),c.subVectors(s,r),h.subVectors(n,r),c.cross(h),o.fromBufferAttribute(i,d),a.fromBufferAttribute(i,m),l.fromBufferAttribute(i,p),o.add(c),a.add(c),l.add(c),i.setXYZ(d,o.x,o.y,o.z),i.setXYZ(m,a.x,a.y,a.z),i.setXYZ(p,l.x,l.y,l.z)}else for(let e=0,o=t.count;e<o;e+=3)n.fromBufferAttribute(t,e+0),r.fromBufferAttribute(t,e+1),s.fromBufferAttribute(t,e+2),c.subVectors(s,r),h.subVectors(n,r),c.cross(h),i.setXYZ(e+0,c.x,c.y,c.z),i.setXYZ(e+1,c.x,c.y,c.z),i.setXYZ(e+2,c.x,c.y,c.z);this.normalizeNormals(),i.needsUpdate=!0}}merge(e,t){if(!e||!e.isBufferGeometry)return void console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",e);void 0===t&&(t=0,console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."));const i=this.attributes;for(const n in i){if(void 0===e.attributes[n])continue;const r=i[n].array,s=e.attributes[n],o=s.array,a=s.itemSize*t,l=Math.min(o.length,r.length-a);for(let e=0,t=a;e<l;e++,t++)r[t]=o[e]}return this}normalizeNormals(){const e=this.attributes.normal;for(let t=0,i=e.count;t<i;t++)is.fromBufferAttribute(e,t),is.normalize(),e.setXYZ(t,is.x,is.y,is.z)}toNonIndexed(){function e(e,t){const i=e.array,n=e.itemSize,r=e.normalized,s=new i.constructor(t.length*n);let o=0,a=0;for(let r=0,l=t.length;r<l;r++){o=e.isInterleavedBufferAttribute?t[r]*e.data.stride+e.offset:t[r]*n;for(let e=0;e<n;e++)s[a++]=i[o++]}return new Nr(s,n,r)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new ns,i=this.index.array,n=this.attributes;for(const r in n){const s=e(n[r],i);t.setAttribute(r,s)}const r=this.morphAttributes;for(const n in r){const s=[],o=r[n];for(let t=0,n=o.length;t<n;t++){const n=e(o[t],i);s.push(n)}t.morphAttributes[n]=s}t.morphTargetsRelative=this.morphTargetsRelative;const s=this.groups;for(let e=0,i=s.length;e<i;e++){const i=s[e];t.addGroup(i.start,i.count,i.materialIndex)}return t}toJSON(){const e={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};
vendor: 22,311 bytes, line 949
949if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),void 0!==this.parameters){const t=this.parameters;for(const i in t)void 0!==t[i]&&(e[i]=t[i]);return e}e.data={attributes:{}};const t=this.index;null!==t&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const i=this.attributes;for(const t in i){const n=i[t];e.data.attributes[t]=n.toJSON(e.data)}const n={};let r=!1;for(const t in this.morphAttributes){const i=this.morphAttributes[t],s=[];for(let t=0,n=i.length;t<n;t++){const n=i[t];s.push(n.toJSON(e.data))}s.length>0&&(n[t]=s,r=!0)}r&&(e.data.morphAttributes=n,e.data.morphTargetsRelative=this.morphTargetsRelative);const s=this.groups;s.length>0&&(e.data.groups=JSON.parse(JSON.stringify(s)));const o=this.boundingSphere;return null!==o&&(e.data.boundingSphere={center:o.center.toArray(),radius:o.radius}),e}clone(){return(new this.constructor).copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const i=e.index;null!==i&&this.setIndex(i.clone(t));const n=e.attributes;for(const e in n){const i=n[e];this.setAttribute(e,i.clone(t))}const r=e.morphAttributes;for(const e in r){const i=[],n=r[e];for(let e=0,r=n.length;e<r;e++)i.push(n[e].clone(t));this.morphAttributes[e]=i}this.morphTargetsRelative=e.morphTargetsRelative;const s=e.groups;for(let e=0,t=s.length;e<t;e++){const t=s[e];this.addGroup(t.start,t.count,t.materialIndex)}const o=e.boundingBox;null!==o&&(this.boundingBox=o.clone());const a=e.boundingSphere;return null!==a&&(this.boundingSphere=a.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,void 0!==e.parameters&&(this.parameters=Object.assign({},e.parameters)),this}dispose(){this.dispatchEvent({type:"dispose"})}}ns.prototype.isBufferGeometry=!0;const rs=new Hn,ss=new jn,os=new Fn,as=new mn,ls=new mn,cs=new mn,hs=new mn,us=new mn,ds=new mn,ms=new mn,ps=new mn,fs=new mn,gs=new Yi,vs=new Yi,ys=new Yi,_s=new mn,xs=new mn;class bs extends fr{constructor(e=new ns,t=new Vr){super(),this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=e.material,this.geometry=e.geometry,this}updateMorphTargets(){const e=this.geometry;if(e.isBufferGeometry){const t=e.morphAttributes,i=Object.keys(t);if(i.length>0){const e=t[i[0]];if(void 0!==e){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,i=e.length;t<i;t++){const i=e[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[i]=t}}}}else{const t=e.morphTargets;void 0!==t&&t.length>0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}raycast(e,t){const i=this.geometry,n=this.material,r=this.matrixWorld;if(void 0===n)return;if(null===i.boundingSphere&&i.computeBoundingSphere(),os.copy(i.boundingSphere),os.applyMatrix4(r),!1===e.ray.intersectsSphere(os))return;if(rs.copy(r).invert(),ss.copy(e.ray).applyMatrix4(rs),null!==i.boundingBox&&!1===ss.intersectsBox(i.boundingBox))return;let s;if(i.isBufferGeometry){const r=i.index,o=i.attributes.position,a=i.morphAttributes.position,l=i.morphTargetsRelative,c=i.attributes.uv,h=i.attributes.uv2,u=i.groups,d=i.drawRange;if(null!==r)if(Array.isArray(n))for(let i=0,m=u.length;i<m;i++){const m=u[i],p=n[m.materialIndex];for(let i=Math.max(m.start,d.start),n=Math.min(r.count,Math.min(m.start+m.count,d.start+d.count));i<n;i+=3){const n=r.getX(i),u=r.getX(i+1),d=r.getX(i+2);s=ws(this,p,e,ss,o,a,l,c,h,n,u,d),s&&(s.faceIndex=Math.floor(i/3),s.face.materialIndex=m.materialIndex,t.push(s))}}else for(let i=Math.max(0,d.start),u=Math.min(r.count,d.start+d.count);i<u;i+=3){const u=r.getX(i),d=r.getX(i+1),m=r.getX(i+2);s=ws(this,n,e,ss,o,a,l,c,h,u,d,m),s&&(s.faceIndex=Math.floor(i/3),t.push(s))}else if(void 0!==o)if(Array.isArray(n))for(let i=0,r=u.length;i<r;i++){const r=u[i],m=n[r.materialIndex];for(let i=Math.max(r.start,d.start),n=Math.min(o.count,Math.min(r.start+r.count,d.start+d.count));i<n;i+=3)s=ws(this,m,e,ss,o,a,l,c,h,i,i+1,i+2),s&&(s.faceIndex=Math.floor(i/3),s.face.materialIndex=r.materialIndex,t.push(s))}else for(let i=Math.max(0,d.start),r=Math.min(o.count,d.start+d.count);i<r;i+=3)s=ws(this,n,e,ss,o,a,l,c,h,i,i+1,i+2),s&&(s.faceIndex=Math.floor(i/3),t.push(s))}else i.isGeometry&&console.error("THREE.Mesh.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}function ws(e,t,i,n,r,s,o,a,l,c,h,u){as.fromBufferAttribute(r,c),ls.fromBufferAttribute(r,h),cs.fromBufferAttribute(r,u);const d=e.morphTargetInfluences;if(s&&d){ms.set(0,0,0),ps.set(0,0,0),fs.set(0,0,0);for(let e=0,t=s.length;e<t;e++){const t=d[e],i=s[e];0!==t&&(hs.fromBufferAttribute(i,c),us.fromBufferAttribute(i,h),ds.fromBufferAttribute(i,u),o?(ms.addScaledVector(hs,t),ps.addScaledVector(us,t),fs.addScaledVector(ds,t)):(ms.addScaledVector(hs.sub(as),t),ps.addScaledVector(us.sub(ls),t),fs.addScaledVector(ds.sub(cs),t)))}as.add(ms),ls.add(ps),cs.add(fs)}e.isSkinnedMesh&&(e.boneTransform(c,as),e.boneTransform(h,ls),e.boneTransform(u,cs));const m=function(e,t,i,n,r,s,o,a){let l;if(l=t.side===f?n.intersectTriangle(o,s,r,!0,a):n.intersectTriangle(r,s,o,t.side!==g,a),null===l)return null;xs.copy(a),xs.applyMatrix4(e.matrixWorld);const c=i.ray.origin.distanceTo(xs);return c<i.near||c>i.far?null:{distance:c,point:xs.clone(),object:e}}(e,t,i,n,as,ls,cs,_s);if(m){a&&(gs.fromBufferAttribute(a,c),vs.fromBufferAttribute(a,h),ys.fromBufferAttribute(a,u),m.uv=Er.getUV(_s,as,ls,cs,gs,vs,ys,new Yi)),l&&(gs.fromBufferAttribute(l,c),vs.fromBufferAttribute(l,h),ys.fromBufferAttribute(l,u),m.uv2=Er.getUV(_s,as,ls,cs,gs,vs,ys,new Yi));const e={a:c,b:h,c:u,normal:new mn,materialIndex:0};Er.getNormal(as,ls,cs,e.normal),m.face=e}return m}bs.prototype.isMesh=!0;class Ms extends ns{constructor(e=1,t=1,i=1,n=1,r=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:n,heightSegments:r,depthSegments:s};const o=this;n=Math.floor(n),r=Math.floor(r),s=Math.floor(s);const a=[],l=[],c=[],h=[];let u=0,d=0;function m(e,t,i,n,r,s,m,p,f,g,v){const y=s/f,_=m/g,x=s/2,b=m/2,w=p/2,M=f+1,T=g+1;let S=0,E=0;const A=new mn;for(let s=0;s<T;s++){const o=s*_-b;for(let a=0;a<M;a++){const u=a*y-x;A[e]=u*n,A[t]=o*r,A[i]=w,l.push(A.x,A.y,A.z),A[e]=0,A[t]=0,A[i]=p>0?1:-1,c.push(A.x,A.y,A.z),h.push(a/f),h.push(1-s/g),S+=1}}for(let e=0;e<g;e++)for(let t=0;t<f;t++){const i=u+t+M*e,n=u+t+M*(e+1),r=u+(t+1)+M*(e+1),s=u+(t+1)+M*e;a.push(i,n,s),a.push(n,r,s),E+=6}o.addGroup(d,E,v),d+=E,u+=S}m("z","y","x",-1,-1,i,t,e,s,r,0),m("z","y","x",1,-1,i,t,-e,s,r,1),m("x","z","y",1,1,e,i,t,n,s,2),m("x","z","y",1,-1,e,i,-t,n,s,3),m("x","y","z",1,-1,e,t,i,n,r,4),m("x","y","z",-1,-1,e,t,-i,n,r,5),this.setIndex(a),this.setAttribute("position",new Zr(l,3)),this.setAttribute("normal",new Zr(c,3)),this.setAttribute("uv",new Zr(h,2))}static fromJSON(e){return new Ms(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function Ts(e){const t={};for(const i in e){t[i]={};for(const n in e[i]){const r=e[i][n];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?t[i][n]=r.clone():Array.isArray(r)?t[i][n]=r.slice():t[i][n]=r}}return t}function Ss(e){const t={};for(let i=0;i<e.length;i++){const n=Ts(e[i]);for(const e in n)t[e]=n[e]}return t}const Es={clone:Ts,merge:Ss};class As extends Cr{constructor(e){super(),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,void 0!==e&&(void 0!==e.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(e))}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=Ts(e.uniforms),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const i in this.uniforms){const n=this.uniforms[i].value;n&&n.isTexture?t.uniforms[i]={type:"t",value:n.toJSON(e).uuid}:n&&n.isColor?t.uniforms[i]={type:"c",value:n.getHex()}:n&&n.isVector2?t.uniforms[i]={type:"v2",value:n.toArray()}:n&&n.isVector3?t.uniforms[i]={type:"v3",value:n.toArray()}:n&&n.isVector4?t.uniforms[i]={type:"v4",value:n.toArray()}:n&&n.isMatrix3?t.uniforms[i]={type:"m3",value:n.toArray()}:n&&n.isMatrix4?t.uniforms[i]={type:"m4",value:n.toArray()}:t.uniforms[i]={value:n}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;const i={};for(const e in this.extensions)!0===this.extensions[e]&&(i[e]=!0);return Object.keys(i).length>0&&(t.extensions=i),t}}As.prototype.isShaderMaterial=!0;class Cs extends fr{constructor(){super(),this.type="Camera",this.matrixWorldInverse=new Hn,this.projectionMatrix=new Hn,this.projectionMatrixInverse=new Hn}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}}Cs.prototype.isCamera=!0;class Ps extends Cs{constructor(e=50,t=1,i=.1,n=2e3){super(),this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=n,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=2*Bi*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(.5*Ui*this.fov);return.5*this.getFilmHeight()/e}getEffectiveFOV(){return 2*Bi*Math.atan(Math.tan(.5*Ui*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,i,n,r,s){this.aspect=e/t,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=n,this.view.width=r,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(.5*Ui*this.fov)/this.zoom,i=2*t,n=this.aspect*i,r=-.5*n;const s=this.view;if(null!==this.view&&this.view.enabled){const e=s.fullWidth,o=s.fullHeight;r+=s.offsetX*n/e,t-=s.offsetY*i/o,n*=s.width/e,i*=s.height/o}const o=this.filmOffset;0!==o&&(r+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+n,t,t-i,e,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}Ps.prototype.isPerspectiveCamera=!0;const Ls=90;class Rs extends fr{constructor(e,t,i){if(super(),this.type="CubeCamera",!0!==i.isWebGLCubeRenderTarget)return void console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");this.renderTarget=i;const n=new Ps(Ls,1,e,t);n.layers=this.layers,n.up.set(0,-1,0),n.lookAt(new mn(1,0,0)),this.add(n);const r=new Ps(Ls,1,e,t);r.layers=this.layers,r.up.set(0,-1,0),r.lookAt(new mn(-1,0,0)),this.add(r);const s=new Ps(Ls,1,e,t);s.layers=this.layers,s.up.set(0,0,1),s.lookAt(new mn(0,1,0)),this.add(s);const o=new Ps(Ls,1,e,t);o.layers=this.layers,o.up.set(0,0,-1),o.lookAt(new mn(0,-1,0)),this.add(o);const a=new Ps(Ls,1,e,t);a.layers=this.layers,a.up.set(0,-1,0),a.lookAt(new mn(0,0,1)),this.add(a);const l=new Ps(Ls,1,e,t);l.layers=this.layers,l.up.set(0,-1,0),l.lookAt(new mn(0,0,-1)),this.add(l)}update(e,t){null===this.parent&&this.updateMatrixWorld();const i=this.renderTarget,[n,r,s,o,a,l]=this.children,c=e.xr.enabled,h=e.getRenderTarget();e.xr.enabled=!1;const u=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0),e.render(t,n),e.setRenderTarget(i,1),e.render(t,r),e.setRenderTarget(i,2),e.render(t,s),e.setRenderTarget(i,3),e.render(t,o),e.setRenderTarget(i,4),e.render(t,a),i.texture.generateMipmaps=u,e.setRenderTarget(i,5),e.render(t,l),e.setRenderTarget(h),e.xr.enabled=c}}class Ds extends on{constructor(e,t,i,n,r,s,o,a,l,c){super(e=void 0!==e?e:[],t=void 0!==t?t:se,i,n,r,s,o,a,l,c),this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}Ds.prototype.isCubeTexture=!0;class Os extends cn{constructor(e,t,i){Number.isInteger(t)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),t=i),super(e,e,t),t=t||{},this.texture=new Ds(void 0,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.encoding),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==t.generateMipmaps&&t.generateMipmaps,this.texture.minFilter=void 0!==t.minFilter?t.minFilter:_e,this.texture._needsFlipEnvMap=!1}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.format=Be,this.texture.encoding=t.encoding,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const i={tEquirect:{value:null}},n="\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include <begin_vertex>\n\t\t\t\t\t#include <project_vertex>\n\n\t\t\t\t}\n\t\t\t",r="\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include <common>\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t",s=new Ms(5,5,5),o=new As({name:"CubemapFromEquirect",uniforms:Ts(i),vertexShader:n,fragmentShader:r,side:f,blending:_});o.uniforms.tEquirect.value=t;const a=new bs(s,o),l=t.minFilter;return t.minFilter===we&&(t.minFilter=_e),new Rs(1,10,this).update(e,a),t.minFilter=l,a.geometry.dispose(),a.material.dispose(),this}clear(e,t,i,n){const r=e.getRenderTarget();for(let r=0;r<6;r++)e.setRenderTarget(this,r),e.clear(t,i,n);e.setRenderTarget(r)}}Os.prototype.isWebGLCubeRenderTarget=!0;const Is=new mn,Fs=new mn,Vs=new Ki;class Us{constructor(e=new mn(1,0,0),t=0){this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,i,n){return this.normal.set(e,t,i),this.constant=n,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,i){const n=Is.subVectors(i,t).cross(Fs.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(n,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)}intersectLine(e,t){const i=e.delta(Is),n=this.normal.dot(i);if(0===n)return 0===this.distanceToPoint(e.start)?t.copy(e.start):null;const r=-(e.start.dot(this.normal)+this.constant)/n;return r<0||r>1?null:t.copy(i).multiplyScalar(r).add(e.start)}intersectsLine(e){const t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const i=t||Vs.getNormalMatrix(e),n=this.coplanarPoint(Is).applyMatrix4(e),r=this.normal.applyMatrix3(i).normalize();return this.constant=-n.dot(r),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return(new this.constructor).copy(this)}}Us.prototype.isPlane=!0;const Bs=new Fn,Ns=new mn;class zs{constructor(e=new Us,t=new Us,i=new Us,n=new Us,r=new Us,s=new Us){this.planes=[e,t,i,n,r,s]}set(e,t,i,n,r,s){const o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(i),o[3].copy(n),o[4].copy(r),o[5].copy(s),this}copy(e){const t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e){const t=this.planes,i=e.elements,n=i[0],r=i[1],s=i[2],o=i[3],a=i[4],l=i[5],c=i[6],h=i[7],u=i[8],d=i[9],m=i[10],p=i[11],f=i[12],g=i[13],v=i[14],y=i[15];return t[0].setComponents(o-n,h-a,p-u,y-f).normalize(),t[1].setComponents(o+n,h+a,p+u,y+f).normalize(),t[2].setComponents(o+r,h+l,p+d,y+g).normalize(),t[3].setComponents(o-r,h-l,p-d,y-g).normalize(),t[4].setComponents(o-s,h-c,p-m,y-v).normalize(),t[5].setComponents(o+s,h+c,p+m,y+v).normalize(),this}intersectsObject(e){const t=e.geometry;return null===t.boundingSphere&&t.computeBoundingSphere(),Bs.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(Bs)}intersectsSprite(e){return Bs.center.set(0,0,0),Bs.radius=.7071067811865476,Bs.applyMatrix4(e.matrixWorld),this.intersectsSphere(Bs)}intersectsSphere(e){const t=this.planes,i=e.center,n=-e.radius;for(let e=0;e<6;e++)if(t[e].distanceToPoint(i)<n)return!1;return!0}intersectsBox(e){const t=this.planes;for(let i=0;i<6;i++){const n=t[i];if(Ns.x=n.normal.x>0?e.max.x:e.min.x,Ns.y=n.normal.y>0?e.max.y:e.min.y,Ns.z=n.normal.z>0?e.max.z:e.min.z,n.distanceToPoint(Ns)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}function ks(){let e=null,t=!1,i=null,n=null;function r(t,s){i(t,s),n=e.requestAnimationFrame(r)}return{start:function(){!0!==t&&null!==i&&(n=e.requestAnimationFrame(r),t=!0)},stop:function(){e.cancelAnimationFrame(n),t=!1},setAnimationLoop:function(e){i=e},setContext:function(t){e=t}}}function Gs(e,t){const i=t.isWebGL2,n=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),n.get(e)},remove:function(t){t.isInterleavedBufferAttribute&&(t=t.data);const i=n.get(t);i&&(e.deleteBuffer(i.buffer),n.delete(t))},update:function(t,r){if(t.isGLBufferAttribute){const e=n.get(t);return void((!e||e.version<t.version)&&n.set(t,{buffer:t.buffer,type:t.type,bytesPerElement:t.elementSize,version:t.version}))}t.isInterleavedBufferAttribute&&(t=t.data);const s=n.get(t);void 0===s?n.set(t,function(t,n){const r=t.array,s=t.usage,o=e.createBuffer();e.bindBuffer(n,o),e.bufferData(n,r,s),t.onUploadCallback();let a=5126;return r instanceof Float32Array?a=5126:r instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):r instanceof Uint16Array?t.isFloat16BufferAttribute?i?a=5131:console.warn("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2."):a=5123:r instanceof Int16Array?a=5122:r instanceof Uint32Array?a=5125:r instanceof Int32Array?a=5124:r instanceof Int8Array?a=5120:(r instanceof Uint8Array||r instanceof Uint8ClampedArray)&&(a=5121),{buffer:o,type:a,bytesPerElement:r.BYTES_PER_ELEMENT,version:t.version}}(t,r)):s.version<t.version&&(function(t,n,r){const s=n.array,o=n.updateRange;e.bindBuffer(r,t),-1===o.count?e.bufferSubData(r,0,s):(i?e.bufferSubData(r,o.offset*s.BYTES_PER_ELEMENT,s,o.offset,o.count):e.bufferSubData(r,o.offset*s.BYTES_PER_ELEMENT,s.subarray(o.offset,o.offset+o.count)),o.count=-1)}(s.buffer,t,r),s.version=t.version)}}}class js extends ns{constructor(e=1,t=1,i=1,n=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:i,heightSegments:n};const r=e/2,s=t/2,o=Math.floor(i),a=Math.floor(n),l=o+1,c=a+1,h=e/o,u=t/a,d=[],m=[],p=[],f=[];for(let e=0;e<c;e++){const t=e*u-s;for(let i=0;i<l;i++){const n=i*h-r;m.push(n,-t,0),p.push(0,0,1),f.push(i/o),f.push(1-e/a)}}for(let e=0;e<a;e++)for(let t=0;t<o;t++){const i=t+l*e,n=t+l*(e+1),r=t+1+l*(e+1),s=t+1+l*e;d.push(i,n,s),d.push(n,r,s)}this.setIndex(d),this.setAttribute("position",new Zr(m,3)),this.setAttribute("normal",new Zr(p,3)),this.setAttribute("uv",new Zr(f,2))}static fromJSON(e){return new js(e.width,e.height,e.widthSegments,e.heightSegments)}}const Hs
vendor: 40,253 bytes, line 949
949={alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef USE_ALPHATEST\n\tif ( diffuseColor.a < alphaTest ) discard;\n#endif",alphatest_pars_fragment:"#ifdef USE_ALPHATEST\n\tuniform float alphaTest;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n\t#endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",begin_vertex:"vec3 transformed = vec3( position );",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"vec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n\tfloat alpha = pow2( roughness );\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\treturn sheenColor * ( D * V );\n}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_maxMipLevel 8.0\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_maxTileSize 256.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\tfloat texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize );\n\t\tvec2 uv = getUV( direction, face ) * ( faceSize - 1.0 );\n\t\tvec2 f = fract( uv );\n\t\tuv += 0.5 - f;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tif ( mipInt < cubeUV_maxMipLevel ) {\n\t\t\tuv.y += 2.0 * cubeUV_maxTileSize;\n\t\t}\n\t\tuv.y += filterInt * 2.0 * cubeUV_minTileSize;\n\t\tuv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize );\n\t\tuv *= texelSize;\n\t\tvec3 tl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x += texelSize;\n\t\tvec3 tr = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.y += texelSize;\n\t\tvec3 br = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x -= texelSize;\n\t\tvec3 bl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tvec3 tm = mix( tl, tr, f.x );\n\t\tvec3 bm = mix( bl, br, f.x );\n\t\treturn mix( tm, bm, f.y );\n\t}\n\t#define r0 1.0\n\t#define v0 0.339\n\t#define m0 - 2.0\n\t#define r1 0.8\n\t#define v1 0.276\n\t#define m1 - 1.0\n\t#define r4 0.4\n\t#define v4 0.046\n\t#define m4 2.0\n\t#define r5 0.305\n\t#define v5 0.016\n\t#define m5 3.0\n\t#define r6 0.21\n\t#define v6 0.0038\n\t#define m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= r1 ) {\n\t\t\tmip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0;\n\t\t} else if ( roughness >= r4 ) {\n\t\t\tmip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1;\n\t\t} else if ( roughness >= r5 ) {\n\t\t\tmip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4;\n\t\t} else if ( roughness >= r6 ) {\n\t\t\tmip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), m0, cubeUV_maxMipLevel );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = clamp( floor( D ) / 255.0, 0.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\n\tXp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract( Le );\n\tvResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t\tenvColor = envMapTexelToLinear( envColor );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP )\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 reflectVec;\n\t\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\t\treflectVec = reflect( - viewDir, normal );\n\t\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\t#else\n\t\t\t\treflectVec = refract( - viewDir, normal, refractionRatio );\n\t\t\t#endif\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float vFogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn texture2D( gradientMap, coord ).rgb;\n\t#else\n\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tlightMapIrradiance *= PI;\n\t#endif\n\treflectedLight.indirectDiffuse += lightMapIrradiance;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry.normal );\n#ifdef DOUBLE_SIDED\n\tvIndirectBack += getAmbientLightIrradiance( ambientLightColor );\n\tvIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry.normal );\n#endif\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointLightInfo( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotLightInfo( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalLightInfo( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry.normal );\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tif ( cutoffDistance > 0.0 ) {\n\t\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t}\n\t\treturn distanceFalloff;\n\t#else\n\t\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\t\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t\t}\n\t\treturn 1.0;\n\t#endif\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointLightInfo( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material )\t(0)",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\t#ifdef SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULARINTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a;\n\t\t#endif\n\t\t#ifdef USE_SPECULARCOLORMAP\n\t\t\tspecularColorFactor *= specularColorMapTexelToLinear( texture2D( specularColorMap, vUv ) ).rgb;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( ior - 1.0 ) / ( ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEENCOLORMAP\n\t\tmaterial.sheenColor *= sheenColorMapTexelToLinear( texture2D( sheenColorMap, vUv ) ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEENROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vUv ).a;\n\t#endif\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n};\nvec3 clearcoatSpecular = vec3( 0.0 );\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\tvec3 FssEss = specularColor * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3(
949 0, 1,
vendor: 24,985 bytes, line 949
9490 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecular += ccIrradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\treflectedLight.directSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.roughness );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tcomputeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef USE_CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry.normal );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometry.normal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] > 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1, 2 ) * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\t\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\t\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\t\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n\t#endif\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t\tuniform sampler2DArray morphTargetsTexture;\n\t\tuniform vec2 morphTargetsTextureSize;\n\t\tvec3 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset, const in int stride ) {\n\t\t\tfloat texelIndex = float( vertexIndex * stride + offset );\n\t\t\tfloat y = floor( texelIndex / morphTargetsTextureSize.x );\n\t\t\tfloat x = texelIndex - y * morphTargetsTextureSize.x;\n\t\t\tvec3 morphUV = vec3( ( x + 0.5 ) / morphTargetsTextureSize.x, y / morphTargetsTextureSize.y, morphTargetIndex );\n\t\t\treturn texture( morphTargetsTexture, morphUV ).xyz;\n\t\t}\n\t#else\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\tuniform float morphTargetInfluences[ 8 ];\n\t\t#else\n\t\t\tuniform float morphTargetInfluences[ 4 ];\n\t\t#endif\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\t#ifndef USE_MORPHNORMALS\n\t\t\t\tif ( morphTargetInfluences[ i ] > 0.0 ) transformed += getMorph( gl_VertexID, i, 0, 1 ) * morphTargetInfluences[ i ];\n\t\t\t#else\n\t\t\t\tif ( morphTargetInfluences[ i ] > 0.0 ) transformed += getMorph( gl_VertexID, i, 0, 2 ) * morphTargetInfluences[ i ];\n\t\t\t#endif\n\t\t}\n\t#else\n\t\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\t\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\t\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\t\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t\t#endif\n\t#endif\n#endif",normal_fragment_begin:"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * faceDirection;\n\t\t\tbitangent = bitangent * faceDirection;\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( - vViewPosition, normal, mapN, faceDirection );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normal_pars_fragment:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_pars_vertex:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_vertex:"#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det );\n\t\treturn normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection );\n\t#endif\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif",output_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= transmissionAlpha + 0.1;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;
vendor: 4,652 bytes, line 949
949\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
vendor: 7,260 bytes, line 949
949\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\n\t\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\tvec4 shadowWorldPosition;\n\t#endif\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3(
949 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605,
vendor: 36,896 bytes, line 949
9491.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n\tfloat transmissionAlpha = 1.0;\n\tfloat transmissionFactor = transmission;\n\tfloat thicknessFactor = thickness;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\ttransmissionFactor *= texture2D( transmissionMap, vUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tthicknessFactor *= texture2D( thicknessMap, vUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmission = getIBLVolumeRefraction(\n\t\tn, v, roughnessFactor, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor,\n\t\tattenuationColor, attenuationDistance );\n\ttotalDiffuse = mix( totalDiffuse, transmission.rgb, transmissionFactor );\n\ttransmissionAlpha = mix( transmissionAlpha, transmission.a, transmissionFactor );\n#endif",transmission_pars_fragment:"#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tvec3 getVolumeTransmissionRay( vec3 n, vec3 v, float thickness, float ior, mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( float roughness, float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( vec2 fragCoord, float roughness, float ior ) {\n\t\tfloat framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\treturn texture2DLodEXT( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n\t\t#else\n\t\t\treturn texture2D( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n\t\t#endif\n\t}\n\tvec3 applyVolumeAttenuation( vec3 radiance, float transmissionDistance, vec3 attenuationColor, float attenuationDistance ) {\n\t\tif ( attenuationDistance == 0.0 ) {\n\t\t\treturn radiance;\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance * radiance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( vec3 n, vec3 v, float roughness, vec3 diffuseColor, vec3 specularColor, float specularF90,\n\t\tvec3 position, mat4 modelMatrix, mat4 viewMatrix, mat4 projMatrix, float ior, float thickness,\n\t\tvec3 attenuationColor, float attenuationDistance ) {\n\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\t\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\tvec3 attenuatedColor = applyVolumeAttenuation( transmittedLight.rgb, length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a );\n\t}\n#endif",uv_pars_fragment:"#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION )\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",cube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",cube_frag:"#include <envmap_common_pars_fragment>\nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include <envmap_fragment>\n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",depth_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <logdepthbuf_fragment>\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",meshbasic_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinbase_vertex>\n\t\t#include <skinnormal_vertex>\n\t\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\n\t#include <lightmap_fragment>\n\treflectedLight.indirectDiffuse *= BRDF_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t\tmatcapColor = matcapTexelToLinear( matcapColor );\n\t#else\n\t\tvec4 matcapColor = vec4( 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",meshnormal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULARINTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n\t#ifdef USE_SPECULARCOLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEENCOLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEENROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include <transmission_fragment>\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - clearcoat * Fcc ) + clearcoatSpecular * clearcoat;\n\t#endif\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",shadow_vert:"#include <common>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}"},
vendor: 626 bytes, line 949
949Ws={common:{diffuse:{value:new Fr(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new Ki},uv2Transform:{value:new Ki},alphaMap:{value:null},alphaTest:{value:0}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new Yi(1,1)}}
vendor: 5,208 bytes, line 949
949,displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Fr(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Fr(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new Ki}},sprite:{diffuse:{value:new Fr(16777215)},opacity:{value:1},center:{value:new Yi(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new Ki}}},qs={basic:{uniforms:Ss([Ws.common,Ws.specularmap,Ws.envmap,Ws.aomap,Ws.lightmap,Ws.fog]),vertexShader:Hs.meshbasic_vert,fragmentShader:Hs.meshbasic_frag},lambert:{uniforms:Ss([Ws.common,Ws.specularmap,Ws.envmap,Ws.aomap,Ws.lightmap,Ws.emissivemap,Ws.fog,Ws.lights,{emissive:{value:new Fr(0)}}]),vertexShader:Hs.meshlambert_vert,fragmentShader:Hs.meshlambert_frag},phong:{uniforms:Ss([Ws.common,Ws.specularmap,Ws.envmap,Ws.aomap,Ws.lightmap,Ws.emissivemap,Ws.bumpmap,Ws.normalmap,Ws.displacementmap,Ws.fog,Ws.lights,{emissive:{value:new Fr(0)},specular:{value:new Fr(1118481)},shininess:{value:30}}]),vertexShader:Hs.meshphong_vert,fragmentShader:Hs.meshphong_frag},standard:{uniforms:Ss([Ws.common,Ws.envmap,Ws.aomap,Ws.lightmap,Ws.emissivemap,Ws.bumpmap,Ws.normalmap,Ws.displacementmap,Ws.roughnessmap,Ws.metalnessmap,Ws.fog,Ws.lights,{emissive:{value:new Fr(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Hs.meshphysical_vert,fragmentShader:Hs.meshphysical_frag},toon:{uniforms:Ss([Ws.common,Ws.aomap,Ws.lightmap,Ws.emissivemap,Ws.bumpmap,Ws.normalmap,Ws.displacementmap,Ws.gradientmap,Ws.fog,Ws.lights,{emissive:{value:new Fr(0)}}]),vertexShader:Hs.meshtoon_vert,fragmentShader:Hs.meshtoon_frag},matcap:{uniforms:Ss([Ws.common,Ws.bumpmap,Ws.normalmap,Ws.displacementmap,Ws.fog,{matcap:{value:null}}]),vertexShader:Hs.meshmatcap_vert,fragmentShader:Hs.meshmatcap_frag},points:{uniforms:Ss([Ws.points,Ws.fog]),vertexShader:Hs.points_vert,fragmentShader:Hs.points_frag},dashed:{uniforms:Ss([Ws.common,Ws.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Hs.linedashed_vert,fragmentShader:Hs.linedashed_frag},depth:{uniforms:Ss([Ws.common,Ws.displacementmap]),vertexShader:Hs.depth_vert,fragmentShader:Hs.depth_frag},normal:{uniforms:Ss([Ws.common,Ws.bumpmap,Ws.normalmap,Ws.displacementmap,{opacity:{value:1}}]),vertexShader:Hs.meshnormal_vert,fragmentShader:Hs.meshnormal_frag},sprite:{uniforms:Ss([Ws.sprite,Ws.fog]),vertexShader:Hs.sprite_vert,fragmentShader:Hs.sprite_frag},background:{uniforms:{uvTransform:{value:new Ki},t2D:{value:null}},vertexShader:Hs.background_vert,fragmentShader:Hs.background_frag},cube:{uniforms:Ss([Ws.envmap,{opacity:{value:1}}]),vertexShader:Hs.cube_vert,fragmentShader:Hs.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Hs.equirect_vert,fragmentShader:Hs.equirect_frag},distanceRGBA:{uniforms:Ss([Ws.common,Ws.displacementmap,{referencePosition:{value:new mn},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Hs.distanceRGBA_vert,fragmentShader:Hs.distanceRGBA_frag},shadow:{uniforms:Ss([Ws.lights,Ws.fog,{color:{value:new Fr(0)},opacity:{value:1}}]),vertexShader:Hs.shadow_vert,fragmentShader:Hs.shadow_frag}};function Xs(e,t,i,n,r){const s=new Fr(0);let o,a,l=0,c=null,h=0,u=null;function d(e,t){i.buffers.color.setClear(e.r,e.g,e.b,t,r)}return{getClearColor:function(){return s},setClearColor:function(e,t=1){s.set(e),l=t,d(s,l)},getClearAlpha:function(){return l},setClearAlpha:function(e){l=e,d(s,l)},render:function(i,r){let m=!1,g=!0===r.isScene?r.background:null;g&&g.isTexture&&(g=t.get(g));const v=e.xr,y=v.getSession&&v.getSession();y&&"additive"===y.environmentBlendMode&&(g=null),null===g?d(s,l):g&&g.isColor&&(d(g,1),m=!0),(e.autoClear||m)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),g&&(g.isCubeTexture||g.mapping===ce)?(void 0===a&&(a=new bs(new Ms(1,1,1),new As({name:"Backgroun
949dCubeMaterial",uniforms:Ts(qs.cube.uniforms),vertexShader:qs.cube.vertexShader,fragmentShader:qs.cube.fragmentShader,side:f,depthTest:!1,depthWrite:!1,fog:!1})),a.geometry.deleteAttribute("normal"),a.geometry.deleteAttribute("uv"),a.onBeforeRender=function(e,t,i){this.matrixWorld.copyPosition(i.matrixWorld)},Object.defineProperty(a.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(a)),a.material.uniforms.envMap.value=g,a.material.uniforms.flipEnvMap.value=g.isCubeTexture&&!1===g.isRenderTargetTexture?-1:1,c===g&&h===g.version&&u===e.toneMapping||(a.material.needsUpdate=!0,c=g,h=g.version,u=e.toneMapping),i.unshift(a,a.geometry,a.material,0,0,null)):g&&g.isTexture&&(void 0===o&&(o=new bs(new js(2,2),new As({name:"BackgroundMaterial",uniforms:Ts(qs.background.uniforms),vertexShader:qs.background.vertexShader,fragmentShader:qs.background.fragmentShader,side:p,depthTest:!1,depthWrite:!1,fog:!1})),o.geometry.deleteAttribute("normal"),Object.defineProperty(o.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(o)),o.material.uniforms.t2D.value=g,!0===g.matrixAutoUpdate&&g.updateMatrix(),o.material.uniforms.uvTransform.value.copy(g.matrix),c===g&&h===g.version&&u===e.toneMapping||(o.material.needsUpdate=!0,c=g,h=g.version,u=e.toneMapping),i.unshift(o,o.geometry,o.material,0,0,null))}}}function Zs(e,t,i,n){const r=e.getParameter(34921),s=n.isWebGL2?null:t.get("OES_vertex_array_object"),o=n.isWebGL2||null!==s,a={},l=d(null);let c=l;function h(t){return n.isWebGL2?e.bindVertexArray(t):s.bindVertexArrayOES(t)}function u(t){return n.isWebGL2?e.deleteVertexArray(t):s.deleteVertexArrayOES(t)}function d(e){const t=[],i=[],n=[];for(let e=0;e<r;e++)t[e]=0,i[e]=0,n[e]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:t,enabledAttributes:i,attributeDivisors:n,object:e,attributes:{},index:null}}function m(){const e=c.newAttributes;for(let t=0,i=e.length;t<i;t++)e[t]=0}function p(e){f(e,0)}function f(i,r){const s=c.newAttributes,o=c.enabledAttributes,a=c.attributeDivisors;s[i]=1,0===o[i]&&(e.enableVertexAttribArray(i),o[i]=1),a[i]!==r&&((n.isWebGL2?e:t.get("ANGLE_instanced_arrays"))[n.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](i,r),a[i]=r)}function g(){const t=c.newAttributes,i=c.enabledAttributes;for(let n=0,r=i.length;n<r;n++)i[n]!==t[n]&&(e.disableVertexAttribArray(n),i[n]=0)}function v(t,i,r,s,o,a){!0!==n.isWebGL2||5124!==r&&5125!==r?e.vertexAttribPointer(t,i,r,s,o,a):e.vertexAttribIPointer(t,i,r,o,a)}function y(){_(),c!==l&&(c=l,h(c.object))}function _(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:function(r,l,u,y,_){let x=!1;if(o){const t=function(t,i,r){const o=!0===r.wireframe;let l=a[t.id];void 0===l&&(l={},a[t.id]=l);let c=l[i.id];void 0===c&&(c={},l[i.id]=c);let h=c[o];return void 0===h&&(h=d(n.isWebGL2?e.createVertexArray():s.createVertexArrayOES()),c[o]=h),h}(y,u,l);c!==t&&(c=t,h(c.object)),x=function(e,t){const i=c.attributes,n=e.attributes;let r=0;for(const e in n){const t=i[e],s=n[e];if(void 0===t)return!0;if(t.attribute!==s)return!0;if(t.data!==s.data)return!0;r++}return c.attributesNum!==r||c.index!==t}(y,_),x&&function(e,t){const i={},n=e.attributes;let r=0;for(const e in n){const t=n[e],s={};s.attribute=t,t.data&&(s.data=t.data),i[e]=s,r++}c.attributes=i,c.attributesNum=r,c.index=t}(y,_)}else{const e=!0===l.wireframe;c.geometry===y.id&&c.program===u.id&&c.wireframe===e||(c.geometry=y.id,c.program=u.id,c.wireframe=e,x=!0)}!0===r.isInstancedMesh&&(x=!0),null!==_&&i.update(_,34963),x&&(function(r,s,o,a){if(!1===n.isWebGL2&&(r.isInstancedMesh||a.isInstancedBufferGeometry)&&null===t.get("ANGLE_instanced_arrays"))return;m();const l=a.attributes,c=o.getAttributes(),h=s.defaultAttributeValues;for(const t in c){const n=c[t];if(n.location>=0){let s=l[t];if(void 0===s&&("instanceMatrix"===t&&r.instanceMatrix&&(s=r.instanceMatrix),"instanceColor"===t&&r.instanceColor&&(s=r.instanceColor)),void 0!==s){const t=s.normalized,o=s.itemSize,l=i.get(s);if(void 0===l)continue;const c=l.buffer,h=l.type,u=l.bytesPerElement;if(s.isInterleavedBufferAttribute){const i=s.data,l=i.stride,d=s.offset;if(i&&i.isInstancedInterleavedBuffer){for(let e=0;e<n.locationSize;e++)f(n.location+e,i.meshPerAttribute);!0!==r.isInstancedMesh&&void 0===a._maxInstanceCount&&(a._maxInstanceCount=i.meshPerAttribute*i.count)}else for(let e=0;e<n.locationSize;e++)p(n.location+e);e.bindBuffer(34962,c);for(let e=0;e<n.locationSize;e++)v(n.location+e,o/n.locationSize,h,t,l*u,(d+o/n.locationSize*e)*u)}else{if(s.isInstancedBufferAttribute){for(let e=0;e<n.locationSize;e++)f(n.location+e,s.meshPerAttribute);!0!==r.isInstancedMesh&&void 0===a._maxInstanceCount&&(a._maxInstanceCount=s.meshPerAttribute*s.count)}else for(let e=0;e<n.locationSize;e++)p(n.location+e);e.bindBuffer(34962,c);for(let e=0;e<n.locationSize;e++)v(n.location+e,o/n.locationSize,h,t,o*u,o/n.locationSize*e*u)}}else if(void 0!==h){const i=h[t];if(void 0!==i)switch(i.length){case 2:e.vertexAttrib2fv(n.location,i);break;case 3:e.vertexAttrib3fv(n.location,i);break;case 4:e.vertexAttrib4fv(n.location,i);break;default:e.vertexAttrib1fv(n.location,i)}}}}g()}(r,l,u,y),null!==_&&e.bindBuffer(34963,i.get(_).buffer))},reset:y,resetDefaultState:_,dispose:function(){y();for(const e in a){const t=a[e];for(const e in t){const i=t[e];for(const e in i)u(i[e].object),delete i[e];delete t[e]}delete a[e]}},releaseStatesOfGeometry:function(e){if(void 0===a[e.id])return;const t=a[e.id];for(const e in t){const i=t[e];for(const e in i)u(i[e].object),delete i[e];delete t[e]}delete a[e.id]},releaseStatesOfProgram:function(e){for(const t in a){const i=a[t];if(void 0===i[e.id])continue;
vendor: 4,836 bytes, line 949
949const n=i[e.id];for(const e in n)u(n[e].object),delete n[e];delete i[e.id]}},initAttributes:m,enableAttribute:p,disableUnusedAttributes:g}}function Ys(e,t,i,n){const r=n.isWebGL2;let s;this.setMode=function(e){s=e},this.render=function(t,n){e.drawArrays(s,t,n),i.update(n,s,1)},this.renderInstances=function(n,o,a){if(0===a)return;let l,c;if(r)l=e,c="drawArraysInstanced";else if(l=t.get("ANGLE_instanced_arrays"),c="drawArraysInstancedANGLE",null===l)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");l[c](s,n,o,a),i.update(o,s,a)}}function Ks(e,t,i){let n;function r(t){if("highp"===t){if(e.getShaderPrecisionFormat(35633,36338).precision>0&&e.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(35633,36337).precision>0&&e.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const s="undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&e instanceof WebGL2ComputeRenderingContext;let o=void 0!==i.precision?i.precision:"highp";const a=r(o);a!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",a,"instead."),o=a);const l=s||t.has("WEBGL_draw_buffers"),c=!0===i.logarithmicDepthBuffer,h=e.getParameter(34930),u=e.getParameter(35660),d=e.getParameter(3379),m=e.getParameter(34076),p=e.getParameter(34921),f=e.getParameter(36347),g=e.getParameter(36348),v=e.getParameter(36349),y=u>0,_=s||t.has("OES_texture_float");return{isWebGL2:s,drawBuffers:l,getMaxAnisotropy:function(){if(void 0!==n)return n;if(!0===t.has("EXT_texture_filter_anisotropic")){const i=t.get("EXT_texture_filter_anisotropic");n=e.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else n=0;return n},getMaxPrecision:r,precision:o,logarithmicDepthBuffer:c,maxTextures:h,maxVertexTextures:u,maxTextureSize:d,maxCubemapSize:m,maxAttributes:p,maxVertexUniforms:f,maxVaryings:g,maxFragmentUniforms:v,vertexTextures:y,floatFragmentTextures:_,floatVertexTextures:y&&_,maxSamples:s?e.getParameter(36183):0}}function $s(e){const t=this;let i=null,n=0,r=!1,s=!1;const o=new Us,a=new Ki,l={value:null,needsUpdate:!1};function c(){l.value!==i&&(l.value=i,l.needsUpdate=n>0),t.numPlanes=n,t.numIntersection=0}function h(e,i,n,r){const s=null!==e?e.length:0;let c=null;if(0!==s){if(c=l.value,!0!==r||null===c){const t=n+4*s,r=i.matrixWorldInverse;a.getNormalMatrix(r),(null===c||c.length<t)&&(c=new Float32Array(t));for(let t=0,i=n;t!==s;++t,i+=4)o.copy(e[t]).applyMatrix4(r,a),o.normal.toArray(c,i),c[i+3]=o.constant}l.value=c,l.needsUpdate=!0}return t.numPlanes=s,t.numIntersection=0,c}this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(e,t,s){const o=0!==e.length||t||0!==n||r;return r=t,i=h(e,s,0),n=e.length,o},this.beginShadows=function(){s=!0,h(null)},this.endShadows=function(){s=!1,c()},this.setState=function(t,o,a){const u=t.clippingPlanes,d=t.clipIntersection,m=t.clipShadows,p=e.get(t);if(!r||null===u||0===u.length||s&&!m)s?h(null):c();else{const e=s?0:n,t=4*e;let r=p.clippingState||null;l.value=r,r=h(u,o,t,a);for(let e=0;e!==t;++e)r[e]=i[e];p.clippingState=r,this.numIntersection=d?this.numPlanes:0,this.numPlanes+=e}}}function Js(e){let t=new WeakMap;function i(e,t){return t===ae?e.mapping=se:t===le&&(e.mapping=oe),e}function n(e){const i=e.target;i.removeEventListener("dispose",n);const r=t.get(i);void 0!==r&&(t.delete(i),r.dispose())}return{get:function(r){if(r&&r.isTexture&&!1===r.isRenderTargetTexture){const s=r.mapping;if(s===ae||s===le){if(t.has(r))return i(t.get(r).texture,r.mapping);{const s=r.image;if(s&&s.height>0){const o=e.getRenderTarget(),a=new Os(s.height/2);return a.fromEquirectangularTexture(e,r),t.set(r,a),e.setRenderTarget(o),r.addEventListener("dispose",n),i(a.texture,r.mapping)}return null}}}return r},dispose:function(){t=new WeakMap}}}qs.physical={uniforms:Ss([qs.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new Yi(1,1)},clearcoatNormalMap:{value:null},sheen:{value:0},sheenColor:{value:new Fr(0)},sheenColorMap:{value:null},sheenRoughness:{value:0},sheenRoughnessMap:{value:null},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new Yi},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new Fr(0)},specularIntensity:{value:0},specularIntensityMap:{value:null},specularColor:{value:new Fr(1,1,1)},specularColorMap:{value:null}}]),vertexShader:Hs.meshphysical_vert,fragmentShader:Hs.meshphysical_frag};class Qs extends Cs{constructor(e=-1,t=1,i=1,n=-1,r=.1,s=2e3){super(),this.type="Orthogra
949phicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=i,this.bottom=n,this.near=r,this.far=s,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=null===e.view?null:Object.assign({},e.view),this}setViewOffset(e,t,i,n,r,s){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=n,this.view.width=r,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,n=(this.top+this.bottom)/2;let r=i-e,s=i+e,o=n+t,a=n-t;if(null!==this.view&&this.view.enabled){const e=(this.right-this.left)/this.view.fullWidth/this.zoom,t=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=e*this.view.offsetX,s=r+e*this.view.width,o-=t*this.view.offsetY,a=o-t*this.view.height}this.projectionMatrix.makeOrthographic(r,s,o,a,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}}Qs.prototype.isOrthographicCamera=!0;class eo extends As{constructor(e){super(e),this.type="RawShaderMaterial"}}eo.prototype.isRawShaderMaterial=!0;const to=Math.pow(2,8),io=[.125,.215,.35,.446,.526,.582],no=5+io.length,ro={[Kt]:0,[$t]:1,[Qt]:2,[ti]:3,[ii]:4,[ni]:5,[Jt]:6},so=new Qs,{_lodPlanes:oo,_sizeLods:ao,_sigmas:lo}=vo(),co=new Fr;let ho=null;const uo=(1+Math.sqrt(5))/2,mo=1/uo,po=[new mn(1,1,1),new mn(-1,1,1),new mn(1,1,-1),new mn(-1,1,-1),new mn(0,uo,mo),new mn(0,uo,-mo),new mn(mo,0,uo),new mn(-mo,0,uo),new mn(uo,mo,0),new mn(-uo,mo,0)];class fo{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._blurMaterial=function(e){const t=new Float32Array(20),i=new mn(0,1,0);return new eo({name:"SphericalGaussianBlur",defines:{n:20},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:t},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i},inputEncoding:{value:ro[Kt]},outputEncoding:{value:ro[Kt]}},vertexShader:"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute vec3 position;\n\t\tattribute vec2 uv;\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t",fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t\n\n\t\tuniform int inputEncoding;\n\t\tuniform int outputEncoding;\n\n\t\t#include <encodings_pars_fragment>\n\n\t\tvec4 inputTexelToLinear( vec4 value ) {\n\n\t\t\tif ( inputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( inputEncoding == 1 ) {\n\n\t\t\t\treturn sRGBToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 2 ) {\n\n\t\t\t\treturn RGBEToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 3 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 7.0 );\n\n\t\t\t} else if ( inputEncoding == 4 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 16.0 );\n\n\t\t\t} else if ( inputEncoding == 5 ) {\n\n\t\t\t\treturn RGBDToLinear( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn GammaToLinear( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 linearToOutputTexel( vec4 value ) {\n\n\t\t\tif ( outputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( outputEncoding == 1 ) {\n\n\t\t\t\treturn LinearTosRGB( value );\n\n\t\t\t} else if ( outputEncoding == 2 ) {\n\n\t\t\t\treturn LinearToRGBE( value );\n\n\t\t\t} else if ( outputEncoding == 3 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 7.0 );\n\n\t\t\t} else if ( outputEncoding == 4 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 16.0 );\n\n\t\t\t} else if ( outputEncoding == 5 ) {\n\n\t\t\t\treturn LinearToRGBD( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn LinearToGamma( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 envMapTexelToLinear( vec4 color ) {\n\n\t\t\treturn inputTexelToLinear( color );\n\n\t\t}\n\t\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include <cube_uv_reflection_fragment>\n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t",blending:_,depthTest:!1,depthWrite:!1})}(),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,i=.1,n=100){ho=this._renderer.getRenderTarget();const r=this._allocateTargets();return this._sceneToCubeUV(e,i,n,r),t>0&&this._blur(r,0,0,t),this._applyPMREM(r),this._cleanup(r),r}fromEquirectangular(e){return this._fromTexture(e)}fromCubemap(e){return this._fromTexture(e)}compileCubemapShader(){null===this._cubemapShader&&(this._cubemapShader=bo(),this._compileMaterial(this._cubemapShader))}compileEquirectangularShader(){null===this._equirectShader&&(this._equirectShader=xo(),this._compileMaterial(this._equirectShader))}dispose(){this._blurMaterial.dispose(),null!==this._cubemapShader&&this._cubemapShader.dispose(),null!==this._equirectShader&&this._equirectShader.dispose();for(let e=0;e<oo.length;e++)oo[e].dispose()}_cleanup(e){this._pingPongRenderTarget.dispose(),this._renderer.setRenderTarget(ho),e.scissorTest=!1,_o(e,0,0,e.width,e.height)}_fromTexture(e){ho=this._renderer.getRenderTarget();const t=this._allocateTargets(e);return this._textureToCubeUV(e,t),this._applyPMREM(t),this._cleanup(t),t}_allocateTargets(e){const t={magFilter:pe,minFilter:pe,generateMipmaps:!1,type:Te,format:ke,encoding:go(e)?e.encoding:Qt,depthBuffer:!1},i=yo(t);return i.depthBuffer=!e,this._pingPongRenderTarget=yo(t),i}_compileMaterial(e){const t=new bs(oo[0],e);this._renderer.compile(t,so)}_sceneToCubeUV(e,t,i,n){const r=new Ps(90,1,t,i),s=[1,-1,1,1,1,1],o=[1,1,1,-1,-1,-1],a=this._renderer,l=a.autoClear,c=a.outputEncoding,h=a.toneMapping;a.getClearColor(co),a.toneMapping=J,a.outputEncoding=Kt,a.autoClear=!1;
vendor: 57,284 bytes, line 949
949const u=new Vr({name:"PMREM.Background",side:f,depthWrite:!1,depthTest:!1}),d=new bs(new Ms,u);let m=!1;const p=e.background;p?p.isColor&&(u.color.copy(p),e.background=null,m=!0):(u.color.copy(co),m=!0);for(let t=0;t<6;t++){const i=t%3;0==i?(r.up.set(0,s[t],0),r.lookAt(o[t],0,0)):1==i?(r.up.set(0,0,s[t]),r.lookAt(0,o[t],0)):(r.up.set(0,s[t],0),r.lookAt(0,0,o[t])),_o(n,i*to,t>2?to:0,to,to),a.setRenderTarget(n),m&&a.render(d,r),a.render(e,r)}d.geometry.dispose(),d.material.dispose(),a.toneMapping=h,a.outputEncoding=c,a.autoClear=l,e.background=p}_setEncoding(e,t){!0===this._renderer.capabilities.isWebGL2&&t.format===Be&&t.type===Te&&t.encoding===$t?e.value=ro[Kt]:e.value=ro[t.encoding]}_textureToCubeUV(e,t){const i=this._renderer,n=e.mapping===se||e.mapping===oe;n?null==this._cubemapShader&&(this._cubemapShader=bo()):null==this._equirectShader&&(this._equirectShader=xo());const r=n?this._cubemapShader:this._equirectShader,s=new bs(oo[0],r),o=r.uniforms;o.envMap.value=e,n||o.texelSize.value.set(1/e.image.width,1/e.image.height),this._setEncoding(o.inputEncoding,e),this._setEncoding(o.outputEncoding,t.texture),_o(t,0,0,3*to,2*to),i.setRenderTarget(t),i.render(s,so)}_applyPMREM(e){const t=this._renderer,i=t.autoClear;t.autoClear=!1;for(let t=1;t<no;t++){const i=Math.sqrt(lo[t]*lo[t]-lo[t-1]*lo[t-1]),n=po[(t-1)%po.length];this._blur(e,t-1,t,i,n)}t.autoClear=i}_blur(e,t,i,n,r){const s=this._pingPongRenderTarget;this._halfBlur(e,s,t,i,n,"latitudinal",r),this._halfBlur(s,e,i,i,n,"longitudinal",r)}_halfBlur(e,t,i,n,r,s,o){const a=this._renderer,l=this._blurMaterial;"latitudinal"!==s&&"longitudinal"!==s&&console.error("blur direction must be either latitudinal or longitudinal!");const c=new bs(oo[n],l),h=l.uniforms,u=ao[i]-1,d=isFinite(r)?Math.PI/(2*u):2*Math.PI/39,m=r/d,p=isFinite(r)?1+Math.floor(3*m):20;p>20&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${p} samples when the maximum is set to 20`);const f=[];let g=0;for(let e=0;e<20;++e){const t=e/m,i=Math.exp(-t*t/2);f.push(i),0==e?g+=i:e<p&&(g+=2*i)}for(let e=0;e<f.length;e++)f[e]=f[e]/g;h.envMap.value=e.texture,h.samples.value=p,h.weights.value=f,h.latitudinal.value="latitudinal"===s,o&&(h.poleAxis.value=o),h.dTheta.value=d,h.mipInt.value=8-i,this._setEncoding(h.inputEncoding,e.texture),this._setEncoding(h.outputEncoding,e.texture);const v=ao[n];_o(t,3*Math.max(0,to-2*v),(0===n?0:2*to)+2*v*(n>4?n-8+4:0),3*v,2*v),a.setRenderTarget(t),a.render(c,so)}}function go(e){return void 0!==e&&e.type===Te&&(e.encoding===Kt||e.encoding===$t||e.encoding===Jt)}function vo(){const e=[],t=[],i=[];let n=8;for(let r=0;r<no;r++){const s=Math.pow(2,n);t.push(s);let o=1/s;r>4?o=io[r-8+4-1]:0==r&&(o=0),i.push(o);const a=1/(s-1),l=-a/2,c=1+a/2,h=[l,l,c,l,c,c,l,l,c,c,l,c],u=6,d=6,m=3,p=2,f=1,g=new Float32Array(m*d*u),v=new Float32Array(p*d*u),y=new Float32Array(f*d*u);for(let e=0;e<u;e++){const t=e%3*2/3-1,i=e>2?0:-1,n=[t,i,0,t+2/3,i,0,t+2/3,i+1,0,t,i,0,t+2/3,i+1,0,t,i+1,0];g.set(n,m*d*e),v.set(h,p*d*e);const r=[e,e,e,e,e,e];y.set(r,f*d*e)}const _=new ns;_.setAttribute("position",new Nr(g,m)),_.setAttribute("uv",new Nr(v,p)),_.setAttribute("faceIndex",new Nr(y,f)),e.push(_),n>4&&n--}return{_lodPlanes:e,_sizeLods:t,_sigmas:i}}function yo(e){const t=new cn(3*to,3*to,e);return t.texture.mapping=ce,t.texture.name="PMREM.cubeUv",t.scissorTest=!0,t}function _o(e,t,i,n,r){e.viewport.set(t,i,n,r),e.scissor.set(t,i,n,r)}function xo(){const e=new Yi(1,1);return new eo({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null},texelSize:{value:e},inputEncoding:{value:ro[Kt]},outputEncoding:{value:ro[Kt]}},vertexShader:"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute vec3 position;\n\t\tattribute vec2 uv;\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t",fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform vec2 texelSize;\n\n\t\t\t\n\n\t\tuniform int inputEncoding;\n\t\tuniform int outputEncoding;\n\n\t\t#include <encodings_pars_fragment>\n\n\t\tvec4 inputTexelToLinear( vec4 value ) {\n\n\t\t\tif ( inputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( inputEncoding == 1 ) {\n\n\t\t\t\treturn sRGBToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 2 ) {\n\n\t\t\t\treturn RGBEToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 3 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 7.0 );\n\n\t\t\t} else if ( inputEncoding == 4 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 16.0 );\n\n\t\t\t} else if ( inputEncoding == 5 ) {\n\n\t\t\t\treturn RGBDToLinear( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn GammaToLinear( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 linearToOutputTexel( vec4 value ) {\n\n\t\t\tif ( outputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( outputEncoding == 1 ) {\n\n\t\t\t\treturn LinearTosRGB( value );\n\n\t\t\t} else if ( outputEncoding == 2 ) {\n\n\t\t\t\treturn LinearToRGBE( value );\n\n\t\t\t} else if ( outputEncoding == 3 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 7.0 );\n\n\t\t\t} else if ( outputEncoding == 4 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 16.0 );\n\n\t\t\t} else if ( outputEncoding == 5 ) {\n\n\t\t\t\treturn LinearToRGBD( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn LinearToGamma( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 envMapTexelToLinear( vec4 color ) {\n\n\t\t\treturn inputTexelToLinear( color );\n\n\t\t}\n\t\n\n\t\t\t#include <common>\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tvec2 f = fract( uv / texelSize - 0.5 );\n\t\t\t\tuv -= f * texelSize;\n\t\t\t\tvec3 tl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.x += texelSize.x;\n\t\t\t\tvec3 tr = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.y += texelSize.y;\n\t\t\t\tvec3 br = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.x -= texelSize.x;\n\t\t\t\tvec3 bl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\n\t\t\t\tvec3 tm = mix( tl, tr, f.x );\n\t\t\t\tvec3 bm = mix( bl, br, f.x );\n\t\t\t\tgl_FragColor.rgb = mix( tm, bm, f.y );\n\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t",blending:_,depthTest:!1,depthWrite:!1})}function bo(){return new eo({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},inputEncoding:{value:ro[Kt]},outputEncoding:{value:ro[Kt]}},vertexShader:"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute vec3 position;\n\t\tattribute vec2 uv;\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t",fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\t\n\n\t\tuniform int inputEncoding;\n\t\tuniform int outputEncoding;\n\n\t\t#include <encodings_pars_fragment>\n\n\t\tvec4 inputTexelToLinear( vec4 value ) {\n\n\t\t\tif ( inputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( inputEncoding == 1 ) {\n\n\t\t\t\treturn sRGBToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 2 ) {\n\n\t\t\t\treturn RGBEToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 3 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 7.0 );\n\n\t\t\t} else if ( inputEncoding == 4 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 16.0 );\n\n\t\t\t} else if ( inputEncoding == 5 ) {\n\n\t\t\t\treturn RGBDToLinear( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn GammaToLinear( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 linearToOutputTexel( vec4 value ) {\n\n\t\t\tif ( outputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( outputEncoding == 1 ) {\n\n\t\t\t\treturn LinearTosRGB( value );\n\n\t\t\t} else if ( outputEncoding == 2 ) {\n\n\t\t\t\treturn LinearToRGBE( value );\n\n\t\t\t} else if ( outputEncoding == 3 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 7.0 );\n\n\t\t\t} else if ( outputEncoding == 4 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 16.0 );\n\n\t\t\t} else if ( outputEncoding == 5 ) {\n\n\t\t\t\treturn LinearToRGBD( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn LinearToGamma( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 envMapTexelToLinear( vec4 color ) {\n\n\t\t\treturn inputTexelToLinear( color );\n\n\t\t}\n\t\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb = envMapTexelToLinear( textureCube( envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ) ) ).rgb;\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t",blending:_,depthTest:!1,depthWrite:!1})}function wo(e){let t=new WeakMap,i=null;function n(e){const i=e.target;i.removeEventListener("dispose",n);const r=t.get(i);void 0!==r&&(t.delete(i),r.dispose())}return{get:function(r){if(r&&r.isTexture&&!1===r.isRenderTargetTexture){const s=r.mapping,o=s===ae||s===le,a=s===se||s===oe;if(o||a){if(t.has(r))return t.get(r).texture;{const s=r.image;if(o&&s&&s.height>0||a&&s&&function(e){let t=0;for(let i=0;i<6;i++)void 0!==e[i]&&t++;return 6===t}(s)){const s=e.getRenderTarget();null===i&&(i=new fo(e));const a=o?i.fromEquirectangular(r):i.fromCubemap(r);return t.set(r,a),e.setRenderTarget(s),r.addEventListener("dispose",n),a.texture}return null}}}return r},dispose:function(){t=new WeakMap,null!==i&&(i.dispose(),i=null)}}}function Mo(e){const t={};function i(i){if(void 0!==t[i])return t[i];let n;switch(i){case"WEBGL_depth_texture":n=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":n=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":n=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":n=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:n=e.getExtension(i)}return t[i]=n,n}return{has:function(e){return null!==i(e)},init:function(e){e.isWebGL2?i("EXT_color_buffer_float"):(i("WEBGL_depth_texture"),i("OES_texture_float"),i("OES_texture_half_float"),i("OES_texture_half_float_linear"),i("OES_standard_derivatives"),i("OES_element_index_uint"),i("OES_vertex_array_object"),i("ANGLE_instanced_arrays")),i("OES_texture_float_linear"),i("EXT_color_buffer_half_float")},get:function(e){const t=i(e);return null===t&&console.warn("THREE.WebGLRenderer: "+e+" extension not supported."),t}}}function To(e,t,i,n){const r={},s=new WeakMap;function o(e){const a=e.target;null!==a.index&&t.remove(a.index);for(const e in a.attributes)t.remove(a.attributes[e]);a.removeEventListener("dispose",o),delete r[a.id];const l=s.get(a);l&&(t.remove(l),s.delete(a)),n.releaseStatesOfGeometry(a),!0===a.isInstancedBufferGeometry&&delete a._maxInstanceCount,i.memory.geometries--}function a(e){const i=[],n=e.index,r=e.attributes.position;let o=0;if(null!==n){const e=n.array;o=n.version;for(let t=0,n=e.length;t<n;t+=3){const n=e[t+0],r=e[t+1],s=e[t+2];i.push(n,r,r,s,s,n)}}else{const e=r.array;o=r.version;for(let t=0,n=e.length/3-1;t<n;t+=3){const e=t+0,n=t+1,r=t+2;i.push(e,n,n,r,r,e)}}const a=new($i(i)>65535?qr:Hr)(i,1);a.version=o;const l=s.get(e);l&&t.remove(l),s.set(e,a)}return{get:function(e,t){return!0===r[t.id]||(t.addEventListener("dispose",o),r[t.id]=!0,i.memory.geometries++),t},update:function(e){const i=e.attributes;for(const e in i)t.update(i[e],34962);const n=e.morphAttributes;for(const e in n){const i=n[e];for(let e=0,n=i.length;e<n;e++)t.update(i[e],34962)}},getWireframeAttribute:function(e){const t=s.get(e);if(t){const i=e.index;null!==i&&t.version<i.version&&a(e)}else a(e);return s.get(e)}}}function So(e,t,i,n){const r=n.isWebGL2;let s,o,a;this.setMode=function(e){s=e},this.setIndex=function(e){o=e.type,a=e.bytesPerElement},this.render=function(t,n){e.drawElements(s,n,o,t*a),i.update(n,s,1)},this.renderInstances=function(n,l,c){if(0===c)return;let h,u;if(r)h=e,u="drawElementsInstanced";else if(h=t.get("ANGLE_instanced_arrays"),u="drawElementsInstancedANGLE",null===h)return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");h[u](s,l,o,n*a,c),i.update(l,s,c)}}function Eo(e){const t={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:t,programs:null,autoReset:!0,reset:function(){t.frame++,t.calls=0,t.triangles=0,t.points=0,t.lines=0},update:function(e,i,n){switch(t.calls++,i){case 4:t.triangles+=n*(e/3);break;case 1:t.lines+=n*(e/2);break;case 3:t.lines+=n*(e-1);break;case 2:t.lines+=n*e;break;case 0:t.points+=n*e;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",i)}}}}class Ao extends on{constructor(e=null,t=1,i=1,n=1){super(null),this.image={data:e,width:t,height:i,depth:n},this.magFilter=pe,this.minFilter=pe,this.wrapR=de,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}function Co(e,t){return e[0]-t[0]}function Po(e,t){return Math.abs(t[1])-Math.abs(e[1])}function Lo(e,t){let i=1;const n=t.isInterleavedBufferAttribute?t.data.array:t.array;n instanceof Int8Array?i=127:n instanceof Int16Array?i=32767:n instanceof Int32Array?i=2147483647:console.error("THREE.WebGLMorphtargets: Unsupported morph attribute data type: ",n),e.divideScalar(i)}function Ro(e,t,i){const n={},r=new Float32Array(8),s=new WeakMap,o=new mn,a=[];for(let e=0;e<8;e++)a[e]=[e,0];return{update:function(l,c,h,u){const d=l.morphTargetInfluences;if(!0===t.isWebGL2){const n=c.morphAttributes.position.length;let r=s.get(c);if(void 0===r||r.count!==n){void 0!==r&&r.texture.dispose();const e=void 0!==c.morphAttributes.normal,i=c.morphAttributes.position,a=c.morphAttributes.normal||[],l=!0===e?2:1;let h=c.attributes.position.count*l,u=1;h>t.maxTextureSize&&(u=Math.ceil(h/t.maxTextureSize),h=t.maxTextureSize);const d=new Float32Array(h*u*4*n),m=new Ao(d,h,u,n);m.format=Be,m.type=Le;const p=4*l;for(let t=0;t<n;t++){const n=i[t],r=a[t],s=h*u*4*t;for(let t=0;t<n.count;t++){o.fromBufferAttribute(n,t),!0===n.normalized&&Lo(o,n);const i=t*p;d[s+i+0]=o.x,d[s+i+1]=o.y,d[s+i+2]=o.z,d[s+i+3]=0,!0===e&&(o.fromBufferAttribute(r,t),!0===r.normalized&&Lo(o,r),d[s+i+4]=o.x,d[s+i+5]=o.y,d[s+i+6]=o.z,d[s+i+7]=0)}}r={count:n,texture:m,size:new Yi(h,u)},s.set(c,r)}let a=0;for(let e=0;e<d.length;e++)a+=d[e];const l=c.morphTargetsRelative?1:1-a;u.getUniforms().setValue(e,"morphTargetBaseInfluence",l),u.getUniforms().setValue(e,"morphTargetInfluences",d),u.getUniforms().setValue(e,"morphTargetsTexture",r.texture,i),u.getUniforms().setValue(e,"morphTargetsTextureSize",r.size)}else{const t=void 0===d?0:d.length;let i=n[c.id];if(void 0===i||i.length!==t){i=[];for(let e=0;e<t;e++)i[e]=[e,0];n[c.id]=i}for(let e=0;e<t;e++){const t=i[e];t[0]=e,t[1]=d[e]}i.sort(Po);for(let e=0;e<8;e++)e<t&&i[e][1]?(a[e][0]=i[e][0],a[e][1]=i[e][1]):(a[e][0]=Number.MAX_SAFE_INTEGER,a[e][1]=0);a.sort(Co);const s=c.morphAttributes.position,o=c.morphAttributes.normal;let l=0;for(let e=0;e<8;e++){const t=a[e],i=t[0],n=t[1];i!==Number.MAX_SAFE_INTEGER&&n?(s&&c.getAttribute("morphTarget"+e)!==s[i]&&c.setAttribute("morphTarget"+e,s[i]),o&&c.getAttribute("morphNormal"+e)!==o[i]&&c.setAttribute("morphNormal"+e,o[i]),r[e]=n,l+=n):(s&&!0===c.hasAttribute("morphTarget"+e)&&c.deleteAttribute("morphTarget"+e),o&&!0===c.hasAttribute("morphNormal"+e)&&c.deleteAttribute("morphNormal"+e),r[e]=0)}const h=c.morphTargetsRelative?1:1-l;u.getUniforms().setValue(e,"morphTargetBaseInfluence",h),u.getUniforms().setValue(e,"morphTargetInfluences",r)}}}}function Do(e,t,i,n){let r=new WeakMap;function s(e){const t=e.target;t.removeEventListener("dispose",s),i.remove(t.instanceMatrix),null!==t.instanceColor&&i.remove(t.instanceColor)}return{update:function(e){const o=n.render.frame,a=e.geometry,l=t.get(e,a);return r.get(l)!==o&&(t.update(l),r.set(l,o)),e.isInstancedMesh&&(!1===e.hasEventListener("dispose",s)&&e.addEventListener("dispose",s),i.update(e.instanceMatrix,34962),null!==e.instanceColor&&i.update(e.instanceColor,34962)),l},dispose:function(){r=new WeakMap}}}Ao.prototype.isDataTexture2DArray=!0;class Oo extends on{constructor(e=null,t=1,i=1,n=1){super(null),this.image={data:e,width:t,height:i,depth:n},this.magFilter=pe,this.minFilter=pe,this.wrapR=de,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}Oo.prototype.isDataTexture3D=!0;const Io=new on,Fo=new Ao,Vo=new Oo,Uo=new Ds,Bo=[],No=[],zo=new Float32Array(16),ko=new Float32Array(9),Go=new Float32Array(4);function jo(e,t,i){const n=e[0];if(n<=0||n>0)return e;const r=t*i;let s=Bo[r];if(void 0===s&&(s=new Float32Array(r),Bo[r]=s),0!==t){n.toArray(s,0);for(let n=1,r=0;n!==t;++n)r+=i,e[n].toArray(s,r)}return s}function Ho(e,t){if(e.length!==t.length)return!1;for(let i=0,n=e.length;i<n;i++)if(e[i]!==t[i])return!1;return!0}function Wo(e,t){for(let i=0,n=t.length;i<n;i++)e[i]=t[i]}function qo(e,t){let i=No[t];void 0===i&&(i=new Int32Array(t),No[t]=i);for(let n=0;n!==t;++n)i[n]=e.allocateTextureUnit();return i}function Xo(e,t){const i=this.cache;i[0]!==t&&(e.uniform1f(this.addr,t),i[0]=t)}function Zo(e,t){const i=this.cache;if(void 0!==t.x)i[0]===t.x&&i[1]===t.y||(e.uniform2f(this.addr,t.x,t.y),i[0]=t.x,i[1]=t.y);else{if(Ho(i,t))return;e.uniform2fv(this.addr,t),Wo(i,t)}}function Yo(e,t){const i=this.cache;if(void 0!==t.x)i[0]===t.x&&i[1]===t.y&&i[2]===t.z||(e.uniform3f(this.addr,t.x,t.y,t.z),i[0]=t.x,i[1]=t.y,i[2]=t.z);else if(void 0!==t.r)i[0]===t.r&&i[1]===t.g&&i[2]===t.b||(e.uniform3f(this.addr,t.r,t.g,t.b),i[0]=t.r,i[1]=t.g,i[2]=t.b);else{if(Ho(i,t))return;e.uniform3fv(this.addr,t),Wo(i,t)}}function Ko(e,t){const i=this.cache;if(void 0!==t.x)i[0]===t.x&&i[1]===t.y&&i[2]===t.z&&i[3]===t.w||(e.uniform4f(this.addr,t.x,t.y,t.z,t.w),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=t.w);else{if(Ho(i,t))return;e.uniform4fv(this.addr,t),Wo(i,t)}}function $o(e,t){const i=this.cache,n=t.elements;if(void 0===n){if(Ho(i,t))return;e.uniformMatrix2fv(this.addr,!1,t),Wo(i,t)}else{if(Ho(i,n))return;Go.set(n),e.uniformMatrix2fv(this.addr,!1,Go),Wo(i,n)}}function Jo(e,t){const i=this.cache,n=t.elements;if(void 0===n){if(Ho(i,t))return;e.uniformMatrix3fv(this.addr,!1,t),Wo(i,t)}else{if(Ho(i,n))return;ko.set(n),e.uniformMatrix3fv(this.addr,!1,ko),Wo(i,n)}}function Qo(e,t){const i=this.cache,n=t.elements;if(void 0===n){if(Ho(i,t))return;e.uniformMatrix4fv(this.addr,!1,t),Wo(i,t)}else{if(Ho(i,n))return;zo.set(n),e.uniformMatrix4fv(this.addr,!1,zo),Wo(i,n)}}function ea(e,t){const i=this.cache;i[0]!==t&&(e.uniform1i(this.addr,t),i[0]=t)}function ta(e,t){const i=this.cache;Ho(i,t)||(e.uniform2iv(this.addr,t),Wo(i,t))}function ia(e,t){const i=this.cache;Ho(i,t)||(e.uniform3iv(this.addr,t),Wo(i,t))}function na(e,t){const i=this.cache;Ho(i,t)||(e.uniform4iv(this.addr,t),Wo(i,t))}function ra(e,t){const i=this.cache;i[0]!==t&&(e.uniform1ui(this.addr,t),i[0]=t)}function sa(e,t){const i=this.cache;Ho(i,t)||(e.uniform2uiv(this.addr,t),Wo(i,t))}function oa(e,t){const i=this.cache;Ho(i,t)||(e.uniform3uiv(this.addr,t),Wo(i,t))}function aa(e,t){const i=this.cache;Ho(i,t)||(e.uniform4uiv(this.addr,t),Wo(i,t))}function la(e,t,i){const n=this.cache,r=i.allocateTextureUnit();n[0]!==r&&(e.uniform1i(this.addr,r),n[0]=r),i.safeSetTexture2D(t||Io,r)}function ca(e,t,i){const n=this.cache,r=i.allocateTextureUnit();n[0]!==r&&(e.uniform1i(this.addr,r),n[0]=r),i.setTexture3D(t||Vo,r)}function ha(e,t,i){const n=this.cache,r=i.allocateTextureUnit();n[0]!==r&&(e.uniform1i(this.addr,r),n[0]=r),i.safeSetTextureCube(t||Uo,r)}function ua(e,t,i){const n=this.cache,r=i.allocateTextureUnit();n[0]!==r&&(e.uniform1i(this.addr,r),n[0]=r),i.setTexture2DArray(t||Fo,r)}function da(e,t){e.uniform1fv(this.addr,t)}function ma(e,t){const i=jo(t,this.size,2);e.uniform2fv(this.addr,i)}function pa(e,t){const i=jo(t,this.size,3);e.uniform3fv(this.addr,i)}function fa(e,t){const i=jo(t,this.size,4);e.uniform4fv(this.addr,i)}function ga(e,t){const i=jo(t,this.size,4);e.uniformMatrix2fv(this.addr,!1,i)}function va(e,t){const i=jo(t,this.size,9);e.uniformMatrix3fv(this.addr,!1,i)}function ya(e,t){const i=jo(t,this.size,16);e.uniformMatrix4fv(this.addr,!1,i)}function _a(e,t){e.uniform1iv(this.addr,t)}function xa(e,t){e.uniform2iv(this.addr,t)}function ba(e,t){e.uniform3iv(this.addr,t)}function wa(e,t){e.uniform4iv(this.addr,t)}function Ma(e,t){e.uniform1uiv(this.addr,t)}function Ta(e,t){e.uniform2uiv(this.addr,t)}function Sa(e,t){e.uniform3uiv(this.addr,t)}function Ea(e,t){e.uniform4uiv(this.addr,t)}function Aa(e,t,i){const n=t.length,r=qo(i,n);e.uniform1iv(this.addr,r);for(let e=0;e!==n;++e)i.safeSetTexture2D(t[e]||Io,r[e])}function Ca(e,t,i){const n=t.length,r=qo(i,n);e.uniform1iv(this.addr,r);for(let e=0;e!==n;++e)i.safeSetTextureCube(t[e]||Uo,r[e])}function Pa(e,t,i){this.id=e,this.addr=i,this.cache=[],this.setValue=function(e){switch(e){case 5126:return Xo;case 35664:return Zo;case 35665:return Yo;case 35666:return Ko;case 35674:return $o;case 35675:return Jo;case 35676:return Qo;case 5124:case 35670:return ea;case 35667:case 35671:return ta;case 35668:case 35672:return ia;case 35669:case 35673:return na;case 5125:return ra;case 36294:return sa;case 36295:return oa;case 36296:return aa;case 35678:case 36198:case 36298:case 36306:case 35682:return la;case 35679:case 36299:case 36307:return ca;case 35680:case 36300:case 36308:case 36293:return ha;case 36289:case 36303:case 36311:case 36292:return ua}}(t.type)}function La(e,t,i){this.id=e,this.addr=i,this.cache=[],this.size=t.size,this.setValue=function(e){switch(e){case 5126:return da;case 35664:return ma;case 35665:return pa;case 35666:return fa;case 35674:return ga;case 35675:return va;case 35676:return ya;case 5124:case 35670:return _a;case 35667:case 35671:return xa;case 35668:case 35672:return ba;case 35669:case 35673:return wa;case 5125:return Ma;case 36294:return Ta;case 36295:return Sa;case 36296:return Ea;case 35678:case 36198:case 36298:case 36306:case 35682:return Aa;case 35680:case 36300:case 36308:case 36293:return Ca}}(t.type)}function Ra(e){this.id=e,this.seq=[],this.map={}}La.prototype.updateCache=function(e){const t=this.cache;e instanceof Float32Array&&t.length!==e.length&&(this.cache=new Float32Array(e.length)),Wo(t,e)},Ra.prototype.setValue=function(e,t,i){const n=this.seq;for(let r=0,s=n.length;r!==s;++r){const s=n[r];s.setValue(e,t[s.id],i)}};const Da=/(\w+)(\])?(\[|\.)?/g;function Oa(e,t){e.seq.push(t),e.map[t.id]=t}function Ia(e,t,i){const n=e.name,r=n.length;for(Da.lastIndex=0;;){const s=Da.exec(n),o=Da.lastIndex;let a=s[1];const l="]"===s[2],c=s[3];if(l&&(a|=0),void 0===c||"["===c&&o+2===r){Oa(i,void 0===c?new Pa(a,e,t):new La(a,e,t));break}{let e=i.map[a];void 0===e&&(e=new Ra(a),Oa(i,e)),i=e}}}function Fa(e,t){this.seq=[],this.map={};const i=e.getProgramParameter(t,35718);for(let n=0;n<i;++n){const i=e.getActiveUniform(t,n);Ia(i,e.getUniformLocation(t,i.name),this)}}function Va(e,t,i){const n=e.createShader(t);return e.shaderSource(n,i),e.compileShader(n),n}Fa.prototype.setValue=function(e,t,i,n){const r=this.map[t];void 0!==r&&r.setValue(e,i,n)},Fa.prototype.setOptional=function(e,t,i){const n=t[i];void 0!==n&&this.setValue(e,i,n)},Fa.upload=function(e,t,i,n){for(let r=0,s=t.length;r!==s;++r){const s=t[r],o=i[s.id];!1!==o.needsUpdate&&s.setValue(e,o.value,n)}},Fa.seqWithValue=function(e,t){const i=[];for(let n=0,r=e.length;n!==r;++n){const r=e[n];r.id in t&&i.push(r)}return i};let Ua=0;function Ba(e){switch(e){case Kt:return["Linear","( value )"];case $t:return["sRGB","( value )"];case Qt:return["RGBE","( value )"];case ti:return["RGBM","( value, 7.0 )"];case ii:return["RGBM","( value, 16.0 )"];case ni:return["RGBD","( value, 256.0 )"];case Jt:return["Gamma","( value, float( GAMMA_FACTOR ) )"];case ei:return["LogLuv","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",e),["Linear","( value )"]}}function Na(e,t,i){const n=e.getShaderParameter(t,35713),r=e.getShaderInfoLog(t).trim();return n&&""===r?"":i.toUpperCase()+"\n\n"+r+"\n\n"+function(e){const t=e.split("\n");for(let e=0;e<t.length;e++)t[e]=e+1+": "+t[e];return t.join("\n")}(e.getShaderSource(t))}function za(e,t){const i=Ba(t);return"vec4 "+e+"( vec4 value ) { return "+i[0]+"ToLinear"+i[1]+"; }"}function ka(e,t){const i=Ba(t);return"vec4 "+e+"( vec4 value ) { return LinearTo"+i[0]+i[1]+"; }"}function Ga(e,t){let i;switch(t){case Q:i="Linear";break;case ee:i="Reinhard";break;case te:i="OptimizedCineon";break;case ie:i="ACESFilmic";break;case ne:i="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),i="Linear"}return"vec3 "+e+"( vec3 color ) { return "+i+"ToneMapping( color ); }"}function ja(e){return""!==e}function Ha(e,t){return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function Wa(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}const qa=/^[ \t]*#include +<([\w\d./]+)>/gm;function Xa(e){return e.replace(qa,Za)}function Za(e,t){const i=Hs[t];if(void 0===i)throw new Error("Can not resolve #include <"+t+">");return Xa(i)}const Ya=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,Ka=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function $a(e){return e.replace(Ka,Qa).replace(Ya,Ja)}function Ja(e,t,i,n){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),Qa(0,t,i,n)}function Qa(e,t,i,n){let r="";for(let e=parseInt(t);e<parseInt(i);e++)r+=n.replace(/\[\s*i\s*\]/g,"[ "+e+" ]").replace(/UNROLLED_LOOP_INDEX/g,e);return r}function el(e){let t="precision "+e.precision+" float;\nprecision "+e.precision+" int;";return"highp"===e.precision?t+="\n#define HIGH_PRECISION":"mediump"===e.precision?t+="\n#define MEDIUM_PRECISION":"lowp"===e.precision&&(t+="\n#define LOW_PRECISION"),t}function tl(e,t,i,n){const r=e.getContext(),s=i.defines;let o=i.vertexShader,a=i.fragmentShader;const l=function(e){let t="SHADOWMAP_TYPE_BASIC";return e.shadowMapType===u?t="SHADOWMAP_TYPE_PCF":e.shadowMapType===d?t="SHADOWMAP_TYPE_PCF_SOFT":e.shadowMapType===m&&(t="SHADOWMAP_TYPE_VSM"),t}(i),c=function(e){let t="ENVMAP_TYPE_CUBE";if(e.envMap)switch(e.envMapMode){case se:case oe:t="ENVMAP_TYPE_CUBE";break;case ce:case he:t="ENVMAP_TYPE_CUBE_UV"}return t}(i),h=function(e){let t="ENVMAP_MODE_REFLECTION";if(e.envMap)switch(e.envMapMode){case oe:case he:t="ENVMAP_MODE_REFRACTION"}return t}(i),p=function(e){let t="ENVMAP_BLENDING_NONE";if(e.envMap)switch(e.combine){case Y:t="ENVMAP_BLENDING_MULTIPLY";break;case K:t="ENVMAP_BLENDING_MIX";break;case $:t="ENVMAP_BLENDING_ADD"}return t}(i),f=e.gammaFactor>0?e.gammaFactor:1,g=i.isWebGL2?"":function(e){return[e.extensionDerivatives||e.envMapCubeUV||e.bumpMap||e.tangentSpaceNormalMap||e.clearcoatNormalMap||e.flatShading||"physical"===e.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(e.extensionFragDepth||e.logarithmicDepthBuffer)&&e.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",e.extensionDrawBuffers&&e.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(e.extensionShaderTextureLOD||e.envMap||e.transmission)&&e.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(ja).join("\n")}(i),v=function(e){const t=[];for(const i in e){const n=e[i];!1!==n&&t.push("#define "+i+" "+n)}return t.join("\n")}(s),y=r.createProgram();let _,x,b=i.glslVersion?"#version "+i.glslVersion+"\n":"";i.isRawShaderMaterial?(_=[v].filter(ja).join("\n"),_.length>0&&(_+="\n"),x=[g,v].filter(ja).join("\n"),x.length>0&&(x+="\n")):(_=[el(i),"#define SHADER_NAME "+i.shaderName,v,i.instancing?"#define USE_INSTANCING":"",i.instancingColor?"#define USE_INSTANCING_COLOR":"",i.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+f,"#define MAX_BONES "+i.maxBones,i.useFog&&i.fog?"#define USE_FOG":"",i.useFog&&i.fogExp2?"#define FOG_EXP2":"",i.map?"#define USE_MAP":"",i.envMap?"#define USE_ENVMAP":"",i.envMap?"#define "+h:"",i.lightMap?"#define USE_LIGHTMAP":"",i.aoMap?"#define USE_AOMAP":"",i.emissiveMap?"#define USE_EMISSIVEMAP":"",i.bumpMap?"#define USE_BUMPMAP":"",i.normalMap?"#define USE_NORMALMAP":"",i.normalMap&&i.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",i.normalMap&&i.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",i.clearcoatMap?"#define USE_CLEARCOATMAP":"",i.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",i.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",i.displacementMap&&i.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",i.specularColorMap?"#define USE_SPECULARCOLORMAP":"",i.roughnessMap?"#define USE_ROUGHNESSMAP":"",i.metalnessMap?"#define USE_METALNESSMAP":"",i.alphaMap?"#define USE_ALPHAMAP":"",i.transmission?"#define USE_TRANSMISSION":"",i.transmissionMap?"#define USE_TRANSMISSIONMAP":"",i.thicknessMap?"#define USE_THICKNESSMAP":"",i.sheenColorMap?"#define USE_SHEENCOLORMAP":"",i.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",i.vertexTangents?"#define USE_TANGENT":"",i.vertexColors?"#define USE_COLOR":"",i.vertexAlphas?"#define USE_COLOR_ALPHA":"",i.vertexUvs?"#define USE_UV":"",i.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",i.flatShading?"#define FLAT_SHADED":"",i.skinning?"#define USE_SKINNING":"",i.useVertexTexture?"#define BONE_TEXTURE":"",i.morphTargets?"#define USE_MORPHTARGETS":"",i.morphNormals&&!1===i.flatShading?"#define USE_MORPHNORMALS":"",i.morphTargets&&i.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",i.morphTargets&&i.isWebGL2?"#define MORPHTARGETS_COUNT "+i.morphTargetsCount:"",i.doubleSided?"#define DOUBLE_SIDED":"",i.flipSided?"#define FLIP_SIDED":"",i.shadowMapEnabled?"#define USE_SHADOWMAP":"",i.shadowMapEnabled?"#define "+l:"",i.sizeAttenuation?"#define USE_SIZEATTENUATION":"",i.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",i.logarithmicDepthBuffer&&i.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","\tattribute vec4 color;","#elif defined( USE_COLOR )","\tattribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(ja).join("\n"),x=[g,el(i),"#define SHADER_NAME "+i.shaderName,v,"#define GAMMA_FACTOR "+f,i.useFog&&i.fog?"#define USE_FOG":"",i.useFog&&i.fogExp2?"#define FOG_EXP2":"",i.map?"#define USE_MAP":"",i.matcap?"#define USE_MATCAP":"",i.envMap?"#define USE_ENVMAP":"",i.envMap?"#define "+c:"",i.envMap?"#define "+h:"",i.envMap?"#define "+p:"",i.lightMap?"#define USE_LIGHTMAP":"",i.aoMap?"#define USE_AOMAP":"",i.emissiveMap?"#define USE_EMISSIVEMAP":"",i.bumpMap?"#define USE_BUMPMAP":"",i.normalMap?"#define USE_NORMALMAP":"",i.normalMap&&i.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",i.normalMap&&i.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",i.clearcoat?"#define USE_CLEARCOAT":"",i.clearcoatMap?"#define USE_CLEARCOATMAP":"",i.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",i.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",i.specularColorMap?"#define USE_SPECULARCOLORMAP":"",i.roughnessMap?"#define USE_ROUGHNESSMAP":"",i.metalnessMap?"#define USE_METALNESSMAP":"",i.alphaMap?"#define USE_ALPHAMAP":"",i.alphaTest?"#define USE_ALPHATEST":"",i.sheen?"#define USE_SHEEN":"",i.sheenColorMap?"#define USE_SHEENCOLORMAP":"",i.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",i.transmission?"#define USE_TRANSMISSION":"",i.transmissionMap?"#define USE_TRANSMISSIONMAP":"",i.thicknessMap?"#define USE_THICKNESSMAP":"",i.vertexTangents?"#define USE_TANGENT":"",i.vertexColors||i.instancingColor?"#define USE_COLOR":"",i.vertexAlphas?"#define USE_COLOR_ALPHA":"",i.vertexUvs?"#define USE_UV":"",i.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",i.gradientMap?"#define USE_GRADIENTMAP":"",i.flatShading?"#define FLAT_SHADED":"",i.doubleSided?"#define DOUBLE_SIDED":"",i.flipSided?"#define FLIP_SIDED":"",i.shadowMapEnabled?"#define USE_SHADOWMAP":"",i.shadowMapEnabled?"#define "+l:"",i.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",i.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",i.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",i.logarithmicDepthBuffer&&i.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(i.extensionShaderTextureLOD||i.envMap)&&i.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",i.toneMapping!==J?"#define TONE_MAPPING":"",i.toneMapping!==J?Hs.tonemapping_pars_fragment:"",i.toneMapping!==J?Ga("toneMapping",i.toneMapping):"",i.dithering?"#define DITHERING":"",i.format===Ue?"#define OPAQUE":"",Hs.encodings_pars_fragment,i.map?za("mapTexelToLinear",i.mapEncoding):"",i.matcap?za("matcapTexelToLinear",i.matcapEncoding):"",i.envMap?za("envMapTexelToLinear",i.envMapEncoding):"",i.emissiveMap?za("emissiveMapTexelToLinear",i.emissiveMapEncoding):"",i.specularColorMap?za("specularColorMapTexelToLinear",i.specularColorMapEncoding):"",i.sheenColorMap?za("sheenColorMapTexelToLinear",i.sheenColorMapEncoding):"",i.lightMap?za("lightMapTexelToLinear",i.lightMapEncoding):"",ka("linearToOutputTexel",i.outputEncoding),i.depthPacking?"#define DEPTH_PACKING "+i.depthPacking:"","\n"].filter(ja).join("\n")),o=Xa(o),o=Ha(o,i),o=Wa(o,i),a=Xa(a),a=Ha(a,i),a=Wa(a,i),o=$a(o),a=$a(a),i.isWebGL2&&!0!==i.isRawShaderMaterial&&(b="#version 300 es\n",_=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+_,x=["#define varying in",i.glslVersion===Ii?"":"out highp vec4 pc_fragColor;",i.glslVersion===Ii?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+x);const w=b+x+a,M=Va(r,35633,b+_+o),T=Va(r,35632,w);if(r.attachShader(y,M),r.attachShader(y,T),void 0!==i.index0AttributeName?r.bindAttribLocation(y,0,i.index0AttributeName):!0===i.morphTargets&&r.bindAttribLocation(y,0,"position"),r.linkProgram(y),e.debug.checkShaderErrors){const e=r.getProgramInfoLog(y).trim(),t=r.getShaderInfoLog(M).trim(),i=r.getShaderInfoLog(T).trim();let n=!0,s=!0;if(!1===r.getProgramParameter(y,35714)){n=!1;const t=Na(r,M,"vertex"),i=Na(r,T,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(y,35715)+"\n\nProgram Info Log: "+e+"\n"+t+"\n"+i)}else""!==e?console.warn("THREE.WebGLProgram: Program Info Log:",e):""!==t&&""!==i||(s=!1);s&&(this.diagnostics={runnable:n,programLog:e,vertexShader:{log:t,prefix:_},fragmentShader:{log:i,prefix:x}})}let S,E;return r.deleteShader(M),r.deleteShader(T),this.getUniforms=function(){return void 0===S&&(S=new Fa(r,y)),S},this.getAttributes=function(){return void 0===E&&(E=function(e,t){const i={},n=e.getProgramParameter(t,35721);for(let r=0;r<n;r++){const n=e.getActiveAttrib(t,r),s=n.name;let o=1;35674===n.type&&(o=2),35675===n.type&&(o=3),35676===n.type&&(o=4),i[s]={type:n.type,location:e.getAttribLocation(t,s),locationSize:o}}return i}(r,y)),E},this.destroy=function(){n.releaseStatesOfProgram(this),r.deleteProgram(y),this.program=void 0},this.name=i.shaderName,this.id=Ua++,this.cacheKey=t,this.usedTimes=1,this.program=y,this.vertexShader=M,this.fragmentShader=T,this}function il(e,t,i,n,r,s,o){const a=[],l=r.isWebGL2,c=r.logarithmicDepthBuffer,h=r.floatVertexTextures,u=r.maxVertexUniforms,d=r.vertexTextures;let m=r.precision;const p={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"},v=["precision","isWebGL2","supportsVertexTextures","outputEncoding","instancing","instancingColor","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","envMapCubeUV","lightMap","lightMapEncoding","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","tangentSpaceNormalMap","clearcoat","clearcoatMap","clearcoatRoughnessMap","clearcoatNormalMap","displacementMap","specularMap",,"roughnessMap","metalnessMap","gradientMap","alphaMap","alphaTest","combine","vertexColors","vertexAlphas","vertexTangents","vertexUvs","uvsVertexOnly","fog","useFog","fogExp2","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","morphTargetsCount","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","numDirLightShadows","numPointLightShadows","numSpotLightShadows","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering","format","specularIntensityMap","specularColorMap","specularColorMapEncoding","transmission","transmissionMap","thicknessMap","sheen","sheenColorMap","sheenColorMapEncoding","sheenRoughnessMap"];function y(e){let t;return e&&e.isTexture?t=e.encoding:e&&e.isWebGLRenderTarget?(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),t=e.texture.encoding):t=Kt,l&&e&&e.isTexture&&e.format===Be&&e.type===Te&&e.encoding===$t&&(t=Kt),t}return{getParameters:function(s,a,v,_,x){const b=_.fog,w=s.isMeshStandardMaterial?_.environment:null,M=(s.isMeshStandardMaterial?i:t).get(s.envMap||w),T=p[s.type],S=x.isSkinnedMesh?function(e){const t=e.skeleton.bones;if(h)return 1024;{const e=u,i=Math.floor((e-20)/4),n=Math.min(i,t.length);return n<t.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+t.length+" bones. This GPU supports "+n+"."),0):n}}(x):0;let E,A;if(null!==s.precision&&(m=r.getMaxPrecision(s.precision),m!==s.precision&&console.warn("THREE.WebGLProgram.getParameters:",s.precision,"not supported, using",m,"instead.")),T){const e=qs[T];E=e.vertexShader,A=e.fragmentShader}else E=s.vertexShader,A=s.fragmentShader;const C=e.getRenderTarget(),P=s.alphaTest>0,L=s.clearcoat>0;return{isWebGL2:l,shaderID:T,shaderName:s.type,vertexShader:E,fragmentShader:A,defines:s.defines,isRawShaderMaterial:!0===s.isRawShaderMaterial,glslVersion:s.glslVersion,precision:m,instancing:!0===x.isInstancedMesh,instancingColor:!0===x.isInstancedMesh&&null!==x.instanceColor,supportsVertexTextures:d,outputEncoding:null!==C?y(C.texture):e.outputEncoding,map:!!s.map,mapEncoding:y(s.map),matcap:!!s.matcap,matcapEncoding:y(s.matcap),envMap:!!M,envMapMode:M&&M.mapping,envMapEncoding:y(M),envMapCubeUV:!!M&&(M.mapping===ce||M.mapping===he),lightMap:!!s.lightMap,lightMapEncoding:y(s.lightMap),aoMap:!!s.aoMap,emissiveMap:!!s.emissiveMap,emissiveMapEncoding:y(s.emissiveMap),bumpMap:!!s.bumpMap,normalMap:!!s.normalMap,objectSpaceNormalMap:s.normalMapType===ai,tangentSpaceNormalMap:s.normalMapType===oi,clearcoat:L,clearcoatMap:L&&!!s.clearcoatMap,clearcoatRoughnessMap:L&&!!s.clearcoatRoughnessMap,clearcoatNormalMap:L&&!!s.clearcoatNormalMap,displacementMap:!!s.displacementMap,roughnessMap:!!s.roughnessMap,metalnessMap:!!s.metalnessMap,specularMap:!!s.specularMap,specularIntensityMap:!!s.specularIntensityMap,specularColorMap:!!s.specularColorMap,specularColorMapEncoding:y(s.specularColorMap),alphaMap:!!s.alphaMap,alphaTest:P,gradientMap:!!s.gradientMap,sheen:s.sheen>0,sheenColorMap:!!s.sheenColorMap,sheenColorMapEncoding:y(s.sheenColorMap),sheenRoughnessMap:!!s.sheenRoughnessMap,transmission:s.transmission>0,transmissionMap:!!s.transmissionMap,thicknessMap:!!s.thicknessMap,combine:s.combine,vertexTangents:!!s.normalMap&&!!x.geometry&&!!x.geometry.attributes.tangent,vertexColors:s.vertexColors,vertexAlphas:!0===s.vertexColors&&!!x.geometry&&!!x.geometry.attributes.color&&4===x.geometry.attributes.color.itemSize,vertexUvs:!!s.map||!!s.bumpMap||!!s.normalMap||!!s.specularMap||!!s.alphaMap||!!s.emissiveMap||!!s.roughnessMap||!!s.metalnessMap||!!s.clearcoatMap||!!s.clearcoatRoughnessMap||!!s.clearcoatNormalMap||!!s.displacementMap||!!s.transmissionMap||!!s.thicknessMap||!!s.specularIntensityMap||!!s.specularColorMap||!!s.sheenColorMap||s.sheenRoughnessMap,uvsVertexOnly:!(s.map||s.bumpMap||s.normalMap||s.specularMap||s.alphaMap||s.emissiveMap||s.roughnessMap||s.metalnessMap||s.clearcoatNormalMap||s.transmission>0||s.transmissionMap||s.thicknessMap||s.specularIntensityMap||s.specularColorMap||!!s.sheen>0||s.sheenColorMap||s.sheenRoughnessMap||!s.displacementMap),fog:!!b,useFog:s.fog,fogExp2:b&&b.isFogExp2,flatShading:!!s.flatShading,sizeAttenuation:s.sizeAttenuation,logarithmicDepthBuffer:c,skinning:!0===x.isSkinnedMesh&&S>0,maxBones:S,useVertexTexture:h,morphTargets:!!x.geometry&&!!x.geometry.morphAttributes.position,morphNormals:!!x.geometry&&!!x.geometry.morphAttributes.normal,morphTargetsCount:x.geometry&&x.geometry.morphAttributes.position?x.geometry.morphAttributes.position.length:0,numDirLights:a.directional.length,numPointLights:a.point.length,numSpotLights:a.spot.length,numRectAreaLights:a.rectArea.length,numHemiLights:a.hemi.length,numDirLightShadows:a.directionalShadowMap.length,numPointLightShadows:a.pointShadowMap.length,numSpotLightShadows:a.spotShadowMap.length,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,format:s.format,dithering:s.dithering,shadowMapEnabled:e.shadowMap.enabled&&v.length>0,shadowMapType:e.shadowMap.type,toneMapping:s.toneMapped?e.toneMapping:J,physicallyCorrectLights:e.physicallyCorrectLights,premultipliedAlpha:s.premultipliedAlpha,doubleSided:s.side===g,flipSided:s.side===f,depthPacking:void 0!==s.depthPacking&&s.depthPacking,index0AttributeName:s.index0AttributeName,extensionDerivatives:s.extensions&&s.extensions.derivatives,extensionFragDepth:s.extensions&&s.extensions.fragDepth,extensionDrawBuffers:s.extensions&&s.extensions.drawBuffers,extensionShaderTextureLOD:s.extensions&&s.extensions.shaderTextureLOD,rendererExtensionFragDepth:l||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:l||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:l||n.has("EXT_shader_texture_lod"),customProgramCacheKey:s.customProgramCacheKey()}},getProgramCacheKey:function(t){const i=[];if(t.shaderID?i.push(t.shaderID):(i.push(tn(t.fragmentShader)),i.push(tn(t.vertexShader))),void 0!==t.defines)for(const e in t.defines)i.push(e),i.push(t.defines[e]);if(!1===t.isRawShaderMaterial){for(let e=0;e<v.length;e++)i.push(t[v[e]]);i.push(e.outputEncoding),i.push(e.gammaFactor)}return i.push(t.customProgramCacheKey),i.join()},getUniforms:function(e){const t=p[e.type];let i;if(t){const e=qs[t];i=Es.clone(e.uniforms)}else i=e.uniforms;return i},acquireProgram:function(t,i){let n;for(let e=0,t=a.length;e<t;e++){const t=a[e];if(t.cacheKey===i){n=t,++n.usedTimes;break}}return void 0===n&&(n=new tl(e,i,t,s),a.push(n)),n},releaseProgram:function(e){if(0==--e.usedTimes){const t=a.indexOf(e);a[t]=a[a.length-1],a.pop(),e.destroy()}},programs:a}}function nl(){let e=new WeakMap;return{get:function(t){let i=e.get(t);return void 0===i&&(i={},e.set(t,i)),i},remove:function(t){e.delete(t)},update:function(t,i,n){e.get(t)[i]=n},dispose:function(){e=new WeakMap}}}function rl(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.program!==t.program?e.program.id-t.program.id:e.material.id!==t.material.id?e.material.id-t.material.id:e.z!==t.z?e.z-t.z:e.id-t.id}function sl(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function ol(e){const t=[];let i=0;const n=[],r=[],s=[],o={id:-1};function a(n,r,s,a,l,c){let h=t[i];const u=e.get(s);return void 0===h?(h={id:n.id,object:n,geometry:r,material:s,program:u.program||o,groupOrder:a,renderOrder:n.renderOrder,z:l,group:c},t[i]=h):(h.id=n.id,h.object=n,h.geometry=r,h.material=s,h.program=u.program||o,h.groupOrder=a,h.renderOrder=n.renderOrder,h.z=l,h.group=c),i++,h}return{opaque:n,transmissive:r,transparent:s,init:function(){i=0,n.length=0,r.length=0,s.length=0},push:function(e,t,i,o,l,c){const h=a(e,t,i,o,l,c);i.transmission>0?r.push(h):!0===i.transparent?s.push(h):n.push(h)},unshift:function(e,t,i,o,l,c){const h=a(e,t,i,o,l,c);i.transmission>0?r.unshift(h):!0===i.transparent?s.unshift(h):n.unshift(h)},finish:function(){for(let e=i,n=t.length;e<n;e++){const i=t[e];if(null===i.id)break;i.id=null,i.object=null,i.geometry=null,i.material=null,i.program=null,i.group=null}},sort:function(e,t){n.length>1&&n.sort(e||rl),r.length>1&&r.sort(t||sl),s.length>1&&s.sort(t||sl)}}}function al(e){let t=new WeakMap;return{get:function(i,n){let r;return!1===t.has(i)?(r=new ol(e),t.set(i,[r])):n>=t.get(i).length?(r=new ol(e),t.get(i).push(r)):r=t.get(i)[n],r},dispose:function(){t=new WeakMap}}}function ll(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let i;switch(t.type){case"DirectionalLight":i={direction:new mn,color:new Fr};break;case"SpotLight":i={position:new mn,direction:new mn,color:new Fr,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":i={position:new mn,color:new Fr,distance:0,decay:0};break;case"HemisphereLight":i={direction:new mn,skyColor:new Fr,groundColor:new Fr};break;case"RectAreaLight":i={color:new Fr,position:new mn,halfWidth:new mn,halfHeight:new mn}}return e[t.id]=i,i}}}let cl=0;function hl(e,t){return(t.castShadow?1:0)-(e.castShadow?1:0)}function ul(e,t){const i=new ll,n=function(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let i;switch(t.type){case"DirectionalLight":case"SpotLight":i={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Yi};break;case"PointLight":i={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Yi,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=i,i}}}(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]};for(let e=0;e<9;e++)r.probe.push(new mn);const s=new mn,o=new Hn,a=new Hn;return{setup:function(s,o){let a=0,l=0,c=0;for(let e=0;e<9;e++)r.probe[e].set(0,0,0);let h=0,u=0,d=0,m=0,p=0,f=0,g=0,v=0;s.sort(hl);const y=!0!==o?Math.PI:1;for(let e=0,t=s.length;e<t;e++){const t=s[e],o=t.color,_=t.intensity,x=t.distance,b=t.shadow&&t.shadow.map?t.shadow.map.texture:null;if(t.isAmbientLight)a+=o.r*_*y,l+=o.g*_*y,c+=o.b*_*y;else if(t.isLightProbe)for(let e=0;e<9;e++)r.probe[e].addScaledVector(t.sh.coefficients[e],_);else if(t.isDirectionalLight){const e=i.get(t);if(e.color.copy(t.color).multiplyScalar(t.intensity*y),t.castShadow){const e=t.shadow,i=n.get(t);i.shadowBias=e.bias,i.shadowNormalBias=e.normalBias,i.shadowRadius=e.radius,i.shadowMapSize=e.mapSize,r.directionalShadow[h]=i,r.directionalShadowMap[h]=b,r.directionalShadowMatrix[h]=t.shadow.matrix,f++}r.directional[h]=e,h++}else if(t.isSpotLight){const e=i.get(t);if(e.position.setFromMatrixPosition(t.matrixWorld),e.color.copy(o).multiplyScalar(_*y),e.distance=x,e.coneCos=Math.cos(t.angle),e.penumbraCos=Math.cos(t.angle*(1-t.penumbra)),e.decay=t.decay,t.castShadow){const e=t.shadow,i=n.get(t);i.shadowBias=e.bias,i.shadowNormalBias=e.normalBias,i.shadowRadius=e.radius,i.shadowMapSize=e.mapSize,r.spotShadow[d]=i,r.spotShadowMap[d]=b,r.spotShadowMatrix[d]=t.shadow.matrix,v++}r.spot[d]=e,d++}else if(t.isRectAreaLight){const e=i.get(t);e.color.copy(o).multiplyScalar(_),e.halfWidth.set(.5*t.width,0,0),e.halfHeight.set(0,.5*t.height,0),r.rectArea[m]=e,m++}else if(t.isPointLight){const e=i.get(t);if(e.color.copy(t.color).multiplyScalar(t.intensity*y),e.distance=t.distance,e.decay=t.decay,t.castShadow){const e=t.shadow,i=n.get(t);i.shadowBias=e.bias,i.shadowNormalBias=e.normalBias,i.shadowRadius=e.radius,i.shadowMapSize=e.mapSize,i.shadowCameraNear=e.camera.near,i.shadowCameraFar=e.camera.far,r.pointShadow[u]=i,r.pointShadowMap[u]=b,r.pointShadowMatrix[u]=t.shadow.matrix,g++}r.point[u]=e,u++}else if(t.isHemisphereLight){const e=i.get(t);e.skyColor.copy(t.color).multiplyScalar(_*y),e.groundColor.copy(t.groundColor).multiplyScalar(_*y),r.hemi[p]=e,p++}}m>0&&(t.isWebGL2||!0===e.has("OES_texture_float_linear")?(r.rectAreaLTC1=Ws.LTC_FLOAT_1,r.rectAreaLTC2=Ws.LTC_FLOAT_2):!0===e.has("OES_texture_half_float_linear")?(r.rectAreaLTC1=Ws.LTC_HALF_1,r.rectAreaLTC2=Ws.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),r.ambient[0]=a,r.ambient[1]=l,r.ambient[2]=c;const _=r.hash;_.directionalLength===h&&_.pointLength===u&&_.spotLength===d&&_.rectAreaLength===m&&_.hemiLength===p&&_.numDirectionalShadows===f&&_.numPointShadows===g&&_.numSpotShadows===v||(r.directional.length=h,r.spot.length=d,r.rectArea.length=m,r.point.length=u,r.hemi.length=p,r.directionalShadow.length=f,r.directionalShadowMap.length=f,r.pointShadow.length=g,r.pointShadowMap.length=g,r.spotShadow.length=v,r.spotShadowMap.length=v,r.directionalShadowMatrix.length=f,r.pointShadowMatrix.length=g,r.spotShadowMatrix.length=v,_.directionalLength=h,_.pointLength=u,_.spotLength=d,_.rectAreaLength=m,_.hemiLength=p,_.numDirectionalShadows=f,_.numPointShadows=g,_.numSpotShadows=v,r.version=cl++)},setupView:function(e,t){let i=0,n=0,l=0,c=0,h=0;const u=t.matrixWorldInverse;for(let t=0,d=e.length;t<d;t++){const d=e[t];if(d.isDirectionalLight){const e=r.directional[i];e.direction.setFromMatrixPosition(d.matrixWorld),s.setFromMatrixPosition(d.target.matrixWorld),e.direction.sub(s),e.direction.transformDirection(u),i++}else if(d.isSpotLight){const e=r.spot[l];e.position.setFromMatrixPosition(d.matrixWorld),e.position.applyMatrix4(u),e.direction.setFromMatrixPosition(d.matrixWorld),s.setFromMatrixPosition(d.target.matrixWorld),e.direction.sub(s),e.direction.transformDirection(u),l++}else if(d.isRectAreaLight){const e=r.rectArea[c];e.position.setFromMatrixPosition(d.matrixWorld),e.position.applyMatrix4(u),a.identity(),o.copy(d.matrixWorld),o.premultiply(u),a.extractRotation(o),e.halfWidth.set(.5*d.width,0,0),e.halfHeight.set(0,.5*d.height,0),e.halfWidth.applyMatrix4(a),e.halfHeight.applyMatrix4(a),c++}else if(d.isPointLight){const e=r.point[n];e.position.setFromMatrixPosition(d.matrixWorld),e.position.applyMatrix4(u),n++}else if(d.isHemisphereLight){const e=r.hemi[h];e.direction.setFromMatrixPosition(d.matrixWorld),e.direction.transformDirection(u),e.direction.normalize(),h++}}},state:r}}function dl(e,t){const i=new ul(e,t),n=[],r=[];return{init:function(){n.length=0,r.length=0},state:{lightsArray:n,shadowsArray:r,lights:i},setupLights:function(e){i.setup(n,e)},setupLightsView:function(e){i.setupView(n,e)},pushLight:function(e){n.push(e)},pushShadow:function(e){r.push(e)}}}function ml(e,t){let i=new WeakMap;return{get:function(n,r=0){let s;return!1===i.has(n)?(s=new dl(e,t),i.set(n,[s])):r>=i.get(n).length?(s=new dl(e,t),i.get(n).push(s)):s=i.get(n)[r],s},dispose:function(){i=new WeakMap}}}class pl extends Cr{constructor(e){super(),this.type="MeshDepthMaterial",this.depthPacking=ri,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}pl.prototype.isMeshDepthMaterial=!0;class fl extends Cr{constructor(e){super(),this.type="MeshDistanceMaterial",this.referencePosition=new mn,this.nearDistance=1,this.farDistance=1e3,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}fl.prototype.isMeshDistanceMaterial=!0;const gl="void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",vl="uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>
949\nvoid main() {\n\tconst float samples = float( VSM_SAMPLES );\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n\tfor ( float i = 0.0; i < samples; i ++ ) {\n\t\tfloat uvOffset = uvStart + i * uvStride;\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean / samples;\n\tsquared_mean = squared_mean / samples;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}";function yl(e,t,i){let n=new zs;const r=new Yi,s=new Yi,o=new ln,a=new pl({depthPacking:si}),l=new fl,c={},h=i.maxTextureSize,d={0:f,1:p,2:g},v=new As({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Yi},radius:{value:4}},vertexShader:gl,fragmentShader:vl}),y=v.clone();y.defines.HORIZONTAL_PASS=1;const x=new ns;x.setAttribute("position",new Nr(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const b=new bs(x,v),w=this;function M(i,n){const r=t.update(b);v.defines.VSM_SAMPLES!==i.blurSamples&&(v.defines.VSM_SAMPLES=i.blurSamples,y.defines.VSM_SAMPLES=i.blurSamples,v.needsUpdate=!0,y.needsUpdate=!0),v.uniforms.shadow_pass.value=i.map.texture,v.uniforms.resolution.value=i.mapSize,v.uniforms.radius.value=i.radius,e.setRenderTarget(i.mapPass),e.clear(),e.renderBufferDirect(n,null,r,v,b,null),y.uniforms.shadow_pass.value=i.mapPass.texture,y.uniforms.resolution.value=i.mapSize,y.uniforms.radius.value=i.radius,e.setRenderTarget(i.map),e.clear(),e.renderBufferDirect(n,null,r,y,b,null)}function T(t,i,n,r,s,o,h){let u=null;const p=!0===r.isPointLight?t.customDistanceMaterial:t.customDepthMaterial;if(u=void 0!==p?p:!0===r.isPointLight?l:a,e.localClippingEnabled&&!0===n.clipShadows&&0!==n.clippingPlanes.length||n.displacementMap&&0!==n.displacementScale||n.alphaMap&&n.alphaTest>0){const e=u.uuid,t=n.uuid;let i=c[e];void 0===i&&(i={},c[e]=i);let r=i[t];void 0===r&&(r=u.clone(),i[t]=r),u=r}return u.visible=n.visible,u.wireframe=n.wireframe,u.side=h===m?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:d[n.side],u.alphaMap=n.alphaMap,u.alphaTest=n.alphaTest,u.clipShadows=n.clipShadows,u.clippingPlanes=n.clippingPlanes,u.clipIntersection=n.clipIntersection,u.displacementMap=n.displacementMap,u.displacementScale=n.displacementScale,u.displacementBias=n.displacementBias,u.wireframeLinewidth=n.wireframeLinewidth,u.linewidth=n.linewidth,!0===r.isPointLight&&!0===u.isMeshDistanceMaterial&&(u.referencePosition.setFromMatrixPosition(r.matrixWorld),u.nearDistance=s,u.farDistance=o),u}function S(i,r,s,o,a){if(!1===i.visible)return;if(i.layers.test(r.layers)&&(i.isMesh||i.isLine||i.isPoints)&&(i.castShadow||i.receiveShadow&&a===m)&&(!i.frustumCulled||n.intersectsObject(i))){i.modelViewMatrix.multiplyMatrices(s.matrixWorldInverse,i.matrixWorld);const n=t.update(i),r=i.material;if(Array.isArray(r)){const t=n.groups;for(let l=0,c=t.length;l<c;l++){const c=t[l],h=r[c.materialIndex];if(h&&h.visible){const t=T(i,0,h,o,s.near,s.far,a);e.renderBufferDirect(s,null,n,t,i,c)}}}else if(r.visible){const t=T(i,0,r,o,s.near,s.far,a);e.renderBufferDirect(s,null,n,t,i,null)}}const l=i.children;for(let e=0,t=l.length;e<t;e++)S(l[e],r,s,o,a)}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=u,this.render=function(t,i,a){if(!1===w.enabled)return;if(!1===w.autoUpdate&&!1===w.needsUpdate)return;if(0===t.length)return;const l=e.getRenderTarget(),c=e.getActiveCubeFace(),u=e.getActiveMipmapLevel(),d=e.state;d.setBlending(_),d.buffers.color.setClear(1,1,1,1),d.buffers.depth.setTest(!0),d.setScissorTest(!1);for(let l=0,c=t.length;l<c;l++){const c=t[l],u=c.shadow;if(void 0===u){console.warn("THREE.WebGLShadowMap:",c,"has no shadow.");continue}if(!1===u.autoUpdate&&!1===u.needsUpdate)continue;r.copy(u.mapSize);const p=u.getFrameExtents();
vendor: 8,438 bytes, line 949
949if(r.multiply(p),s.copy(u.mapSize),(r.x>h||r.y>h)&&(r.x>h&&(s.x=Math.floor(h/p.x),r.x=s.x*p.x,u.mapSize.x=s.x),r.y>h&&(s.y=Math.floor(h/p.y),r.y=s.y*p.y,u.mapSize.y=s.y)),null===u.map&&!u.isPointLightShadow&&this.type===m){const e={minFilter:_e,magFilter:_e,format:Be};u.map=new cn(r.x,r.y,e),u.map.texture.name=c.name+".shadowMap",u.mapPass=new cn(r.x,r.y,e),u.camera.updateProjectionMatrix()}if(null===u.map){const e={minFilter:pe,magFilter:pe,format:Be};u.map=new cn(r.x,r.y,e),u.map.texture.name=c.name+".shadowMap",u.camera.updateProjectionMatrix()}e.setRenderTarget(u.map),e.clear();const f=u.getViewportCount();for(let e=0;e<f;e++){const t=u.getViewport(e);o.set(s.x*t.x,s.y*t.y,s.x*t.z,s.y*t.w),d.viewport(o),u.updateMatrices(c,e),n=u.getFrustum(),S(i,a,u.camera,c,this.type)}u.isPointLightShadow||this.type!==m||M(u,a),u.needsUpdate=!1}w.needsUpdate=!1,e.setRenderTarget(l,c,u)}}function _l(e,t,i){const n=i.isWebGL2,r=new function(){let t=!1;const i=new ln;let n=null;const r=new ln(0,0,0,0);return{setMask:function(i){n===i||t||(e.colorMask(i,i,i,i),n=i)},setLocked:function(e){t=e},setClear:function(t,n,s,o,a){!0===a&&(t*=o,n*=o,s*=o),i.set(t,n,s,o),!1===r.equals(i)&&(e.clearColor(t,n,s,o),r.copy(i))},reset:function(){t=!1,n=null,r.set(-1,0,0,0)}}},s=new function(){let t=!1,i=null,n=null,r=null;return{setTest:function(e){e?ye(2929):_e(2929)},setMask:function(n){i===n||t||(e.depthMask(n),i=n)},setFunc:function(t){if(n!==t){if(t)switch(t){case k:e.depthFunc(512);break;case G:e.depthFunc(519);break;case j:e.depthFunc(513);break;case H:e.depthFunc(515);break;case W:e.depthFunc(514);break;case q:e.depthFunc(518);break;case X:e.depthFunc(516);break;case Z:e.depthFunc(517);break;default:e.depthFunc(515)}else e.depthFunc(515);n=t}},setLocked:function(e){t=e},setClear:function(t){r!==t&&(e.clearDepth(t),r=t)},reset:function(){t=!1,i=null,n=null,r=null}}},c=new function(){let t=!1,i=null,n=null,r=null,s=null,o=null,a=null,l=null,c=null;return{setTest:function(e){t||(e?ye(2960):_e(2960))},setMask:function(n){i===n||t||(e.stencilMask(n),i=n)},setFunc:function(t,i,o){n===t&&r===i&&s===o||(e.stencilFunc(t,i,o),n=t,r=i,s=o)},setOp:function(t,i,n){o===t&&a===i&&l===n||(e.stencilOp(t,i,n),o=t,a=i,l=n)},setLocked:function(e){t=e},setClear:function(t){c!==t&&(e.clearStencil(t),c=t)},reset:function(){t=!1,i=null,n=null,r=null,s=null,o=null,a=null,l=null,c=null}}};let h={},u=null,d={},m=null,p=!1,v=null,y=null,Y=null,K=null,$=null,J=null,Q=null,ee=!1,te=null,ie=null,ne=null,re=null,se=null;const oe=e.getParameter(35661);let ae=!1,le=0;const ce=e.getParameter(7938);-1!==ce.indexOf("WebGL")?(le=parseFloat(/^WebGL (\d)/.exec(ce)[1]),ae=le>=1):-1!==ce.indexOf("OpenGL ES")&&(le=parseFloat(/^OpenGL ES (\d)/.exec(ce)[1]),ae=le>=2);let he=null,ue={};const de=e.getParameter(3088),me=e.getParameter(2978),pe=(new ln).fromArray(de),fe=(new ln).fromArray(me);function ge(t,i,n){const r=new Uint8Array(4),s=e.createTexture();e.bindTexture(t,s),e.texParameteri(t,10241,9728),e.texParameteri(t,10240,9728);for(let t=0;t<n;t++)e.texImage2D(i+t,0,6408,1,1,0,6408,5121,r);return s}const ve={};function ye(t){!0!==h[t]&&(e.enable(t),h[t]=!0)}function _e(t){!1!==h[t]&&(e.disable(t),h[t]=!1)}ve[3553]=ge(3553,3553,1),ve[34067]=ge(34067,34069,6),r.setClear(0,0,0,1),s.setClear(1),c.setClear(0),ye(2929),s.setFunc(H),Me(!1),Te(a),ye(2884),we(_);const xe={[S]:32774,[E]:32778,[A]:32779};if(n)xe[C]=32775,xe[P]=32776;else{const e=t.get("EXT_blend_minmax");null!==e&&(xe[C]=e.MIN_EXT,xe[P]=e.MAX_EXT)}const be={[L]:0,[R]:1,[D]:768,[I]:770,[z]:776,[B]:774,[V]:772,[O]:769,[F]:771,[N]:775,[U]:773};function we(t,i,n,r,s,o,a,l){if(t!==_){if(!1===p&&(ye(3042),p=!0),t===T)s=s||i,o=o||n,a=a||r,i===y&&s===$||(e.blendEquationSeparate(xe[i],xe[s]),y=i,$=s),n===Y&&r===K&&o===J&&a===Q||(e.blendFuncSeparate(be[n],be[r],be[o],be[a]),Y=n,K=r,J=o,Q=a),v=t,ee=null;else if(t!==v||l!==ee){if(y===S&&$===S||(e.blendEquation(32774),y=S,$=S),l)switch(t){case x:e.blendFuncSeparate(1,771,1,771);break;case b:e.blendFunc(1,1);break;case w:e.blendFuncSeparate(0,0,769,771);break;case M:e.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}else switch(t){case x:e.blendFuncSeparate(770,771,1,771);break;case b:e.blendFunc(770,1);break;case w:e.blendFunc(0,769);break;case M:e.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}Y=null,K=null,J=null,Q=null,v=t,ee=l}}else!0===p&&(_e(3042),p=!1)}function Me(t){te!==t&&(t?e.frontFace(2304):e.frontFace(2305),te=t)}function Te(t){t!==o?(ye(2884),t!==ie&&(t===a?e.cullFace(1029):t===l?e.cullFace(1028):e.cullFace(1032))):_e(2884),ie=t}function Se(t,i,n){t?(ye(32823),re===i&&se===n||(e.polygonOffset(i,n),re=i,se=n)):_e(32823)}function Ee(t){void 0===t&&(t=33984+oe-1),he!==t&&(e.activeTexture(t),he=t)}return{buffers:{color:r,depth:s,stencil:c},enable:ye,disable:_e,bindFramebuffer:function(t,i){return null===i&&null!==u&&(i=u),d[t]!==i&&(e.bindFramebuffer(t,i),d[t]=i,n&&(36009===t&&(d[36160]=i),36160===t&&(d[36009]=i)),!0)},bindXRFramebuffer:function(t){t!==u&&(e.bindFramebuffer(36160,t),u=t)},useProgram:function(t){return m!==t&&(e.useProgram(t),m=t,!0)},setBlending:we,setMaterial:function(e,t){e.side===g?_e(2884):ye(2884);let i=e.side===f;t&&(i=!i),Me(i),e.blending===x&&!1===e.transparent?we(_):we(e.blending,e.blendEquation,e.blendSrc,e.blendDst,e.blendEquationAlpha,e.blendSrcAlpha,e.blendDstAlpha,e.premultipliedAlpha),s.setFunc(e.depthFunc),s.setTest(e.depthTest),s.setMask(e.depthWrite),r.setMask(e.colorWrite);const n=e.stencilWrite;c.setTest(n),n&&(c.setMask(e.stencilWriteMask),c.setFunc(e.stencilFunc,e.stencilRef,e.stencilFuncMask),c.setOp(e.stencilFail,e.stencilZFail,e.stencilZPass)),Se(e.polygonOffset,e.polygonOffsetFactor,e.polygonOffsetUnits),!0===e.alphaToCoverage?ye(32926):_e(32926)},setFlipSided:Me,setCullFace:Te,setLineWidth:function(t){t!==ne&&(ae&&e.lineWidth(t),ne=t)},setPolygonOffset:Se,setScissorTest:function(e){e?ye(3089):_e(3089)},activeTexture:Ee,bindTexture:function(t,i){null===he&&Ee();let n=ue[he];void 0===n&&(n={type:void 0,texture:void 0},ue[he]=n),n.type===t&&n.texture===i||(e.bindTexture(t,i||ve[t]),n.type=t,n.texture=i)},unbindTexture:function(){const t=ue[he];void 0!==t&&void 0!==t.type&&(e.bindTexture(t.type,null),t.type=void 0,t.texture=void 0)},compressedTexImage2D:function(){try{e.compressedTexImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texImage2D:function(){try{e.texImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texImage3D:function(){try{e.texImage3D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},scissor:function(t){!1===pe.equals(t)&&(e.scissor(t.x,t.y,t.z,t.w),pe.copy(t))},viewport:function(t){!1===fe.equals(t)&&(e.viewport(t.x,t.y,t.z,t.w),fe.copy(t))},reset:function(){e.disable(3042),e.disable(2884),e.disable(2929),e.disable(32823),e.disable(3089),e.disable(2960),e.disable(32926),e.blendEquation(32774),e.blendFunc(1,0),e.blendFuncSeparate(1,0,1,0),e.colorMask(!0,!0,!0,!0),e.clearColor(0,0,0,0),e.depthMask(!0),e.depthFunc(513),e.clearDepth(1),e.stencilMask(4294967295),e.stencilFunc(519,0,4294967295),e.stencilOp(7680,7680,7680),e.clearStencil(0),e.cullFace(1029),e.frontFace(2305),e.polygonOffset(0,0),e.activeTexture(33984),e.bindFramebuffer(36160,null),!0===n&&(e.bindFramebuffer(36009,null),e.bindFramebuffer(36008,null)),e.useProgram(null),e.lineWidth(1),e.scissor(0,0,e.canvas.width,e.canvas.height),e.viewport(0,0,e.canvas.width,e.canvas.height),h={},he=null,ue={},u=null,d={},m=null,p=!1,v=null,y=null,Y=null,K=null,$=null,J=null,Q=null,ee=!1,te=null,ie=null,ne=null,re=null,se=null,pe.set(0,0,e.canvas.width,e.canvas.height),fe.set(0,0,e.canvas.width,e.canvas.height),r.reset(),s.reset(),c.reset()}}}function xl(e,t,i,n,r,s,o){const a=r.isWebGL2,l=r.maxTextures,c=r.maxCubemapSize,h=r.maxTextureSize,u=r.maxSamples,d=new WeakMap;let m,p=!1;try{p="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(e){}function f(e,t){return p?new OffscreenCanvas(e,t):en("canvas")}function g(e,t,i,n){let r=1;if((e.width>n||e.height>n)&&(r=n/Math.max(e.width,e.height)),r<1||!0===t){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){const n=t?Xi:Math.floor,s=n(r*e.width),o=n(r*e.he
vendor: 27,498 bytes, line 949
949ight);void 0===m&&(m=f(s,o));const a=i?f(s,o):m;return a.width=s,a.height=o,a.getContext("2d").drawImage(e,0,0,s,o),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+e.width+"x"+e.height+") to ("+s+"x"+o+")."),a}return"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+e.width+"x"+e.height+")."),e}return e}function v(e){return Wi(e.width)&&Wi(e.height)}function y(e,t){return e.generateMipmaps&&t&&e.minFilter!==pe&&e.minFilter!==_e}function _(t,i,r,s,o=1){e.generateMipmap(t),n.get(i).__maxMipLevel=Math.log2(Math.max(r,s,o))}function x(i,n,r,s){if(!1===a)return n;if(null!==i){if(void 0!==e[i])return e[i];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+i+"'")}let o=n;return 6403===n&&(5126===r&&(o=33326),5131===r&&(o=33325),5121===r&&(o=33321)),6407===n&&(5126===r&&(o=34837),5131===r&&(o=34843),5121===r&&(o=32849)),6408===n&&(5126===r&&(o=34836),5131===r&&(o=34842),5121===r&&(o=s===$t?35907:32856)),33325!==o&&33326!==o&&34842!==o&&34836!==o||t.get("EXT_color_buffer_float"),o}function b(e){return e===pe||e===fe||e===ve?9728:9729}function w(t){const i=t.target;i.removeEventListener("dispose",w),function(t){const i=n.get(t);void 0!==i.__webglInit&&(e.deleteTexture(i.__webglTexture),n.remove(t))}(i),i.isVideoTexture&&d.delete(i),o.memory.textures--}function M(t){const i=t.target;i.removeEventListener("dispose",M),function(t){const i=t.texture,r=n.get(t),s=n.get(i);if(t){if(void 0!==s.__webglTexture&&(e.deleteTexture(s.__webglTexture),o.memory.textures--),t.depthTexture&&t.depthTexture.dispose(),t.isWebGLCubeRenderTarget)for(let t=0;t<6;t++)e.deleteFramebuffer(r.__webglFramebuffer[t]),r.__webglDepthbuffer&&e.deleteRenderbuffer(r.__webglDepthbuffer[t]);else e.deleteFramebuffer(r.__webglFramebuffer),r.__webglDepthbuffer&&e.deleteRenderbuffer(r.__webglDepthbuffer),r.__webglMultisampledFramebuffer&&e.deleteFramebuffer(r.__webglMultisampledFramebuffer),r.__webglColorRenderbuffer&&e.deleteRenderbuffer(r.__webglColorRenderbuffer),r.__webglDepthRenderbuffer&&e.deleteRenderbuffer(r.__webglDepthRenderbuffer);if(t.isWebGLMultipleRenderTargets)for(let t=0,r=i.length;t<r;t++){const r=n.get(i[t]);r.__webglTexture&&(e.deleteTexture(r.__webglTexture),o.memory.textures--),n.remove(i[t])}n.remove(i),n.remove(t)}}(i)}let T=0;function S(e,t){const r=n.get(e);if(e.isVideoTexture&&function(e){const t=o.render.frame;d.get(e)!==t&&(d.set(e,t),e.update())}(e),e.version>0&&r.__version!==e.version){const i=e.image;if(void 0===i)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==i.complete)return void R(r,e,t);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}i.activeTexture(33984+t),i.bindTexture(3553,r.__webglTexture)}function E(t,r){const o=n.get(t);t.version>0&&o.__version!==t.version?function(t,n,r){if(6!==n.image.length)return;L(t,n),i.activeTexture(33984+r),i.bindTexture(34067,t.__webglTexture),e.pixelStorei(37440,n.flipY),e.pixelStorei(37441,n.premultiplyAlpha),e.pixelStorei(3317,n.unpackAlignment),e.pixelStorei(37443,0);const o=n&&(n.isCompressedTexture||n.image[0].isCompressedTexture),l=n.image[0]&&n.image[0].isDataTexture,h=[];for(let e=0;e<6;e++)h[e]=o||l?l?n.image[e].image:n.image[e]:g(n.image[e],!1,!0,c);const u=h[0],d=v(u)||a,m=s.convert(n.format),p=s.convert(n.type),f=x(n.internalFormat,m,p,n.encoding);let b;if(P(34067,n,d),o){for(let e=0;e<6;e++){b=h[e].mipmaps;for(let t=0;t<b.length;t++){const r=b[t];n.format!==Be&&n.format!==Ue?null!==m?i.compressedTexImage2D(34069+e,t,f,r.width,r.height,0,r.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):i.texImage2D(34069+e,t,f,r.width,r.height,0,m,p,r.data)}}t.__maxMipLevel=b.length-1}else{b=n.mipmaps;for(let e=0;e<6;e++)if(l){i.texImage2D(34069+e,0,f,h[e].width,h[e].height,0,m,p,h[e].data);for(let t=0;t<b.length;t++){const n=b[t].image[e].image;i.texImage2D(34069+e,t+1,f,n.width,n.height,0,m,p,n.data)}}else{i.texImage2D(34069+e,0,f,m,p,h[e]);for(let t=0;t<b.length;t++){const n=b[t];i.texImage2D(34069+e,t+1,f,m,p,n.image[e])}}t.__maxMipLevel=b.length}y(n,d)&&_(34067,n,u.width,u.height),t.__version=n.version,n.onUpdate&&n.onUpdate(n)}(o,t,r):(i.activeTexture(33984+r),i.bindTexture(34067,o.__webglTexture))}const A={[ue]:10497,[de]:33071,[me]:33648},C={[pe]:9728,[fe]:9984,[ve]:9986,[_e]:9729,[xe]:9985,[we]:9987};function P(i,s,o){if(o?(e.texParameteri(i,10242,A[s.wrapS]),e.texParameteri(i,10243,A[s.wrapT]),32879!==i&&35866!==i||e.texParameteri(i,32882,A[s.wrapR]),e.texParameteri(i,10240,C[s.magFilter]),e.texParameteri(i,10241,C[s.minFilter])):(e.texParameteri(i,10242,33071),e.texParameteri(i,10243,33071),32879!==i&&35866!==i||e.texParameteri(i,32882,33071),s.wrapS===de&&s.wrapT===de||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),e.texParameteri(i,10240,b(s.magFilter)),e.texParameteri(i,10241,b(s.minFilter)),s.minFilter!==pe&&s.minFilter!==_e&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),!0===t.has("EXT_texture_filter_anisotropic")){const o=t.get("EXT_texture_filter_anisotropic");if(s.type===Le&&!1===t.has("OES_texture_float_linear"))return;if(!1===a&&s.type===Re&&!1===t.has("OES_texture_half_float_linear"))return;(s.anisotropy>1||n.get(s).__currentAnisotropy)&&(e.texParameterf(i,o.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(s.anisotropy,r.getMaxAnisotropy())),n.get(s).__currentAnisotropy=s.anisotropy)}}function L(t,i){void 0===t.__webglInit&&(t.__webglInit=!0,i.addEventListener("dispose",w),t.__webglTexture=e.createTexture(),o.memory.textures++)}function R(t,n,r){let o=3553;n.isDataTexture2DArray&&(o=35866),n.isDataTexture3D&&(o=32879),L(t,n),i.activeTexture(33984+r),i.bindTexture(o,t.__webglTexture),e.pixelStorei(37440,n.flipY),e.pixelStorei(37441,n.premultiplyAlpha),e.pixelStorei(3317,n.unpackAlignment),e.pixelStorei(37443,0);const l=function(e){return!a&&(e.wrapS!==de||e.wrapT!==de||e.minFilter!==pe&&e.minFilter!==_e)}(n)&&!1===v(n.image),c=g(n.image,l,!1,h),u=v(c)||a,d=s.convert(n.format);let m,p=s.convert(n.type),f=x(n.internalFormat,d,p,n.encoding);P(o,n,u);const b=n.mipmaps;if(n.isDepthTexture)f=6402,a?f=n.type===Le?36012:n.type===Pe?33190:n.type===Fe?35056:33189:n.type===Le&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),n.format===Ge&&6402===f&&n.type!==Ae&&n.type!==Pe&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),n.type=Ae,p=s.convert(n.type)),n.format===je&&6402===f&&(f=34041,n.type!==Fe&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),n.type=Fe,p=s.convert(n.type))),i.texImage2D(3553,0,f,c.width,c.height,0,d,p,null);else if(n.isDataTexture)if(b.length>0&&u){for(let e=0,t=b.length;e<t;e++)m=b[e],i.texImage2D(3553,e,f,m.width,m.height,0,d,p,m.data);n.generateMipmaps=!1,t.__maxMipLevel=b.length-1}else i.texImage2D(3553,0,f,c.width,c.height,0,d,p,c.data),t.__maxMipLevel=0;else if(n.isCompressedTexture){for(let e=0,t=b.length;e<t;e++)m=b[e],n.format!==Be&&n.format!==Ue?null!==d?i.compressedTexImage2D(3553,e,f,m.width,m.height,0,m.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):i.texImage2D(3553,e,f,m.width,m.height,0,d,p,m.data);t.__maxMipLevel=b.length-1}else if(n.isDataTexture2DArray)i.texImage3D(35866,0,f,c.width,c.height,c.depth,0,d,p,c.data),t.__maxMipLevel=0;else if(n.isDataTexture3D)i.texImage3D(32879,0,f,c.width,c.height,c.depth,0,d,p,c.data),t.__maxMipLevel=0;else if(b.length>0&&u){for(let e=0,t=b.length;e<t;e++)m=b[e],i.texImage2D(3553,e,f,d,p,m);n.generateMipmaps=!1,t.__maxMipLevel=b.length-1}else i.texImage2D(3553,0,f,d,p,c),t.__maxMipLevel=0;y(n,u)&&_(o,n,c.width,c.height),t.__version=n.version,n.onUpdate&&n.onUpdate(n)}function D(t,r,o,a,l){const c=s.convert(o.format),h=s.convert(o.type),u=x(o.internalFormat,c,h,o.encoding);32879===l||35866===l?i.texImage3D(l,0,u,r.width,r.height,r.depth,0,c,h,null):i.texImage2D(l,0,u,r.width,r.height,0,c,h,null),i.bindFramebuffer(36160,t),e.framebufferTexture2D(36160,a,l,n.get(o).__webglTexture,0),i.bindFramebuffer(36160,null)}function O(t,i,n){if(e.bindRenderbuffer(36161,t),i.depthBuffer&&!i.stencilBuffer){let r=33189;if(n){const t=i.depthTexture;t&&t.isDepthTexture&&(t.type===Le?r=36012:t.type===Pe&&(r=33190));const n=I(i);e.renderbufferStorageMultisample(36161,n,r,i.width,i.height)}else e.renderbufferStorage(36161,r,i.width,i.height);e.framebufferRenderbuffer(36160,36096,36161,t)}else if(i.depthBuffer&&i.stencilBuffer){if(n){const t=I(i);e.renderbufferStorageMultisample(36161,t,35056,i.width,i.height)}else e.renderbufferStorage(36161,34041,i.width,i.height);e.framebufferRenderbuffer(36160,33306,36161,t)}else{const t=!0===i.isWebGLMultipleRenderTargets?i.texture[0]:i.texture,r=s.convert(t.format),o=s.convert(t.type),a=x(t.internalFormat,r,o,t.encoding);if(n){const t=I(i);e.renderbufferStorageMultisample(36161,t,a,i.width,i.height)}else e.renderbufferStorage(36161,a,i.width,i.height)}e.bindRenderbuffer(36161,null)}function I(e){return a&&e.isWebGLMultisampleRenderTarget?Math.min(u,e.samples):0}let F=!1,V=!1;this.allocateTextureUnit=function(){const e=T;return e>=l&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+l),T+=1,e},this.resetTextureUnits=function(){T=0},this.setTexture2D=S,this.setTexture2DArray=function(e,t){const r=n.get(e);e.version>0&&r.__version!==e.version?R(r,e,t):(i.activeTexture(33984+t),i.bindTexture(35866,r.__webglTexture))},this.setTexture3D=function(e,t){const r=n.get(e);e.version>0&&r.__version!==e.version?R(r,e,t):(i.activeTexture(33984+t),i.bindTexture(32879,r.__webglTexture))},this.setTextureCube=E,this.setupRenderTarget=function(t){const l=t.texture,c=n.get(t),h=n.get(l);t.addEventListener("dispose",M),!0!==t.isWebGLMultipleRenderTargets&&(h.__webglTexture=e.createTexture(),h.__version=l.version,o.memory.textures++);const u=!0===t.isWebGLCubeRenderTarget,d=!0===t.isWebGLMultipleRenderTargets,m=!0===t.isWebGLMultisampleRenderTarget,p=l.isDataTexture3D||l.isDataTexture2DArray,f=v(t)||a;if(!a||l.format!==Ue||l.type!==Le&&l.type!==Re||(l.format=Be,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),u){c.__webglFramebuffer=[];for(let t=0;t<6;t++)c.__webglFramebuffer[t]=e.createFramebuffer()}else if(c.__webglFramebuffer=e.createFramebuffer(),d)if(r.drawBuffers){const i=t.texture;for(let t=0,r=i.length;t<r;t++){const r=n.get(i[t]);void 0===r.__webglTexture&&(r.__webglTexture=e.createTexture(),o.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");else if(m)if(a){c.__webglMultisampledFramebuffer=e.createFramebuffer(),c.__webglColorRenderbuffer=e.createRenderbuffer(),e.bindRenderbuffer(36161,c.__webglColorRenderbuffer);const n=s.convert(l.format),r=s.convert(l.type),o=x(l.internalFormat,n,r,l.encoding),a=I(t);e.renderbufferStorageMultisample(36161,a,o,t.width,t.height),i.bindFramebuffer(36160,c.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(36160,36064,36161,c.__webglColorRenderbuffer),e.bindRenderbuffer(36161,null),t.depthBuffer&&(c.__webglDepthRenderbuffer=e.createRenderbuffer(),O(c.__webglDepthRenderbuffer,t,!0)),i.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(u){i.bindTexture(34067,h.__webglTexture),P(34067,l,f);for(let e=0;e<6;e++)D(c.__webglFramebuffer[e],t,l,36064,34069+e);y(l,f)&&_(34067,l,t.width,t.height),i.unbindTexture()}else if(d){const e=t.texture;for(let r=0,s=e.length;r<s;r++){const s=e[r],o=n.get(s);i.bindTexture(3553,o.__webglTexture),P(3553,s,f),D(c.__webglFramebuffer,t,s,36064+r,3553),y(s,f)&&_(3553,s,t.width,t.height)}i.unbindTexture()}else{let e=3553;p&&(a?e=l.isDataTexture3D?32879:35866:console.warn("THREE.DataTexture3D and THREE.DataTexture2DArray only supported with WebGL2.")),i.bindTexture(e,h.__webglTexture),P(e,l,f),D(c.__webglFramebuffer,t,l,36064,e),y(l,f)&&_(e,l,t.width,t.height,t.depth),i.unbindTexture()}t.depthBuffer&&function(t){const r=n.get(t),s=!0===t.isWebGLCubeRenderTarget;if(t.depthTexture){if(s)throw new Error("target.depthTexture not supported in Cube render targets");!function(t,r){if(r&&r.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(i.bindFramebuffer(36160,t),!r.depthTexture||!r.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");n.get(r.depthTexture).__webglTexture&&r.depthTexture.image.width===r.width&&r.depthTexture.image.height===r.height||(r.depthTexture.image.width=r.width,r.depthTexture.image.height=r.height,r.depthTexture.needsUpdate=!0),S(r.depthTexture,0);const s=n.get(r.depthTexture).__webglTexture;if(r.depthTexture.format===Ge)e.framebufferTexture2D(36160,36096,3553,s,0);else{if(r.depthTexture.format!==je)throw new Error("Unknown depthTexture format");e.framebufferTexture2D(36160,33306,3553,s,0)}}(r.__webglFramebuffer,t)}else if(s){r.__webglDepthbuffer=[];for(let n=0;n<6;n++)i.bindFramebuffer(36160,r.__webglFramebuffer[n]),r.__webglDepthbuffer[n]=e.createRenderbuffer(),O(r.__webglDepthbuffer[n],t,!1)}else i.bindFramebuffer(36160,r.__webglFramebuffer),r.__webglDepthbuffer=e.createRenderbuffer(),O(r.__webglDepthbuffer,t,!1);i.bindFramebuffer(36160,null)}(t)},this.updateRenderTargetMipmap=function(e){const t=v(e)||a,r=!0===e.isWebGLMultipleRenderTargets?e.texture:[e.texture];for(let s=0,o=r.length;s<o;s++){const o=r[s];if(y(o,t)){const t=e.isWebGLCubeRenderTarget?34067:3553,r=n.get(o).__webglTexture;i.bindTexture(t,r),_(t,o,e.width,e.height),i.unbindTexture()}}},this.updateMultisampleRenderTarget=function(t){if(t.isWebGLMultisampleRenderTarget)if(a){const r=t.width,s=t.height;let o=16384;t.depthBuffer&&(o|=256),t.stencilBuffer&&(o|=1024);const a=n.get(t);i.bindFramebuffer(36008,a.__webglMultisampledFramebuffer),i.bindFramebuffer(36009,a.__webglFramebuffer),e.blitFramebuffer(0,0,r,s,0,0,r,s,o,9728),i.bindFramebuffer(36008,null),i.bindFramebuffer(36009,a.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")},this.safeSetTexture2D=function(e,t){e&&e.isWebGLRenderTarget&&(!1===F&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),F=!0),e=e.texture),S(e,t)},this.safeSetTextureCube=function(e,t){e&&e.isWebGLCubeRenderTarget&&(!1===V&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),V=!0),e=e.texture),E(e,t)}}function bl(e,t,i){const n=i.isWebGL2;return{convert:function(e){let i;if(e===Te)return 5121;if(e===De)return 32819;if(e===Oe)return 32820;if(e===Ie)return 33635;if(e===Se)return 5120;if(e===Ee)return 5122;if(e===Ae)return 5123;if(e===Ce)return 5124;if(e===Pe)return 5125;if(e===Le)return 5126;if(e===Re)return n?5131:(i=t.get("OES_texture_half_float"),null!==i?i.HALF_FLOAT_OES:null);if(e===Ve)return 6406;if(e===Ue)return 6407;if(e===Be)return 6408;if(e===Ne)return 6409;if(e===ze)return 6410;if(e===Ge)return 6402;if(e===je)return 34041;if(e===He)return 6403;if(e===We)return 36244;if(e===qe)return 33319;if(e===Xe)return 33320;if(e===Ze)return 36248;if(e===Ye)return 36249;if(e===Ke||e===$e||e===Je||e===Qe){if(i=t.get("WEBGL_compressed_texture_s3tc"),null===i)return null;if(e===Ke)return i.COMPRESSED_RGB_S3TC_DXT1_EXT;if(e===$e)return i.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(e===Je)return i.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(e===Qe)return i.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(e===et||e===tt||e===it||e===nt){if(i=t.get("WEBGL_compressed_texture_pvrtc"),null===i)return null;if(e===et)return i.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(e===tt)return i.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(e===it)return i.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(e===nt)return i.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(e===rt)return i=t.get("WEBGL_compressed_texture_etc1"),null!==i?i.COMPRESSED_RGB_ETC1_WEBGL:null;if((e===st||e===ot)&&(i=t.get("WEBGL_compressed_texture_etc"),null!==i)){if(e===st)return i.COMPRESSED_RGB8_ETC2;if(e===ot)return i.COMPRESSED_RGBA8_ETC2_EAC}return e===at||e===lt||e===ct||e===ht||e===ut||e===dt||e===mt||e===pt||e===ft||e===gt||e===vt||e===yt||e===_t||e===xt||e===wt||e===Mt||e===Tt||e===St||e===Et||e===At||e===Ct||e===Pt||e===Lt||e===Rt||e===Dt||e===Ot||e===It||e===Ft?(i=t.get("WEBGL_compressed_texture_astc"),null!==i?e:null):e===bt?(i=t.get("EXT_texture_compression_bptc"),null!==i?e:null):e===Fe?n?34042:(i=t.get("WEBGL_depth_texture"),null!==i?i.UNSIGNED_INT_24_8_WEBGL:null):void 0}}}class wl extends Ps{constructor(e=[]){super(),this.cameras=e}}wl.prototype.isArrayCamera=!0;class Ml extends fr{constructor(){super(),this.type="Group"}}Ml.prototype.isGroup=!0;const Tl={type:"move"};class Sl{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new Ml,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return null===this._targetRay&&(this._targetRay=new Ml,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new mn,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new mn),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new Ml,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new mn,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new mn),this._grip}dispatchEvent(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),null!==this._hand&&this._hand.dispatchEvent(e),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(e,t,i){let n=null,r=null,s=null;const o=this._targetRay,a=this._grip,l=this._hand;if(e&&"visible-blurred"!==t.session.visibilityState)if(null!==o&&(n=t.getPose(e.targetRaySpace,i),null!==n&&(o.matrix.fromArray(n.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),n.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(n.linearVelocity)):o.hasLinearVelocity=!1,n.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(n.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(Tl))),l&&e.hand){s=!0;for(const n of e.hand.values()){const e=t.getJointPose(n,i);if(void 0===l.joints[n.jointName]){const e=new Ml;e.matrixAutoUpdate=!1,e.visible=!1,l.joints[n.jointName]=e,l.add(e)}const r=l.joints[n.jointName];null!==e&&(r.matrix.fromArray(e.transform.matrix),r.matrix.decompose(r.position,r.rotation,r.scale),r.jointRadius=e.radius),r.visible=null!==e}const n=l.joints["index-finger-tip"],r=l.joints["thumb-tip"],o=n.position.distanceTo(r.position),a=.02,c=.005;l.inputState.pinching&&o>a+c?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&o<=a-c&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==a&&e.gripSpace&&(r=t.getPose(e.gripSpace,i),null!==r&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),r.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(r.linearVelocity)):a.hasLinearVelocity=!1,r.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(r.angularVelocity)):a.hasAngularVelocity=!1));return null!==o&&(o.visible=null!==n),null!==a&&(a.visible=null!==r),null!==l&&(l.visible=null!==s),this}}class El extends Fi{constructor(e,t){super();const i=this,n=e.state;let r=null,s=1,o=null,a="local-floor",l=null,c=null,h=null,u=null,d=null,m=!1,p=null,f=null,g=null,v=null,y=null,_=null;const x=[],b=new Map,w=new Ps;w.layers.enable(1),w.viewport=new ln;const M=new Ps;M.layers.enable(2),M.viewport=new ln;const T=[w,M],S=new wl;S.layers.enable(1),S.layers.enable(2);let E=null,A=null;function C(e){const t=b.get(e.inputSource);t&&t.dispatchEvent({type:e.type,data:e.inputSource})}function P(){b.forEach((function(e,t){e.disconnect(t)})),b.clear(),E=null,A=null,n.bindXRFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),h&&t.deleteFramebuffer(h),p&&t.deleteFramebuffer(p),f&&t.deleteRenderbuffer(f),g&&t.deleteRenderbuffer(g),h=null,p=null,f=null,g=null,d=null,u=null,c=null,r=null,F.stop(),i.isPresenting=!1,i.dispatchEvent({type:"sessionend"})}function L(e){const t=r.inputSources;for(let e=0;e<x.length;e++)b.set(t[e],x[e]);for(let t=0;t<e.removed.length;t++){const i=e.removed[t],n=b.get(i);n&&(n.dispatchEvent({type:"disconnected",data:i}),b.delete(i))}for(let t=0;t<e.added.length;t++){const i=e.added[t],n=b.get(i);n&&n.dispatchEvent({type:"connected",data:i})}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(e){let t=x[e];return void 0===t&&(t=new Sl,x[e]=t),t.getTargetRaySpace()},this.getControllerGrip=function(e){let t=x[e];return void 0===t&&(t=new Sl,x[e]=t),t.getGripSpace()},this.getHand=function(e){let t=x[e];return void 0===t&&(t=new Sl,x[e]=t),t.getHandSpace()},this.setFramebufferScaleFactor=function(e){s=e,!0===i.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(e){a=e,!0===i.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return o},this.getBaseLayer=function(){return null!==u?u:d},this.getBinding=function(){return c},this.getFrame=function(){return v},this.getSession=function(){return r},this.setSession=async function(e){if(r=e,null!==r){r.addEventListener("select",C),r.addEventListener("selectstart",C),r.addEventListener("selectend",C),r.addEventListener("squeeze",C),r.addEventListener("squeezestart",C),r.addEventListener("squeezeend",C),r.addEventListener("end",P),r.addEventListener("inputsourceschange",L);const e=t.getContextAttributes();if(!0!==e.xrCompatible&&await t.makeXRCompatible(),void 0===r.renderState.layers){const i={antialias:e.antialias,alpha:e.alpha,depth:e.depth,stencil:e.stencil,framebufferScaleFactor:s};d=new XRWebGLLayer(r,t,i),r.updateRenderState({baseLayer:d})}else if(t instanceof WebGLRenderingContext){const i={antialias:!0,alpha:e.alpha,depth:e.depth,stencil:e.stencil,framebufferScaleFactor:s};d=new XRWebGLLayer(r,t,i),r.updateRenderState({layers:[d]})}else{m=e.antialias;let i=null;e.depth&&(_=256,e.stencil&&(_|=1024),y=e.stencil?33306:36096,i=e.stencil?35056:33190);const o={colorFormat:e.alpha?32856:32849,depthFormat:i,scaleFactor:s};c=new XRWebGLBinding(r,t),u=c.createProjectionLayer(o),h=t.createFramebuffer(),r.updateRenderState({layers:[u]}),m&&(p=t.createFramebuffer(),f=t.createRenderbuffer(),t.bindRenderbuffer(36161,f),t.renderbufferStorageMultisample(36161,4,32856,u.textureWidth,u.textureHeight),n.bindFramebuffer(36160,p),t.framebufferRenderbuffer(36160,36064,36161,f),t.bindRenderbuffer(36161,null),null!==i&&(g=t.createRenderbuffer(),t.bindRenderbuffer(36161,g),t.renderbufferStorageMultisample(36161,4,i,u.textureWidth,u.textureHeight),t.framebufferRenderbuffer(36160,y,36161,g),t.bindRenderbuffer(36161,null)),n.bindFramebuffer(36160,null))}o=await r.requestReferenceSpace(a),F.setContext(r),F.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}};const R=new mn,D=new mn;function O(e,t){null===t?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.copy(e.matrixWorld).invert()}this.updateCamera=function(e){if(null===r)return;S.near=M.near=w.near=e.near,S.far=M.far=w.far=e.far,E===S.near&&A===S.far||(r.updateRenderState({depthNear:S.near,depthFar:S.far}),E=S.near,A=S.far);const t=e.parent,i=S.cameras;O(S,t);for(let e=0;e<i.length;e++)O(i[e],t);S.matrixWorld.decompose(S.position,S.quaternion,S.scale),e.position.copy(S.position),e.quaternion.copy(S.quaternion),e.scale.copy(S.scale),e.matrix.copy(S.matrix),e.matrixWorld.copy(S.matrixWorld);const n=e.children;for(let e=0,t=n.length;e<t;e++)n[e].updateMatrixWorld(!0);2===i.length?function(e,t,i){R.setFromMatrixPosition(t.matrixWorld),D.setFromMatrixPosition(i.matrixWorld);const n=R.distanceTo(D),r=t.projectionMatrix.elements,s=i.projectionMatrix.elements,o=r[14]/(r[10]-1),a=r[14]/(r[10]+1),l=(r[9]+1)/r[5],c=(r[9]-1)/r[5],h=(r[8]-1)/r[0],u=(s[8]+1)/s[0],d=o*h,m=o*u,p=n/(-h+u),f=p*-h;t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(f),e.translateZ(p),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.copy(e.matrixWorld).invert();const g=o+p,v=a+p,y=d-f,_=m+(n-f),x=l*a/v*g,b=c*a/v*g;e.projectionMatrix.makePerspective(y,_,x,b,g,v)}(S,w,M):S.projectionMatrix.copy(w.projectionMatrix)},this.getCamera=function(){return S},this.getFoveation=function(){return null!==u?u.fixedFoveation:null!==d?d.fixedFoveation:void 0},this.setFoveation=function(e){null!==u&&(u.fixedFoveation=e),null!==d&&void 0!==d.fixedFoveation&&(d.fixedFoveation=e)};let I=null;const F=new ks;F.setAnimationLoop((function(e,i){if(l=i.getViewerPose(o),v=i,null!==l){const e=l.views;null!==d&&n.bindXRFramebuffer(d.framebuffer);let i=!1;e.length!==S.cameras.length&&(S.cameras.length=0,i=!0);for(let r=0;r<e.length;r++){const s=e[r];let o=null;if(null!==d)o=d.getViewport(s);else{const e=c.getViewSubImage(u,s);n.bindXRFramebuffer(h),void 0!==e.depthStencilTexture&&t.framebufferTexture2D(36160,y,3553,e.depthStencilTexture,0),t.framebufferTexture2D(36160,36064,3553,e.colorTexture,0),o=e.viewport}const a=T[r];a.matrix.fromArray(s.transform.matrix),a.projectionMatrix.fromArray(s.projectionMatrix),a.viewport.set(o.x,o.y,o.width,o.height),0===r&&S.matrix.copy(a.matrix),!0===i&&S.cameras.push(a)}m&&(n.bindXRFramebuffer(p),null!==_&&t.clear(_))}const s=r.inputSources;for(let e=0;e<x.length;e++){const t=x[e],n=s[e];t.update(n,i,o)}if(I&&I(e,i),m){const e=u.textureWidth,i=u.textureHeight;n.bindFramebuffer(36008,p),n.bindFramebuffer(36009,h),t.invalidateFramebuffer(36008,[y]),t.invalidateFramebuffer(36009,[y]),t.blitFramebuffer(0,0,e,i,0,0,e,i,16384,9728),t.invalidateFramebuffer(36008,[36064]),n.bindFramebuffer(36008,null),n.bindFramebuffer(36009,null),n.bindFramebuffer(36160,p)}v=null})),this.setAnimationLoop=function(e){I=e},this.dispose=function(){}}}function Al(e){function t(t,i){t.opacity.value=i.opacity,i.color&&t.diffuse.value.copy(i.color),i.emissive&&t.emissive.value.copy(i.emissive).multiplyScalar(i.emissiveIntensity),i.map&&(t.map.value=i.map),i.alphaMap&&(t.alphaMap.value=i.alphaMap),i.specularMap&&(t.specularMap.value=i.specularMap),i.alphaTest>0&&(t.alphaTest.value=i.alphaTest);const n=e.get(i).envMap;if(n){t.envMap.value=n,t.flipEnvMap.value=n.isCubeTexture&&!1===n.isRenderTargetTexture?-1:1,t.reflectivity.value=i.reflectivity,t.ior.value=i.ior,t.refractionRatio.value=i.refractionRatio;const r=e.get(n).__maxMipLevel;
949void 0!==r&&(t.maxMipLevel.value=r)}let r,s;i.lightMap&&(t.lightMap.value=i.lightMap,t.lightMapIntensity.value=i.lightMapIntensity),i.aoMap&&(t.aoMap.value=i.aoMap,t.aoMapIntensity.value=i.aoMapIntensity),i.map?r=i.map:i.specularMap?r=i.specularMap:i.displacementMap?r=i.displacementMap:i.normalMap?r=i.normalMap:i.bumpMap?r=i.bumpMap:i.roughnessMap?r=i.roughnessMap:i.metalnessMap?r=i.metalnessMap:i.alphaMap?r=i.alphaMap:i.emissiveMap?r=i.emissiveMap:i.clearcoatMap?r=i.clearcoatMap:i.clearcoatNormalMap?r=i.clearcoatNormalMap:i.clearcoatRoughnessMap?r=i.clearcoatRoughnessMap:i.specularIntensityMap?r=i.specularIntensityMap:i.specularColorMap?r=i.specularColorMap:i.transmissionMap?r=i.transmissionMap:i.thicknessMap?r=i.thicknessMap:i.sheenColorMap?r=i.sheenColorMap:i.sheenRoughnessMap&&(r=i.sheenRoughnessMap),void 0!==r&&(r.isWebGLRenderTarget&&(r=r.texture),!0===r.matrixAutoUpdate&&r.updateMatrix(),t.uvTransform.value.copy(r.matrix)),i.aoMap?s=i.aoMap:i.lightMap&&(s=i.lightMap),void 0!==s&&(s.isWebGLRenderTarget&&(s=s.texture),!0===s.matrixAutoUpdate&&s.updateMatrix(),t.uv2Transform.value.copy(s.matrix))}function i(t,i){t.roughness.value=i.roughness,t.metalness.value=i.metalness,i.roughnessMap&&(t.roughnessMap.value=i.roughnessMap),i.metalnessMap&&(t.metalnessMap.value=i.metalnessMap),i.emissiveMap&&(t.emissiveMap.value=i.emissiveMap),i.bumpMap&&(t.bumpMap.value=i.bumpMap,t.bumpScale.value=i.bumpScale,i.side===f&&(t.bumpScale.value*=-1)),i.normalMap&&(t.normalMap.value=i.normalMap,t.normalScale.value.copy(i.normalScale),i.side===f&&t.normalScale.value.negate()),i.displacementMap&&(t.displacementMap.value=i.displacementMap,t.displacementScale.value=i.displacementScale,t.displacementBias.value=i.displacementBias),e.get(i).envMap&&(t.envMapIntensity.value=i.envMapIntensity)}return{refreshFogUniforms:function(e,t){e.fogColor.value.copy(t.color),t.isFog?(e.fogNear.value=t.near,e.fogFar.value=t.far):t.isFogExp2&&(e.fogDensity.value=t.density)},refreshMaterialUniforms:function(e,n,r,s,o){n.isMeshBasicMaterial?t(e,n):n.isMeshLambertMaterial?(t(e,n),function(e,t){t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap)}(e,n)):n.isMeshToonMaterial?(t(e,n),function(e,t){t.gradientMap&&(e.gradientMap.value=t.gradientMap),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===f&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===f&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(e,n)):n.isMeshPhongMaterial?(t(e,n),function(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===f&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===f&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(e,n)):n.isMeshStandardMaterial?(t(e,n),n.isMeshPhysicalMaterial?function(e,t,n){i(e,t),e.ior.value=t.ior,t.sheen>0&&(e.sheenColor.value.copy(t.sheenColor).multiplyScalar(t.sheen),e.sheenRoughness.value=t.sheenRoughness,t.sheenColorMap&&(e.sheenColorMap.value=t.sheenColorMap),t.sheenRoughnessMap&&(e.sheenRoughnessMap.value=t.sheenRoughnessMap)),t.clearcoat>0&&(e.clearcoat.value=t.clearcoat,e.clearcoatRoughness.value=t.clearcoatRoughness,t.clearcoatMap&&(e.clearcoatMap.value=t.clearcoatMap),t.clearcoatRoughnessMap&&(e.clearcoatRoughnessMap.value=t.clearcoatRoughnessMap),t.clearcoatNormalMap&&(e.clearcoatNormalScale.value.copy(t.clearcoatNormalScale),e.clearcoatNormalMap.value=t.clearcoatNormalMap,t.side===f&&e.clearcoatNormalScale.value.negate())),t.transmission>0&&(e.transmission.value=t.transmission,e.transmissionSamplerMap.value=n.texture,e.transmissionSamplerSize.value.set(n.width,n.height),t.transmissionMap&&(e.transmissionMap.value=t.transmissionMap),e.thickness.value=t.thickness,t.thicknessMap&&(e.thicknessMap.value=t.thicknessMap),e.attenuationDistance.value=t.attenuationDistance,e.attenuationColor.value.copy(t.attenuationColor)),e.specularIntensity.value=t.specularIntensity,e.specularColor.value.copy(t.specularColor),t.specularIntensityMap&&(e.specularIntensityMap.value=t.specularIntensityMap),t.specularColorMap&&(e.specularColorMap.value=t.specularColorMap)}
vendor: 40,897 bytes, line 949
949(e,n,o):i(e,n)):n.isMeshMatcapMaterial?(t(e,n),function(e,t){t.matcap&&(e.matcap.value=t.matcap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===f&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===f&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(e,n)):n.isMeshDepthMaterial?(t(e,n),function(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(e,n)):n.isMeshDistanceMaterial?(t(e,n),function(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias),e.referencePosition.value.copy(t.referencePosition),e.nearDistance.value=t.nearDistance,e.farDistance.value=t.farDistance}(e,n)):n.isMeshNormalMaterial?(t(e,n),function(e,t){t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===f&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===f&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(e,n)):n.isLineBasicMaterial?(function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity}(e,n),n.isLineDashedMaterial&&function(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}(e,n)):n.isPointsMaterial?function(e,t,i,n){let r;e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*i,e.scale.value=.5*n,t.map&&(e.map.value=t.map),t.alphaMap&&(e.alphaMap.value=t.alphaMap),t.alphaTest>0&&(e.alphaTest.value=t.alphaTest),t.map?r=t.map:t.alphaMap&&(r=t.alphaMap),void 0!==r&&(!0===r.matrixAutoUpdate&&r.updateMatrix(),e.uvTransform.value.copy(r.matrix))}(e,n,r,s):n.isSpriteMaterial?function(e,t){let i;e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.rotation.value=t.rotation,t.map&&(e.map.value=t.map),t.alphaMap&&(e.alphaMap.value=t.alphaMap),t.alphaTest>0&&(e.alphaTest.value=t.alphaTest),t.map?i=t.map:t.alphaMap&&(i=t.alphaMap),void 0!==i&&(!0===i.matrixAutoUpdate&&i.updateMatrix(),e.uvTransform.value.copy(i.matrix))}(e,n):n.isShadowMaterial?(e.color.value.copy(n.color),e.opacity.value=n.opacity):n.isShaderMaterial&&(n.uniformsNeedUpdate=!1)}}}function Cl(e={}){const t=void 0!==e.canvas?e.canvas:function(){const e=en("canvas");return e.style.display="block",e}(),i=void 0!==e.context?e.context:null,n=void 0!==e.alpha&&e.alpha,r=void 0===e.depth||e.depth,s=void 0===e.stencil||e.stencil,o=void 0!==e.antialias&&e.antialias,a=void 0===e.premultipliedAlpha||e.premultipliedAlpha,l=void 0!==e.preserveDrawingBuffer&&e.preserveDrawingBuffer,c=void 0!==e.powerPreference?e.powerPreference:"default",h=void 0!==e.failIfMajorPerformanceCaveat&&e.failIfMajorPerformanceCaveat;let u=null,d=null;const m=[],v=[];this.domElement=t,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.outputEncoding=Kt,this.physicallyCorrectLights=!1,this.toneMapping=J,this.toneMappingExposure=1;const y=this;let _=!1,x=0,b=0,w=null,M=-1,T=null;const S=new ln,E=new ln;let A=null,C=t.width,P=t.height,L=1,R=null,D=null;const O=new ln(0,0,C,P),I=new ln(0,0,C,P);let F=!1;const V=[],U=new zs;let B=!1,N=!1,z=null;const k=new Hn,G=new mn,j={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function H(){return null===w?L:1}let W,q,X,Z,Y,K,$,Q,ee,te,ie,ne,re,se,oe,ae,le,ce,he,ue,me,fe,ge,ve=i;function ye(e,i){for(let n=0;n<e.length;n++){const r=e[n],s=t.getContext(r,i);if(null!==s)return s}return null}try{const e={alpha:n,depth:r,stencil:s,antialias:o,premultipliedAlpha:a,preserveDrawingBuffer:l,powerPreference:c,failIfMajorPerformanceCaveat:h};if(t.addEventListener("webglcontextlost",be,!1),t.addEventListener("webglcontextrestored",Me,!1),null===ve){const t=["webgl2","webgl","experimental-webgl"];if(!0===y.isWebGL1Renderer&&t.shift(),ve=ye(t,e),null===ve)throw ye(t)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}void 0===ve.getShaderPrecisionFormat&&(ve.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(e){throw console.error("THREE.WebGLRenderer: "+e.message),e}function _e(){W=new Mo(ve),q=new Ks(ve,W,e),W.init(q),fe=new bl(ve,W,q),X=new _l(ve,W,q),V[0]=1029,Z=new Eo(ve),Y=new nl,K=new xl(ve,W,X,Y,q,fe,Z),$=new Js(y),Q=new wo(y),ee=new Gs(ve,q),ge=new Zs(ve,W,ee,q),te=new To(ve,ee,Z,ge),ie=new Do(ve,te,ee,Z),he=new Ro(ve,q,K),ae=new $s(Y),ne=new il(y,$,Q,W,q,ge,ae),re=new Al(Y),se=new al(Y),oe=new ml(W,q),ce=new Xs(y,$,X,ie,a),le=new yl(y,ie,q),ue=new Ys(ve,W,Z,q),me=new So(ve,W,Z,q),Z.programs=ne.programs,y.capabilities=q,y.extensions=W,y.properties=Y,y.renderLists=se,y.shadowMap=le,y.state=X,y.info=Z}_e();const xe=new El(y,ve);function be(e){e.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),_=!0}function Me(){console.log("THREE.WebGLRenderer: Context Restored."),_=!1;const e=Z.autoReset,t=le.enabled,i=le.autoUpdate,n=le.needsUpdate,r=le.type;_e(),Z.autoReset=e,le.enabled=t,le.autoUpdate=i,le.needsUpdate=n,le.type=r}function Se(e){const t=e.target;t.removeEventListener("dispose",Se),function(e){(function(e){const t=Y.get(e).programs;void 0!==t&&t.forEach((function(e){ne.releaseProgram(e)}))})(e),Y.remove(e)}(t)}this.xr=xe,this.getContext=function(){return ve},this.getContextAttributes=function(){return ve.getContextAttributes()},this.forceContextLoss=function(){const e=W.get("WEBGL_lose_context");e&&e.loseContext()},this.forceContextRestore=function(){const e=W.get("WEBGL_lose_context");e&&e.restoreContext()},this.getPixelRatio=function(){return L},this.setPixelRatio=function(e){void 0!==e&&(L=e,this.setSize(C,P,!1))},this.getSize=function(e){return e.set(C,P)},this.setSize=function(e,i,n){xe.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(C=e,P=i,t.width=Math.floor(e*L),t.height=Math.floor(i*L),!1!==n&&(t.style.width=e+"px",t.style.height=i+"px"),this.setViewport(0,0,e,i))},this.getDrawingBufferSize=function(e){return e.set(C*L,P*L).floor()},this.setDrawingBufferSize=function(e,i,n){C=e,P=i,L=n,t.width=Math.floor(e*n),t.height=Math.floor(i*n),this.setViewport(0,0,e,i)},this.getCurrentViewport=function(e){return e.copy(S)},this.getViewport=function(e){return e.copy(O)},this.setViewport=function(e,t,i,n){e.isVector4?O.set(e.x,e.y,e.z,e.w):O.set(e,t,i,n),X.viewport(S.copy(O).multiplyScalar(L).floor())},this.getScissor=function(e){return e.copy(I)},this.setScissor=function(e,t,i,n){e.isVector4?I.set(e.x,e.y,e.z,e.w):I.set(e,t,i,n),X.scissor(E.copy(I).multiplyScalar(L).floor())},this.getScissorTest=function(){return F},this.setScissorTest=function(e){X.setScissorTest(F=e)},this.setOpaqueSort=function(e){R=e},this.setTransparentSort=function(e){D=e},this.getClearColor=function(e){return e.copy(ce.getClearColor())},this.setClearColor=function(){ce.setClearColor.apply(ce,arguments)},this.getClearAlpha=function(){return ce.getClearAlpha()},this.setClearAlpha=function(){ce.setClearAlpha.apply(ce,arguments)},this.clear=function(e,t,i){let n=0;(void 0===e||e)&&(n|=16384),(void 0===t||t)&&(n|=256),(void 0===i||i)&&(n|=1024),ve.clear(n)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",be,!1),t.removeEventListener("webglcontextrestored",Me,!1),se.dispose(),oe.dispose(),Y.dispose(),$.dispose(),Q.dispose(),ie.dispose(),ge.dispose(),xe.dispose(),xe.removeEventListener("sessionstart",Ae),xe.removeEventListener("sessionend",Ce),z&&(z.dispose(),z=null),Pe.stop()},this.renderBufferDirect=function(e,t,i,n,r,s){null===t&&(t=j);const o=r.isMesh&&r.matrixWorld.determinant()<0,a=function(e,t,i,n,r){!0!==t.isScene&&(t=j),K.resetTextureUnits();const s=t.fog,o=n.isMeshStandardMaterial?t.environment:null,a=null===w?y.outputEncoding:w.texture.encoding,l=(n.isMeshStandardMaterial?Q:$).get(n.envMap||o),c=!0===n.vertexColors&&!!i.attributes.color&&4===i.attributes.color.itemSize,h=!!n.normalMap&&!!i.attributes.tangent,u=!!i.morphAttributes.position,m=!!i.morphAttributes.normal,p=i.morphAttributes.position?i.morphAttributes.position.length:0,f=Y.get(n),g=d.state.lights;if(!0===B&&(!0===N||e!==T)){const t=e===T&&n.id===M;ae.setState(n,e,t)}let v=!1;n.version===f.__version?f.needsLights&&f.lightsStateVersion!==g.state.version||f.outputEncoding!==a||r.isInstancedMesh&&!1===f.instancing?v=!0:r.isInstancedMesh||!0!==f.instancing?r.isSkinnedMesh&&!1===f.skinning?v=!0:r.isSkinnedMesh||!0!==f.skinning?f.envMap!==l||n.fog&&f.fog!==s?v=!0:void 0===f.numClippingPlanes||f.numClippingPlanes===ae.numPlanes&&f.numIntersection===ae.numIntersection?(f.vertexAlphas!==c||f.vertexTangents!==h||f.morphTargets!==u||f.morphNormals!==m||!0===q.isWebGL2&&f.morphTargetsCount!==p)&&(v=!0):v=!0:v=!0:v=!0:(v=!0,f.__version=n.version);let _=f.currentProgram;!0===v&&(_=Ve(n,t,r));let x=!1,b=!1,S=!1;const E=_.getUniforms(),A=f.uniforms;if(X.useProgram(_.program)&&(x=!0,b=!0,S=!0),n.id!==M&&(M=n.id,b=!0),x||T!==e){if(E.setValue(ve,"projectionMatrix",e.projectionMatrix),q.logarithmicDepthBuffer&&E.setValue(ve,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),T!==e&&(T=e,b=!0,S=!0),n.isShaderMaterial||n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshStandardMaterial||n.envMap){const t=E.map.cameraPosition;void 0!==t&&t.setValue(ve,G.setFromMatrixPosition(e.matrixWorld))}(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial)&&E.setValue(ve,"isOrthographic",!0===e.isOrthographicCamera),(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial||n.isShadowMaterial||r.isSkinnedMesh)&&E.setValue(ve,"viewMatrix",e.matrixWorldInverse)}if(r.isSkinnedMesh){E.setOptional(ve,r,"bindMatrix"),E.setOptional(ve,r,"bindMatrixInverse");const e=r.skeleton;e&&(q.floatVertexTextures?(null===e.boneTexture&&e.computeBoneTexture(),E.setValue(ve,"boneTexture",e.boneTexture,K),E.setValue(ve,"boneTextureSize",e.boneTextureSize)):E.setOptional(ve,e,"boneMatrices"))}var C,R;return!i||void 0===i.morphAttributes.position&&void 0===i.morphAttributes.normal||he.update(r,i,n,_),(b||f.receiveShadow!==r.receiveShadow)&&(f.receiveShadow=r.receiveShadow,E.setValue(ve,"receiveShadow",r.receiveShadow)),b&&(E.setValue(ve,"toneMappingExposure",y.toneMappingExposure),f.needsLights&&(R=S,(C=A).ambientLightColor.needsUpdate=R,C.lightProbe.needsUpdate=R,C.directionalLights.needsUpdate=R,C.directionalLightShadows.needsUpdate=R,C.pointLights.needsUpdate=R,C.pointLightShadows.needsUpdate=R,C.spotLights.needsUpdate=R,C.spotLightShadows.needsUpdate=R,C.rectAreaLights.needsUpdate=R,C.hemisphereLights.needsUpdate=R),s&&n.fog&&re.refreshFogUniforms(A,s),re.refreshMaterialUniforms(A,n,L,P,z),Fa.upload(ve,f.uniformsList,A,K)),n.isShaderMaterial&&!0===n.uniformsNeedUpdate&&(Fa.upload(ve,f.uniformsList,A,K),n.uniformsNeedUpdate=!1),n.isSpriteMaterial&&E.setValue(ve,"center",r.center),E.setValue(ve,"modelViewMatrix",r.modelViewMatrix),E.setValue(ve,"normalMatrix",r.normalMatrix),E.setValue(ve,"modelMatrix",r.matrixWorld),_}(e,t,i,n,r);X.setMaterial(n,o);let l=i.index;const c=i.attributes.position;if(null===l){if(void 0===c||0===c.count)return}else if(0===l.count)return;let h,u=1;!0===n.wireframe&&(l=te.getWireframeAttribute(i),u=2),ge.setup(r,n,a,i,l);let m=ue;null!==l&&(h=ee.get(l),m=me,m.setIndex(h));const p=null!==l?l.count:c.count,f=i.drawRange.start*u,g=i.drawRange.count*u,v=null!==s?s.start*u:0,_=null!==s?s.count*u:1/0,x=Math.max(f,v),b=Math.min(p,f+g,v+_)-1,S=Math.max(0,b-x+1);if(0!==S){if(r.isMesh)!0===n.wireframe?(X.setLineWidth(n.wireframeLinewidth*H()),m.setMode(1)):m.setMode(4);else if(r.isLine){let e=n.linewidth;void 0===e&&(e=1),X.setLineWidth(e*H()),r.isLineSegments?m.setMode(1):r.isLineLoop?m.setMode(2):m.setMode(3)}else r.isPoints?m.setMode(0):r.isSprite&&m.setMode(4);if(r.isInstancedMesh)m.renderInstances(x,S,r.count);else if(i.isInstancedBufferGeometry){const e=Math.min(i.instanceCount,i._maxInstanceCount);m.renderInstances(x,S,e)}else m.render(x,S)}},this.compile=function(e,t){d=oe.get(e),d.init(),v.push(d),e.traverseVisible((function(e){e.isLight&&e.layers.test(t.layers)&&(d.pushLight(e),e.castShadow&&d.pushShadow(e))})),d.setupLights(y.physicallyCorrectLights),e.traverse((function(t){const i=t.material;if(i)if(Array.isArray(i))for(let n=0;n<i.length;n++)Ve(i[n],e,t);else Ve(i,e,t)})),v.pop(),d=null};let Ee=null;function Ae(){Pe.stop()}function Ce(){Pe.start()}const Pe=new ks;function De(e,t,i,n){if(!1===e.visible)return;if(e.layers.test(t.layers))if(e.isGroup)i=e.renderOrder;else if(e.isLOD)!0===e.autoUpdate&&e.update(t);else if(e.isLight)d.pushLight(e),e.castShadow&&d.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||U.intersectsSprite(e)){n&&G.setFromMatrixPosition(e.matrixWorld).applyMatrix4(k);const t=ie.update(e),r=e.material;r.visible&&u.push(e,t,r,i,G.z,null)}}else if((e.isMesh||e.isLine||e.isPoints)&&(e.isSkinnedMesh&&e.skeleton.frame!==Z.render.frame&&(e.skeleton.update(),e.skeleton.frame=Z.render.frame),!e.frustumCulled||U.intersectsObject(e))){n&&G.setFromMatrixPosition(e.matrixWorld).applyMatrix4(k);const t=ie.update(e),r=e.material;if(Array.isArray(r)){const n=t.groups;for(let s=0,o=n.length;s<o;s++){const o=n[s],a=r[o.materialIndex];a&&a.visible&&u.push(e,t,a,i,G.z,o)}}else r.visible&&u.push(e,t,r,i,G.z,null)}const r=e.children;for(let e=0,s=r.length;e<s;e++)De(r[e],t,i,n)}function Oe(e,t,i,n){const r=e.opaque,s=e.transmissive,a=e.transparent;d.setupLightsView(i),s.length>0&&function(e,t,i){if(null===z){const e=!0===o&&!0===q.isWebGL2;z=new(e?un:cn)(1024,1024,{generateMipmaps:!0,type:null!==fe.convert(Re)?Re:Te,minFilter:we,magFilter:pe,wrapS:de,wrapT:de})}const n=y.getRenderTarget();y.setRenderTarget(z),y.clear();const r=y.toneMapping;y.toneMapping=J,Ie(e,t,i),y.toneMapping=r,K.updateMultisampleRenderTarget(z),K.updateRenderTargetMipmap(z),y.setRenderTarget(n)}(r,t,i),n&&X.viewport(S.copy(n)),r.length>0&&Ie(r,t,i),s.length>0&&Ie(s,t,i),a.length>0&&Ie(a,t,i)}function Ie(e,t,i){const n=!0===t.isScene?t.overrideMaterial:null;for(let r=0,s=e.length;r<s;r++){const s=e[r],o=s.object,a=s.geometry,l=null===n?s.material:n,c=s.group;o.layers.test(i.layers)&&Fe(o,t,i,a,l,c)}}function Fe(e,t,i,n,r,s){e.onBeforeRender(y,t,i,n,r,s),e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix),r.onBeforeRender(y,t,i,n,e,s),!0===r.transparent&&r.side===g?(r.side=f,r.needsUpdate=!0,y.renderBufferDirect(i,t,n,r,e,s),r.side=p,r.needsUpdate=!0,y.renderBufferDirect(i,t,n,r,e,s),r.side=g):y.renderBufferDirect(i,t,n,r,e,s),e.onAfterRender(y,t,i,n,r,s)}function Ve(e,t,i){!0!==t.isScene&&(t=j);const n=Y.get(e),r=d.state.lights,s=d.state.shadowsArray,o=r.state.version,a=ne.getParameters(e,r.state,s,t,i),l=ne.getProgramCacheKey(a);let c=n.programs;n.environment=e.isMeshStandardMaterial?t.environment:null,n.fog=t.fog,n.envMap=(e.isMeshStandardMaterial?Q:$).get(e.envMap||n.environment),void 0===c&&(e.addEventListener("dispose",Se),c=new Map,n.programs=c);let h=c.get(l);if(void 0!==h){if(n.currentProgram===h&&n.lightsStateVersion===o)return Ue(e,a),h}else a.uniforms=ne.getUniforms(e),e.onBuild(i,a,y),e.onBeforeCompile(a,y),h=ne.acquireProgram(a,l),c.set(l,h),n.uniforms=a.uniforms;const u=n.uniforms;(e.isShaderMaterial||e.isRawShaderMaterial)&&!0!==e.clipping||(u.clippingPlanes=ae.uniform),Ue(e,a),n.needsLights=function(e){return e.isMeshLambertMaterial||e.isMeshToonMaterial||e.isMeshPhongMaterial||e.isMeshStandardMaterial||e.isShadowMaterial||e.isShaderMaterial&&!0===e.lights}(e),n.lightsStateVersion=o,n.needsLights&&(u.ambientLightColor.value=r.state.ambient,u.lightProbe.value=r.state.probe,u.directionalLights.value=r.state.directional,u.directionalLightShadows.value=r.state.directionalShadow,u.spotLights.value=r.state.spot,u.spotLightShadows.value=r.state.spotShadow,u.rectAreaLights.value=r.state.rectArea,u.ltc_1.value=r.state.rectAreaLTC1,u.ltc_2.value=r.state.rectAreaLTC2,u.pointLights.value=r.state.point,u.pointLightShadows.value=r.state.pointShadow,u.hemisphereLights.value=r.state.hemi,u.directionalShadowMap.value=r.state.directionalShadowMap,u.directionalShadowMatrix.value=r.state.directionalShadowMatrix,u.spotShadowMap.value=r.state.spotShadowMap,u.spotShadowMatrix.value=r.state.spotShadowMatrix,u.pointShadowMap.value=r.state.pointShadowMap,u.pointShadowMatrix.value=r.state.pointShadowMatrix);const m=h.getUniforms(),p=Fa.seqWithValue(m.seq,u);return n.currentProgram=h,n.uniformsList=p,h}function Ue(e,t){const i=Y.get(e);i.outputEncoding=t.outputEncoding,i.instancing=t.instancing,i.skinning=t.skinning,i.morphTargets=t.morphTargets,i.morphNormals=t.morphNormals,i.morphTargetsCount=t.morphTargetsCount,i.numClippingPlanes=t.numClippingPlanes,i.numIntersection=t.numClipIntersection,i.vertexAlphas=t.vertexAlphas,i.vertexTangents=t.vertexTangents}Pe.setAnimationLoop((function(e){Ee&&Ee(e)})),"undefined"!=typeof window&&Pe.setContext(window),this.setAnimationLoop=function(e){Ee=e,xe.setAnimationLoop(e),null===e?Pe.stop():Pe.start()},xe.addEventListener("sessionstart",Ae),xe.addEventListener("sessionend",Ce),this.render=function(e,t){if(void 0!==t&&!0!==t.isCamera)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(!0===_)return;!0===e.autoUpdate&&e.updateMatrixWorld(),null===t.parent&&t.updateMatrixWorld(),!0===xe.enabled&&!0===xe.isPresenting&&(!0===xe.cameraAutoUpdate&&xe.updateCamera(t),t=xe.getCamera()),!0===e.isScene&&e.onBeforeRender(y,e,t,w),d=oe.get(e,v.length),d.init(),v.push(d),k.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),U.setFromProjectionMatrix(k),N=this.localClippingEnabled,B=ae.init(this.clippingPlanes,N,t),u=se.get(e,m.length),u.init(),m.push(u),De(e,t,0,y.sortObjects),u.finish(),!0===y.sortObjects&&u.sort(R,D),!0===B&&ae.beginShadows();const i=d.state.shadowsArray;if(le.render(i,e,t),!0===B&&ae.endShadows(),!0===this.info.autoReset&&this.info.reset(),ce.render(u,e),d.setupLights(y.physicallyCorrectLights),t.isArrayCamera){const i=t.cameras;for(let t=0,n=i.length;t<n;t++){const n=i[t];Oe(u,e,n,n.viewport)}}else Oe(u,e,t);null!==w&&(K.updateMultisampleRenderTarget(w),K.updateRenderTargetMipmap(w)),!0===e.isScene&&e.onAfterRender(y,e,t),X.buffers.depth.setTest(!0),X.buffers.depth.setMask(!0),X.buffers.color.setMask(!0),X.setPolygonOffset(!1),ge.resetDefaultState(),M=-1,T=null,v.pop(),d=v.length>0?v[v.length-1]:null,m.pop(),u=m.length>0?m[m.length-1]:null},this.getActiveCubeFace=function(){return x},this.getActiveMipmapLevel=function(){return b},this.getRenderTarget=function(){return w},this.setRenderTarget=function(e,t=0,i=0){w=e,x=t,b=i,e&&void 0===Y.get(e).__webglFramebuffer&&K.setupRenderTarget(e);let n=null,r=!1,s=!1;if(e){const i=e.texture;(i.isDataTexture3D||i.isDataTexture2DArray)&&(s=!0);const o=Y.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(n=o[t],r=!0):n=e.isWebGLMultisampleRenderTarget?Y.get(e).__webglMultisampledFramebuffer:o,S.copy(e.viewport),E.copy(e.scissor),A=e.scissorTest}else S.copy(O).multiplyScalar(L).floor(),E.copy(I).multiplyScalar(L).floor(),A=F;if(X.bindFramebuffer(36160,n)&&q.drawBuffers){let t=!1;if(e)if(e.isWebGLMultipleRenderTargets){const i=e.texture;if(V.length!==i.length||36064!==V[0]){for(let e=0,t=i.length;e<t;e++)V[e]=36064+e;V.length=i.length,t=!0}}else 1===V.length&&36064===V[0]||(V[0]=36064,V.length=1,t=!0);else 1===V.length&&1029===V[0]||(V[0]=1029,V.length=1,t=!0);t&&(q.isWebGL2?ve.drawBuffers(V):W.get("WEBGL_draw_buffers").drawBuffersWEBGL(V))}if(X.viewport(S),X.scissor(E),X.setScissorTest(A),r){const n=Y.get(e.texture);ve.framebufferTexture2D(36160,36064,34069+t,n.__webglTexture,i)}else if(s){const n=Y.get(e.texture),r=t||0;ve.framebufferTextureLayer(36160,36064,n.__webglTexture,i||0,r)}M=-1},this.readRenderTargetPixels=function(e,t,i,n,r,s,o){if(!e||!e.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let a=Y.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==o&&(a=a[o]),a){X.bindFramebuffer(36160,a);try{const o=e.texture,a=o.format,l=o.type;if(a!==Be&&fe.convert(a)!==ve.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const c=l===Re&&(W.has("EXT_color_buffer_half_float")||q.isWebGL2&&W.has("EXT_color_buffer_float"));if(!(l===Te||fe.convert(l)===ve.getParameter(35738)||l===Le&&(q.isWebGL2||W.has("OES_texture_float")||W.has("WEBGL_color_buffer_float"))||c))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");36053===ve.checkFramebufferStatus(36160)?t>=0&&t<=e.width-n&&i>=0&&i<=e.height-r&&ve.readPixels(t,i,n,r,fe.convert(a),fe.convert(l),s):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{const e=null!==w?Y.get(w).__webglFramebuffer:null;X.bindFramebuffer(36160,e)}}},this.copyFramebufferToTexture=function(e,t,i=0){const n=Math.pow(2,-i),r=Math.floor(t.image.width*n),s=Math.floor(t.image.height*n);let o=fe.convert(t.format);q.isWebGL2&&(6407===o&&(o=32849),6408===o&&(o=32856)),K.setTexture2D(t,0),ve.copyTexImage2D(3553,i,o,e.x,e.y,r,s,0),X.unbindTexture()},this.copyTextureToTexture=function(e,t,i,n=0){const r=t.image.width,s=t.image.height,o=fe.convert(i.format),a=fe.convert(i.type);K.setTexture2D(i,0),ve.pixelStorei(37440,i.flipY),ve.pixelStorei(37441,i.premultiplyAlpha),ve.pixelStorei(3317,i.unpackAlignment),t.isDataTexture?ve.texSubImage2D(3553,n,e.x,e.y,r,s,o,a,t.image.data):t.isCompressedTexture?ve.compressedTexSubImage2D(3553,n,e.x,e.y,t.mipmaps[0].width,t.mipmaps[0].height,o,t.mipmaps[0].data):ve.texSubImage2D(3553,n,e.x,e.y,o,a,t.image),0===n&&i.generateMipmaps&&ve.generateMipmap(3553),X.unbindTexture()},this.copyTextureToTexture3D=function(e,t,i,n,r=0){if(y.isWebGL1Renderer)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");const s=e.max.x-e.min.x+1,o=e.max.y-e.min.y+1,a=e.max.z-e.min.z+1,l=fe.convert(n.format),c=fe.convert(n.type);let h;if(n.isDataTexture3D)K.setTexture3D(n,0),h=32879;else{if(!n.isDataTexture2DArray)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");K.setTexture2DArray(n,0),h=35866}ve.pixelStorei(37440,n.flipY),ve.pixelStorei(37441,n.premultiplyAlpha),ve.pixelStorei(3317,n.unpackAlignment);const u=ve.getParameter(3314),d=ve.getParameter(32878),m=ve.getParameter(3316),p=ve.getParameter(3315),f=ve.getParameter(32877),g=i.isCompressedTexture?i.mipmaps[0]:i.image;ve.pixelStorei(3314,g.width),ve.pixelStorei(32878,g.height),ve.pixelStorei(3316,e.min.x),ve.pixelStorei(3315,e.min.y),ve.pixelStorei(32877,e.min.z),i.isDataTexture||i.isDataTexture3D?ve.texSubImage3D(h,r,t.x,t.y,t.z,s,o,a,l,c,g.data):i.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),ve.compressedTexSubImage3D(h,r,t.x,t.y,t.z,s,o,a,l,g.data)):ve.texSubImage3D(h,r,t.x,t.y,t.z,s,o,a,l,c,g),ve.pixelStorei(3314,u),ve.pixelStorei(32878,d),ve.pixelStorei(3316,m),ve.pixelStorei(3315,p),ve.pixelStorei(32877,f),0===r&&n.generateMipmaps&&ve.generateMipmap(h),X.unbindTexture()},this.initTexture=function(e){K.setTexture2D(e,0),X.unbindTexture()},this.resetState=function(){x=0,b=0,w=null,X.reset(),ge.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}Cl.prototype.isWebGLRenderer=!0;class Pl extends Cl{}Pl.prototype.isWebGL1Renderer=!0;class Ll{constructor(e,t=25e-5){this.name="",this.color=new Fr(e),this.density=t}clone(){return new Ll(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}Ll.prototype.isFogExp2=!0;class Rl{constructor(e,t=1,i=1e3){this.name="",this.color=new Fr(e),this.near=t,this.far=i}clone(){return new Rl(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}Rl.prototype.isFog=!0;class Dl extends fr{constructor(){super(),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return null!==this.fog&&(t.object.fog=this.fog.toJSON()),t}}Dl.prototype.isScene=!0;class Ol{constructor(e,t){this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=Ti,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=ki()}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,i){e*=this.stride,i*=t.stride;for(let n=0,r=this.stride;n<r;n++)this.array[e+n]=t.array[i+n];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=ki()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),i=new this.constructor(t,this.stride);return i.setUsage(this.usage),i}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=ki()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=Array.prototype.slice.call(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}Ol.prototype.isInterleavedBuffer=!0;const Il=new mn;class Fl{constructor(e,t,i,n=!1){this.name="",this.data=e,this.itemSize=t,this.offset=i,this.normalized=!0===n}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,i=this.data.count;t<i;t++)Il.x=this.getX(t),Il.y=this.getY(t),Il.z=this.getZ(t),Il.applyMatrix4(e),this.setXYZ(t,Il.x,Il.y,Il.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)Il.x=this.getX(t),Il.y=this.getY(t),Il.z=this.getZ(t),Il.applyNormalMatrix(e),this.setXYZ(t,Il.x,Il.y,Il.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)Il.x=this.getX(t),Il.y=this.getY(t),Il.z=this.getZ(t),Il.transformDirection(e),this.setXYZ(t,Il.x,Il.y,Il.z);return this}setX(e,t){return this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){return this.data.array[e*this.data.stride+this.offset]}getY(e){return this.data.array[e*this.data.stride+this.offset+1]}getZ(e){return this.data.array[e*this.data.stride+this.offset+2]}getW(e){return this.data.array[e*this.data.stride+this.offset+3]}setXY(e,t,i){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=i,this}setXYZ(e,t,i,n){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=n,this}setXYZW(e,t,i,n,r){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=n,this.data.array[e+3]=r,this}clone(e){if(void 0===e){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interlaved buffer attribute will deinterleave buffer data.");const e=[];for(let t=0;t<this.count;t++){const i=t*this.data.stride+this.offset;for(let t=0;t<this.itemSize;t++)e.push(this.data.array[i+t])}return new Nr(new this.array.constructor(e),this.itemSize,this.normalized)}return void 0===e.interleavedBuffers&&(e.interleavedBuffers={}),void 0===e.interleavedBuffers[this.data.uuid]&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new Fl(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(void 0===e){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interlaved buffer attribute will deinterleave buffer data.");const e=[];for(let t=0;t<this.count;t++){const i=t*this.data.stride+this.offset;for(let t=0;t<this.itemSize;t++)e.push(this.data.array[i+t])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:e,normalized:this.normalized}}return void 0===e.interleavedBuffers&&(e.interleavedBuffers={}),void 0===e.interleavedBuffers[this.data.uuid]&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}Fl.prototype.isInterleavedBufferAttribute=!0;class Vl extends Cr{constructor(e){super(),this.type="SpriteMaterial",this.color=new Fr(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this}}let Ul;Vl.prototype.isSpriteMaterial=!0;const Bl=new mn,Nl=new mn,zl=new mn,kl=new Yi,Gl=new Yi,jl=new Hn,Hl=new mn,Wl=new mn,ql=new mn,Xl=new Yi,Zl=new Yi,Yl=new Yi;class Kl extends fr{constructor(e){if(super(),this.type="Sprite",void 0===Ul){Ul=new ns;const e=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),t=new Ol(e,5);Ul.setIndex([0,1,2,0,2,3]),Ul.setAttribute("position",new Fl(t,3,0,!1)),Ul.setAttribute("uv",new Fl(t,2,3,!1))}this.geometry=Ul,this.material=void 0!==e?e:new Vl,this.center=new Yi(.5,.5)}raycast(e,t){null===e.camera&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),Nl.setFromMatrixScale(this.matrixWorld),jl.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),zl.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&Nl.multiplyScalar(-zl.z);const i=this.material.rotation;let n,r;0!==i&&(r=Math.cos(i),n=Math.sin(i));const s=this.center;$l(Hl.set(-.5,-.5,0),zl,s,Nl,n,r),$l(Wl.set(.5,-.5,0),zl,s,Nl,n,r),$l(ql.set(.5,.5,0),zl,s,Nl,n,r),Xl.set(0,0),Zl.set(1,0),Yl.set(1,1);let o=e.ray.intersectTriangle(Hl,Wl,ql,!1,Bl);if(null===o&&($l(Wl.set(-.5,.5,0),zl,s,Nl,n,r),Zl.set(0,1),o=e.ray.intersectTriangle(Hl,ql,Wl,!1,Bl),null===o))return;const a=e.ray.origin.distanceTo(Bl);a<e.near||a>e.far||t.push({distance:a,point:Bl.clone(),uv:Er.getUV(Bl,Hl,Wl,ql,Xl,Zl,Yl,new Yi),face:null,object:this})}copy(e){return super.copy(e),void 0!==e.center&&this.center.copy(e.center),this.material=e.material,this}}function $l(e,t,i,n,r,s){kl.subVectors(e,i).addScalar(.5).multiply(n),void 0!==r?(Gl.x=s*kl.x-r*kl.y,Gl.y=r*kl.x+s*kl.y):Gl.copy(kl),e.copy(t),e.x+=Gl.x,e.y+=Gl.y,e.applyMatrix4(jl)}Kl.prototype.isSprite=!0;const Jl=new mn,Ql=new mn;class ec extends fr{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let e=0,i=t.length;e<i;e++){const i=t[e];this.addLevel(i.object.clone(),i.distance)}return this.autoUpdate=e.autoUpdate,this}addLevel(e,t=0){t=Math.abs(t);const i=this.levels;let n;for(n=0;n<i.length&&!(t<i[n].distance);n++);return i.splice(n,0,{distance:t,object:e}),this.add(e),this}getCurrentLevel(){return this._currentLevel}getObjectForDistance(e){const t=this.levels;if(t.length>0){let i,n;for(i=1,n=t.length;i<n&&!(e<t[i].distance);i++);return t[i-1].object}return null}raycast(e,t){if(this.levels.length>0){Jl.setFromMatrixPosition(this.matrixWorld);const i=e.ray.origin.distanceTo(Jl);this.getObjectForDistance(i).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){Jl.setFromMatrixPosition(e.matrixWorld),Ql.setFromMatrixPosition(this.matrixWorld);const i=Jl.distanceTo(Ql)/e.zoom;let n,r;for(t[0].object.visible=!0,n=1,r=t.length;n<r&&i>=t[n].distance;n++)t[n-1].object.visible=!1,t[n].object.visible=!0;for(this._currentLevel=n-1;n<r;n++)t[n].object.visible=!1}}toJSON(e){const t=super.toJSON(e);!1===this.autoUpdate&&(t.object.autoUpdate=!1),t.object.levels=[];const i=this.levels;for(let e=0,n=i.length;e<n;e++){const n=i[e];t.object.levels.push({object:n.object.uuid,distance:n.distance})}return t}}const tc=new mn,ic=new ln,nc=new ln,rc=new mn,sc=new Hn;class oc extends bs{constructor(e,t){super(e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new Hn,this.bindMatrixInverse=new Hn}copy(e){return super.copy(e),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,this}bind(e,t){this.skeleton=e,void 0===t&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new ln,t=this.geometry.attributes.skinWeight;for(let i=0,n=t.count;i<n;i++){e.x=t.getX(i),e.y=t.getY(i),e.z=t.getZ(i),e.w=t.getW(i);const n=1/e.manhattanLength();n!==1/0?e.multiplyScalar(n):e.set(1,0,0,0),t.setXYZW(i,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),"attached"===this.bindMode?this.bindMatrixInverse.copy(this.matrixWorld).invert():"detached"===this.bindMode?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}boneTransform(e,t){const i=this.skeleton,n=this.geometry;ic.fromBufferAttribute(n.attributes.skinIndex,e),nc.fromBufferAttribute(n.attributes.skinWeight,e),tc.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let e=0;e<4;e++){const n=nc.getComponent(e);if(0!==n){const r=ic.getComponent(e);sc.multiplyMatrices(i.bones[r].matrixWorld,i.boneInverses[r]),t.addScaledVector(rc.copy(tc).applyMatrix4(sc),n)}}return t.applyMatrix4(this.bindMatrixInverse)}}oc.prototype.isSkinnedMesh=!0;class ac extends fr{constructor(){super(),this.type="Bone"}}ac.prototype.isBone=!0;class lc extends on{constructor(e=null,t=1,i=1,n,r,s,o,a,l=pe,c=pe,h,u){super(null,s,o,a,l,c,n,r,h,u),this.image={data:e,width:t,height:i},this.magFilter=l,this.minFilter=c,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}lc.prototype.isDataTexture=!0;const cc=new Hn,hc=new Hn;class uc{constructor(e=[],t=[]){this.uuid=ki(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.boneTextureSize=0,this.frame=-1,this.init()}init(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(16*e.length),0===t.length)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let e=0,t=this.bones.length;e<t;e++)this.boneInverses.push(new Hn)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const t=new Hn;this.bones[e]&&t.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(t)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){const t=this.bones[e];t&&t.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){const t=this.bones[e];t&&(t.parent&&t.parent.isBone?(t.matrix.copy(t.parent.matrixWorld).invert(),t.matrix.multiply(t.matrixWorld)):t.matrix.copy(t.matrixWorld),t.matrix.decompose(t.position,t.quaternion,t.scale))}}update(){const e=this.bones,t=this.boneInverses,i=this.boneMatrices,n=this.boneTexture;for(let n=0,r=e.length;n<r;n++){const r=e[n]?e[n].matrixWorld:hc;cc.multiplyMatrices(r,t[n]),cc.toArray(i,16*n)}null!==n&&(n.needsUpdate=!0)}clone(){return new uc(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(4*this.bones.length);e=qi(e),e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const i=new lc(t,e,e,Be,Le);return this.boneMatrices=t,this.boneTexture=i,this.boneTextureSize=e,this}getBoneByName(e){for(let t=0,i=this.bones.length;t<i;t++){const i=this.bones[t];if(i.name===e)return i}}dispose(){null!==this.boneTexture&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let i=0,n=e.bones.length;i<n;i++){const n=e.bones[i];let r=t[n];void 0===r&&(console.warn("THREE.Skeleton: No bone found with UUID:",n),r=new ac),this.bones.push(r),this.boneInverses.push((new Hn).fromArray(e.boneInverses[i]))}return this.init(),this}toJSON(){const e={metadata:{version:4.5,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const t=this.bones,i=this.boneInverses;for(let n=0,r=t.length;n<r;n++){const r=t[n];e.bones.push(r.uuid);const s=i[n];e.boneInverses.push(s.toArray())}return e}}class dc extends Nr{constructor(e,t,i,n=1){"number"==typeof i&&(n=i,i=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),super(e,t,i),this.meshPerAttribute=n}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}dc.prototype.isInstancedBufferAttribute=!0;const mc=new Hn,pc=new Hn,fc=[],gc=new bs;class vc extends bs{constructor(e,t,i){super(e,t),this.instanceMatrix=new dc(new Float32Array(16*i),16),this.instanceColor=null,this.count=i,this.frustumCulled=!1}copy(e){return super.copy(e),this.instanceMatrix.copy(e.instanceMatrix),null!==e.instanceColor&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,this}getColorAt(e,t){t.fromArray(this.instanceColor.array,3*e)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,16*e)}raycast(e,t){const i=this.matrixWorld,n=this.count;if(gc.geometry=this.geometry,gc.material=this.material,void 0!==gc.material)for(let r=0;r<n;r++){this.getMatrixAt(r,mc),pc.multiplyMatrices(i,mc),gc.matrixWorld=pc,gc.raycast(e,fc);for(let e=0,i=fc.length;e<i;e++){const i=fc[e];i.instanceId=r,i.object=this,t.push(i)}fc.length=0}}setColorAt(e,t){null===this.instanceColor&&(this.instanceColor=new dc(new Float32Array(3*this.instanceMatrix.count),3)),t.toArray(this.instanceColor.array,3*e)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,16*e)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"})}}vc.prototype.isInstancedMesh=!0;class yc extends Cr{constructor(e){super(),this.type="LineBasicMaterial",this.color=new Fr(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this}}yc.prototype.isLineBasicMaterial=!0;const _c=new mn,xc=new mn,bc=new Hn,wc=new jn,Mc=new Fn;class Tc extends fr{constructor(e=new ns,t=new yc){super(),this.type="Line",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),this.material=e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.isBufferGeometry)if(null===e.index){const t=e.attributes.position,i=[0];for(let e=1,n=t.count;e<n;e++)_c.fromBufferAttribute(t,e-1),xc.fromBufferAttribute(t,e),i[e]=i[e-1],i[e]+=_c.distanceTo(xc);e.setAttribute("lineDistance",new Zr(i,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else e.isGeometry&&console.error("THREE.Line.computeLineDistances() n
949o longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this}raycast(e,t){const i=this.geometry,n=this.matrixWorld,r=e.params.Line.threshold,s=i.drawRange;if(null===i.boundingSphere&&i.computeBoundingSphere(),Mc.copy(i.boundingSphere),Mc.applyMatrix4(n),Mc.radius+=r,!1===e.ray.intersectsSphere(Mc))return;bc.copy(n).invert(),wc.copy(e.ray).applyMatrix4(bc);const o=r/((this.scale.x+this.scale.y+this.scale.z)/3),a=o*o,l=new mn,c=new mn,h=new mn,u=new mn,d=this.isLineSegments?2:1;if(i.isBufferGeometry){const n=i.index,r=i.attributes.position;if(null!==n)for(let i=Math.max(0,s.start),o=Math.min(n.count,s.start+s.count)-1;i<o;i+=d){const s=n.getX(i),o=n.getX(i+1);if(l.fromBufferAttribute(r,s),c.fromBufferAttribute(r,o),wc.distanceSqToSegment(l,c,u,h)>a)continue;u.applyMatrix4(this.matrixWorld);const d=e.ray.origin.distanceTo(u);d<e.near||d>e.far||t.push({distance:d,point:h.clone().applyMatrix4(this.matrixWorld),index:i,face:null,faceIndex:null,object:this})}else for(let i=Math.max(0,s.start),n=Math.min(r.count,s.start+s.count)-1;i<n;i+=d){if(l.fromBufferAttribute(r,i),c.fromBufferAttribute(r,i+1),wc.distanceSqToSegment(l,c,u,h)>a)continue;u.applyMatrix4(this.matrixWorld);const n=e.ray.origin.distanceTo(u);n<e.near||n>e.far||t.push({distance:n,point:h.clone().applyMatrix4(this.matrixWorld),index:i,face:null,faceIndex:null,object:this})}}else i.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){const e=this.geometry;if(e.isBufferGeometry){const t=e.morphAttributes,i=Object.keys(t);if(i.length>0){const e=t[i[0]];if(void 0!==e){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,i=e.length;t<i;t++){const i=e[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[i]=t}}}}else{const t=e.morphTargets;void 0!==t&&t.length>0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}Tc.prototype.isLine=!0;const Sc=new mn,Ec=new mn;class Ac extends Tc{constructor(e,t){super(e,t),this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.isBufferGeometry)if(null===e.index){const t=e.attributes.position,i=[];for(let e=0,n=t.count;e<n;e+=2)Sc.fromBufferAttribute(t,e),Ec.fromBufferAttribute(t,e+1),i[e]=0===e?0:i[e-1],i[e+1]=i[e]+Sc.distanceTo(Ec);e.setAttribute("lineDistance",new Zr(i,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else e.isGeometry&&console.error("THREE.LineSegments.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this}}Ac.prototype.isLineSegments=!0;class Cc extends Tc{constructor(e,t){super(e,t),this.type="LineLoop"}}Cc.prototype.isLineLoop=!0;class Pc extends Cr{constructor(e){super(),this.type="PointsMaterial",this.color=new Fr(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this}}Pc.prototype.isPointsMaterial=!0;const Lc=new Hn,Rc=new jn,Dc=new Fn,Oc=new mn;class Ic extends fr{constructor(e=new ns,t=new Pc){super(),this.type="Points",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),this.material=e.material,this.geometry=e.geometry,this}raycast(e,t){const i=this.geometry,n=this.matrixWorld,r=e.params.Points.threshold,s=i.drawRange;if(null===i.boundingSphere&&i.computeBoundingSphere(),Dc.copy(i.boundingSphere),Dc.applyMatrix4(n),Dc.radius+=r,!1===e.ray.intersectsSphere(Dc))return;Lc.copy(n).invert(),Rc.copy(e.ray).applyMatrix4(Lc);const o=r/((this.scale.x+this.scale.y+this.scale.z)/3),a=o*o;if(i.isBufferGeometry){const r=i.index,o=i.attributes.position;if(null!==r)for(let i=Math.max(0,s.start),l=Math.min(r.count,s.start+s.count);i<l;i++){const s=r.getX(i);Oc.fromBufferAttribute(o,s),Fc(Oc,s,a,n,e,t,this)}else for(let i=Math.max(0,s.start),r=Math.min(o.count,s.start+s.count);i<r;i++)Oc.fromBufferAttribute(o,i),Fc(Oc,i,a,n,e,t,this)}else console.error("THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){const e=this.geometry;if(e.isBufferGeometry){const t=e.morphAttributes,i=Object.keys(t);if(i.length>0){const e=t[i[0]];if(void 0!==e){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,i=e.length;t<i;t++){const i=e[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[i]=t}}}}else{const t=e.morphTargets;void 0!==t&&t.length>0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}function Fc(e,t,i,n,r,s,o){const a=Rc.distanceSqToPoint(e);if(a<i){const i=new mn;Rc.closestPointToPoint(e,i),i.applyMatrix4(n);const l=r.ray.origin.distanceTo(i);if(l<r.near||l>r.far)return;s.push({distance:l,distanceToRay:Math.sqrt(a),point:i,index:t,face:null,object:o})}}Ic.prototype.isPoints=!0;class Vc extends on{constructor(e,t,i,n,r,s,o,a,l){super(e,t,i,n,r,s,o,a,l),this.format=void 0!==o?o:Ue,this.minFilter=void 0!==s?s:_e,this.magFilter=void 0!==r?r:_e,this.generateMipmaps=!1;const c=this;"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback((function t(){c.needsUpdate=!0,e.requestVideoFrameCallback(t)}))}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;!1=="requestVideoFrameCallback"in e&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}Vc.prototype.isVideoTexture=!0;class Uc extends on{constructor(e,t,i,n,r,s,o,a,l,c,h,u){super(null,s,o,a,l,c,n,r,h,u),this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}Uc.prototype.isCompressedTexture=!0;class Bc extends on{constructor(e,t,i,n,r,s,o,a,l){super(e,t,i,n,r,s,o,a,l),this.needsUpdate=!0}}Bc.prototype.isCanvasTexture=!0;class Nc extends on{constructor(e,t,i,n,r,s,o,a,l,c){if((c=void 0!==c?c:Ge)!==Ge&&c!==je)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===i&&c===Ge&&(i=Ae),void 0===i&&c===je&&(i=Fe),super(null,n,r,s,o,a,c,i,l),this.image={width:e,height:t},this.magFilter=void 0!==o?o:pe,this.minFilter=void 0!==a?a:pe,this.flipY=!1,this.generateMipmaps=!1}}Nc.prototype.isDepthTexture=!0;class zc extends ns{constructor(e=1,t=8,i=0,n=2*Math.PI){super(),this.type="CircleGeometry",this.parameters={radiu
vendor: 2,236 bytes, line 949
949s:e,segments:t,thetaStart:i,thetaLength:n},t=Math.max(3,t);const r=[],s=[],o=[],a=[],l=new mn,c=new Yi;s.push(0,0,0),o.push(0,0,1),a.push(.5,.5);for(let r=0,h=3;r<=t;r++,h+=3){const u=i+r/t*n;l.x=e*Math.cos(u),l.y=e*Math.sin(u),s.push(l.x,l.y,l.z),o.push(0,0,1),c.x=(s[h]/e+1)/2,c.y=(s[h+1]/e+1)/2,a.push(c.x,c.y)}for(let e=1;e<=t;e++)r.push(e,e+1,0);this.setIndex(r),this.setAttribute("position",new Zr(s,3)),this.setAttribute("normal",new Zr(o,3)),this.setAttribute("uv",new Zr(a,2))}static fromJSON(e){return new zc(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class kc extends ns{constructor(e=1,t=1,i=1,n=8,r=1,s=!1,o=0,a=2*Math.PI){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:i,radialSegments:n,heightSegments:r,openEnded:s,thetaStart:o,thetaLength:a};const l=this;n=Math.floor(n),r=Math.floor(r);const c=[],h=[],u=[],d=[];let m=0;const p=[],f=i/2;let g=0;function v(i){const r=m,s=new Yi,p=new mn;let v=0;const y=!0===i?e:t,_=!0===i?1:-1;for(let e=1;e<=n;e++)h.push(0,f*_,0),u.push(0,_,0),d.push(.5,.5),m++;const x=m;for(let e=0;e<=n;e++){const t=e/n*a+o,i=Math.cos(t),r=Math.sin(t);p.x=y*r,p.y=f*_,p.z=y*i,h.push(p.x,p.y,p.z),u.push(0,_,0),s.x=.5*i+.5,s.y=.5*r*_+.5,d.push(s.x,s.y),m++}for(let e=0;e<n;e++){const t=r+e,n=x+e;!0===i?c.push(n,n+1,t):c.push(n+1,n,t),v+=3}l.addGroup(g,v,!0===i?1:2),g+=v}!function(){const s=new mn,v=new mn;let y=0;const _=(t-e)/i;for(let l=0;l<=r;l++){const c=[],g=l/r,y=g*(t-e)+e;for(let e=0;e<=n;e++){const t=e/n,r=t*a+o,l=Math.sin(r),p=Math.cos(r);v.x=y*l,v.y=-g*i+f,v.z=y*p,h.push(v.x,v.y,v.z),s.set(l,_,p).normalize(),u.push(s.x,s.y,s.z),d.push(t,1-g),c.push(m++)}p.push(c)}for(let e=0;e<n;e++)for(let t=0;t<r;t++){const i=p[t][e],n=p[t+1][e],r=p[t+1][e+1],s=p[t][e+1];c.push(i,n,s),c.push(n,r,s),y+=6}l.addGroup(g,y,0),g+=y}(),!1===s&&(e>0&&v(!0),t>0&&v(!1)),this.setIndex(c),this.setAttribute("position",new Zr(h,3)),this.setAttribute("normal",new Zr(u,3)),this.setAttribute("uv",new Zr(d,2))}static fromJSON(e){return new kc(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class Gc extends kc{constructor(e=1,t=1,i=8,n=1,r=!1,s=0,o=2*Math.PI){super(0,e,t,i,n,r,s,o),this.type="C
949oneGeometry",this.parameters={radius:e,height:t,radialSegments:i,heightSegments:n,openEnded:r,thetaStart:s,thetaLength:o}}static fromJSON(e){return new Gc(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class jc extends ns{constructor(e=[],t=[],i=1,n=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:i,detail:n};const r=[],s=[];function o(e,t,i,n){const r=n+1,s=[];for(let n=0;n<=r;n++){s[n]=[];const o=e.clone().lerp(i,n/r),a=t.clone().lerp(i,n/r),l=r-n;for(let e=0;e<=l;e++)s[n][e]=0===e&&n===r?o:o.clone().lerp(a,e/l)}for(let e=0;e<r;e++)for(let t=0;t<2*(r-e)-1;t++){const i=Math.floor(t/2);t%2==0?(a(s[e][i+1]),a(s[e+1][i]),a(s[e][i])):(a(s[e][i+1]),a(s[e+1][i+1]),a(s[e+1][i]))}}function a(e){r.push(e.x,e.y,e.z)}function l(t,i){const n=3*t;i.x=e[n+0],i.y=e[n+1],i.z=e[n+2]}function c(e,t,i,n){n<0&&1===e.x&&(s[t]=e.x-1),0===i.x&&0===i.z&&(s[t]=n/2/Math.PI+.5)}function h(e){return Math.atan2(e.z,-e.x)}!function(e){const i=new mn,n=new mn,r=new mn;for(let s=0;s<t.length;s+=3)l(t[s+0],i),l(t[s+1],n),l(t[s+2],r),o(i,n,r,e)}(n),function(e){const t=new mn;for(let i=0;i<r.length;i+=3)t.x=r[i+0],t.y=r[i+1],t.z=r[i+2],t.normalize().multiplyScalar(e),r[i+0]=t.x,r[i+1]=t.y,r[i+2]=t.z}(i),function(){const e=new mn;for(let i=0;i<r.length;i+=3){e.x=r[i+0],e.y=r[i+1],e.z=r[i+2];const n=h(e)/2/Math.PI+.5,o=(t=e,Math.atan2(-t.y,Math.sqrt(t.x*t.x+t.z*t.z))/Math.PI+.5);s.push(n,1-o)}var t;(function(){const e=new mn,t=new mn,i=new mn,n=new mn,o=new Yi,a=new Yi,l=new Yi;for(let u=0,d=0;u<r.length;u+=9,d+=6){e.set(r[u+0],r[u+1],r[u+2]),t.set(r[u+3],r[u+4],r[u+5]),i.set(r[u+6],r[u+7],r[u+8]),o.set(s[d+0],s[d+1]),a.set(s[d+2],s[d+3]),l.set(s[d+4],s[d+5]),n.copy(e).add(t).add(i).divideScalar(3);const m=h(n);c(o,d+0,e,m),c(a,d+2,t,m),c(l,d+4,i,m)}})(),function(){for(let e=0;e<s.length;e+=6){const t=s[e+0],i=s[e+2],n=s[e+4],r=Math.max(t,i,n),o=Math.min(t,i,n);r>.9&&o<.1&&(t<.2&&(s[e+0]+=1),i<.2&&(s[e+2]+=1),n<.2&&(s[e+4]+=1))}}()}(),this.setAttribute("position",new Zr(r,3)),this.setAttribute("normal",new Zr(r.slice(),3)),this.setAttribute("uv",new Zr(s,2)),0===n?this.computeVertexNormals():this.normalizeNormals()}static fromJSON(e){return new jc(e.vertices,e.indices,e.radius,e.details)}}class Hc extends jc{constructor(e=1,t=0){const i=(1+Math.sqrt(5))/2,n=1/i;super([-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-n,-i,0,-n,i,0,n,-i,0,n,i,-n,-i,0,-n,i,0,n,-i,0,n,i,0,-i,0,-n,i,0,-n,-i,0,n,i,0,n],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,
vendor: 126,721 bytes, line 949
94919,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],e,t),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Hc(e.radius,e.detail)}}const Wc=new mn,qc=new mn,Xc=new mn,Zc=new Er;class Yc extends ns{constructor(e=null,t=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:e,thresholdAngle:t},null!==e){const i=4,n=Math.pow(10,i),r=Math.cos(Ui*t),s=e.getIndex(),o=e.getAttribute("position"),a=s?s.count:o.count,l=[0,0,0],c=["a","b","c"],h=new Array(3),u={},d=[];for(let e=0;e<a;e+=3){s?(l[0]=s.getX(e),l[1]=s.getX(e+1),l[2]=s.getX(e+2)):(l[0]=e,l[1]=e+1,l[2]=e+2);const{a:t,b:i,c:a}=Zc;if(t.fromBufferAttribute(o,l[0]),i.fromBufferAttribute(o,l[1]),a.fromBufferAttribute(o,l[2]),Zc.getNormal(Xc),h[0]=`${Math.round(t.x*n)},${Math.round(t.y*n)},${Math.round(t.z*n)}`,h[1]=`${Math.round(i.x*n)},${Math.round(i.y*n)},${Math.round(i.z*n)}`,h[2]=`${Math.round(a.x*n)},${Math.round(a.y*n)},${Math.round(a.z*n)}`,h[0]!==h[1]&&h[1]!==h[2]&&h[2]!==h[0])for(let e=0;e<3;e++){const t=(e+1)%3,i=h[e],n=h[t],s=Zc[c[e]],o=Zc[c[t]],a=`${i}_${n}`,m=`${n}_${i}`;m in u&&u[m]?(Xc.dot(u[m].normal)<=r&&(d.push(s.x,s.y,s.z),d.push(o.x,o.y,o.z)),u[m]=null):a in u||(u[a]={index0:l[e],index1:l[t],normal:Xc.clone()})}}for(const e in u)if(u[e]){const{index0:t,index1:i}=u[e];Wc.fromBufferAttribute(o,t),qc.fromBufferAttribute(o,i),d.push(Wc.x,Wc.y,Wc.z),d.push(qc.x,qc.y,qc.z)}this.setAttribute("position",new Zr(d,3))}}}class Kc{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const i=this.getUtoTmapping(e);return this.getPoint(i,t)}getPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return t}getSpacedPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPointAt(i/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let i,n=this.getPoint(0),r=0;t.push(0);for(let s=1;s<=e;s++)i=this.getPoint(s/e),r+=i.distanceTo(n),t.push(r),n=i;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const i=this.getLengths();let n=0;const r=i.length;let s;s=t||e*i[r-1];let o,a=0,l=r-1;for(;a<=l;)if(n=Math.floor(a+(l-a)/2),o=i[n]-s,o<0)a=n+1;else{if(!(o>0)){l=n;break}l=n-1}if(n=l,i[n]===s)return n/(r-1);const c=i[n];return(n+(s-c)/(i[n+1]-c))/(r-1)}getTangent(e,t){const i=1e-4;let n=e-i,r=e+i;n<0&&(n=0),r>1&&(r=1);const s=this.getPoint(n),o=this.getPoint(r),a=t||(s.isVector2?new Yi:new mn);return a.copy(o).sub(s).normalize(),a}getTangentAt(e,t){const i=this.getUtoTmapping(e);return this.getTangent(i,t)}computeFrenetFrames(e,t){const i=new mn,n=[],r=[],s=[],o=new mn,a=new Hn;for(let t=0;t<=e;t++){const i=t/e;n[t]=this.getTangentAt(i,new mn)}r[0]=new mn,s[0]=new mn;let l=Number.MAX_VALUE;const c=Math.abs(n[0].x),h=Math.abs(n[0].y),u=Math.abs(n[0].z);c<=l&&(l=c,i.set(1,0,0)),h<=l&&(l=h,i.set(0,1,0)),u<=l&&i.set(0,0,1),o.crossVectors(n[0],i).normalize(),r[0].crossVectors(n[0],o),s[0].crossVectors(n[0],r[0]);for(let t=1;t<=e;t++){if(r[t]=r[t-1].clone(),s[t]=s[t-1].clone(),o.crossVectors(n[t-1],n[t]),o.length()>Number.EPSILON){o.normalize();const e=Math.acos(Gi(n[t-1].dot(n[t]),-1,1));r[t].applyMatrix4(a.makeRotationAxis(o,e))}s[t].crossVectors(n[t],r[t])}if(!0===t){let t=Math.acos(Gi(r[0].dot(r[e]),-1,1));t/=e,n[0].dot(o.crossVectors(r[0],r[e]))>0&&(t=-t);for(let i=1;i<=e;i++)r[i].applyMatrix4(a.makeRotationAxis(n[i],t*i)),s[i].crossVectors(n[i],r[i])}return{tangents:n,normals:r,binormals:s}}clone(){return(new this.constructor).copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class $c extends Kc{constructor(e=0,t=0,i=1,n=1,r=0,s=2*Math.PI,o=!1,a=0){super(),this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=i,this.yRadius=n,this.aStartAngle=r,this.aEndAngle=s,this.aClockwise=o,this.aRotation=a}getPoint(e,t){const i=t||new Yi,n=2*Math.PI;let r=this.aEndAngle-this.aStartAngle;const s=Math.abs(r)<Number.EPSILON;for(;r<0;)r+=n;for(;r>n;)r-=n;r<Number.EPSILON&&(r=s?0:n),!0!==this.aClockwise||s||(r===n?r=-n:r-=n);const o=this.aStartAngle+e*r;let a=this.aX+this.xRadius*Math.cos(o),l=this.aY+this.yRadius*Math.sin(o);if(0!==this.aRotation){const e=Math.cos(this.aRotation),t=Math.sin(this.aRotation),i=a-this.aX,n=l-this.aY;a=i*e-n*t+this.aX,l=i*t+n*e+this.aY}return i.set(a,l)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){const e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}}$c.prototype.isEllipseCurve=!0;class Jc extends $c{constructor(e,t,i,n,r,s){super(e,t,i,i,n,r,s),this.type="ArcCurve"}}function Qc(){let e=0,t=0,i=0,n=0;function r(r,s,o,a){e=r,t=o,i=-3*r+3*s-2*o-a,n=2*r-2*s+o+a}return{initCatmullRom:function(e,t,i,n,s){r(t,i,s*(i-e),s*(n-t))},initNonuniformCatmullRom:function(e,t,i,n,s,o,a){let l=(t-e)/s-(i-e)/(s+o)+(i-t)/o,c=(i-t)/o-(n-t)/(o+a)+(n-i)/a;l*=o,c*=o,r(t,i,l,c)},calc:function(r){const s=r*r;return e+t*r+i*s+n*(s*r)}}}Jc.prototype.isArcCurve=!0;const eh=new mn,th=new Qc,ih=new Qc,nh=new Qc;class rh extends Kc{constructor(e=[],t=!1,i="centripetal",n=.5){super(),this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=i,this.tension=n}getPoint(e,t=new mn){const i=t,n=this.points,r=n.length,s=(r-(this.closed?0:1))*e;let o,a,l=Math.floor(s),c=s-l;this.closed?l+=l>0?0:(Math.floor(Math.abs(l)/r)+1)*r:0===c&&l===r-1&&(l=r-2,c=1),this.closed||l>0?o=n[(l-1)%r]:(eh.subVectors(n[0],n[1]).add(n[0]),o=eh);const h=n[l%r],u=n[(l+1)%r];if(this.closed||l+2<r?a=n[(l+2)%r]:(eh.subVectors(n[r-1],n[r-2]).add(n[r-1]),a=eh),"centripetal"===this.curveType||"chordal"===this.curveType){const e="chordal"===this.curveType?.5:.25;let t=Math.pow(o.distanceToSquared(h),e),i=Math.pow(h.distanceToSquared(u),e),n=Math.pow(u.distanceToSquared(a),e);i<1e-4&&(i=1),t<1e-4&&(t=i),n<1e-4&&(n=i),th.initNonuniformCatmullRom(o.x,h.x,u.x,a.x,t,i,n),ih.initNonuniformCatmullRom(o.y,h.y,u.y,a.y,t,i,n),nh.initNonuniformCatmullRom(o.z,h.z,u.z,a.z,t,i,n)}else"catmullrom"===this.curveType&&(th.initCatmullRom(o.x,h.x,u.x,a.x,this.tension),ih.initCatmullRom(o.y,h.y,u.y,a.y,this.tension),nh.initCatmullRom(o.z,h.z,u.z,a.z,this.tension));return i.set(th.calc(c),ih.calc(c),nh.calc(c)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){const i=e.points[t];this.points.push(i.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,i=this.points.length;t<i;t++){const i=this.points[t];e.points.push(i.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){const i=e.points[t];this.points.push((new mn).fromArray(i))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}function sh(e,t,i,n,r){const s=.5*(n-t),o=.5*(r-i),a=e*e;return(2*i-2*n+s+o)*(e*a)+(-3*i+3*n-2*s-o)*a+s*e+i}function oh(e,t,i,n){return function(e,t){const i=1-e;return i*i*t}(e,t)+function(e,t){return 2*(1-e)*e*t}(e,i)+function(e,t){return e*e*t}(e,n)}function ah(e,t,i,n,r){return function(e,t){const i=1-e;return i*i*i*t}(e,t)+function(e,t){const i=1-e;return 3*i*i*e*t}(e,i)+function(e,t){return 3*(1-e)*e*e*t}(e,n)+function(e,t){return e*e*e*t}(e,r)}rh.prototype.isCatmullRomCurve3=!0;class lh extends Kc{constructor(e=new Yi,t=new Yi,i=new Yi,n=new Yi){super(),this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=i,this.v3=n}getPoint(e,t=new Yi){const i=t,n=this.v0,r=this.v1,s=this.v2,o=this.v3;return i.set(ah(e,n.x,r.x,s.x,o.x),ah(e,n.y,r.y,s.y,o.y)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}lh.prototype.isCubicBezierCurve=!0;class ch extends Kc{constructor(e=new mn,t=new mn,i=new mn,n=new mn){super(),this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=i,this.v3=n}getPoint(e,t=new mn){const i=t,n=this.v0,r=this.v1,s=this.v2,o=this.v3;return i.set(ah(e,n.x,r.x,s.x,o.x),ah(e,n.y,r.y,s.y,o.y),ah(e,n.z,r.z,s.z,o.z)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}ch.prototype.isCubicBezierCurve3=!0;class hh extends Kc{constructor(e=new Yi,t=new Yi){super(),this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new Yi){const i=t;return 1===e?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(e).add(this.v1)),i}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t){const i=t||new Yi;return i.copy(this.v2).sub(this.v1).normalize(),i}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}hh.prototype.isLineCurve=!0;class uh extends Kc{constructor(e=new mn,t=new mn){super(),this.type="LineCurve3",this.isLineCurve3=!0,this.v1=e,this.v2=t}getPoint(e,t=new mn){const i=t;return 1===e?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(e).add(this.v1)),i}getPointAt(e,t){return this.getPoint(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class dh extends Kc{constructor(e=new Yi,t=new Yi,i=new Yi){super(),this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=i}getPoint(e,t=new Yi){const i=t,n=this.v0,r=this.v1,s=this.v2;return i.set(oh(e,n.x,r.x,s.x),oh(e,n.y,r.y,s.y)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}dh.prototype.isQuadraticBezierCurve=!0;class mh extends Kc{constructor(e=new mn,t=new mn,i=new mn){super(),this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=i}getPoint(e,t=new mn){const i=t,n=this.v0,r=this.v1,s=this.v2;return i.set(oh(e,n.x,r.x,s.x),oh(e,n.y,r.y,s.y),oh(e,n.z,r.z,s.z)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}mh.prototype.isQuadraticBezierCurve3=!0;class ph extends Kc{constructor(e=[]){super(),this.type="SplineCurve",this.points=e}getPoint(e,t=new Yi){const i=t,n=this.points,r=(n.length-1)*e,s=Math.floor(r),o=r-s,a=n[0===s?s:s-1],l=n[s],c=n[s>n.length-2?n.length-1:s+1],h=n[s>n.length-3?n.length-1:s+2];return i.set(sh(o,a.x,l.x,c.x,h.x),sh(o,a.y,l.y,c.y,h.y)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){const i=e.points[t];this.points.push(i.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,i=this.points.length;t<i;t++){const i=this.points[t];e.points.push(i.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){const i=e.points[t];this.points.push((new Yi).fromArray(i))}return this}}ph.prototype.isSplineCurve=!0;var fh=Object.freeze({__proto__:null,ArcCurve:Jc,CatmullRomCurve3:rh,CubicBezierCurve:lh,CubicBezierCurve3:ch,EllipseCurve:$c,LineCurve:hh,LineCurve3:uh,QuadraticBezierCurve:dh,QuadraticBezierCurve3:mh,SplineCurve:ph});class gh extends Kc{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){const e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new hh(t,e))}getPoint(e,t){const i=e*this.getLength(),n=this.getCurveLengths();let r=0;for(;r<n.length;){if(n[r]>=i){const e=n[r]-i,s=this.curves[r],o=s.getLength(),a=0===o?0:1-e/o;return s.getPointAt(a,t)}r++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let i=0,n=this.curves.length;i<n;i++)t+=this.curves[i].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(e=40){const t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return this.autoClose&&t.push(t[0]),t}getPoints(e=12){const t=[];let i;for(let n=0,r=this.curves;n<r.length;n++){const s=r[n],o=s&&s.isEllipseCurve?2*e:s&&(s.isLineCurve||s.isLineCurve3)?1:s&&s.isSplineCurve?e*s.points.length:e,a=s.getPoints(o);for(let e=0;e<a.length;e++){const n=a[e];i&&i.equals(n)||(t.push(n),i=n)}}return this.autoClose&&t.length>1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,i=e.curves.length;t<i;t++){const i=e.curves[t];this.curves.push(i.clone())}return this.autoClose=e.autoClose,this}toJSON(){const e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,i=this.curves.length;t<i;t++){const i=this.curves[t];e.curves.push(i.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,i=e.curves.length;t<i;t++){const i=e.curves[t];this.curves.push((new fh[i.type]).fromJSON(i))}return this}}class vh extends gh{constructor(e){super(),this.type="Path",this.currentPoint=new Yi,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,i=e.length;t<i;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){const i=new hh(this.currentPoint.clone(),new Yi(e,t));return this.curves.push(i),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,i,n){const r=new dh(this.currentPoint.clone(),new Yi(e,t),new Yi(i,n));return this.curves.push(r),this.currentPoint.set(i,n),this}bezierCurveTo(e,t,i,n,r,s){const o=new lh(this.currentPoint.clone(),new Yi(e,t),new Yi(i,n),new Yi(r,s));return this.curves.push(o),this.currentPoint.set(r,s),this}splineThru(e){const t=[this.currentPoint.clone()].concat(e),i=new ph(t);return this.curves.push(i),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,i,n,r,s){const o=this.currentPoint.x,a=this.currentPoint.y;return this.absarc(e+o,t+a,i,n,r,s),this}absarc(e,t,i,n,r,s){return this.absellipse(e,t,i,i,n,r,s),this}ellipse(e,t,i,n,r,s,o,a){const l=this.currentPoint.x,c=this.currentPoint.y;return this.absellipse(e+l,t+c,i,n,r,s,o,a),this}absellipse(e,t,i,n,r,s,o,a){const l=new $c(e,t,i,n,r,s,o,a);if(this.curves.length>0){const e=l.getPoint(0);e.equals(this.currentPoint)||this.lineTo(e.x,e.y)}this.curves.push(l);const c=l.getPoint(1);return this.currentPoint.copy(c),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class yh extends vh{constructor(e){super(e),this.uuid=ki(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let i=0,n=this.holes.length;i<n;i++)t[i]=this.holes[i].getPoints(e);return t}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let t=0,i=e.holes.length;t<i;t++){const i=e.holes[t];this.holes.push(i.clone())}return this}toJSON(){const e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,i=this.holes.length;t<i;t++){const i=this.holes[t];e.holes.push(i.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,i=e.holes.length;t<i;t++){const i=e.holes[t];this.holes.push((new vh).fromJSON(i))}return this}}function _h(e,t,i,n,r){let s,o;if(r===function(e,t,i,n){let r=0;for(let s=t,o=i-n;s<i;s+=n)r+=(e[o]-e[s])*(e[s+1]+e[o+1]),o=s;return r}(e,t,i,n)>0)for(s=t;s<i;s+=n)o=zh(s,e[s],e[s+1],o);else for(s=i-n;s>=t;s-=n)o=zh(s,e[s],e[s+1],o);return o&&Ih(o,o.next)&&(kh(o),o=o.next),o}function xh(e,t){if(!e)return e;t||(t=e);let i,n=e;do{if(i=!1,n.steiner||!Ih(n,n.next)&&0!==Oh(n.prev,n,n.next))n=n.next;else{if(kh(n),n=t=n.prev,n===n.next)break;i=!0}}while(i||n!==t);return t}function bh(e,t,i,n,r,s,o){if(!e)return;!o&&s&&function(e,t,i,n){let r=e;do{null===r.z&&(r.z=Ph(r.x,r.y,t,i,n)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,function(e){let t,i,n,r,s,o,a,l,c=1;do{for(i=e,e=null,s=null,o=0;i;){for(o++,n=i,a=0,t=0;t<c&&(a++,n=n.nextZ,n);t++);for(l=c;a>0||l>0&&n;)0!==a&&(0===l||!n||i.z<=n.z)?(r=i,i=i.nextZ,a--):(r=n,n=n.nextZ,l--),s?s.nextZ=r:e=r,r.prevZ=s,s=r;i=n}s.nextZ=null,c*=2}while(o>1)}(r)}(e,n,r,s);let a,l,c=e;for(;e.prev!==e.next;)if(a=e.prev,l=e.next,s?Mh(e,n,r,s):wh(e))t.push(a.i/i),t.push(e.i/i),t.push(l.i/i),kh(e),e=l.next,c=l.next;else if((e=l)===c){o?1===o?bh(e=Th(xh(e),t,i),t,i,n,r,s,2):2===o&&Sh(e,t,i,n,r,s):bh(xh(e),t,i,n,r,s,1);break}}function wh(e){const t=e.prev,i=e,n=e.next;if(Oh(t,i,n)>=0)return!1;let r=e.next.next;for(;r!==e.prev;){if(Rh(t.x,t.y,i.x,i.y,n.x,n.y,r.x,r.y)&&Oh(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function Mh(e,t,i,n){const r=e.prev,s=e,o=e.next;if(Oh(r,s,o)>=0)return!1;const a=r.x<s.x?r.x<o.x?r.x:o.x:s.x<o.x?s.x:o.x,l=r.y<s.y?r.y<o.y?r.y:o.y:s.y<o.y?s.y:o.y,c=r.x>s.x?r.x>o.x?r.x:o.x:s.x>o.x?s.x:o.x,h=r.y>s.y?r.y>o.y?r.y:o.y:s.y>o.y?s.y:o.y,u=Ph(a,l,t,i,n),d=Ph(c,h,t,i,n);let m=e.prevZ,p=e.nextZ;for(;m&&m.z>=u&&p&&p.z<=d;){if(m!==e.prev&&m!==e.next&&Rh(r.x,r.y,s.x,s.y,o.x,o.y,m.x,m.y)&&Oh(m.prev,m,m.next)>=0)return!1;if(m=m.prevZ,p!==e.prev&&p!==e.next&&Rh(r.x,r.y,s.x,s.y,o.x,o.y,p.x,p.y)&&Oh(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(;m&&m.z>=u;){if(m!==e.prev&&m!==e.next&&Rh(r.x,r.y,s.x,s.y,o.x,o.y,m.x,m.y)&&Oh(m.prev,m,m.next)>=0)return!1;m=m.prevZ}for(;p&&p.z<=d;){if(p!==e.prev&&p!==e.next&&Rh(r.x,r.y,s.x,s.y,o.x,o.y,p.x,p.y)&&Oh(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function Th(e,t,i){let n=e;do{const r=n.prev,s=n.next.next;!Ih(r,s)&&Fh(r,n,n.next,s)&&Bh(r,s)&&Bh(s,r)&&(t.push(r.i/i),t.push(n.i/i),t.push(s.i/i),kh(n),kh(n.next),n=e=s),n=n.next}while(n!==e);return xh(n)}function Sh(e,t,i,n,r,s){let o=e;do{let e=o.next.next;for(;e!==o.prev;){if(o.i!==e.i&&Dh(o,e)){let a=Nh(o,e);return o=xh(o,o.next),a=xh(a,a.next),bh(o,t,i,n,r,s),void bh(a,t,i,n,r,s)}e=e.next}o=o.next}while(o!==e)}function Eh(e,t){return e.x-t.x}function Ah(e,t){if(t=function(e,t){let i=t;const n=e.x,r=e.y;let s,o=-1/0;do{if(r<=i.y&&r>=i.next.y&&i.next.y!==i.y){const e=i.x+(r-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(e<=n&&e>o){if(o=e,e===n){if(r===i.y)return i;if(r===i.next.y)return i.next}s=i.x<i.next.x?i:i.next}}i=i.next}while(i!==t);if(!s)return null;if(n===o)return s;const a=s,l=s.x,c=s.y;let h,u=1/0;i=s;do{n>=i.x&&i.x>=l&&n!==i.x&&Rh(r<c?n:o,r,l,c,r<c?o:n,r,i.x,i.y)&&(h=Math.abs(r-i.y)/(n-i.x),Bh(i,e)&&(h<u||h===u&&(i.x>s.x||i.x===s.x&&Ch(s,i)))&&(s=i,u=h)),i=i.next}while(i!==a);return s}(e,t),t){const i=Nh(t,e);xh(t,t.next),xh(i,i.next)}}function Ch(e,t){return Oh(e.prev,e,t.prev)<0&&Oh(t.next,e,e.next)<0}function Ph(e,t,i,n,r){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*r)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*r)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function Lh(e){let t=e,i=e;do{(t.x<i.x||t.x===i.x&&t.y<i.y)&&(i=t),t=t.next}while(t!==e);return i}function Rh(e,t,i,n,r,s,o,a){return(r-o)*(t-a)-(e-o)*(s-a)>=0&&(e-o)*(n-a)-(i-o)*(t-a)>=0&&(i-o)*(s-a)-(r-o)*(n-a)>=0}function Dh(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){let i=e;do{if(i.i!==e.i&&i.next.i!==e.i&&i.i!==t.i&&i.next.i!==t.i&&Fh(i,i.next,e,t))return!0;i=i.next}while(i!==e);return!1}(e,t)&&(Bh(e,t)&&Bh(t,e)&&function(e,t){let i=e,n=!1;const r=(e.x+t.x)/2,s=(e.y+t.y)/2;do{i.y>s!=i.next.y>s&&i.next.y!==i.y&&r<(i.next.x-i.x)*(s-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==e);return n}(e,t)&&(Oh(e.prev,e,t.prev)||Oh(e,t.prev,t))||Ih(e,t)&&Oh(e.prev,e,e.next)>0&&Oh(t.prev,t,t.next)>0)}function Oh(e,t,i){return(t.y-e.y)*(i.x-t.x)-(t.x-e.x)*(i.y-t.y)}function Ih(e,t){return e.x===t.x&&e.y===t.y}function Fh(e,t,i,n){const r=Uh(Oh(e,t,i)),s=Uh(Oh(e,t,n)),o=Uh(Oh(i,n,e)),a=Uh(Oh(i,n,t));return r!==s&&o!==a||!(0!==r||!Vh(e,i,t))||!(0!==s||!Vh(e,n,t))||!(0!==o||!Vh(i,e,n))||!(0!==a||!Vh(i,t,n))}function Vh(e,t,i){return t.x<=Math.max(e.x,i.x)&&t.x>=Math.min(e.x,i.x)&&t.y<=Math.max(e.y,i.y)&&t.y>=Math.min(e.y,i.y)}function Uh(e){return e>0?1:e<0?-1:0}function Bh(e,t){return Oh(e.prev,e,e.next)<0?Oh(e,t,e.next)>=0&&Oh(e,e.prev,t)>=0:Oh(e,t,e.prev)<0||Oh(e,e.next,t)<0}function Nh(e,t){const i=new Gh(e.i,e.x,e.y),n=new Gh(t.i,t.x,t.y),r=e.next,s=t.prev;return e.next=t,t.prev=e,i.next=r,r.prev=i,n.next=i,i.prev=n,s.next=n,n.prev=s,n}function zh(e,t,i,n){const r=new Gh(e,t,i);return n?(r.next=n.next,r.prev=n,n.next.prev=r,n.next=r):(r.prev=r,r.next=r),r}function kh(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 Gh(e,t,i){this.i=e,this.x=t,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}class jh{static area(e){const t=e.length;let i=0;for(let n=t-1,r=0;r<t;n=r++)i+=e[n].x*e[r].y-e[r].x*e[n].y;return.5*i}static isClockWise(e){return jh.area(e)<0}static triangulateShape(e,t){const i=[],n=[],r=[];Hh(e),Wh(i,e);let s=e.length;t.forEach(Hh);for(let e=0;e<t.length;e++)n.push(s),s+=t[e].length,Wh(i,t[e]);const o=function(e,t,i=2){const n=t&&t.length,r=n?t[0]*i:e.length;let s=_h(e,0,r,i,!0);const o=[];if(!s||s.next===s.prev)return o;let a,l,c,h,u,d,m;if(n&&(s=function(e,t,i,n){const r=[];let s,o,a,l,c;for(s=0,o=t.length;s<o;s++)a=t[s]*n,l=s<o-1?t[s+1]*n:e.length,c=_h(e,a,l,n,!1),c===c.next&&(c.steiner=!0),r.push(Lh(c));for(r.sort(Eh),s=0;s<r.length;s++)Ah(r[s],i),i=xh(i,i.next);return i}(e,t,s,i)),e.length>80*i){a=c=e[0],l=h=e[1];for(let t=i;t<r;t+=i)u=e[t],d=e[t+1],u<a&&(a=u),d<l&&(l=d),u>c&&(c=u),d>h&&(h=d);m=Math.max(c-a,h-l),m=0!==m?1/m:0}return bh(s,o,i,a,l,m),o}(i,n);for(let e=0;e<o.length;e+=3)r.push(o.slice(e,e+3));return r}}function Hh(e){const t=e.length;t>2&&e[t-1].equals(e[0])&&e.pop()}function Wh(e,t){for(let i=0;i<t.length;i++)e.push(t[i].x),e.push(t[i].y)}class qh extends ns{constructor(e=new yh([new Yi(.5,.5),new Yi(-.5,.5),new Yi(-.5,-.5),new Yi(.5,-.5)]),t={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];const i=this,n=[],r=[];for(let t=0,i=e.length;t<i;t++)s(e[t]);function s(e){const s=[],o=void 0!==t.curveSegments?t.curveSegments:12,a=void 0!==t.steps?t.steps:1;let l=void 0!==t.depth?t.depth:1,c=void 0===t.bevelEnabled||t.bevelEnabled,h=void 0!==t.bevelThickness?t.bevelThickness:.2,u=void 0!==t.bevelSize?t.bevelSize:h-.1,d=void 0!==t.bevelOffset?t.bevelOffset:0,m=void 0!==t.bevelSegments?t.bevelSegments:3;const p=t.extrudePath,f=void 0!==t.UVGenerator?t.UVGenerator:Xh;void 0!==t.amount&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),l=t.amount);let g,v,y,_,x,b=!1;p&&(g=p.getSpacedPoints(a),b=!0,c=!1,v=p.computeFrenetFrames(a,!1),y=new mn,_=new mn,x=new mn),c||(m=0,h=0,u=0,d=0);const w=e.extractPoints(o);let M=w.shape;const T=w.holes;if(!jh.isClockWise(M)){M=M.reverse();for(let e=0,t=T.length;e<t;e++){const t=T[e];jh.isClockWise(t)&&(T[e]=t.reverse())}}const S=jh.triangulateShape(M,T),E=M;for(let e=0,t=T.length;e<t;e++){const t=T[e];M=M.concat(t)}function A(e,t,i){return t||console.error("THREE.ExtrudeGeometry: vec does not exist"),t.clone().multiplyScalar(i).add(e)}const C=M.length,P=S.length;function L(e,t,i){let n,r,s;const o=e.x-t.x,a=e.y-t.y,l=i.x-e.x,c=i.y-e.y,h=o*o+a*a,u=o*c-a*l;if(Math.abs(u)>Number.EPSILON){const u=Math.sqrt(h),d=Math.sqrt(l*l+c*c),m=t.x-a/u,p=t.y+o/u,f=((i.x-c/d-m)*c-(i.y+l/d-p)*l)/(o*c-a*l);n=m+o*f-e.x,r=p+a*f-e.y;const g=n*n+r*r;if(g<=2)return new Yi(n,r);s=Math.sqrt(g/2)}else{let e=!1;o>Number.EPSILON?l>Number.EPSILON&&(e=!0):o<-Number.EPSILON?l<-Number.EPSILON&&(e=!0):Math.sign(a)===Math.sign(c)&&(e=!0),e?(n=-a,r=o,s=Math.sqrt(h)):(n=o,r=a,s=Math.sqrt(h/2))}return new Yi(n/s,r/s)}const R=[];for(let e=0,t=E.length,i=t-1,n=e+1;e<t;e++,i++,n++)i===t&&(i=0),n===t&&(n=0),R[e]=L(E[e],E[i],E[n]);const D=[];let O,I=R.concat();for(let e=0,t=T.length;e<t;e++){const t=T[e];O=[];for(let e=0,i=t.length,n=i-1,r=e+1;e<i;e++,n++,r++)n===i&&(n=0),r===i&&(r=0),O[e]=L(t[e],t[n],t[r]);D.push(O),I=I.concat(O)}for(let e=0;e<m;e++){const t=e/m,i=h*Math.cos(t*Math.PI/2),n=u*Math.sin(t*Math.PI/2)+d;for(let e=0,t=E.length;e<t;e++){const t=A(E[e],R[e],n);U(t.x,t.y,-i)}for(let e=0,t=T.length;e<t;e++){const t=T[e];O=D[e];for(let e=0,r=t.length;e<r;e++){const r=A(t[e],O[e],n);U(r.x,r.y,-i)}}}const F=u+d;for(let e=0;e<C;e++){const t=c?A(M[e],I[e],F):M[e];b?(_.copy(v.normals[0]).multiplyScalar(t.x),y.copy(v.binormals[0]).multiplyScalar(t.y),x.copy(g[0]).add(_).add(y),U(x.x,x.y,x.z)):U(t.x,t.y,0)}for(let e=1;e<=a;e++)for(let t=0;t<C;t++){const i=c?A(M[t],I[t],F):M[t];b?(_.copy(v.normals[e]).multiplyScalar(i.x),y.copy(v.binormals[e]).multiplyScalar(i.y),x.copy(g[e]).add(_).add(y),U(x.x,x.y,x.z)):U(i.x,i.y,l/a*e)}for(let e=m-1;e>=0;e--){const t=e/m,i=h*Math.cos(t*Math.PI/2),n=u*Math.sin(t*Math.PI/2)+d;for(let e=0,t=E.length;e<t;e++){const t=A(E[e],R[e],n);U(t.x,t.y,l+i)}for(let e=0,t=T.length;e<t;e++){const t=T[e];O=D[e];for(let e=0,r=t.length;e<r;e++){const r=A(t[e],O[e],n);b?U(r.x,r.y+g[a-1].y,g[a-1].x+i):U(r.x,r.y,l+i)}}}function V(e,t){let i=e.length;for(;--i>=0;){const n=i;let r=i-1;r<0&&(r=e.length-1);for(let e=0,i=a+2*m;e<i;e++){const i=C*e,s=C*(e+1);N(t+n+i,t+r+i,t+r+s,t+n+s)}}}function U(e,t,i){s.push(e),s.push(t),s.push(i)}function B(e,t,r){z(e),z(t),z(r);const s=n.length/3,o=f.generateTopUV(i,n,s-3,s-2,s-1);k(o[0]),k(o[1]),k(o[2])}function N(e,t,r,s){z(e),z(t),z(s),z(t),z(r),z(s);const o=n.length/3,a=f.generateSideWallUV(i,n,o-6,o-3,o-2,o-1);k(a[0]),k(a[1]),k(a[3]),k(a[1]),k(a[2]),k(a[3])}function z(e){n.push(s[3*e+0]),n.push(s[3*e+1]),n.push(s[3*e+2])}function k(e){r.push(e.x),r.push(e.y)}!function(){const e=n.length/3;if(c){let e=0,t=C*e;for(let e=0;e<P;e++){const i=S[e];B(i[2]+t,i[1]+t,i[0]+t)}e=a+2*m,t=C*e;for(let e=0;e<P;e++){const i=S[e];B(i[0]+t,i[1]+t,i[2]+t)}}else{for(let e=0;e<P;e++){const t=S[e];B(t[2],t[1],t[0])}for(let e=0;e<P;e++){const t=S[e];B(t[0]+C*a,t[1]+C*a,t[2]+C*a)}}i.addGroup(e,n.length/3-e,0)}(),function(){const e=n.length/3;let t=0;V(E,t),t+=E.length;for(let e=0,i=T.length;e<i;e++){const i=T[e];V(i,t),t+=i.length}i.addGroup(e,n.length/3-e,1)}()}this.setAttribute("position",new Zr(n,3)),this.setAttribute("uv",new Zr(r,2)),this.computeVertexNormals()}toJSON(){const e=super.toJSON();return function(e,t,i){if(i.shapes=[],Array.isArray(e))for(let t=0,n=e.length;t<n;t++){const n=e[t];i.shapes.push(n.uuid)}else i.shapes.push(e.uuid);return void 0!==t.extrudePath&&(i.options.extrudePath=t.extrudePath.toJSON()),i}(this.parameters.shapes,this.parameters.options,e)}static fromJSON(e,t){const i=[];for(let n=0,r=e.shapes.length;n<r;n++){const r=t[e.shapes[n]];i.push(r)}const n=e.options.extrudePath;return void 0!==n&&(e.options.extrudePath=(new fh[n.type]).fromJSON(n)),new qh(i,e.options)}}const Xh={generateTopUV:function(e,t,i,n,r){const s=t[3*i],o=t[3*i+1],a=t[3*n],l=t[3*n+1],c=t[3*r],h=t[3*r+1];return[new Yi(s,o),new Yi(a,l),new Yi(c,h)]},generateSideWallUV:function(e,t,i,n,r,s){const o=t[3*i],a=t[3*i+1],l=t[3*i+2],c=t[3*n],h=t[3*n+1],u=t[3*n+2],d=t[3*r],m=t[3*r+1],p=t[3*r+2],f=t[3*s],g=t[3*s+1],v=t[3*s+2];return Math.abs(a-h)<Math.abs(o-c)?[new Yi(o,1-l),new Yi(c,1-u),new Yi(d,1-p),new Yi(f,1-v)]:[new Yi(a,1-l),new Yi(h,1-u),new Yi(m,1-p),new Yi(g,1-v)]}};class Zh extends jc{constructor(e=1,t=0){const i=(1+Math.sqrt(5))/2;super([-1,i,0,1,i,0,-1,-i,0,1,-i,0,0,-1,i,0,1,i,0,-1,-i,0,1,-i,i,0,-1,i,0,1,-i,0,-1,-i,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],e,t),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Zh(e.radius,e.detail)}}class Yh extends ns{constructor(e=[new Yi(0,.5),new Yi(.5,0),new Yi(0,-.5)],t=12,i=0,n=2*Math.PI){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:i,phiLength:n},t=Math.floor(t),n=Gi(n,0,2*Math.PI);const r=[],s=[],o=[],a=1/t,l=new mn,c=new Yi;for(let r=0;r<=t;r++){const h=i+r*a*n,u=Math.sin(h),d=Math.cos(h);for(let i=0;i<=e.length-1;i++)l.x=e[i].x*u,l.y=e[i].y,l.z=e[i].x*d,s.push(l.x,l.y,l.z),c.x=r/t,c.y=i/(e.length-1),o.push(c.x,c.y)}for(let i=0;i<t;i++)for(let t=0;t<e.length-1;t++){const n=t+i*e.length,s=n,o=n+e.length,a=n+e.length+1,l=n+1;r.push(s,o,l),r.push(o,a,l)}if(this.setIndex(r),this.setAttribute("position",new Zr(s,3)),this.setAttribute("uv",new Zr(o,2)),this.computeVertexNormals(),n===2*Math.PI){const i=this.attributes.normal.array,n=new mn,r=new mn,s=new mn,o=t*e.length*3;for(let t=0,a=0;t<e.length;t++,a+=3)n.x=i[a+0],n.y=i[a+1],n.z=i[a+2],r.x=i[o+a+0],r.y=i[o+a+1],r.z=i[o+a+2],s.addVectors(n,r).normalize(),i[a+0]=i[o+a+0]=s.x,i[a+1]=i[o+a+1]=s.y,i[a+2]=i[o+a+2]=s.z}}static fromJSON(e){return new Yh(e.points,e.segments,e.phiStart,e.phiLength)}}class Kh extends jc{constructor(e=1,t=0){super([1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],e,t),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Kh(e.radius,e.detail)}}class $h extends ns{constructor(e=.5,t=1,i=8,n=1,r=0,s=2*Math.PI){super(),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:i,phiSegments:n,thetaStart:r,thetaLength:s},i=Math.max(3,i);const o=[],a=[],l=[],c=[];let h=e;const u=(t-e)/(n=Math.max(1,n)),d=new mn,m=new Yi;for(let e=0;e<=n;e++){for(let e=0;e<=i;e++){const n=r+e/i*s;d.x=h*Math.cos(n),d.y=h*Math.sin(n),a.push(d.x,d.y,d.z),l.push(0,0,1),m.x=(d.x/t+1)/2,m.y=(d.y/t+1)/2,c.push(m.x,m.y)}h+=u}for(let e=0;e<n;e++){const t=e*(i+1);for(let e=0;e<i;e++){const n=e+t,r=n,s=n+i+1,a=n+i+2,l=n+1;o.push(r,s,l),o.push(s,a,l)}}this.setIndex(o),this.setAttribute("position",new Zr(a,3)),this.setAttribute("normal",new Zr(l,3)),this.setAttribute("uv",new Zr(c,2))}static fromJSON(e){return new $h(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)}}class Jh extends ns{constructor(e=new yh([new Yi(0,.5),new Yi(-.5,-.5),new Yi(.5,-.5)]),t=12){super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:t};const i=[],n=[],r=[],s=[];let o=0,a=0;if(!1===Array.isArray(e))l(e);else for(let t=0;t<e.length;t++)l(e[t]),this.addGroup(o,a,t),o+=a,a=0;function l(e){const o=n.length/3,l=e.extractPoints(t);let c=l.shape;const h=l.holes;!1===jh.isClockWise(c)&&(c=c.reverse());for(let e=0,t=h.length;e<t;e++){const t=h[e];!0===jh.isClockWise(t)&&(h[e]=t.reverse())}const u=jh.triangulateShape(c,h);for(let e=0,t=h.length;e<t;e++){const t=h[e];c=c.concat(t)}for(let e=0,t=c.length;e<t;e++){const t=c[e];n.push(t.x,t.y,0),r.push(0,0,1),s.push(t.x,t.y)}for(let e=0,t=u.length;e<t;e++){const t=u[e],n=t[0]+o,r=t[1]+o,s=t[2]+o;i.push(n,r,s),a+=3}}this.setIndex(i),this.setAttribute("position",new Zr(n,3)),this.setAttribute("normal",new Zr(r,3)),this.setAttribute("uv",new Zr(s,2))}toJSON(){const e=super.toJSON();return function(e,t){if(t.shapes=[],Array.isArray(e))for(let i=0,n=e.length;i<n;i++){const n=e[i];t.shapes.push(n.uuid)}else t.shapes.push(e.uuid);return t}(this.parameters.shapes,e)}static fromJSON(e,t){const i=[];for(let n=0,r=e.shapes.length;n<r;n++){const r=t[e.shapes[n]];i.push(r)}return new Jh(i,e.curveSegments)}}class Qh extends ns{constructor(e=1,t=32,i=16,n=0,r=2*Math.PI,s=0,o=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:i,phiStart:n,phiLength:r,thetaStart:s,thetaLength:o},t=Math.max(3,Math.floor(t)),i=Math.max(2,Math.floor(i));const a=Math.min(s+o,Math.PI);let l=0;const c=[],h=new mn,u=new mn,d=[],m=[],p=[],f=[];for(let d=0;d<=i;d++){const g=[],v=d/i;let y=0;0==d&&0==s?y=.5/t:d==i&&a==Math.PI&&(y=-.5/t);for(let i=0;i<=t;i++){const a=i/t;h.x=-e*Math.cos(n+a*r)*Math.sin(s+v*o),h.y=e*Math.cos(s+v*o),h.z=e*Math.sin(n+a*r)*Math.sin(s+v*o),m.push(h.x,h.y,h.z),u.copy(h).normalize(),p.push(u.x,u.y,u.z),f.push(a+y,1-v),g.push(l++)}c.push(g)}for(let e=0;e<i;e++)for(let n=0;n<t;n++){const t=c[e][n+1],r=c[e][n],o=c[e+1][n],l=c[e+1][n+1];(0!==e||s>0)&&d.push(t,r,l),(e!==i-1||a<Math.PI)&&d.push(r,o,l)}this.setIndex(d),this.setAttribute("position",new Zr(m,3)),this.setAttribute("normal",new Zr(p,3)),this.setAttribute("uv",new Zr(f,2))}static fromJSON(e){return new Qh(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class eu extends jc{constructor(e=1,t=0){super([1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],e,t),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new eu(e.radius,e.detail)}}class tu extends ns{constructor(e=1,t=.4,i=8,n=6,r=2*Math.PI){super(),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:i,tubularSegments:n,arc:r},i=Math.floor(i),n=Math.floor(n);const s=[],o=[],a=[],l=[],c=new mn,h=new mn,u=new mn;for(let s=0;s<=i;s++)for(let d=0;d<=n;d++){const m=d/n*r,p=s/i*Math.PI*2;h.x=(e+t*Math.cos(p))*Math.cos(m),h.y=(e+t*Math.cos(p))*Math.sin(m),h.z=t*Math.sin(p),o.push(h.x,h.y,h.z),c.x=e*Math.cos(m),c.y=e*Math.sin(m),u.subVectors(h,c).normalize(),a.push(u.x,u.y,u.z),l.push(d/n),l.push(s/i)}for(let e=1;e<=i;e++)for(let t=1;t<=n;t++){const i=(n+1)*e+t-1,r=(n+1)*(e-1)+t-1,o=(n+1)*(e-1)+t,a=(n+1)*e+t;s.push(i,r,a),s.push(r,o,a)}this.setIndex(s),this.setAttribute("position",new Zr(o,3)),this.setAttribute("normal",new Zr(a,3)),this.setAttribute("uv",new Zr(l,2))}static fromJSON(e){return new tu(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}class iu extends ns{constructor(e=1,t=.4,i=64,n=8,r=2,s=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:i,radialSegments:n,p:r,q:s},i=Math.floor(i),n=Math.floor(n);const o=[],a=[],l=[],c=[],h=new mn,u=new mn,d=new mn,m=new mn,p=new mn,f=new mn,g=new mn;for(let o=0;o<=i;++o){const y=o/i*r*Math.PI*2;v(y,r,s,e,d),v(y+.01,r,s,e,m),f.subVectors(m,d),g.addVectors(m,d),p.crossVectors(f,g),g.crossVectors(p,f),p.normalize(),g.normalize();for(let e=0;e<=n;++e){const r=e/n*Math.PI*2,s=-t*Math.cos(r),m=t*Math.sin(r);h.x=d.x+(s*g.x+m*p.x),h.y=d.y+(s*g.y+m*p.y),h.z=d.z+(s*g.z+m*p.z),a.push(h.x,h.y,h.z),u.subVectors(h,d).normalize(),l.push(u.x,u.y,u.z),c.push(o/i),c.push(e/n)}}for(let e=1;e<=i;e++)for(let t=1;t<=n;t++){const i=(n+1)*(e-1)+(t-1),r=(n+1)*e+(t-1),s=(n+1)*e+t,a=(n+1)*(e-1)+t;o.push(i,r,a),o.push(r,s,a)}function v(e,t,i,n,r){const s=Math.cos(e),o=Math.sin(e),a=i/t*e,l=Math.cos(a);r.x=n*(2+l)*.5*s,r.y=n*(2+l)*o*.5,r.z=n*Math.sin(a)*.5}this.setIndex(o),this.setAttribute("position",new Zr(a,3)),this.setAttribute("normal",new Zr(l,3)),this.setAttribute("uv",new Zr(c,2))}static fromJSON(e){return new iu(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}}class nu extends ns{constructor(e=new mh(new mn(-1,-1,0),new mn(-1,1,0),new mn(1,1,0)),t=64,i=1,n=8,r=!1){super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:i,radialSegments:n,closed:r};const s=e.computeFrenetFrames(t,r);this.tangents=s.tangents,this.normals=s.normals,this.binormals=s.binormals;const o=new mn,a=new mn,l=new Yi;let c=new mn;const h=[],u=[],d=[],m=[];function p(r){c=e.getPointAt(r/t,c);const l=s.normals[r],d=s.binormals[r];for(let e=0;e<=n;e++){const t=e/n*Math.PI*2,r=Math.sin(t),s=-Math.cos(t);a.x=s*l.x+r*d.x,a.y=s*l.y+r*d.y,a.z=s*l.z+r*d.z,a.normalize(),u.push(a.x,a.y,a.z),o.x=c.x+i*a.x,o.y=c.y+i*a.y,o.z=c.z+i*a.z,h.push(o.x,o.y,o.z)}}!function(){for(let e=0;e<t;e++)p(e);p(!1===r?t:0),function(){for(let e=0;e<=t;e++)for(let i=0;i<=n;i++)l.x=e/t,l.y=i/n,d.push(l.x,l.y)}(),function(){for(let e=1;e<=t;e++)for(let t=1;t<=n;t++){const i=(n+1)*(e-1)+(t-1),r=(n+1)*e+(t-1),s=(n+1)*e+t,o=(n+1)*(e-1)+t;m.push(i,r,o),m.push(r,s,o)}}()}(),this.setIndex(m),this.setAttribute("position",new Zr(h,3)),this.setAttribute("normal",new Zr(u,3)),this.setAttribute("uv",new Zr(d,2))}toJSON(){const e=super.toJSON();return e.path=this.parameters.path.toJSON(),e}static fromJSON(e){return new nu((new fh[e.path.type]).fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class ru extends ns{constructor(e=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:e},null!==e){const t=[],i=new Set,n=new mn,r=new mn;if(null!==e.index){const s=e.attributes.position,o=e.index;let a=e.groups;0===a.length&&(a=[{start:0,count:o.count,materialIndex:0}]);for(let e=0,l=a.length;e<l;++e){const l=a[e],c=l.start;for(let e=c,a=c+l.count;e<a;e+=3)for(let a=0;a<3;a++){const l=o.getX(e+a),c=o.getX(e+(a+1)%3);n.fromBufferAttribute(s,l),r.fromBufferAttribute(s,c),!0===su(n,r,i)&&(t.push(n.x,n.y,n.z),t.push(r.x,r.y,r.z))}}}else{const s=e.attributes.position;for(let e=0,o=s.count/3;e<o;e++)for(let o=0;o<3;o++){const a=3*e+o,l=3*e+(o+1)%3;n.fromBufferAttribute(s,a),r.fromBufferAttribute(s,l),!0===su(n,r,i)&&(t.push(n.x,n.y,n.z),t.push(r.x,r.y,r.z))}}this.setAttribute("position",new Zr(t,3))}}}function su(e,t,i){const n=`${e.x},${e.y},${e.z}-${t.x},${t.y},${t.z}`,r=`${t.x},${t.y},${t.z}-${e.x},${e.y},${e.z}`;return!0!==i.has(n)&&!0!==i.has(r)&&(i.add(n,r),!0)}var ou=Object.freeze({__proto__:null,BoxGeometry:Ms,BoxBufferGeometry:Ms,CircleGeometry:zc,CircleBufferGeometry:zc,ConeGeometry:Gc,ConeBufferGeometry:Gc,CylinderGeometry:kc,CylinderBufferGeometry:kc,DodecahedronGeometry:Hc,DodecahedronBufferGeometry:Hc,EdgesGeometry:Yc,ExtrudeGeometry:qh,ExtrudeBufferGeometry:qh,IcosahedronGeometry:Zh,IcosahedronBufferGeometry:Zh,LatheGeometry:Yh,LatheBufferGeometry:Yh,OctahedronGeometry:Kh,OctahedronBufferGeometry:Kh,PlaneGeometry:js,PlaneBufferGeometry:js,PolyhedronGeometry:jc,PolyhedronBufferGeometry:jc,RingGeometry:$h,RingBufferGeometry:$h,ShapeGeometry:Jh,ShapeBufferGeometry:Jh,SphereGeometry:Qh,SphereBufferGeometry:Qh,TetrahedronGeometry:eu,TetrahedronBufferGeometry:eu,TorusGeometry:tu,TorusBufferGeometry:tu,TorusKnotGeometry:iu,TorusKnotBufferGeometry:iu,TubeGeometry:nu,TubeBufferGeometry:nu,WireframeGeometry:ru});class au extends Cr{constructor(e){super(),this.type="ShadowMaterial",this.color=new Fr(0),this.transparent=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this}}au.prototype.isShadowMaterial=!0;class lu extends Cr{constructor(e){super(),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Fr(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Fr(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=oi,this.normalScale=new Yi(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this}}lu.prototype.isMeshStandardMaterial=!0;class cu extends lu{constructor(e){super(),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new Yi(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return Gi(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(e){this.ior=(1+.4*e)/(1-.4*e)}}),this.sheenColor=new Fr(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=.01,this.thicknessMap=null,this.attenuationDistance=0,this.attenuationColor=new Fr(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new Fr(1,1,1),this.specularColorMap=null,this._sheen=0,this._clearcoat=0,this._transmission=0,this.setValues(e)}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}cu.prototype.isMeshPhysicalMaterial=!0;class hu extends Cr{constructor(e){super(),this.type="MeshPhongMaterial",this.color=new Fr(16777215),this.specular=new Fr(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Fr(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=oi,this.normalScale=new Yi(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Y,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this}}hu.prototype.isMeshPhongMaterial=!0;class uu extends Cr{constructor(e){super(),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Fr(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Fr(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=oi,this.normalScale=new Yi(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this}}uu.prototype.isMeshToonMaterial=!0;class du extends Cr{constructor(e){super(),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=oi,this.normalScale=new Yi(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}du.prototype.isMeshNormalMaterial=!0;class mu extends Cr{constructor(e){super(),this.type="MeshLambertMaterial",this.color=new Fr(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Fr(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Y,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this}}mu.prototype.isMeshLambertMaterial=!0;class pu extends Cr{constructor(e){super(),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Fr(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=oi,this.normalScale=new Yi(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this}}pu.prototype.isMeshMatcapMaterial=!0;class fu extends yc{constructor(e){super(),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}fu.prototype.isLineDashedMaterial=!0;var gu=Object.freeze({__proto__:null,ShadowMaterial:au,SpriteMaterial:Vl,RawShaderMaterial:eo,ShaderMaterial:As,PointsMaterial:Pc,MeshPhysicalMaterial:cu,MeshStandardMaterial:lu,MeshPhongMaterial:hu,MeshToonMaterial:uu,MeshNormalMaterial:du,MeshLambertMaterial:mu,MeshDepthMaterial:pl,MeshDistanceMaterial:fl,MeshBasicMaterial:Vr,MeshMatcapMaterial:pu,LineDashedMaterial:fu,LineBasicMaterial:yc,Material:Cr});const vu={arraySlice:function(e,t,i){return vu.isTypedArray(e)?new e.constructor(e.subarray(t,void 0!==i?i:e.length)):e.slice(t,i)},convertArray:function(e,t,i){return!e||!i&&e.constructor===t?e:"number"==typeof t.BYTES_PER_ELEMENT?new t(e):Array.prototype.slice.call(e)},isTypedArray:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)},getKeyframeOrder:function(e){const t=e.length,i=new Array(t);for(let e=0;e!==t;++e)i[e]=e;return i.sort((function(t,i){return e[t]-e[i]})),i},sortedArray:function(e,t,i){const n=e.length,r=new e.constructor(n);for(let s=0,o=0;o!==n;++s){const n=i[s]*t;for(let i=0;i!==t;++i)r[o++]=e[n+i]}return r},flattenJSON:function(e,t,i,n){let r=1,s=e[0];for(;void 0!==s&&void 0===s[n];)s=e[r++];if(void 0===s)return;let o=s[n];if(void 0!==o)if(Array.isArray(o))do{o=s[n],void 0!==o&&(t.push(s.time),i.push.apply(i,o)),s=e[r++]}while(void 0!==s);else if(void 0!==o.toArray)do{o=s[n],void 0!==o&&(t.push(s.time),o.toArray(i,i.length)),s=e[r++]}while(void 0!==s);else do{o=s[n],void 0!==o&&(t.push(s.time),i.push(o)),s=e[r++]}while(void 0!==s)},subclip:function(e,t,i,n,r=30){const s=e.clone();s.name=t;const o=[];for(let e=0;e<s.tracks.length;++e){const t=s.tracks[e],a=t.getValueSize(),l=[],c=[];for(let e=0;e<t.times.length;++e){const s=t.times[e]*r;if(!(s<i||s>=n)){l.push(t.times[e]);for(let i=0;i<a;++i)c.push(t.values[e*a+i])}}0!==l.length&&(t.times=vu.convertArray(l,t.times.constructor),t.values=vu.convertArray(c,t.values.constructor),o.push(t))}s.tracks=o;let a=1/0;for(let e=0;e<s.tracks.length;++e)a>s.tracks[e].times[0]&&(a=s.tracks[e].times[0]);for(let e=0;e<s.tracks.length;++e)s.tracks[e].shift(-1*a);return s.resetDuration(),s},makeClipAdditive:function(e,t=0,i=e,n=30){n<=0&&(n=30);const r=i.tracks.length,s=t/n;for(let t=0;t<r;++t){const n=i.tracks[t],r=n.ValueTypeName;if("bool"===r||"string"===r)continue;const o=e.tracks.find((function(e){return e.name===n.name&&e.ValueTypeName===r}));if(void 0===o)continue;let a=0;const l=n.getValueSize();n.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(a=l/3);let c=0;const h=o.getValueSize();o.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(c=h/3);const u=n.times.length-1;let d;if(s<=n.times[0]){const e=a,t=l-a;d=vu.arraySlice(n.values,e,t)}else if(s>=n.times[u]){const e=u*l+a,t=e+l-a;d=vu.arraySlice(n.values,e,t)}else{const e=n.createInterpolant(),t=a,i=l-a;e.evaluate(s),d=vu.arraySlice(e.resultBuffer,t,i)}"quaternion"===r&&(new dn).fromArray(d).normalize().conjugate().toArray(d);const m=o.times.length;for(let e=0;e<m;++e){const t=e*h+c;if("quaternion"===r)dn.multiplyQuaternionsFlat(o.values,t,d,0,o.values,t);else{const e=h-2*c;for(let i=0;i<e;++i)o.values[t+i]-=d[i]}}}return e.blendMode=qt,e}};class yu{constructor(e,t,i,n){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=void 0!==n?n:new t.constructor(i),this.sampleValues=t,this.valueSize=i,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let i=this._cachedIndex,n=t[i],r=t[i-1];e:{t:{let s;i:{n:if(!(e<n)){for(let s=i+2;;){if(void 0===n){if(e<r)break n;return i=t.length,this._cachedIndex=i,this.afterEnd_(i-1,e,r)}if(i===s)break;if(r=n,n=t[++i],e<n)break t}s=t.length;break i}if(e>=r)break e;{const o=t[1];e<o&&(i=2,r=o);for(let s=i-2;;){if(void 0===r)return this._cachedIndex=0,this.beforeStart_(0,e,n);if(i===s)break;if(n=r,r=t[--i-1],e>=r)break t}s=i,i=0}}for(;i<s;){const n=i+s>>>1;e<t[n]?s=n:i=n+1}if(n=t[i],r=t[i-1],void 0===r)return this._cachedIndex=0,this.beforeStart_(0,e,n);if(void 0===n)return i=t.length,this._cachedIndex=i,this.afterEnd_(i-1,r,e)}this._cachedIndex=i,this.intervalChanged_(i,r,n)}return this.interpolate_(i,r,e,n)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,i=this.sampleValues,n=this.valueSize,r=e*n;for(let e=0;e!==n;++e)t[e]=i[r+e];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}yu.prototype.beforeStart_=yu.prototype.copySampleValue_,yu.prototype.afterEnd_=yu.prototype.copySampleValue_;class _u extends yu{constructor(e,t,i,n){super(e,t,i,n),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:Gt,endingEnd:Gt}}intervalChanged_(e,t,i){const n=this.parameterPositions;let r=e-2,s=e+1,o=n[r],a=n[s];if(void 0===o)switch(this.getSettings_().endingStart){case jt:r=e,o=2*t-i;break;case Ht:r=n.length-2,o=t+n[r]-n[r+1];break;default:r=e,o=i}if(void 0===a)switch(this.getSettings_().endingEnd){case jt:s=e,a=2*i-t;break;case Ht:s=1,a=i+n[1]-n[0];break;default:s=e-1,a=t}const l=.5*(i-t),c=this.valueSize;this._weightPrev=l/(t-o),this._weightNext=l/(a-i),this._offsetPrev=r*c,this._offsetNext=s*c}interpolate_(e,t,i,n){const r=this.resultBuffer,s=this.sampleValues,o=this.valueSize,a=e*o,l=a-o,c=this._offsetPrev,h=this._offsetNext,u=this._weightPrev,d=this._weightNext,m=(i-t)/(n-t),p=m*m,f=p*m,g=-u*f+2*u*p-u*m,v=(1+u)*f+(-1.5-2*u)*p+(-.5+u)*m+1,y=(-1-d)*f+(1.5+d)*p+.5*m,_=d*f-d*p;for(let e=0;e!==o;++e)r[e]=g*s[c+e]+v*s[l+e]+y*s[a+e]+_*s[h+e];return r}}class xu extends yu{constructor(e,t,i,n){super(e,t,i,n)}interpolate_(e,t,i,n){const r=this.resultBuffer,s=this.sampleValues,o=this.valueSize,a=e*o,l=a-o,c=(i-t)/(n-t),h=1-c;for(let e=0;e!==o;++e)r[e]=s[l+e]*h+s[a+e]*c;return r}}class bu extends yu{constructor(e,t,i,n){super(e,t,i,n)}interpolate_(e){return this.copySampleValue_(e-1)}}class wu{constructor(e,t,i,n){if(void 0===e)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===t||0===t.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=vu.convertArray(t,this.TimeBufferType),this.values=vu.convertArray(i,this.ValueBufferType),this.setInterpolation(n||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let i;if(t.toJSON!==this.toJSON)i=t.toJSON(e);else{i={name:e.name,times:vu.convertArray(e.times,Array),values:vu.convertArray(e.values,Array)};const t=e.getInterpolation();t!==e.DefaultInterpolation&&(i.interpolation=t)}return i.type=e.ValueTypeName,i}InterpolantFactoryMethodDiscrete(e){return new bu(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new xu(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new _u(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case Nt:t=this.InterpolantFactoryMethodDiscrete;break;case zt:t=this.InterpolantFactoryMethodLinear;break;case kt:t=this.InterpolantFactoryMethodSmooth}if(void 0===t){const t="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(e===this.DefaultInterpolation)throw new Error(t);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",t),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Nt;case this.InterpolantFactoryMethodLinear:return zt;case this.InterpolantFactoryMethodSmooth:return kt}}getValueSize(){return this.values.length/this.times.length}shift(e){if(0!==e){const t=this.times;for(let i=0,n=t.length;i!==n;++i)t[i]+=e}return this}scale(e){if(1!==e){const t=this.times;for(let i=0,n=t.length;i!==n;++i)t[i]*=e}return this}trim(e,t){const i=this.times,n=i.length;let r=0,s=n-1;for(;r!==n&&i[r]<e;)++r;for(;-1!==s&&i[s]>t;)--s;if(++s,0!==r||s!==n){r>=s&&(s=Math.max(s,1),r=s-1);const e=this.getValueSize();this.times=vu.arraySlice(i,r,s),this.values=vu.arraySlice(this.values,r*e,s*e)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const i=this.times,n=this.values,r=i.length;0===r&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let s=null;for(let t=0;t!==r;t++){const n=i[t];if("number"==typeof n&&isNaN(n)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,t,n),e=!1;break}if(null!==s&&s>n){console.error("THREE.KeyframeTrack: Out of order keys.",this,t,n,s),e=!1;break}s=n}if(void 0!==n&&vu.isTypedArray(n))for(let t=0,i=n.length;t!==i;++t){const i=n[t];if(isNaN(i)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,t,i),e=!1;break}}return e}optimize(){const e=vu.arraySlice(this.times),t=vu.arraySlice(this.values),i=this.getValueSize(),n=this.getInterpolation()===kt,r=e.length-1;let s=1;for(let o=1;o<r;++o){let r=!1;const a=e[o];if(a!==e[o+1]&&(1!==o||a!==e[0]))if(n)r=!0;else{const e=o*i,n=e-i,s=e+i;for(let o=0;o!==i;++o){const i=t[e+o];if(i!==t[n+o]||i!==t[s+o]){r=!0;break}}}if(r){if(o!==s){e[s]=e[o];const n=o*i,r=s*i;for(let e=0;e!==i;++e)t[r+e]=t[n+e]}++s}}if(r>0){e[s]=e[r];for(let e=r*i,n=s*i,o=0;o!==i;++o)t[n+o]=t[e+o];++s}return s!==e.length?(this.times=vu.arraySlice(e,0,s),this.values=vu.arraySlice(t,0,s*i)):(this.times=e,this.values=t),this}clone(){const e=vu.arraySlice(this.times,0),t=vu.arraySlice(this.values,0),i=new(0,this.constructor)(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}}wu.prototype.TimeBufferType=Float32Array,wu.prototype.ValueBufferType=Float32Array,wu.prototype.DefaultInterpolation=zt;class Mu extends wu{}Mu.prototype.ValueTypeName="bool",Mu.prototype.ValueBufferType=Array,Mu.prototype.DefaultInterpolation=Nt,Mu.prototype.InterpolantFactoryMethodLinear=void 0,Mu.prototype.InterpolantFactoryMethodSmooth=void 0;class Tu extends wu{}Tu.prototype.ValueTypeName="color";class Su extends wu{}Su.prototype.ValueTypeName="number";class Eu extends yu{constructor(e,t,i,n){super(e,t,i,n)}interpolate_(e,t,i,n){const r=this.resultBuffer,s=this.sampleValues,o=this.valueSize,a=(i-t)/(n-t);let l=e*o;for(let e=l+o;l!==e;l+=4)dn.slerpFlat(r,0,s,l-o,s,l,a);return r}}class Au extends wu{InterpolantFactoryMethodLinear(e){return new Eu(this.times,this.values,this.getValueSize(),e)}}Au.prototype.ValueTypeName="quaternion",Au.prototype.DefaultInterpolation=zt,Au.prototype.InterpolantFactoryMethodSmooth=void 0;class Cu extends wu{}Cu.prototype.ValueTypeName="string",Cu.prototype.ValueBufferType=Array,Cu.prototype.DefaultInterpolation=Nt,Cu.prototype.InterpolantFactoryMethodLinear=void 0,Cu.prototype.InterpolantFactoryMethodSmooth=void 0;class Pu extends wu{}Pu.prototype.ValueTypeName="vector";class Lu{constructor(e,t=-1,i,n=Wt){this.name=e,this.tracks=i,this.duration=t,this.blendMode=n,this.uuid=ki(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],i=e.tracks,n=1/(e.fps||1);for(let e=0,r=i.length;e!==r;++e)t.push(Ru(i[e]).scale(n));const r=new this(e.name,e.duration,t,e.blendMode);return r.uuid=e.uuid,r}static toJSON(e){const t=[],i=e.tracks,n={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let e=0,n=i.length;e!==n;++e)t.push(wu.toJSON(i[e]));return n}static CreateFromMorphTargetSequence(e,t,i,n){const r=t.length,s=[];for(let e=0;e<r;e++){let o=[],a=[];o.push((e+r-1)%r,e,(e+1)%r),a.push(0,1,0);const l=vu.getKeyframeOrder(o);o=vu.sortedArray(o,1,l),a=vu.sortedArray(a,1,l),n||0!==o[0]||(o.push(r),a.push(a[0])),s.push(new Su(".morphTargetInfluences["+t[e].name+"]",o,a).scale(1/i))}return new this(e,-1,s)}static findByName(e,t){let i=e;if(!Array.isArray(e)){const t=e;i=t.geometry&&t.geometry.animations||t.animations}for(let e=0;e<i.length;e++)if(i[e].name===t)return i[e];return null}static CreateClipsFromMorphTargetSequences(e,t,i){const n={},r=/^([\w-]*?)([\d]+)$/;for(let t=0,i=e.length;t<i;t++){const i=e[t],s=i.name.match(r);if(s&&s.length>1){const e=s[1];let t=n[e];t||(n[e]=t=[]),t.push(i)}}const s=[];for(const e in n)s.push(this.CreateFromMorphTargetSequence(e,n[e],t,i));return s}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(e,t,i,n,r){if(0!==i.length){const s=[],o=[];vu.flattenJSON(i,s,o,n),0!==s.length&&r.push(new e(t,s,o))}},n=[],r=e.name||"default",s=e.fps||30,o=e.blendMode;let a=e.length||-1;const l=e.hierarchy||[];for(let e=0;e<l.length;e++){const r=l[e].keys;if(r&&0!==r.length)if(r[0].morphTargets){const e={};let t;for(t=0;t<r.length;t++)if(r[t].morphTargets)for(let i=0;i<r[t].morphTargets.length;i++)e[r[t].morphTargets[i]]=-1;for(const i in e){const e=[],s=[];for(let n=0;n!==r[t].morphTargets.length;++n){const n=r[t];e.push(n.time),s.push(n.morphTarget===i?1:0)}n.push(new Su(".morphTargetInfluence["+i+"]",e,s))}a=e.length*(s||1)}else{const s=".bones["+t[e].name+"]";i(Pu,s+".position",r,"pos",n),i(Au,s+".quaternion",r,"rot",n),i(Pu,s+".scale",r,"scl",n)}}return 0===n.length?null:new this(r,a,n,o)}resetDuration(){let e=0;for(let t=0,i=this.tracks.length;t!==i;++t){const i=this.tracks[t];e=Math.max(e,i.times[i.times.length-1])}return this.duration=e,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function Ru(e){if(void 0===e.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const t=function(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Su;case"vector":case"vector2":case"vector3":case"vector4":return Pu;case"color":return Tu;case"quaternion":return Au;case"bool":case"boolean":return Mu;case"string":return Cu}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+e)}(e.type);if(void 0===e.times){const t=[],i=[];vu.flattenJSON(e.keys,t,i,"value"),e.times=t,e.values=i}return void 0!==t.parse?t.parse(e):new t(e.name,e.times,e.values,e.interpolation)}const Du={enabled:!1,files:{},add:function(e,t){!1!==this.enabled&&(this.files[e]=t)},get:function(e){if(!1!==this.enabled)return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}};class Ou{constructor(e,t,i){const n=this;let r,s=!1,o=0,a=0;const l=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=i,this.itemStart=function(e){a++,!1===s&&void 0!==n.onStart&&n.onStart(e,o,a),s=!0},this.itemEnd=function(e){o++,void 0!==n.onProgress&&n.onProgress(e,o,a),o===a&&(s=!1,void 0!==n.onLoad&&n.onLoad())},this.itemError=function(e){void 0!==n.onError&&n.onError(e)},this.resolveURL=function(e){return r?r(e):e},this.setURLModifier=function(e){return r=e,this},this.addHandler=function(e,t){return l.push(e,t),this},this.removeHandler=function(e){const t=l.indexOf(e);return-1!==t&&l.splice(t,2),this},this.getHandler=function(e){for(let t=0,i=l.length;t<i;t+=2){const i=l[t],n=l[t+1];if(i.global&&(i.lastIndex=0),i.test(e))return n}return null}}}const Iu=new Ou;class Fu{constructor(e){this.manager=void 0!==e?e:Iu,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const i=this;return new Promise((function(n,r){i.load(e,n,t,r)}))}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}const Vu={};class Uu extends Fu{constructor(e){super(e)}load(e,t,i,n){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);const r=Du.get(e);if(void 0!==r)return this.manager.itemStart(e),setTimeout((()=>{t&&t(r),this.manager.itemEnd(e)}),0),r;if(void 0!==Vu[e])return void Vu[e].push({onLoad:t,onProgress:i,onError:n});Vu[e]=[],Vu[e].push({onLoad:t,onProgress:i,onError:n});const s=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"});fetch(s).then((t=>{if(200===t.status||0===t.status){0===t.status&&console.warn("THREE.FileLoader: HTTP Status 0 received.");const i=Vu[e],n=t.body.getReader(),r=t.headers.get("Content-Length"),s=r?parseInt(r):0,o=0!==s;let a=0;return new ReadableStream({start(e){!function t(){n.read().then((({done:n,value:r})=>{if(n)e.close();else{a+=r.byteLength;const n=new ProgressEvent("progress",{lengthComputable:o,loaded:a,total:s});for(let e=0,t=i.length;e<t;e++){const t=i[e];t.onProgress&&t.onProgress(n)}e.enqueue(r),t()}}))}()}})}throw Error(`fetch for "${t.url}" responded with ${t.status}: ${t.statusText}`)})).then((e=>{const t=new Response(e);switch(this.responseType){case"arraybuffer":return t.arrayBuffer();case"blob":return t.blob();case"document":return t.text().then((e=>(new DOMParser).parseFromString(e,this.mimeType)));case"json":return t.json();default:return t.text()}})).then((t=>{Du.add(e,t);const i=Vu[e];delete Vu[e];for(let e=0,n=i.length;e<n;e++){const n=i[e];n.onLoad&&n.onLoad(t)}this.manager.itemEnd(e)})).catch((t=>{const i=Vu[e];delete Vu[e];for(let e=0,n=i.length;e<n;e++){const n=i[e];n.onError&&n.onError(t)}this.manager.itemError(e),this.manager.itemEnd(e)})),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class Bu extends Fu{constructor(e){super(e)}load(e,t,i,n){const r=this,s=new Uu(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,(function(i){try{t(r.parse(JSON.parse(i)))}catch(t){n?n(t):console.error(t),r.manager.itemError(e)}}),i,n)}parse(e){const t=[];for(let i=0;i<e.length;i++){const n=Lu.parse(e[i]);t.push(n)}return t}}class Nu extends Fu{constructor(e){super(e)}load(e,t,i,n){const r=this,s=[],o=new Uc,a=new Uu(this.manager);a.setPath(this.path),a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setWithCredentials(r.withCredentials);let l=0;function c(c){a.load(e[c],(function(e){const i=r.parse(e,!0);s[c]={width:i.width,height:i.height,format:i.format,mipmaps:i.mipmaps},l+=1,6===l&&(1===i.mipmapCount&&(o.minFilter=_e),o.image=s,o.format=i.format,o.needsUpdate=!0,t&&t(o))}),i,n)}if(Array.isArray(e))for(let t=0,i=e.length;t<i;++t)c(t);else a.load(e,(function(e){const i=r.parse(e,!0);if(i.isCubemap){const e=i.mipmaps.length/i.mipmapCount;for(let t=0;t<e;t++){s[t]={mipmaps:[]};for(let e=0;e<i.mipmapCount;e++)s[t].mipmaps.push(i.mipmaps[t*i.mipmapCount+e]),s[t].format=i.format,s[t].width=i.width,s[t].height=i.height}o.image=s}else o.image.width=i.width,o.image.height=i.height,o.mipmaps=i.mipmaps;1===i.mipmapCount&&(o.minFilter=_e),o.format=i.format,o.needsUpdate=!0,t&&t(o)}),i,n);return o}}class zu extends Fu{constructor(e){super(e)}load(e,t,i,n){void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);const r=this,s=Du.get(e);if(void 0!==s)return r.manager.itemStart(e),setTimeout((function(){t&&t(s),r.manager.itemEnd(e)}),0),s;const o=en("img");function a(){c(),Du.add(e,this),t&&t(this),r.manager.itemEnd(e)}function l(t){c(),n&&n(t),r.manager.itemError(e),r.manager.itemEnd(e)}function c(){o.removeEventListener("load",a,!1),o.removeEventListener("error",l,!1)}return o.addEventListener("load",a,!1),o.addEventListener("error",l,!1),"data:"!==e.substr(0,5)&&void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),r.manager.itemStart(e),o.src=e,o}}class ku extends Fu{constructor(e){super(e)}load(e,t,i,n){const r=new Ds,s=new zu(this.manager);s.setCrossOrigin(this.crossOrigin),s.setPath(this.path);let o=0;function a(i){s.load(e[i],(function(e){r.images[i]=e,o++,6===o&&(r.needsUpdate=!0,t&&t(r))}),void 0,n)}for(let t=0;t<e.length;++t)a(t);return r}}class Gu extends Fu{constructor(e){super(e)}load(e,t,i,n){const r=this,s=new lc,o=new Uu(this.manager);return o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setPath(this.path),o.setWithCredentials(r.withCredentials),o.load(e,(function(e){const i=r.parse(e);i&&(void 0!==i.image?s.image=i.image:void 0!==i.data&&(s.image.width=i.width,s.image.height=i.height,s.image.data=i.data),s.wrapS=void 0!==i.wrapS?i.wrapS:de,s.wrapT=void 0!==i.wrapT?i.wrapT:de,s.magFilter=void 0!==i.magFilter?i.magFilter:_e,s.minFilter=void 0!==i.minFilter?i.minFilter:_e,s.anisotropy=void 0!==i.anisotropy?i.anisotropy:1,void 0!==i.encoding&&(s.encoding=i.encoding),void 0!==i.flipY&&(s.flipY=i.flipY),void 0!==i.format&&(s.format=i.format),void 0!==i.type&&(s.type=i.type),void 0!==i.mipmaps&&(s.mipmaps=i.mipmaps,s.minFilter=we),1===i.mipmapCount&&(s.minFilter=_e),void 0!==i.generateMipmaps&&(s.generateMipmaps=i.generateMipmaps),s.needsUpdate=!0,t&&t(s,i))}),i,n),s}}class ju extends Fu{constructor(e){super(e)}load(e,t,i,n){const r=new on,s=new zu(this.manager);return s.setCrossOrigin(this.crossOrigin),s.setPath(this.path),s.load(e,(function(e){r.image=e,r.needsUpdate=!0,void 0!==t&&t(r)}),i,n),r}}class Hu extends fr{constructor(e,t=1){super(),this.type="Light",this.color=new Fr(e),this.intensity=t}dispose(){}copy(e){return super.copy(e),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,void 0!==this.groundColor&&(t.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(t.object.distance=this.distance),void 0!==this.angle&&(t.object.angle=this.angle),void 0!==this.decay&&(t.object.decay=this.decay),void 0!==this.penumbra&&(t.object.penumbra=this.penumbra),void 0!==this.shadow&&(t.object.shadow=this.shadow.toJSON()),t}}Hu.prototype.isLight=!0;class Wu extends Hu{constructor(e,t,i){super(e,i),this.type="HemisphereLight",this.position.copy(fr.DefaultUp),this.updateMatrix(),this.groundColor=new Fr(t)}copy(e){return Hu.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this}}Wu.prototype.isHemisphereLight=!0;const qu=new Hn,Xu=new mn,Zu=new mn;class Yu{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Yi(512,512),this.map=null,this.mapPass=null,this.matrix=new Hn,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new zs,this._frameExtents=new Yi(1,1),this._viewportCount=1,this._viewports=[new ln(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,i=this.matrix;Xu.setFromMatrixPosition(e.matrixWorld),t.position.copy(Xu),Zu.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(Zu),t.updateMatrixWorld(),qu.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(qu),i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(t.projectionMatrix),i.multiply(t.matrixWorldInverse)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return(new this.constructor).copy(this)}toJSON(){const e={};return 0!==this.bias&&(e.bias=this.bias),0!==this.normalBias&&(e.normalBias=this.normalBias),1!==this.radius&&(e.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class Ku extends Yu{constructor(){super(new Ps(50,1,.5,500)),this.focus=1}updateMatrices(e){const t=this.camera,i=2*Bi*e.angle*this.focus,n=this.mapSize.width/this.mapSize.height,r=e.distance||t.far;i===t.fov&&n===t.aspect&&r===t.far||(t.fov=i,t.aspect=n,t.far=r,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}Ku.prototype.isSpotLightShadow=!0;class $u extends Hu{constructor(e,t,i=0,n=Math.PI/3,r=0,s=1){super(e,t),this.type="SpotLight",this.position.copy(fr.DefaultUp),this.updateMatrix(),this.target=new fr,this.distance=i,this.angle=n,this.penumbra=r,this.decay=s,this.shadow=new Ku}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}$u.prototype.isSpotLight=!0;const Ju=new Hn,Qu=new mn,ed=new mn;class td extends Yu{constructor(){super(new Ps(90,1,.5,500)),this._frameExtents=new Yi(4,2),this._viewportCount=6,this._viewports=[new ln(2,1,1,1),new ln(0,1,1,1),new ln(3,1,1,1),new ln(1,1,1,1),new ln(3,0,1,1),new ln(1,0,1,1)],this._cubeDirections=[new mn(1,0,0),new mn(-1,0,0),new mn(0,0,1),new mn(0,0,-1),new mn(0,1,0),new mn(0,-1,0)],this._cubeUps=[new mn(0,1,0),new mn(0,1,0),new mn(0,1,0),new mn(0,1,0),new mn(0,0,1),new mn(0,0,-1)]}updateMatrices(e,t=0){const i=this.camera,n=this.matrix,r=e.distance||i.far;r!==i.far&&(i.far=r,i.updateProjectionMatrix()),Qu.setFromMatrixPosition(e.matrixWorld),i.position.copy(Qu),ed.copy(i.position),ed.add(this._cubeDirections[t]),i.up.copy(this._cubeUps[t]),i.lookAt(ed),i.updateMatrixWorld(),n.makeTranslation(-Qu.x,-Qu.y,-Qu.z),Ju.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Ju)}}td.prototype.isPointLightShadow=!0;class id extends Hu{constructor(e,t,i=0,n=1){super(e,t),this.type="PointLight",this.distance=i,this.decay=n,this.shadow=new td}get power(){return 4*this.intensity*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}id.prototype.isPointLight=!0;class nd extends Yu{constructor(){super(new Qs(-5,5,5,-5,.5,500))}}nd.prototype.isDirectionalLightShadow=!0;class rd extends Hu{constructor(e,t){super(e,t),this.type="DirectionalLight",this.position.copy(fr.DefaultUp),this.updateMatrix(),this.target=new fr,this.shadow=new nd}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}rd.prototype.isDirectionalLight=!0;class sd extends Hu{constructor(e,t){super(e,t),this.type="AmbientLight"}}sd.prototype.isAmbientLight=!0;class od extends Hu{constructor(e,t,i=10,n=10){super(e,t),this.type="RectAreaLight",this.width=i,this.height=n}get power(){return this.intensity*this.width*this.height*Math.PI}set power(e){this.intensity=e/(this.width*this.height*Math.PI)}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){const t=super.toJSON(e);return t.object.width=this.width,t.object.height=this.height,t}}od.prototype.isRectAreaLight=!0;class ad{constructor(){this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new mn)}set(e){for(let t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,t){const i=e.x,n=e.y,r=e.z,s=this.coefficients;return t.copy(s[0]).multiplyScalar(.282095),t.addScaledVector(s[1],.488603*n),t.addScaledVector(s[2],.488603*r),t.addScaledVector(s[3],.488603*i),t.addScaledVector(s[4],i*n*1.092548),t.addScaledVector(s[5],n*r*1.092548),t.addScaledVector(s[6],.315392*(3*r*r-1)),t.addScaledVector(s[7],i*r*1.092548),t.addScaledVector(s[8],.546274*(i*i-n*n)),t}getIrradianceAt(e,t){const i=e.x,n=e.y,r=e.z,s=this.coefficients;return t.copy(s[0]).multiplyScalar(.886227),t.addScaledVector(s[1],1.023328*n),t.addScaledVector(s[2],1.023328*r),t.addScaledVector(s[3],1.023328*i),t.addScaledVector(s[4],.858086*i*n),t.addScaledVector(s[5],.858086*n*r),t.addScaledVector(s[6],.743125*r*r-.247708),t.addScaledVector(s[7],.858086*i*r),t.addScaledVector(s[8],.429043*(i*i-n*n)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let i=0;i<9;i++)this.coefficients[i].addScaledVector(e.coefficients[i],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let i=0;i<9;i++)this.coefficients[i].lerp(e.coefficients[i],t);return this}equals(e){for(let t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return(new this.constructor).copy(this)}fromArray(e,t=0){const i=this.coefficients;for(let n=0;n<9;n++)i[n].fromArray(e,t+3*n);return this}toArray(e=[],t=0){const i=this.coefficients;for(let n=0;n<9;n++)i[n].toArray(e,t+3*n);return e}static getBasisAt(e,t){const i=e.x,n=e.y,r=e.z;t[0]=.282095,t[1]=.488603*n,t[2]=.488603*r,t[3]=.488603*i,t[4]=1.092548*i*n,t[5]=1.092548*n*r,t[6]=.315392*(3*r*r-1),t[7]=1.092548*i*r,t[8]=.546274*(i*i-n*n)}}ad.prototype.isSphericalHarmonics3=!0;class ld extends Hu{constructor(e=new ad,t=1){super(void 0,t),this.sh=e}copy(e){return super.copy(e),this.sh.copy(e.sh),this}fromJSON(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this}toJSON(e){const t=super.toJSON(e);return t.object.sh=this.sh.toArray(),t}}ld.prototype.isLightProbe=!0;class cd extends Fu{constructor(e){super(e),this.textures={}}load(e,t,i,n){const r=this,s=new Uu(r.manager);s.setPath(r.path),s.setRequestHeader(r.requestHeader),s.setWithCredentials(r.withCredentials),s.load(e,(function(i){try{t(r.parse(JSON.parse(i)))}catch(t){n?n(t):console.error(t),r.manager.itemError(e)}}),i,n)}parse(e){const t=this.textures;function i(e){return void 0===t[e]&&console.warn("THREE.MaterialLoader: Undefined texture",e),t[e]}const n=new gu[e.type];if(void 0!==e.uuid&&(n.uuid=e.uuid),void 0!==e.name&&(n.name=e.name),void 0!==e.color&&void 0!==n.color&&n.color.setHex(e.color),void 0!==e.roughness&&(n.roughness=e.roughness),void 0!==e.metalness&&(n.metalness=e.metalness),void 0!==e.sheen&&(n.sheen=e.sheen),void 0!==e.sheenColor&&(n.sheenColor=(new Fr).setHex(e.sheenColor)),void 0!==e.sheenRoughness&&(n.sheenRoughness=e.sheenRoughness),void 0!==e.emissive&&void 0!==n.emissive&&n.emissive.setHex(e.emissive),void 0!==e.specular&&void 0!==n.specular&&n.specular.setHex(e.specular),void 0!==e.specularIntensity&&(n.specularIntensity=e.specularIntensity),void 0!==e.specularColor&&void 0!==n.specularColor&&n.specularColor.setHex(e.specularColor),void 0!==e.shininess&&(n.shininess=e.shininess),void 0!==e.clearcoat&&(n.clearcoat=e.clearcoat),void 0!==e.clearcoatRoughness&&(n.clearcoatRoughness=e.clearcoatRoughness),void 0!==e.transmission&&(n.transmission=e.transmission),void 0!==e.thickness&&(n.thickness=e.thickness),void 0!==e.attenuationDistance&&(n.attenuationDistance=e.attenuationDistance),void 0!==e.attenuationColor&&void 0!==n.attenuationColor&&n.attenuationColor.setHex(e.attenuationColor),void 0!==e.fog&&(n.fog=e.fog),void 0!==e.flatShading&&(n.flatShading=e.flatShading),void 0!==e.blending&&(n.blending=e.blending),void 0!==e.combine&&(n.combine=e.combine),void 0!==e.side&&(n.side=e.side),void 0!==e.shadowSide&&(n.shadowSide=e.shadowSide),void 0!==e.opacity&&(n.opacity=e.opacity),void 0!==e.format&&(n.format=e.format),void 0!==e.transparent&&(n.transparent=e.transparent),void 0!==e.alphaTest&&(n.alphaTest=e.alphaTest),void 0!==e.depthTest&&(n.depthTest=e.depthTest),void 0!==e.depthWrite&&(n.depthWrite=e.depthWrite),void 0!==e.colorWrite&&(n.colorWrite=e.colorWrite),void 0!==e.stencilWrite&&(n.stencilWrite=e.stencilWrite),void 0!==e.stencilWriteMask&&(n.stencilWriteMask=e.stencilWriteMask),void 0!==e.stencilFunc&&(n.stencilFunc=e.stencilFunc),void 0!==e.stencilRef&&(n.stencilRef=e.stencilRef),void 0!==e.stencilFuncMask&&(n.stencilFuncMask=e.stencilFuncMask),void 0!==e.stencilFail&&(n.stencilFail=e.stencilFail),void 0!==e.stencilZFail&&(n.stencilZFail=e.stencilZFail),void 0!==e.stencilZPass&&(n.stencilZPass=e.stencilZPass),void 0!==e.wireframe&&(n.wireframe=e.wireframe),void 0!==e.wireframeLinewidth&&(n.wireframeLinewidth=e.wireframeLinewidth),void 0!==e.wireframeLinecap&&(n.wireframeLinecap=e.wireframeLinecap),void 0!==e.wireframeLinejoin&&(n.wireframeLinejoin=e.wireframeLinejoin),void 0!==e.rotation&&(n.rotation=e.rotation),1!==e.linewidth&&(n.linewidth=e.linewidth),void 0!==e.dashSize&&(n.dashSize=e.dashSize),void 0!==e.gapSize&&(n.gapSize=e.gapSize),void 0!==e.scale&&(n.scale=e.scale),void 0!==e.polygonOffset&&(n.polygonOffset=e.polygonOffset),void 0!==e.polygonOffsetFactor&&(n.polygonOffsetFactor=e.polygonOffsetFactor),void 0!==e.polygonOffsetUnits&&(n.polygonOffsetUnits=e.polygonOffsetUnits),void 0!==e.dithering&&(n.dithering=e.dithering),void 0!==e.alphaToCoverage&&(n.alphaToCoverage=e.alphaToCoverage),void 0!==e.premultipliedAlpha&&(n.premultipliedAlpha=e.premultipliedAlpha),void 0!==e.visible&&(n.visible=e.visible),void 0!==e.toneMapped&&(n.toneMapped=e.toneMapped),void 0!==e.userData&&(n.userData=e.userData),void 0!==e.vertexColors&&("number"==typeof e.vertexColors?n.vertexColors=e.vertexColors>0:n.vertexColors=e.vertexColors),void 0!==e.uniforms)for(const t in e.uniforms){const r=e.uniforms[t];switch(n.uniforms[t]={},r.type){case"t":n.uniforms[t].value=i(r.value);break;case"c":n.uniforms[t].value=(new Fr).setHex(r.value);break;case"v2":n.uniforms[t].value=(new Yi).fromArray(r.value);break;case"v3":n.uniforms[t].value=(new mn).fromArray(r.value);break;case"v4":n.uniforms[t].value=(new ln).fromArray(r.value);break;case"m3":n.uniforms[t].value=(new Ki).fromArray(r.value);break;case"m4":n.uniforms[t].value=(new Hn).fromArray(r.value);break;default:n.uniforms[t].value=r.value}}if(void 0!==e.defines&&(n.defines=e.defines),void 0!==e.vertexShader&&(n.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(n.fragmentShader=e.fragmentShader),void 0!==e.extensions)for(const t in e.extensions)n.extensions[t]=e.extensions[t];if(void 0!==e.shading&&(n.flatShading=1===e.shading),void 0!==e.size&&(n.size=e.size),void 0!==e.sizeAttenuation&&(n.sizeAttenuation=e.sizeAttenuation),void 0!==e.map&&(n.map=i(e.map)),void 0!==e.matcap&&(n.matcap=i(e.matcap)),void 0!==e.alphaMap&&(n.alphaMap=i(e.alphaMap)),void 0!==e.bumpMap&&(n.bumpMap=i(e.bumpMap)),void 0!==e.bumpScale&&(n.bumpScale=e.bumpScale),void 0!==e.normalMap&&(n.normalMap=i(e.normalMap)),void 0!==e.normalMapType&&(n.normalMapType=e.normalMapType),void 0!==e.normalScale){let t=e.normalScale;!1===Array.isArray(t)&&(t=[t,t]),n.normalScale=(new Yi).fromArray(t)}return void 0!==e.displacementMap&&(n.displacementMap=i(e.displacementMap)),void 0!==e.displacementScale&&(n.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(n.displacementBias=e.displacementBias),void 0!==e.roughnessMap&&(n.roughnessMap=i(e.roughnessMap)),void 0!==e.metalnessMap&&(n.metalnessMap=i(e.metalnessMap)),void 0!==e.emissiveMap&&(n.emissiveMap=i(e.emissiveMap)),void 0!==e.emissiveIntensity&&(n.emissiveIntensity=e.emissiveIntensity),void 0!==e.specularMap&&(n.specularMap=i(e.specularMap)),void 0!==e.specularIntensityMap&&(n.specularIntensityMap=i(e.specularIntensityMap)),void 0!==e.specularColorMap&&(n.specularColorMap=i(e.specularColorMap)),void 0!==e.envMap&&(n.envMap=i(e.envMap)),void 0!==e.envMapIntensity&&(n.envMapIntensity=e.envMapIntensity),void 0!==e.reflectivity&&(n.reflectivity=e.reflectivity),void 0!==e.refractionRatio&&(n.refractionRatio=e.refractionRatio),void 0!==e.lightMap&&(n.lightMap=i(e.lightMap)),void 0!==e.lightMapIntensity&&(n.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(n.aoMap=i(e.aoMap)),void 0!==e.aoMapIntensity&&(n.aoMapIntensity=e.aoMapIntensity),void 0!==e.gradientMap&&(n.gradientMap=i(e.gradientMap)),void 0!==e.clearcoatMap&&(n.clearcoatMap=i(e.clearcoatMap)),void 0!==e.clearcoatRoughnessMap&&(n.clearcoatRoughnessMap=i(e.clearcoatRoughnessMap)),void 0!==e.clearcoatNormalMap&&(n.clearcoatNormalMap=i(e.clearcoatNormalMap)),void 0!==e.clearcoatNormalScale&&(n.clearcoatNormalScale=(new Yi).fromArray(e.clearcoatNormalScale)),void 0!==e.transmissionMap&&(n.transmissionMap=i(e.transmissionMap)),void 0!==e.thicknessMap&&(n.thicknessMap=i(e.thicknessMap)),void 0!==e.sheenColorMap&&(n.sheenColorMap=i(e.sheenColorMap)),void 0!==e.sheenRoughnessMap&&(n.sheenRoughnessMap=i(e.sheenRoughnessMap)),n}setTextures(e){return this.textures=e,this}}class hd{static decodeText(e){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);let t="";for(let i=0,n=e.length;i<n;i++)t+=String.fromCharCode(e[i]);try{return decodeURIComponent(escape(t))}catch(e){return t}}static extractUrlBase(e){const t=e.lastIndexOf("/");return-1===t?"./":e.substr(0,t+1)}static resolveURL(e,t){return"string"!=typeof e||""===e?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}}class ud extends ns{constructor(){super(),this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}clone(){return(new this.constructor).copy(this)}toJSON(){const e=super.toJSON(this);return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}ud.prototype.isInstancedBufferGeometry=!0;class dd extends Fu{constructor(e){super(e)}load(e,t,i,n){const r=this,s=new Uu(r.manager);s.setPath(r.path),s.setRequestHeader(r.requestHeader),s.setWithCredentials(r.withCredentials),s.load(e,(function(i){try{t(r.parse(JSON.parse(i)))}catch(t){n?n(t):console.error(t),r.manager.itemError(e)}}),i,n)}parse(e){const t={},i={};function n(e,n){if(void 0!==t[n])return t[n];const r=e.interleavedBuffers[n],s=function(e,t){if(void 0!==i[t])return i[t];const n=e.arrayBuffers[t],r=new Uint32Array(n).buffer;return i[t]=r,r}(e,r.buffer),o=Qi(r.type,s),a=new Ol(o,r.stride);return a.uuid=r.uuid,t[n]=a,a}const r=e.isInstancedBufferGeometry?new ud:new ns,s=e.data.index;if(void 0!==s){const e=Qi(s.type,s.array);r.setIndex(new Nr(e,1))}const o=e.data.attributes;for(const t in o){const i=o[t];let s;if(i.isInterleavedBufferAttribute){const t=n(e.data,i.data);s=new Fl(t,i.itemSize,i.offset,i.normalized)}else{const e=Qi(i.type,i.array);s=new(i.isInstancedBufferAttribute?dc:Nr)(e,i.itemSize,i.normalized)}void 0!==i.name&&(s.name=i.name),void 0!==i.usage&&s.setUsage(i.usage),void 0!==i.updateRange&&(s.updateRange.offset=i.updateRange.offset,s.updateRange.count=i.updateRange.count),r.setAttribute(t,s)}const a=e.data.morphAttributes;if(a)for(const t in a){const i=a[t],s=[];for(let t=0,r=i.length;t<r;t++){const r=i[t];let o;if(r.isInterleavedBufferAttribute){const t=n(e.data,r.data);o=new Fl(t,r.itemSize,r.offset,r.normalized)}else{const e=Qi(r.type,r.array);o=new Nr(e,r.itemSize,r.normalized)}void 0!==r.name&&(o.name=r.name),s.push(o)}r.morphAttributes[t]=s}e.data.morphTargetsRelative&&(r.morphTargetsRelative=!0);const l=e.data.groups||e.data.drawcalls||e.data.offsets;if(void 0!==l)for(let e=0,t=l.length;e!==t;++e){const t=l[e];r.addGroup(t.start,t.count,t.materialIndex)}const c=e.data.boundingSphere;if(void 0!==c){const e=new mn;void 0!==c.center&&e.fromArray(c.center),r.boundingSphere=new Fn(e,c.radius)}return e.name&&(r.name=e.name),e.userData&&(r.userData=e.userData),r}}class md extends Fu{constructor(e){super(e)}load(e,t,i,n){const r=this,s=""===this.path?hd.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||s;const o=new Uu(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,(function(i){let s=null;try{s=JSON.parse(i)}catch(t){return void 0!==n&&n(t),void console.error("THREE:ObjectLoader: Can't parse "+e+".",t.message)}const o=s.metadata;void 0!==o&&void 0!==o.type&&"geometry"!==o.type.toLowerCase()?r.parse(s,t):console.error("THREE.ObjectLoader: Can't load "+e)}),i,n)}async loadAsync(e,t){const i=""===this.path?hd.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||i;const n=new Uu(this.manager);n.setPath(this.path),n.setRequestHeader(this.requestHeader),n.setWithCredentials(this.withCredentials);const r=await n.loadAsync(e,t),s=JSON.parse(r),o=s.metadata;if(void 0===o||void 0===o.type||"geometry"===o.type.toLowerCase())throw new Error("THREE.ObjectLoader: Can't load "+e);return await this.parseAsync(s)}parse(e,t){const i=this.parseAnimations(e.animations),n=this.parseShapes(e.shapes),r=this.parseGeometries(e.geometries,n),s=this.parseImages(e.images,(function(){void 0!==t&&t(l)})),o=this.parseTextures(e.textures,s),a=this.parseMaterials(e.materials,o),l=this.parseObject(e.object,r,a,o,i),c=this.parseSkeletons(e.skeletons,l);if(this.bindSkeletons(l,c),void 0!==t){let e=!1;for(const t in s)if(s[t]instanceof HTMLImageElement){e=!0;break}!1===e&&t(l)}return l}async parseAsync(e){const t=this.parseAnimations(e.animations),i=this.parseShapes(e.shapes),n=this.parseGeometries(e.geometries,i),r=await this.parseImagesAsync(e.images),s=this.parseTextures(e.textures,r),o=this.parseMaterials(e.materials,s),a=this.parseObject(e.object,n,o,s,t),l=this.parseSkeletons(e.skeletons,a);return this.bindSkeletons(a,l),a}parseShapes(e){const t={};if(void 0!==e)for(let i=0,n=e.length;i<n;i++){const n=(new yh).fromJSON(e[i]);t[n.uuid]=n}return t}parseSkeletons(e,t){const i={},n={};if(t.traverse((function(e){e.isBone&&(n[e.uuid]=e)})),void 0!==e)for(let t=0,r=e.length;t<r;t++){const r=(new uc).fromJSON(e[t],n);i[r.uuid]=r}return i}parseGeometries(e,t){const i={};if(void 0!==e){const n=new dd;for(let r=0,s=e.length;r<s;r++){let s;const o=e[r];switch(o.type){case"BufferGeometry":case"InstancedBufferGeometry":s=n.parse(o);break;case"Geometry":console.error("THREE.ObjectLoader: The legacy Geometry type is no longer supported.");break;default:o.type in ou?s=ou[o.type].fromJSON(o,t):console.warn(`THREE.ObjectLoader: Unsupported geometry type "${o.type}"`)}s.uuid=o.uuid,void 0!==o.name&&(s.name=o.name),!0===s.isBufferGeometry&&void 0!==o.userData&&(s.userData=o.userData),i[o.uuid]=s}}return i}parseMaterials(e,t){const i={},n={};if(void 0!==e){const r=new cd;r.setTextures(t);for(let t=0,s=e.length;t<s;t++){const s=e[t];if("MultiMaterial"===s.type){const e=[];for(let t=0;t<s.materials.length;t++){const n=s.materials[t];void 0===i[n.uuid]&&(i[n.uuid]=r.parse(n)),e.push(i[n.uuid])}n[s.uuid]=e}else void 0===i[s.uuid]&&(i[s.uuid]=r.parse(s)),n[s.uuid]=i[s.uuid]}}return n}parseAnimations(e){const t={};if(void 0!==e)for(let i=0;i<e.length;i++){const n=e[i],r=Lu.parse(n);t[r.uuid]=r}return t}parseImages(e,t){const i=this,n={};let r;function s(e){if("string"==typeof e){const t=e;return function(e){return i.manager.itemStart(e),r.load(e,(function(){i.manager.itemEnd(e)}),void 0,(function(){i.manager.itemError(e),i.manager.itemEnd(e)}))}(/^(\/\/)|([a-z]+:(\/\/)?)/i.test(t)?t:i.resourcePath+t)}return e.data?{data:Qi(e.type,e.data),width:e.width,height:e.height}:null}if(void 0!==e&&e.length>0){const i=new Ou(t);r=new zu(i),r.setCrossOrigin(this.crossOrigin);for(let t=0,i=e.length;t<i;t++){const i=e[t],r=i.url;if(Array.isArray(r)){n[i.uuid]=[];for(let e=0,t=r.length;e<t;e++){const t=s(r[e]);null!==t&&(t instanceof HTMLImageElement?n[i.uuid].push(t):n[i.uuid].push(new lc(t.data,t.width,t.height)))}}else{const e=s(i.url);null!==e&&(n[i.uuid]=e)}}}return n}async parseImagesAsync(e){const t=this,i={};let n;async function r(e){if("string"==typeof e){const i=e,r=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(i)?i:t.resourcePath+i;return await n.loadAsync(r)}return e.data?{data:Qi(e.type,e.data),width:e.width,height:e.height}:null}if(void 0!==e&&e.length>0){n=new zu(this.manager),n.setCrossOrigin(this.crossOrigin);for(let t=0,n=e.length;t<n;t++){const n=e[t],s=n.url;if(Array.isArray(s)){i[n.uuid]=[];for(let e=0,t=s.length;e<t;e++){const t=s[e],o=await r(t);null!==o&&(o instanceof HTMLImageElement?i[n.uuid].push(o):i[n.uuid].push(new lc(o.data,o.width,o.height)))}}else{const e=await r(n.url);null!==e&&(i[n.uuid]=e)}}}return i}parseTextures(e,t){function i(e,t){return"number"==typeof e?e:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",e),t[e])}const n={};if(void 0!==e)for(let r=0,s=e.length;r<s;r++){const s=e[r];let o;void 0===s.image&&console.warn('THREE.ObjectLoader: No "image" specified for',s.uuid),void 0===t[s.image]&&console.warn("THREE.ObjectLoader: Undefined image",s.image);const a=t[s.image];Array.isArray(a)?(o=new Ds(a),6===a.length&&(o.needsUpdate=!0)):(o=a&&a.data?new lc(a.data,a.width,a.height):new on(a),a&&(o.needsUpdate=!0)),o.uuid=s.uuid,void 0!==s.name&&(o.name=s.name),void 0!==s.mapping&&(o.mapping=i(s.mapping,pd)),void 0!==s.offset&&o.offset.fromArray(s.offset),void 0!==s.repeat&&o.repeat.fromArray(s.repeat),void 0!==s.center&&o.center.fromArray(s.center),void 0!==s.rotation&&(o.rotation=s.rotation),void 0!==s.wrap&&(o.wrapS=i(s.wrap[0],fd),o.wrapT=i(s.wrap[1],fd)),void 0!==s.format&&(o.format=s.format),void 0!==s.type&&(o.type=s.type),void 0!==s.encoding&&(o.encoding=s.encoding),void 0!==s.minFilter&&(o.minFilter=i(s.minFilter,gd)),void 0!==s.magFilter&&(o.magFilter=i(s.magFilter,gd)),void 0!==s.anisotropy&&(o.anisotropy=s.anisotropy),void 0!==s.flipY&&(o.flipY=s.flipY),void 0!==s.premultiplyAlpha&&(o.premultiplyAlpha=s.premultiplyAlpha),void 0!==s.unpackAlignment&&(o.unpackAlignment=s.unpackAlignment),void 0!==s.userData&&(o.userData=s.userData),n[s.uuid]=o}return n}parseObject(e,t,i,n,r){let s,o,a;function l(e){return void 0===t[e]&&console.warn("THREE.ObjectLoader: Undefined geometry",e),t[e]}function c(e){if(void 0!==e){if(Array.isArray(e)){const t=[];for(let n=0,r=e.length;n<r;n++){const r=e[n];void 0===i[r]&&console.warn("THREE.ObjectLoader: Undefined material",r),t.push(i[r])}return t}return void 0===i[e]&&console.warn("THREE.ObjectLoader: Undefined material",e),i[e]}}function h(e){return void 0===n[e]&&console.warn("THREE.ObjectLoader: Undefined texture",e),n[e]}switch(e.type){case"Scene":s=new Dl,void 0!==e.background&&(Number.isInteger(e.background)?s.background=new Fr(e.background):s.background=h(e.background)),void 0!==e.environment&&(s.environment=h(e.environment)),void 0!==e.fog&&("Fog"===e.fog.type?s.fog=new Rl(e.fog.color,e.fog.near,e.fog.far):"FogExp2"===e.fog.type&&(s.fog=new Ll(e.fog.color,e.fog.density)));break;case"PerspectiveCamera":s=new Ps(e.fov,e.aspect,e.near,e.far),void 0!==e.focus&&(s.focus=e.focus),void 0!==e.zoom&&(s.zoom=e.zoom),void 0!==e.filmGauge&&(s.filmGauge=e.filmGauge),void 0!==e.filmOffset&&(s.filmOffset=e.filmOffset),void 0!==e.view&&(s.view=Object.assign({},e.view));break;case"OrthographicCamera":s=new Qs(e.left,e.right,e.top,e.bottom,e.near,e.far),void 0!==e.zoom&&(s.zoom=e.zoom),void 0!==e.view&&(s.view=Object.assign({},e.view));break;case"AmbientLight":s=new sd(e.color,e.intensity);break;case"DirectionalLight":s=new rd(e.color,e.intensity);break;case"PointLight":s=new id(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":s=new od(e.color,e.intensity,e.width,e.height);break;case"SpotLight":s=new $u(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":s=new Wu(e.color,e.groundColor,e.intensity);break;case"LightProbe":s=(new ld).fromJSON(e);break;case"SkinnedMesh":o=l(e.geometry),a=c(e.material),s=new oc(o,a),void 0!==e.bindMode&&(s.bindMode=e.bindMode),void 0!==e.bindMatrix&&s.bindMatrix.fromArray(e.bindMatrix),void 0!==e.skeleton&&(s.skeleton=e.skeleton);break;case"Mesh":o=l(e.geometry),a=c(e.material),s=new bs(o,a);break;case"InstancedMesh":o=l(e.geometry),a=c(e.material);const t=e.count,i=e.instanceMatrix,n=e.instanceColor;s=new vc(o,a,t),s.instanceMatrix=new dc(new Float32Array(i.array),16),void 0!==n&&(s.instanceColor=new dc(new Float32Array(n.array),n.itemSize));break;case"LOD":s=new ec;break;case"Line":s=new Tc(l(e.geometry),c(e.material));break;case"LineLoop":s=new Cc(l(e.geometry),c(e.material));break;case"LineSegments":s=new Ac(l(e.geometry),c(e.material));break;case"PointCloud":case"Points":s=new Ic(l(e.geometry),c(e.material));break;case"Sprite":s=new Kl(c(e.material));break;case"Group":s=new Ml;break;case"Bone":s=new ac;break;default:s=new fr}if(s.uuid=e.uuid,void 0!==e.name&&(s.name=e.name),void 0!==e.matrix?(s.matrix.fromArray(e.matrix),void 0!==e.matrixAutoUpdate&&(s.matrixAutoUpdate=e.matrixAutoUpdate),s.matrixAutoUpdate&&s.matrix.decompose(s.position,s.quaternion,s.scale)):(void 0!==e.position&&s.position.fromArray(e.position),void 0!==e.rotation&&s.rotation.fromArray(e.rotation),void 0!==e.quaternion&&s.quaternion.fromArray(e.quaternion),void 0!==e.scale&&s.scale.fromArray(e.scale)),void 0!==e.castShadow&&(s.castShadow=e.castShadow),void 0!==e.receiveShadow&&(s.receiveShadow=e.receiveShadow),e.shadow&&(void 0!==e.shadow.bias&&(s.shadow.bias=e.shadow.bias),void 0!==e.shadow.normalBias&&(s.shadow.normalBias=e.shadow.normalBias),void 0!==e.shadow.radius&&(s.shadow.radius=e.shadow.radius),void 0!==e.shadow.mapSize&&s.shadow.mapSize.fromArray(e.shadow.mapSize),void 0!==e.shadow.camera&&(s.shadow.camera=this.parseObject(e.shadow.camera))),void 0!==e.visible&&(s.visible=e.visible),void 0!==e.frustumCulled&&(s.frustumCulled=e.frustumCulled),void 0!==e.renderOrder&&(s.renderOrder=e.renderOrder),void 0!==e.userData&&(s.userData=e.userData),void 0!==e.layers&&(s.layers.mask=e.layers),void 0!==e.children){const o=e.children;for(let e=0;e<o.length;e++)s.add(this.parseObject(o[e],t,i,n,r))}if(void 0!==e.animations){const t=e.animations;for(let e=0;e<t.length;e++){const i=t[e];s.animations.push(r[i])}}if("LOD"===e.type){void 0!==e.autoUpdate&&(s.autoUpdate=e.autoUpdate);const t=e.levels;for(let e=0;e<t.length;e++){const i=t[e],n=s.getObjectByProperty("uuid",i.object);void 0!==n&&s.addLevel(n,i.distance)}}return s}bindSkeletons(e,t){0!==Object.keys(t).length&&e.traverse((function(e){if(!0===e.isSkinnedMesh&&void 0!==e.skeleton){const i=t[e.skeleton];void 0===i?console.warn("THREE.ObjectLoader: No skeleton found with UUID:",e.skeleton):e.bind(i,e.bindMatrix)}}))}setTexturePath(e){return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(e)}}const pd={UVMapping:re,CubeReflectionMapping:se,CubeRefractionMapping:oe,EquirectangularReflectionMapping:ae,EquirectangularRefractionMapping:le,CubeUVReflectionMapping:ce,CubeUVRefractionMapping:he},fd={RepeatWrapping:ue,ClampToEdgeWrapping:de,MirroredRepeatWrapping:me},gd={NearestFilter:pe,NearestMipmapNearestFilter:fe,NearestMipmapLinearFilter:ve,LinearFilter:_e,LinearMipmapNearestFilter:xe,LinearMipmapLinearFilter:we};class vd extends Fu{constructor(e){super(e),"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,i,n){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);const r=this,s=Du.get(e);if(void 0!==s)return r.manager.itemStart(e),setTimeout((function(){t&&t(s),r.manager.itemEnd(e)}),0),s;const o={};o.credentials="anonymous"===this.crossOrigin?"same-origin":"include",o.headers=this.requestHeader,fetch(e,o).then((function(e){return e.blob()})).then((function(e){return createImageBitmap(e,Object.assign(r.options,{colorSpaceConversion:"none"}))})).then((function(i){Du.add(e,i),t&&t(i),r.manager.itemEnd(e)})).catch((function(t){n&&n(t),r.manager.itemError(e),r.manager.itemEnd(e)})),r.manager.itemStart(e)}}let yd;vd.prototype.isImageBitmapLoader=!0;const _d={getContext:function(){return void 0===yd&&(yd=new(window.AudioContext||window.webkitAudioContext)),yd},setContext:function(e){yd=e}};class xd extends Fu{constructor(e){super(e)}load(e,t,i,n){const r=this,s=new Uu(this.manager);s.setResponseType("arraybuffer"),s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,(function(i){try{const e=i.slice(0);_d.getContext().decodeAudioData(e,(function(e){t(e)}))}catch(t){n?n(t):console.error(t),r.manager.itemError(e)}}),i,n)}}class bd extends ld{constructor(e,t,i=1){super(void 0,i);const n=(new Fr).set(e),r=(new Fr).set(t),s=new mn(n.r,n.g,n.b),o=new mn(r.r,r.g,r.b),a=Math.sqrt(Math.PI),l=a*Math.sqrt(.75);this.sh.coefficients[0].copy(s).add(o).multiplyScalar(a),this.sh.coefficients[1].copy(s).sub(o).multiplyScalar(l)}}bd.prototype.isHemisphereLightProbe=!0;class wd extends ld{constructor(e,t=1){super(void 0,t);const i=(new Fr).set(e);this.sh.coefficients[0].set(i.r,i.g,i.b).multiplyScalar(2*Math.sqrt(Math.PI))}}wd.prototype.isAmbientLightProbe=!0;const Md=new Hn,Td=new Hn;class Sd{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Ps,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Ps,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep;const i=e.projectionMatrix.clone(),n=t.eyeSep/2,r=n*t.near/t.focus,s=t.near*Math.tan(Ui*t.fov*.5)/t.zoom;let o,a;Td.elements[12]=-n,Md.elements[12]=n,o=-s*t.aspect+r,a=s*t.aspect+r,i.elements[0]=2*t.near/(a-o),i.elements[8]=(a+o)/(a-o),this.cameraL.projectionMatrix.copy(i),o=-s*t.aspect-r,a=s*t.aspect-r,i.elements[0]=2*t.near/(a-o),i.elements[8]=(a+o)/(a-o),this.cameraR.projectionMatrix.copy(i)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Td),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Md)}}class Ed{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=Ad(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=Ad();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function Ad(){return("undefined"==typeof performance?Date:performance).now()}const Cd=new mn,Pd=new dn,Ld=new mn,Rd=new mn;class Dd extends fr{constructor(){super(),this.type="AudioListener",this.context=_d.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new Ed}getInput(){return this.gain}removeFilter(){return null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener,i=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(Cd,Pd,Ld),Rd.set(0,0,-1).applyQuaternion(Pd),t.positionX){const e=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(Cd.x,e),t.positionY.linearRampToValueAtTime(Cd.y,e),t.positionZ.linearRampToValueAtTime(Cd.z,e),t.forwardX.linearRampToValueAtTime(Rd.x,e),t.forwardY.linearRampToValueAtTime(Rd.y,e),t.forwardZ.linearRampToValueAtTime(Rd.z,e),t.upX.linearRampToValueAtTime(i.x,e),t.upY.linearRampToValueAtTime(i.y,e),t.upZ.linearRampToValueAtTime(i.z,e)}else t.setPosition(Cd.x,Cd.y,Cd.z),t.setOrientation(Rd.x,Rd.y,Rd.z,i.x,i.y,i.z)}}class Od extends fr{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(!0===this.isPlaying)return void console.warn("THREE.Audio: Audio is already playing.");if(!1===this.hasPlaybackControl)return void console.warn("THREE.Audio: this Audio has no playback control.");this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,!0===this.loop&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")}stop(){if(!1!==this.hasPlaybackControl)return this._progress=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}getFilters(){return this.filters}setFilters(e){return e||(e=[]),!0===this._connected?(this.disconnect(),this.filters=e.slice(),this.connect()):this.filters=e.slice(),this}setDetune(e){if(this.detune=e,void 0!==this.source.detune)return!0===this.isPlaying&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(e){return this.setFilters(e?[e]:[])}setPlaybackRate(e){if(!1!==this.hasPlaybackControl)return this.playbackRate=e,!0===this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this;console.warn("THREE.Audio: this Audio has no playback control.")}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1}getLoop(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop}setLoop(e){if(!1!==this.hasPlaybackControl)return this.loop=e,!0===this.isPlaying&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")}setLoopStart(e){return this.loopStart=e,this}setLoopEnd(e){return this.loopEnd=e,this}getVolume(){return this.gain.gain.value}setVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}}const Id=new mn,Fd=new dn,Vd=new mn,Ud=new mn;class Bd extends Od{constructor(e){super(e),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}getOutput(){return this.panner}getRefDistance(){return this.panner.refDistance}setRefDistance(e){return this.panner.refDistance=e,this}getRolloffFactor(){return this.panner.rolloffFactor}setRolloffFactor(e){return this.panner.rolloffFactor=e,this}getDistanceModel(){return this.panner.distanceModel}setDistanceModel(e){return this.panner.distanceModel=e,this}getMaxDistance(){return this.panner.maxDistance}setMaxDistance(e){return this.panner.maxDistance=e,this}setDirectionalCone(e,t,i){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=t,this.panner.coneOuterGain=i,this}updateMatrixWorld(e){if(super.updateMatrixWorld(e),!0===this.hasPlaybackControl&&!1===this.isPlaying)return;this.matrixWorld.decompose(Id,Fd,Vd),Ud.set(0,0,1).applyQuaternion(Fd);const t=this.panner;if(t.positionX){const e=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(Id.x,e),t.positionY.linearRampToValueAtTime(Id.y,e),t.positionZ.linearRampToValueAtTime(Id.z,e),t.orientationX.linearRampToValueAtTime(Ud.x,e),t.orientationY.linearRampToValueAtTime(Ud.y,e),t.orientationZ.linearRampToValueAtTime(Ud.z,e)}else t.setPosition(Id.x,Id.y,Id.z),t.setOrientation(Ud.x,Ud.y,Ud.z)}}class Nd{constructor(e,t=2048){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=t,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let e=0;const t=this.getFrequencyData();for(let i=0;i<t.length;i++)e+=t[i];return e/t.length}}class zd{constructor(e,t,i){let n,r,s;switch(this.binding=e,this.valueSize=i,t){case"quaternion":n=this._slerp,r=this._slerpAdditive,s=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(6*i),this._workIndex=5;break;case"string":case"bool":n=this._select,r=this._select,s=this._setAdditiveIdentityOther,this.buffer=new Array(5*i);break;default:n=this._lerp,r=this._lerpAdditive,s=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(5*i)}this._mixBufferRegion=n,this._mixBufferRegionAdditive=r,this._setIdentity=s,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(e,t){const i=this.buffer,n=this.valueSize,r=e*n+n;let s=this.cumulativeWeight;if(0===s){for(let e=0;e!==n;++e)i[r+e]=i[e];s=t}else{s+=t;const e=t/s;this._mixBufferRegion(i,r,0,e,n)}this.cumulativeWeight=s}accumulateAdditive(e){const t=this.buffer,i=this.valueSize,n=i*this._addIndex;0===this.cumulativeWeightAdditive&&this._setIdentity(),this._mixBufferRegionAdditive(t,n,0,e,i),this.cumulativeWeightAdditive+=e}apply(e){const t=this.valueSize,i=this.buffer,n=e*t+t,r=this.cumulativeWeight,s=this.cumulativeWeightAdditive,o=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,r<1){const e=t*this._origIndex;this._mixBufferRegion(i,n,e,1-r,t)}s>0&&this._mixBufferRegionAdditive(i,n,this._addIndex*t,1,t);for(let e=t,r=t+t;e!==r;++e)if(i[e]!==i[e+t]){o.setValue(i,n);break}}saveOriginalState(){const e=this.binding,t=this.buffer,i=this.valueSize,n=i*this._origIndex;e.getValue(t,n);for(let e=i,r=n;e!==r;++e)t[e]=t[n+e%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=3*this.valueSize;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let i=e;i<t;i++)this.buffer[i]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const e=this._origIndex*this.valueSize,t=this._addIndex*this.valueSize;for(let i=0;i<this.valueSize;i++)this.buffer[t+i]=this.buffer[e+i]}_select(e,t,i,n,r){if(n>=.5)for(let n=0;n!==r;++n)e[t+n]=e[i+n]}_slerp(e,t,i,n){dn.slerpFlat(e,t,e,t,e,i,n)}_slerpAdditive(e,t,i,n,r){const s=this._workIndex*r;dn.multiplyQuaternionsFlat(e,s,e,t,e,i),dn.slerpFlat(e,t,e,t,e,s,n)}_lerp(e,t,i,n,r){const s=1-n;for(let o=0;o!==r;++o){const r=t+o;e[r]=e[r]*s+e[i+o]*n}}_lerpAdditive(e,t,i,n,r){for(let s=0;s!==r;++s){const r=t+s;e[r]=e[r]+e[i+s]*n}}}const kd="\\[\\]\\.:\\/",Gd=new RegExp("["+kd+"]","g"),jd="[^"+kd+"]",Hd="[^"+kd.replace("\\.","")+"]",Wd=/((?:WC+[\/:])*)/.source.replace("WC",jd),qd=/(WCOD+)?/.source.replace("WCOD",Hd),Xd=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",jd),Zd=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",jd),Yd=new RegExp("^"+Wd+qd+Xd+Zd+"$"),Kd=["material","materials","bones"];class $d{constructor(e,t,i){this.path=t,this.parsedPath=i||$d.parseTrackName(t),this.node=$d.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,i){return e&&e.isAnimationObjectGroup?new $d.Composite(e,t,i):new $d(e,t,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(Gd,"")}static parseTrackName(e){const t=Yd.exec(e);if(!t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const i={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},n=i.nodeName&&i.nodeName.lastIndexOf(".");if(void 0!==n&&-1!==n){const e=i.nodeName.substring(n+1);-1!==Kd.indexOf(e)&&(i.nodeName=i.nodeName.substring(0,n),i.objectName=e)}if(null===i.propertyName||0===i.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return i}static findNode(e,t){if(!t||""===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){const i=e.skeleton.getBoneByName(t);if(void 0!==i)return i}if(e.children){const i=function(e){for(let n=0;n<e.length;n++){const r=e[n];if(r.name===t||r.uuid===t)return r;const s=i(r.children);if(s)return s}return null},n=i(e.children);if(n)return n}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){const i=this.resolvedProperty;for(let n=0,r=i.length;n!==r;++n)e[t++]=i[n]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){const i=this.resolvedProperty;for(let n=0,r=i.length;n!==r;++n)i[n]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const i=this.resolvedProperty;for(let n=0,r=i.length;n!==r;++n)i[n]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){const i=this.resolvedProperty;for(let n=0,r=i.length;n!==r;++n)i[n]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node;const t=this.parsedPath,i=t.objectName,n=t.propertyName;let r=t.propertyIndex;if(e||(e=$d.findNode(this.rootNode,t.nodeName)||this.rootNode,this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e)return void console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.");if(i){let n=t.objectIndex;switch(i){case"materials":if(!e.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);e=e.material.materials;break;case"bones":if(!e.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);e=e.skeleton.bones;for(let t=0;t<e.length;t++)if(e[t].name===n){n=t;break}break;default:if(void 0===e[i])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);e=e[i]}if(void 0!==n){if(void 0===e[n])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);e=e[n]}}const s=e[n];if(void 0===s){const i=t.nodeName;return void console.error("THREE.PropertyBinding: Trying to update property for track: "+i+"."+n+" but it wasn't found.",e)}let o=this.Versioning.None;this.targetObject=e,void 0!==e.needsUpdate?o=this.Versioning.NeedsUpdate:void 0!==e.matrixWorldNeedsUpdate&&(o=this.Versioning.MatrixWorldNeedsUpdate);let a=this.BindingType.Direct;if(void 0!==r){if("morphTargetInfluences"===n){if(!e.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!e.geometry.isBufferGeometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences on THREE.Geometry. Use THREE.BufferGeometry instead.",this);if(!e.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);void 0!==e.morphTargetDictionary[r]&&(r=e.morphTargetDictionary[r])}a=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=r}else void 0!==s.fromArray&&void 0!==s.toArray?(a=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(a=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=n;this.getValue=this.GetterByBindingType[a],this.setValue=this.SetterByBindingTypeAndVersioning[a][o]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}$d.Composite=class{constructor(e,t,i){const n=i||$d.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,n)}getValue(e,t){this.bind();const i=this._targetGroup.nCachedObjects_,n=this._bindings[i];void 0!==n&&n.getValue(e,t)}setValue(e,t){const i=this._bindings;for(let n=this._targetGroup.nCachedObjects_,r=i.length;n!==r;++n)i[n].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].unbind()}},$d.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},$d.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},$d.prototype.GetterByBindingType=[$d.prototype._getValue_direct,$d.prototype._getValue_array,$d.prototype._getValue_arrayElement,$d.prototype._getValue_toArray],$d.prototype.SetterByBindingTypeAndVersioning=[[$d.prototype._setValue_direct,$d.prototype._setValue_direct_setNeedsUpdate,$d.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[$d.prototype._setValue_array,$d.prototype._setValue_array_setNeedsUpdate,$d.prototype._setValue_array_setMatrixWorldNeedsUpdate],[$d.prototype._setValue_arrayElement,$d.prototype._setValue_arrayElement_setNeedsUpdate,$d.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[$d.prototype._setValue_fromArray,$d.prototype._setValue_fromArray_setNeedsUpdate,$d.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class Jd{constructor(){this.uuid=ki(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;const e={};this._indicesByUUID=e;for(let t=0,i=arguments.length;t!==i;++t)e[arguments[t].uuid]=t;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};const t=this;this.stats={objects:{get total(){return t._objects.length},get inUse(){return this.total-t.nCachedObjects_}},get bindingsPerObject(){return t._bindings.length}}}add(){const e=this._objects,t=this._indicesByUUID,i=this._paths,n=this._parsedPaths,r=this._bindings,s=r.length;let o,a=e.length,l=this.nCachedObjects_;for(let c=0,h=arguments.length;c!==h;++c){const h=arguments[c],u=h.uuid;let d=t[u];if(void 0===d){d=a++,t[u]=d,e.push(h);for(let e=0,t=s;e!==t;++e)r[e].push(new $d(h,i[e],n[e]))}else if(d<l){o=e[d];const a=--l,c=e[a];t[c.uuid]=d,e[d]=c,t[u]=a,e[a]=h;for(let e=0,t=s;e!==t;++e){const t=r[e],s=t[a];let o=t[d];t[d]=s,void 0===o&&(o=new $d(h,i[e],n[e])),t[a]=o}}else e[d]!==o&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=l}remove(){const e=this._objects,t=this._indicesByUUID,i=this._bindings,n=i.length;let r=this.nCachedObjects_;for(let s=0,o=arguments.length;s!==o;++s){const o=arguments[s],a=o.uuid,l=t[a];if(void 0!==l&&l>=r){const s=r++,c=e[s];t[c.uuid]=l,e[l]=c,t[a]=s,e[s]=o;for(let e=0,t=n;e!==t;++e){const t=i[e],n=t[s],r=t[l];t[l]=n,t[s]=r}}}this.nCachedObjects_=r}uncache(){const e=this._objects,t=this._indicesByUUID,i=this._bindings,n=i.length;let r=this.nCachedObjects_,s=e.length;for(let o=0,a=arguments.length;o!==a;++o){const a=arguments[o].uuid,l=t[a];if(void 0!==l)if(delete t[a],l<r){const o=--r,a=e[o],c=--s,h=e[c];t[a.uuid]=l,e[l]=a,t[h.uuid]=o,e[o]=h,e.pop();for(let e=0,t=n;e!==t;++e){const t=i[e],n=t[o],r=t[c];t[l]=n,t[o]=r,t.pop()}}else{const r=--s,o=e[r];r>0&&(t[o.uuid]=l),e[l]=o,e.pop();for(let e=0,t=n;e!==t;++e){const t=i[e];t[l]=t[r],t.pop()}}}this.nCachedObjects_=r}subscribe_(e,t){const i=this._bindingsIndicesByPath;let n=i[e];const r=this._bindings;if(void 0!==n)return r[n];const s=this._paths,o=this._parsedPaths,a=this._objects,l=a.length,c=this.nCachedObjects_,h=new Array(l);n=r.length,i[e]=n,s.push(e),o.push(t),r.push(h);for(let i=c,n=a.length;i!==n;++i){const n=a[i];h[i]=new $d(n,e,t)}return h}unsubscribe_(e){const t=this._bindingsIndicesByPath,i=t[e];if(void 0!==i){const n=this._paths,r=this._parsedPaths,s=this._bindings,o=s.length-1,a=s[o];t[e[o]]=i,s[i]=a,s.pop(),r[i]=r[o],r.pop(),n[i]=n[o],n.pop()}}}Jd.prototype.isAnimationObjectGroup=!0;class Qd{constructor(e,t,i=null,n=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=i,this.blendMode=n;const r=t.tracks,s=r.length,o=new Array(s),a={endingStart:Gt,endingEnd:Gt};for(let e=0;e!==s;++e){const t=r[e].createInterpolant(null);o[e]=t,t.settings=a}this._interpolantSettings=a,this._interpolants=o,this._propertyBindings=new Array(s),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=Ut,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}
vendor: 4,126 bytes, line 949
949fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,i){if(e.fadeOut(t),this.fadeIn(t),i){const i=this._clip.duration,n=e._clip.duration,r=n/i,s=i/n;e.warp(1,r,t),this.warp(s,1,t)}return this}crossFadeTo(e,t,i){return e.crossFadeFrom(this,t,i)}stopFading(){const e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,i){const n=this._mixer,r=n.time,s=this.timeScale;let o=this._timeScaleInterpolant;null===o&&(o=n._lendControlInterpolant(),this._timeScaleInterpolant=o);const a=o.parameterPositions,l=o.sampleValues;return a[0]=r,a[1]=r+i,l[0]=e/s,l[1]=t/s,this}stopWarping(){const e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,i,n){if(!this.enabled)return void this._updateWeight(e);const r=this._startTime;if(null!==r){const n=(e-r)*i;if(n<0||0===i)return;this._startTime=null,t=i*n}t*=this._updateTimeScale(e);const s=this._updateTime(t),o=this._updateWeight(e);if(o>0){const e=this._interpolants,t=this._propertyBindings;if(this.blendMode===qt)for(let i=0,n=e.length;i!==n;++i)e[i].evaluate(s),t[i].accumulateAdditive(o);else for(let i=0,r=e.length;i!==r;++i)e[i].evaluate(s),t[i].accumulate(n,o)}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const i=this._weightInterpolant;if(null!==i){const n=i.evaluate(e)[0];t*=n,e>i.parameterPositions[1]&&(this.stopFading(),0===n&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const i=this._timeScaleInterpolant;null!==i&&(t*=i.evaluate(e)[0],e>i.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t))}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,i=this.loop;let n=this.time+e,r=this._loopCount;const s=i===Bt;if(0===e)return-1===r||!s||1&~r?n:t-n;if(i===Vt){-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(n>=t)n=t;else{if(!(n<0)){this.time=n;break e}n=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===r&&(e>=0?(r=0,this._setEndings(!0,0===this.repetitions,s)):this._setEndings(0===this.repetitions,!0,s)),n>=t||n<0){const i=Math.floor(n/t);n-=t*i,r+=Math.abs(i);const o=this.repetitions-r;if(o<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,n=e>0?t:0,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(1===o){const t=e<0;this._setEndings(t,!t,s)}else this._setEndings(!1,!1,s);this._loopCount=r,this.time=n,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:i})}}else this.time=n;if(s&&!(1&~r))return t-n}return n}_setEndings(e,t,i){const n=this._interpolantSettings;i?(n.endingStart=jt,n.endingEnd=jt):(n.endingStart=e?this.zeroSlopeAtStart?jt:Gt:Ht,n.endingEnd=t?this.zeroSlopeAtEnd?jt:Gt:Ht)}_scheduleFading(e,t,i){const n=this._mixer,r=n.time;let s=this._weightInterpolant;null===s&&(s=n._lendControlInterpolant(),this._weightInterpolant=s);const o=s.parameterPositions,a=s.sampleValues;return o[0]=r,a[0]=t,o[1]=r+e,a[1]=i,this}}class em extends Fi{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const i=e._localRoot||this._root,n=e._clip.tracks,r=n.length,s=e._propertyBindings,o=e._interpolants,a=i.uuid,l=this._bindingsByRootAndName;let c=l[a];void 0===c&&(c={},l[a]=c);for(let e=0;e!==r;++e){const r=n[e],l=r.name;let h=c[l];if(void 0!==h)s[e]=h;
vendor: 7,334 bytes, line 949
949else{if(h=s[e],void 0!==h){null===h._cacheIndex&&(++h.referenceCount,this._addInactiveBinding(h,a,l));continue}const n=t&&t._propertyBindings[e].binding.parsedPath;h=new zd($d.create(i,l,n),r.ValueTypeName,r.getValueSize()),++h.referenceCount,this._addInactiveBinding(h,a,l),s[e]=h}o[e].resultBuffer=h.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){const t=(e._localRoot||this._root).uuid,i=e._clip.uuid,n=this._actionsByClip[i];this._bindAction(e,n&&n.knownActions[0]),this._addInactiveAction(e,i,t)}const t=e._propertyBindings;for(let e=0,i=t.length;e!==i;++e){const i=t[e];0==i.useCount++&&(this._lendBinding(i),i.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let e=0,i=t.length;e!==i;++e){const i=t[e];0==--i.useCount&&(i.restoreOriginalState(),this._takeBackBinding(i))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return null!==t&&t<this._nActiveActions}_addInactiveAction(e,t,i){const n=this._actions,r=this._actionsByClip;let s=r[t];if(void 0===s)s={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,r[t]=s;else{const t=s.knownActions;e._byClipCacheIndex=t.length,t.push(e)}e._cacheIndex=n.length,n.push(e),s.actionByRoot[i]=e}_removeInactiveAction(e){const t=this._actions,i=t[t.length-1],n=e._cacheIndex;i._cacheIndex=n,t[n]=i,t.pop(),e._cacheIndex=null;const r=e._clip.uuid,s=this._actionsByClip,o=s[r],a=o.knownActions,l=a[a.length-1],c=e._byClipCacheIndex;l._byClipCacheIndex=c,a[c]=l,a.pop(),e._byClipCacheIndex=null,delete o.actionByRoot[(e._localRoot||this._root).uuid],0===a.length&&delete s[r],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){const t=e._propertyBindings;for(let e=0,i=t.length;e!==i;++e){const i=t[e];0==--i.referenceCount&&this._removeInactiveBinding(i)}}_lendAction(e){const t=this._actions,i=e._cacheIndex,n=this._nActiveActions++,r=t[n];e._cacheIndex=n,t[n]=e,r._cacheIndex=i,t[i]=r}_takeBackAction(e){const t=this._actions,i=e._cacheIndex,n=--this._nActiveActions,r=t[n];e._cacheIndex=n,t[n]=e,r._cacheIndex=i,t[i]=r}_addInactiveBinding(e,t,i){const n=this._bindingsByRootAndName,r=this._bindings;let s=n[t];void 0===s&&(s={},n[t]=s),s[i]=e,e._cacheIndex=r.length,r.push(e)}_removeInactiveBinding(e){const t=this._bindings,i=e.binding,n=i.rootNode.uuid,r=i.path,s=this._bindingsByRootAndName,o=s[n],a=t[t.length-1],l=e._cacheIndex;a._cacheIndex=l,t[l]=a,t.pop(),delete o[r],0===Object.keys(o).length&&delete s[n]}_lendBinding(e){const t=this._bindings,i=e._cacheIndex,n=this._nActiveBindings++,r=t[n];e._cacheIndex=n,t[n]=e,r._cacheIndex=i,t[i]=r}_takeBackBinding(e){const t=this._bindings,i=e._cacheIndex,n=--this._nActiveBindings,r=t[n];e._cacheIndex=n,t[n]=e,r._cacheIndex=i,t[i]=r}_lendControlInterpolant(){const e=this._controlInterpolants,t=this._nActiveControlInterpolants++;let i=e[t];return void 0===i&&(i=new xu(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),i.__cacheIndex=t,e[t]=i),i}_takeBackControlInterpolant(e){const t=this._controlInterpolants,i=e.__cacheIndex,n=--this._nActiveControlInterpolants,r=t[n];e.__cacheIndex=n,t[n]=e,r.__cacheIndex=i,t[i]=r}clipAction(e,t,i){const n=t||this._root,r=n.uuid;let s="string"==typeof e?Lu.findByName(n,e):e;const o=null!==s?s.uuid:e,a=this._actionsByClip[o];let l=null;if(void 0===i&&(i=null!==s?s.blendMode:Wt),void 0!==a){const e=a.actionByRoot[r];if(void 0!==e&&e.blendMode===i)return e;l=a.knownActions[0],null===s&&(s=l._clip)}if(null===s)return null;const c=new Qd(this,s,t,i);return this._bindAction(c,l),this._addInactiveAction(c,o,r),c}existingAction(e,t){const i=t||this._root,n=i.uuid,r="string"==typeof e?Lu.findByName(i,e):e,s=r?r.uuid:e,o=this._actionsByClip[s];return void 0!==o&&o.actionByRoot[n]||null}stopAllAction(){const e=this._actions;for(let t=this._nActiveActions-1;t>=0;--t)e[t].stop();return this}update(e){e*=this.timeScale;const t=this._actions,i=this._nActiveActions,n=this.time+=e,r=Math.sign(e),s=this._accuIndex^=1;for(let o=0;o!==i;++o)t[o]._update(n,e,r,s);const o=this._bindings,a=this._nActiveBindings;for(let e=0;e!==a;++e)o[e].apply(s);return this}setTime(e){this.time=0;for(let e=0;e<this._actions.length;e++)this._actions[e].time=0;return this.update(e)}getRoot(){return this._root}uncacheClip(e){const t=this._actions,i=e.uuid,n=this._actionsByClip,r=n[i];if(void 0!==r){const e=r.knownActions;for(let i=0,n=e.length;i!==n;++i){const n=e[i];this._deactivateAction(n);const r=n._cacheIndex,s=t[t.length-1];n._cacheIndex=null,n._byClipCacheIndex=null,s._cacheIndex=r,t[r]=s,t.pop(),this._removeInactiveBindingsForAction(n)}delete n[i]}}uncacheRoot(e){const t=e.uuid,i=this._actionsByClip;for(const e in i){const n=i[e].actionByRoot[t];void 0!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}const n=this._bindingsByRootAndName[t];if(void 0!==n)for(const e in n){const t=n[e];t.restoreOriginalState(),this._removeInactiveBinding(t)}}uncacheAction(e,t){const i=this.existingAction(e,t);null!==i&&(this._deactivateAction(i),this._removeInactiveAction(i))}}em.prototype._controlInterpolantsResultBuffer=new Float32Array(1);class tm{constructor(e){"string"==typeof e&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),e=arguments[1]),this.value=e}clone(){return new tm(void 0===this.value.clone?this.value:this.value.clone())}}class im extends Ol{constructor(e,t,i=1){super(e,t),this.meshPerAttribute=i}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}clone(e){const t=super.clone(e);return t.meshPerAttribute=this.meshPerAttribute,t}toJSON(e){const t=super.toJSON(e);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}}im.prototype.isInstancedInterleavedBuffer=!0;class nm{constructor(e,t,i,n,r){this.buffer=e,this.type=t,this.itemSize=i,this.elementSize=n,this.count=r,this.version=0}set needsUpdate(e){!0===e&&this.version++}setBuffer(e){return this.buffer=e,this}setType(e,t){return this.type=e,this.elementSize=t,this}setItemSize(e){return this.itemSize=e,this}setCount(e){return this.count=e,this}}nm.prototype.isGLBufferAttribute=!0;class rm{constructor(e,t,i=0,n=1/0){this.ray=new jn(e,t),this.near=i,this.far=n,this.camera=null,this.layers=new tr,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t&&t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t&&t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster:
949Unsupported camera type: "+t.type)}intersectObject(e,t=!0,i=[]){return om(e,this,i,t),i.sort(sm),i}intersectObjects(e,t=!0,i=[]){for(let n=0,r=e.length;n<r;n++)om(e[n],this,i,t);return i.sort(sm),i}}function sm(e,t){return e.distance-t.distance}function om(e,t,i,n){if(e.layers.test(t.layers)&&e.raycast(t,i),!0===n){const n=e.children;for(let e=0,r=n.length;e<r;e++)om(n[e],t,i,!0)}}class am{constructor(e=1,t=0,i=0){return this.radius=e,this.phi=t,this.theta=i,this}set(e,t,i){return this.radius=e,this.phi=t,this.theta=i,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){const e=1e-6;return this.phi=Math.max(e,Math.min(Math.PI-e,this.phi)),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,i){return this.radius=Math.sqrt(e*e+t*t+i*i),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,i),this.phi=Math.acos(Gi(t/this.radius,-1,1))),this}clone(){return(new this.constructor).copy(this)}}class lm{constructor(e=1,t=0,i=0){return this.radius=e,this.theta=t,this.y=i,this}set(e,t,i){return this.radius=e,this.theta=t,this.y=i,this}copy(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,i){return this.radius=Math.sqrt(e*e+i*i),this.theta=Math.atan2(e,i),this.y=t,this}clone(){return(new this.constructor).copy(this)}}const cm=new Yi;class hm{constructor(e=new Yi(1/0,1/0),t=new Yi(-1/0,-1/0)){this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromPoints(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const i=cm.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(e){return this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return cm.copy(e).clamp(this.min,this.max).sub(e).length()}intersect(e){return this.min.max(e.min),this.max.min(e.max),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}hm.prototype.isBox2=!0;const um=new mn,dm=new mn;class mm{constructor(e=new mn,t=new mn){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){um.subVectors(e,this.start),dm.subVectors(this.end,this.start);const i=dm.dot(dm);let n=dm.dot(um)/i;return t&&(n=Gi(n,0,1)),n}closestPointToPoint(e,t,i){const n=this.closestPointToPointParameter(e,t);return this.delta(i).multiplyScalar(n).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return(new this.constructor).copy(this)}}const pm=new mn;class fm extends fr{constructor(e,t){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;
vendor: 7,879 bytes, line 949
949const i=new ns,n=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let e=0,t=1,i=32;e<i;e++,t++){const r=e/i*Math.PI*2,s=t/i*Math.PI*2;n.push(Math.cos(r),Math.sin(r),1,Math.cos(s),Math.sin(s),1)}i.setAttribute("position",new Zr(n,3));const r=new yc({fog:!1,toneMapped:!1});this.cone=new Ac(i,r),this.add(this.cone),this.update()}dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateMatrixWorld();const e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),pm.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(pm),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}const gm=new mn,vm=new Hn,ym=new Hn;class _m extends Ac{constructor(e){const t=xm(e),i=new ns,n=[],r=[],s=new Fr(0,0,1),o=new Fr(0,1,0);for(let e=0;e<t.length;e++){const i=t[e];i.parent&&i.parent.isBone&&(n.push(0,0,0),n.push(0,0,0),r.push(s.r,s.g,s.b),r.push(o.r,o.g,o.b))}i.setAttribute("position",new Zr(n,3)),i.setAttribute("color",new Zr(r,3)),super(i,new yc({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0})),this.type="SkeletonHelper",this.isSkeletonHelper=!0,this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}updateMatrixWorld(e){const t=this.bones,i=this.geometry,n=i.getAttribute("position");ym.copy(this.root.matrixWorld).invert();for(let e=0,i=0;e<t.length;e++){const r=t[e];r.parent&&r.parent.isBone&&(vm.multiplyMatrices(ym,r.matrixWorld),gm.setFromMatrixPosition(vm),n.setXYZ(i,gm.x,gm.y,gm.z),vm.multiplyMatrices(ym,r.parent.matrixWorld),gm.setFromMatrixPosition(vm),n.setXYZ(i+1,gm.x,gm.y,gm.z),i+=2)}i.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(e)}}function xm(e){const t=[];e&&e.isBone&&t.push(e);for(let i=0;i<e.children.length;i++)t.push.apply(t,xm(e.children[i]));return t}class bm extends bs{constructor(e,t,i){super(new Qh(t,4,2),new Vr({wireframe:!0,fog:!1,toneMapped:!1})),this.light=e,this.light.updateMatrixWorld(),this.color=i,this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}dispose(){this.geometry.dispose(),this.material.dispose()}update(){void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)}}const wm=new mn,Mm=new Fr,Tm=new Fr;class Sm extends fr{constructor(e,t,i){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=i;const n=new Kh(t);n.rotateY(.5*Math.PI),this.material=new Vr({wireframe:!0,fog:!1,toneMapped:!1}),void 0===this.color&&(this.material.vertexColors=!0);const r=n.getAttribute("position"),s=new Float32Array(3*r.count);n.setAttribute("color",new Nr(s,3)),this.add(new bs(n,this.material)),this.update()}dispose(){this.children[0].geometry.dispose(),this.children[0].material.dispose()}update(){const e=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{const t=e.geometry.getAttribute("color");Mm.copy(this.light.color),Tm.copy(this.light.groundColor);for(let e=0,i=t.count;e<i;e++){const n=e<i/2?Mm:Tm;t.setXYZ(e,n.r,n.g,n.b)}t.needsUpdate=!0}e.lookAt(wm.setFromMatrixPosition(this.light.matrixWorld).negate())}}class Em extends Ac{constructor(e=10,t=10,i=4473924,n=8947848){i=new Fr(i),n=new Fr(n);const r=t/2,s=e/t,o=e/2,a=[],l=[];for(let e=0,c=0,h=-o;e<=t;e++,h+=s){a.push(-o,0,h,o,0,h),a.push(h,0,-o,h,0,o);const t=e===r?i:n;t.toArray(l,c),c+=3,t.toArray(l,c),c+=3,t.toArray(l,c),c+=3,t.toArray(l,c),c+=3}const c=new ns;c.setAttribute("position",new Zr(a,3)),c.setAttribute("color",new Zr(l,3)),super(c,new yc({vertexColors:!0,toneMapped:!1})),this.type="GridHelper"}}class Am extends Ac{constructor(e=10,t=16,i=8,n=64,r=4473924,s=8947848){r=new Fr(r),s=new Fr(s);const o=[],a=[];for(let i=0;i<=t;i++){const n=i/t*(2*Math.PI),l=Math.sin(n)*e,c=Math.cos(n)*e;o.push(0,0,0),o.push(l,0,c);const h=1&i?r:s;a.push(h.r,h.g,h.b),a.push(h.r,h.g,h.b)}for(let t=0;t<=i;t++){const l=1&t?r:s,c=e-e/i*t;for(let e=0;e<n;e++){let t=e/n*(2*Math.PI),i=Math.sin(t)*c,r=Math.cos(t)*c;o.push(i,0,r),a.push(l.r,l.g,l.b),t=(e+1)/n*(2*Math.PI),i=Math.sin(t)*c,r=Math.cos(t)*c,o.push(i,0,r),a.push(l.r,l.g,l.b)}}const l=new ns;l.setAttribute("position",new Zr(o,3)),l.setAttribute("color",new Zr(a,3)),super(l,new yc({vertexColors:!0,toneMapped:!1})),this.type="PolarGridHelper"}}const Cm=new mn,Pm=new mn,Lm=new mn;class Rm extends fr{constructor(e,t,i){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=i,void 0===t&&(t=1);let n=new ns;n.setAttribute("position",new Zr([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));const r=new yc({fog:!1,toneMapped:!1});this.lightPlane=new Tc(n,r),this.add(this.lightPlane),n=new ns,n.setAttribute("position",new Zr([0,0,0,0,0,1],3)),this.targetLine=new Tc(n,r),this.add(this.targetLine),this.update()}dispose(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}update(){Cm.setFromMatrixPosition(this.light.matrixWorld),Pm.setFromMatrixPosition(this.light.target.matrixWorld),Lm.subVectors(Pm,Cm),this.lightPlane.lookAt(Pm),void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(Pm),this.targetLine.scale.z=Lm.length()}}const Dm=new mn,Om=new Cs;class Im extends Ac{constructor(e){const t=new ns,i=new yc({color:16777215,vertexColors:!0,toneMapped:!1}),n=[],r=[],s={},o=new Fr(16755200),a=new Fr(16711680),l=new Fr(43775),c=new Fr(16777215),h=new Fr(3355443);function u(e,t,i){d(e,i),d(t,i)}function d(e,t){n.push(0,0,0),r.push(t.r,t.g,t.b),void 0===s[e]&&(s[e]=[]),s[e].push(n.length/3-1)}u("n1","n2",o),u("n2","n4",o),u("n4","n3",o),u("n3","n1",o),u("f1","f2",o),u("f2","f4",o),u("f4","f3",o),u("f3","f1",o),u("n1","f1",o),u("n2","f2",o),u("n3","f3",o),u("n4","f4",o),u("p","n1",a),u("p","n2",a),u("p","n3",a),u("p","n4",a),u("u1","u2",l),u("u2","u3",l),u("u3","u1",l),u("c","t",c),u("p","c",h),u("cn1","cn2",h),u("cn3","cn4",h),u("cf1","cf2",h),u("cf3","cf4",h),t.setAttribute("position",new Zr(n,3)),t.setAttribute("color",new Zr(r,3)),super(t,i),this.type="CameraHelper",this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=s,this.update()}update(){const e=this.geometry,t=this.pointMap;Om.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),Fm("c",t,e,Om,0,0,-1),Fm("t",t,e,Om,0,0,1),Fm("n1",t,e,Om,-1,-1,-1),Fm("n2",t,e,Om,1,-1,-1),Fm("n3",t,e,Om,-1,1,-1),Fm("n4",t,e,Om,1,1,-1),Fm("f1",t,e,Om,-1,-1,1),Fm("f2",t,e,Om,1,-1,1),Fm("f3",t,e,Om,-1,1,1),Fm("f4",t,e,Om,1,1,1),Fm("u1",t,e,Om,.7,1.1,-1),Fm("u2",t,e,Om,-.7,1.1,-1),Fm("u3",t,e,Om,0,2,-1),Fm("cf1",t,e,Om,-1,0,1),Fm("cf2",t,e,Om,1,0,1),Fm("cf3",t,e,Om,0,-1,1),Fm("cf4",t,e,Om,0,1,1),Fm("cn1",t,e,Om,-1,0,-1),Fm("cn2",t,e,Om,1,0,-1),Fm("cn3",t,e,Om,0,-1,-1),Fm("cn4",t,e,Om,0,1,-1),e.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}function Fm(e,t,i,n,r,s,o){Dm.set(r,s,o).unproject(n);const a=t[e];if(void 0!==a){const e=i.getAttribute("position");for(let t=0,i=a.length;t<i;t++)e.setXYZ(a[t],Dm.x,Dm.y,Dm.z)}}const Vm=new gn;class Um extends Ac{constructor(e,t=16776960){const i=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),n=new Float32Array(24),r=new ns;r.setIndex(new Nr(i,1)),r.setAttribute("position",new Nr(n,3)),super(r,new yc({color:t,toneMapped:!1})),this.object=e,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(e){if(void 0!==e&&console.warn("THREE.BoxHelper: .update(
949) has no longer arguments."),void 0!==this.object&&Vm.setFromObject(this.object),Vm.isEmpty())return;const t=Vm.min,i=Vm.max,n=this.geometry.attributes.position,r=n.array;r[0]=i.x,r[1]=i.y,r[2]=i.z,r[3]=t.x,r[4]=i.y,r[5]=i.z,r[6]=t.x,r[7]=t.y,r[8]=i.z,r[9]=i.x,r[10]=t.y,r[11]=i.z,r[12]=i.x,r[13]=i.y,r[14]=t.z,r[15]=t.x,r[16]=i.y,r[17]=t.z,r[18]=t.x,r[19]=t.y,r[20]=t.z,r[21]=i.x,r[22]=t.y,r[23]=t.z,n.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(e){return this.object=e,this.update(),this}copy(e){return Ac.prototype.copy.call(this,e),this.object=e.object,this}}class Bm extends Ac{constructor(e,t=16776960){const i=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),n=new ns;n.setIndex(new Nr(i,1)),n.setAttribute("position",new Zr([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),super(n,new yc({color:t,toneMapped:!1})),this.box=e,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(e){const t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(e))}}class Nm extends Tc{constructor(e,t=1,i=16776960){const n=i,r=new ns;r.setAttribute("position",new Zr([1,-1,1,-1,1,1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,0,0,1,0,0,0],3)),r.computeBoundingSphere(),super(r,new yc({color:n,toneMapped:!1})),this.type="PlaneHelper",this.plane=e,this.size=t;const s=new ns;s.setAttribute("position",new Zr([1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],3)),s.computeBoundingSphere(),this.add(new bs(s,new Vr({color:n,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}updateMatrixWorld(e){let t=-this.plane.constant;Math.abs(t)<1e-8&&(t=1e-8),this.scale.set(.5*this.size,.5*this.size,t),this.children[0].material.side=t<0?f:p,this.lookAt(this.plane.normal),super.updateMatrixWorld(e)}}const zm=new mn;let km,Gm;class jm extends fr{constructor(e=new mn(0,0,1),t=new mn(0,0,0),i=1,n=16776960,r=.2*i,s=.2*r){super(),this.type="ArrowHelper",void 0===km&&(km=new ns,km.setAttribute("position",new Zr([0,0,0,0,1,0],3)),Gm=new kc(0,.5,1,5,1),Gm.translate(0,-.5,0)),this.position.copy(t),this.line=new Tc(km,new yc({color:n,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new bs(Gm,new Vr({color:n,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(i,r,s)}setDirection(e){if(e.y>.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{zm.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(zm,t)}}setLength(e,t=.2*e,i=.2*t){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(i,t,i),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}}class Hm extends Ac{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],i=new ns;i.setAttribute("position",new Zr(t,3)),i.setAttribute("color",new Zr([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3)),super(i,new yc({vertexColors:!0,toneMapped:!1})),this.type="AxesHelper"}setColors(e,t,i){const n=new Fr,r=this.geometry.attributes.color.array;return n.set(e),n.toArray(r,0),n.toArray(r,3),n.set(t),n.toArray(r,6),n.toArray(r,9),n.set(i),n.toArray(r,12),n.toArray(r,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class Wm{constructor(){this.type="ShapePath",this.color=new Fr,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new vh,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,i,n){return this.currentPath.quadraticCurveTo(e,t,i,n),this}bezierCurveTo(e,t,i,n,r,s){return this.currentPath.bezierCurveTo(e,t,i,n,r,s),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e,t){function i(e){const t=[];for(let i=0,n=e.length;i<n;i++){const n=e[i],r=new yh;r.curves=n.curves,t.push(r)}return t}function n(e,t){const i=t.length;let n=!1;for(let r=i-1,s=0;s<i;r=s++){let i=t[r],o=t[s],a=o.x-i.x,l=o.y-i.y;
vendor: 5,022 bytes, line 949
949if(Math.abs(l)>Number.EPSILON){if(l<0&&(i=t[s],a=-a,o=t[r],l=-l),e.y<i.y||e.y>o.y)continue;if(e.y===i.y){if(e.x===i.x)return!0}else{const t=l*(e.x-i.x)-a*(e.y-i.y);if(0===t)return!0;if(t<0)continue;n=!n}}else{if(e.y!==i.y)continue;if(o.x<=e.x&&e.x<=i.x||i.x<=e.x&&e.x<=o.x)return!0}}return n}const r=jh.isClockWise,s=this.subPaths;if(0===s.length)return[];if(!0===t)return i(s);let o,a,l;const c=[];if(1===s.length)return a=s[0],l=new yh,l.curves=a.curves,c.push(l),c;let h=!r(s[0].getPoints());h=e?!h:h;const u=[],d=[];let m,p,f=[],g=0;d[g]=void 0,f[g]=[];for(let t=0,i=s.length;t<i;t++)a=s[t],m=a.getPoints(),o=r(m),o=e?!o:o,o?(!h&&d[g]&&g++,d[g]={s:new yh,p:m},d[g].s.curves=a.curves,h&&g++,f[g]=[]):f[g].push({h:a,p:m[0]});if(!d[0])return i(s);if(d.length>1){let e=!1;const t=[];for(let e=0,t=d.length;e<t;e++)u[e]=[];for(let i=0,r=d.length;i<r;i++){const r=f[i];for(let s=0;s<r.length;s++){const o=r[s];let a=!0;for(let r=0;r<d.length;r++)n(o.p,d[r].p)&&(i!==r&&t.push({froms:i,tos:r,hole:s}),a?(a=!1,u[r].push(o)):e=!0);a&&u[i].push(o)}}t.length>0&&(e||(f=u))}for(let e=0,t=d.length;e<t;e++){l=d[e].s,c.push(l),p=f[e];for(let e=0,t=p.length;e<t;e++)l.holes.push(p[e].h)}return c}}const qm=new Float32Array(1),Xm=new Int32Array(qm.buffer);class Zm{static toHalfFloat(e){e>65504&&(console.warn("THREE.DataUtils.toHalfFloat(): value exceeds 65504."),e=65504),qm[0]=e;const t=Xm[0];let i=t>>16&32768,n=t>>12&2047;const r=t>>23&255;return r<103?i:r>142?(i|=31744,i|=(255==r?0:1)&&8388607&t,i):r<113?(n|=2048,i|=(n>>114-r)+(n>>113-r&1),i):(i|=r-112<<10|n>>1,i+=1&n,i)}}const Ym=0,Km=1,$m=0,Jm=1,Qm=2;function ep(e){return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."),e}function tp(e=[]){return console.warn("THREE.MultiMaterial has been removed. Use an Array instead."),e.isMultiMaterial=!0,e.materials=e,e.clone=function(){return e.slice()},e}function ip(e,t){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new Ic(e,t)}function np(e){return console.warn("THREE.Particle has been renamed to THREE.Sprite."),new Kl(e)}function rp(e,t){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new Ic(e,t)}function sp(e){return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),new Pc(e)}function op(e){return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),new Pc(e)}function ap(e){return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),new Pc(e)}function lp(e,t,i){return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),new mn(e,t,i)}function cp(e,t){return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setUsage( THREE.DynamicDrawUsage ) instead."),new Nr(e,t).setUsage(Si)}function hp(e,t){return console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."),new zr(e,t)}function up(e,t){return console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."),new kr(e,t)}function dp(e,t){return console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."),new Gr(e,t)}function mp(e,t){return console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."),new jr(e,t)}function pp(e,t){return console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."),new Hr(e,t)}function fp(e,t){return console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."),new Wr(e,t)}function gp(e,t){return console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."),new qr(e,t)}function vp(e,t){return console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."),new Zr(e,t)}function yp(e,t){return console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."),new Yr(e,t)}function _p(e){return console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper."),new Hm(e)}function xp(e,t){return console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."),new Um(e,t)}function bp(e,t){return console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."),new Ac(new Yc(e.geometry),new yc({color:void 0!==t?t:16777215}))}function wp(e,t){return console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."),new Ac(new ru(e.geometry),new yc({color:void 0!==t?t:16777215}))}function Mp(e){return console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."),new Uu(e)}function Tp(e){return console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."),new Gu(e)}function Sp(e,t,i){return console.warn("THREE.WebGLRenderTargetCube( width, height, options ) is now WebGLCubeRen
949derTarget( size, options )."),new Os(e,i)}function Ep(){console.error("THREE.CanvasRenderer has been removed")}function Ap(){console.error("THREE.JSONLoader has been removed.")}Kc.create=function(e,t){return console.log("THREE.Curve.create() has been deprecated"),e.prototype=Object.create(Kc.prototype),e.prototype.constructor=e,e.prototype.getPoint=t,e},vh.prototype.fromPoints=function(e){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(e)},Em.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},_m.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},Fu.prototype.extractUrlBase=function(e){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),hd.extractUrlBase(e)},Fu.Handlers={add:function(){console.error("THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead.")},get:function(){console.error("THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead.")}},hm.prototype.center=function(e){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(e)},hm.prototype.empty=function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},hm.prototype.isIntersectionBox=function(e){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},hm.prototype.size=function(e){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(e)},gn.prototype.center=function(e){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(e)},gn.prototype.empty=function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},gn.prototype.isIntersectionBox=function(e){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},gn.prototype.isIntersectionSphere=function(e){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)},gn.prototype.size=function(e){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(e)},Fn.prototype.empty=function(){return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."),this.isEmpty()},zs.prototype.setFromMatrix=function(e){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(e)},mm.prototype.center=function(e){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(e)},Ki.prototype.flattenToArrayOffset=function(e,t){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},Ki.prototype.multiplyVector3=function(e){return console.warn("THREE.Matrix3: .multiplyVector3(
949) has been removed. Use vector.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},Ki.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},Ki.prototype.applyToBufferAttribute=function(e){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},Ki.prototype.applyToVector3Array=function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")},Ki.prototype.getInverse=function(e){return console.warn("THREE.Matrix3: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(e).invert()},Hn.prototype.extractPosition=function(e){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(e)},Hn.prototype.flattenToArrayOffset=function(e,t){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},Hn.prototype.getPosition=function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),(new mn).setFromMatrixColumn(this,3)},Hn.prototype.setRotationFromQuaternion=function(e){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(e)},Hn.prototype.multiplyToArray=function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},Hn.prototype.multiplyVector3=function(e){return console.warn("THREE.Matrix4: .multiplyVector3(
949) has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},Hn.prototype.multiplyVector4=function(e){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},Hn.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},Hn.prototype.rotateAxis=function(e){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),e.transformDirection(this)},Hn.prototype.crossVector=function(e){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},Hn.prototype.translate=function(){console.error("THREE.Matrix4: .translate() has been removed.")},Hn.prototype.rotateX=function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},Hn.prototype.rotateY=function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},Hn.prototype.rotateZ=function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},Hn.prototype.rotateByAxis=function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},Hn.prototype.applyToBufferAttribute=function(e){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},Hn.prototype.applyToVector3Array=function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},Hn.prototype.makeFrustum=function(e,t,i,n,r,s){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(e,t,n,i,r,s)},Hn.prototype.getInverse=function(e){return console.warn("THREE.Matrix4: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(e).invert()},Us.prototype.isIntersectionLine=function(e){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(e)},dn.prototype.multiplyVector3=function(e){return console.warn("THREE.Quaternion: .multiplyVector3(
949) has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),e.applyQuaternion(this)},dn.prototype.inverse=function(){return console.warn("THREE.Quaternion: .inverse() has been renamed to invert()."),this.invert()},jn.prototype.isIntersectionBox=function(e){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},jn.prototype.isIntersectionPlane=function(e){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(e)},jn.prototype.isIntersectionSphere=function(e){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)},Er.prototype.area=function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},Er.prototype.barycoordFromPoint=function(e,t){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(e,t)},Er.prototype.midpoint=function(e){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(e)},Er.prototypenormal=function(e){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(e)},Er.prototype.plane=function(e){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(e)},Er.barycoordFromPoint=function(e,t,i,n,r){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),Er.getBarycoord(e,t,i,n,r)},Er.normal=function(e,t,i,n){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),Er.getNormal(e,t,i,n)},yh.prototype.extractAllPoints=function(e){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(e)},yh.prototype.extrude=function(e){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new qh(this,e)},yh.prototype.makeGeometry=function(e){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new Jh(this,e)},Yi.prototype.fromAttribute=function(e,t,i){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,i)},Yi.prototype.distanceToManhattan=function(e){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},Yi.prototype.lengthManhattan=function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},mn.prototype.setEulerFromRotationMatrix=function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},mn.prototype.setEulerFromQuaternion=function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},mn.prototype.getPositionFromMatrix=function(e){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(e)},mn.prototype.getScaleFromMatrix=function(e){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(e)},mn.prototype.getColumnFromMatrix=function(e,t){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(t,e)},mn.prototype.applyProjection=function(e){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(e)},mn.prototype.fromAttribute=function(e,t,i){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,i)},mn.prototype.distanceToManhattan=function(e){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},mn.prototype.lengthManhattan=function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},ln.prototype.fromAttribute=function(e,t,i){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,i)},ln.prototype.lengthManhattan=function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},fr.prototype.getChildByName=function(e){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(e)},fr.prototype.renderDepth=function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},fr.prototype.translate=function(e,t){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(t,e)},fr.prototype.getWorldRotation=function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")}
vendor: 11,160 bytes, line 949
949,fr.prototype.applyMatrix=function(e){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)},Object.defineProperties(fr.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(e){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=e}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),bs.prototype.setDrawMode=function(){console.error("THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")},Object.defineProperties(bs.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),Xt},set:function(){console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}}),oc.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},Ps.prototype.setLens=function(e,t){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==t&&(this.filmGauge=t),this.setFocalLength(e)},Object.defineProperties(Hu.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(e){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=e}},shadowCameraLeft:{set:function(e){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=e}},shadowCameraRight:{set:function(e){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=e}},shadowCameraTop:{set:function(e){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=e}},shadowCameraBottom:{set:function(e){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=e}},shadowCameraNear:{set:function(e){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=e}},shadowCameraFar:{set:function(e){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=e}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(e){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=e}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(e){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=e}},shadowMapHeight:{set:function(e){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=e}}}),Object.defineProperties(Nr.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},dynamic:{get:function(){return console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.usage===Si},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(Si)}}}),Nr.prototype.setDynamic=function(e){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===e?Si:Ti),this},Nr.prototype.copyIndicesArray=function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},Nr.prototype.setArray=function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")},ns.prototype.addIndex=function(e){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(e)},ns.prototype.addAttribute=function(e,t){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),t&&t.isBufferAttribute||t&&t.isInterleavedBufferAttribute?"index"===e?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(t),this):this.setAttribute(e,t):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(e,new Nr(arguments[1],arguments[2])))},ns.prototype.addDrawCall=function(e,t,i){void 0!==i&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(e,t)},ns.prototype.clearDrawCalls=function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},ns.prototype.computeOffsets=function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},ns.prototype.removeAttribute=function(e){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(e)},ns.prototype.applyMatrix=function(e){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)},Object.defineProperties(ns.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),Ol.prototype.setDynamic=function(e){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===e?Si:Ti),this},Ol.prototype.setArray=function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")},qh.prototype.getArrays=function(){console.error("THREE.ExtrudeGeometry: .getArrays() has been removed.")},qh.prototype.addShapeList=function(){console.error("THREE.ExtrudeGeometry: .addShapeList() has been removed.")},qh.prototype.addShape=function(){console.error("THREE.ExtrudeGeometry: .addShape() has been removed.")},Dl.prototype.dispose=function(){console.error("THREE.Scene: .dispose() has been removed.")},tm.prototype.onUpdate=function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this},Object.defineProperties(Cr.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new Fr}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(e){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=e===v}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(e){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=e}},vertexTangents:{get:function(){console.warn("THREE."+this.type+": .vertexTangents has been removed.")},set:function(){console.warn("THREE."+this.type+": .vertexTangents has been removed.")}}}),Object.defineProperties(As.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(e){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=e}}}),Cl.prototype.clearTarget=function(e,t,i,n){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(e),this.clear(t,i,n)},Cl.prototype.animate=function(e){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(e)},Cl.prototype.getCurrentRenderTarget=function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},Cl.prototype.getMaxAnisotropy=function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},Cl.prototype.getPrecision=function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},Cl.prototype.resetGLState=function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},Cl.prototype.supportsFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},Cl.prototype.supportsHalfFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},Cl.prototype.supportsStandardDerivatives=function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},Cl.prototype.supportsCompressedTextureS3TC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},Cl.prototype.supportsCompressedTexturePVRTC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},Cl.prototype.supportsBlendMinMax=function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},Cl.prototype.supportsVertexTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},Cl.prototype.supportsInstancedArrays=function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_
949instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},Cl.prototype.enableScissorTest=function(e){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(e)},Cl.prototype.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},Cl.prototype.addPrePlugin=function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},Cl.prototype.addPostPlugin=function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},Cl.prototype.updateShadowMap=function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},Cl.prototype.setFaceCulling=function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")},Cl.prototype.allocTextureUnit=function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},Cl.prototype.setTexture=function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},Cl.prototype.setTexture2D=function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")},Cl.prototype.setTextureCube=function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")},Cl.prototype.getActiveMipMapLevel=function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()},Object.defineProperties(Cl.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=e}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=e}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}},vr:{get:function(){return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"),this.xr}},gammaInput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."),!1},set:function(){console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.")}},gammaOutput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),!1},set:function(e){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=!0===e?$t:Kt}},toneMappingWhitePoint:{get:function(){return console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed."),1},set:function(){console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.")}}}),Object.defineProperties(yl.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(cn.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=e}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=e}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=e}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=e}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy
949is now .texture.anisotropy."),this.texture.anisotropy},set:function(e){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=e}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(e){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=e}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(e){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=e}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(e){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=e}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(e){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=e}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(e){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=e}}}),Od.prototype.load=function(e){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");const t=this;return(new xd).load(e,(function(e){t.setBuffer(e)})),this},Nd.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},Rs.prototype.updateCubeMap=function(e,t){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update(
949)."),this.update(e,t)},Rs.prototype.clear=function(e,t,i,n){return console.warn("THREE.CubeCamera: .clear() is now .renderTarget.clear()."),this.renderTarget.clear(e,t,i,n)},rn.crossOrigin=void 0,rn.loadTexture=function(e,t,i,n){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");const r=new ju;r.setCrossOrigin(this.crossOrigin);const s=r.load(e,i,void 0,n);return t&&(s.mapping=t),s},rn.loadTextureCube=function(e,t,i,n){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");const r=new ku;r.setCrossOrigin(this.crossOrigin);const s=r.load(e,i,void 0,n);return t&&(s.mapping=t),s},rn.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},rn.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")};const Cp={createMultiMaterialObject:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")},detach:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")},attach:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")}};function Pp(){console.error("THREE.LensFlare has been moved to /examples/jsm/objects/Lensflare.js")}function Lp(){return console.error("THREE.ParametricGeometry has been moved to /examples/jsm/geometries/ParametricGeometry.js"),new ns}function Rp(){return console.error("THREE.TextGeometry has been moved to /examples/jsm/geometries/TextGeometry.js"),new ns}function Dp(){console.error("THREE.FontLoader has been moved to /examples/jsm/loaders/FontLoader.js")}function Op(){console.error("THREE.Font has been moved to /examples/jsm/loaders/FontLoader.js")}function Ip(){console.error("THREE.ImmediateRenderObject has been removed.")}"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:n}})),"undefined"!=typeof window&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=n)},7769:function(e,t,i){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);
949r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=this&&this.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||n(t,e,i)};Object.defineProperty(t,"__esModule",{value:!0}),r(i(5185),t),r(i(6406),t),r(i(6114),t),r(i(8934),t),r(i(1072),t),r(i(7259),t),r(i(8284),t),r(i(1017),t),r(i(1370),t),r(i(1216),t),r(i(8131),t)},8152:function(e,t,i){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=this&&this.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||n(t,e,i)};Object.defineProperty(t,"__esModule",{value:!0}),r(i(7395),t),r(i(8920),t),r(i(4835),t),r(i(9421),t),r(i(9362),t),r(i(7980),t),r(i(2286),t),r(i(3253),t),r(i(8770),t),r(i(1072),t)},3253:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scaleHeight=t.getFeatureText=t.getFeatureName=t.getFeatureId=t.getProjectionName=t.getProjection=t.GeometryType=t.getArrayConstructor=void 0;const n=i(2616),r=i(1984),s=i(3561);function o(e,t,i){var n;let r;if(void 0===t&&(t="name"),void 0!==i)for(const s of i)if(r=null!==(n=e.lookup(`${t}:${s}`))&&void 0!==n?n:e.lookup(`${t}_${s}`),"string"==typeof r&&r.length>0)return r;if(r=e.lookup(t),"string"==typeof r)return r}var a;t.getArrayConstructor=function(e){switch(e){case"float":return Float32Array;case"uint8":return Uint8Array;case"uint16":return Uint16Array;case"uint32":return Uint32Array;case"int8":return Int8Array;case"int16":return Int16Array;case"int32":return Int32Array}},(a=t.GeometryType||(t.GeometryType={}))[a.Unspecified=0]="Unspecified",a[a.Point=1]="Point",a[a.Line=2]="Line",a[a.SolidLine=3]="SolidLine",a[a.Text=4]="Text",a[a.TextPath=5]="TextPath",a[a.ExtrudedLine=6]="ExtrudedLine",a[a.Polygon=7]="Polygon",a[a.ExtrudedPolygon=8]="ExtrudedPolygon",a[a.Object3D=9]="Object3D",a[a.Other=1e3]="Other",t.getProjection=function(e){switch(e){case"mercator":return n.mercatorProjection;case"webMercator":return n.webMercatorProjection;case"sphere":return n.sphereProjection;case"normalizedEquirectangular":return n.normalizedEquirectangularProjection;case"equirectangular":return n.equirectangularProjection;default:throw new Error(`Unknown projection ${e}`)}},t.getProjectionName=function(e){if(e===n.mercatorProjection)return"mercator";if(e===n.webMercatorProjection)return"webMercator";if(e===n.sphereProjection)return"sphere";if(e===n.normalizedEquirectangularProjection)return"normalizedEquirectangular";if(e===n.equirectangularProjection)return"equirectangular";throw new Error("Unknown projection")},t.getFeatureId=function(e){if(void 0===e)return 0;if("string"==typeof e||"number"==typeof e)return e;if(e.hasOwnProperty("$id")){const t=e.$id;if("string"==typeof t||"number"==typeof t)return t}return 0},t.getFeatureName=o,t.getFeatureText=function(e,t,i){const n=e instanceof r.Env?e:e.env;if((0,r.isTextTechnique)(t)||(0,r.isIconTextTechnique)(t)||(0,r.isLineMarkerTechnique)(t)){if(void 0!==t.text)return(0,s.evaluateTechniqueAttr)(e,t.text);if((0,r.isIconTextTechnique)(t)||(0,r.isLineMarkerTechnique)(t))return}return o(n,"name",i)},t.scaleHeight=function(e,t,i){return!(0,s.evaluateTechniqueAttr)(e,t.constantHeight,i<12)}},1072:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isFeatureGeometry=void 0,t.isFeatureGeometry=function(e){const t=e.type;return"Point"===t||"MultiPoint"===t||"LineString"===t||"MultiLineString"===t||"Polygon"===t||"MultiPolygon"===t}},6406:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},7980:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2286:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6114:(e,t,i)=>{"use strict";
949Object.defineProperty(t,"__esModule",{value:!0}),t.addPolygonEdges=void 0;const n=i(82),r=new n.Vector2,s=new n.Vector2,o=new n.Vector2,a=new n.Vector2;t.addPolygonEdges=function(e,t,i,n,l,c,h,u){for(let d=0;d<l.length;++d)if(l[d])if(!0===c){const c=t+2*d,m=c+1,p=t+(d+1)%l.length*2,f=p+1;!0===h&&e.push(c,p),e.push(m,f);const g=(0===d?l.length:d)-1;if(l[g])if(void 0!==u){const t=n[d*i],h=n[d*i+1],p=n[(d+1)%l.length*i],f=n[(d+1)%l.length*i+1];r.set(t,h),s.set(p,f),o.set(n[g*i],n[g*i+1]),a.set(r.x,r.y),a.sub(o).normalize().dot(s.sub(r).normalize())<=u&&e.push(c,m)}else e.push(c,m)}else{const i=t+d,n=t+(d+1)%l.length;e.push(i,n)}}},7395:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8920:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPropertyValue=void 0;const n=i(1984),r=i(4342).LoggerManager.instance.create("PropertyValue");t.getPropertyValue=function(e,t,i){try{return(0,n.getPropertyValue)(e,t,i)}catch(t){return r.error("failed to evaluate expression",JSON.stringify(e),"error",String(t)),null}}},5185:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.makeDecodedTechnique=t.StyleSetEvaluator=void 0;const n=i(1984),r=i(8023),s=i(8797),o=i(8628),a=i(4342),l=i(5535),c=a.LoggerManager.instance.create("StyleSetEvaluator"),h=l.AttrScope.TechniqueGeometry;class u{classify(e){if(e._whenExpr){const t=this.switchStyle(e);e._whenExpr=e._whenExpr.accept(this,void 0),this._style=t}}visitNullLiteralExpr(e,t){return e}visitBooleanLiteralExpr(e,t){return e}visitNumberLiteralExpr(e,t){return e}visitStringLiteralExpr(e,t){return e}visitObjectLiteralExpr(e,t){return e}visitVarExpr(e,t){return e}visitHasAttributeExpr(e,t){return e}visitMatchExpr(e,t){return e}visitCaseExpr(e,t){return e}visitCallExpr(e,t){if("all"===e.op){const t=e.args.map((t=>t.accept(this,e))).filter((e=>void 0!==e));return new r.CallExpr(e.op,t)}if(t){const t=this.matchVarStringComparison(e);if(t){if(void 0===this._style.dataLayer&&"$layer"===t.name)return void(this._style.dataLayer=t.value);if(void 0===this._style._geometryType&&"$geometryType"===t.name)return void(this._style._geometryType=t.value)}}return e}visitLookupExpr(e,t){return this.visitCallExpr(e,t)}visitStepExpr(e,t){return e}visitInterpolateExpr(e,t){return e}matchVarStringComparison(e){if("=="===e.op){const t=e.args[0],i=e.args[1];if(t instanceof r.VarExpr&&i instanceof r.StringLiteralExpr)return{name:t.name,value:i.value};if(i instanceof r.VarExpr&&t instanceof r.StringLiteralExpr)return{name:i.name,value:t.value}}}switchStyle(e){const t=this._style;return this._style=e,t}}class d{constructor(e,t){this.key="",this.set(e,t)}set(e,t,i){let n=!1;if(void 0===e){const t=void 0!==i?i.lookup("$layer"):void 0;e="string"==typeof t?t:void 0}if(this.layer!==e&&(this.layer=e,n=!0),void 0===t){const e=void 0!==i?i.lookup("$geometryType"):void 0;t="string"==typeof e?e:void 0}return this.geometryType!==t&&(this.geometryType=t,n=!0),n&&this.updateKey(),this}updateKey(){void 0!==this.layer?void 0!==this.geometryType?this.key=`${this.layer}:${this.geometryType}`:this.key=`${this.layer}:`:void 0!==this.geometryType?this.key=`:${this.geometryType}`:this.key="all",this.cachedStyleSet=void 0}}function m(e){const t={};for(const i in e){if(!e.hasOwnProperty(i))continue;let n=e[i];"object"==typeof n&&(n.isVector2||n.isVector3||n.isVector4)&&(n=r.LiteralExpr.fromValue(n)),r.Expr.isExpr(n)&&(n=n.toJSON()),t[i]=n}return t}t.StyleSetEvaluator=class{constructor(e){this.m_options=e,this.styleSet=[],this.m_techniques=[],this.m_exprPool=new s.ExprPool,this.m_cachedResults=new Map,this.m_styleConditionClassifier=new u,this.m_subStyleSetCache=new Map,this.m_areCurrentDefinitionsOverrid
949den=!0,this.m_definitionsContainVerbose=!1,this.m_disabledStyles={byId:new Set,byLayer:new Set},this.m_definitionExprCache=new Map,this.m_tmpOptimizedSubSetKey=new d,this.m_emptyEnv=new n.Env,this.m_featureDependencies=["$layer","$geometryType","$zoom"],this.m_nextArrayBufferId=0,this.m_definitions=this.m_options.definitions;for(const e in this.m_definitions)this.m_definitionsContainVerbose||(this.m_definitionsContainVerbose=(0,n.isVerboseDefinition)(this.m_definitions[e]));this.styleSet=this.m_options.styleSet.map((e=>{const t=Object.assign(Object.assign({},e),{_forceCompile:!0});return e.attr&&(t.attr=Object.assign({},e.attr)),t})),function(e){var t;let i=0,n=0;for(const r of e)r._styleIndex=n++,void 0!==r.technique&&void 0===(null===(t=r.attr)||void 0===t?void 0:t.renderOrder)&&(void 0===r.attr?r.attr={renderOrder:i++}:r.attr.renderOrder=i++)}(this.styleSet),this.m_features=this.validateFeatures(this.m_options.features);const t=[];for(const e in this.m_features)this.m_features[e].modes.forEach((e=>{e.extendedDefinitions&&Array.prototype.push.apply(t,Object.keys(e.extendedDefinitions))}));this.m_modesDefinitions=new Set(t),this.setEnabledFeatures(e.enabledFeatures)}setEnabledFeatures(e){this.applyFeaturesAndModes(null!=e?e:this.getFeaturesEnabledByDefault())}getFeaturesEnabledByDefault(){var e;const t=[];if(this.m_features)for(const i in this.m_features){const n=this.m_features[i];n.enabledByDefault&&t.push({feature:i,mode:null===(e=n.modes[0])||void 0===e?void 0:e.name})}return t}applyFeaturesAndModes(e){if(this.m_disabledStyles.byId.clear(),this.m_disabledStyles.byLayer.clear(),this.resetTechniques(),this.m_areCurrentDefinitionsOverrid
949den&&(this.m_definitionsContainVerbose?this.m_currentDefinitions=JSON.parse(JSON.stringify(this.m_definitions)):this.m_currentDefinitions=Object.assign({},this.m_definitions),this.m_areCurrentDefinitionsOverridden=!1),this.m_features)for(const t in this.m_features){const i=this.m_features[t];let n;const r=e.find((e=>e.feature===t));r?(n=i.modes.find((e=>e.name===r.mode)),n||(n=i.modes[0])):n=i.disabledMode,n.disabledLayers&&n.disabledLayers.forEach((e=>{this.m_disabledStyles.byLayer.add(e)})),n.disabledStyleRules&&n.disabledStyleRules.forEach((e=>{this.m_disabledStyles.byId.add(e)})),this.m_currentDefinitions&&(null==n?void 0:n.extendedDefinitions)&&(this.m_areCurrentDefinitionsOverridden=!0,Object.assign(this.m_currentDefinitions,null==n?void 0:n.extendedDefinitions))}this.m_definitionExprCache.clear(),this.m_cachedResults.clear(),this.m_subStyleSetCache.clear(),this.compileStyleSet()}validateFeatures(e){const t={};for(const i in e){const n=e[i];Array.isArray(n.modes)&&0!==n.modes.length&&void 0!==n.disabledMode?t[i]=n:c.error(`The style configuration is invalid. The feature "${i}" must be an array, have at least one mode and specify a value for disabledMode property`)}if(Object.keys(t).length>0)return t}isStyleDisabled(e){if(void 0!==this.m_disabledStyles){if(void 0!==e.layer&&this.m_disabledStyles.byLayer.has(e.layer))return!0;if(void 0!==e.id&&this.m_disabledStyles.byId.has(e.id))return!0}return!1}getMatchingTechniques(e,t,i){if(this.m_previousResult&&this.m_previousEnv&&this.m_featureDependencies.every((t=>{var i;return(null===(i=this.m_previousEnv)||void 0===i?void 0:i.lookup(t))===e.lookup(t)})))return this.m_previousResult;const n=[];this.m_cachedResults.clear();const r=this.m_tmpOptimizedSubSetKey;r.set(t,i,e),this.m_dataLayer=r.layer,this.m_geometryType=r.geometryType,this.m_zoomLevel=e.lookup("$zoom");const s=this.getOptimizedStyleSet(r);for(const t of s)if(this.processStyle(e,t,n))break;return this.m_previousResult=n,this.m_previousEnv=e,n}wantsDataLayer(e){return this.getOptimizedStyleSet(this.m_tmpOptimizedSubSetKey.set(e,void 0)).length>0}wantsFeature(e,t){return this.getOptimizedStyleSet(this.m_tmpOptimizedSubSetKey.set(e,t)).length>0}resetTechniques(){for(const e of this.m_techniques)e._index=void 0;this.m_techniques.length=0,this.m_previousResult=void 0,this.m_previousEnv=void 0}get techniques(){return this.m_techniques}get decodedTechniques(){return this.m_techniques.map(m)}getOptimizedStyleSet(e){if(void 0!==e.cachedStyleSet)return e.cachedStyleSet;let t=this.m_subStyleSetCache.get(e.key);return void 0!==t?(e.cachedStyleSet=t,t):(t=this.createPreFilteredStyleSet(e),this.m_subStyleSetCache.set(e.key,t),e.cachedStyleSet=t,t)}createPreFilteredStyleSet(e){const{layer:t,geometryType:i}=e;return this.styleSet.filter((e=>!(void 0!==t&&void 0!==e.dataLayer&&e.dataLayer!==t||void 0!==i&&void 0!==e._geometryType&&e._geometryType!==i)))}compileStyleSet(){this.styleSet.forEach((e=>this.compileStyle(e))),this.styleSet.forEach((e=>{this.getOptimizedStyleSet(this.m_tmpOptimizedSubSetKey.set(e.dataLayer,e._geometryType))}))}compileStyle(e){var t,i;try{this.compileStyleAttributes(e)}catch(t){c.error("failed to evaluate style rule",e,String(t))}if(void 0!==e.when)try{e._whenExpr=r.Expr.fromJSON(e.when,this.m_currentDefinitions,this.m_definitionExprCache),this.m_styleConditionClassifier.classify(e),void 0!==e._whenExpr&&(e._whenExpr=e._whenExpr.intern(this.m_exprPool));const s=e._whenExpr.dependencies();null==s||s.properties.forEach((e=>{this.m_featureDependencies.includes(e)||this.m_featureDependencies.push(e)})),(0,n.isJsonExpr)(null===(t=e.attr)||void 0===t?void 0:t.minZoomLevel)&&(e._minZoomLevelExpr=r.Expr.fromJSON(e.attr.minZoomLevel,this.m_currentDefinitions).intern(this.m_exprPool)),(0,n.isJsonExpr)(null===(i=e.attr)||void 0===i?void 0:i.maxZoomLevel)&&(e._maxZoomLevelExpr=r.Expr.fromJSON(e.attr.maxZoomLevel,this.m_currentDefinitions).intern(this.m_exprPool))}catch(t){c.error("failed to evaluate expression",JSON.stringify(e.when),String(t))}}processStyle(e,t,i){if(!this.checkZoomLevel(e,t))return!1;if(this.isStyleDisabled(t))return!1;if(void 0!==this.m_dataLayer&&void 0!==t.dataLayer&&t.dataLayer!==this.m_dataLayer)return!1;if(void 0!==this.m_geometryType&&void 0!==t._geometryType&&t._geometryType!==this.m_geometryType)return!1;if(t._whenExpr)try{if(!t._whenExpr.evaluate(e,r.ExprScope.Condition,this.m_cachedResults))return!1}catch(e){return c.error(`failed to evaluate expression '${JSON.stringify(t.when)}': ${e}`),!1}return void 0!==t.technique&&("none"!==t.technique&&i.push(this.getTechniqueForStyleMatch(e,t)),!0===t.final)}checkZoomLevel(e,t){var i,n,s,o,a;const l=this.m_zoomLevel;if(void 0===l||l>=17)return!0;let h=null===(i=t.attr)||void 0===i?void 0:i.minZoomLevel,u=null===(n=t.attr)||void 0===n?void 0:n.maxZoomLevel;if(void 0===h&&void 0===u)return!0;
949if(void 0!==h){if(!1===(null===(s=t._minZoomLevelExpr)||void 0===s?void 0:s.isDynamic()))try{h=t._minZoomLevelExpr.evaluate(e,r.ExprScope.Condition,this.m_cachedResults)}catch(e){c.error(`failed to evaluate expression '${JSON.stringify(t._minZoomLevelExpr)}': ${e}`)}if("number"==typeof h&&l<Math.floor(h))return!1}if(void 0!==(null===(o=t.attr)||void 0===o?void 0:o.maxZoomLevel)){if(!1===(null===(a=t._maxZoomLevelExpr)||void 0===a?void 0:a.isDynamic()))try{u=t._maxZoomLevelExpr.evaluate(e,r.ExprScope.Condition,this.m_cachedResults)}catch(e){c.error(`failed to evaluate expression '${JSON.stringify(t._maxZoomLevelExpr)}': ${e}`)}if("number"==typeof u&&l>=Math.ceil(u))return!1}return!0}getTechniqueForStyleMatch(e,t){let i;if(void 0!==t._dynamicTechniques){const n=this.evaluateTechniqueProperties(t,e),r=this.getDynamicTechniqueKey(t,n);i=t._dynamicTechniques.get(r),void 0===i&&(i=this.createTechnique(t,n),t._dynamicTechniques.set(r,i))}else i=t._staticTechnique,void 0===i&&(t._staticTechnique=i=this.createTechnique(t,[]));return void 0===i._index&&(i._index=this.m_techniques.length,this.m_techniques.push(i)),i}getDynamicTechniqueKey(e,t){const i=t.map((([e,t])=>void 0===t?"U":"object"==typeof t?JSON.stringify(t,((e,t)=>{if(t instanceof ArrayBuffer){let e=t.id;return void 0===e&&(e=t.id=this.m_nextArrayBufferId++),e}return t})):JSON.stringify(t))).join(":");return`${e._styleIndex}:${i}`}compileStyleAttributes(e){var t;if(!e._forceCompile&&(void 0!==e._dynamicTechniqueAttributes||"none"===e.technique))return;e._dynamicTechniqueAttributes=[],e._dynamicFeatureAttributes=[],e._dynamicForwardedAttributes=[],e._staticAttributes=[],e._staticTechnique=void 0,e._dynamicTechniques=void 0;const i=e._dynamicFeatureAttributes,s=e._dynamicTechniqueAttributes,a=e._dynamicForwardedAttributes,u=e._staticAttributes,d=(t,d)=>{if(void 0===d)return;const m=new Set;if((0,n.isJsonExpr)(d)?d=r.Expr.fromJSON(d,this.m_currentDefinitions,this.m_definitionExprCache,m).intern(this.m_exprPool):(0,o.isInterpolatedPropertyDefinition)(d)&&(d=r.Expr.fromJSON((0,o.interpolatedPropertyDefinitionToJsonExpr)(d)).intern(this.m_exprPool)),r.Expr.isExpr(d)){const i=d.dependencies();i.featureState&&("enabled"!==t?c.log("feature-state is not supported in this context"):e._usesFeatureState=!0),0!==i.properties.size||d.isDynamic()||(d=d.evaluate(this.m_emptyEnv))}if(r.Expr.isExpr(d)){const n=function(e,t){var i,n,r;return"extruded-polygon"===e.technique&&"color"===t&&!1!==(null===(i=e.attr)||void 0===i?void 0:i.vertexColors)?h:null!==(r=null===(n=(0,l.getTechniqueAttributeDescriptor)(e.technique,t))||void 0===n?void 0:n.scope)&&void 0!==r?r:h}(e,t),r=d.dependencies();switch(r.properties.forEach((e=>{this.m_featureDependencies.includes(e)||this.m_featureDependencies.push(e)})),n){case l.AttrScope.FeatureGeometry:i.push([t,d]);break;case l.AttrScope.TechniqueGeometry:s.push([t,d]);break;case l.AttrScope.TechniqueRendering:0===r.properties.size?a.push([t,d]):s.push([t,d])}}else null!=d&&u.push([t,d]);for(const t of m.values())if(this.m_modesDefinitions.has(t)){e._forceCompile=!0;break}};e._forceCompile=!1;for(const t in e)e.hasOwnProperty(t)&&(t.startsWith("_")||["when","technique","layer","attr","category","description"].includes(t)||d(t,e[t]));const m=new Map([["category","_category"]]);if(void 0!==e.attr)for(const i in e.attr)e.attr.hasOwnProperty(i)&&d(null!==(t=m.get(i))&&void 0!==t?t:i,e.attr[i]);s.length>0&&(e._dynamicTechniques=new Map)}evaluateTechniqueProperties(e,t){return void 0===e._dynamicTechniqueAttributes?[]:e._dynamicTechniqueAttributes.map((([e,i])=>{try{return[e,i.evaluate(t,r.ExprScope.Value,this.m_cachedResults)]}catch(t){return c.error(`failed to evaluate expression '${i.toJSON()}': ${t}`),[e,null]}}))}createTechnique(e,t){var i,r;const s={};if(s.name=e.technique,void 0!==e._staticAttributes)for(const[t,i]of e._staticAttributes)null!==i&&(s[t]=i);for(const[e,i]of t)null!==i&&(s[e]=i);if(void 0!==e._dynamicFeatureAttributes)for(const[t,i]of e._dynamicFeatureAttributes)s[t]=i;if(void 0!==e._dynamicForwardedAttributes)for(const[t,i]of e._dynamicForwardedAttributes)s[t]=i;return s._index=this.m_techniques.length,s._styleIndex=e._styleIndex,void 0!==e.layer&&(s._layer=e.layer),void 0!==e._usesFeatureState&&(s._usesFeatureState=e._usesFeatureState),(0,n.setTechniqueRenderOrderOrPriority)(s,null!==(i=this.m_options.priorities)&&void 0!==i?i:[],null!==(r=this.m_options.labelPriorities)&&void 0!==r?r:[]),this.m_techniques.push(s),s}},t.makeDecodedTechnique=m},3561:(e,t,i)=>{"use strict";
949Object.defineProperty(t,"__esModule",{value:!0}),t.evaluateTechniqueAttr=void 0;const n=i(1984),r=i(8920);t.evaluateTechniqueAttr=function(e,t,i){if(void 0===t)return i;const s=n.Env.isEnv(e)?(0,r.getPropertyValue)(t,e):(0,r.getPropertyValue)(t,e.env,e.cachedExprResults);return null!=s?s:i}},5535:(e,t)=>{"use strict";var i;function n(...e){const t={attrDescriptors:{}};for(const i of e)void 0!==i.attrTransparencyColor&&(t.attrTransparencyColor=i.attrTransparencyColor),void 0!==i.attrDescriptors&&(t.attrDescriptors=Object.assign(Object.assign({},t.attrDescriptors),i.attrDescriptors));return t}Object.defineProperty(t,"__esModule",{value:!0}),t.getTechniqueAutomaticAttrs=t.getTechniqueAttributeDescriptor=t.getTechniqueDescriptor=t.AttrScope=void 0,function(e){e[e.FeatureGeometry=0]="FeatureGeometry",e[e.TechniqueGeometry=1]="TechniqueGeometry",e[e.TechniqueRendering=2]="TechniqueRendering"}(i=t.AttrScope||(t.AttrScope={}));const r={attrTransparencyColor:"color",attrDescriptors:{constantHeight:i.FeatureGeometry,enabled:i.FeatureGeometry,fadeFar:i.TechniqueRendering,fadeNear:i.TechniqueRendering,transparent:{scope:i.TechniqueRendering,automatic:!0},side:{scope:i.TechniqueRendering,automatic:!0}}},s=n(r,{attrDescriptors:{color:{scope:i.TechniqueRendering,automatic:!0},size:{scope:i.TechniqueRendering,automatic:!0},opacity:{scope:i.TechniqueRendering,automatic:!0}}}),o=n(r,s),a=n(r,s),l=n(r,{attrDescriptors:{text:i.FeatureGeometry,imageTexture:i.FeatureGeometry,iconColor:i.TechniqueRendering,iconBrightness:i.TechniqueRendering,textBrightness:i.TechniqueRendering,backgroundColor:i.TechniqueRendering,backgroundSize:i.TechniqueRendering,backgroundOpacity:i.TechniqueRendering,color:i.TechniqueRendering,opacity:i.TechniqueRendering,size:i.TechniqueRendering,priority:i.TechniqueRendering,zOrder:i.TechniqueRendering,margin:i.TechniqueRendering,"check-margin":i.TechniqueRendering,"anchor-point-density":i.TechniqueRendering}}),c={attrDescriptors:{polygonOffset:{scope:i.TechniqueRendering,automatic:!0},polygonOffsetFactor:{scope:i.TechniqueRendering,automatic:!0},polygonOffsetUnits:{scope:i.TechniqueRendering,automatic:!0},depthTest:{scope:i.TechniqueRendering,automatic:!0},transparent:{scope:i.TechniqueRendering,automatic:!0},opacity:{scope:i.TechniqueRendering,automatic:!0},color:{scope:i.TechniqueRendering,automatic:!0},lineColor:i.TechniqueRendering,lineFadeFar:i.TechniqueRendering,lineFadeNear:i.TechniqueRendering}},h=n(r,c,{attrDescriptors:{width:i.TechniqueRendering,cap:{scope:i.TechniqueRendering,automatic:!0},drawRangeStart:{scope:i.TechniqueRendering,automatic:!0},drawRangeEnd:{scope:i.TechniqueRendering,automatic:!0},dashes:{scope:i.TechniqueRendering,automatic:!0},dashColor:{scope:i.TechniqueRendering,automatic:!0},"dash-pattern":{scope:i.TechniqueRendering,automatic:!0},"dash-image":{scope:i.TechniqueRendering,automatic:!0}}}),u=n(r,{attrDescriptors:{color:{scope:i.TechniqueRendering,automatic:!0},opacity:{scope:i.TechniqueRendering,automatic:!0},width:i.FeatureGeometry}}),d=n(r,c,{attrDescriptors:{wireframe:{scope:i.TechniqueRendering,automatic:!0},color:{scope:i.TechniqueRendering,automatic:!0},opacity:{scope:i.TechniqueRendering,automatic:!0},transparent:{scope:i.TechniqueRendering,automatic:!0},lineWidth:i.TechniqueRendering,map:{scope:i.TechniqueRendering,automatic:!0}}}),m=n(r,{attrDescriptors:{color:{scope:i.TechniqueRendering,automatic:!0},vertexColors:{scope:i.TechniqueRendering,automatic:!0},wireframe:{scope:i.TechniqueRendering,automatic:!0},roughness:{scope:i.TechniqueRendering,automatic:!0},metalness:{scope:i.TechniqueRendering,automatic:!0},alphaTest:{scope:i.TechniqueRendering,automatic:!0},depthTest:{scope:i.TechniqueRendering,automatic:!0},transparent:{scope:i.TechniqueRendering,automatic:!0},opacity:{scope:i.TechniqueRendering,automatic:!0},emissive:{scope:i.TechniqueRendering,automatic:!0},emissiveIntensity:{scope:i.TechniqueRendering,automatic:!0},refractionRatio:{scope:i.TechniqueRendering,automatic:!0},normalMapType:{scope:i.TechniqueRendering,automatic:!0},map:{scope:i.TechniqueRendering,automatic:!0},normalMap:{scope:i.TechniqueRendering,automatic:!0},displacementMap:{scope:i.TechniqueRendering,automatic:!0},roughnessMap:{scope:i.TechniqueRendering,automatic:!0},emissiveMap:{scope:i.TechniqueRendering,automatic:!0},bumpMap:{scope:i.TechniqueRendering,automatic:!0},metalnessMap:{scope:i.TechniqueRendering,automatic:!0},alphaMap:{scope:i.TechniqueRendering,automatic:!0}}}),p={"extruded-polygon":n(r,{attrDescriptors:{depthTest:{scope:i.TechniqueRendering,automatic:!0},vertexColors:{scope:i.TechniqueRendering,automatic:!0},opacity:{scope:i.TechniqueRendering,automatic:!0},color:{scope:i.TechniqueRendering,automatic:!0},colorIntensity:{scope:i.TechniqueRendering,automatic:!0},specular:{scope:i.TechniqueRendering,automatic:!0},emissive:{scope:i.TechniqueRendering,automatic:!0},emissiveIntensity:{scope:i.TechniqueRendering,automatic:!0},shininess:{scope:i.TechniqueRendering,automatic:!0},displacementMap:{scope:i.TechniqueRendering,automatic:!0},height:i.FeatureGeometry,floorHeight:i.FeatureGeometry,defaultColor:i.FeatureGeometry,defaultHeight:i.FeatureGeometry,boundaryWalls:i.FeatureGeometry,footprint:i.FeatureGeometry,maxSlope:i.FeatureGeometry,animateExtrusion:i.TechniqueRendering,lineWidth:i.TechniqueRendering,lineFadeNear:i.TechniqueRendering,lineFadeFar:i.TechniqueRendering,lineColor:i.TechniqueRendering}}),"line-marker":l,"labeled-icon":l,"solid-line":h,"dashed-line":h,terrain:m,standard:m,squares:o,circles:a,line:u,segments:u,polygon:d,text:n(r,{attrDescriptors:{text:i.FeatureGeometry,backgroundColor:i.TechniqueRendering,backgroundSize:i.TechniqueRendering,backgroundOpacity:i.TechniqueRendering,color:i.TechniqueRendering,opacity:i.TechniqueRendering,size:i.TechniqueRendering,priority:i.TechniqueRendering,zOrder:i.TechniqueRendering}}),raster:n(r,{attrDescriptors:{brightness:{scope:i.TechniqueRendering,automatic:!0},gamma:{scope:i.TechniqueRendering,automatic:!0}}})};function f(e){return"string"!=typeof e&&(e=e.name),p[e]}t.getTechniqueDescriptor=f,t.getTechniqueAttributeDescriptor=function(e,t){const i=f(e),n=null==i?void 0:i.attrDescriptors,r=null==n?void 0:n[t];if(void 0!==typeof r)return"object"==typeof r?r:{scope:r}};const g=new Map;t.getTechniqueAutomaticAttrs=function(e){var t;if("string"!=typeof e&&(e=e.name),g.has(e))return g.get(e);const i=[],n=null===(t=f(e))||void 0===t?void 0:t.attrDescriptors;if(void 0===n)return i;for(const e in n){if(!n.hasOwnProperty(e))continue;const t=n[e];void 0!==t&&"number"!=typeof t&&!0===t.automatic&&i.push(e)}return g.set(e,i),i}},8934:(e,t,i)=>{"use strict";
949Object.defineProperty(t,"__esModule",{value:!0}),t.ThreeBufferUtils=void 0;const n=i(3253);!function(e){function t(e){if(e instanceof Int8Array)return"int8";if(e instanceof Uint8Array)return"uint8";if(e instanceof Int16Array)return"int16";if(e instanceof Uint16Array)return"uint16";if(e instanceof Int32Array)return"int32";if(e instanceof Uint32Array)return"uint32";if(e instanceof Float32Array)return"float";throw new Error(`Unsupported buffer type ${name}`)}function i(e){const i=e.array;return{name:e.name,buffer:i.buffer,type:t(i),itemCount:e.itemSize,normalized:e.normalized}}e.getBufferElementType=t,e.fromThreeBufferAttribute=i,e.fromThreeInterleavedBufferAttribute=function(e){throw new Error("Not implemented yet")},e.fromThreeBufferGeometry=function(e,t){const r=[],s=Object.getOwnPropertyNames(e.attributes);for(const t of s){const n=i(e.attributes[t]);n.name=t,r.push(n)}const o=null!==e.index?i(e.index):void 0;let a=0;if(void 0!==o)a=null===e.index?0:e.index.count;else{const t=e.attributes.position;if(void 0===t)throw new Error("Missing position attibute to deduce item count");a=t.count}return{type:n.GeometryType.Unspecified,vertexAttributes:r,index:o,groups:[{start:0,count:a,technique:t}]}}}(t.ThreeBufferUtils||(t.ThreeBufferUtils={}))},8770:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},9362:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkerDecoderProtocol=t.RequestController=void 0,t.RequestController=class{constructor(e=0,t=new AbortController){this.priority=e,this.abortController=t}get signal(){return this.abortController.signal}abort(){this.abortController.abort()}},function(e){let t,i;!function(e){e.Configuration="configuration"}(t=e.DecoderMessageName||(e.DecoderMessageName={})),e.isConfigurationMessage=function(e){return e&&"string"==typeof e.service&&"string"==typeof e.type&&e.type===t.Configuration},function(e){e.DecodeTileRequest="decode-tile-request",e.TileInfoRequest="tile-info-request"}(i=e.Requests||(e.Requests={})),e.isDecodeTileRequest=function(e){return e&&"string"==typeof e.type&&e.type===i.DecodeTileRequest},e.isTileInfoRequest=function(e){return e&&"string"==typeof e.type&&e.type===i.TileInfoRequest}}(t.WorkerDecoderProtocol||(t.WorkerDecoderProtocol={}))},4835:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkerServiceProtocol=void 0,function(e){let t,i;e.WORKER_SERVICE_MANAGER_SERVICE_ID="worker-service-manager",function(e){e.Initialized="initialized",e.Request="request",e.Response="response"}(t=e.ServiceMessageName||(e.ServiceMessageName={})),e.isInitializedMessage=function(e){return e&&"string"==typeof e.service&&"string"==typeof e.type&&e.type===t.Initialized},function(e){e.CreateService="create-service",e.DestroyService="destroy-service"}(i=e.Requests||(e.Requests={})),e.isUnknownServiceError=function(e){return e.message.includes("unknown targetServiceType requested: ")},e.isRequestMessage=function(e){return e&&"string"==typeof e.service&&"string"==typeof e.type&&e.type===t.Request},e.isResponseMessage=function(e){return e&&"string"==typeof e.service&&"string"==typeof e.type&&e.type===t.Response}}(t.WorkerServiceProtocol||(t.WorkerServiceProtocol={}))},9421:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkerTilerProtocol=void 0,function(e){let t;!function(e){e.RegisterIndex="register-index",e.UpdateIndex="update-index",e.TileRequest="tile-request"}(t=e.Requests||(e.Requests={})),e.isRegisterIndexRequest=function(e){return e&&"string"==typeof e.type&&e.type===t.RegisterIndex},e.isUpdateIndexRequest=function(e){return e&&"string"==typeof e.type&&e.type===t.UpdateIndex},e.isTileRequest=function(e){return e&&"string"==typeof e.type&&e.type===t.TileRequest}}(t.WorkerTilerProtocol||(t.WorkerTilerProtocol={}))},6892:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6112:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.wrapLineString=t.clipLineString=void 0;const n=i(82),r=i(2616),s=i(4342);class o{constructor(e,t,i,r,s){this.isInside=s,this.p0=new n.Vector2(e,t),this.p1=new n.Vector2(i,r)}inside(e){return this.isInside(e)}computeIntersection(e,t){const i=new n.Vector2;return s.Math2D.intersectLines(e.x,e.y,t.x,t.y,this.p0.x,this.p0.y,this.p1.x,this.p1.y,i),i}clipLine(e){const t=e,i=[];e=[],i.push(e);const n=t=>{0!==e.length&&e[e.length-1].equals(t)||e.push(t)};for(let r=0;r<t.length;++r){const s=t[r],o=r>0?t[r-1]:void 0;this.inside(s)?(void 0===o||this.inside(o)||(e.length>0&&(e=[],i.push(e)),n(this.computeIntersection(o,s))),n(s)):void 0!==o&&this.inside(o)&&n(this.computeIntersection(o,s))}return 0===i[i.length-1].length&&(i.length=i.length-1),i}clipLines(e){const t=[];return e.forEach((e=>{this.clipLine(e).forEach((e=>{t.push(e)}))})),t}}
949function a(e,t,i){for(const i of t)e=i.clipLines(e);const s=new n.Vector3,o=[];return e.forEach((e=>{if(0===e.length)return;const t=e.map((({x:e,y:t})=>{s.set(e,t,0);const n=r.webMercatorProjection.unprojectPoint(s);return n.longitude+=i,n}));o.push(t)})),o.length>0?o:void 0}t.clipLineString=function(e,t,i,n,r){const s=new o(t,i,t,r,(e=>e.x>t)),a=new o(t,r,n,r,(e=>e.y<r)),l=new o(n,r,n,i,(e=>e.x<n)),c=new o(n,i,t,i,(e=>e.y>i));let h=s.clipLine(e);return h=a.clipLines(h),h=l.clipLines(h),h=c.clipLines(h),h},t.wrapLineString=function(e){const t=new n.Vector3,i=[e.map((e=>{const{x:i,y:s}=r.webMercatorProjection.projectPoint(e,t);return new n.Vector2(i,s)}))];return{left:a(i,h,360),middle:a(i,c,0),right:a(i,u,-360)}};const l=r.EarthConstants.EQUATORIAL_CIRCUMFERENCE,c=[new o(0,l,0,0,(e=>e.x>0)),new o(l+0,0,l+0,l,(e=>e.x<l+0))],h=[new o(-l-0,l,-l-0,0,(e=>e.x>-l-0)),new o(0,0,0,l,(e=>e.x<0))],u=[new o(l-0,l,l-0,0,(e=>e.x>l-0)),new o(2*l+0,0,2*l+0,l,(e=>e.x<2*l+0))]},2982:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.clipPolygon=t.ClippingEdge=void 0;const n=i(82);class r{clipPolygon(e,t){const i=e;e=[];const n=t=>{const i=e[e.length-1];(!(null==i?void 0:i.equals(t))||!0===t.isClipped&&!(null==i?void 0:i.isClipped)||!t.isClipped&&!0===(null==i?void 0:i.isClipped))&&e.push(t)};for(let e=0;e<i.length;++e){const r=i[e],s=i[(e+i.length-1)%i.length];if(this.inside(r,t)){if(!this.inside(s,t)){const e=this.computeIntersection(s,r,t);e.isClipped=!0,n(e)}n(r)}else if(this.inside(s,t)){const e=this.computeIntersection(s,r,t);e.isClipped=!0,n(e)}}return e}}t.ClippingEdge=r;const s=[new class extends r{inside(e){return e.y>=0}computeIntersection(e,t){const{x:i,y:r}=e,{x:s,y:o}=t;return new n.Vector2((i*o-r*s)/-(r-o),0).round()}},new class extends r{inside(e,t){return e.x<=t}computeIntersection(e,t,i){const{x:r,y:s}=e,{x:o,y:a}=t;return new n.Vector2(i,(r*a-s*o-(s-a)*-i)/(r-o)).round()}},new class extends r{inside(e,t){return e.y<=t}computeIntersection(e,t,i){const{x:r,y:s}=e,{x:o,y:a}=t;return new n.Vector2((r*a-s*o-(r-o)*i)/-(s-a),i).round()}},new class extends r{inside(e){return e.x>=0}computeIntersection(e,t){const{x:i,y:r}=e,{x:s,y:o}=t;return new n.Vector2(0,(i*o-r*s)/(i-s)).round()}}];t.clipPolygon=function(e,t){if(0===e.length)return e;e[0].equals(e[e.length-1])||(e=[...e,e[0]]);for(const i of s)e=i.clipPolygon(e,t);return e.length<3?[]:e}},6525:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EdgeLengthGeometrySubdivisionModifier=t.SubdivisionMode=void 0;const n=i(82),r=i(2616),s=i(4342),o=i(3386),a=[new n.Vector3,new n.Vector3];var l;!function(e){e[e.All=0]="All",e[e.NoDiagonals=1]="NoDiagonals"}(l=t.SubdivisionMode||(t.SubdivisionMode={}));class c extends o.SubdivisionModifier{constructor(e,t,i=l.All,n){super(),this.subdivision=e,this.geoBox=t,this.subdivisionMode=i,this.projection=n,(0,s.assert)(n.type===r.ProjectionType.Planar,"EdgeLengthGeometrySubdivisionModifier only supports planar projections");const o=n.projectPoint(t.northEast,a[0]),c=n.projectPoint(t.southWest,a[1]);this.m_projectedBox={min:{x:Math.min(o.x,c.x),y:Math.min(o.y,c.y),z:Math.min(o.z,c.z)},max:{x:Math.max(o.x,c.x),y:Math.max(o.y,c.y),z:Math.max(o.z,c.z)}},this.m_maxLengthX=(this.m_projectedBox.max.x-this.m_projectedBox.min.x)/e,this.m_maxLengthY=(this.m_projectedBox.max.y-this.m_projectedBox.min.y)/e,this.subdivisionMode===l.All&&(this.m_maxLengthX*=1.1,this.m_maxLengthY*=1.1),this.m_maxLength=Math.sqrt(this.m_maxLengthX*this.m_maxLengthX+this.m_maxLengthY*this.m_maxLengthY)}get maxLength(){return this.m_maxLength}get maxLengthX(){return this.m_maxLengthX}get maxLengthY(){return this.m_maxLengthY}shouldSplitTriangle(e,t,i){const n=this.shouldSplitEdge(e,t),r=this.shouldSplitEdge(t,i),s=this.shouldSplitEdge(i,e);if(!(n||r||s))return;const o=e.distanceTo(t),a=t.distanceTo(i),l=i.distanceTo(e),c=Math.max(n?o:0,r?a:0,s?l:0);if(o===c)return 0;if(a===c)return 1;if(l===c)return 2;throw new Error("Could not split triangle.")}shouldSplitEdge(e,t){switch(this.subdivisionMode){case l.All:return e.y===t.y&&Math.abs(e.x-t.x)>this.m_maxLengthX||e.x===t.x&&Math.abs(e.y-t.y)>this.m_maxLengthY||e.distanceTo(t)>this.m_maxLength;case l.NoDiagonals:return e.y===t.y&&Math.abs(e.x-t.x)>this.m_maxLengthX||e.x===t.x&&Math.abs(e.y-t.y)>this.m_maxLengthY}}}t.EdgeLengthGeometrySubdivisionModifier=c},6189:(e,t,i)=>{"use strict";
949Object.defineProperty(t,"__esModule",{value:!0}),t.SphericalGeometrySubdivisionModifier=void 0;const n=i(82),r=i(2616),s=i(3386),o=[new n.Vector3,new n.Vector3,new n.Vector3];class a extends s.SubdivisionModifier{constructor(e,t=r.sphereProjection){super(),this.angle=e,this.projection=t}shouldSplitTriangle(e,t,i){const n=r.sphereProjection.reprojectPoint(this.projection,e,o[0]),s=r.sphereProjection.reprojectPoint(this.projection,t,o[1]),a=r.sphereProjection.reprojectPoint(this.projection,i,o[2]),l=n.angleTo(s),c=s.angleTo(a),h=a.angleTo(n),u=Math.max(l,Math.max(c,h));if(!(u<this.angle)){if(u===l)return 0;if(u===c)return 1;if(u===h)return 2;throw new Error("failed to split triangle")}}}t.SphericalGeometrySubdivisionModifier=a},3386:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SubdivisionModifier=void 0;const n=i(82),r=new n.Vector3,s=new n.Vector3,o=new n.Vector3;t.SubdivisionModifier=class{constructor(){}modify(e){const t=e.getAttribute("position"),i=Array.from(t.array),n=e.getAttribute("uv"),a=void 0!==n?Array.from(n.array):void 0,l=e.getAttribute("edge"),c=void 0!==l?Array.from(l.array):void 0,h=e.getAttribute("wall"),u=void 0!==h?Array.from(h.array):void 0,d=e.getIndex(),m=Array.from(d.array),p=new Map;function f(e,t){const n=`${Math.min(e,t)}_${Math.max(e,t)}`,l=p.get(n);if(void 0!==l)return l;r.set(i[3*e],i[3*e+1],i[3*e+2]),s.set(i[3*t],i[3*t+1],i[3*t+2]),o.lerpVectors(r,s,.5);const h=i.length/3;return i.push(...o.toArray()),p.set(n,h),void 0!==a&&(r.set(a[2*e],a[2*e+1],0),s.set(a[2*t],a[2*t+1],0),o.lerpVectors(r,s,.5),a.push(o.x,o.y)),void 0!==c&&(c[e]===t?(c.push(t),c[e]=h):c[t]===e?(c.push(e),c[t]=h):c.push(-1)),void 0!==u&&(u[e]===t?(u.push(t),u[e]=h):u[t]===e?(u.push(e),u[t]=h):u.push(-1)),h}const g=[];for(;m.length>=3;){const e=m.shift(),t=m.shift(),n=m.shift();switch(r.set(i[3*e],i[3*e+1],i[3*e+2]),s.set(i[3*t],i[3*t+1],i[3*t+2]),o.set(i[3*n],i[3*n+1],i[3*n+2]),this.shouldSplitTriangle(r,s,o)){case 0:{const i=f(e,t);m.push(e,i,n,i,t,n);break}case 1:{const i=f(t,n);m.push(e,t,i,e,i,n);break}case 2:{const i=f(n,e);m.push(e,t,i,i,t,n);break}case void 0:g.push(e,t,n);break;default:throw new Error("failed to subdivide the given geometry")}}return t.array=t.array instanceof Float32Array?new Float32Array(i):new Float64Array(i),t.count=i.length/t.itemSize,t.needsUpdate=!0,e.setIndex(g),void 0!==a&&(n.array=new Float32Array(a),n.count=a.length/n.itemSize,n.needsUpdate=!0),void 0!==c&&(l.array=new Float32Array(c),l.count=c.length/l.itemSize,l.needsUpdate=!0),e}}},3997:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.wrapLineString=void 0;var n=i(6112);Object.defineProperty(t,"wrapLineString",{enumerable:!0,get:function(){return n.wrapLineString}})},8965:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.wrapPolygon=void 0;const n=i(82),r=i(2616),s=i(4342),o=i(2982);class a extends o.ClippingEdge{constructor(e,t,i){super(),this.isInside=i,this.p0=(new n.Vector2).fromArray(e),this.p1=(new n.Vector2).fromArray(t)}inside(e,t){return this.isInside(e)}computeIntersection(e,t,i){const r=new n.Vector2;return s.Math2D.intersectLines(e.x,e.y,t.x,t.y,this.p0.x,this.p0.y,this.p1.x,this.p1.y,r),r}}const l=r.EarthConstants.EQUATORIAL_CIRCUMFERENCE,c=.05*l,h=[new a([0-c,l],[0-c,0],(e=>e.x>0-c)),new a([l+c,0],[l+c,l],(e=>e.x<l+c))],u=[new a([-l-c,l],[-l-c,0],(e=>e.x>-l-c)),new a([0+c,0],[0+c,l],(e=>e.x<0+c))],d=[new a([l-c,l],[l-c,0],(e=>e.x>l-c)),new a([2*l+c,0],[2*l+c,l],(e=>e.x<2*l+c))];function m(e,t,i){for(const i of t)e=i.clipPolygon(e,0);const s=new n.Vector3,o=e.map((({x:e,y:t})=>{s.set(e,t,0);const n=r.webMercatorProjection.unprojectPoint(s);return n.longitude+=i,n}));return o.length>0?o:void 0}t.wrapPolygon=function(e){const t=new n.Vector3,i=e.map((e=>{const{x:i,y:s}=r.webMercatorProjection.projectPoint(e,t);return new n.Vector2(i,s)}));return{left:m(i,u,360),middle:m(i,h,0),right:m(i,d,-360)}}},2616:function(e,t,i){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);
949r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=this&&this.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||n(t,e,i)};Object.defineProperty(t,"__esModule",{value:!0}),r(i(3068),t),r(i(5999),t),r(i(6306),t),r(i(4860),t),r(i(8248),t),r(i(9019),t),r(i(6482),t),r(i(7870),t),r(i(5610),t),r(i(1515),t),r(i(9686),t),r(i(5234),t),r(i(9885),t),r(i(7289),t),r(i(6322),t),r(i(9861),t),r(i(435),t),r(i(9447),t),r(i(7171),t),r(i(3424),t),r(i(4948),t),r(i(6541),t),r(i(7841),t),r(i(2801),t),r(i(6557),t),r(i(4490),t),r(i(2224),t),r(i(1635),t),r(i(1871),t),r(i(2953),t),r(i(1383),t),r(i(9264),t),r(i(58),t),r(i(7523),t),r(i(2683),t),r(i(2334),t)},3068:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GeoBox=void 0;const n=i(82),r=i(4860);class s{static fromCoordinates(e,t){return new s(e,t)}static fromCenterAndExtents(e,t){return new s(new r.GeoCoordinates(e.latitude-t.latitudeSpan/2,e.longitude-t.longitudeSpan/2),new r.GeoCoordinates(e.latitude+t.latitudeSpan/2,e.longitude+t.longitudeSpan/2))}constructor(e,t){this.southWest=e,this.northEast=t,this.west>this.east&&(this.northEast.longitude+=360)}get minAltitude(){if(void 0!==this.southWest.altitude&&void 0!==this.northEast.altitude)return Math.min(this.southWest.altitude,this.northEast.altitude)}get maxAltitude(){if(void 0!==this.southWest.altitude&&void 0!==this.northEast.altitude)return Math.max(this.southWest.altitude,this.northEast.altitude)}get south(){return this.southWest.latitude}get north(){return this.northEast.latitude}get west(){return this.southWest.longitude}get east(){return this.northEast.longitude}get center(){const e=.5*(this.south+this.north),{west:t,east:i}=this,{minAltitude:n,altitudeSpan:s}=this;let o;if(void 0!==n&&void 0!==s&&(o=n+.5*s),t<=i)return new r.GeoCoordinates(e,.5*(t+i),o);let a=.5*(360+i+t);return a>360&&(a-=360),new r.GeoCoordinates(e,a,o)}get latitudeSpanInRadians(){return n.MathUtils.degToRad(this.latitudeSpan)}get longitudeSpanInRadians(){return n.MathUtils.degToRad(this.longitudeSpan)}get latitudeSpan(){return this.north-this.south}get altitudeSpan(){if(void 0!==this.maxAltitude&&void 0!==this.minAltitude)return this.maxAltitude-this.minAltitude}get longitudeSpan(){let e=this.northEast.longitude-this.southWest.longitude;return e<0&&(e+=360),e}get latitudeSpanInDegrees(){return this.latitudeSpan}get longitudeSpanInDegrees(){return this.longitudeSpan}contains(e){if(void 0===e.altitude||void 0===this.minAltitude||void 0===this.maxAltitude)return this.containsHelper(e);const t=this.minAltitude===this.maxAltitude,i=this.minAltitude===e.altitude,n=this.minAltitude<=e.altitude&&this.maxAltitude>e.altitude;return!!(t?i:n)&&this.containsHelper(e)}clone(){return new s(this.southWest.clone(),this.northEast.clone())}growToContain(e){this.southWest.latitude=Math.min(this.southWest.latitude,e.latitude),this.southWest.longitude=Math.min(this.southWest.longitude,e.longitude),this.southWest.altitude=void 0!==this.southWest.altitude&&void 0!==e.altitude?Math.min(this.southWest.altitude,e.altitude):void 0!==this.southWest.altitude?this.southWest.altitude:void 0!==e.altitude?e.altitude:void 0,this.northEast.latitude=Math.max(this.northEast.latitude,e.latitude),this.northEast.longitude=Math.max(this.northEast.longitude,e.longitude),this.northEast.altitude=void 0!==this.northEast.altitude&&void 0!==e.altitude?Math.max(this.northEast.altitude,e.altitude):void 0!==this.northEast.altitude?this.northEast.altitude:void 0!==e.altitude?e.altitude:void 0}containsHelper(e){if(e.latitude<this.southWest.latitude||e.latitude>=this.northEast.latitude)return!1;const{west:t,east:i}=this;let n=e.longitude;if(i>r.MAX_LONGITUDE)for(;n<t;)n+=360;if(n>i)for(;n>t+360;)n-=360;return n>=t&&n<i}}t.GeoBox=s},5999:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isGeoBoxExtentLike=void 0,t.isGeoBoxExtentLike=function(e){return e&&"object"==typeof e&&"number"==typeof e.latitudeSpan&&"number"==typeof e.longitudeSpan}},680:(e,t,i)=>{"use strict";
949Object.defineProperty(t,"__esModule",{value:!0}),t.isGeoCoordLike=t.geoCoordLikeToGeoPointLike=t.geoCoordLikeToGeoCoordinatesLike=void 0;const n=i(6306),r=i(8248),s=i(7870);t.geoCoordLikeToGeoCoordinatesLike=function(e){return(0,n.isGeoCoordinatesLike)(e)?e:(0,s.isLatLngLike)(e)?{latitude:e.lat,longitude:e.lng}:{latitude:e[1],longitude:e[0]}},t.geoCoordLikeToGeoPointLike=function(e){return(0,r.isGeoPointLike)(e)?e:(0,s.isLatLngLike)(e)?[e.lng,e.lat]:[e.longitude,e.latitude]},t.isGeoCoordLike=function(e){return(0,n.isGeoCoordinatesLike)(e)||(0,s.isLatLngLike)(e)||!(0,r.isGeoPointLike)(e)}},4860:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GeoCoordinates=t.MIN_LONGITUDE=t.MAX_LONGITUDE=t.MIN_LATITUDE=t.MAX_LATITUDE=void 0;const n=i(82),r=i(6306),s=i(8248),o=i(7870);t.MAX_LATITUDE=90,t.MIN_LATITUDE=-90,t.MAX_LONGITUDE=180,t.MIN_LONGITUDE=-180;const a=new n.Vector3,l=new n.Vector3;class c{static fromDegrees(e,t,i){return new c(e,t,i)}static fromRadians(e,t,i){return new c(n.MathUtils.radToDeg(e),n.MathUtils.radToDeg(t),i)}static fromLatLng(e){return new c(e.lat,e.lng)}static fromGeoPoint(e){return new c(e[1],e[0],e[2])}static fromObject(e){if((0,s.isGeoPointLike)(e))return c.fromGeoPoint(e);if((0,r.isGeoCoordinatesLike)(e))return c.fromDegrees(e.latitude,e.longitude,e.altitude);if((0,o.isLatLngLike)(e))return c.fromDegrees(e.lat,e.lng);throw new Error("Invalid input coordinate format.")}static lerp(e,t,i,n=!1,r=!1){var s,o;if(n){if(e.lng<t.lng){const n=e.clone();return n.longitude+=360,this.lerp(t,n,1-i)}{const n=t.clone();return n.longitude+=360,this.lerp(e,n,i)}}const h=a.set(e.lat,e.lng,null!==(s=e.altitude)&&void 0!==s?s:0),u=l.set(t.lat,t.lng,null!==(o=t.altitude)&&void 0!==o?o:0);h.lerp(u,i);const d=new c(h.x,h.y,h.z);return r?d.normalized():d}constructor(e,t,i){this.latitude=e,this.longitude=t,this.altitude=i}get latitudeInRadians(){return n.MathUtils.degToRad(this.latitude)}get longitudeInRadians(){return n.MathUtils.degToRad(this.longitude)}get latitudeInDegrees(){return this.latitude}get longitudeInDegrees(){return this.longitude}get lat(){return this.latitude}get lng(){return this.longitude}isValid(){return!isNaN(this.latitude)&&!isNaN(this.longitude)}normalized(){let{latitude:e,longitude:t}=this;return isNaN(e)||isNaN(t)?this:((t<-180||t>180)&&(t=function(e,t){const i=e%360;return i<0==0?i:i+360}(t+180)-180),e=n.MathUtils.clamp(e,-90,90),new c(e,t,this.altitude))}equals(e){return this.latitude===e.latitude&&this.longitude===e.longitude&&this.altitude===e.altitude}copy(e){return this.latitude=e.latitude,this.longitude=e.longitude,this.altitude=e.altitude,this}clone(){return new c(this.latitude,this.longitude,this.altitude)}toLatLng(){return{lat:this.latitude,lng:this.longitude}}toGeoPoint(){return void 0!==this.altitude?[this.longitude,this.latitude,this.altitude]:[this.longitude,this.latitude]}minLongitudeSpanTo(e){const t=Math.min(this.longitude,e.longitude),i=Math.max(this.longitude,e.longitude);return Math.min(i-t,360+t-i)}}t.GeoCoordinates=c},6306:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isGeoCoordinatesLike=void 0,t.isGeoCoordinatesLike=function(e){return e&&"number"==typeof e.latitude&&"number"==typeof e.longitude&&("number"==typeof e.altitude||void 0===e.altitude)}},8248:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isGeoPointLike=void 0,t.isGeoPointLike=function(e){if(Array.isArray(e)){const[t,i,n]=e;return"number"==typeof t&&"number"==typeof i&&(void 0===n||"number"==typeof n)}return!1}},6482:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GeoPolygon=t.isAntimeridianCrossing=void 0;const n=i(82),r=i(3068),s=i(4860),o=i(680);function a(e,t){return Math.max(e,t)-Math.min(e,t)}function l(e,t){return e>0&&t<0&&a(e,t)>180}t.isAntimeridianCrossing=function(e,t){return Math.sign(e)===-Math.sign(t)&&a(e,t)>180},t.GeoPolygon=class{constructor(e,t=!1,i=!1){this.m_coordinates=e.map((e=>(0,o.geoCoordLikeToGeoCoordinatesLike)(e))),t&&this.sortCCW(),i&&this.wrapCoordinatesAround()}get coordinates(){return this.m_coordinates}getGeoBoundingBox(){const e=this.getCentroid();if(void 0===e)return r.GeoBox.fromCoordinates(this.coordinates[0],this.coordinates[0]);const{east:t,west:i}=this.getEastAndWest(e),{north:n,south:o}=this.getNorthAndSouth();return r.GeoBox.fromCoordinates(new s.GeoCoordinates(o,i),new s.GeoCoordinates(n,t))}getCentroid(){const e=this.getArea();if(0===e)return;let t,i=0,n=0,r=this.m_coordinates.length-1;
949return this.m_coordinates.forEach(((e,s)=>{const o=this.m_coordinates[r];t=e.latitude*o.longitude-o.latitude*e.longitude,i+=(e.latitude+o.latitude)*t,n+=(e.longitude+o.longitude)*t,r=s})),t=6*e,new s.GeoCoordinates(i/t,e<0?n/t-180:n/t)}sortCCW(){const e=this.getPolyAverageCenter();e&&this.m_coordinates.sort(((t,i)=>{const r=new n.Vector2(t.latitude-e.latitude,t.longitude-e.longitude).normalize();return new n.Vector2(i.latitude-e.latitude,i.longitude-e.longitude).normalize().angle()-r.angle()}))}wrapCoordinatesAround(){const e=this.m_coordinates.findIndex(((e,t)=>{const i=0===t?this.m_coordinates.length-1:t-1;return l(this.m_coordinates[i].longitude,e.longitude)}));if(e<0)return;let t=!0;for(let i=0;i<this.m_coordinates.length;i++){const n=(e+i)%this.m_coordinates.length,r=this.m_coordinates[n].longitude,s=this.m_coordinates[(n+1)%this.m_coordinates.length].longitude;t&&(this.m_coordinates[n].longitude+=360),l(s,r)?t=!1:l(r,s)&&(t=!0)}}getPolyAverageCenter(){const e=this.m_coordinates.reduce(((e,t)=>new s.GeoCoordinates(e.latitude+t.latitude,e.longitude+t.longitude)));return new s.GeoCoordinates(e.latitude/this.m_coordinates.length,e.longitude/this.m_coordinates.length)}getArea(){let e=0,t=this.m_coordinates.length-1;return this.m_coordinates.forEach(((i,n)=>{const r=this.m_coordinates[t];e+=i.latitude*r.longitude,e-=i.longitude*r.latitude,t=n})),e/=2}getEastAndWest(e){let t=e.longitude,i=e.longitude,r=this.m_coordinates.length-1;return this.m_coordinates.forEach(((s,o)=>{const a=this.m_coordinates[r];r=o;const l=new n.Vector2(s.latitude-e.latitude,s.longitude-e.longitude).normalize(),c=new n.Vector2(a.latitude-e.latitude,a.longitude-e.longitude).normalize();let h=1===Math.sign(c.angle()-l.angle());c.y>=0&&l.y<0&&(h=!0);const u=s.longitude;u<e.longitude?h?t=Math.min(t,u):i=Math.min(i,u):h?i=Math.max(i,u):t=Math.max(t,u)})),{east:i,west:t}}getNorthAndSouth(){let e=s.MIN_LATITUDE,t=s.MAX_LATITUDE;return this.m_coordinates.forEach(((i,n)=>{e=Math.max(e,i.latitude),t=Math.min(t,i.latitude)})),{north:e,south:t}}}},9019:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isGeoPolygonLike=void 0;const n=i(680);t.isGeoPolygonLike=function(e){if(!e||!Array.isArray(e.coordinates)&&e.coordinates.length>2)return!1;let t=!0;return e.coordinates.forEach((i=>{(0,n.isGeoCoordLike)(e)||(t=!1)})),t}},7870:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isLatLngLike=void 0,t.isLatLngLike=function(e){return e&&"number"==typeof e.lat&&"number"==typeof e.lng}},9264:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isBox3Like=void 0,t.isBox3Like=function(e){const t=e;return void 0!==t.min&&void 0!==t.max}},7523:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MathUtils=void 0;const n=i(82);!function(e){function t(e){return(e%=360)<0&&(e+=360),e}function i(e,i){const n=(e=t(e))-(i=t(i));return n>180?n-360:n<=-180?n+360:n}e.newEmptyBox3=function(){return{min:{x:1/0,y:1/0,z:1/0},max:{x:-1/0,y:-1/0,z:-1/0}}},e.newVector3=function(e,t,i,n){return void 0===n?{x:e,y:t,z:i}:(n.x=e,n.y=t,n.z=i,n)},e.copyVector3=function(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t},e.degToRad=n.MathUtils.degToRad,e.radToDeg=n.MathUtils.radToDeg,e.clamp=n.MathUtils.clamp,e.normalizeAngleDeg=t,e.normalizeLongitudeDeg=function(e){return(e=t(e))>180&&(e-=360),e},e.angleDistanceDeg=i,e.interpolateAnglesDeg=function(e,t,n){return(e+i(t,e)*n)%360}}(t.MathUtils||(t.MathUtils={}))},2334:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OrientedBox3=void 0;const n=i(82);function r(e,t,i,n,r){const s=i.dot(t),o=i.dot(e);if(Math.abs(o)<1e-20)return Math.abs(s)<=n;const a=1/o,l=(s+n)*a,c=(s-n)*a;return l>c?(c>r.min&&(r.min=c),l<r.max&&(r.max=l)):(l>r.min&&(r.min=l),c<r.max&&(r.max=c)),r.min<=r.max&&r.max>=0}const s=new n.Vector3,o={min:-1/0,max:1/0};class a{constructor(e,t,i){this.position=new n.Vector3,this.xAxis=new n.Vector3(1,0,0),this.yAxis=new n.Vector3(0,1,0),this.zAxis=new n.Vector3(0,0,1),this.extents=new n.Vector3,void 0!==e&&this.position.copy(e),void 0!==t&&t.extractBasis(this.xAxis,this.yAxis,this.zAxis),void 0!==i&&this.extents.copy(i)}clone(){const e=new a;return e.copy(this),e}copy(e){this.position.copy(e.position),this.xAxis.copy(e.xAxis),this.yAxis.copy(e.yAxis),this.zAxis.copy(e.zAxis),this.extents.copy(e.extents)}getCenter(e=new n.Vector3){return e.copy(this.position)}getSize(e=new n.Vector3){return e.copy(this.extents).multiplyScalar(2)}getRotationMatrix(e=new n.Matrix4){return e.makeBasis(this.xAxis,this.yAxis,this.zAxis)}intersects(e){const t=Array.isArray(e)?e:e.planes;for(const e of t){const t=Math.abs(e.normal.dot(this.xAxis)*this.extents.x)+Math.abs(e.normal.dot(this.yAxis)*this.extents.y)+Math.abs(e.normal.dot(this.zAxis)*this.extents.z);if(e.distanceToPoint(this.position)+t<0)return!1}return!0}intersectsRay(e){if(o.min=-1/0,o.max=1/0,s.copy(this.position).sub(e.origin),r(e.direction,s,this.xAxis,this.extents.x,o)&&r(e.direction,s,this.yAxis,this.extents.y,o)&&r(e.direction,s,this.zAxis,this.extents.z,o))return o.min>0?o.min:o.max}contains(e){const t=e.x-this.position.x,i=e.y-this.position.y,n=e.z-this.position.z,r=Math.abs(t*this.xAxis.x+i*this.xAxis.y+n*this.xAxis.z),s=Math.abs(t*this.yAxis.x+i*this.yAxis.y+n*this.yAxis.z),o=Math.abs(t*this.zAxis.x+i*this.zAxis.y+n*this.zAxis.z);return!(r>this.extents.x||s>this.extents.y||o>this.extents.z)}distanceToPoint(e){return Math.sqrt(this.distanceToPointSquared(e))}distanceToPointSquared(e){const t=new n.Vector3;t.subVectors(e,this.position);const i=[t.dot(this.xAxis),t.dot(this.yAxis),t.dot(this.zAxis)];let r=0;for(let e=0;e<3;++e){const t=i[e],n=this.extents.getComponent(e);
949if(t<-n){const e=n+t;r+=e*e}else if(t>n){const e=t-n;r+=e*e}}return r}}t.OrientedBox3=a},58:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isOrientedBox3Like=void 0,t.isOrientedBox3Like=function(e){const t=e;return void 0!==t.position&&void 0!==t.xAxis&&void 0!==t.yAxis&&void 0!==t.zAxis&&void 0!==t.extents}},2683:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isTransformLike=void 0,t.isTransformLike=function(e){const t=e;return void 0!==t.position&&void 0!==t.xAxis&&void 0!==t.yAxis&&void 0!==t.zAxis}},2953:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isVector2Like=void 0,t.isVector2Like=function(e){return e&&"number"==typeof e.x&&"number"==typeof e.y}},1383:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isVector3Like=void 0,t.isVector3Like=function(e){return e&&"number"==typeof e.x&&"number"==typeof e.y&&"number"==typeof e.z}},5610:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EarthConstants=void 0;class i{}t.EarthConstants=i,i.EQUATORIAL_CIRCUMFERENCE=40075016.68557849,i.EQUATORIAL_RADIUS=6378137,i.MIN_ELEVATION=-433,i.MAX_ELEVATION=8848,i.MAX_BUILDING_HEIGHT=828},1515:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.equirectangularProjection=t.normalizedEquirectangularProjection=void 0;const n=i(82),r=i(3068),s=i(4860),o=i(9264),a=i(7523),l=i(58),c=i(5610),h=i(5234);class u extends h.Projection{constructor(){super(...arguments),this.type=h.ProjectionType.Planar}getScaleFactor(e){return 1}worldExtent(e,t,i){return i||(i=new n.Box3),i.min.x=0,i.min.y=0,i.min.z=e,i.max.x=this.unitScale,i.max.y=this.unitScale/2,i.max.z=t,i}projectPoint(e,t){var i;return void 0===t&&(t={x:0,y:0,z:0}),t.x=(n.MathUtils.degToRad(e.longitude)+Math.PI)*u.geoToWorldScale*this.unitScale,t.y=(n.MathUtils.degToRad(e.latitude)+.5*Math.PI)*u.geoToWorldScale*this.unitScale,t.z=null!==(i=e.altitude)&&void 0!==i?i:0,t}unprojectPoint(e){return s.GeoCoordinates.fromRadians(e.y*u.worldToGeoScale/this.unitScale-.5*Math.PI,e.x*u.worldToGeoScale/this.unitScale-Math.PI,e.z)}unprojectAltitude(e){return e.z}projectBox(e,t){const i=this.projectPoint(new s.GeoCoordinates(e.center.latitude,e.center.longitude,0)),{latitudeSpanInRadians:r,longitudeSpanInRadians:c,altitudeSpan:h}=e,d=c*u.geoToWorldScale,m=r*u.geoToWorldScale;return t||(t=new n.Box3),(0,o.isBox3Like)(t)?(t.min.x=i.x-.5*d*this.unitScale,t.min.y=i.y-.5*m*this.unitScale,t.max.x=i.x+.5*d*this.unitScale,t.max.y=i.y+.5*m*this.unitScale,void 0!==h?(t.min.z=i.z-.5*h,t.max.z=i.z+.5*h):(t.min.z=0,t.max.z=0)):(0,l.isOrientedBox3Like)(t)&&(a.MathUtils.newVector3(1,0,0,t.xAxis),a.MathUtils.newVector3(0,1,0,t.yAxis),a.MathUtils.newVector3(0,0,1,t.zAxis),t.position.x=i.x,t.position.y=i.y,t.position.z=i.z,t.extents.x=.5*d*this.unitScale,t.extents.y=.5*m*this.unitScale,t.extents.z=Math.max(Number.EPSILON,.5*(null!=h?h:0))),t}unprojectBox(e){const t=this.unprojectPoint(e.min),i=this.unprojectPoint(e.max);return r.GeoBox.fromCoordinates(t,i)}groundDistance(e){return e.z}scalePointToSurface(e){return e.z=0,e}surfaceNormal(e,t){return void 0===t?t={x:0,y:0,z:1}:(t.x=0,t.y=0,t.z=1),t}}u.geoToWorldScale=1/(2*Math.PI),u.worldToGeoScale=2*Math.PI/1,t.normalizedEquirectangularProjection=new u(1),t.equirectangularProjection=new u(c.EarthConstants.EQUATORIAL_CIRCUMFERENCE)},9686:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.identityProjection=void 0;const n=i(82),r=i(3068),s=i(4860),o=i(9264),a=i(7523),l=i(58),c=i(5234);class h extends c.Projection{constructor(){super(...arguments),this.type=c.ProjectionType.Planar}getScaleFactor(e){return 1}worldExtent(e,t,i){return i||(i=new n.Box3),i.min.x=-Math.PI,i.min.y=.5*-Math.PI,i.min.z=e,i.max.x=Math.PI,i.max.y=.5*Math.PI,i.max.z=t,i}projectPoint(e,t){var i;return t||(t={x:0,y:0,z:0}),t.x=n.MathUtils.degToRad(e.longitude),t.y=n.MathUtils.degToRad(e.latitude),t.z=null!==(i=e.altitude)&&void 0!==i?i:0,t}unprojectPoint(e){return s.GeoCoordinates.fromRadians(e.y,e.x,e.z)}unprojectAltitude(e){return e.z}projectBox(e,t){t||(t=new n.Box3);const i=this.projectPoint(new s.GeoCoordinates(e.south,e.west,e.minAltitude)),r=this.projectPoint(new s.GeoCoordinates(e.north,e.east,e.maxAltitude));return(0,o.isBox3Like)(t)?(t.min.x=i.x,t.min.y=i.y,t.min.z=i.z,t.max.x=r.x,t.max.y=r.y,t.max.z=r.z):(0,l.isOrientedBox3Like)(t)&&(a.MathUtils.newVector3(1,0,0,t.xAxis),a.MathUtils.newVector3(0,1,0,t.yAxis),a.MathUtils.newVector3(0,0,1,t.zAxis),t.position.x=.5*(i.x+r.x),t.position.y=.5*(i.y+r.y),t.position.z=.5*(i.z+r.z),t.extents.x=.5*(r.x-i.x),t.extents.y=.5*(r.y-i.y),t.extents.z=Math.max(Number.EPSILON,.5*(r.z-i.z))),t}unprojectBox(e){const t=this.unprojectPoint(e.min),i=this.unprojectPoint(e.max);return r.GeoBox.fromCoordinates(t,i)}groundDistance(e){return e.z}scalePointToSurface(e){return e.z=0,e}surfaceNormal(e,t){return void 0===t?t={x:0,y:0,z:1}:(t.x=0,t.y=0,t.z=1),t}}t.identityProjection=new h(1)},9885:(e,t,i)=>{"use strict";
949Object.defineProperty(t,"__esModule",{value:!0}),t.webMercatorProjection=t.mercatorProjection=t.MercatorConstants=void 0;const n=i(82),r=i(3068),s=i(4860),o=i(6306),a=i(9264),l=i(7523),c=i(58),h=i(5610),u=i(5234);class d extends u.Projection{constructor(){super(...arguments),this.type=u.ProjectionType.Planar}static clamp(e,t,i){return Math.min(Math.max(t,e),i)}static latitudeClamp(e){return d.clamp(e,-m.MAXIMUM_LATITUDE,m.MAXIMUM_LATITUDE)}static latitudeProject(e){return Math.log(Math.tan(.25*Math.PI+.5*e))/Math.PI}static latitudeClampProject(e){return d.latitudeProject(d.latitudeClamp(e))}static unprojectLatitude(e){return 2*Math.atan(Math.exp(Math.PI*e))-.5*Math.PI}getScaleFactor(e){return Math.cosh(2*Math.PI*(e.y/this.unitScale-.5))}worldExtent(e,t,i){return i||(i=new n.Box3),i.min.x=0,i.min.y=0,i.min.z=e,i.max.x=this.unitScale,i.max.y=this.unitScale,i.max.z=t,i}projectPoint(e,t){var i;let n;return n=e instanceof s.GeoCoordinates?e:new s.GeoCoordinates(e.latitude,e.longitude,e.altitude),t||(t={x:0,y:0,z:0}),t.x=(n.longitude+180)/360*this.unitScale,t.y=(.5*d.latitudeClampProject(n.latitudeInRadians)+.5)*this.unitScale,t.z=null!==(i=n.altitude)&&void 0!==i?i:0,t}unprojectPoint(e){return s.GeoCoordinates.fromRadians(d.unprojectLatitude(2*(e.y/this.unitScale-.5)),e.x/this.unitScale*2*Math.PI-Math.PI,e.z)}unprojectAltitude(e){return e.z}projectBox(e,t){var i;const r=this.projectPoint(e.center),s=(.5*d.latitudeClampProject(e.northEast.latitudeInRadians)+.5)*this.unitScale,o=(.5*d.latitudeClampProject(e.southWest.latitudeInRadians)+.5)*this.unitScale,h=.5*(s+o);r.y=h;const u=s-o,m=e.longitudeSpan/360*this.unitScale;if(t||(t=new n.Box3),(0,a.isBox3Like)(t)){t.min.x=r.x-.5*m,t.min.y=r.y-.5*u,t.max.x=r.x+.5*m,t.max.y=r.y+.5*u;const i=e.altitudeSpan;void 0!==i?(t.min.z=r.z-.5*i,t.max.z=r.z+.5*i):(t.min.z=0,t.max.z=0)}else{if(!(0,c.isOrientedBox3Like)(t))throw new Error("invalid bounding box");l.MathUtils.newVector3(1,0,0,t.xAxis),l.MathUtils.newVector3(0,1,0,t.yAxis),l.MathUtils.newVector3(0,0,1,t.zAxis),t.position.x=r.x,t.position.y=r.y,t.position.z=r.z,t.extents.x=.5*m,t.extents.y=.5*u,t.extents.z=Math.max(Number.EPSILON,.5*(null!==(i=e.altitudeSpan)&&void 0!==i?i:0))}return t}unprojectBox(e){const t=this.unprojectPoint(e.min),i=this.unprojectPoint(e.max);return r.GeoBox.fromCoordinates(t,i)}groundDistance(e){return e.z}scalePointToSurface(e){return e.z=0,e}surfaceNormal(e,t){return void 0===t?t={x:0,y:0,z:1}:(t.x=0,t.y=0,t.z=1),t}reprojectPoint(e,i,n){return e===this||e!==t.webMercatorProjection&&e!==t.mercatorProjection?super.reprojectPoint(e,i,n):(void 0===n&&(n={}),n.x=i.x,n.y=this.unitScale-i.y,n.z=i.z,n)}}class m{}t.MercatorConstants=m,m.MAXIMUM_LATITUDE=1.4844222297453322,t.mercatorProjection=new d(h.EarthConstants.EQUATORIAL_CIRCUMFERENCE),t.webMercatorProjection=new class extends d{projectPoint(e,t){var i;let n;n=e instanceof s.GeoCoordinates?e:new s.GeoCoordinates(e.latitude,e.longitude,e.altitude),t||(t={x:0,y:0,z:0}),t.x=(n.longitude+180)/360*this.unitScale;const r=Math.sin(d.latitudeClamp(n.latitudeInRadians));return t.y=(.5-Math.log((1+r)/(1-r))/(4*Math.PI))*this.unitScale,t.z=null!==(i=n.altitude)&&void 0!==i?i:0,t}unprojectPoint(e){const t=e.x/this.unitScale-.5,i=.5-e.y/this.unitScale,n=360*t,r=90-360*Math.atan(Math.exp(2*-i*Math.PI))/Math.PI;return new s.GeoCoordinates(r,n,e.z)}projectBox(e,t){const i=super.projectBox(e,t);if((0,a.isBox3Like)(i)){const e=i.max.y;i.max.y=this.unitScale-i.min.y,i.min.y=this.unitScale-e}else(0,c.isOrientedBox3Like)(i)&&(l.MathUtils.newVector3(1,0,0,i.xAxis),l.MathUtils.newVector3(0,-1,0,i.yAxis),l.MathUtils.newVector3(0,0,-1,i.zAxis),i.position.y=this.unitScale-i.position.y);return i}unprojectBox(e){const t=this.unprojectPoint(e.min),i=this.unprojectPoint(e.max);return new r.GeoBox(new s.GeoCoordinates(i.latitude,t.longitude,t.altitude),new s.GeoCoordinates(t.latitude,i.longitude,i.altitude))}surfaceNormal(e,t){return void 0===t?t={x:0,y:0,z:-1}:(t.x=0,t.y=0,t.z=-1),t}localTangentSpace(e,t){return(0,o.isGeoCoordinatesLike)(e)?this.projectPoint(e,t.position):l.MathUtils.copyVector3(e,t.position),l.MathUtils.newVector3(1,0,0,t.xAxis),l.MathUtils.newVector3(0,-1,0,t.yAxis),l.MathUtils.newVector3(0,0,-1,t.zAxis),t}}(h.EarthConstants.EQUATORIAL_CIRCUMFERENCE)},5234:(e,t,i)=>{"use strict";
949Object.defineProperty(t,"__esModule",{value:!0}),t.Projection=t.ProjectionType=void 0;const n=i(6306),r=i(7523);var s;(s=t.ProjectionType||(t.ProjectionType={}))[s.Planar=0]="Planar",s[s.Spherical=1]="Spherical",t.Projection=class{constructor(e){this.unitScale=e}localTangentSpace(e,t){return(0,n.isGeoCoordinatesLike)(e)?this.projectPoint(e,t.position):r.MathUtils.copyVector3(e,t.position),r.MathUtils.newVector3(1,0,0,t.xAxis),r.MathUtils.newVector3(0,1,0,t.yAxis),r.MathUtils.newVector3(0,0,1,t.zAxis),t}reprojectPoint(e,t,i){return e===this?void 0===i?{x:t.x,y:t.y,z:t.z}:(i.x=t.x,i.y=t.y,i.z=t.z,i):this.projectPoint(e.unprojectPoint(t),i)}}},6322:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sphereProjection=void 0;const n=i(82),r=i(4860),s=i(6306),o=i(9264),a=i(7523),l=i(58),c=i(5610),h=i(9885),u=i(5234);function d(e){const t=1/Math.PI,i=Math.floor(2*(e*t+1));return n.MathUtils.clamp(i,0,4)}function m(e){return Math.sqrt(e.x*e.x+e.y*e.y+e.z*e.z)}function p(e,t,i){var r;const s=.5*(i+(null!==(r=e.maxAltitude)&&void 0!==r?r:0)),o=n.MathUtils.degToRad(e.west),a=n.MathUtils.degToRad(e.east),l=d(o),c=d(a);let h=Math.cos(o),u=h,m=Math.sin(o),p=m;for(let e=l+1;e<=c;e++){const t=(e+1&1)*((2&e)-1);h=Math.min(t,h),u=Math.max(t,u);const i=(1&e)*((2&e)-1);m=Math.min(i,m),p=Math.max(i,p)}const f=Math.cos(a);h=Math.min(f,h),u=Math.max(f,u);const g=Math.sin(a);m=Math.min(g,m),p=Math.max(g,p);const v=(u+h)*s,y=(u-h)*s,_=(p+m)*s,x=(p-m)*s,b=n.MathUtils.degToRad(e.south),w=n.MathUtils.degToRad(e.north),M=Math.sin(w),T=Math.sin(b),S=(M+T)*s,E=(M-T)*s;return t.min.x=v-y,t.min.y=_-x,t.min.z=S-E,t.max.x=v+y,t.max.y=_+x,t.max.z=S+E,t}class f extends u.Projection{constructor(){super(...arguments),this.type=u.ProjectionType.Spherical}worldExtent(e,t,i=new n.Box3){const r=this.unitScale+t;return i.min.x=-r,i.min.y=-r,i.min.z=-r,i.max.x=r,i.max.y=r,i.max.z=r,i}projectPoint(e,t=a.MathUtils.newVector3(0,0,0)){return function(e,t,i){var r;const s=i+(null!==(r=e.altitude)&&void 0!==r?r:0),o=n.MathUtils.degToRad(e.latitude),a=n.MathUtils.degToRad(e.longitude),l=Math.cos(o);return t.x=s*l*Math.cos(a),t.y=s*l*Math.sin(a),t.z=s*Math.sin(o),t}(e,t,this.unitScale)}unprojectPoint(e){const t=e.x*e.x+e.y*e.y,i=Math.sqrt(t),n=e.z/i;if(isNaN(n))return r.GeoCoordinates.fromRadians(0,0,-this.unitScale);const s=Math.sqrt(t+e.z*e.z);return r.GeoCoordinates.fromRadians(Math.atan(n),Math.atan2(e.y,e.x),s-this.unitScale)}unprojectAltitude(e){const t=e.x*e.x+e.y*e.y+e.z*e.z;return Math.sqrt(t)-c.EarthConstants.EQUATORIAL_RADIUS}projectBox(e,t=new n.Box3){var i,r;if((0,o.isBox3Like)(t))return p(e,t,this.unitScale);if((0,l.isOrientedBox3Like)(t)){if(e.longitudeSpan>=90){const i=p(e,new n.Box3,this.unitScale);return a.MathUtils.newVector3(1,0,0,t.xAxis),a.MathUtils.newVector3(0,1,0,t.yAxis),a.MathUtils.newVector3(0,0,1,t.zAxis),t.position.x=.5*(i.max.x+i.min.x),t.position.y=.5*(i.max.y+i.min.y),t.position.z=.5*(i.max.z+i.min.z),t.extents.x=.5*(i.max.x-i.min.x),t.extents.y=.5*(i.max.y-i.min.y),t.extents.z=.5*(i.max.z-i.min.z),t}const{south:s,west:o,north:l,east:c,center:h}=e,u=h.longitude,d=h.latitude,m=Math.cos(n.MathUtils.degToRad(s)),f=Math.sin(n.MathUtils.degToRad(s)),g=Math.cos(n.MathUtils.degToRad(o)),v=Math.sin(n.MathUtils.degToRad(o)),y=Math.cos(n.MathUtils.degToRad(l)),_=Math.sin(n.MathUtils.degToRad(l)),x=Math.cos(n.MathUtils.degToRad(c)),b=Math.sin(n.MathUtils.degToRad(c)),w=Math.cos(n.MathUtils.degToRad(u)),M=Math.sin(n.MathUtils.degToRad(u)),T=Math.cos(n.MathUtils.degToRad(d)),S=Math.sin(n.MathUtils.degToRad(d));let E,A,C;a.MathUtils.newVector3(w*T,M*T,S,t.zAxis),a.MathUtils.newVector3(-M,w,0,t.xAxis),a.MathUtils.newVector3(-w*S,-M*S,T,t.yAxis),s>=0?(E=Math.abs(m*(w*(v-b)+M*(x-g))),A=T*f-S*m,C=T*_-S*y*(w*x+M*b)):(l<=0?(E=Math.abs(y*(w*(v-b)+M*(x-g))),C=T*_-S*y):(E=Math.abs(w*(v-b)+M*(x-g)),C=T*_-S*y*(M*b+w*x)),A=T*f-S*m*(w*x+M*b));const P=.5*(this.unitScale+(null!==(i=e.maxAltitude)&&void 0!==i?i:0)),L=.5*(this.unitScale+(null!==(r=e.minAltitude)&&void 0!==r?r:0)),R=T*(w*x+M*b),D=Math.min(y*R+_*S,m*R+f*S);return a.MathUtils.newVector3(E*P,(C-A)*P,P-D*L,t.extents),a.MathUtils.newVector3(0,(A+C)*P,P+P,t.position),function(e,t,i,n){const r=e.x*n.x+t.x*n.y+i.x*n.z,s=e.y*n.x+t.y*n.y+i.y*n.z,o=e.z*n.x+t.z*n.y+i.z*n.z;n.x=r,n.y=s,n.z=o}(t.xAxis,t.yAxis,t.zAxis,t.position),t.position.x=t.position.x-t.zAxis.x*t.extents.z,t.position.y=t.position.y-t.zAxis.y*t.extents.z,t.position.z=t.position.z-t.zAxis.z*t.extents.z,t}throw new Error("Invalid bounding box")}unprojectBox(e){throw new Error("Method not implemented.")}getScaleFactor(e){return 1}groundDistance(e){return m(e)-this.unitScale}scalePointToSurface(e){const t=this.unitScale/(m(e)||1);return e.x*=t,e.y*=t,e.z*=t,e}surfaceNormal(e,t){void 0===t&&(t={x:0,y:0,z:0});const i=1/(m(e)||1);return t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t}reprojectPoint(e,t,i){if(e===h.mercatorProjection||e===h.webMercatorProjection){const{x:n,y:r,z:s}=t,o=this.unitScale,a=n/o-Math.PI,l=r/o-Math.PI,c=Math.exp(l),u=c*c,d=2*c/(u+1),m=(u-1)/(u+1),p=o+s;return void 0===i&&(i={}),i.x=Math.cos(a)*d*p,i.y=Math.sin(a)*d*p,i.z=m*p,e===h.webMercatorProjection&&(i.z=-i.z),i}return super.reprojectPoint(e,t,i)}localTangentSpace(e,t){let i;(0,s.isGeoCoordinatesLike)(e)?(this.projectPoint(e,t.position),i=e):(a.MathUtils.copyVector3(e,t.position),i=this.unprojectPoint(e));const r=n.MathUtils.degToRad(i.latitude),o=n.MathUtils.degToRad(i.longitude),l=Math.cos(o),c=Math.sin(o),h=Math.cos(r),u=Math.sin(r);return a.MathUtils.newVector3(l*h,c*h,u,t.zAxis),a.MathUtils.newVector3(-c,l,0,t.xAxis),a.MathUtils.newVector3(-l*u,-c*u,h,t.yAxis),t}}t.sphereProjection=new f(c.EarthConstants.EQUATORIAL_RADIUS)},7289:(e,t,i)=>{"use strict";
949Object.defineProperty(t,"__esModule",{value:!0}),t.transverseMercatorProjection=t.TransverseMercatorUtils=void 0;const n=i(82),r=i(3068),s=i(4860),o=i(9264),a=i(7523),l=i(58),c=i(5610),h=i(5234);class u extends h.Projection{static clampGeoPoint(e,t){const i=e.latitude,n=e.longitude,r=d.POLE_RADIUS,o=d.POLE_RADIUS_SQ,a=Math.round(n/90),l=90*a-n;if(a%2==0||Math.abs(l)>r)return e;const c=i-0,h=l*l+c*c;if(h<o){const e=Math.sqrt(h),t=(r-e)/e,o=0===l&&0===c?1*r:l;return new s.GeoCoordinates(i+c*t,n+o*t)}return e}constructor(e){super(e),this.unitScale=e,this.type=h.ProjectionType.Planar,this.m_phi0=0,this.m_lambda0=0}getScaleFactor(e){return Math.cosh(2*(e.x/this.unitScale-.5)*Math.PI)}worldExtent(e,t,i){return i||(i=new n.Box3),i.min.x=0,i.min.y=0,i.min.z=e,i.max.x=this.unitScale,i.max.y=this.unitScale,i.max.z=t,i}projectPoint(e,t){var i;t||(t={x:0,y:0,z:0});const r=u.clampGeoPoint(e,this.unitScale),s=r.longitude/360+.5,o=1===s?0:Math.floor(s),a=n.MathUtils.degToRad(r.latitude),l=n.MathUtils.degToRad(r.longitude-360*o)-this.m_lambda0,c=Math.cos(a)*Math.sin(l);t.x=Math.atanh(c),t.y=Math.atan2(Math.tan(a),Math.cos(l))-this.m_phi0;const h=.5/Math.PI;return t.x=this.unitScale*(n.MathUtils.clamp(t.x*h+.5,0,1)+o),t.y=this.unitScale*n.MathUtils.clamp(t.y*h+.5,0,1),t.z=null!==(i=e.altitude)&&void 0!==i?i:0,t}unprojectPoint(e){const t=2*Math.PI,i=e.x/this.unitScale,n=e.y/this.unitScale,r=1===i?0:Math.floor(i),o=t*(i-.5-r),a=t*(n-.5),l=e.z||0,c=a+this.m_phi0,h=Math.asin(Math.sin(c)/Math.cosh(o)),u=this.m_lambda0+Math.atan2(Math.sinh(o),Math.cos(c))+r*t;return s.GeoCoordinates.fromRadians(h,u,l)}projectBox(e,t){const{north:i,south:r,east:c,west:h}=e,u=[e.center,e.northEast,e.southWest,new s.GeoCoordinates(r,c),new s.GeoCoordinates(i,h)],m=d.POLE_EDGE_DEG,p=h<90&&c>90,f=h<0&&c>0,g=h<m&&c>-m&&i>0&&r<0;h<-90&&c>-90&&(u.push(new s.GeoCoordinates(i,-90)),u.push(new s.GeoCoordinates(r,-90))),p&&(u.push(new s.GeoCoordinates(i,90)),u.push(new s.GeoCoordinates(r,90))),f&&(u.push(new s.GeoCoordinates(i,0)),u.push(new s.GeoCoordinates(r,0))),g&&(u.push(new s.GeoCoordinates(0,h)),u.push(new s.GeoCoordinates(0,c))),d.alignLatitude(u,u[0]);const v=u.map((e=>this.projectPoint(e))),y=v.map((e=>e.x)),_=v.map((e=>e.y)),x=v.map((e=>e.z)),b=Math.min(...y),w=Math.min(..._),M=Math.min(...x),T=Math.max(...y),S=Math.max(..._),E=Math.max(...x);if(t||(t=new n.Box3),(0,o.isBox3Like)(t))t.min.x=b,t.min.y=w,t.min.z=M,t.max.x=T,t.max.y=S,t.max.z=E;else{if(!(0,l.isOrientedBox3Like)(t))throw new Error("invalid bounding box");a.MathUtils.newVector3(1,0,0,t.xAxis),a.MathUtils.newVector3(0,1,0,t.yAxis),a.MathUtils.newVector3(0,0,1,t.zAxis),t.position.x=(b+T)/2,t.position.y=(w+S)/2,t.position.z=(M+E)/2,t.extents.x=(T-b)/2,t.extents.y=(S-w)/2,t.extents.z=(E-M)/2}return t}unprojectBox(e){const t=this.unitScale,i=e.min,n=e.max,o=[{x:(i.x+n.x)/2,y:(i.y+n.y)/2,z:0},i,n,{x:i.x,y:n.y,z:0},{x:n.x,y:i.y,z:0}],a=.5*t,l=.25*t,c=.75*t,h=i.x<a&&n.x>a,u=i.y<a&&n.y>a,m=i.y<l&&n.y>l,p=i.y<c&&n.y>c;u&&(o.push({x:i.x,y:a,z:0}),o.push({x:n.x,y:a,z:0}),h&&o.push({x:a,y:a,z:0})),m&&(o.push({x:i.x,y:l,z:0}),o.push({x:n.x,y:l,z:0}),h&&o.push({x:a,y:l,z:0})),p&&(o.push({x:i.x,y:c,z:0}),o.push({x:n.x,y:c,z:0}),h&&o.push({x:a,y:c,z:0}));const f=o.map((e=>this.unprojectPoint(e)));d.alignLongitude(f,f[0]);const g=f.map((e=>e.latitude)),v=f.filter((e=>Math.abs(e.latitude)<90)).map((e=>e.longitude)),y=f.map((e=>{var t;return null!==(t=e.altitude)&&void 0!==t?t:0})),_=new s.GeoCoordinates(Math.min(...g),Math.min(...v),Math.min(...y)),x=new s.GeoCoordinates(Math.max(...g),Math.max(...v),Math.max(...y));return r.GeoBox.fromCoordinates(_,x)}unprojectAltitude(e){return e.z}groundDistance(e){return e.z}scalePointToSurface(e){return e.z=0,e}surfaceNormal(e,t){return void 0===t?t={x:0,y:0,z:-1}:(t.x=0,t.y=0,t.z=-1),t}}class d{static alignLatitude(e,t){for(const i of e)0===i.latitude&&(i.latitude=1e-9*t.latitude)}static alignLongitude(e,t){const i=t.longitude<0?180:-180,n=t.longitude<0?-180:180;for(const t of e)t.longitude===i&&(t.longitude=n)}}t.TransverseMercatorUtils=d,d.POLE_EDGE=1.4844222297453322,d.POLE_EDGE_DEG=n.MathUtils.radToDeg(d.POLE_
949EDGE),d.POLE_RADIUS=90-d.POLE_EDGE_DEG,d.POLE_RADIUS_SQ=Math.pow(d.POLE_RADIUS,2),t.transverseMercatorProjection=new u(c.EarthConstants.EQUATORIAL_CIRCUMFERENCE)},9861:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FlatTileBoundingBoxGenerator=void 0;const n=i(82);t.FlatTileBoundingBoxGenerator=class{constructor(e,t=0,i=0){this.tilingScheme=e,this.minElevation=t,this.maxElevation=i,this.m_tilingScheme=e,this.m_worldBox=e.projection.worldExtent(t,i);const{min:n,max:r}=this.m_worldBox;this.m_worldDimensions={x:r.x-n.x,y:r.y-n.y,z:r.z-n.z}}get projection(){return this.m_tilingScheme.projection}get subdivisionScheme(){return this.m_tilingScheme.subdivisionScheme}getWorldBox(e,t){const i=e.level,r=this.subdivisionScheme.getLevelDimensionX(i),s=this.subdivisionScheme.getLevelDimensionY(i),o=this.m_worldDimensions.x/r,a=this.m_worldDimensions.y/s,l=this.m_worldBox.min.x+o*e.column,c=this.m_worldBox.min.y+a*e.row;return t||(t=new n.Box3),t.min.x=l,t.min.y=c,t.min.z=this.m_worldBox.min.z,t.max.x=l+o,t.max.y=c+a,t.max.z=this.m_worldBox.max.z,t}getGeoBox(e){const t=this.getWorldBox(e);return this.projection.unprojectBox(t)}}},435:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.halfQuadTreeSubdivisionScheme=void 0,t.halfQuadTreeSubdivisionScheme=new class{getSubdivisionX(){return 2}getSubdivisionY(e){return 0===e?1:2}getLevelDimensionX(e){return 1<<e}getLevelDimensionY(e){return 0!==e?1<<e-1:1}}},4490:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hereTilingScheme=void 0;const n=i(1515),r=i(435),s=i(6557);t.hereTilingScheme=new s.TilingScheme(r.halfQuadTreeSubdivisionScheme,n.normalizedEquirectangularProjection)},1635:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mercatorTilingScheme=void 0;const n=i(9885),r=i(9447),s=i(6557);t.mercatorTilingScheme=new s.TilingScheme(r.quadTreeSubdivisionScheme,n.mercatorProjection)},1871:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.polarTilingScheme=void 0;const n=i(7289),r=i(9447),s=i(6557);t.polarTilingScheme=new s.TilingScheme(r.quadTreeSubdivisionScheme,n.transverseMercatorProjection)},7171:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.QuadTree=void 0;const n=i(6541);t.QuadTree=class{constructor(e){this.tilingScheme=e}visit(e){this.visitTileKey(n.TileKey.fromRowColumnLevel(0,0,0),e)}visitTileKey(e,t){if(t(e,this.tilingScheme.getGeoBox(e)))for(const i of this.tilingScheme.getSubTileKeys(e))this.visitTileKey(i,t)}}},9447:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.quadTreeSubdivisionScheme=void 0,t.quadTreeSubdivisionScheme=new class{getSubdivisionX(){return 2}getSubdivisionY(){return 2}getLevelDimensionX(e){return 1<<e}getLevelDimensionY(e){return 1<<e}}},3424:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SubTiles=void 0;const n=i(6541);class r{constructor(e,t,i){this.tileKey=e,this.sizeX=t,this.sizeY=i}[Symbol.iterator](){return 2===this.sizeX&&2===this.sizeY?r.ZCurveIterator(this.tileKey):r.RowColumnIterator(this.tileKey,this.sizeX,this.sizeY)}}t.SubTiles=r,function(e){e.RowColumnIterator=function*(e,t,i){for(let r=0;r<i;r++)for(let s=0;s<t;s++)yield n.TileKey.fromRowColumnLevel(e.row*i+r,e.column*t+s,e.level+1)},e.ZCurveIterator=function*(e){for(let t=0;t<4;t++)yield n.TileKey.fromRowColumnLevel(e.row<<1|t>>1,e.column<<1|1&t,e.level+1)}}(r=t.SubTiles||(t.SubTiles={}))},4948:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6541:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TileKey=void 0;const i=[1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384,32768,65536,131072,262144,524288,1048576,2097152,4194304,8388608,16777216,33554432,67108864,134217728,268435456,536870912,1073741824,2147483648,4294967296,8589934592,17179869184,34359738368,68719476736,137438953472,274877906944,549755813888,1099511627776,2199023255552,4398046511104,8796093022208,17592186044416,35184372088832,70368744177664,0x800000000000,281474976710656,562949953421312,0x4000000000000,
9490x8000000000000,4503599627370496];class n{static fromRowColumnLevel(e,t,i){return new n(e,t,i)}static fromQuadKey(e){const t=e.length;let i=0,r=0;for(let n=0;n<e.length;++n){const s=1<<n,o=parseInt(e.charAt(t-n-1),10);1&o&&(r|=s),2&o&&(i|=s)}return n.fromRowColumnLevel(i,r,t)}static fromMortonCode(e){let t=0,i=0,r=0,s=e;for(;s>1;){const e=1<<t;1&s&&(r|=e),2&s&&(i|=e),t++,s=(s-(3&s))/4}const o=n.fromRowColumnLevel(i,r,t);return o.m_mortonCode=e,o}static fromHereTile(e){const t=n.fromMortonCode(parseInt(e,10));return t.m_hereTile=e,t}static columnsAtLevel(e){return Math.pow(2,e)}static rowsAtLevel(e){return Math.pow(2,e)}static atCoords(e,t,i,r,s){return n.fromRowColumnLevel(Math.floor(i/(s/n.rowsAtLevel(e))),Math.floor(t/(r/n.columnsAtLevel(e))),e)}static parentMortonCode(e){return Math.floor(e/4)}constructor(e,t,i){this.row=e,this.column=t,this.level=i}parent(){if(0===this.level)throw new Error("Cannot get the parent of the root tile key");return n.fromRowColumnLevel(this.row>>>1,this.column>>>1,this.level-1)}changedLevelBy(e){const t=Math.max(0,this.level+e);let i=this.row,r=this.column;return e>=0?(i<<=e,r<<=e):(i>>>=-e,r>>>=-e),n.fromRowColumnLevel(i,r,t)}changedLevelTo(e){return this.changedLevelBy(e-this.level)}mortonCode(){if(void 0===this.m_mortonCode){let e=this.column,t=this.row,n=i[this.level<<1];for(let r=0;r<this.level;++r)1&e&&(n+=i[2*r]),1&t&&(n+=i[2*r+1]),e>>>=1,t>>>=1;this.m_mortonCode=n}return this.m_mortonCode}toHereTile(){return void 0===this.m_hereTile&&(this.m_hereTile=this.mortonCode().toString()),this.m_hereTile}toQuadKey(){let e="";for(let t=this.level;t>0;--t){const i=1<<t-1,n=!!(this.column&i),r=!!(this.row&i);e+=n&&r?"3":r?"2":n?"1":"0"}return e}equals(e){return this.row===e.row&&this.column===e.column&&this.level===e.level}addedSubKey(e){const t=n.fromQuadKey(0===e.length?"-":e),i=this.changedLevelBy(t.level);return n.fromRowColumnLevel(i.row+t.row,i.column+t.column,i.level)}addedSubHereTile(e){const t=n.fromHereTile(e),i=this.changedLevelBy(t.level);return n.fromRowColumnLevel(i.row+t.row,i.column+t.column,i.level)}getSubHereTile(e){const t=1<<2*e;return(this.mortonCode()&t-1|t).toString()}rowCount(){return n.rowsAtLevel(this.level)}columnCount(){return n.columnsAtLevel(this.level)}}t.TileKey=n},7841:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TileKeyUtils=t.powerOfTwo=void 0;const n=i(4860),r=i(6541);t.powerOfTwo=(()=>{let e=.5;return new Array(53).fill(0).map((()=>e*=2))})(),function(e){function i(e,t,i){const n=e.projection,s=e.subdivisionScheme,o=s.getLevelDimensionX(i),a=s.getLevelDimensionY(i),{min:l,max:c}=n.worldExtent(0,0),h=c.x-l.x,u=c.y-l.y;if(t.x<l.x||t.x>c.x)return null;if(t.y<l.y||t.y>c.y)return null;const d=Math.min(o-1,Math.floor(o*(t.x-l.x)/h)),m=Math.min(a-1,Math.floor(a*(t.y-l.y)/u));return r.TileKey.fromRowColumnLevel(m,d,i)}function s(e,i,n=4){const r=function(e,i=4){let n=0;const r=t.powerOfTwo[i];for(e+=r/2;e<0;)e+=r;for(;e>=r;)e-=r;for(let r=0;r<i&&e>0;r++)1&e&&(n+=t.powerOfTwo[53-i+r]),e>>>=1;return n}(i,n);return e.mortonCode()+r}function o(e,i=4){let n=0,r=e,s=0;for(;s<i;s++){const e=t.powerOfTwo[52-s];r>=e&&(r-=e,n+=t.powerOfTwo[i-1-s])}return n-=t.powerOfTwo[i-1],{offset:n,mortonCode:r}}e.geoCoordinatesToTileKey=function(e,t,n){return i(e,e.projection.projectPoint(t),n)},e.worldCoordinatesToTileKey=i,e.geoRectangleToTileKeys=function(t,i,s){const o=(e,t,i)=>e<t?i-(t-e)%(i-t):t+(e-t)%(i-t),a=(e,t,i)=>Math.min(Math.max(e,t),i),l=o(i.southWest.longitudeInRadians,-Math.PI,Math.PI),c=a(i.southWest.latitudeInRadians,-.5*Math.PI,.5*Math.PI),h=o(i.northEast.longitudeInRadians,-Math.PI,Math.PI),u=a(i.northEast.latitudeInRadians,-.5*Math.PI,.5*Math.PI),d=e.geoCoordinatesToTileKey(t,n.GeoCoordinates.fromRadians(c,l),s),m=e.geoCoordinatesToTileKey(t,n.GeoCoordinates.fromRadians(u,h),s),p=t.subdivisionScheme.getLevelDimensionX(s);if(!d||!m)throw new Error("Invalid coordinates");const f=d.column;let g=m.column;l>h&&(g+=g!==f?p:p-1);const v=Math.min(d.row,m.row),y=Math.max(d.row,m.row),_=new Array;for(let e=v;e<=y;++e)for(let t=f;t<=g;++t)_.push(r.TileKey.fromRowColumnLevel(e,t%p,s));return _},e.getKeyForTileKeyAndOffset=s,e.extractOffsetAndMortonKeyFromKey=o,e.getParentKeyFromKey=function(e,t=4){const{offset:i,mortonCode:n}=o(e,t);return s(r.TileKey.fromMortonCode(r.TileKey.parentMortonCode(n)),i,t)}}(t.TileKeyUtils||(t.TileKeyUtils={}))},2801:(e,t,i)=>{"use strict";
949Object.defineProperty(t,"__esModule",{value:!0}),t.TileTreeTraverse=void 0;const n=i(3424);t.TileTreeTraverse=class{constructor(e){this.m_subdivisionScheme=e}subTiles(e){const t=this.m_subdivisionScheme.getSubdivisionX(e.level),i=this.m_subdivisionScheme.getSubdivisionY(e.level);return new n.SubTiles(e,t,i)}}},6557:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TilingScheme=void 0;const n=i(9861),r=i(7841),s=i(2801);t.TilingScheme=class{constructor(e,t){this.subdivisionScheme=e,this.projection=t,this.boundingBoxGenerator=new n.FlatTileBoundingBoxGenerator(this),this.tileTreeTraverse=new s.TileTreeTraverse(e)}getSubTileKeys(e){return this.tileTreeTraverse.subTiles(e)}getTileKey(e,t){return r.TileKeyUtils.geoCoordinatesToTileKey(this,e,t)}getTileKeys(e,t){return r.TileKeyUtils.geoRectangleToTileKeys(this,e,t)}getGeoBox(e){return this.boundingBoxGenerator.getGeoBox(e)}getWorldBox(e,t){return this.boundingBoxGenerator.getWorldBox(e,t)}}},2224:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.webMercatorTilingScheme=void 0;const n=i(9885),r=i(9447),s=i(6557);t.webMercatorTilingScheme=new s.TilingScheme(r.quadTreeSubdivisionScheme,n.webMercatorProjection)},3211:function(e,t,i){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);
949r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=this&&this.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||n(t,e,i)};Object.defineProperty(t,"__esModule",{value:!0}),r(i(4388),t),r(i(3711),t),r(i(8487),t),r(i(3674),t)},8487:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HighPrecisionLine=t.HighPrecisionWireFrameLine=void 0;const n=i(82),r=i(3674);class s extends n.Line{constructor(e,t,i){super(e,t),this.matrixWorldInverse=new n.Matrix4,i&&this.setPositions(i)}get bufferGeometry(){return this.geometry}get shaderMaterial(){return this.material}setPositions(e){r.HighPrecisionUtils.setPositions(this,e)}setupForRendering(){this.onBeforeRender=(e,t,i,n,s,o)=>{r.HighPrecisionUtils.updateHpUniforms(this,i,this.shaderMaterial)}}updateMatrixWorld(e){const t=this.matrixWorldNeedsUpdate||e;super.updateMatrixWorld(e),t&&this.matrixWorldInverse.copy(this.matrixWorld).invert()}}t.HighPrecisionWireFrameLine=s;class o extends n.Mesh{constructor(e,t,i){super(e,t),this.matrixWorldInverse=new n.Matrix4,i&&this.setPositions(i)}get bufferGeometry(){return this.geometry}get shaderMaterial(){return this.material}setPositions(e){r.HighPrecisionUtils.setPositions(this,e)}setupForRendering(){this.onBeforeRender=(e,t,i,n,s,o)=>{r.HighPrecisionUtils.updateHpUniforms(this,i,this.shaderMaterial)}}updateMatrixWorld(e){const t=this.matrixWorldNeedsUpdate||e;super.updateMatrixWorld(e),t&&this.matrixWorldInverse.copy(this.matrixWorld).invert()}}t.HighPrecisionLine=o},1939:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HighPrecisionPoints=void 0;const n=i(82),r=i(4250),s=i(3674);class o extends n.Points{constructor(e,t,i,s,o){void 0===t&&(t=new r.HighPrecisionPointMaterial({color:s||r.HighPrecisionPointMaterial.DEFAULT_COLOR,opacity:void 0!==o?o:1})),super(void 0===e?new n.BufferGeometry:e,t),this.matrixWorldInverse=new n.Matrix4,i&&this.setPositions(i)}get bufferGeometry(){return this.geometry}clearGeometry(){return this.geometry=new n.BufferGeometry}get shaderMaterial(){return this.material}setPositions(e){s.HighPrecisionUtils.setPositions(this,e)}setupForRendering(){this.material.isHighPrecisionPointsMaterial&&void 0!==this.dimensionality&&this.material.setDimensionality(this.dimensionality),this.onBeforeRender=(e,t,i,n,r,o)=>{s.HighPrecisionUtils.updateHpUniforms(this,i,this.shaderMaterial)}}updateMatrixWorld(e){const t=this.matrixWorldNeedsUpdate||e;super.updateMatrixWorld(e),t&&this.matrixWorldInverse.copy(this.matrixWorld).invert()}}t.HighPrecisionPoints=o},3674:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HighPrecisionUtils=void 0;const n=i(82),r=i(4250),s=i(8487),o=i(1939),a=i(3711);!function(e){function t(e){return new n.Vector3(Math.fround(e.x),Math.fround(e.y),Math.fround(e.z))}function i(e,i){const r=(new n.Matrix4).copy(e.projectionMatrix).multiply(e.matrixWorldInverse),s=new n.Vector3(0,0,0).applyMatrix4(i),o=t(s);return{viewProjection:r,eyePosHi:o,eyePosLo:t(s.sub(o))}}function l(e){if(e.length>0){const t=e[0];if(null==t)throw Error("Empty element in positions");const i=new Array,r=new Array,s=(...e)=>{for(const t of e){const e=Math.fround(t);r.push(t-e),i.push(e)}},o=e=>{s(e.x,e.y,e.z)};if(void 0!==t.z)e.forEach((e=>{o(e)}));else{if(i.length%3!=0)throw Error("Positions must be 3D, not 2D");e.forEach((e=>{s(e)}))}return{positionHigh:new n.Float32BufferAttribute(i,3),positionLow:new n.Float32BufferAttribute(r,3)}}return{positionHigh:new n.Float32BufferAttribute([],3),positionLow:new n.Float32BufferAttribute([],3)}}function c(e,t,i=0){const n=new Array,r=e.length;for(let s=0;s<r;s+=t){for(let t=0;t<i;t++)n.push(e[s+t]);const r=e[s+i],o=e[s+i+1],a=e[s+i+2],l=Math.fround(r),c=r-l,h=Math.fround(o),u=o-h,d=Math.fround(a),m=a-d;n.push(l,h,d,c,u,m);for(let r=i+3;r<t;r++)n.push(e[s+r])}return n}function h(e,t){const i=l(t);return e.bufferGeometry.setAttribute("position",i.positionHigh),e.bufferGeometry.setAttribute("positionLow",i.positionLow),i.positionHigh.itemSize}e.doubleToFloatVec=t,e.makeFloatVec=function(e){const t=Math.fround(e.x),i=Math.fround(e.y),r=Math.fround(e.z),s=new n.Vector3(e.x-t,e.y-i,e.z-r);return e.x=Math.fround(t),e.y=Math.fround(i),e.z=Math.fround(r),s},e.createHighPrecisionCameraPos=i,e.updateHpUniforms=function(e,t,n){const r=i(t,e.matrixWorldInverse),s=r.viewProjection;if(void 0===n||!n.isMaterial)throw Error("High pecision line has no high precision material");if(!(n.uniforms&&n.uniforms.u_mvp&&n.uniforms.u_eyepos&&n.uniforms.u_eyepos_lowpart))throw Error("High pecision material has missing uniforms");n.uniforms.u_mvp.value=new Float32Array(s.elements),n.uniforms.u_eyepos.value=new Float32Array(r.eyePosHi.toArray()),n.uniforms.u_eyepos_lowpart.value=new Float32Array(r.eyePosLo.toArray())},e.createAttributes=l,e.addInterleavedAttributes3=c,e.setPositions=h,e.convertPositions=function(e){if(e.length<=0)return{positions:[]};const t=e[0];if(null==t)throw Error("Empty element in positions");const i=t;if(void 0===i.y&&void 0===i.z)return{positions:e};const n=new Array;return e.forEach((e=>{n.push(e.x,e.y,e.z)})),{positions:n}},e.createLine=function(e,t){const i=void 0!==t.lineWidth?t.lineWidth:5,o=void 0!==t.addCircles&&t.addCircles,l=void 0!==t.wireFrame&&t.wireFrame,h=[],u=[];
949(0,a.triangulateLine)(e,i,h,u,o);const d=new n.BufferGeometry,m=c(h,3),p=new n.InterleavedBuffer(new Float32Array(m),6),f=new n.InterleavedBufferAttribute(p,3,0,!1),g=new n.InterleavedBufferAttribute(p,3,3,!1);d.setAttribute("position",f),d.setAttribute("positionLow",g),d.setIndex(new n.BufferAttribute(new Uint32Array(u),1));const v=new r.HighPrecisionLineMaterial(t),y=l?new s.HighPrecisionWireFrameLine(d,v):new s.HighPrecisionLine(d,v);return y.setupForRendering(),y},e.createPoints=function(e,t){const i=[];for(let t=0;t<e.length;t++)i.push(i.length/3);const s=new n.BufferGeometry,a=(0,r.isHighPrecisionPointMaterial)(t)?t:new r.HighPrecisionPointMaterial(t),l=new o.HighPrecisionPoints(s,a);return h(l,e),l.setupForRendering(),l}}(t.HighPrecisionUtils||(t.HighPrecisionUtils={}))},4388:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LineGroup=t.createSimpleLineGeometry=t.createLineGeometry=t.LineGeometry=void 0;const n=i(82),r=i(4342),s=new n.Vector3,o=new n.Vector3,a=new n.Vector3,l=new n.Vector3,c={attributes:[{name:"extrusionCoord",itemSize:3,offset:0},{name:"position",itemSize:3,offset:3},{name:"tangent",itemSize:3,offset:6},{name:"biTangent",itemSize:4,offset:9}],stride:13},h={attributes:[{name:"uv",itemSize:2,offset:c.stride},{name:"normal",itemSize:3,offset:c.stride+2}],stride:5},u={attributes:[...c.attributes,...h.attributes],stride:c.stride+h.stride},d={attributes:[{name:"extrusionCoord",itemSize:2,offset:0},{name:"position",itemSize:3,offset:2},{name:"positionLow",itemSize:3,offset:5},{name:"tangent",itemSize:3,offset:8},{name:"biTangent",itemSize:4,offset:11}],stride:15},m={attributes:[...d.attributes,...h.attributes],stride:d.stride+h.stride};class p{constructor(){this.vertices=[],this.vertexColors=[],this.indices=[]}}function f(e,t){return t?e?m:d:e?u:c}function g(e,t,i,c,h,u,d=new p,m=!1){if(0===t.length)return d;const g=f(void 0!==h,m).stride,v=t.length,y=v/3,_=new Array(y),x=new Array(v-3),b=d.vertices.length/g,w=void 0!==c&&c.length>0,M=void 0!==h&&h.length>0,T=void 0!==u&&u.length&&v;(0,r.assert)(!w||c.length===y),(0,r.assert)(!M||h.length/2===y),(0,r.assert)(!T||u.length===v);let S=.1;_[0]=S;for(let e=0;e<y-1;++e){let i=0;for(let n=0;n<3;++n){const r=t[3*(e+1)+n]-t[3*e+n];x[3*e+n]=r,i+=r*r}S+=Math.sqrt(i),_[e+1]=S}const E=w?Math.abs(c[c.length-1]-c[0]):1,A=_[_.length-1]/E;if(w)for(let e=0;e<y;++e)_[e]=c[e]*A+.1;let C=!0;for(let e=0;e<3;++e)C=C&&t[e]===t[t.length-3+e];const P=(r,c,p,f,g)=>{const v=[],y=[];v.push(f,-1*g,A),y.push(f,1*g,A);for(let e=0;e<3;++e){if(m){const i=Math.fround(t[3*r+e]),n=t[3*r+e]-i;v.push(i,n),y.push(i,n)}else v.push(t[3*r+e]),y.push(t[3*r+e]);s.setComponent(e,t[3*r+e]),o.setComponent(e,x[c+e]),a.setComponent(e,x[p+e])}o.normalize(),a.normalize(),v.push(o.x,o.y,o.z),y.push(o.x,o.y,o.z),s.add(e),i.surfaceNormal(s,s);const _=function(e,t,i,r){let s=0;if(!t.equals(i)){s=t.angleTo(i);const r=(new n.Vector3).crossVectors(t,i),o=Math.sign(r.dot(e));0!==o&&(s*=o),Number.isNaN(s)&&(s=0)}return r.copy(t).add(i).normalize().cross(e).normalize(),s}(s,o,a,l);v.push(l.x,l.y,l.z,_),y.push(l.x,l.y,l.z,_),M&&(v.push(h[2*r],h[2*r+1]),y.push(h[2*r],h[2*r+1]),v.push(s.x,s.y,s.z),y.push(s.x,s.y,s.z)),d.vertices.push(...v,...y),T&&(d.vertexColors.push(u[3*r],u[3*r+1],u[3*r+2]),d.vertexColors.push(u[3*r],u[3*r+1],u[3*r+2]))};for(let e=0;e<y;++e){const t=C&&0===e?x.length-3:3*Math.max(0,e-1),i=C&&e===y-1?0:Math.min(3*e,x.length-3);e>0&&P(e,t,i,_[e-1],_[e]),e+1<y&&P(e,t,i,-1*_[Math.min(e,_.length-1)],_[Math.min(e+1,_.length-1)])}for(let e=0;e<y-1;++e){const t=b+4*e;d.indices.push(t,t+1,t+2,t+2,t+1,t+3)}return d}function v(e,t,i=new p){if(0===e.length)return i;const n=e.length/3;let r=i.vertices.length/3;const s=void 0!==t&&t.length&&e.length;for(let o=0;o<n;++o,r++){o>0&&i.indices.push(r),o<n-1&&i.indices.push(r);for(let n=0;n<3;++n)i.vertices.push(e[3*o+n]),s&&i.vertexColors.push(t[3*o+n])}return i}t.LineGeometry=p,t.createLineGeometry=g,t.createSimpleLineGeometry=v;class y{static createGeometry(e,t,i,r,s=!1,o=!1,a=!1){if(a)return r.setAttribute("position",new n.BufferAttribute(new Float32Array(e),3)),t.length===e.length&&r.setAttribute("color",new n.BufferAttribute(new Float32Array(t),3)),r.setIndex(new n.BufferAttribute(new Uint32Array(i),1)),r;{const a=f(s,o),l=new n.InterleavedBuffer(new Float32Array(e),a.stride);
949return a.attributes.forEach((e=>{const t=new n.InterleavedBufferAttribute(l,e.itemSize,e.offset,!1);r.setAttribute(e.name,t)})),t.length===e.length&&r.setAttribute("color",new n.BufferAttribute(new Float32Array(t),3)),r.setIndex(new n.BufferAttribute(new Uint32Array(i),1)),r}}constructor(e=!1,t=!1,i=!1){this.hasNormalsAndUvs=e,this.highPrecision=t,this.isSimple=i,this.m_geometry=new p}clear(){this.m_geometry.vertices=[],this.m_geometry.vertexColors=[],this.m_geometry.indices=[]}add(e,t,i,n,s,o){return this.isSimple?v(t,o,this.m_geometry):((0,r.assert)(!this.hasNormalsAndUvs||void 0!==s),g(e,t,i,n,s,o,this.m_geometry,this.highPrecision)),this}get vertices(){return this.m_geometry.vertices}get vertexColors(){return this.m_geometry.vertexColors}get indices(){return this.m_geometry.indices}get vertexAttributes(){return f(this.hasNormalsAndUvs,this.highPrecision).attributes}get stride(){return f(this.hasNormalsAndUvs,this.highPrecision).stride}createGeometry(e){return void 0===e&&(e=new n.BufferGeometry),y.createGeometry(this.m_geometry.vertices,this.m_geometry.vertexColors,this.m_geometry.indices,e,this.hasNormalsAndUvs,this.highPrecision)}}t.LineGroup=y},3711:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reconstructLineWidth=t.reconstructLine=t.triangulateLine=t.numCirclePoints=void 0;const n=i(82),r=new n.Vector3(0,0,1),s=[0,1,2,1,3,2],o=[0,1,3,3,1,2,0,3,4,5,4,3],a=Math.PI/8;function l(e,t,i,n,r,s){const o=r.length/3;r.push(e,t,0);for(let l=0;l<9;++l){const c=a*l+Math.PI/2+i;r.push(e+n*Math.cos(c),t+n*Math.sin(c),0),s.push(o,o+l+1,o+(l+1)%9+1)}}t.numCirclePoints=function(e){return 9},t.triangulateLine=function(e,t,i,a,c=!0,h=c){if(e.length<3)return;const u=new n.Vector2;if(c){const n=3!==e.length?u.set(e[3]-e[0],e[4]-e[1]).angle():0;l(e[0],e[1],n,t,i,a)}const d=i.length/3,m=new n.Vector3,p=new n.Vector3,f=new n.Vector3,g=new n.Vector3,v=new n.Vector3,y=new n.Vector3,_=new n.Vector3,x=new n.Vector3,b=new n.Vector3,w=e.length/3;let M=0;for(let n=0;n<w;++n){let l=!1;if(p.set(e[3*n],e[3*n+1],e[3*n+2]),n+1<w){if(f.set(e[3*(n+1)],e[3*(n+1)+1],e[3*(n+1)+2]),g.copy(f).sub(p).normalize().cross(r),v.copy(g),n>0&&(v.add(m).multiplyScalar(1-.5*g.dot(m)),l=m.angleTo(g)>Math.PI/2,l)){const e=t/Math.cos(g.angleTo(m)/2);y.copy(g).add(m).normalize().multiplyScalar(-e).add(p),_.copy(m).multiplyScalar(t).add(p),x.copy(g).add(m).normalize().multiplyScalar(e).add(p),b.copy(g).multiplyScalar(t).add(p)}l?i.push(y.x,y.y,y.z,_.x,_.y,_.z,x.x,x.y,x.z,b.x,b.y,b.z):(y.copy(v).multiplyScalar(-t).add(p),_.copy(v).multiplyScalar(t).add(p),i.push(y.x,y.y,y.z,_.x,_.y,_.z)),m.copy(g)}else y.copy(m).multiplyScalar(-t).add(p),_.copy(m).multiplyScalar(t).add(p),i.push(y.x,y.y,y.z,_.x,_.y,_.z);n!==w-1&&((l?o:s).forEach((e=>a.push(d+M+e))),M+=l?4:2)}if(h){const n=2!==e.length?u.set(e[3*(w-3)]-e[3*(w-2)],e[3*(w-3)+1]-e[3*(w-2)+1]).angle():Math.PI;l(e[3*(w-2)],e[3*(w-2)+1],n,t,i,a)}},t.reconstructLine=function(e,t){const i=new Float32Array(e.length/2);for(let n=3*t,r=2*n;n<i.length;n+=3,r+=6)i[n]=e[r]+.5*(e[r+3]-e[r]),i[n+1]=e[r+1]+.5*(e[r+3+1]-e[r+1]),i[n+2]=e[r+2]+.5*(e[r+3+2]-e[r+2]);return i},t.reconstructLineWidth=function(e,t){const i=e[2*t+3]-e[2*t],n=e[2*t+3+1]-e[2*t+1],r=e[2*t+3+2]-e[2*t+2];return.5*Math.sqrt(i*i+n*n+r*r)}},8263:function(e,t,i){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);
949r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=this&&this.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||n(t,e,i)};Object.defineProperty(t,"__esModule",{value:!0}),r(i(8759),t)},8759:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LRUCache=t.Entry=void 0;const n=i(4342);class r{constructor(e,t,i,n,r){this.key=e,this.value=t,this.size=i,this.newer=n,this.older=r}}t.Entry=r,t.LRUCache=class{constructor(e,t=(()=>1)){this.m_size=0,this.m_map=new Map,this.m_newest=null,this.m_oldest=null,this.m_capacity=e,this.m_sizeFunction=t}forEach(e,t){let i=this.m_newest;for(;null!==i;){const n=i.older;e.call(t,i.value,i.key,this),i=n}}get size(){return this.m_size}get capacity(){return this.m_capacity}get map(){return this.m_map}get newest(){return this.m_newest}get oldest(){return this.m_oldest}setCapacity(e){this.m_capacity=e,this.evict()}setCapacityAndMeasure(e,t=(()=>1)){this.m_capacity=e,this.m_sizeFunction=t,this.shrinkToCapacity()}shrinkToCapacity(){let e=0;const t=this.m_sizeFunction;let i=this.m_newest;for(;null!==i;){const n=t(i.value);i.size=n,e+=n,i=i.older}this.m_size=e,this.evict()}set(e,t){const i=this.m_sizeFunction(t);let s=this.m_map.get(e);if(void 0!==s)this.m_size=this.m_size-s.size+i,s.value=t,s.size=i,this.promoteEntry(s),this.evict();else{if(i>this.m_capacity)return;if(s=new r(e,t,i,null,null),0===this.m_map.size)this.m_newest=this.m_oldest=s;else{(0,n.assert)(null!==this.m_newest);const e=this.m_newest;s.older=this.m_newest,e.newer=s,this.m_newest=s}this.m_map.set(e,s),this.m_size+=i,this.evict()}}get(e){const t=this.m_map.get(e);if(void 0!==t)return this.promoteEntry(t),t.value}has(e){return this.m_map.has(e)}clear(){this.m_newest=this.m_oldest=null,this.m_size=0,this.m_map.clear()}evictAll(){const e=this.evictionCallback;void 0!==e&&this.forEach(((t,i)=>e(i,t))),this.clear()}evictSelected(e,t){const i=this.evictionCallback;let n=this.m_newest;for(;null!==n;){const r=n.older;e.call(t,n.value,n.key)&&(void 0!==i&&i(n.key,n.value),this.deleteEntry(n),this.m_map.delete(n.key)),n=r}}delete(e){const t=this.m_map.get(e);return void 0!==t&&(this.deleteEntry(t),this.m_map.delete(e))}evict(){for(;null!==this.m_oldest&&this.m_size>this.m_capacity;)if(void 0===this.evictOldest())return}evictOldest(){(0,n.assert)(null!==this.m_oldest);const e=this.m_oldest;(0,n.assert)(null===e.older);let t=e;if(void 0!==this.canEvict)for(;!this.canEvict(t.key,t.value);){if(null===t.newer)return;t=t.newer}if(t===e)this.m_oldest=t.newer,null!==t.newer&&((0,n.assert)(t.newer.older===t),t.newer.older=null);else{if(null===t.newer)return;(0,n.assert)(t.newer.older===t),t.newer.older=t.older,null!==t.older&&(t.older.newer=t.newer)}const i=this.m_map.delete(t.key);return(0,n.assert)(!0===i),i&&void 0!==this.evictionCallback&&this.evictionCallback(t.key,t.value),this.m_size-=t.size,t}deleteEntry(e){e===this.m_newest?this.m_newest=e.older:e.newer?e.newer.older=e.older:(0,n.assert)(!1),e===this.m_oldest?this.m_oldest=e.newer:e.older?e.older.newer=e.newer:(0,n.assert)(!1),this.m_size-=e.size}promoteEntry(e){if(e===this.m_newest)return;e.newer&&((0,n.assert)(e.newer.older===e),e.newer.older=e.older),e.older&&((0,n.assert)(e.older.newer===e),e.older.newer=e.newer),e===this.m_oldest&&(this.m_oldest=e.newer),e.newer=null,e.older=this.m_newest,(0,n.assert)(null!==this.m_newest);const t=this.m_newest;(0,n.assert)(null===t.newer),t.newer=e,this.m_newest=e}}},4609:function(e,t,i){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);
949r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=this&&this.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||n(t,e,i)};Object.defineProperty(t,"__esModule",{value:!0}),r(i(3453),t),r(i(5363),t),r(i(4194),t),r(i(1555),t),r(i(1773),t),r(i(9026),t),r(i(2505),t)},2505:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CameraAnimationBuilder=void 0;const n=i(2616),r=i(2344),s=i(82),o=i(1350),a=i(9026);class l{static getLookAtFromView(e){return{target:e.target,heading:e.heading,tilt:e.tilt,distance:e.targetDistance}}static appendControlPoint(e,t,i){i=null!=i?i:10,e.controlPoints.length>0&&(void 0===t.timestamp||t.timestamp<=e.controlPoints[e.controlPoints.length-1].timestamp)&&(t.timestamp=e.controlPoints[e.controlPoints.length-1].timestamp+i),e.controlPoints.push(t)}static prependControlPoint(e,t,i){i=void 0!==i?i:10;for(const t of e.controlPoints)t.timestamp+=i;t.timestamp=0,e.controlPoints.unshift(t)}static createFlyToOptions(e,t,i,c,h){var u,d,m,p;const f=new a.ControlPoint(Object.assign({},l.getLookAtFromView(e))),g=void 0!==t.target?n.GeoCoordinates.fromObject(t.target):void 0;let v=null!=g?g:f.target;const y=void 0!==t.zoomLevel?r.MapViewUtils.calculateDistanceFromZoomLevel(e,t.zoomLevel):t.distance;let _=null!=y?y:e.targetDistance;if(void 0!==t.bounds){const i=Math.min(null!==(u=t.tilt)&&void 0!==u?u:e.tilt,r.MapViewUtils.MAX_TILT_DEG),n=-(null!==(d=t.heading)&&void 0!==d?d:e.heading),a=(0,o.getFitLookAtBoundsDistance)({target:e.target,camera:e.camera,cameraSettings:e,projection:e.projection,maxZoomLevel:e.maxZoomLevel,viewportSize:e.renderer.getSize(new s.Vector2),tileWrapping:e.tileWrappingEnabled},{bounds:t.bounds,target:g,distance:y,yaw:n,tilt:i,padding:t.padding});_=a.distance,v=a.target}if(c){const t=0|r.MapViewUtils.calculateZoomLevelFromDistance(e,_);_=r.MapViewUtils.calculateDistanceFromZoomLevel(e,t)}const x=new a.ControlPoint({target:v,distance:_,tilt:null!==(m=t.tilt)&&void 0!==m?m:f.tilt,heading:null!==(p=t.heading)&&void 0!==p?p:f.heading});if(r.MapViewUtils.closeToFrustum(e.projection.projectPoint(v,new s.Vector3),e.camera))return x.timestamp=i(f,x),{controlPoints:[f,x]};const b=[f],w=new s.Vector3;e.projection.projectPoint(f.target,w);let M=null!=h?h:2*w.distanceTo(e.projection.projectPoint(x.target));M=Math.max(f.distance+x.distance,M);const T=n.GeoCoordinates.lerp(f.target,x.target,.25),S=new a.ControlPoint({target:T,distance:M,timestamp:0,tilt:n.MathUtils.interpolateAnglesDeg(f.tilt,x.tilt,.25),heading:n.MathUtils.interpolateAnglesDeg(f.heading,x.heading,.25)});S.timestamp=S.timestamp+i(f,S),b.push(S);const E=n.GeoCoordinates.lerp(f.target,x.target,.75),A=new a.ControlPoint({target:E,distance:M,timestamp:0,tilt:n.MathUtils.interpolateAnglesDeg(f.tilt,x.tilt,.75),heading:n.MathUtils.interpolateAnglesDeg(f.heading,x.heading,.75)});return A.timestamp=S.timestamp+i(S,A),b.push(A),x.timestamp=A.timestamp+i(A,x),b.push(x),{controlPoints:b}}static createOrbitOptions(e,t=10){const i=[e],n=t/3;for(let e=1;e<4;e++){const t=i[e-1];i.push(Object.assign(Object.assign({},t),{heading:t.heading-120,timestamp:t.timestamp+n}))}return{controlPoints:i}}}t.CameraAnimationBuilder=l},9026:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CameraKeyTrackAnimation=t.ControlPoint=void 0;const n=i(2616),r=i(2344),s=i(4342),o=i(82),a=s.LoggerManager.instance.create("CameraKeyTrackAnimation");t.ControlPoint=class{constructor(e){var t,i,r,s,o;this.timestamp=0,this.timestamp=null!==(t=e.timestamp)&&void 0!==t?t:0,this.target=e.target?n.GeoCoordinates.fromObject(e.target):new n.GeoCoordinates(0,0),this.tilt=null!==(i=e.tilt)&&void 0!==i?i:0,this.heading=null!==(r=e.heading)&&void 0!==r?r:0,this.distance=null!==(s=e.distance)&&void 0!==s?s:0,this.name=null!==(o=e.name)&&void 0!==o?o:Date.now().toString()}};class l extends o.Object3D{constructor(e){super(),this.distance=0,this.name=e}}t.CameraKeyTrackAnimation=class{constructor(e,t){var i,n,r,s;this.m_mapView=e,this.m_options=t,this.m_dummy=new l("dummy"),this.m_azimuthAxis=new o.Vector3(0,0,1),this.m_altitudeAxis=new o.Vector3(1,0,0),this.m_running=!1,this.m_lastFrameTime=0;const c=void 0!==this.m_options.interpolation?this.m_options.interpolation:o.InterpolateSmooth;this.m_options.loop=null!==(i=this.m_options.loop)&&void 0!==i?i:o.LoopOnce,this.m_options.repetitions=null!==(n=this.m_options.repetitions)&&void 0!==n?n:1,this.m_options.rotateOnlyClockwise=null===(r=this.m_options.rotateOnlyClockwise)||void 0===r||r,this.m_name=(null!==(s=this.m_options.name)&&void 0!==s?s:"CameraKeyTrackAnimation")+Date.now();const h=this.m_options.controlPoints.map((e=>e.timestamp)),u=[],d=[];this.m_options.controlPoints.map((e=>{const t=this.m_mapView.projection.projectPoint(e.target);u.push(t.x),u.push(t.y),u.push(t.z);const i=new o.Quaternion;i.setFromAxisAngle(this.m_azimuthAxis,o.MathUtils.degToRad(e.heading)),i.multiply((new o.Quaternion).setFromAxisAngle(this.m_altitudeAxis,o.MathUtils.degToRad(e.tilt))),d.push(i.x),d.push(i.y),d.push(i.z),d.push(i.w)}));const m=new o.VectorKeyframeTrack(".position",h,u,c),p=new o.QuaternionKeyframeTrack(".quaternion",h,d,c),f=new o.NumberKeyframeTrack(".distance",h,this.m_options.controlPoints.map((e=>e.distance)),c);this.m_animationClip=new o.AnimationClip("cameraflyoveranimation",-1,[m,p,f]),this.m_animationClip.validate()||a.error("Review the entered controlpoints for: ",this.m_name,", The Animation was provided with invali
949d track data"),this.m_animationClip.resetDuration(),this.m_animationClip.trim(),this.m_animationMixer=new o.AnimationMixer(this.m_dummy),this.m_animationAction=this.m_animationMixer.clipAction(this.m_animationClip),this.m_animationAction.setLoop(this.m_options.loop,this.m_options.repetitions),this.m_animationAction.clampWhenFinished=!0,this.m_animateCb=this.animate.bind(this),this.m_animationMixer.addEventListener("finished",this.stop.bind(this))}set loop(e){this.m_options.loop=e,this.m_animationAction.setLoop(this.m_options.loop,this.m_options.repetitions)}set repetitions(e){this.m_options.repetitions=e,this.m_animationAction.setLoop(this.m_options.loop,this.m_options.repetitions)}set rotateOnlyClockwise(e){this.m_options.rotateOnlyClockwise=e}start(e,t){this.stop(),this.m_onFinished=t,this.m_animationAction.reset().play(),this.m_lastFrameTime=Date.now(),this.m_mapView.addEventListener(r.MapViewEventNames.Render,this.m_animateCb),this.m_mapView.beginAnimation(),this.m_running=!0}stop(){this.m_running&&(this.m_mapView.removeEventListener(r.MapViewEventNames.Render,this.m_animateCb),this.m_mapView.endAnimation(),void 0!==this.m_onFinished&&window.setTimeout((()=>{var e;null===(e=this.m_onFinished)||void 0===e||e.call(this),this.m_onFinished=void 0}),0),this.m_running=!1)}isRunning(){return this.m_running}updateCameraFromDummy(){let e=o.MathUtils.radToDeg(this.m_azimuthAxis.clone().applyQuaternion(this.m_dummy.quaternion).angleTo(this.m_azimuthAxis));e=o.MathUtils.clamp(e,0,r.MapViewUtils.MAX_TILT_DEG);const t=this.m_altitudeAxis.clone().applyQuaternion(this.m_dummy.quaternion);let i=t.angleTo(this.m_altitudeAxis);this.m_options.rotateOnlyClockwise&&this.m_azimuthAxis.dot(t.normalize().cross(this.m_altitudeAxis))>=0&&(i=2*Math.PI-i);const n=o.MathUtils.radToDeg(i),s=this.m_mapView.projection.unprojectPoint(this.m_dummy.position),l=Math.max(0,this.m_dummy.distance);(isNaN(e)||isNaN(n)||isNaN(l)||!s.isValid())&&a.error("Cannot update due to invalid data",e,n,l,s),this.m_mapView.lookAt({target:s,distance:l,tilt:e,heading:n})}animate(e){const t=(Date.now()-this.m_lastFrameTime)/1e3;this.m_animationMixer.update(t),this.m_lastFrameTime=Date.now(),this.updateCameraFromDummy()}}},4194:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LongPressHandler=void 0,t.LongPressHandler=class{constructor(e,t,i){this.element=e,this.onLongPress=t,this.onTap=i,this.timeout=500,this.moveThreshold=5,this.buttonId=0,this.m_pressEvent=void 0,this.m_timerId=void 0,this.m_moveHandlerRegistered=!1,this.m_boundPointerMoveHandler=this.onPointerMove.bind(this),this.m_boundMouseDownHandler=this.onMouseDown.bind(this),this.m_boundTouchStartHandler=this.onTouchStart.bind(this),this.m_boundMouseUpHandler=this.onMouseUp.bind(this),this.m_boundTouchEndHandler=this.onTouchEnd.bind(this),this.element.addEventListener("mousedown",this.m_boundMouseDownHandler),this.element.addEventListener("touchstart",this.m_boundTouchStartHandler),this.element.addEventListener("mouseup",this.m_boundMouseUpHandler),this.element.addEventListener("touchend",this.m_boundTouchEndHandler)}dispose(){this.cancel(),this.element.removeEventListener("mousedown",this.m_boundMouseDownHandler),this.element.removeEventListener("touchstart",this.m_boundTouchStartHandler),this.element.removeEventListener("mouseup",this.m_boundMouseUpHandler),this.element.removeEventListener("touchend",this.m_boundTouchEndHandler)}startPress(e){var t,i;this.cancelTimer(),this.m_pressEvent=null!==(i=null===(t=e.changedTouches)||void 0===t?void 0:t[0])&&void 0!==i?i:e,this.m_timerId=setTimeout((()=>this.onTimeout()),this.timeout),this.addPointerMoveHandler()}onMouseDown(e){e.button===this.buttonId&&this.startPress(e)}onTouchStart(e){this.m_pressEvent?this.cancel():1===e.changedTouches.length&&this.startPress(e)}onMouseUp(e){var t;this.m_pressEvent&&e.button===this.buttonId&&(this.cancel(),null===(t=this.onTap)||void 0===t||t.call(this,e))}onTouchEnd(e){var t;1===e.changedTouches.length&&e.changedTouches[0].identifier===this.m_pressEvent.identifier&&(this.cancel(),null===(t=this.onTap)||void 0===t||t.call(this,e.changedTouches[0]))}onPointerMove(e){var t,i;if(void 0===this.m_pressEvent)return;const{clientX:n,clientY:r}=null!==(i=null===(t=e.changedTouches)||void 0===t?void 0:t[0])&&void 0!==i?i:e;Math.abs(n-this.m_pressEvent.clientX)+Math.abs(r-this.m_pressEvent.clientY)>this.moveThreshold&&this.cancel()}cancel(){this.m_pressEvent=void 0,this.cancelTimer(),this.removePointerMoveHandler()}cancelTimer(){void 0!==this.m_timerId&&(clearTimeout(this.m_timerId),this.m_timerId=void 0)}addPointerMoveHandler(){this.m_moveHandlerRegistered||(this.element.addEventListener("mousemove",this.m_boundPointerMoveHandler),this.element.addEventListener("touchmove",this.m_boundPointerMoveHandler),this.m_moveHandlerRegistered=!0)}removePointerMoveHandler(){this.m_moveHandlerRegistered&&(this.element.removeEventListener("mousemove",this.m_boundPointerMoveHandler),this.element.removeEventListener("touchmove",this.m_boundPointerMoveHandler),this.m_moveHandlerRegistered=!1)}onTimeout(){const e=this.m_pressEvent;this.m_timerId=void 0,this.cancel(),void 0!==e&&this.onLongPress(e)}}},1773:(e,t,i)=>{"use strict";
949Object.defineProperty(t,"__esModule",{value:!0}),t.CameraPanAnimation=t.CameraRotationAnimation=t.CameraAnimation=t.InterpolationFunction=t.EasingFunction=void 0;const n=i(9761),r=i(82),s=i(2616),o=i(4342),a=i(3453);var l,c;!function(e){e[e.Linear=0]="Linear",e[e.QuadraticIn=1]="QuadraticIn",e[e.QuadraticOut=2]="QuadraticOut",e[e.QuadraticInOut=3]="QuadraticInOut",e[e.CubicIn=4]="CubicIn",e[e.CubicOut=5]="CubicOut",e[e.CubicInOut=6]="CubicInOut",e[e.QuarticIn=7]="QuarticIn",e[e.QuarticOut=8]="QuarticOut",e[e.QuarticInOut=9]="QuarticInOut",e[e.QuinticIn=10]="QuinticIn",e[e.QuinticOut=11]="QuinticOut",e[e.QuinticInOut=12]="QuinticInOut",e[e.SinusoidalIn=13]="SinusoidalIn",e[e.SinusoidalOut=14]="SinusoidalOut",e[e.SinusoidalInOut=15]="SinusoidalInOut",e[e.ExponentialIn=16]="ExponentialIn",e[e.ExponentialOut=17]="ExponentialOut",e[e.ExponentialInOut=18]="ExponentialInOut",e[e.CircularIn=19]="CircularIn",e[e.CircularOut=20]="CircularOut",e[e.CircularInOut=21]="CircularInOut",e[e.ElasticIn=22]="ElasticIn",e[e.ElasticOut=23]="ElasticOut",e[e.ElasticInOut=24]="ElasticInOut",e[e.BackIn=25]="BackIn",e[e.BackOut=26]="BackOut",e[e.BackInOut=27]="BackInOut",e[e.BounceIn=28]="BounceIn",e[e.BounceOut=29]="BounceOut",e[e.BounceInOut=30]="BounceInOut"}(l=t.EasingFunction||(t.EasingFunction={})),function(e){e[e.Linear=0]="Linear",e[e.Bezier=1]="Bezier",e[e.CatmullRom=2]="CatmullRom"}(c=t.InterpolationFunction||(t.InterpolationFunction={}));class h{constructor(e,t){this.mapView=e,this.name=t,this.running=!1,this.stopped=!1,this.duration=1e4,this.repeat=0,this.easing=n.Easing.Linear.None,void 0===u&&(u=new Map,d=new Map,u.set(l.Linear,n.Easing.Linear.None),u.set(l.QuadraticIn,n.Easing.Quadratic.In),u.set(l.QuadraticOut,n.Easing.Quadratic.Out),u.set(l.QuadraticInOut,n.Easing.Quadratic.InOut),u.set(l.CubicIn,n.Easing.Cubic.In),u.set(l.CubicOut,n.Easing.Cubic.Out),u.set(l.CubicInOut,n.Easing.Cubic.InOut),u.set(l.QuarticIn,n.Easing.Quartic.In),u.set(l.QuarticOut,n.Easing.Quartic.Out),u.set(l.QuarticInOut,n.Easing.Quartic.InOut),u.set(l.QuinticIn,n.Easing.Quintic.In),u.set(l.QuinticOut,n.Easing.Quintic.Out),u.set(l.QuinticInOut,n.Easing.Quintic.InOut),u.set(l.SinusoidalIn,n.Easing.Sinusoidal.In),u.set(l.SinusoidalOut,n.Easing.Sinusoidal.Out),u.set(l.SinusoidalInOut,n.Easing.Sinusoidal.InOut),u.set(l.ExponentialIn,n.Easing.Exponential.In),u.set(l.ExponentialOut,n.Easing.Exponential.Out),u.set(l.ExponentialInOut,n.Easing.Exponential.InOut),u.set(l.CircularIn,n.Easing.Circular.In),u.set(l.CircularOut,n.Easing.Circular.Out),u.set(l.CircularOut,n.Easing.Circular.InOut),u.set(l.ElasticIn,n.Easing.Elastic.In),u.set(l.ElasticOut,n.Easing.Elastic.Out),u.set(l.ElasticInOut,n.Easing.Elastic.InOut),u.set(l.BackIn,n.Easing.Back.In),u.set(l.BackOut,n.Easing.Back.Out),u.set(l.BackInOut,n.Easing.Back.InOut),u.set(l.BounceIn,n.Easing.Bounce.In),u.set(l.BounceOut,n.Easing.Bounce.Out),u.set(l.BounceInOut,n.Easing.Bounce.InOut),d.set(c.Linear,n.Interpolation.Linear),d.set(c.Bezier,n.Interpolation.Bezier),d.set(c.CatmullRom,n.Interpolation.CatmullRom))}update(e){return!!this.tween&&this.tween.update(null!=e?e:o.PerformanceTimer.now())}get isRunning(){return this.running}}let u,d;t.CameraAnimation=h,t.CameraRotationAnimation=class extends h{constructor(e,t,i,s){var o;super(e,s),this.m_mapControls=t,this.startAngle=0,this.endAngle=360,this.m_axis=new r.Vector3(0,0,1),this.beginInteractionListener=()=>{this.stopped||this.stopTween()},this.endInteractionListener=()=>{this.stopped||this.startTween()},void 0!==i.axis&&(this.m_axis=i.axis),void 0!==i.startAngle&&(this.startAngle=i.startAngle),void 0!==i.endAngle&&(this.endAngle=i.endAngle),void 0!==i.duration&&(this.duration=i.duration),void 0!==i.repeat&&(this.repeat=i.repeat),void 0!==i.easing&&(this.easing="function"==typeof i.easing?i.easing:null!==(o=u.get(i.easing))&&void 0!==o?o:n.Easing.Linear.None),this.m_lastRotationValue=this.startAngle}start(e,t){if(this.running)throw new Error("Animation already running"+this.name!==void 0?this.name:0);this.running=!0,this.onFinished=t,this.stopped=!1,this.m_mapControls&&(this.m_mapControl
949s.addEventListener(a.EventNames.BeginInteraction,this.beginInteractionListener),this.m_mapControls.addEventListener(a.EventNames.EndInteraction,this.endInteractionListener)),this.startTween(e),this.mapView.beginAnimation()}stop(){if(!this.running)throw new Error("Animation not running"+this.name!==void 0?this.name:0);this.running=!1,this.stopped=!0,this.mapView.endAnimation(),this.tween&&this.tween.stop(),this.m_mapControls&&(this.m_mapControls.removeEventListener(a.EventNames.BeginInteraction,this.beginInteractionListener),this.m_mapControls.removeEventListener(a.EventNames.EndInteraction,this.endInteractionListener))}startTween(e){const t=new r.Quaternion;this.m_userCamerRotation=new r.Quaternion,this.mapView.camera.getWorldQuaternion(this.m_userCamerRotation),this.tween=new n.Tween({rotation:0}).to({rotation:this.endAngle-this.m_lastRotationValue},this.duration).onComplete((()=>{this.stop(),this.onFinished&&this.onFinished()})).onUpdate((({rotation:e})=>{this.m_lastRotationValue=e,t.setFromEuler(new r.Euler(0,0,r.MathUtils.degToRad(e))),void 0!==this.m_userCamerRotation&&t.multiply(this.m_userCamerRotation),this.mapView.camera.quaternion.copy(t)})),this.tween.repeat(this.repeat),this.tween.easing(this.easing),this.tween.start(e)}stopTween(){this.tween&&this.tween.stop()}},t.CameraPanAnimation=class extends h{constructor(e,t,i){var r,s;super(e,i),this.name=i,this.interpolation=n.Interpolation.CatmullRom,void 0!==t.duration&&(this.duration=t.duration),void 0!==t.repeat&&(this.repeat=t.repeat),void 0!==t.easing&&(this.easing="function"==typeof t.easing?t.easing:null!==(r=u.get(t.easing))&&void 0!==r?r:n.Easing.Linear.None),void 0!==t.interpolation&&(this.interpolation="function"==typeof t.interpolation?t.interpolation:null!==(s=d.get(t.interpolation))&&void 0!==s?s:n.Interpolation.Linear),this.m_geoCoordinates=void 0!==t.geoCoordinates?t.geoCoordinates:[]}addPosition(e){this.m_geoCoordinates.push(e)}start(e,t){var i;if(this.running)throw new Error("Animation already running"+this.name!==void 0?this.name:0);this.onFinished=t,this.running=!0;const r=new s.GeoCoordinates(this.mapView.geoCenter.latitude,this.mapView.geoCenter.longitude,this.mapView.camera.position.z),o={latitude:new Array,longitude:new Array,altitude:new Array};for(const e of this.m_geoCoordinates)o.latitude.push(e.latitude),o.longitude.push(e.longitude),o.altitude.push(null!==(i=e.altitude)&&void 0!==i?i:this.mapView.camera.position.z);this.tween=new n.Tween(r).to(o,this.duration).onComplete((()=>{this.stop(),this.onFinished&&this.onFinished()})).onUpdate((({latitude:e,longitude:t,altitude:i})=>{this.mapView.geoCenter=new s.GeoCoordinates(e,t,i),this.mapView.camera.position.z=null!=i?i:0})),this.tween.repeat(this.repeat),this.tween.easing(this.easing),this.tween.interpolation(this.interpolation),this.tween.start(e),this.mapView.beginAnimation()}stop(){if(!this.running)throw new Error("Animation not running"+this.name!==void 0?this.name:0);this.running=!1,this.mapView.endAnimation(),this.tween&&this.tween.stop()}get isRunning(){return this.running}}},3453:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MapControls=t.EventNames=t.TiltState=void 0;const n=i(82),r=i(2616),s=i(2344),o=i(1555);var a,l,c;!function(e){e[e.NONE=0]="NONE",e[e.PAN=1]="PAN",e[e.ROTATE=2]="ROTATE",e[e.ORBIT=3]="ORBIT",e[e.TOUCH=4]="TOUCH"}(a||(a={})),function(e){e[e.Tilted=0]="Tilted",e[e.Down=1]="Down"}(l=t.TiltState||(t.TiltState={})),function(e){e.Update="update",e.BeginInteraction="begin-interaction",e.EndInteraction="end-interaction"}(c=t.EventNames||(t.EventNames={}));const h={type:c.Update},u={type:c.BeginInteraction},d={type:c.EndInteraction},m=n.MathUtils.degToRad(89),p=.01;class f extends s.EventDispatcher{static create(e,t=!0){return new f(e,t)}get zoomLevelDeltaOnMouseWheel(){return void 0!==this.m_zoomLevelDeltaOnMouseWheel?this.m_zoomLevelDeltaOnMouseWheel:this.inertiaEnabled?.8:.2}set zoomLevelDeltaOnMouseWheel(e){this.m_zoomLevelDeltaOnMouseWheel=e}constructor(e,t=!0){super(),this.mapView=e,this.rotationMouseDeltaFactor=.1,this.orbitingMouseDeltaFactor=.1*n.MathUtils.DEG2RAD,this.orbitingTouchDeltaFactor=.1*n.MathUtils.DEG2RAD,this.enabled=!0,this.zoomEnabled=!0,this.panEnabled=!0,this.tiltEnabled=!0,this.rotateEnabled=!0,this.inertiaEnabled=!0,this.zoomInertiaDampingDuration=.6,this.panInertiaDampingDuration=1,this.tiltToggleDuration=.5,this.tiltAngle=Math.PI/4,this.northResetAnimationDuration=1.5,this.zoomLevelDeltaOnControl=1,this.minZoomLevel=0,this.maxZoomLevel=20,this.minCameraHeight=3,this.zoomLevelDeltaOnDoubleClick=1,this.doubleTapTime=.3,this.m_currentViewDirection=new n.Vector3,this.m_lastMousePosition=new n.Vector2(0,0),this.m_initialMousePosition=new n.Vector2(0,0),this.m_mouseDelta=new n.Vector2(0,0),this.m_needsRenderLastFrame=!0,this.m_panIsAnimated=!1,this.m_panDistanceFrameDelta=new n.Vector3,this.m_panAnimationTime=0,this.m_panAnimationStartTime=0,this.m_lastAveragedPanDistanceOrAngle=0,this.m_currentInertialPanningSpeed=0,this.m_lastPanVector=new n.Vector3,this.m_rotateGlobeQuaternion=new n.Quaternion,this.m_lastRotateGlobeAxis=new n.Vector3,this.m_lastRotateGlobeAngle=0,this.m_lastRotateGlobeFromVector=new n.Vector3,this.m_recentPanDistancesOrAngles=[0,0,0,0,0],this.m_currentPanDistanceOrAngleIndex=0,this.m_zoomIsAnimated=!1,this.m_zoomDeltaRequested=0,this.m_zoomTargetNormalizedCoordinates=new n.Vector2,this.m_zoomAnimationTime=0,this.m_zoomAnimationStartTime=0,this.m_startZoom=0,this.m_tiltIsAnimated=!1,this.m_tiltRequested=void 0,this.m_tiltAnimationTime=0,this.m_tiltAnimationStartTime=0,this.m_startTilt=0,this.m_state=a.NONE,this.m_tmpVector2=new n.Vector2,this.m_tmpVector3=new n.Vector3,this.m_tapStartTime=0,this.m_lastSingleTapTime=0,this.m_fingerMoved=!1,this.m_isDoubleTap=!1,this.m_resetNorthStartTime=0,this.m_resetNorthIsAnimated=!1,this.m_resetNorthAnimationDuration=0,this.m_currentAzimuth=0,this.m_lastAzimuth=0,this.m_startAzimuth=0,this.m_maxTiltAngle=m,this.m_touchState={touches:[],currentRotation:0,initialRotation:0},this.dispose=()=>{},this.camera=e.camera,this.domElement=e.renderer.domElement,this.maxZoomLevel=e.maxZoomLevel,this.minZoomLevel=e.minZoomLevel,this.minCameraHeight=e.minCameraHeight,this.bindInputEvents(this.domElement),this.handleZoom=this.handleZoom.bind(this),this.handlePan=this.handlePan.bind(this),this.tilt=this.tilt.bind(this),this.resetNorth=this.resetNorth.bind(this),this.assignZoomAfterTouchZoomRender=this.assignZoomAfterTouchZoomRender.bind(this),t&&e.addEventListener(s.MapViewEventNames.Dispose,(()=>{this.dispose()}))}get attitude(){const e=s.MapViewUtils.extractAttitude(this.mapView,this.camera);return{yaw:n.MathUtils.radToDeg(e.yaw),pitch:n.MathUtils.radToDeg(e.pitch),roll:n.MathUtils.radToDeg(e.roll)}}pointToNorth(){this.m_startAzimuth=Math.PI+s.MapViewUtils.extractSphericalCoordinatesFromLocation(this.mapView,this.camera,this.mapView.target).azimuth,this.m_startAzimuth=Math.atan2(Math.sin(this.m_startAzimuth),Math.cos(this.m_startAzimuth)),0!==this.m_startAzimuth&&(this.stopExistingAnimations(),this.m_resetNorthAnimationDuration=this.northResetAnimationDuration,this.m_currentAzimuth=this.m_startAzimuth,this.m_resetNorthStartTime=performance.now(),this.resetNorth())}zoomOnTargetPosition(e,t,i){s.MapViewUtils.zoomOnTargetPosition(this.mapView,e,t,i,this.m_maxTiltAngle)}setZoomLevel(e,t={x:0,y:0}){this.enabled&&this.zoomEnabled&&(this.dispatchEvent(u),this.m_startZoom=this.currentZoom,this.m_zoomDeltaRequested=e-this.zoomLevelTargeted,this.stopExistingAnimations(),this.m_zoomAnimationStartTime=performance.now(),this.m_zoomTargetNormalizedCoordinates.set(t.x,t.y),this.handleZoom(),this.dispatchEvent(d))}toggleTilt(){if(!this.enabled||!this.tiltEnabled)return;this.stopExistingAnimations(),this.m_startTilt=this.currentTilt;const e=this.m_startTilt<p;this.m_tiltRequested=e?this.tiltAngle:0,this.m_tiltState=e?l.Tilted:l.Down,this.m_tiltAnimationStartTime=performance.now(),this.tilt()}set cameraHeight(e){this.camera.position.setZ(e),this.camera.matrixWorldNeedsUpdate=!0}
949get cameraHeight(){return this.mapView.camera.position.z}set maxTiltAngle(e){this.m_maxTiltAngle=Math.max(0,Math.min(m,n.MathUtils.degToRad(e)))}get maxTiltAngle(){return n.MathUtils.radToDeg(this.m_maxTiltAngle)}get zoomLevelTargeted(){return void 0===this.m_targetedZoom?this.currentZoom:this.m_targetedZoom}get tiltState(){return void 0===this.m_tiltState&&(this.m_tiltState=this.currentTilt<p||this.m_tiltState===l.Down?l.Tilted:l.Down),this.m_tiltState}set currentZoom(e){this.m_currentZoom=e}get currentZoom(){return void 0!==this.m_currentZoom?this.m_currentZoom:this.mapView.zoomLevel}set currentTilt(e){this.m_currentTilt=e}get currentTilt(){return n.MathUtils.degToRad(this.mapView.tilt)}get targetedTilt(){return void 0===this.m_targetedTilt?void 0===this.m_currentTilt?this.currentTilt:this.m_currentTilt:this.m_targetedTilt}assignZoomAfterTouchZoomRender(){this.m_currentZoom=this.mapView.zoomLevel,this.m_targetedZoom=this.mapView.zoomLevel,this.mapView.removeEventListener(s.MapViewEventNames.AfterRender,this.assignZoomAfterTouchZoomRender)}stopExistingAnimations(){this.stopResetNorth(),this.stopZoom(),this.stopPan(),this.stopTilt()}resetNorth(){const e=(performance.now()-this.m_resetNorthStartTime)/1e3;this.inertiaEnabled&&(this.m_resetNorthIsAnimated||(this.m_resetNorthIsAnimated=!0,this.mapView.addEventListener(s.MapViewEventNames.AfterRender,this.resetNorth)),e>this.m_resetNorthAnimationDuration?this.m_needsRenderLastFrame&&(this.m_needsRenderLastFrame=!1,this.stopResetNorth()):this.m_needsRenderLastFrame=!0),this.m_lastAzimuth=this.m_currentAzimuth,this.m_currentAzimuth=this.inertiaEnabled?this.easeOutCubic(this.m_startAzimuth,0,Math.min(1,e/this.m_resetNorthAnimationDuration)):0;const t=this.m_currentAzimuth-this.m_lastAzimuth;s.MapViewUtils.orbitAroundScreenPoint(this.mapView,{deltaAzimuth:t,maxTiltAngle:this.m_maxTiltAngle}),this.updateMapView()}stopResetNorth(){this.mapView.removeEventListener(s.MapViewEventNames.AfterRender,this.resetNorth),this.m_resetNorthIsAnimated=!1}tilt(){void 0!==this.m_tiltRequested&&(this.m_targetedTilt=Math.max(Math.min(this.m_tiltRequested,this.maxTiltAngle),0),this.m_tiltRequested=void 0);let e=!1;if(this.inertiaEnabled){this.m_tiltIsAnimated||(this.m_tiltIsAnimated=!0,this.mapView.addEventListener(s.MapViewEventNames.AfterRender,this.tilt));const t=performance.now();this.m_tiltAnimationTime=(t-this.m_tiltAnimationStartTime)/1e3,this.m_tiltAnimationTime>=this.tiltToggleDuration?this.m_needsRenderLastFrame&&(this.m_needsRenderLastFrame=!1,this.m_tiltAnimationTime=this.tiltToggleDuration,e=!0):this.m_needsRenderLastFrame=!0}this.m_currentTilt=this.inertiaEnabled?this.easeOutCubic(this.m_startTilt,this.targetedTilt,Math.min(1,this.m_tiltAnimationTime/this.tiltToggleDuration)):this.targetedTilt;const t=this.currentTilt,i=this.m_currentTilt-t;s.MapViewUtils.orbitAroundScreenPoint(this.mapView,{deltaTilt:i,maxTiltAngle:this.m_maxTiltAngle}),this.updateMapView(),e&&this.stopTilt()}stopTilt(){this.mapView.removeEventListener(s.MapViewEventNames.AfterRender,this.tilt),this.m_tiltIsAnimated=!1,this.m_targetedTilt=this.m_currentTilt=void 0}easeOutCubic(e,t,i){return e+(t-e)*(1-Math.pow(1-i,3))}easeOutCirc(e,t,i){return e+(t-e)*Math.sqrt(1-Math.pow(i-1,2))}handleZoom(){let e=!1;if(0!==this.m_zoomDeltaRequested&&(this.m_targetedZoom=Math.max(Math.min(this.zoomLevelTargeted+this.m_zoomDeltaRequested,this.maxZoomLevel),this.minZoomLevel),this.m_zoomDeltaRequested=0),this.inertiaEnabled&&this.zoomInertiaDampingDuration>0){this.m_zoomIsAnimated||(this.m_zoomIsAnimated=!0,this.mapView.addEventListener(s.MapViewEventNames.AfterRender,this.handleZoom));const t=performance.now();this.m_zoomAnimationTime=(t-this.m_zoomAnimationStartTime)/1e3,this.m_zoomAnimationTime>this.zoomInertiaDampingDuration?this.m_needsRenderLastFrame&&(this.m_needsRenderLastFrame=!1,this.m_zoomAnimationTime=this.zoomInertiaDampingDuration,e=!0,this.stopZoom()):this.m_needsRenderLastFrame=!0}this.currentZoom=!this.inertiaEnabled||Math.abs(this.zoomLevelTargeted-this.m_startZoom)<p?this.zoomLevelTargeted:this.easeOutCirc(this.m_startZoom,this.zoomLevelTargeted,Math.min(1,this.m_zoomAnimationTime/this.zoomInertiaDampingDuration));const t=s.MapViewUtils.zoomOnTargetPosition(this.mapView,this.m_zoomTargetNormalizedCoordinates.x,this.m_zoomTargetNormalizedCoordinates.y,this.currentZoom,this.m_maxTiltAngle);!e&&t||(this.m_targetedZoom=void 0,this.m_currentZoom=void 0),this.updateMapView()}stopZoom(){this.mapView.removeEventListener(s.MapViewEventNames.AfterRender,this.handleZoom),this.m_zoomIsAnimated=!1}handlePan(){if(this.m_state===a.NONE&&0===this.m_lastAveragedPanDistanceOrAngle)return;this.inertiaEnabled&&!this.m_panIsAnimated&&(this.m_panIsAnimated=!0,this.mapView.addEventListener(s.MapViewEventNames.AfterRender,this.handlePan));const e=this.inertiaEnabled&&this.panInertiaDampingDuration>0&&this.m_state===a.NONE&&this.m_lastAveragedPanDistanceOrAngle>0;if(e){const e=performance.now();this.m_panAnimationTime=(e-this.m_panAnimationStartTime)/1e3,this.m_panAnimationTime>this.panInertiaDampingDuration?this.m_needsRenderLastFrame&&(this.m_needsRenderLastFrame=!1,this.m_panAnimationTime=this.panInertiaDampingDuration,this.mapView.removeEventListener(s.MapViewEventNames.AfterRender,this.handlePan),this.m_panIsAnimated=!1):this.m_needsRenderLastFrame=!0;const t=this.m_panAnimationTime/this.panInertiaDampingDuration;this.m_currentInertialPanningSpeed=this.easeOutCubic(this.m_lastAveragedPanDistanceOrAngle,0,Math.min(1,t)),0===this.m_currentInertialPanningSpeed&&(this.m_lastAveragedPanDistanceOrAngle=0),this.mapView.projection.type===r.ProjectionType.Planar?this.m_panDistanceFrameDelta.
949copy(this.m_lastPanVector).setLength(this.m_currentInertialPanningSpeed):this.mapView.projection.type===r.ProjectionType.Spherical&&this.m_rotateGlobeQuaternion.setFromAxisAngle(this.m_lastRotateGlobeAxis,this.m_currentInertialPanningSpeed).normalize()}else{let e=0;this.mapView.projection.type===r.ProjectionType.Planar?e=this.m_lastPanVector.copy(this.m_panDistanceFrameDelta).length():this.mapView.projection.type===r.ProjectionType.Spherical&&(e=this.m_lastRotateGlobeAngle,this.m_rotateGlobeQuaternion.setFromAxisAngle(this.m_lastRotateGlobeAxis,this.m_lastRotateGlobeAngle),this.m_rotateGlobeQuaternion.normalize()),this.m_currentPanDistanceOrAngleIndex=(this.m_currentPanDistanceOrAngleIndex+1)%5,this.m_recentPanDistancesOrAngles[this.m_currentPanDistanceOrAngleIndex]=e,this.m_lastAveragedPanDistanceOrAngle=this.m_recentPanDistancesOrAngles.reduce(((e,t)=>e+t))/5}this.mapView.projection.type===r.ProjectionType.Planar?s.MapViewUtils.panCameraAboveFlatMap(this.mapView,this.m_panDistanceFrameDelta.x,this.m_panDistanceFrameDelta.y):this.mapView.projection.type===r.ProjectionType.Spherical&&s.MapViewUtils.panCameraAroundGlobe(this.mapView,this.m_lastRotateGlobeFromVector,this.m_tmpVector3.copy(this.m_lastRotateGlobeFromVector).applyQuaternion(this.m_rotateGlobeQuaternion)),e||(this.m_panDistanceFrameDelta.set(0,0,0),this.m_lastRotateGlobeAngle=0),this.updateMapView()}stopPan(){this.m_panDistanceFrameDelta.set(0,0,0),this.m_lastAveragedPanDistanceOrAngle=0}bindInputEvents(e){const t=this.contextMenu.bind(this),i=this.mouseDown.bind(this),n=this.mouseWheel.bind(this),r=this.touchStart.bind(this),s=this.touchEnd.bind(this),o=this.touchMove.bind(this),a=this.mouseDoubleClick.bind(this);e.addEventListener("dblclick",a,!1),e.addEventListener("contextmenu",t,!1),e.addEventListener("mousedown",i,!1),e.addEventListener("wheel",n,!1),e.addEventListener("touchstart",r,!1),e.addEventListener("touchend",s,!1),e.addEventListener("touchmove",o,!1),this.dispose=()=>{e.removeEventListener("dblclick",a,!1),e.removeEventListener("contextmenu",t,!1),e.removeEventListener("mousedown",i,!1),e.removeEventListener("wheel",n,!1),e.removeEventListener("touchstart",r,!1),e.removeEventListener("touchend",s,!1),e.removeEventListener("touchmove",o,!1)}}updateMapView(){this.dispatchEvent(h),this.mapView.update()}mouseDoubleClick(e){if(!this.enabled||!this.zoomEnabled)return;const t=this.getPointerPosition(e);this.zoomOnDoubleClickOrTap(t.x,t.y)}mouseDown(e){if(!1===this.enabled)return;if(e.shiftKey)return;if(e.stopPropagation(),this.m_state!==a.NONE)return;if(0===e.button&&!e.ctrlKey&&this.panEnabled)this.m_state=a.PAN;else if(1===e.button)this.m_state=a.ROTATE;else{if(2!==e.button&&!e.ctrlKey||!this.tiltEnabled)return;this.m_state=a.ORBIT}this.dispatchEvent(u);const t=this.getPointerPosition(e);if(this.m_lastMousePosition.copy(t),!0===e.altKey){const{width:e,height:i}=o.getWidthAndHeightFromCanvas(this.domElement);this.m_initialMousePosition.copy(o.calculateNormalizedDeviceCoordinates(t.x,t.y,e,i))}else s.CameraUtils.getPrincipalPoint(this.mapView.camera,this.m_initialMousePosition);const i=this.mouseMove.bind(this),n=this.mouseUp.bind(this);window.addEventListener("mousemove",i,!1),window.addEventListener("mouseup",n,!1),this.m_cleanupMouseEventListeners=()=>{window.removeEventListener("mousemove",i),window.removeEventListener("mouseup",n)}}mouseMove(e){if(!1===this.enabled)return;const t=this.getPointerPosition(e);if(this.m_mouseDelta.set(t.x-this.m_lastMousePosition.x,t.y-this.m_lastMousePosition.y),this.m_state===a.PAN){const e=this.getWorldPositionWithElevation(this.m_lastMousePosition.x,this.m_lastMousePosition.y,t.x,t.y);if(void 0===e)return;const{fromWorld:i,toWorld:n}=e;this.panFromTo(i,n)}else this.m_state===a.ROTATE?(this.stopExistingAnimations(),s.MapViewUtils.rotate(this.mapView,-this.rotationMouseDeltaFactor*this.m_mouseDelta.x,this.rotationMouseDeltaFactor*this.m_mouseDelta.y,this.m_maxTiltAngle)):this.m_state===a.ORBIT&&(this.stopExistingAnimations(),s.MapViewUtils.orbitAroundScreenPoint(this.mapView,{center:this.m_tmpVector2.set(this.m_initialMousePosition.x,this.m_initialMousePosition.y),deltaAzimuth:this.orbitingMouseDeltaFactor*this.m_mouseDelta.x,deltaTilt:-this.orbitingMouseDeltaFactor*this.m_mouseDelta.y,maxTiltAngle:this.m_maxTiltAngle}));this.m_lastMousePosition.set(t.x,t.y),this.m_zoomAnimationStartTime=performance.now(),this.updateMapView(),e.preventDefault(),e.stopPropagation()}mouseUp(e){!1!==this.enabled&&(this.updateMapView(),e.preventDefault(),e.stopPropagation(),this.m_state=a.NONE,this.m_cleanupMouseEventListeners&&this.m_cleanupMouseEventListeners(),this.dispatchEvent(d))}mouseWheel(e){if(!this.enabled||!this.zoomEnabled)return;const{width:t,height:i}=o.getWidthAndHeightFromCanvas(this.domElement),n=o.calculateNormalizedDeviceCoordinates(e.offsetX,e.offsetY,t,i);this.setZoomLevel(this.mapView.zoomLevel-this.zoomLevelDeltaOnMouseWheel*Math.sign(e.deltaY),n),e.preventDefault(),e.stopPropagation()}updateCurrentRotation(){if(this.m_touchState.touches.length<2||0===this.m_touchState.touches[1].currentWorldPosition.length()||0===this.m_touchState.touches[0].currentWorldPosition.length())return;let e=0,t=0;this.mapView.projection.type===r.ProjectionType.Planar?(e=this.m_touchState.touches[1].currentWorldPosition.x-this.m_touchState.touches[0].currentWorldPosition.x,t=this.m_touchState.touches[1].currentWorldPosition.y-this.m_touchState.touches[0].currentWorldPosition.y):this.mapView.projection.type===r.ProjectionType.Spherical&&(e=this.m_touchState.touches[1].currentTouchPoint.x-this.m_touchState.touches[0].currentTouchPoint.x,t=this.m_touchState.touches[0].currentTouchPoint.y-this.m_touchState.touches[1].currentTouchPoint.y,this.m_touchState.initialRotation=this.m_touchState.currentRotation),this.m_touchState.currentRotation=Math.atan2(t,e)}calculatePinchDistanceInWorldSpace(){if(this.m_touchState.touches.length<2)return 0;const e=this.m_tmpVector3.subVectors(this.m_touchState.touches[0].initialWorldPosition,this.m_touchState.touches[1].initialWorldPosition).length();return this.m_tmpVector3.subVectors(this.m_touchState.touches[0].currentWorldPosition,this.m_touchState.touches[1].currentWorldPosition).length()-e}convertTouchPoint(e,t){const i=this.getPointerPosition(e);if(void 0!==t){const e=t.currentTouchPoint,r=this.getWorldPositionWithElevation(e.x,e.y,i.x,i.y),s=void 0===r?new n.Vector3:r.toWorld;return 0!==s.length()||3===this.m_touchState.touches.length&&this.tiltEnabled?(this.m_state!==a.TOUCH&&this.dispatchEvent(u),this.m_state=a.TOUCH,{currentTouchPoint:i,lastTouchPoint:i,currentWorldPosition:s,initialWorldPosition:s}):(this.setTouchState([]),this.m_state=a.NONE,void this.dispatchEvent(d))}{const{width:e,height:t}=o.getWidthAndHeightFromCanvas(this.domElement),r=o.calculateNormalizedDeviceCoordinates(i.x,i.y,e,t),l=s.MapViewUtils.rayCastWorldCoordinates(this.mapView,r.x,r.y),c=null===l?new n.Vector3:l;return 0!==c.length()||3===this.m_touchState.touches.length&&this.tiltEnabled?(this.m_state!==a.TOUCH&&this.dispatchEvent(u),this.m_state=a.TOUCH,{currentTouchPoint:i,lastTouchPoint:i,currentWorldPosition:c,initialWorldPosition:c}):(this.setTouchState([]),this.m_state=a.NONE,void this.dispatchEvent(d))}}setTouchState(e){this.m_touchState.touches=[];for(let t=0;t<e.length;++t){const i=this.convertTouchPoint(e[t]);void 0!==i&&this.m_touchState.touches.push(i)}0!==this.m_touchState.touches.length&&(this.updateCurrentRotation(),this.m_touchState.initialRotation=this.m_touchState.currentRotation)}updateTouches(e){const t=Math.min(e.length,this.m_touchState.touches.length);for(let i=0;i<t;++i){const t=this.m_touchState.touches[i],n=this.convertTouchPoint(e[i],t);void 0!==n&&void 0!==t&&(n.initialWorldPosition=t.initialWorldPosition,n.lastTouchPoint=t.currentTouchPoint,this.m_touchState.touches[i]=n)}}zoomOnDoubleClickOrTap(e,t){if(0===this.zoomLevelDeltaOnDoubleClick)return;const{width:i,height:n}=o.getWidthAndHeightFromCanvas(this.domElement),r=o.calculateNormalizedDeviceCoordinates(e,t,i,n);this.setZoomLevel(this.currentZoom+this.zoomLevelDeltaOnDoubleClick,r)}touchStart(e){!1!==this.enabled&&(this.m_tapStartTime=performance.now(),this.m_fingerMoved=!1,this.m_state=a.TOUCH,this.dispatchEvent(u),this.setTouchState(e.touches),this.updateTouches(e.touches),e.preventDefault(),e.stopPropagation())}touchMove(e){if(!1!==this.enabled){if(this.m_fingerMoved=!0,this.updateTouches(e.touches),this.panEnabled&&this.m_touchState.touches.length<=2&&void 0!==this.m_touchState.touches[0]&&this.panFromTo(this.m_touchState.touches[0].initialWorldPosition,this.m_touchState.touches[0].currentWorldPosition),2===this.m_touchState.touches.length){const e=this.m_touchState.touches,t=new n.Vector2;if(!0===this.zoomEnabled||!0===this.rotateEnabled){const{width:i,height:n}=o.getWidthAndHeightFromCanvas(this.domElement);e.forEach((e=>{const r=o.calculateNormalizedDeviceCoordinates(e.currentTouchPoint.x,e.currentTouchPoint.y,i,n);t.add(r)})),t.divideScalar(e.length)}if(this.zoomEnabled){const e=this.calculatePinchDistanceInWorldSpace();if(Math.abs(e)<p)return;const i=s.MapViewUtils.calculateZoomLevelFromDistance(this.mapView,this.mapView.targetDistance-e);s.MapViewUtils.zoomOnTargetPosition(this.mapView,t.x,t.y,i,this.m_maxTiltAngle)}if(this.rotateEnabled){this.updateCurrentRotation();const e=this.m_touchState.currentRotation-this.m_touchState.initialRotation;this.stopExistingAnimations(),s.MapViewUtils.orbitAroundScreenPoint(this.mapView,{center:this.m_tmpVector2.set(t.x,t.y),deltaAzimuth:e,maxTiltAngle:this.m_maxTiltAngle})}}if(3===this.m_touchState.touches.length&&this.tiltEnabled){const e=this.m_touchState.touches[0],t=this.m_tmpVector2.subVectors(e.currentTouchPoint,e.lastTouchPoint);this.stopExistingAnimations(),s.MapViewUtils.orbitAroundScreenPoint(this.mapView,{deltaAzimuth:this.orbitingTouchDeltaFactor*t.x,deltaTilt:-this.orbitingTouchDeltaFactor*t.y,maxTiltAngle:this.m_maxTiltAngle})}this.m_zoomAnimationStartTime=performance.now(),this.updateMapView(),e.preventDefault(),e.stopPropagation()}}touchEnd(e){!1!==this.enabled&&(this.m_state=a.NONE,this.handleDoubleTap(),this.setTouchState(e.touches),this.dispatchEvent(d),this.updateMapView(),e.preventDefault(),e.stopPropagation())}handleDoubleTap(){if(this.m_fingerMoved||!this.zoomEnabled)return;const e=performance.now();return e-this.m_tapStartTime>120?void 0:this.m_isDoubleTap?(e-this.m_lastSingleTapTime>1e3*this.doubleTapTime||this.zoomOnDoubleClickOrTap(this.m_touchState.touches[0].currentTouchPoint.x,this.m_touchState.touches[0].currentTouchPoint.y),void(this.m_isDoubleTap=!1)):(this.m_isDoubleTap=!0,void(this.m_lastSingleTapTime=e))}contextMenu(e){e.preventDefault()}getWorldPositionWithElevation(e,t,i,n){const{width:r,height:a}=o.getWidthAndHeightFromCanvas(this.domElement),l=o.calculateNormalizedDeviceCoordinates(e,t,r,a),c=o.calculateNormalizedDeviceCoordinates(i,n,r,a);let h,u,d;if(void 0!==this.mapView.elevationProvider&&(d=this.mapView.elevationProvider.rayCast(e,t)),void 0===d)u=s.MapViewUtils.rayCastWorldCoordinates(this.mapView,l.x,l.y),h=s.MapViewUtils.rayCastWorldCoordinates(this.mapView,c.x,c.y);else{u=d;const e=this.mapView.projection.unprojectAltitude(u);h=s.MapViewUtils.rayCastWorldCoordinates(this.mapView,c.x,c.y,e)}if(null!==u&&null!==h)return{fromWorld:u,toWorld:h}}panFromTo(e,t){this.stopExistingAnimations(),this.m_panAnimationStartTime=performance.now(),this.mapView.projection.type===r.ProjectionType.Planar?this.m_panDistanceFrameDelta.subVectors(e,t):this.mapView.projection.type===r.ProjectionType.Spherical&&(this.m_lastRotateGlobeFromVector.copy(e),this.m_lastRotateGlobeAxis.crossVectors(e,t).normalize(),this.m_lastRotateGlobeAngle=e.angleTo(t),isNaN(this.m_lastRotateGlobeAngle)&&(this.m_lastRotateGlobeAngle=0)),this.handlePan()}getPointerPosition(e){const t=o.getWidthAndHeightFromCanvas(this.domElement),i=this.domElement.getBoundingClientRect(),r=Math.round(i.width)/t.width,s=Math.round(i.height)/t.height;return new n.Vector2((e.clientX-Math.floor(i.left))*r,(e.clientY-Math.floor(i.top))*s)}}
949t.MapControls=f},5363:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MapControlsUI=void 0;const n=i(2616),r=i(2344);t.MapControlsUI=class{constructor(e,t={}){this.controls=e,this.domElement=document.createElement("div"),this.m_buttonsElement=document.createElement("div"),this.m_zoomLevelElement=null,this.m_projectionSwitchElement=null,this.m_onMapViewRenderEvent=()=>{if(null===this.m_zoomLevelElement)return;const e=this.controls.zoomLevelTargeted.toFixed(1);"INPUT"===this.m_zoomLevelElement.tagName?this.m_zoomLevelElement.value=e:this.m_zoomLevelElement.innerHTML=e},this.m_onWindowClick=e=>{const t=this.m_zoomLevelElement;e&&e.target&&e.target.contains&&e.target!==t&&!e.target.contains(t)&&t.blur()};const i=document.createElement("span");i.className="harp-gl_v-align",this.domElement.appendChild(i),this.m_buttonsElement=document.createElement("div"),this.m_buttonsElement.className="harp-gl_v-aligned",this.domElement.appendChild(this.m_buttonsElement);const s=document.createElement("button");s.innerText="+",s.className="harp-gl_controls_button-top",s.classList.add("harp-gl_controls-button");const o=document.createElement("button");o.innerText="-",o.className="harp-gl_controls_button-bottom",o.classList.add("harp-gl_controls-button");const a=document.createElement("button");a.innerText="3D",a.id="harp-gl_controls_tilt-button-ui",a.title="Toggle tilt",a.classList.add("harp-gl_controls-button"),a.classList.add("harp-gl_controls_button-bottom");const l=document.createElement("button");l.id="harp-gl_controls-button_compass",l.title="Reset North",l.classList.add("harp-gl_controls-button"),l.classList.add("harp-gl_controls_button-top");const c=document.createElement("span");if(c.id="harp-gl_controls_compass",l.appendChild(c),"show"===t.zoomLevel)this.m_zoomLevelElement=document.createElement("div"),e.mapView.addEventListener(r.MapViewEventNames.Render,this.m_onMapViewRenderEvent);else if("input"===t.zoomLevel){const t=document.createElement("input");t.type="number",t.step="0.1",e.mapView.addEventListener(r.MapViewEventNames.Render,this.m_onMapViewRenderEvent);const i=i=>{e.setZoomLevel(parseFloat(t.value)),i.preventDefault()};t.addEventListener("blur",i),t.addEventListener("keypress",(e=>{"Enter"===e.key&&i(e)})),window.addEventListener("click",this.m_onWindowClick),this.m_zoomLevelElement=t}if(t.projectionSwitch){const e=document.createElement("button");e.id="harp-gl_controls_switch_projection",e.classList.add("harp-gl_controls-button");const t=()=>`Switch to ${this.controls.mapView.projection.type===n.ProjectionType.Spherical?"flat":"globe"} projection`;e.title=t();const i='\n <svg style="margin-top:5px;" stroke-width="2" class="harp-gl_controls_switch_svg" width="50" height="50" viewBox="0 0 25 25" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">\n <ellipse ry="9.79855" rx="4.56139" id="svg_6" cy="11.99798" cx="11.99798" fill="none"/>\n <line id="svg_8" y2="8.16866" x2="21.12086" y1="8.16866" x1="3.10044"/>\n <line id="svg_9" y2="16.10887" x2="21.0645" y1="16.10887" x1="3.04409"/>\n <ellipse id="svg_11" ry="9.79855" rx="9.82671" cy="11.94167" cx="12.02614" fill="none"/>\n </svg>',r='\n <svg style="margin-top:5px;" class="harp-gl_controls_switch_svg" width="25" height="25" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">\n <rect id="svg_1" stroke-width="2" height="13.51524" width="18.35821" y="5.80349" x="3.21307" fill="none"/>\n <path id="svg_14" d="m9.52018,7.71815l1.2357,-0.0032l-0.61945,1.18258l-0.61625,-1.17938z"/>\n <path id="svg_15" d="m4.11409,7.32396l3.65718,-0.0032l0.28156,2.13991l-2.59042,1.57678l0.50682,1.80203l2.25254,0.8447l-0.90101,2.0836l0.28157,2.25254l-3.26619,-3.04093l0.67576,-2.02728l-0.61945,-1.97097l-1.01364,-3.15356l0.73528,-0.50362z"/>\n <path id="svg_17" d="m13.23688,7.4929l2.02409,-0.0032l0.78839,1.29521l2.47779,-1.35152l2.75936,0.78839l0,1.57678l-0.73208,0.61945l-0.28157,1.97097c0,0 -0.67256,0.8479 -0.72888,0.90422c-0.05631,0.05631 0.28157,1.06996 0.33788,1.18258c0.05631,0.11263 -1.68941,-1.35152 -1.6926,-1.35472c-0.0032,-0.0032 -0.16574,1.29841 -0.16894,1.29521c-0.0032,-0.0032 -1.57358,-1.34832 -1.57678,-1.35152c-0.0032,-0.0032 -0.72888,0.67896 -0.73208,0.67576c-0.0032,-0.0032 -0.8415,-0.67256 -0.8447,-0.67576c-0.0032,-0.0032 0.73528,2.0868 0.79159,2.0868c0.05631,0 -0.50682,3.20987 -0.51002,3.20667c-0.0032,-0.0032 -1.235
9497,-0.16574 -1.34832,-0.16574c-0.11263,0 -0.95733,-1.52046 -0.90102,-1.57678c0.05631,-0.05631 0,-1.80203 -0.0032,-1.80523c-0.0032,-0.0032 -1.40464,-0.33468 -1.40784,-0.33788c-0.0032,-0.0032 -0.05311,-1.74252 -0.05631,-1.74572c-0.0032,-0.0032 1.18578,-0.8415 1.18258,-0.8447c-0.0032,-0.0032 1.69261,-0.16574 1.74892,-0.16574c0.05631,0 1.2389,-1.06996 1.2357,-1.07316c-0.0032,-0.0032 -1.91146,-0.10943 -1.91466,-0.11263c-0.0032,-0.0032 -1.96777,0.17214 -1.97097,0.16894c-0.0032,-0.0032 1.52366,-3.20667 1.52366,-3.20667z"/>\n </svg>';e.innerHTML=this.controls.mapView.projection.type===n.ProjectionType.Spherical?r:i,e.addEventListener("click",(()=>{this.controls.mapView.projection=this.controls.mapView.projection.type===n.ProjectionType.Spherical?n.mercatorProjection:n.sphereProjection,e.title=t(),e.innerHTML=this.controls.mapView.projection.type===n.ProjectionType.Spherical?r:i})),this.m_projectionSwitchElement=e}return this.m_buttonsElement.appendChild(s),null!==this.m_zoomLevelElement&&this.m_buttonsElement.appendChild(this.m_zoomLevelElement),this.m_buttonsElement.appendChild(o),this.m_buttonsElement.appendChild(l),this.m_buttonsElement.appendChild(a),null!==this.m_projectionSwitchElement&&this.m_buttonsElement.appendChild(this.m_projectionSwitchElement),s.addEventListener("click",(t=>{const i=e.zoomLevelTargeted+e.zoomLevelDeltaOnControl;e.setZoomLevel(i)})),s.addEventListener("dblclick",(e=>{e.stopPropagation()})),o.addEventListener("click",(t=>{const i=e.zoomLevelTargeted-e.zoomLevelDeltaOnControl;e.setZoomLevel(i)})),o.addEventListener("dblclick",(e=>{e.stopPropagation()})),a.addEventListener("click",(t=>{e.toggleTilt()})),l.addEventListener("click",(t=>{e.pointToNorth()})),e.mapView.addEventListener(r.MapViewEventNames.AfterRender,(()=>{c.style.transform=`rotate(${e.mapView.heading}deg)`})),this.domElement.className="harp-gl_controls",null!==this.m_zoomLevelElement&&this.m_zoomLevelElement.classList.add("harp-gl_controls_zoom-level"),!0!==t.disableDefaultStyle&&(this.initStyle(),this.domElement.style.cssText="\n position: absolute;\n right: 5px;\n top: 0;\n height: 100%; /* Vertical alignment is done dynamically, in the rest of the CSS. */\n pointer-events: none; /* Allows to click the map even though height is 100%. */\n "),this}get projectionSwitchElement(){return this.m_projectionSwitchElement}dispose(){null!==this.m_zoomLevelElement&&"INPUT"===this.m_zoomLevelElement.tagName&&window.removeEventListener("click",this.m_onWindowClick),this.controls.mapView.removeEventListener(r.MapViewEventNames.Render,this.m_onMapViewRenderEvent),this.domElement.remove()}initStyle(){if(null!==document.getElementById("here-harp-controls.map-controls-ui-styles"))return;const e=document.createElement("style");e.id="here-harp-controls.map-controls-ui-styles",e.appendChild(document.createTextNode('\n /* CSS trick to align another div dynamically. */\n .harp-gl_v-align{\n height: 100%;\n display: inline-block;\n vertical-align: middle;\n }\n /* The target element to align vertically with vertical-align. */\n .harp-gl_v-aligned{\n pointer-events: all;\n vertical-align: middle;\n display: inline-block;\n }\n .harp-gl_controls-button {\n display: block;\n background-color: #272d37;\n width: 40px;\n height: 40px;\n font-size: 22px;\n font-weight: bold;\n outline: none;\n margin:0;\n border: none;\n color: rgba(255, 255, 255, 0.8);\n cursor: pointer;\n border-radius: 4px;\n box-shadow: 0px 0px 5px 0 hsl(220, 4%, 40%);\n transition: all 0.1s;\n padding: 0 0 1px 1px;\n user-select: none;\n position:relative;\n }\n #harp-gl_controls_tilt-button-ui {\n font-size: 16px;\n }\n .harp-gl_controls-button:active {\n background-color: #37afaa;\n color: #eee;\n }\n .harp-gl_controls-button:focus {\n outline:none;\n }\n .harp-gl_controls_button-top{\n margin-bottom:0;\n border-bottom-right-radius:0;\n border-bottom-left-radius:0;\n }\n .harp-gl_controls_button-bottom{\n margin-top:1px;\n border-top-right-radius:0;\n border-top-left-radius:0;\n }\n .harp-gl_controls_zoom-level {\n display: block;\n background-color: #fff;\n width: 40px;\n height: 20px;\n font-size: 12px;\n font-weight: bold;\n outline: none;\n border: none;\n color: #555;\n opacity: 0.87;\n box-shadow: 0px 0px 4px #aaa;\n padding: 2px 0 0;\n text-align: center;\n user-select: text;\n }\n input.harp-gl_controls_zoom-level::-webkit-outer-spin-button,\n input.harp-gl_controls_zoom-level::-webkit-inner-spin-button {\n /* display: none; <- Crashes Chrome on hover */\n -webkit-appearance: none;\n margin: 0; /* <-- Apparently some margin are still there even though it\'s hidden */\n }\n input.harp-gl_controls_zoom-level[type=number] {\n -moz-appearance:textfield; /* Firefox */\n }\n #harp-gl_controls-button_compass{\n overflow: hidden;\n margin: 5px 0 0 0;\n }\n #harp-gl_controls_compass{\n pointer-events:none;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n margin:0\n }\n #harp-gl_controls_compass::after{\n content: " ";\n position:absolute;\n left:50%;\n margin-left:-3px;\n top:50%;\n margin-top: -18px;\n border:solid 3px rgba(0,0,0,0);\n border-bottom:solid 15px #a34f2e;\n }\n #harp-gl_controls_compass::before{\n content: " ";\n position:absolute;\n left:50%;\n margin-left:-3px;\n top:50%;\n margin-top:0px;\n border:solid 3px rgba(0,0,0,0);\n border-top:solid 15px #eee;\n }\n #harp-gl_controls_switch_projection{\n margin-top:5px;\n }\n .harp-gl_controls_switch_svg{\n width: 25px;\n height: 25px;\n stroke: #d4d5d7;\n fill: #d4d5d7;\n }\n ')),document.head.appendChild(e)}}},1555:(e,t,i)=>{"use strict";
949Object.defineProperty(t,"__esModule",{value:!0}),t.getWidthAndHeightFromCanvas=t.safeParseDecimalInt=t.azimuthAltitudeToDirection=t.calculateNormalizedDeviceCoordinates=void 0;const n=i(82);function r(e,t){if(null==e||""===e)return t;if(!e.match(s))return t;const i=Number.parseInt(e,10);return isNaN(i)?t:i}t.calculateNormalizedDeviceCoordinates=function(e,t,i,r){return new n.Vector2(e/i*2-1,-t/r*2+1)},t.azimuthAltitudeToDirection=function(e,t){const i=new n.Vector3,r=Math.cos(t);return i.setX(Math.sin(e)*r),i.setY(Math.cos(e)*r),i.setZ(Math.sin(t)),i},t.safeParseDecimalInt=r;const s=/^\d+$/;t.getWidthAndHeightFromCanvas=function(e){return{width:r(e.style.width,e.clientWidth),height:r(e.style.height,e.clientHeight)}}},2626:function(e,t,i){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=this&&this.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||n(t,e,i)};Object.defineProperty(t,"__esModule",{value:!0}),r(i(1153),t),r(i(5805),t),r(i(4773),t),r(i(2369),t),r(i(5199),t),r(i(1781),t)},8449:function(e,t,i){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);
949r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=this&&this.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||n(t,e,i)};Object.defineProperty(t,"__esModule",{value:!0}),r(i(8635),t),r(i(1930),t),r(i(4069),t)},8635:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DataProvider=void 0;const n=i(82);class r extends n.EventDispatcher{constructor(){super(...arguments),this.m_clients=new Set}register(e){return 0===this.m_clients.size&&(this.m_connectPromise=this.connect()),this.m_clients.add(e),this.m_connectPromise}unregister(e){this.m_clients.delete(e)&&0===this.m_clients.size&&this.dispose()}}t.DataProvider=r},1781:(e,t,i)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.GeoJsonTiler=void 0;const r=i(242),s=i(8152),o=null!==(n=r.default)&&void 0!==n?n:r,a=-(-2&-Math.ceil(204.8));t.GeoJsonTiler=class{constructor(){this.indexes=new Map}dispose(){}async connect(){return await Promise.resolve()}async registerIndex(e,t){if(!this.indexes.has(e))return await this.updateIndex(e,t)}async updateIndex(e,t){if(t instanceof URL){const e=await fetch(t.href);if(!e.ok)throw new Error(`GeoJsonTiler: Unable to fetch ${t.href}: ${e.statusText}`);t=await e.json()}const i=(0,s.isFeatureGeometry)(t)||"GeometryCollection"===t.type||"Feature"===t.type&&void 0===t.id||"FeatureCollection"===t.type&&t.features.length>0&&void 0===t.features[0].id,n=o(t,{maxZoom:20,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:a,lineMetrics:!1,promoteId:null,generateId:i,debug:0});n.geojson=t,this.indexes.set(e,n)}async getTile(e,t){const i=this.indexes.get(e);if(void 0===i)throw new Error("Tile not found");const n=i.getTile(t.level,t.column,t.row);return null!==n&&(n.layer=e),n||{}}}},1153:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ThemedTileDecoder=void 0;const n=i(7769),r=i(4342).LoggerManager.instance.create("ThemedTileDecoder");t.ThemedTileDecoder=class{constructor(){this.m_storageLevelOffset=0}dispose(){}decodeTile(e,t,i){return void 0===this.m_styleSetEvaluator?(r.info("cannot decode tile, as there is not style available"),Promise.resolve(void 0)):this.decodeThemedTile(e,t,this.m_styleSetEvaluator,i)}getTileInfo(e,t,i){return Promise.resolve(void 0)}configure(e,t){void 0!==(null==e?void 0:e.styleSet)&&(this.m_styleSetEvaluator=new n.StyleSetEvaluator(e)),this.m_styleSetEvaluator&&this.m_styleSetEvaluator.setEnabledFeatures(null==e?void 0:e.enabledFeatures),void 0!==(null==e?void 0:e.languages)&&(this.languages=e.languages),void 0!==t&&void 0!==t.storageLevelOffset&&(this.m_storageLevelOffset=t.storageLevelOffset)}}},1930:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TileDataSource=t.TileFactory=void 0;const n=i(2344),r=i(6586),s=i(1984),o=i(4342),a=i(4069);t.TileFactory=class{constructor(e){this.m_modelConstructor=e}create(e,t){const i=new this.m_modelConstructor(e,t);return i.tileLoader=new a.TileLoader(e,t,e.dataProvider(),e.decoder,e.mapView.taskQueue),i}};class l extends n.DataSource{constructor(e,t){var i,r;if(super(t),this.m_tileFactory=e,this.m_options=t,this.logger=o.LoggerManager.instance.create("TileDataSource"),this.m_isReady=!1,t.decoder)this.m_decoder=t.decoder;else{if(!t.concurrentDecoderServiceName)throw new Error(`TileDataSource[${this.name}]: unable to create, missing decoder or concurrentDecoderServiceName`);this.m_decoder=n.ConcurrentDecoderFacade.getTileDecoder(t.concurrentDecoderServiceName,t.concurrentDecoderScriptUrl,t.concurrentDecoderWorkerCount,t.workerConnectionTimeout)}this.useGeometryLoader=!0,this.cacheable=!0,this.m_unregisterClearTileCache=null===(r=(i=this.dataProvider()).onDidInvalidate)||void 0===r?void 0:r.call(i,(()=>this.mapView.markTilesDirty(this)))}dispose(){var e;null===(e=this.m_unregisterClearTileCache)||void 0===e||e.call(this),this.decoder.dispose(),this.dataProvider().unregister(this)}ready(){return this.m_isReady&&this.m_options.dataProvider.ready()}get decoder(){return this.m_decoder}async connect(){await Promise.all([this.m_options.dataProvider.register(this),this.m_decoder.connect()]),this.m_isReady=!0;let e={};void 0!==this.m_options.storageLevelOffset&&(e={storageLevelOffset:this.m_options.storageLevelOffset}),this.m_decoder.configure({languages:super.languages},e)}set languages(e){super.languages=e,this.m_decoder.configure({languages:e}),this.mapView.markTilesDirty(this)}get languages(){return super.languages}async setTheme(e,t){var i;e=await r.load(e,{baseUrl:t});const n=(0,s.getStyles)(e.styles).filter((e=>{var t;return!e.layer||(null===(t=this.layerNames)||void 0===t?void 0:t.includes(e.layer))}));n.length>0&&(this.m_decoder.configure({styleSet:n,definitions:e.definitions,features:e.features,priorities:e.priorities,labelPriorities:e.labelPriorities,enabledFeatures:this.enabledFeatures}),this.isDetached()||null===(i=this.mapView)||void 0===i||i.markTilesDirty(this))}get enabledFeatures(){return this.m_enabledFeatures}set enabledFeatures(e){this.m_enabledFeatures=e,this.m_decoder.configure({enabledFeatures:e}),this.isDetached()||this.mapView.markTilesDirty(this)}dataProvider(){return this.m_options.dataProvider}getTilingScheme(){return this.m_options.tilingScheme}getTile(e,t=!1){const i=this.m_tileFactory.create(this,e);return i.copyrightInfo=this.m_options.copyrightInfo,void 0!==this.m_options.copyrightProvider&&this.m_options.copyrightProvider.getCopyrights(i.geoBox,e.level).then((e=>{i.copyrightInfo=void 0===i.copyrightInfo?e:[...i.copyrightInfo,...e],this.requestUpdate()})),t||i.load(),i}getTileInfo(e){return new Promise(((t,i)=>{const r=new a.TileInfoLoader(this,e,this.m_options.dataProvider,this.decoder);r.loadAndDecode().then((e=>{e===n.TileLoaderState.Ready?t(r.tileInfo):i(new Error(`TileDataSource#getInfoTile wrong final state: ${e}`))}))}))}}t.TileDataSource=l},5805:(e,t,i)=>{"use strict";
949Object.defineProperty(t,"__esModule",{value:!0}),t.TileDecoderService=void 0;const n=i(8152),r=i(2616),s=i(1984),o=i(4342),a=i(2369),l=o.LoggerManager.instance.create("TileDecoderService");class c extends a.WorkerService{static start(e,t){return new c(e,t)}constructor(e,t){super(e),this.serviceId=e,this.m_decoder=t,this.m_decoder.connect()}handleRequest(e){return n.WorkerDecoderProtocol.isDecodeTileRequest(e)?this.handleDecodeTileRequest(e):n.WorkerDecoderProtocol.isTileInfoRequest(e)?this.handleTileInfoRequest(e):super.handleRequest(e)}handleMessage(e){n.WorkerDecoderProtocol.isConfigurationMessage(e)?this.handleConfigurationMessage(e):l.error(`[${this.serviceId}]: invalid message ${e.type}`)}async handleDecodeTileRequest(e){const t=r.TileKey.fromMortonCode(e.tileKey),i=(0,n.getProjection)(e.projection),o=await this.m_decoder.decodeTile(e.data,t,i),a=[],l=e=>{void 0!==e&&e.buffer.byteLength>0&&!a.includes(e.buffer)&&a.push(e.buffer)};return null==o||o.geometries.forEach((e=>{var t,i,n;if(null===(t=e.vertexAttributes)||void 0===t||t.forEach((e=>l(e))),null===(i=e.interleavedVertexAttributes)||void 0===i||i.forEach((e=>l(e))),l(e.index),l(e.edgeIndex),Array.isArray(e.objInfos)&&1===e.objInfos.length&&"object"==typeof e.objInfos[0]&&(null===(n=e.objInfos[0])||void 0===n?void 0:n.hasOwnProperty("displacementMap"))){const t=e.objInfos[0];l(t.displacementMap)}Array.isArray(e.attachments)&&e.attachments.forEach((e=>{l(e.index),l(e.edgeIndex)}))})),null==o||o.techniques.forEach((e=>{(0,s.addBuffersToTransferList)(e,a)})),{response:o,transferList:a}}handleTileInfoRequest(e){const t=r.TileKey.fromMortonCode(e.tileKey),i=(0,n.getProjection)(e.projection);return this.m_decoder.getTileInfo(e.data,t,i).then((e=>({response:e,transferList:void 0!==e&&void 0!==e.transferList?e.transferList:[]})))}handleConfigurationMessage(e){this.m_decoder.configure(e,e.options)}}t.TileDecoderService=c},4069:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TileInfoLoader=t.TileLoader=void 0;const n=i(8152),r=i(2344),s=i(1406),o=i(4342).LoggerManager.instance.create("TileLoader");class a extends r.BaseTileLoader{constructor(e,t,i,n,r){super(e,t),this.dataSource=e,this.tileKey=t,this.dataProvider=i,this.tileDecoder=n,this.m_taskQueue=r}get priority(){return this.m_priority}set priority(e){this.m_priority=e,this.requestController&&(this.requestController.priority=e)}loadImpl(e,t,i){this.m_taskQueue?this.m_taskQueue.add({execute:this.loadData.bind(this,e,t,i),group:r.TileTaskGroups.FETCH_AND_DECODE,getPriority:()=>{var e;return null!==(e=this.priority)&&void 0!==e?e:0},isExpired:()=>e.aborted,estimatedProcessTime:()=>1}):this.loadData(e,t,i)}cancelImpl(){this.requestController=void 0}startDecodeTile(e,t,i){const r=this.payload;void 0!==r?(this.state=s.TileLoaderState.Decoding,this.payload=void 0,0===r.byteLength||r.constructor===Object&&0===Object.keys(r).length?this.onDecoded({geometries:[],techniques:[]},t):(this.requestController=new n.RequestController(this.priority,this.loadAbortController),this.tileDecoder.decodeTile(r,this.tileKey,this.dataSource.projection,this.requestController).then((i=>{e.aborted||this.onDecoded(i,t)})).catch((e=>{"AbortError"!==e.name&&"AbortError: Aborted"!==e.message&&i(e)})))):o.error("TileLoader#startDecodeTile: Cannot decode without payload")}loadData(e,t,i){this.dataProvider.getTile(this.tileKey,e).then((n=>{if(e.aborted){const e=new Error("Aborted");throw e.name="AbortError",e}this.onLoaded(n,t,i,e)})).catch((e=>{"AbortError"!==e.name&&"AbortError: Aborted"!==e.message&&i(e)}))}onLoaded(e,t,i,n){this.state===s.TileLoaderState.Loading&&(this.state=s.TileLoaderState.Loaded,this.payload=e,this.startDecodeTile(n,t,i))}onDecoded(e,t){this.decodedTile=e,t(s.TileLoaderState.Ready)}}t.TileLoader=a,t.TileInfoLoader=class extends a{startDecodeTile(e,t,i){const r=this.payload;void 0!==r?(this.state=s.TileLoaderState.Decoding,this.requestController=new n.RequestController(this.priority),this.tileDecoder.getTileInfo(r,this.tileKey,this.dataSource.projection,this.requestController).then((i=>{e.aborted||(this.tileInfo=i,t(s.TileLoaderState.Ready))})).catch((e=>{"AbortError"!==e.name&&"AbortError: Aborted"!==e.message&&i(e)}))):o.error("TileInfoLoader#startDecodeTile: Cannot decode without payload")}}},4773:(e,t,i)=>{"use strict";
949Object.defineProperty(t,"__esModule",{value:!0}),t.TilerService=void 0;const n=i(8152),r=i(2616),s=i(1781),o=i(2369);class a extends o.WorkerService{static start(e){return new a(e)}constructor(e){super(e),this.serviceId=e,this.tiler=new s.GeoJsonTiler}handleRequest(e){return n.WorkerTilerProtocol.isRegisterIndexRequest(e)?this.handleRegisterIndexRequest(e):n.WorkerTilerProtocol.isUpdateIndexRequest(e)?this.handleUpdateIndexRequest(e):n.WorkerTilerProtocol.isTileRequest(e)?this.handleTileRequest(e):super.handleRequest(e)}async handleTileRequest(e){const t=r.TileKey.fromMortonCode(e.tileKey);return{response:await this.tiler.getTile(e.index,t)||{}}}async handleRegisterIndexRequest(e){const t="string"==typeof e.input?new URL(e.input):e.input;return await this.tiler.registerIndex(e.id,t),{response:{}}}async handleUpdateIndexRequest(e){const t="string"==typeof e.input?new URL(e.input):e.input;return this.tiler.updateIndex(e.id,t),{response:{}}}}t.TilerService=a},2369:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkerService=void 0;const n=i(8152),r=i(4342).LoggerManager.instance.create("WorkerService",{enabled:!0});t.WorkerService=class{constructor(e){this.serviceId=e,this.m_pendingRequests=new Map,this.onMessage=e=>{if("string"==typeof e.data.service&&e.data.service===this.serviceId)try{if(n.WorkerServiceProtocol.isRequestMessage(e.data)){const t=e.data,i={service:t.service,messageId:t.messageId,responseSent:!1};this.m_pendingRequests.set(t.messageId,i),this.tryHandleRequest(t.request).then((e=>{this.doSendResponse(i,{service:this.serviceId,type:n.WorkerServiceProtocol.ServiceMessageName.Response,messageId:t.messageId,response:e.response},e.transferList)})).catch((e=>{this.doSendResponse(i,{service:this.serviceId,type:n.WorkerServiceProtocol.ServiceMessageName.Response,messageId:t.messageId,errorMessage:e.toString(),errorStack:e.stack})}))}else this.tryHandleMessage(e.data)}catch(t){r.error(`[${this.serviceId}]: Unhandled exception when handling ${e.type}`)}},self.addEventListener("message",this.onMessage);const t={service:e,type:n.WorkerServiceProtocol.ServiceMessageName.Initialized};self.postMessage(t)}destroy(){this.cancelAllPendingRequests(),self.removeEventListener("message",this.onMessage)}handleMessage(e){r.error(`[${this.serviceId}]: Invalid message ${e.type}`)}handleRequest(e){throw new Error(`ServiceAdapter[${this.serviceId}]: Invalid request '${e.type}'`)}tryHandleMessage(e){try{this.handleMessage(e)}catch(t){r.error(`[${this.serviceId}]: Failed, handling message ${e.type}`)}}tryHandleRequest(e){try{return this.handleRequest(e)}catch(e){return r.error(`[${this.serviceId}]: Failure`,e),Promise.reject(e)}}doSendResponse(e,t,i){e.responseSent||(void 0!==i?self.postMessage(t,i):self.postMessage(t),e.responseSent=!0,this.m_pendingRequests.delete(e.messageId))}cancelAllPendingRequests(){this.m_pendingRequests.forEach((e=>{this.doSendResponse(e,{service:this.serviceId,type:n.WorkerServiceProtocol.ServiceMessageName.Response,messageId:e.messageId,errorMessage:"cancelled"})}))}}},5199:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkerServiceManager=void 0;const n=i(8152),r=i(2369);class s extends r.WorkerService{static getInstance(){return void 0===this.m_service&&(this.m_service=new s(n.WorkerServiceProtocol.WORKER_SERVICE_MANAGER_SERVICE_ID)),this.m_service}constructor(e=n.WorkerServiceProtocol.WORKER_SERVICE_MANAGER_SERVICE_ID){super(e),this.m_factories=new Map,this.m_services=new Map}register(e){this.m_factories.set(e.serviceType,e.factory)}handleRequest(e){if(e.type===n.WorkerServiceProtocol.Requests.CreateService){if(void 0!==this.m_services.get(e.targetServiceId))throw Error(`error - service with targetServiceId='${e.targetServiceId}' already running, ignoring CreateService request`);const t=this.m_factories.get(e.targetServiceType);if(void 0===t)throw Error(`unknown targetServiceType requested: '${e.targetServiceType}'`);const i=t(e.targetServiceId);this.m_services.set(e.targetServiceId,i)}if(e.type===n.WorkerServiceProtocol.Requests.DestroyService){const t=this.m_services.get(e.targetServiceId);if(void 0===t)throw Error(`unknown targetServiceId '${e.targetServiceId}'`);t.destroy(),this.m_services.delete(e.targetServiceId)}return Promise.resolve({response:{}})}}
949t.WorkerServiceManager=s},2344:function(e,t,i){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=this&&this.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||n(t,e,i)};Object.defineProperty(t,"__esModule",{value:!0}),t.ThemeLoader=void 0,r(i(2541),t),r(i(3509),t),r(i(7220),t),r(i(8907),t),r(i(4442),t),r(i(9978),t),r(i(207),t),r(i(5307),t),r(i(1818),t),r(i(7511),t),r(i(4549),t),r(i(8380),t),r(i(9348),t),r(i(5808),t),r(i(4757),t),r(i(4303),t),r(i(4055),t),r(i(1774),t),r(i(3103),t),r(i(5187),t),r(i(8427),t),r(i(2476),t),r(i(5071),t),r(i(2175),t),r(i(4988),t),r(i(1406),t),r(i(9237),t),r(i(5159),t),r(i(5482),t),r(i(3977),t),r(i(4247),t),r(i(3061),t),r(i(5146),t),r(i(8881),t),r(i(5738),t),r(i(8015),t),r(i(2967),t),r(i(304),t),r(i(3800),t),r(i(1797),t),t.ThemeLoader=i(6586),r(i(1447),t),r(i(5571),t),r(i(4269),t),r(i(541),t),r(i(5008),t),r(i(9931),t),r(i(3373),t),r(i(1973),t)},2541:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AnimatedExtrusionHandler=t.AnimatedExtrusionState=void 0;const n=i(8152),r=i(4250),s=i(1984),o=i(4342);var a;!function(e){e[e.None=0]="None",e[e.Started=1]="Started",e[e.Finished=2]="Finished"}(a=t.AnimatedExtrusionState||(t.AnimatedExtrusionState={})),t.AnimatedExtrusionHandler=class{constructor(e){this.m_mapView=e,this.enabled=!0,this.duration=750,this.m_minZoomLevel=1,this.m_forceEnabled=!1,this.m_dataSourceMap=new Map,this.m_state=a.None,this.m_startTime=-1}get forceEnabled(){return this.m_forceEnabled}set forceEnabled(e){this.m_forceEnabled=e,this.duration=750}get minZoomLevel(){return this.m_minZoomLevel}setAnimationProperties(e,t){if(!(0,s.isExtrudedPolygonTechnique)(e))return!1;if(e.hasOwnProperty("minZoomLevel")&&(this.m_minZoomLevel=e.minZoomLevel),this.forceEnabled)return this.enabled;void 0!==e.animateExtrusionDuration&&(this.duration=e.animateExtrusionDuration);const i=(0,n.getPropertyValue)(e.animateExtrusion,t);return null===i?this.enabled:"boolean"==typeof i?i:"number"==typeof i&&0!==i}update(e){const t=this.m_dataSourceMap.size>0&&e>=this.m_minZoomLevel;this.m_state===a.None&&t?this.m_state=a.Started:this.m_state===a.None||t||this.resetAnimation(!0),this.animateExtrusion()}add(e,t){e.addDisposeCallback(this.removeTile.bind(this));let i=!1;this.m_state!==a.None&&(i=this.skipAnimation(e),i?this.setTileExtrusionRatio(t,1):this.m_state===a.Finished&&this.resetAnimation(!1)),this.getOrCreateTileMap(e.dataSource).set(e.tileKey.mortonCode(),{materials:t,animated:i})}get isAnimating(){return this.m_state!==a.Finished&&this.m_state!==a.None}getTileMap(e,t=!1){return this.m_dataSourceMap.get(e)}getOrCreateTileMap(e){let t=this.m_dataSourceMap.get(e);return t||(t=new Map,this.m_dataSourceMap.set(e,t)),t}skipAnimation(e){return this.wasAnyAncestorAnimated(e)||this.wasAnyDescendantAnimated(e)}wasAnyAncestorAnimated(e){var t,i;const n=e.dataSource.getDataZoomLevel(this.m_minZoomLevel),r=Math.max(0,e.tileKey.level-n),s=Math.min(r,this.m_mapView.visibleTileSet.options.quadTreeSearchDistanceUp),o=this.getTileMap(e.dataSource);if(!o)return!1;let a=e.tileKey;for(let e=1;e<=s;++e)if(a=a.parent(),null!==(i=null===(t=o.get(a.mortonCode()))||void 0===t?void 0:t.animated)&&void 0!==i&&i)return!0;return!1}wasAnyDescendantAnimated(e){var t,i;const n=e.dataSource.maxDataLevel-e.tileKey.level,r=Math.min(n,this.m_mapView.visibleTileSet.options.quadTreeSearchDistanceDown),s=this.getTileMap(e.dataSource);if(!s)return!1;const o=e.dataSource.getTilingScheme();let a=[e.tileKey],l=[];for(let e=1;e<=r;++e){l.length=0;for(const e of a)for(const n of o.getSubTileKeys(e)){if(null!==(i=null===(t=s.get(n.mortonCode()))||void 0===t?void 0:t.animated)&&void 0!==i&&i)return!0;l.push(n)}[a,l]=[l,a]}return!1}removeTile(e){const t=this.getTileMap(e.dataSource);t&&(t.delete(e.tileKey.mortonCode()),0===t.size&&this.m_dataSourceMap.delete(e.dataSource))}animateExtrusion(){if(this.m_state!==a.Started)return;const e=Date.now();this.m_startTime<0&&(this.m_startTime=e);const t=this.duration,i=Math.min(e-this.m_startTime,t),n=o.MathUtils.easeInOutCubic(r.ExtrusionFeatureDefs.DEFAULT_RATIO_MIN,r.ExtrusionFeatureDefs.DEFAULT_RATIO_MAX,i/t);this.setExtrusionRatio(n),i>=t&&(this.m_state=a.Finished),this.m_mapView.update()}resetAnimation(e){this.m_state=a.None,this.m_startTime=-1,e&&this.m_dataSourceMap.forEac
949h((e=>{e.forEach((e=>{e.animated=!1}))}))}setExtrusionRatio(e){this.m_dataSourceMap.forEach((t=>{t.forEach((t=>{t.animated||(this.setTileExtrusionRatio(t.materials,e),e>=1&&(t.animated=!0))}))}))}setTileExtrusionRatio(e,t){e.forEach((e=>{e.extrusionRatio=t}))}}},5863:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BackgroundDataSource=void 0;const n=i(2616),r=i(8023),s=i(4303),o=i(8024),a=i(1447);class l extends s.DataSource{constructor(e){super({name:l.NAME,dataSourceOrder:l.GROUND_RENDER_ORDER}),this.m_backgroundColor=l.DEFAULT_COLOR,this.cacheable=!0,this.addGroundPlane=!0,this.enablePicking=!1,this.m_tilingScheme=null!=e?e:l.DEFAULT_TILING_SCHEME}get backgroundColor(){return this.m_backgroundColor}updateStorageLevelOffset(){let e;this.mapView.dataSources.forEach((t=>{t!==this&&t.getTilingScheme()===this.m_tilingScheme&&(e=void 0===e?t.storageLevelOffset:Math.max(e,t.storageLevelOffset))})),void 0===e&&(e=0),e!==this.storageLevelOffset&&(this.storageLevelOffset=e,this.mapView.clearTileCache(this.name))}async setTheme(e){if(this.mapView.clearTileCache(this.name),void 0!==e.clearColor){const t=r.Expr.fromJSON(e.clearColor,e.definitions);this.m_backgroundColor=t.isDynamic()?t:t.evaluate(this.mapView.env,r.ExprScope.Value)}else this.m_backgroundColor=l.DEFAULT_COLOR}getTilingScheme(){return this.m_tilingScheme}getTile(e){const t=new a.Tile(this,e);return t.forceHasGeometry(!0),(0,o.addGroundPlane)(t,l.GROUND_RENDER_ORDER,this.m_backgroundColor),t}}t.BackgroundDataSource=l,l.NAME="background",l.DEFAULT_COLOR=16777215,l.GROUND_RENDER_ORDER=Number.MIN_SAFE_INTEGER,l.DEFAULT_TILING_SCHEME=n.webMercatorTilingScheme},3509:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BaseTileLoader=void 0;const n=i(4342),r=i(1406),s=n.LoggerManager.instance.create("BaseTileLoader");t.BaseTileLoader=class{constructor(e,t){this.dataSource=e,this.tileKey=t,this.state=r.TileLoaderState.Initialized,this.m_priority=0,this.loadAbortController=new AbortController}get priority(){return this.m_priority}set priority(e){this.m_priority=e}loadAndDecode(){switch(this.state){case r.TileLoaderState.Loading:case r.TileLoaderState.Loaded:case r.TileLoaderState.Decoding:return this.donePromise;case r.TileLoaderState.Ready:case r.TileLoaderState.Failed:case r.TileLoaderState.Initialized:case r.TileLoaderState.Canceled:return this.startLoading(),this.donePromise}}waitSettled(){return this.donePromise?this.donePromise:Promise.resolve(this.state)}cancel(){this.isFinished||(this.loadAbortController.abort(),this.loadAbortController=new AbortController,this.cancelImpl()),this.onDone(r.TileLoaderState.Canceled)}get isFinished(){return this.state===r.TileLoaderState.Ready||this.state===r.TileLoaderState.Canceled||this.state===r.TileLoaderState.Failed}cancelImpl(){}startLoading(){(0,n.assert)(this.state!==r.TileLoaderState.Loading),this.state=r.TileLoaderState.Loading,this.loadImpl(this.loadAbortController.signal,this.onDone.bind(this),this.onError.bind(this)),void 0===this.donePromise&&(this.donePromise=new Promise(((e,t)=>{this.resolveDonePromise=e,this.rejectedDonePromise=t})))}onDone(e){this.resolveDonePromise&&e===r.TileLoaderState.Ready?this.resolveDonePromise(e):this.rejectedDonePromise&&this.rejectedDonePromise(e),this.resolveDonePromise=void 0,this.rejectedDonePromise=void 0,this.donePromise=void 0,this.state=e}onError(e){if(this.state===r.TileLoaderState.Canceled)return;const t=this.dataSource;s.error(`[${t.name}]: failed to load tile ${this.tileKey.mortonCode()}`,e),this.error=e,this.onDone(r.TileLoaderState.Failed)}}},7220:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BoundsGenerator=void 0;const n=i(2616),r=i(6313),s=i(7284);t.BoundsGenerator=class{constructor(e){this.m_view=e,this.createViewBounds()}
949generate(){return this.m_view.projection!==this.m_viewBounds.projection&&this.createViewBounds(),this.m_viewBounds.generate()}createViewBounds(){this.m_viewBounds=this.m_view.projection.type===n.ProjectionType.Planar?new r.PlaneViewBounds(this.m_view.camera,this.m_view.projection,this.m_view):new s.SphereViewBounds(this.m_view.camera,this.m_view.projection)}}},8907:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CameraMovementDetector=void 0;const n=i(82),r=i(541);t.CameraMovementDetector=class{constructor(e,t,i){this.m_throttlingTimeout=e,this.m_movementStartedFunc=t,this.m_movementFinishedFunc=i,this.m_lastCameraPos=new n.Vector3,this.m_newCameraPos=new n.Vector3,this.m_throttlingTimerId=void 0,this.m_movementDetectorDeadline=0,this.onDeadlineTimer=()=>{this.m_throttlingTimerId=void 0;const e=performance.now();e>=this.m_movementDetectorDeadline?this.movementFinished():this.startMovementFinishedTimer(e)},void 0===this.m_throttlingTimeout&&(this.m_throttlingTimeout=300)}checkCameraMoved(e,t){const i=r.MapViewUtils.extractAttitude(e,e.camera),n=e.camera.getWorldPosition(this.m_newCameraPos);if(void 0===this.m_lastAttitude)return this.m_lastCameraPos.copy(n),this.m_lastAttitude=i,!1;const s=!this.m_lastCameraPos.equals(n)||i.yaw!==this.m_lastAttitude.yaw||i.pitch!==this.m_lastAttitude.pitch||i.roll!==this.m_lastAttitude.roll;return s&&(this.m_lastCameraPos.copy(n),this.m_lastAttitude=i),s!==this.m_cameraMovedLastFrame&&(s&&this.movementStarted(),this.m_cameraMovedLastFrame=s),s&&(this.m_movementDetectorDeadline=t+this.m_throttlingTimeout,this.startMovementFinishedTimer(t)),this.m_cameraMovedLastFrame}clear(e){const t=e.camera.getWorldPosition(this.m_newCameraPos);this.m_lastCameraPos.set(t.x,t.y,t.z);const i=r.MapViewUtils.extractAttitude(e,e.camera);this.m_lastAttitude=i}forceMoved(){this.m_lastCameraPos.set(Number.NaN,Number.NaN,Number.NaN)}get cameraIsMoving(){return void 0!==this.m_throttlingTimerId}dispose(){this.removeMovementFinishedTimer(),this.m_movementStartedFunc=void 0,this.m_movementFinishedFunc=void 0}get cameraMovedLastFrame(){return!0===this.m_cameraMovedLastFrame}movementStarted(){void 0!==this.m_movementStartedFunc&&this.m_movementStartedFunc()}movementFinished(){this.removeMovementFinishedTimer(),void 0!==this.m_movementFinishedFunc&&this.m_movementFinishedFunc()}startMovementFinishedTimer(e){if(void 0===this.m_throttlingTimerId){const t=Math.max(0,this.m_movementDetectorDeadline-e);this.m_throttlingTimerId=setTimeout(this.onDeadlineTimer,t)}}removeMovementFinishedTimer(){void 0!==this.m_throttlingTimerId&&(clearTimeout(this.m_throttlingTimerId),this.m_throttlingTimerId=void 0)}}},4442:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CameraUtils=void 0;const n=i(82),r=i(4342),s=i(3103);function o(e,t,i){return(0,r.assert)(e>0,"Focal length must be larger than 0"),Math.atan((1-t)*i*.5/e)}function a(e,t,i){return(0,r.assert)(e>0,"Focal length must be larger than 0"),0===t?2*Math.atan(.5*i/e):o(e,t,i)+o(e,-t,i)}function l(e){return e.userData.fovs}function c(e,t,i,r,l){const c=r*e.aspect;let u=a(i,t.x,c);if((u<s.MIN_FOV_RAD||u>s.MAX_FOV_RAD)&&(u=n.MathUtils.clamp(u,s.MIN_FOV_RAD,s.MAX_FOV_RAD),l=a(h(u,c,t.x),t.y,r)),e.fov=n.MathUtils.radToDeg(l),0===(d=t).x&&0===d.y)delete e.userData.fovs;else{const n=r*e.aspect;e.userData.fovs={top:o(i,t.y,r),right:o(i,t.x,n),horizontal:u}}var d;e.userData.focalLength=i}function h(e,t,i){const n=t/2;if(0===i)return n/Math.tan(e/2);const s=i**2;if(Math.abs(e-Math.PI/2)<1e-6)return n*Math.sqrt(1-s);const o=Math.tan(e),a=n*(1+Math.sign(o)*Math.sqrt(1+o**2*(1-s)))/o;return(0,r.assert)(a>=0,"Focal length must be larger than 0"),a}!function(e){function t(e){var t;return null===(t=e.userData)||void 0===t?void 0:t.focalLength}function i(e){return n.MathUtils.degToRad(e.fov)}function r(e,t,r){t=n.MathUtils.clamp(t,s.MIN_FOV_RAD,s.MAX_FOV_RAD);const a=o(e);return c(e,a,h(t,r,a.y),r,t),i(e)}function o(e,t=new n.Vector2){return t.x=-e.projectionMatrix.elements[8],t.y=-e.projectionMatrix.elements[9],t}function u(e){var t,i;return null!==(i=null===(t=l(e))||void 0===t?void 0:t.horizontal)&&void 0!==i?i:2*Math.atan(Math.tan(n.MathUtils.degToRad(e.fov)/2)*e.aspect)}function d(e){var t,i;return null!==(i=null===(t=l(e))||void 0===t?void 0:t.top)&&void 0!==i?i:n.MathUtils.degToRad(e.fov/2)}function m(e){var t,i;return null!==(i=null===(t=l(e))||void 0===t?void 0:t.right)&&void 0!==i?i:u(e)/2}e.getFocalLength=t,e.setFocalLength=function(e,i,n){const l=o(e),h=a(i,l.y,n);return h<s.MIN_FOV_RAD||h>s.MAX_FOV_RAD?r(e,h,n):c(e,l,i,n,h),t(e)},e.getVerticalFov=i,e.setVerticalFov=r,e.convertWorldToScreenSize=function(e,t,i){return e*i/t},e.convertScreenToWorldSize=function(e,t,i){return t*i/e},e.getPrincipalPoint=o,e.setPrincipalPoint=function(e,t){const i=e.aspect,r=.999999;e.setViewOffset(i,1,-n.MathUtils.clamp(t.x,-.999999,r)*i/2,1*n.MathUtils.clamp(t.y,-.999999,r)/2,i,1)},e.getHorizontalFov=u,e.getTopFov=d,e.getBottomFov=function(e){return n.MathUtils.degToRad(e.fov)-d(e)},e.getRightFov=m,e.getLeftFov=function(e){var t;return void 0!==(null===(t=l(e))||void 0===t?void 0:t.right)?u(e)-m(e):u(e)/2}}(t.CameraUtils||(t.CameraUtils={}))},9978:(e,t,i)=>{"use strict";
949Object.defineProperty(t,"__esModule",{value:!0}),t.createDefaultClipPlanesEvaluator=t.TiltViewClipPlanesEvaluator=t.TopViewClipPlanesEvaluator=t.ElevationBasedClipPlanesEvaluator=void 0;const n=i(82),r=i(2616),s=i(4342),o=i(4442),a=i(541),l=1e-6;var c;!function(e){const t=[new n.Vector3,new n.Vector3],i=new n.Raycaster,s=new n.Sphere(new n.Vector3,r.EarthConstants.EQUATORIAL_RADIUS);function o(e,t){return e-t<l?0:Math.sqrt(e*e-t*t)}e.getFarDistanceFromElevatedHorizon=function(t,i,n,r){const s=o(i,n),a=o(r,n),l=Math.asin(n/i),c=Math.abs(l-e.getNormalToFwdAngle(t));return Math.cos(c)*(s+a)},e.getProjNearPlaneTanDistance=function(e,i,n){const r=e.getWorldDirection(t[0]),s=t[1].copy(r).multiplyScalar(-n).sub(e.position),o=s.dot(r);return o/s.length()>Math.cos(i)?o:void 0},e.getProjSphereIntersectionDistance=function(e,n,r){i.setFromCamera(n,e),s.radius=r;const o=i.ray.intersectSphere(s,t[0]);return null!==o?o.sub(e.position).dot(e.getWorldDirection(t[1])):void 0},e.getNormalToFwdAngle=function(e){const i=t[0].copy(e.position).negate().normalize().dot(e.getWorldDirection(t[1]));return Math.acos(n.MathUtils.clamp(i,-1,1))}}(c||(c={}));class h{constructor(e,t){(0,s.assert)(e>=t),this.m_minElevation=t,this.m_maxElevation=e}set maxElevation(e){this.m_maxElevation=e,this.m_minElevation=Math.min(e,this.m_minElevation)}get maxElevation(){return this.m_maxElevation}set minElevation(e){this.m_minElevation=e,this.m_maxElevation=Math.max(e,this.m_maxElevation)}get minElevation(){return this.m_minElevation}}t.ElevationBasedClipPlanesEvaluator=h;class u extends h{constructor(e=r.EarthConstants.MAX_BUILDING_HEIGHT,t=0,i=1,o=.05,a=6){super(e,t),this.nearMin=i,this.nearFarMarginRatio=o,this.farMaxRatio=a,this.m_tmpVectors=[new n.Vector3,new n.Vector3,new n.Vector3],this.m_tmpQuaternion=new n.Quaternion,(0,s.assert)(i>0),(0,s.assert)(o>=0),(0,s.assert)(a>1);const l=o*i;this.m_minimumViewRange={near:i,far:i+l,minimum:this.nearMin,maximum:Math.max(i*a,i+l)}}evaluateClipPlanes(e,t,i){(0,s.assert)(e instanceof n.PerspectiveCamera,"Unsupported camera type.");const o=e;return t.type===r.ProjectionType.Spherical?this.evaluateDistanceSphericalProj(o,t,i):t.type===r.ProjectionType.Planar?this.evaluateDistancePlanarProj(o,t,i):((0,s.assert)(!1,"Unsupported projection type"),Object.assign({},this.minimumViewRange))}get minimumViewRange(){return this.m_minimumViewRange}evaluateDistancePlanarProj(e,t,i){(0,s.assert)(t.type!==r.ProjectionType.Spherical);let n=this.nearMin,o=this.nearMin*this.farMaxRatio;const a=t.groundDistance(e.position),l=a*this.farMaxRatio;n=a-this.maxElevation,o=a-this.minElevation,n=Math.max(n,this.nearMin),o=Math.min(o,l);const c=this.nearFarMarginRatio*(n+o)/2;return n=Math.max(n-c/2,this.nearMin),o=Math.max(o+c/2,n+c),{near:n,far:o,minimum:this.nearMin,maximum:Math.max(l,o)}}evaluateDistanceSphericalProj(e,t,i){(0,s.assert)(t.type===r.ProjectionType.Spherical);const o=t.groundDistance(e.position);let h=o-this.maxElevation;const u=r.EarthConstants.EQUATORIAL_RADIUS,d=Math.max(l,e.position.length()),m=Math.asin(u/d);let p=n.MathUtils.degToRad(e.fov/2);e.aspect>1&&(p=a.MapViewUtils.calculateHorizontalFovByVerticalFov(2*p,e.aspect));const f=u+this.maxElevation,g=c.getFarDistanceFromElevatedHorizon(e,d,u,f);let v=p>m?g:this.getFovBasedFarPlane(e,d,u,2*p,t);const y=o-this.minElevation,_=o*this.farMaxRatio;h=Math.max(h,this.nearMin),v=Math.max(v,y);const x=this.nearFarMarginRatio*(h+v)/2;return h=Math.max(h-x/2,this.nearMin),v=Math.max(v+x/2,h+x),{near:h,far:v,minimum:this.nearMin,maximum:_}}getFovBasedFarPlane(e,t,i,n,r){const o=e.position;e.matrixWorld.extractBasis(this.m_tmpVectors[0],this.m_tmpVectors[1],this.m_tmpVectors[2]),this.m_tmpQuaternion.setFromAxisAngle(this.m_tmpVectors[0],n/2);const a=this.m_tmpVectors[2],l=this.m_tmpVectors[1].copy(a).applyQuaternion(this.m_tmpQuaternion),c=o.dot(l);if(c<0)return r.groundDistance(e.position)*this.farMaxRatio;const h=o.dot(o)-c*c,u=i*i;return(0,s.assert)(h<=u,"Please use this evaluator only for top view camera poses."),c-Math.sqrt(u-h)}}t.TopViewClipPlanesEvaluator=u;class d extends u{constructor(){super(...arguments),this.m_tmpV2=new n.Vector2}evaluateDistancePlanarProj(e,t,i){(0,s.assert)(t.type!==r.ProjectionType.Spherical);const c=Object.assign({},this.minimumViewRange),h=Math.PI/2-l,u=t.groundDistance(e.position),d=a.MapViewUtils.extractCameraTilt(e,t),m=o.CameraUtils.getTopFov(e),p=o.CameraUtils.getBottomFov(e),f=n.MathUtils.clamp(d+m,-h,h),g=n.MathUtils.clamp(d-p,-h,h),v=Math.max(0,(u-this.minElevation)/Math.cos(f)),y=Math.max(0,(u-this.maxElevation)/Math.cos(g));return c.near=y*Math.cos(p),c.far=v*Math.cos(m),this.applyViewRangeConstraints(c,e,t,i)}evaluateDistanceSphericalProj(e,t,i){(0,s.assert)(t.type===r.ProjectionType.Spherical);const n=Object.assign({},this.minimumViewRange);return n.near=this.computeNearDistSphericalProj(e,t),n.far=this.computeFarDistSphericalProj(e,t),this.applyViewRangeConstraints(n,e,t,i)}computeNearDistSphericalProj(e,t){(0,s.assert)(t.type===r.ProjectionType.Spherical);const i=t.groundDistance(e.position)-this.maxElevation;if(i<=0)return 0;const n=r.EarthConstants.EQUATORIAL_RADIUS+this.maxElevation,a=o.CameraUtils.getBottomFov(e),l=c.getProjNearPlaneTanDistance(e,a,n);if(void 0!==l)return l;o.CameraUtils.getPrincipalPoint(e,this.m_tmpV2);const h=this.m_tmpV2.y>0,u=c.getProjSphereIntersectionDistance(e,this.m_tmpV2.setComponent(1,-1),n),d=h?c.getProjSphereIntersectionDistance(e,this.m_tmpV2.setComponent(1,1),n):1/0,m=Math.min(null!=u?u:1/0,null!=d?d:1/0);return(0,s.assert)(m!==1/0,"No reference point for near distance found"),null!=m?m:i}computeFarDistSphericalProj(e,t){(0,s.assert)(t.type===r.ProjectionType.Spherical);const i=r.EarthConstants.EQUATORIAL_RADIUS,n=i+this.minElevation,a=i+this.maxElevation,l=e.position.length();o.CameraUtils.getPrincipalPoint(e,this.m_tmpV2);const h=this.m_tmpV2.x<=0?1:-1,u=this.m_tmpV2.y>0,d=c.getProjSphereIntersectionDistance(e,this.m_tmpV2.set(h,1),n),m=u?c.getProjSphereIntersectionDistance(e,this.m_tmpV2.set(h,-1),n):0,p=Math.max(null!=d?d:1/0,null!=m?m:1/0);return p!==1/0?p:c.getFarDistanceFromElevatedHorizon(e,l,i,a)}applyViewRangeConstraints(e,t,i,r){const{distance:s}=a.MapViewUtils.getTargetAndDistance(i,t,r),o=i.groundDistance(t.position)-this.minElevation,l=s*this.farMax
949Ratio;e.near=Math.max(e.near,this.nearMin),e.far=n.MathUtils.clamp(e.far,o,l);const c=this.nearFarMarginRatio*(e.near+e.far)/2;return e.near=Math.max(e.near-c/2,this.nearMin),e.far=Math.max(e.far+c/2,e.near+c),e.minimum=this.nearMin,e.maximum=l,e}}t.TiltViewClipPlanesEvaluator=d,t.createDefaultClipPlanesEvaluator=()=>new d},207:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ColorCache=void 0;const n=i(82);class r{constructor(){this.m_map=new Map}static get instance(){return this.m_instance}getColor(e){"number"==typeof e&&(e="#"+e.toString(16).padStart(6,"0"));let t=this.m_map.get(e);return void 0!==t||(t=new n.Color(e),this.m_map.set(e,t)),t}get size(){return this.m_map.size}clear(){this.m_map.clear()}}t.ColorCache=r,r.m_instance=new r},1818:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConcurrentDecoderFacade=void 0;const n=i(7685),r=i(9931);class s{static getTileDecoder(e,t,i,n){const s=this.getWorkerSet(t,i,n);return new r.WorkerBasedDecoder(s,e)}static getWorkerSet(e,t,i){void 0===e&&(e=this.defaultScriptUrl);let r=this.workerSets[e];if(void 0===r){const s=void 0!==i?1e3*i:void 0;r=new n.ConcurrentWorkerSet({scriptUrl:e,workerCount:null!=t?t:this.defaultWorkerCount,workerConnectionTimeout:s}),this.workerSets[e]=r}return r}static destroyWorkerSet(e){const t=this.workerSets[e];void 0!==t&&(t.destroy(),delete this.workerSets[e])}static destroy(){Object.keys(this.workerSets).forEach((e=>{this.workerSets[e].destroy()})),this.workerSets={}}static destroyIfTerminated(){let e=!0;Object.keys(this.workerSets).forEach((t=>{this.workerSets[t].terminated||(e=!1)})),e&&s.destroy()}}t.ConcurrentDecoderFacade=s,s.defaultScriptUrl="./decoder.bundle.js",s.defaultWorkerCount=void 0,s.workerSets={}},7511:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConcurrentTilerFacade=void 0;const n=i(7685),r=i(3373);class s{static getTiler(e,t,i,n){const s=this.getWorkerSet(t,i,n);return new r.WorkerBasedTiler(s,e)}static getWorkerSet(e,t,i){void 0===e&&(e=this.defaultScriptUrl);let r=this.workerSets[e];if(void 0===r){const s=void 0!==i?1e3*i:void 0;r=new n.ConcurrentWorkerSet({scriptUrl:e,workerCount:null!=t?t:this.defaultWorkerCount,workerConnectionTimeout:s}),this.workerSets[e]=r}return r}static destroyWorkerSet(e){const t=this.workerSets[e];void 0!==t&&(t.destroy(),delete this.workerSets[e])}static destroy(){Object.keys(this.workerSets).forEach((e=>{this.workerSets[e].destroy()})),this.workerSets={}}static destroyIfTerminated(){let e=!0;Object.keys(this.workerSets).forEach((t=>{this.workerSets[t].terminated||(e=!1)})),e&&s.destroy()}}t.ConcurrentTilerFacade=s,s.defaultScriptUrl="./decoder.bundle.js",s.defaultWorkerCount=1,s.workerSets={}},7685:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConcurrentWorkerSet=t.DEFAULT_WORKER_INITIALIZATION_TIMEOUT=t.isLoggingMessage=void 0;const n=i(82),r=i(8152),s=i(4342),o=i(1973),a=s.LoggerManager.instance.create("ConcurrentWorkerSet");function l(e){return e&&"number"==typeof e.level&&e.type===s.WORKERCHANNEL_MSG_TYPE}t.isLoggingMessage=l,t.DEFAULT_WORKER_INITIALIZATION_TIMEOUT=1e4,t.ConcurrentWorkerSet=class{constructor(e){this.m_options=e,this.m_workerChannelLogger=s.LoggerManager.instance.create("WorkerChannel"),this.m_eventListeners=new Map,this.m_workers=new Array,this.m_availableWorkers=new Array,this.m_workerPromises=new Array,this.m_readyPromises=new Map,this.m_requests=new Map,this.m_workerRequestQueue=[],this.m_nextMessageId=0,this.m_stopped=!0,this.m_referenceCount=0,this.onWorkerMessage=(e,t)=>{if(r.WorkerServiceProtocol.isResponseMessage(t.data)){const i=t.data;if(null===i.messageId)return void a.error(`[${this.m_options.scriptUrl}]: Bad ResponseMessage: no messageId`);const n=this.m_requests.get(i.messageId);if(void 0===n)return void a.error(`[${this.m_options.scriptUrl}]: Bad ResponseMessage: invalid messageId`);if(e>=0&&e<this.m_workers.length){const t=this.m_workers[e];this.m_availableWorkers.push(t),this.checkWorkerRequestQueue()}else a.error(`[${this.m_options.scriptUrl}]: onWorkerMessage: invalid workerId`);if(void 0!==i.errorMessage){const e=new Error(i.errorMessage);void 0!==i.errorStack&&(e.stack=i.errorStack),n.resolver(e)}else n.resolver(void 0,i.response)}
949else if(r.WorkerServiceProtocol.isInitializedMessage(t.data)){const e=this.getReadyPromise(t.data.service);++e.count===this.m_workerPromises.length&&e.resolve()}else if(l(t.data))switch(t.data.level){case s.LogLevel.Trace:this.m_workerChannelLogger.trace(...t.data.message);break;case s.LogLevel.Debug:this.m_workerChannelLogger.debug(...t.data.message);break;case s.LogLevel.Log:this.m_workerChannelLogger.log(...t.data.message);break;case s.LogLevel.Info:this.m_workerChannelLogger.info(...t.data.message);break;case s.LogLevel.Warn:this.m_workerChannelLogger.warn(...t.data.message);break;case s.LogLevel.Error:this.m_workerChannelLogger.error(...t.data.message)}else this.eventHandler(t)},this.start()}addReference(){this.m_referenceCount+=1,1===this.m_referenceCount&&this.m_stopped&&this.start()}removeReference(){this.m_referenceCount-=1,0===this.m_referenceCount&&this.destroy()}start(e){if(void 0!==e&&(this.m_options=e),!this.m_stopped)throw new Error("ConcurrentWorker set already started");this.m_workerCount=(0,s.getOptionValue)(this.m_options.workerCount,"undefined"!=typeof navigator&&void 0!==navigator.hardwareConcurrency?n.MathUtils.clamp(navigator.hardwareConcurrency-1,1,2):void 0,2);const i=(0,s.getOptionValue)(this.m_options.workerConnectionTimeout,t.DEFAULT_WORKER_INITIALIZATION_TIMEOUT),r=this.m_workers,a=this.m_availableWorkers;for(let e=0;e<this.m_workerCount;++e){const t=o.WorkerLoader.startWorker(this.m_options.scriptUrl,i).then((t=>{const i=t=>{this.onWorkerMessage(e,t)};return t.addEventListener("message",i),r.push(t),a.push(t),{worker:t,listener:i}}));this.m_workerPromises.push(t)}this.m_stopped=!1}get workerCount(){return this.m_workerCount}async stop(){this.m_stopped=!0,await this.waitForAllResponses().then((()=>{this.terminateWorkers()}))}destroy(){this.m_stopped=!0,this.m_requests.forEach((e=>{e.resolver(new Error("worker destroyed"))})),this.m_requests.clear(),this.m_workerRequestQueue=[],this.terminateWorkers(),this.m_eventListeners.clear()}get terminated(){return 0===this.m_workers.length}async connect(e){return this.ensureStarted(),await Promise.all(this.m_workerPromises),await this.getReadyPromise(e).promise}addEventListener(e,t){this.m_eventListeners.set(e,t)}removeEventListener(e){this.m_eventListeners.delete(e)}
949invokeRequest(e,t,i,n){this.ensureStarted();const s=this.m_nextMessageId++;let o;const a=new Promise(((e,t)=>{o=(i,n)=>{this.m_requests.delete(s),void 0!==i?t(i):e(n)}}));this.m_requests.set(s,{promise:a,resolver:o});const l={service:e,type:r.WorkerServiceProtocol.ServiceMessageName.Request,messageId:s,request:t};return this.postRequestMessage(l,i,n),a}broadcastRequest(e,t,i){const n=[];for(const s of this.m_workers){const o=this.m_nextMessageId++;let a;const l=new Promise(((e,t)=>{a=(i,n)=>{this.m_requests.delete(o),void 0!==i?t(i):e(n)}}));n.push(l),this.m_requests.set(o,{promise:l,resolver:a});const c={service:e,type:r.WorkerServiceProtocol.ServiceMessageName.Request,messageId:o,request:t};void 0!==i?s.postMessage(c,i):s.postMessage(c)}return Promise.all(n)}broadcastMessage(e,t){this.ensureStarted(),void 0!==t?this.m_workers.forEach((i=>i.postMessage(e,t))):this.m_workers.forEach((t=>t.postMessage(e)))}get requestQueueSize(){return this.m_workerRequestQueue.length}get numWorkers(){return this.m_workers.length}get numIdleWorkers(){return this.m_availableWorkers.length}eventHandler(e){"string"==typeof e.data.type&&this.dispatchEvent(e.data.type,e)}postRequestMessage(e,t,i){if(this.ensureStarted(),0===this.m_workers.length)throw new Error("ConcurrentWorkerSet#postMessage: no workers started");if(void 0!==i&&i.signal.aborted){const t=this.m_requests.get(e.messageId);if(void 0===t)return void a.error(`[${this.m_options.scriptUrl}]: Bad RequestMessage: invalid messageId`);const i=new Error("Aborted");return i.name="AbortError",void t.resolver(i,void 0)}if(this.m_availableWorkers.length>0){const i=this.m_availableWorkers.pop();void 0!==t?i.postMessage(e,t):i.postMessage(e)}else void 0===i&&(i=new r.RequestController(0)),0===i.priority&&(i.priority=-this.m_nextMessageId),this.m_workerRequestQueue.unshift({message:e,buffers:t,requestController:i})}ensureStarted(){if(this.m_stopped)throw new Error("ConcurrentWorkerSet stopped")}async waitForAllResponses(){const e=new Array;this.m_requests.forEach((t=>{e.push(t.promise)})),await Promise.all(e)}dispatchEvent(e,t){const i=this.m_eventListeners.get(e);void 0!==i&&i(t)}terminateWorkers(){this.m_workerPromises.forEach((e=>{e.then((e=>{void 0!==e&&(e.worker.removeEventListener("message",e.listener),e.worker.terminate())}))})),this.m_workers=[],this.m_availableWorkers=[],this.m_workerPromises=[],this.m_readyPromises.clear()}getReadyPromise(e){const t=this.m_readyPromises.get(e);if(void 0!==t)return t;const i={count:0,promise:void 0,resolve:()=>{},reject:e=>{i.error=e},error:void 0};return i.promise=new Promise(((e,t)=>{const n=i;void 0!==n.error?t(n.error):n.count===this.m_workerPromises.length&&e(),n.resolve=e,n.reject=t})),this.m_readyPromises.set(e,i),i}checkWorkerRequestQueue(){if(0!==this.m_workerRequestQueue.length&&0!==this.m_availableWorkers.length)for(this.m_workerRequestQueue.sort(((e,t)=>e.requestController.priority-t.requestController.priority));this.m_availableWorkers.length>0&&this.m_workerRequestQueue.length>0;){const e=this.m_workerRequestQueue.pop();this.postRequestMessage(e.message,e.buffers,e.requestController)}}}},4303:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DataSource=void 0;const n=i(82),r=i(8797),s=i(4342),o=s.LoggerManager.instance.create("DataSource");class a extends n.EventDispatcher{constructor(e={}){super(),this.UPDATE_EVENT={type:"update"},this.enabled=!0,this.cacheable=!1,this.useGeometryLoader=!1,this.addGroundPlane=!1,this.minDataLevel=1,this.maxDataLevel=20,this.minDisplayLevel=0,this.maxDisplayLevel=22,this.allowOverlappingTiles=!0,this.enablePicking=!0,this.dataSourceOrder=0,this.exprPool=new r.ExprPool,this.m_maxGeometryHeight=0,this.m_minGeometryHeight=0,this.m_storageLevelOffset=0,this.m_featureStateMap=new Map;let{name:t}=e;const{layerNames:i,languages:n,minZoomLevel:s,maxZoomLevel:o,minDataLevel:l,maxDataLevel:c,minDisplayLevel:h,maxDisplayLevel:u,storageLevelOffset:d,allowOverlappingTiles:m,enablePicking:p,minGeometryHeight:f,maxGeometryHeight:g,dataSourceOrder:v}=e;void 0!==t&&0!==t.length||(t="anonymous-datasource#"+ ++a.uniqueNameCounter),this.name=t,this.layerNames=i,this.m_languages=n,void 0!==l&&(this.minDataLevel=l),void 0!==c&&(this.maxDataLevel=c),void 0!==s&&(this.minZoomLevel=s),void 0!==o&&(this.maxZoomLevel=o),void 0!==h&&(this.minDisplayLevel=h),void 0!==u&&(this.maxDisplayLevel=u),void 0!==d&&(this.m_storageLevelOffset=d),void 0!==m&&(this.allowOverlappingTiles=m),void 0!==p&&(this.enablePicking=p),void 0!==f&&(this.minGeometryHeight=f),void 0!==g&&(this.maxGeometryHeight=g),v&&(this.dataSourceOrder=v)}getFeatureState(e){return this.m_featureStateMap.get(e)}clearFeatureState(){this.m_featureStateMap.clear()}setFeatureState(e,t){this.m_featureStateMap.set(e,t)}removeFeatureState(e){this.m_featureStateMap.delete(e)}get layerNames(){return this.m_layerNames}
949set layerNames(e){l(e,this.m_layerNames)||(this.m_layerNames=e,this.clearCache(),this.requestUpdate())}dispose(){}clearCache(){}isFullyCovering(){return this.addGroundPlane}ready(){return!0}get mapView(){if(void 0===this.m_mapView)throw new Error("This DataSource "+this.name+" was not added to MapView");return this.m_mapView}get projection(){return this.mapView.projection}async connect(){}attach(e){this.m_mapView=e}detach(e){(0,s.assert)(this.m_mapView===e),this.m_mapView=void 0}isDetached(){return void 0===this.m_mapView}async setTheme(e){}set languages(e){this.m_languages=e}get languages(){return this.m_languages}setPoliticalView(e){}updateTile(e){}shouldPreloadTiles(){return!1}get minZoomLevel(){return o.warn("DataSource.minZoomLevel is deprecated. Use minDataLevel and maxDataLevel instead."),this.minDataLevel}set minZoomLevel(e){o.warn("DataSource.minZoomLevel is deprecated. Use minDataLevel and minDisplayLevel instead."),this.minDataLevel=e}get maxZoomLevel(){return o.warn("DataSource.maxZoomLevel is deprecated. Use maxDataLevel and maxDisplayLevel instead."),this.maxDataLevel}set maxZoomLevel(e){o.warn("DataSource.maxZoomLevel is deprecated. Use maxDataLevel and maxDisplayLevel instead."),this.maxDataLevel=e}get maxGeometryHeight(){return this.m_maxGeometryHeight}set maxGeometryHeight(e){this.m_maxGeometryHeight=e}get minGeometryHeight(){return this.m_minGeometryHeight}set minGeometryHeight(e){this.m_minGeometryHeight=e}get storageLevelOffset(){return this.m_storageLevelOffset}set storageLevelOffset(e){this.m_storageLevelOffset=e}setEnableElevationOverlay(e){}getDataZoomLevel(e){return n.MathUtils.clamp(e+this.m_storageLevelOffset,this.minDataLevel,this.maxDataLevel)}isVisible(e){return e>=this.minDisplayLevel&&e<=this.maxDisplayLevel}canGetTile(e,t){return t.level<=e}shouldSubdivide(e,t){return t.level<=e}shouldRenderText(e,t){return!0}requestUpdate(){this.dispatchEvent(this.UPDATE_EVENT)}}t.DataSource=a,a.uniqueNameCounter=0;const l=(e,t)=>{let i=e===t;if(!i&&e&&t){let n=e.length;if(t.length===n)for(i=!0;i&&n--;)i=t.includes(e[n])}return i}},507:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.debugContext=t.DebugContext=void 0;const n=i(82),r="undefined"==typeof window;class s extends n.EventDispatcher{constructor(e){super(),this.value=e}set(e,t){this.value=e,this.dispatchEvent({type:s.SET_EVENT_TYPE,name:t,value:e})}}s.SET_EVENT_TYPE="set";class o{constructor(){this.m_optionsMap=new Map,!r&&"undefined"!=typeof window&&window&&(window.__debugContext=this)}setValue(e,t){let i=this.m_optionsMap.get(e);i?i.set(t,e):(i=new s(t),this.m_optionsMap.set(e,i))}getValue(e){const t=this.m_optionsMap.get(e);return t?t.value:void 0}hasOption(e){return void 0!==this.m_optionsMap.get(e)}addEventListener(e,t){const i=this.m_optionsMap.get(e);if(!i)throw Error("Unknown option: "+e);i.addEventListener(s.SET_EVENT_TYPE,t)}hasEventListener(e,t){const i=this.m_optionsMap.get(e);if(i)return i.hasEventListener(s.SET_EVENT_TYPE,t);throw Error("Unknown option: "+e)}removeEventListener(e,t){const i=this.m_optionsMap.get(e);if(!i)throw Error("Unknown option: "+e);i.removeEventListener(s.SET_EVENT_TYPE,t)}get options(){return this.m_optionsMap}clear(){this.m_optionsMap.forEach((e=>{e.set(void 0,"")}))}}t.DebugContext=o,t.debugContext=new o},8427:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.evaluateColorProperty=t.applySecondaryColorToMaterial=t.evaluateBaseColorProperty=t.buildMetricValueEvaluator=t.buildObject=t.usesObject3D=t.getBufferAttribute=t.createMaterial=void 0;const n=i(82),r=i(8152),s=i(5535),o=i(4250),a=i(5562),l=i(1984),c=i(1667),h=i(8023),u=i(6331),d=i(4342),m=i(946),p=i(8673),f=i(7063),g=i(176),v=i(3977),y=i(5146),_=d.LoggerManager.instance.create("DecodedTileHelpers");function x(e,t,i){return e[i]=t,e.needsUpdate=!0,t}const b=new n.Texture;function w(e,t,i,n,r){return new Promise(((s,o)=>{const a=(0,f.loadTexture)(t,r.textureCache,n,r.renderer,s,o);a&&x(e,a,i)}))}const M=new n.Vector2;function T(e,t){return null==e?e:("string"==typeof e&&(e.endsWith("px")?(t="Pixel",e=Number.parseFloat(e)):e.endsWith("m")&&(e=Number.parseFloat(e))),"Pixel"===t?t=>{var i;return(null!==(i=t.env.lookup("$pixelToMeters"))&&void 0!==i?i:1)*(0,r.getPropertyValue)(e,t.env)}:e)}function S(e,t){if(e=function(e,t){return void 0!==t&&h.Expr.isExpr(e)&&(e=(0,r.getPropertyValue)(e,t)),e}(e,t),null!=e){if("number"==typeof e)return e;if("string"==typeof e){const t=(0,u.parseStringEncodedColor)(e);if(void 0!==t)return t}if(null==e?void 0:e.isRGBA)return c.ColorUtils.getHexFromRgba(e.r,e.g,e.b,e.a);_.error(`Unsupported color format: '${e}'`)}}t.createMaterial=function(e,t,i){const c=function(e,t){if(void 0!==e.name)switch(e.name){case"extruded-line":if(!(0,l.isExtrudedLineTechnique)(e))throw new Error("Invalid extruded-line technique");return"standard"===e.shading?o.MapMeshStandardMaterial:o.MapMeshBasicMaterial;case"standard":case"terrain":return o.MapMeshStandardMaterial;case"extruded-polygon":return o.MapMeshPhongMaterial;case"dashed-line":case"solid-line":return o.SolidLineMaterial;case"polygon":return t?o.MapMeshStandardMaterial:o.MapMeshBasicMaterial;case"squares":return n.PointsMaterial;case"circles":return o.CirclePointsMaterial;case"line":case"segments":return n.LineBasicMaterial;case"raster":case"text":case"labeled-icon":case"line-marker":case"label-rejection-line":return}}(e,!0===(null==i?void 0:i.shadowsEnabled)),u={};if(void 0===c)return;c.prototype instanceof o.RawShaderMaterial&&(u.rendererCapabilities=t.renderer.capabilities,c!==o.HighPrecisionLineMaterial&&(u.fog=null==i?void 0:i.fog)),!0===(null==i?void 0:i.shadowsEnabled)&&"polygon"===e.name&&(u.removeDiffuseLight=!0);const m=new c(u);if(void 0!==e.id&&(m.name=e.id),(0,l.isExtrudedPolygonTechnique)(e)&&(m.flatShading=!0),(0,a.needsCanvasSize)(m)){const e=t.renderer.domElement;m.canvasSize=M.set(e.width,e.height),m.onResizeListener=()=>{const e=t.renderer.domElement;m.canvasSize=M.set(e.width,e.height)},m.onResizeTarget=t,m.onResizeTarget.addEventListener(v.MapViewEventNames.Resize,m.onResizeListener)}m.depthTest=(0,l.isExtrudedPolygonTechnique)(e)&&!1!==e.depthTest;const p=[];let f=!0;
949(0,l.supportsTextures)(e)&&l.TEXTURE_PROPERTY_KEYS.forEach((i=>{const n=function(e,t,i,n){let s=i[t];if(void 0===s)return Promise.reject(new Error(`textureProperty for texturePropertyName ${t} in technique ${i.name} is undefined`));if(h.Expr.isExpr(s)&&(s=(0,r.getPropertyValue)(s,n.env),!s))return Promise.resolve(x(e,b,t));if(!(0,l.isSolidLineTechnique)(i)){const r=i[t+"Properties"];return w(e,s,t,r,n)}return x(e,b,t),n.imageRepo.loadImage(s).then((i=>(null==i?void 0:i.imageItem.image)?w(e,null==i?void 0:i.imageItem.image,t,{minFilter:"linear",magFilter:"linear"},n):void 0))}(m,i,e,t).catch((e=>{f=!1}));p.push(n)}));const y=Promise.all(p).then((()=>Promise.resolve(f)));return g.MapMaterialAdapter.create(m,function(e){var t;const i=(0,s.getTechniqueAutomaticAttrs)(e);switch(e.name){case"dashed-line":case"solid-line":{const n=(0,d.pick)(e,i);return n.width=T(null!==(t=e.width)&&void 0!==t?t:0,e.metricUnit),n.offset=T(e.offset,e.metricUnit),n}case"polygon":case"circles":case"squares":case"line":case"segments":return(0,d.pick)(e,i);case"standard":case"terrain":case"extruded-polygon":{const t=(0,d.pick)(e,i);return!0!==e.vertexColors&&(t.color=e.color),t}case"extruded-line":return(0,d.pick)(e,["color","wireframe","transparent","opacity","polygonOffset","polygonOffsetFactor","polygonOffsetUnits",...i]);case"raster":return(0,d.pick)(e,["brightness","gamma"]);default:return{}}}(e)),{material:m,texturesReady:y}},t.getBufferAttribute=function(e){switch(e.type){case"float":return new n.BufferAttribute(new Float32Array(e.buffer),e.itemCount);case"uint8":return new n.BufferAttribute(new Uint8Array(e.buffer),e.itemCount,e.normalized);case"uint16":return new n.BufferAttribute(new Uint16Array(e.buffer),e.itemCount,e.normalized);case"uint32":return new n.BufferAttribute(new Uint32Array(e.buffer),e.itemCount,e.normalized);case"int8":return new n.BufferAttribute(new Int8Array(e.buffer),e.itemCount,e.normalized);case"int16":return new n.BufferAttribute(new Int16Array(e.buffer),e.itemCount,e.normalized);case"int32":return new n.BufferAttribute(new Int32Array(e.buffer),e.itemCount,e.normalized);default:throw new Error(`unsupported buffer of type ${e.type}`)}},t.usesObject3D=function(e){const t=e.name;return void 0!==t&&"text"!==t&&"labeled-icon"!==t&&"line-marker"!==t&&"label-rejection-line"!==t},t.buildObject=function(e,t,i,r,s){switch((0,d.assert)(void 0!==e.name),e.name){case"extruded-line":case"standard":case"extruded-polygon":case"polygon":return s?new m.DisplacedMesh(t,i,(()=>({min:r.elevationRange.minElevation,max:r.elevationRange.maxElevation}))):new n.Mesh(t,i);case"terrain":return new n.Mesh(t,i);case"dashed-line":case"solid-line":return s?new m.DisplacedMesh(t,i,(()=>({min:r.elevationRange.minElevation,max:r.elevationRange.maxElevation})),p.SolidLineMesh.raycast):new p.SolidLineMesh(t,i);case"circles":return new y.Circles(t,i);case"squares":return new y.Squares(t,i);case"line":case"segments":return new n.LineSegments(t,i)}return(0,d.assert)(!1,"Invalid technique"),new n.Object3D},t.buildMetricValueEvaluator=T,t.evaluateBaseColorProperty=function(e,t){const i=function(e){const t=function(e){var t;return null===(t=(0,s.getTechniqueDescriptor)(e))||void 0===t?void 0:t.attrTransparencyColor}(e);if(void 0!==t)return e[t]}(e);if(void 0!==i)return S(i,t)},t.applySecondaryColorToMaterial=function(e,t,i){let n=S(t,i);void 0!==n&&(c.ColorUtils.hasAlphaInHex(n)&&(_.warn("Used RGBA value for technique color without transparency support!"),n=c.ColorUtils.removeAlphaFromHex(n)),e.setHex(n))},t.evaluateColorProperty=S},2476:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setDepthPrePassStencil=t.createDepthPrePassMesh=t.isDepthPrePassMesh=t.createDepthPrePassMaterial=t.isRenderDepthPrePassEnabled=t.DEPTH_PRE_PASS_STENCIL_MASK=void 0;const n=i(82),r=i(4250),s=i(1667),o=i(8427);function a(e){e.depthWrite=!1,e.depthFunc=n.EqualDepth,e.colorWrite=!0,(0,r.enforceBlending)(e);const t=e.clone();return t.isDepthPrepassMaterial=!0,t.depthWrite=!0,t.depthTest=!0,t.depthFunc=n.LessDepth,t.colorWrite=!1,t.opacity=1,t.blending=n.NoBlending,t}t.DEPTH_PRE_PASS_STENCIL_MASK=1,t.isRenderDepthPrePassEnabled=function(e,t){if(!1===e.enableDepthPrePass)return!1;let i=void 0!==e.opacity&&e.opacity>0&&e.opacity<1;if(!i){const n=(0,o.evaluateBaseColorProperty)(e,t);if(void 0!==n){const e=s.ColorUtils.getAlphaFromHex(n);i=e>0&&e<1}}return i},t.createDepthPrePassMaterial=a,t.isDepthPrePassMesh=function(e){if(!0!==e.isMesh)return!1;const t=e;return t.material instanceof Array?t.material.every((e=>!0===e.isDepthPrepassMaterial)):!0===t.material.isDepthPrepassMaterial},t.createDepthPrePassMesh=function(e){const t=e.geometry;if(!(t instanceof n.BufferGeometry))throw new Error("#createDepthPassMesh only BufferGeometry is supported");const i=t.getAttribute("position");if(!i)throw new Error("#createDepthPassMesh position attribute not found");const r=new n.BufferGeometry;r.setAttribute("position",i);const s=t.getAttribute("uv");s&&r.setAttribute("uv",s);const o=t.getAttribute("normal");o&&r.setAttribute("normal",o);const l=t.getAttribute("extrusionAxis");l&&r.setAttribute("extrusionAxis",l),t.index&&r.setIndex(t.index);for(const e of t.groups){const{start:t,count:i,materialIndex:n}=e;r.addGroup(t,i,n)}const c=e.material instanceof Array?e.material.map(a):a(e.material),h=new n.Mesh(r,c);return h.renderOrder=e.renderOrder-1e-6,h},t.setDepthPrePassStencil=function(e,i){function r(e){const i=e;i.stencilWrite=!0,i.stencilFail=n.KeepStencilOp,i.stencilZFail=n.KeepStencilOp,i.stencilZPass=n.ReplaceStencilOp,i.stencilFunc=n.AlwaysStencilFunc,i.stencilRef=255,i.stencilFuncMask=t.DEPTH_PRE_PASS_STENCIL_MASK}function s(e){const i=e;i.stencilWrite=!0,i.stencilFail=n.KeepStencilOp,i.stencilZFail=n.KeepStencilOp,i.stencilZPass=n.ZeroStencilOp,i.stencilFunc=n.EqualStencilFunc,i.stencilRef=255,i.stencilFuncMask=t.DEPTH_PRE_PASS_STENCIL_MASK}e.material instanceof Array?e.material.map(r):r(e.material),i.material instanceof Array?i.material.map(s):s(i.material)}},5071:(e,t)=>{"use strict";
949Object.defineProperty(t,"__esModule",{value:!0})},2175:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4988:(e,t)=>{"use strict";var i;Object.defineProperty(t,"__esModule",{value:!0}),t.CalculationStatus=void 0,(i=t.CalculationStatus||(t.CalculationStatus={}))[i.PendingApproximate=0]="PendingApproximate",i[i.FinalPrecise=1]="FinalPrecise"},4055:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EventDispatcher=void 0,t.EventDispatcher=class{constructor(){this.m_listeners=new Map}dispose(){this.removeAllEventListeners()}hasEventListener(e,t){const i=this.m_listeners.get(e);return void 0!==i&&(void 0===t||i.includes(t))}addEventListener(e,t){let i=this.m_listeners.get(e);void 0===i&&(i=[],this.m_listeners.set(e,i)),i.includes(t)||i.push(t)}removeEventListener(e,t){const i=this.m_listeners.get(e);if(void 0!==i)if(void 0===t)this.m_listeners.delete(e);else{const n=i.indexOf(t);-1!==n&&(i.splice(n,1),0===i.length&&this.m_listeners.delete(e))}}removeAllEventListeners(){const e=Array.from(this.m_listeners.keys());for(const t of e)this.removeEventListener(t)}get eventTypes(){return Array.from(this.m_listeners.keys())}listeners(e){return this.m_listeners.get(e)}dispatchEvent(e){const t=this.m_listeners.get(e.type);if(void 0!==t){e.target=this;const i=t.slice(0);for(let t=0,n=i.length;t<n;t++)i[t].call(this,e)}}}},1774:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FixedClipPlanesEvaluator=void 0,t.FixedClipPlanesEvaluator=class{constructor(e=1,t=10){this.minNear=e,this.minFarOffset=t,this.minFar=e+t,this.m_nearPlane=e,this.m_farPlane=this.minFar}get nearPlane(){return this.m_nearPlane}set nearPlane(e){this.invalidatePlanes(e,this.m_farPlane)}get farPlane(){return this.m_farPlane}set farPlane(e){this.invalidatePlanes(this.m_nearPlane,e)}set minElevation(e){}get minElevation(){return 0}set maxElevation(e){}get maxElevation(){return 0}evaluateClipPlanes(e,t,i){return{near:this.m_nearPlane,far:this.m_farPlane,minimum:this.minNear,maximum:this.m_farPlane}}invalidatePlanes(e,t){const i=Math.max(this.minNear,e),n=Math.max(this.minFar,t,i+this.minFarOffset);this.m_nearPlane=i,this.m_farPlane=n}}},3103:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MAX_FOV_RAD=t.MIN_FOV_RAD=t.MAX_FOV_DEG=t.MIN_FOV_DEG=t.DEFAULT_FOV_CALCULATION=void 0;const n=i(82);t.DEFAULT_FOV_CALCULATION={type:"dynamic",fov:40},t.MIN_FOV_DEG=0,t.MAX_FOV_DEG=180,t.MIN_FOV_RAD=n.MathUtils.degToRad(t.MIN_FOV_DEG),t.MAX_FOV_RAD=n.MathUtils.degToRad(t.MAX_FOV_DEG)},8502:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FrustumIntersection=t.TileKeyEntry=void 0;const n=i(82),r=i(2616),s=i(4342),o=i(4988),a=i(9904),l=i(541),c=[new n.Vector3,new n.Vector3],h=new n.Vector4;class u{constructor(e,t,i=0,n,r=0){this.tileKey=e,this.area=t,this.offset=i,this.elevationRange=n,this.distance=r}}t.TileKeyEntry=u,t.FrustumIntersection=class{constructor(e,t,i,r,s,o=256){this.m_camera=e,this.mapView=t,this.m_extendedFrustumCulling=i,this.m_tileWrappingEnabled=r,this.m_enableMixedLod=s,this.m_tilePixelSize=o,this.m_frustum=new n.Frustum,this.m_viewProjectionMatrix=new n.Matrix4,this.m_rootTileKeys=[],this.m_tileKeyEntries=new Map,this.m_mapTileCuller=new a.MapTileCuller(e)}get camera(){return this.m_camera}get projection(){return this.mapView.projection}updateFrustum(e){this.m_viewProjectionMatrix.multiplyMatrices(void 0!==e?e:this.m_camera.projectionMatrix,this.m_camera.matrixWorldInverse),this.m_frustum.setFromProjectionMatrix(this.m_viewProjectionMatrix),this.m_extendedFrustumCulling&&this.m_mapTileCuller.setup(),this.computeRequiredInitialRootTileKeys(this.m_camera.position)}compute(e,t,i,o){this.m_tileKeyEntries.clear(),(0,s.assert)(0!==this.mapView.viewportHeight);const a=Math.pow(this.m_tilePixelSize/this.mapView.viewportHeight,2),l=void 0!==t&&t.getTilingScheme()===e,c=this.mapView.projection.type===r.ProjectionType.Spherical||l,h=new Set(i);let u=0,d=0;o.forEach((e=>{u=Math.min(u,e.minGeometryHeight),d=Math.max(d,e.maxGeometryHeight)}));const m={calculationFinal:!0,tileBounds:c?new r.OrientedBox3:new n.Box3};for(const e of h)this.m_tileKeyEntries.set(e,new Map);for(const i of this.m_rootTileKeys){const n=i.tileKey,s=i.offset,o=this.getTileKeyEntry(n,s,e,m,u,d,l?t:void 0);if(void 0!==o)for(const e of h)this.m_tileKeyEntries.get(e).set(r.TileKeyUtils.getKeyForTileKeyAndOffset(n,s),o)}const p=[...this.m_rootTileKeys.values()],f=this.mapView.projection===r.sphereProjection||this.mapView.tilt>0;for(;p.length>0;){const n=p.pop();if(void 0===n)break;const s=n.tileKey,c=n.offset;if(!o.some(((e,t)=>e.shouldSubdivide(i[t],s))))continue;if(this.m_enableMixedLod&&f&&n.area<a)continue;const g=r.TileKeyUtils.getKeyForTileKeyAndOffset(s,c);for(const e of h)s.level>=e||this.m_tileKeyEntries.get(e).delete(g);for(const i of e.getSubTileKeys(s)){const n=this.getTileKeyEntry(i,c,e,m,u,d,l?t:void 0);if(void 0!==n){for(const e of h){if(n.tileKey.level>e)continue;const t=r.TileKeyUtils.getKeyForTileKeyAndOffset(i,c);this.m_tileKeyEntries.get(e).set(t,n)}p.push(n)}}}return{tileKeyEntries:this.m_tileKeyEntries,calculationFinal:m.calculationFinal}}getTileKeyEntry(e,t,i,n,r,s,a){var l,c;const h=function(e,t,i){const n=e.getGeoBox(t),r=360*i;return n.northEast.longitude+=r,n.southWest.longitude+=r,n}(i,e,t);if(void 0!==a){const t=a.getElevationRange(e);h.southWest.altitude=t.minElevation,h.northEast.altitude=t.maxElevation,n.calculationFinal=n.calculationFinal&&t.calculationStatus===o.CalculationStatus.FinalPrecise}h.southWest.altitude=(null!==(l=h.southWest.altitude)&&void 0!==l?l:0)+r,h.northEast.altitude=(null!==(c=h.northEast.altitude)&&void 0!==c?c:0)+s,this.mapView.projection.projectBox(h,n.tileBounds);const{area:d,distance:m}=this.computeTileAreaAndDistance(n.tileBounds);if(d>0)return new u(e,d,t,{minElevation:h.southWest.altitude,maxElevation:h.northEast.altitude},m)}computeTileAreaAndDistance(e){if(e instanceof n.Box3){if(this.m_extendedFrustumCulling&&!this.m_mapTileCuller.frustumIntersectsTileBox(e)||!this.m_frustum.intersectsBox(e))return{area:0,distance:1/0}}else if(!e.intersects(this.m_frustum))return{area:0,distance:1/0};const t=e.getCenter(c[0]),i=h.set(t.x,t.y,t.z,1).applyMatrix4(this.m_viewProjectionMatrix),r=.5*e.getSize(c[1]).length()/i.w;return{area:r*r,distance:i.z<=-i.w?-1:i.z>=i.w?1:i.z/i.w}}computeRequiredInitialRootTileKeys(e){this.m_rootTileKeys=[];const t=r.TileKey.fromRowColumnLevel(0,0,0);if(this.mapView.projection.type!==r.ProjectionType.Planar||!this.m_tileWrappingEnabled)return void this.m_rootTileKeys.push(new u(t,1/0,0));const i=this.mapView.projection.unprojectPoint(e),s=Math.round(i.longitude/360),o=this.m_camera,a=l.MapViewUtils.extractAttitude(this.mapView,o).pitch,c=o.aspect>1?o.aspect:1/o.aspect,h=n.MathUtils.degToRad(o.fov*c/2)+a,d=Math.tan(h)*o.position.z-Math.tan(a)*o.position.z,m=new n.Vector3(e.x-d,e.y,e.z),p=this.mapView.projection.unprojectPoint(m),f=n.MathUtils.clamp(Math.ceil(Math.abs((i.longitude-p.longitude)/360)*Math.SQRT2),0,7);for(let e=-f+s;e<=f+s;e++)this.m_rootTileKeys.push(new u(t,1/0,e))}}},1406:(e,t)=>{"use strict";var i;
949Object.defineProperty(t,"__esModule",{value:!0}),t.TileLoaderState=void 0,(i=t.TileLoaderState||(t.TileLoaderState={}))[i.Initialized=0]="Initialized",i[i.Loading=1]="Loading",i[i.Loaded=2]="Loaded",i[i.Decoding=3]="Decoding",i[i.Ready=4]="Ready",i[i.Canceled=5]="Canceled",i[i.Failed=6]="Failed"},5482:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MapAnchors=void 0;const n=i(82),r=i(2616);t.MapAnchors=class{constructor(){this.m_anchors=[],this.m_priorities=[]}get children(){return this.m_anchors}add(e){this.m_anchors.push(e)}remove(e){const t=this.m_anchors.findIndex((t=>t===e));t>-1&&this.m_anchors.splice(t,1)}clear(){this.m_anchors.length=0}setPriorities(e){this.m_priorities=e}update(e,t,i,s){const o=new n.Vector3;this.m_anchors.forEach((n=>{var a;if(void 0!==n.layer){const e=null===(a=this.m_priorities)||void 0===a?void 0:a.findIndex((e=>e.layer===n.layer&&e.category===n.category));void 0!==e&&-1!==e&&(n.renderOrder=10*(e+1))}const l=void 0!==n.geoPosition?n.geoPosition:n.anchor;void 0!==l&&((0,r.isVector3Like)(l)?o.set(l.x,l.y,l.z):(0,r.isGeoCoordinatesLike)(l)&&e.projectPoint(l,o),n.position.copy(o).sub(t)),!0===n.overlay?s.add(n):i.add(n)}))}}},176:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MapMaterialAdapter=void 0;const n=i(82),r=i(8152),s=i(4250),o=i(1984),a=i(1667),l=i(8023),c=i(7610),h=i(4342),u=i(8427),d=i(7063);function m(e){return"color"===e||"opacity"===e}class p{static create(e,t){const i=new p(e,t);return e.userData||(e.userData={}),e.userData.mapMaterialAdapter=i,i}static update(e,t){var i,n;const r=null===(i=e.userData)||void 0===i?void 0:i.mapMaterialAdapter;return null!==(n=null==r?void 0:r.update(t))&&void 0!==n&&n}constructor(e,t){this.m_material=e,this.m_styledProperties=t,this.m_currentPropertyValues={},this.m_lastUpdateFrameNumber=-1,this.m_dynamicProperties=[];let i=!1;for(const e in t){if(!t.hasOwnProperty(e))continue;const n=t[e];l.Expr.isExpr(n)||"function"==typeof n?this.m_dynamicProperties.push([e,n]):null!=n&&(this.m_currentPropertyValues[e]=n,m(e)?i=!0:this.setProperty(e,n))}i&&this.setBaseColorAndOpacity()}toJSON(){}update(e){if(this.m_lastUpdateFrameNumber===e.frameNumber)return!1;this.m_lastUpdateFrameNumber=e.frameNumber;const t=this.updateDynamicProperties(e),i=this.updateTextureMagFilter(e);return t||i}updateTextureMagFilter(e){let t=!1;if(this.m_material instanceof n.MeshBasicMaterial&&this.m_material.map){const i=e.env.lookup("$shouldAntialiasRasterTile")?n.LinearFilter:n.NearestFilter;this.m_material.map.magFilter!==i&&(this.m_material.map.magFilter=i,t=!0,this.m_material.map.needsUpdate=!0)}return t}updateDynamicProperties(e){let t=!1,i=!1;for(const[n,s]of this.m_dynamicProperties){const o=l.Expr.isExpr(s)?(0,r.getPropertyValue)(s,e.env):s(e);o!==this.m_currentPropertyValues[n]&&(this.m_currentPropertyValues[n]=o,m(n)?i=!0:this.setProperty(n,o,e.textureCache),t=!0)}return i&&this.setBaseColorAndOpacity(),t}setTextureProperty(e,t,i){const n=this.m_material;if(!n[e]||null===t)return;const r=n[e],s=(0,d.loadTexture)(t,i,void 0,void 0,(t=>
949{n[e]=t,r.dispose()}));s&&(s.wrapS=r.wrapS,s.wrapT=r.wrapT,s.magFilter=r.magFilter,s.minFilter=r.minFilter,s.flipY=r.flipY,s.repeat=r.repeat)}isColorProperty(e){const t=this.m_material[e];return t instanceof n.Color||t instanceof c.RGBA}setProperty(e,t,i){var n;this.isColorProperty(e)?this.setColorProperty(e,t):(n=e,o.TEXTURE_PROPERTY_KEYS.includes(n)?i&&this.setTextureProperty(e,t,i):this.m_material[e]=t)}setColorProperty(e,t){const i=this.m_material;let r;if((0,h.assert)(i[e]instanceof n.Color||i[e]instanceof c.RGBA),null==t?void 0:t.isRGBA)r=c.RGBA.isRGBA(t)?t:(new c.RGBA).copy(t);else{const e=(0,u.evaluateColorProperty)(t);if(void 0===e)return;r=a.ColorUtils.getRgbaFromHex(e)}return i[e]instanceof n.Color?i[e]=new n.Color(r.r,r.g,r.b):i[e]=r,r}setOpacity(e){var t;let i=null!==(t=this.m_currentPropertyValues.opacity)&&void 0!==t?t:1;i=n.MathUtils.clamp(i,0,1);const r=i*e.a,o=r>=1;this.m_material.color instanceof n.Color&&(i=r),this.m_material instanceof s.RawShaderMaterial?this.m_material.setOpacity(i):this.m_material.opacity=i,o?(0,s.disableBlending)(this.m_material):(0,s.enableBlending)(this.m_material)}setBaseColorAndOpacity(){var e;const t=null!==(e=this.m_currentPropertyValues.color)&&void 0!==e?e:16711680,i=this.setColorProperty("color",t);i&&this.setOpacity(i)}}t.MapMaterialAdapter=p},4572:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MapObjectAdapter=void 0;const n=i(1984),r=i(176);class s{static get(e){var t;return null===(t=null==e?void 0:e.userData)||void 0===t?void 0:t.mapObjectAdapter}static install(e){return e.object.userData||(e.object.userData={}),e.object.userData.mapObjectAdapter=e}static create(e,t){return s.install(new s(e,t))}static update(e,t){var i,n;return null!==(n=null===(i=s.get(e))||void 0===i?void 0:i.update(t))&&void 0!==n&&n}constructor(e,t){var i;this.m_lastUpdateFrameNumber=-1,this.m_notCompletlyTransparent=!0,this.object=e,this.technique=t.technique,this.dataSource=t.dataSource,this.m_pickability=null!==(i=t.pickability)&&void 0!==i?i:n.Pickability.onlyVisible,this.m_notCompletlyTransparent=this.getObjectMaterials().some((e=>e.opacity>0)),this.tileKey=t.tileKey}toJSON(){return{technique:this.technique}}update(e){return this.m_lastUpdateFrameNumber!==e.frameNumber&&(this.m_lastUpdateFrameNumber=e.frameNumber,this.updateMaterials(e))}isVisible(){return this.object.visible&&this.m_notCompletlyTransparent}isPickable(){return this.pickability===n.Pickability.onlyVisible&&this.isVisible()||this.m_pickability===n.Pickability.all}get pickability(){return this.m_pickability}updateMaterials(e){let t=!1;const i=this.getObjectMaterials();for(const n of i){const i=r.MapMaterialAdapter.update(n,e);t=t||i}return t&&(this.m_notCompletlyTransparent=i.some((e=>e.opacity>0))),t}getObjectMaterials(){const e=this.object;return Array.isArray(e.material)?e.material:void 0!==e.material?[e.material]:[]}}t.MapObjectAdapter=s},9904:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MapTileCuller=void 0;const n=i(82);t.MapTileCuller=class{constructor(e){this.m_camera=e,this.m_globalFrustumMin=new n.Vector3,this.m_globalFrustumMax=new n.Vector3,this.m_frustumCorners=[new n.Vector3,new n.Vector3,new n.Vector3,new n.Vector3,new n.Vector3,new n.Vector3,new n.Vector3,new n.Vector3]}setup(){const e=this.getFrustumCorners(),t=this.m_camera.matrixWorld;this.m_globalFrustumMin.set(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this.m_globalFrustumMax.set(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);for(const i of e)i.applyMatrix4(t),this.m_globalFrustumMin.x=Math.min(this.m_globalFrustumMin.x,i.x),this.m_globalFrustumMin.y=Math.min(this.m_globalFrustumMin.y,i.y),this.m_globalFrustumMin.z=Math.min(this.m_globalFrustumMin.z,i.z),this.m_globalFrustumMax.x=Math.max(this.m_globalFrustumMax.x,i.x),this.m_globalFrustumMax.y=Math.max(this.m_globalFrustumMax.y,i.y),this.m_globalFrustumMax.z=Math.max(this.m_globalFrustumMax.z,i.z)}frustumIntersectsTileBox(e){const t=this.m_globalFrustumMin,i=this.m_globalFrustumMax;return!(i.x<e.min.x||i.y<e.min.y||i.z<e.min.z||t.x>e.max.x||t.y>e.max.y||t.z>e.max.z)}getFrustumCorners(){const e=this.m_frustumCorners,t=this.m_camera.projectionMatrixInverse;let i=0;function n(n,r,s){e[i++].set(n,r,s).applyMatrix4(t)}return n(-1,-1,-1),n(1,-1,-1),n(-1,1,-1),n(1,1,-1),n(-1,-1,1),n(1,-1,1),n(-1,1,1),n(1,1,1),e}}},3977:(e,t,i)=>{"use strict";
949Object.defineProperty(t,"__esModule",{value:!0}),t.MapView=t.MapViewPowerPreference=t.MapViewEventNames=t.TileTaskGroups=void 0;const n=i(82),r=i(2616),s=i(1984),o=i(4342),a=i(2541),l=i(5863),c=i(8907),h=i(4442),u=i(9978),d=i(5307),m=i(1818),p=i(7511),f=i(8380),g=i(4055),v=i(1350),y=i(3103),_=i(8502),x=i(9587),b=i(3801),w=i(304),M=i(8488),T=i(9297),S=i(5996),E=i(5482),A=i(3011),C=i(19),P=i(6272),L=i(8881),R=i(5187),D=i(8658),O=i(8015),I=i(9780),F=i(541),V=i(5008);var U,B;o.LoggerManager.instance.setLogLevelForAll(o.LogLevel.Error),(B=t.TileTaskGroups||(t.TileTaskGroups={})).FETCH_AND_DECODE="fetch",B.CREATE="create",function(e){e.Update="update",e.Resize="resize",e.Render="render",e.AfterRender="didrender",e.FirstFrame="first-render",e.FrameComplete="frame-complete",e.ThemeLoaded="theme-loaded",e.AnimationStarted="animation-started",e.AnimationFinished="animation-finished",e.MovementStarted="movement-started",e.MovementFinished="movement-finished",e.DataSourceConnect="datasource-connect",e.CopyrightChanged="copyright-changed",e.ContextLost="webglcontext-lost",e.ContextRestored="webglcontext-restored",e.CameraPositionChanged="camera-changed",e.Dispose="dispose"}(U=t.MapViewEventNames||(t.MapViewEventNames={}));const N=o.LoggerManager.instance.create("MapView"),z=4e6,k=["northpole","southpole"],G={vector2:[new n.Vector2],vector3:[new n.Vector3,new n.Vector3,new n.Vector3],rayCaster:new n.Raycaster,groundPlane:new n.Plane,groundSphere:new n.Sphere(void 0,r.EarthConstants.EQUATORIAL_RADIUS),matrix4:[new n.Matrix4,new n.Matrix4],transform:[{position:new n.Vector3,xAxis:new n.Vector3,yAxis:new n.Vector3,zAxis:new n.Vector3}],color:new n.Color};var j;!function(e){e.Default="default",e.LowPower="low-power",e.HighPerformance="high-performance"}(j=t.MapViewPowerPreference||(t.MapViewPowerPreference={}));const H={projection:r.mercatorProjection,addBackgroundDatasource:!0,maxVisibleDataSourceTiles:100,extendedFrustumCulling:!0,tileCacheSize:200,resourceComputationType:V.ResourceComputationType.EstimationInMb,quadTreeSearchDistanceUp:3,quadTreeSearchDistanceDown:2,pixelRatio:"undefined"!=typeof window&&void 0!==window.devicePixelRatio?window.devicePixelRatio:1,target:new r.GeoCoordinates(25,0),zoomLevel:5,tilt:0,heading:0,theme:{},maxTilesPerFrame:0};class W extends g.EventDispatcher{constructor(e){var t,i;super(),this.UPDATE_EVENT={type:U.Update},this.RENDER_EVENT={type:U.Render},this.DID_RENDER_EVENT={type:U.AfterRender},this.FIRST_FRAME_EVENT={type:U.FirstFrame},this.FRAME_COMPLETE_EVENT={type:U.FrameComplete},this.THEME_LOADED_EVENT={type:U.ThemeLoaded},this.ANIMATION_STARTED_EVENT={type:U.AnimationStarted},this.ANIMATION_FINISHED_EVENT={type:U.AnimationFinished},this.MOVEMENT_STARTED_EVENT={type:U.MovementStarted},this.MOVEMENT_FINISHED_EVENT={type:U.MovementFinished},this.CONTEXT_LOST_EVENT={type:U.ContextLost},this.CONTEXT_RESTORED_EVENT={type:U.ContextRestored},this.COPYRIGHT_CHANGED_EVENT={type:U.CopyrightChanged},this.DISPOSE_EVENT={type:U.Dispose},this.m_renderLabels=!0,this.m_visibleTileSetLock=!1,this.m_tileWrappingEnabled=!0,this.m_zoomLevel=1,this.m_minZoomLevel=1,this.m_maxZoomLevel=20,this.m_minCameraHeight=20,this.m_rteCamera=new n.PerspectiveCamera,this.m_yaw=0,this.m_pitch=0,this.m_roll=0,this.m_targetDistance=0,this.m_targetGeoPos=r.GeoCoordinates.fromObject(H.target),this.m_targetWorldPos=new n.Vector3,this.m_viewRanges={near:.1,far:z,minimum:.1,maximum:z},this.m_scene=new n.Scene,this.m_overlayScene=new n.Scene,this.m_sceneRoot=new n.Object3D,this.m_overlaySceneRoot=new n.Object3D,this.m_mapAnchors=new E.MapAnchors,this.m_animationCount=0,this.m_drawing=!1,this.m_updatePending=!1,this.m_frameNumber=0,this.m_forceCameraAspect=void 0,this.m_taskSchedulerTimeout=void 0,this.m_tileDataSources=[],this.m_connectedDataSources=new Set,this.m_connectingDataSources=0,this.m_enablePolarDataSource=!0,this.m_raycaster=new n.Raycaster,this.m_plane=new n.Plane(new n.Vector3(0,0,1)),this.m_sphere=new n.Sphere(void 0,r.EarthConstants.EQUATORIAL_RADIUS),this.m_firstFrameRendered=!1,this.m_firstFrameComplete=!1,this.m_env=new s.MapEnv({}),this.m_imageRepo=new T.ImageRepo,this.m_textureCache=new S.TextureCache,this.m_lastTileIds="",this.m_copyrightInfo=[],this.m_disposed=!1,this.onWebGLContextLost=e=>{this.dispatchEvent(this.CONTEXT_LOST_EVENT),N.warn("WebGL context lost",e)},this.onWebGLContextRestored=e=>{this.dispatchEvent(this.CONTEXT_RESTORED_EVENT),void 0!==this.m_renderer&&(this.iconTextRenderer.restoreRenderers(this.m_renderer),this.update()),N.warn("WebGL context restored",e)},this.m_options=Object.assign({},e),this.m_uriResolver=this.m_options.uriResolver,void 0!==this.m_options.minZoomLevel&&(this.m_minZoomLevel=this.m_options.minZoomLevel),void 0!==this.m_options.maxZoomLevel&&(this.m_maxZoomLevel=this.m_options.maxZoomLevel),void 0!==this.m_options.minCameraHeight&&(this.m_minCameraHeight=this.m_options.minCameraHeight),void 0!==this.m_options.maxBounds&&(this.m_geoMaxBounds=this.m_options.maxBounds),void 0!==this.m_options.decoderUrl&&(m.ConcurrentDecoderFacade.defaultScriptUrl=this.m_uriResolver?this.m_uriResolver.resolveUri(this.m_options.decoderUrl):this.m_options.decoderUrl),void 0!==this.m_options.decoderCount&&(m.ConcurrentDecoderFacade.defaultWorkerCount=this.m_options.decoderCount),this.m_visibleTileSetOptions=Object.assign(Object.assign({},H),{clipPlanesEvaluator:void 0!==e.clipPlanesEvaluator?e.clipPlanesEvaluator:(0,u.createDefaultClipPlanesEvaluator)()}),void 0!==e.projection&&(this.m_visibleTileSetOptions.projection=e.projection),void 0!==e.extendedFrustumCulling&&(this.m_visibleTileSetOptions.extendedFrustumCulling=e.extendedFrustumCulling),void 0!==e.maxVisibleDataSourceTiles&&(this.m_visibleTileSetOptions.maxVisibleDataSourceTiles=e.maxVisibleDataSourceTiles),void 0!==e.tileCacheSize&&(this.m_visibleTileSetOptions.tileCacheSize=e.tileCacheSize),void 0!==e.resourceComputationType&&(this.m_visibleTileSetOptions.resourceComputationType=e.resourceComputationType),void 0!==e.quadTreeSearchDistanceUp&&(this.m_visibleTileSetOptions.quadTreeSearchDistanceUp=e.quadTreeSearchDistanceUp),void 0!==e.quadTreeSearchDistanceDown&&(this.m_visibleTileSetOptions.quadTreeSearchDistanceDown=e.quadTreeSearchDistanceDown),void 0!==e.enablePolarDataSource&&(this.m_enablePolarDataSource=e.enablePolarDataSource),this.m_pixelRatio=e.pixelRatio,this.m_options.maxFps=null!==(t=this.m_options.maxFps)&&void 0!==t?t:0,this.m_options.enableStatistics=!0===this.m_options.enableStatistics,this.handleRequestAnimationFrame=this.renderLoop.bind(this),void 0!==this.m_options.tileWrappingEnabled&&(this.m_tileWrappingEnabled=this.m_options.tileWrappingEnabled),this.setupStats(this.m_options.enableStatistics),this.canvas.addEventListener("webglcontextlost",this.onWebGLContextLost),this.canvas.addEventListener("webglcontextrestored",this.onWebGLContextRestored),this.m_renderer=new(null!==(i=n.WebGL1Renderer)&&void 0!==i?i:n.WebGLRenderer)({canvas:this.canvas,context:this.m_options.context,antialias:this.nativeWebglAntialiasEnabled,alpha:this.m_options.alpha,preserveDrawingBuffer:!0===this.m_options.preserveDrawingBuffer,powerPreference:void 0===this.m_options.powerPreference?j.Default:this.m_options.powerPreference}
949),this.m_renderer.autoClear=!1,this.m_renderer.debug.checkShaderErrors=!1,this.m_renderer.info.autoReset=!1,this.m_tileObjectRenderer=new I.TileObjectRenderer(this.m_env,this.m_renderer),this.setupRenderer(this.m_tileObjectRenderer),this.m_options.fovCalculation=void 0===this.m_options.fovCalculation?y.DEFAULT_FOV_CALCULATION:this.m_options.fovCalculation,this.m_options.fovCalculation.fov=n.MathUtils.clamp(this.m_options.fovCalculation.fov,y.MIN_FOV_DEG,y.MAX_FOV_DEG);const{width:l,height:h}=this.getCanvasClientSize(),p=l/h;this.m_camera=new n.PerspectiveCamera(this.m_options.fovCalculation.fov,p,.1,z),this.m_camera.up.set(0,0,1),this.setFovOnCamera(this.m_options.fovCalculation,h),this.projection.projectPoint(this.m_targetGeoPos,this.m_targetWorldPos),this.m_scene.add(this.m_camera),this.m_screenProjector=new D.ScreenProjector(this.m_camera),this.m_taskScheduler=new C.MapViewTaskScheduler(this.maxFps),this.m_tileGeometryManager=new b.TileGeometryManager(this),void 0!==e.enableMixedLod&&(this.m_enableMixedLod=e.enableMixedLod),void 0!==e.lodMinTilePixelSize&&(this.m_lodMinTilePixelSize=e.lodMinTilePixelSize),this.m_visibleTiles=this.createVisibleTileSet(),this.m_sceneEnvironment=new A.MapViewEnvironment(this,e),this.setupCamera(),this.m_pickHandler=new L.PickHandler(this,this.m_rteCamera,!0===this.m_options.enablePickTechnique),this.m_movementDetector=new c.CameraMovementDetector(this.m_options.movementThrottleTimeout,(()=>this.movementStarted()),(()=>this.movementFinished()));const f=this.m_options.customAntialiasSettings;if(this.mapRenderingManager=new d.MapRenderingManager(l,h,this.m_options.dynamicPixelRatio,f),this.m_animatedExtrusionHandler=new a.AnimatedExtrusionHandler(this),this.m_enablePolarDataSource){const t=void 0!==e.polarLayerNames?e.polarLayerNames:k;this.m_polarDataSource=new R.PolarTileDataSource({layerNames:t,geometryLevelOffset:e.polarGeometryLevelOffset}),this.updatePolarDataSource()}this.m_taskScheduler.addEventListener(U.Update,(()=>{this.update()})),void 0!==e.throttlingEnabled&&(this.m_taskScheduler.throttlingEnabled=e.throttlingEnabled),this.m_themeManager=new P.MapViewThemeManager(this,(0,o.getOptionValue)(this.m_options.theme,H.theme),this.m_imageRepo,this.m_uriResolver),this.m_iconTextRenderer=this.createTextRenderer(),this.update()}get lights(){return this.m_sceneEnvironment.lights}get taskQueue(){return this.m_taskScheduler.taskQueue}get renderLabels(){return this.m_renderLabels}set renderLabels(e){this.m_renderLabels=e}get delayLabelsUntilMovementFinished(){return this.iconTextRenderer.delayLabelsUntilMovementFinished}set delayLabelsUntilMovementFinished(e){this.iconTextRenderer.delayLabelsUntilMovementFinished=e}get iconTextRenderer(){return this.m_iconTextRenderer}get cameraMovementDetector(){return this.m_movementDetector}get animatedExtrusionHandler(){return this.m_animatedExtrusionHandler}get tileGeometryManager(){return this.m_tileGeometryManager}get enableMixedLod(){return this.m_enableMixedLod}set enableMixedLod(e){this.m_enableMixedLod!==e&&(this.m_enableMixedLod=e,this.createVisibleTileSet(),this.update())}get tileWrappingEnabled(){return this.m_tileWrappingEnabled}set tileWrappingEnabled(e){this.projection.type!==r.ProjectionType.Spherical?(e!==this.m_tileWrappingEnabled&&(this.m_tileWrappingEnabled=e,this.createVisibleTileSet()),this.update()):N.warn("Setting this with spherical projection has no affect. Was this intended?")}dispose(e=!0){this.DISPOSE_EVENT.time=Date.now(),this.dispatchEvent(this.DISPOSE_EVENT),this.m_disposed=!0,this.m_movementFinishedUpdateTimerId&&(clearTimeout(this.m_movementFinishedUpdateTimerId),this.m_movementFinishedUpdateTimerId=void 0),void 0!==this.m_animationFrameHandle&&(cancelAnimationFrame(this.m_animationFrameHandle),this.m_animationFrameHandle=void 0),this.canvas.removeEventListener("webglcontextlost",this.onWebGLContextLost),this.canvas.removeEventListener("webglcontextrestored",this.onWebGLContextRestored);for(const e of this.m_tileDataSources)e.dispose();this.m_visibleTiles.clearTileCache(),this.m_iconTextRenderer.clearRenderStates(),this.m_textureCache.evictAll(),this.m_renderer.dispose(),e&&this.m_renderer.forceContextLoss(),this.m_imageRepo.iconTextManager.clear(),this.m_tileGeometryManager.clear(),this.m_movementDetector.dispose(),m.ConcurrentDecoderFacade.destroyIfTerminated(),p.ConcurrentTilerFacade.destroyIfTerminated(),this.m_taskScheduler.clearQueuedTasks(),super.dispose()}get disposed(){return this.m_disposed}get resourceComputationType(){return this.m_visibleTiles.resourceComputationType}set resourceComputationType(e){this.m_visibleTiles.resourceComputationType=e}getCacheSize(){return this.m_visibleTiles.getDataSourceCacheSize()}setCacheSize(e,t){this.m_visibleTiles.setDataSourceCacheSize(e),t=void 0!==t?t:e/2,this.m_visibleTiles.setNumberOfVisibleTiles(Math.floor(t)),this.m_iconTextRenderer.invalidateCache(),this.update()}
949get extendedFrustumCulling(){return void 0===this.m_options.extendedFrustumCulling||this.m_visibleTileSetOptions.extendedFrustumCulling}set extendedFrustumCulling(e){this.m_visibleTileSetOptions.extendedFrustumCulling=e}get lockVisibleTileSet(){return this.m_visibleTileSetLock}set lockVisibleTileSet(e){this.m_visibleTileSetLock=e}get pointOfView(){return this.m_pointOfView}set pointOfView(e){this.m_pointOfView=e,this.update()}loadPostEffects(e){fetch(e).then((e=>e.json())).then((e=>{this.m_postEffects=e,this.setPostEffects()}))}get postEffects(){return this.m_postEffects}set postEffects(e){this.m_postEffects=e,this.setPostEffects()}async setTheme(e,t){if(this.animatedExtrusionHandler.enabled){this.animatedExtrusionHandler.enabled=!1;const e=()=>{this.animatedExtrusionHandler.enabled=!0,this.removeEventListener(U.FrameComplete,e)};this.addEventListener(U.FrameComplete,e)}const i=await this.m_themeManager.setTheme(e,t);return this.THEME_LOADED_EVENT.time=Date.now(),this.dispatchEvent(this.THEME_LOADED_EVENT),this.update(),i}async getTheme(){return await this.m_themeManager.getTheme()}get uriResolver(){return this.m_uriResolver}get forceCameraAspect(){return this.m_forceCameraAspect}set forceCameraAspect(e){this.m_forceCameraAspect=e}get copyrightInfo(){return this.m_copyrightInfo}set disableFading(e){this.m_iconTextRenderer.disableFading=e}get disableFading(){return this.m_iconTextRenderer.disableFading}get frameNumber(){return this.m_frameNumber}resetFrameNumber(){this.m_frameNumber=0,this.m_previousFrameTimeStamp=void 0}addEventListener(e,t){super.addEventListener(e,t)}removeEventListener(e,t){super.removeEventListener(e,t)}get canvas(){return this.m_options.canvas}get collisionDebugCanvas(){return this.m_collisionDebugCanvas}get scene(){return this.m_scene}get overlayScene(){return this.m_overlayScene}get sceneEnvironment(){return this.m_sceneEnvironment}get camera(){return this.m_camera}get renderer(){return this.m_renderer}get clearColor(){const e=this.m_renderer.getClearColor(G.color);return void 0!==e?e.getHex():0}set clearColor(e){this.m_renderer.setClearColor(e)}get clearAlpha(){const e=this.m_renderer.getClearAlpha();return void 0!==e?e:0}set clearAlpha(e){this.m_renderer.setClearAlpha(e)}get projection(){return this.m_visibleTileSetOptions.projection}set projection(e){const t=this.tilt,i=this.heading;this.m_visibleTileSetOptions.projection=e,this.updatePolarDataSource(),this.clearTileCache(),this.iconTextRenderer.clearRenderStates(),this.createVisibleTileSet(),this.geoMaxBounds=this.geoMaxBounds,this.lookAtImpl({tilt:t,heading:i})}get clipPlanesEvaluator(){return this.m_visibleTileSetOptions.clipPlanesEvaluator}set clipPlanesEvaluator(e){this.m_visibleTileSetOptions.clipPlanesEvaluator=e}get focalLength(){var e;return null!==(e=h.CameraUtils.getFocalLength(this.m_camera))&&void 0!==e?e:0}get target(){return this.m_targetGeoPos}get worldTarget(){return this.m_targetWorldPos}get targetDistance(){return this.m_targetDistance}get viewRanges(){return this.m_viewRanges}get geoCenter(){return this.projection.unprojectPoint(this.m_camera.position).normalized()}set geoCenter(e){if(void 0!==e.altitude)this.projection.projectPoint(e,this.m_camera.position);else{const t=this.geoCenter.altitude;this.projection.projectPoint(new r.GeoCoordinates(e.latitude,e.longitude,t),this.m_camera.position)}this.update()}get mapAnchors(){return this.m_mapAnchors}get worldCenter(){return this.m_camera.position}get pickHandler(){return this.m_pickHandler}get imageRepo(){return this.m_imageRepo}get textureCache(){return this.m_textureCache}get minCameraHeight(){return this.m_minCameraHeight}get minZoomLevel(){return this.m_minZoomLevel}set minZoomLevel(e){this.m_minZoomLevel=e,this.update()}get maxZoomLevel(){return this.m_maxZoomLevel}set maxZoomLevel(e){this.m_maxZoomLevel=e,this.update()}get geoMaxBounds(){return this.m_geoMaxBounds}set geoMaxBounds(e){this.m_geoMaxBounds=e,this.m_worldMaxBounds=this.m_geoMaxBounds?this.projection.projectBox(this.m_geoMaxBounds,this.projection.type===r.ProjectionType.Planar?new n.Box3:new r.OrientedBox3):void 0}get worldMaxBounds(){return this.m_worldMaxBounds}get zoomLevel(){return this.m_zoomLevel}set zoomLevel(e){this.lookAtImpl({zoomLevel:e})}get tilt(){return n.MathUtils.radToDeg(this.m_pitch)}set tilt(e){this.lookAtImpl({tilt:e})}get heading(){return-n.MathUtils.radToDeg(this.m_yaw)}set heading(e){this.lookAtImpl({heading:e})}get env(){return this.m_env}get storageLevel(){return n.MathUtils.clamp(Math.floor(this.m_zoomLevel),this.m_minZoomLevel,this.m_maxZoomLevel)}
949get viewportHeight(){return this.canvas.height}get nativeWebglAntialiasEnabled(){return void 0===this.m_options.enableNativeWebglAntialias?this.pixelRatio<2:this.m_options.enableNativeWebglAntialias}get dataSources(){return this.m_tileDataSources}setFovCalculation(e){this.m_options.fovCalculation=e,this.updateCameras()}getDataSourceByName(e){return this.m_tileDataSources.find((t=>t.name===e))}getDataSourcesByLayerName(e){return this.m_tileDataSources.filter((t=>{var i;return null===(i=t.layerNames)||void 0===i?void 0:i.includes(e)}))}isDataSourceEnabled(e){return e.enabled&&e.ready()&&this.m_connectedDataSources.has(e.name)&&e.isVisible(this.zoomLevel)}async addDataSource(e){var t,i;if(void 0!==this.getDataSourceByName(e.name))throw new Error(`A DataSource with the name "${e.name}" already exists in this MapView.`);e.attach(this),e.setEnableElevationOverlay(void 0!==this.m_elevationProvider);const n=this.m_tileDataSources.find((e=>!0===e.addGroundPlane&&!(e instanceof l.BackgroundDataSource)));!0===e.addGroundPlane&&void 0!==n&&N.warn(`The DataSources ${e.name} and ${n.name} both have a ground plane added, this will cause problems with the fallback logic, see HARP-14728 & HARP-15488.`),this.m_tileDataSources.push(e),this.m_connectingDataSources++,null===(t=this.m_sceneEnvironment)||void 0===t||t.updateBackgroun
949dDataSource();try{if(await e.connect(),!this.m_tileDataSources.includes(e))return;e.addEventListener(U.Update,(()=>{this.update()}));const t=await this.getTheme().catch((()=>{}));(null==t?void 0:t.styles)&&await e.setTheme(t),this.m_connectedDataSources.add(e.name),this.dispatchEvent({type:U.DataSourceConnect,dataSourceName:e.name}),this.update()}catch(t){N.debug(`Failed to connect to datasource ${e.name}: ${null!==(i=t.message)&&void 0!==i?i:t}`),this.dispatchEvent({type:U.DataSourceConnect,dataSourceName:e.name,error:t})}finally{this.m_connectingDataSources--}}removeDataSource(e){const t=this.m_tileDataSources.indexOf(e);-1!==t&&(e.detach(this),this.m_visibleTiles.removeDataSource(e),this.m_tileDataSources.splice(t,1),this.m_connectedDataSources.delete(e.name),this.m_sceneEnvironment.updateBackgroundDataSource(),this.update())}get visibleTileSet(){return this.m_visibleTiles}addOverlayText(e){this.m_iconTextRenderer.addOverlayText(e),this.update()}clearOverlayText(){this.m_iconTextRenderer.clearOverlayText()}lookAt(e,t,i,n){if((0,r.isGeoCoordinatesLike)(e)){const r={target:e,zoomLevel:void 0!==t?F.MapViewUtils.calculateZoomLevelFromDistance(this,t):void 0,tilt:i,heading:n};this.lookAtImpl(r)}else"object"==typeof e&&this.lookAtImpl(e)}setCameraGeolocationAndZoom(e,t,i=0,s=0){this.geoCenter=e;let o=Math.min(F.MapViewUtils.MAX_TILT_DEG,s);if(this.projection.type===r.ProjectionType.Spherical){const e=Math.asin(r.EarthConstants.EQUATORIAL_RADIUS/(F.MapViewUtils.calculateDistanceToGroundFromZoomLevel(this,t)+r.EarthConstants.EQUATORIAL_RADIUS)),i=n.MathUtils.radToDeg(e);o=Math.min(o,i)}F.MapViewUtils.zoomOnTargetPosition(this,0,0,t),F.MapViewUtils.setRotation(this,i,o),this.update()}setDynamicProperty(e,t){if(e.startsWith("$"))throw new Error(`failed to update the value of the dynamic property '${e}'`);this.m_env.entries[e]=t,this.update()}removeDynamicProperty(e){if(e.startsWith("$"))throw new Error(`failed to remove the dynamic property '${e}'`);delete this.m_env.entries[e],this.update()}get animating(){return this.m_animationCount>0}beginAnimation(){0==this.m_animationCount++&&(this.update(),this.ANIMATION_STARTED_EVENT.time=Date.now(),this.dispatchEvent(this.ANIMATION_STARTED_EVENT))}endAnimation(){this.m_animationCount>0&&--this.m_animationCount,0===this.m_animationCount&&(this.ANIMATION_FINISHED_EVENT.time=Date.now(),this.dispatchEvent(this.ANIMATION_FINISHED_EVENT))}get cameraIsMoving(){return this.m_movementDetector.cameraIsMoving}get isDynamicFrame(){return!(0===this.taskQueue.numItemsLeft())||!this.m_visibleTiles.allVisibleTilesLoaded||this.m_themeManager.isUpdating()||this.cameraIsMoving||this.animating||this.m_updatePending||this.m_animatedExtrusionHandler.isAnimating||this.m_iconTextRenderer.isUpdatePending||this.m_iconTextRenderer.loading||this.m_connectingDataSources>0}get pixelToWorld(){(0,o.assert)(this.m_camera instanceof n.PerspectiveCamera),(0,o.assert)(void 0!==this.m_options.fovCalculation);const e=h.CameraUtils.getFocalLength(this.m_camera);return(0,o.assert)(void 0!==e),h.CameraUtils.convertScreenToWorldSize(e,this.m_targetDistance,1)}get worldToPixel(){return 1/this.pixelToWorld}get pixelRatio(){return void 0!==this.m_pixelRatio?this.m_pixelRatio:"undefined"!=typeof window&&void 0!==window.devicePixelRatio?window.devicePixelRatio:1}set pixelRatio(e){this.m_pixelRatio=e,this.renderer.getPixelRatio()!==this.pixelRatio&&this.renderer.setPixelRatio(this.pixelRatio)}set maxFps(e){this.m_options.maxFps=e,this.m_taskScheduler.maxFps=e}get maxFps(){return this.m_options.maxFps}set dynamicPixelRatio(e){this.mapRenderingManager.lowResPixelRatio=e}get dynamicPixelRatio(){return this.mapRenderingManager.lowResPixelRatio}getScreenPosition(e){(0,r.isVector3Like)(e)?G.vector3[0].copy(e):this.projection.projectPoint(r.GeoCoordinates.fromObject(e),G.vector3[0]);const t=this.m_screenProjector.project(G.vector3[0]);if(void 0!==t){const{width:e,height:i}=this.getCanvasClientSize();t.x=t.x+e/2,t.y=i-(t.y+i/2)}return t}getWorldPositionAt(e,t,i){this.m_raycaster.setFromCamera(this.getNormalizedScreenCoordinates(e,t),this.m_camera);const n=this.projection.type===r.ProjectionType.Spherical?this.m_raycaster.ray.intersectSphere(this.m_sphere,G.vector3[0]):this.m_raycaster.ray.intersectPlane(this.m_plane,G.vector3[0]);if(null===n&&!0===i){const e=this.m_camera.getWorldDirection(G.vector3[0]).dot(this.m_raycaster.ray.direction);return G.vector3[0].copy(this.m_raycaster.ray.direction).multiplyScalar(this.m_camera.far/e).add(this.m_camera.position)}return n}getGeoCoordinatesAt(e,t,i){const s=this.getWorldPositionAt(e,t,i);if(!s)return null;const o=this.projection.unprojectPoint(s);return this.tileWrappingEnabled||this.projection.type!==r.ProjectionType.Planar||(o.longitude=n.MathUtils.clamp(o.longitude,-180,180)),o}getNormalizedScreenCoordinates(e,t){const{width:i,height:r}=this.getCanvasClientSize();return new n.Vector3(e/i*2-1,-t/r*2+1,0)}intersectMapObjects(e,t,i){return this.m_pickHandler.intersectMapObjects(e,t,i)}resize(e,t){var i;void 0!==(null===(i=this.camera.userData)||void 0===i?void 0:i.focalLength)&&(this.camera.userData.focalLength=void 0),this.m_renderer.setSize(e,t,!1),this.m_renderer.getPixelRatio()!==this.pixelRatio&&this.m_renderer.setPixelRatio(this.pixelRatio),void 0!==this.mapRenderingManager&&this.mapRenderingManager.setSize(e,t),void 0!==this.collisionDebugCanvas&&(this.collisionDebugCanvas.width=e,this.collisionDebugCanvas.height=t),this.updateCameras(),this.update(),this.updateLookAtSettings(),this.dispatchEvent({type:U.Resize,size:{width:e,height:t}})}renderSync(e){void 0===e&&(e=o.PerformanceTimer.now()),this.render(e)}update(){this.disposed?N.warn("update(): MapView has been disposed of."):(this.dispatchEvent(this.UPDATE_EVENT),this.m_updatePending||(this.m_updatePending=!0,this.startRenderLoop()))}get updatePending(){return this.m_updatePending}requestUpdateIfNeeded(){this.update()}
949clearTileCache(e,t){if(void 0!==this.m_visibleTiles){if(void 0!==e){const i=this.getDataSourceByName(e);i&&(this.m_visibleTiles.clearTileCache(i,t),i.clearCache())}else this.m_visibleTiles.clearTileCache(void 0,t),this.m_tileDataSources.forEach((e=>e.clearCache()));void 0!==this.m_elevationProvider&&this.m_elevationProvider.clearCache()}}forEachVisibleTile(e){this.m_visibleTiles.forEachVisibleTile(e)}forEachCachedTile(e){this.m_visibleTiles.forEachCachedTile(e)}markTilesDirty(e,t){this.m_visibleTiles.markTilesDirty(e,t),this.update()}async setElevationSource(e,t,i){this.m_elevationSource&&this.m_elevationSource!==e&&this.removeDataSource(this.m_elevationSource),this.m_tileDataSources.includes(e)||await this.addDataSource(e),this.m_elevationSource=e,this.m_elevationRangeSource=t,this.m_elevationRangeSource.ready()||await this.m_elevationRangeSource.connect(),this.m_elevationProvider=i,this.dataSources.forEach((e=>{e.setEnableElevationOverlay(!0)})),this.m_tileGeometryManager.setTileUpdateCallback((e=>{(0,x.overlayOnElevation)(e)})),this.clearTileCache()}clearElevationSource(e){this.removeDataSource(e),this.m_elevationSource=void 0,this.m_elevationRangeSource=void 0,this.m_elevationProvider=void 0,this.dataSources.forEach((e=>{e.setEnableElevationOverlay(!1)})),this.m_tileGeometryManager.setTileUpdateCallback(void 0),this.clearTileCache()}get fog(){return this.m_sceneEnvironment.fog}setPostEffects(){this.mapRenderingManager.bloom.enabled=!1,this.mapRenderingManager.outline.enabled=!1,this.mapRenderingManager.vignette.enabled=!1,this.mapRenderingManager.sepia.enabled=!1,void 0!==this.m_postEffects&&(void 0!==this.m_postEffects.bloom&&(this.mapRenderingManager.bloom=this.m_postEffects.bloom),void 0!==this.m_postEffects.outline&&(this.mapRenderingManager.outline.enabled=this.m_postEffects.outline.enabled,this.mapRenderingManager.updateOutline(this.m_postEffects.outline)),void 0!==this.m_postEffects.vignette&&(this.mapRenderingManager.vignette=this.m_postEffects.vignette),void 0!==this.m_postEffects.sepia&&(this.mapRenderingManager.sepia=this.m_postEffects.sepia))}get elevationProvider(){return this.m_elevationProvider}get throttlingEnabled(){return!0===this.m_taskScheduler.throttlingEnabled}set throttlingEnabled(e){this.m_taskScheduler.throttlingEnabled=e}get shadowsEnabled(){return!0===this.m_options.enableShadows}set shadowsEnabled(e){void 0!==this.m_renderer.shadowMap&&e!==this.m_renderer.shadowMap.enabled&&(this.m_options.enableShadows=e,this.m_renderer.shadowMap.enabled=e,this.m_renderer.shadowMap.type=n.PCFSoftShadowMap,this.clearTileCache())}extractAttitude(){const e=this.m_camera,t=this.projection,i=G.vector3[1],n=G.transform[0],r=G.matrix4[1];i.setFromMatrixPosition(e.matrixWorld),t.localTangentSpace(this.m_targetGeoPos,n),r.makeBasis(n.xAxis,n.yAxis,n.zAxis),G.matrix4[0].copy(r).invert().multiply(e.matrixWorld),n.xAxis.setFromMatrixColumn(G.matrix4[0],0),n.yAxis.setFromMatrixColumn(G.matrix4[0],1),n.zAxis.setFromMatrixColumn(G.matrix4[0],2);let s=0,o=0,a=0;const l=n.zAxis.dot(i.set(0,0,1));return l<1-1e-10?l>1e-10-1?(s=Math.atan2(n.zAxis.x,-n.zAxis.y),o=Math.acos(n.zAxis.z),a=Math.atan2(n.xAxis.x,n.yAxis.z)):(s=-Math.atan2(-n.yAxis.x,n.xAxis.x),o=180,a=0):(s=Math.atan2(-n.yAxis.x,n.xAxis.x),o=0,a=0),{yaw:s,pitch:o,roll:a}}lookAtImpl(e){var t,i;const s=this.projection,o=this.camera,a=Math.min(null!==(t=e.tilt)&&void 0!==t?t:this.tilt,F.MapViewUtils.MAX_TILT_DEG),l=-(null!==(i=e.heading)&&void 0!==i?i:this.heading),c=void 0!==e.zoomLevel?F.MapViewUtils.calculateDistanceFromZoomLevel(this,n.MathUtils.clamp(e.zoomLevel,this.m_minZoomLevel,this.m_maxZoomLevel)):e.distance,h=e.target?r.GeoCoordinates.fromObject(e.target):void 0;if(e.bounds)(0,v.fitLookAtBounds)({target:this.target,camera:this.camera,cameraSettings:this,projection:this.projection,maxZoomLevel:this.maxZoomLevel,viewportSize:this.m_renderer.getSize(G.vector2[0]),tileWrapping:this.tileWrappingEnabled},{bounds:e.bounds,target:h,distance:c,yaw:l,tilt:a,padding:e.padding});else{const e=null!=h?h:this.target;F.MapViewUtils.getCameraRotationAtTarget(s,e,l,a,o.quaternion);const t=null!=c?c:this.m_targetDistance;F.MapViewUtils.getCameraPositionFromTarget(e,t,l,a,s,o.position),o.updateMatrixWorld(!0)}this.updateLookAtSettings(),this.update()}updatePolarDataSource(){const e=this.m_polarDataSource;if(!0===this.m_enablePolarDataSource&&void 0!==e){const t=this.getDataSourceByName(e.name);this.projection.type===r.ProjectionType.Spherical?void 0===t&&this.addDataSource(e):void 0!==t&&this.removeDataSource(e)}}updateCameras(e){var t;this.m_camera.updateMatrixWorld(!1),this.updateLookAtSettings();const{width:i,height:n}=this.m_renderer.getSize(G.vector2[0]);this.m_camera.aspect=void 0!==this.m_forceCameraAspect?this.m_forceCameraAspect:i/n,this.setFovOnCamera(this.m_options.fovCalculation,n);const r=this.projection.getScaleFactor(this.camera.position),s=r*this.m_tileDataSources.reduce(((e,t)=>Math.max(e,t.maxGeometryHeight)),0),o=r*this.m_tileDataSources.reduce(((e,t)=>Math.min(e,t.minGeometryHeight)),0);Object.assign(this.m_viewRanges,void 0===e?this.m_visibleTiles.updateClipPlanes(s,o):e),this.m_camera.near=this.m_viewRanges.near,this.m_camera.far=this.m_viewRanges.far,this.m_camera.updateProjectionMatrix(),this.m_rteCamera.copy(this.m_camera),this.m_rteCamera.position.setScalar(0),this.m_rteCamera.updateMatrixWorld(!0),null===(t=this.m_iconTextRenderer)||void 0===t||t.updateCamera(),this.m_screenProjector.update(this.camera,i,n),this.updateEnv(),this.m_sceneEnvironment.update(
949)}updateLookAtSettings(){let{target:e,distance:t,final:i}=F.MapViewUtils.getTargetAndDistance(this.projection,this.camera,this.elevationProvider);i||this.update(),this.geoMaxBounds&&({target:e,distance:t}=F.MapViewUtils.constrainTargetAndDistanceToViewBounds(e,t,this)),this.m_targetWorldPos.copy(e),this.m_targetGeoPos=this.projection.unprojectPoint(this.m_targetWorldPos),this.m_targetDistance=t,this.m_zoomLevel=F.MapViewUtils.calculateZoomLevelFromDistance(this,this.m_targetDistance);const{yaw:n,pitch:r,roll:s}=this.extractAttitude();this.m_yaw=n,this.m_pitch=r,this.m_roll=s}updateEnv(){this.m_env.entries.$zoom=this.m_zoomLevel,this.m_env.entries.$shouldAntialiasRasterTile=this.m_zoomLevel%1!=0||0!==this.m_yaw||0!==this.m_pitch||0!==this.m_roll,this.m_env.entries.$pixelToMeters=this.pixelToWorld,this.m_env.entries.$frameNumber=this.m_frameNumber}ndcToView(e,t){return t.set(e.x,e.y,e.z).applyMatrix4(this.camera.projectionMatrixInverse).applyMatrix4(this.m_rteCamera.matrixWorld),t}renderLoop(e){if(!0!==this.m_options.synchronousRendering&&!this.disposed){if(0===this.maxFps)this.render(e);else{const t=3,i=1e3/this.maxFps;e>=(void 0===this.m_previousFrameTimeStamp?0:this.m_previousFrameTimeStamp)+i-t&&this.render(e)}this.isDynamicFrame?this.m_animationFrameHandle=requestAnimationFrame(this.handleRequestAnimationFrame):this.m_animationFrameHandle=void 0}}startRenderLoop(){void 0!==this.m_animationFrameHandle||this.m_options.synchronousRendering||(this.m_animationFrameHandle=requestAnimationFrame(this.handleRequestAnimationFrame))}getEnabledTileDataSources(){const e=[];for(const t of this.m_tileDataSources)this.isDataSourceEnabled(t)&&e.push(t);return e}render(e){if(this.m_drawing)return;if(this.disposed)return void N.warn("render(): MapView has been disposed of.");let t;this.RENDER_EVENT.time=e,this.dispatchEvent(this.RENDER_EVENT),this.m_tileObjectRenderer.prepareRender(),++this.m_frameNumber;const i=O.PerformanceStatistics.instance,n=i.enabled;if(n){if(t=i.currentFrame,void 0!==this.m_previousFrameTimeStamp){const i=e-this.m_previousFrameTimeStamp;t.setValue("render.fps",1e3/i)}i.storeAndClearFrameInfo(),t.setValue("renderCount.frameNumber",this.m_frameNumber)}let r,s,a,l,c,h;if(this.m_previousFrameTimeStamp=e,this.m_renderer.info.reset(),this.m_updatePending=!1,this.m_thisFrameTilesChanged=void 0,this.m_drawing=!0,this.m_renderer.getPixelRatio()!==this.pixelRatio&&this.m_renderer.setPixelRatio(this.pixelRatio),this.updateCameras(),this.m_renderer.clear(),this.m_sceneRoot.children.length=0,this.m_overlaySceneRoot.children.length=0,n&&(r=o.PerformanceTimer.now()),!this.lockVisibleTileSet){const e=this.m_visibleTiles.updateRenderList(this.storageLevel,Math.floor(this.zoomLevel),this.getEnabledTileDataSources(),this.m_frameNumber,this.m_elevationRangeSource);e.viewRangesChanged&&this.updateCameras(e.viewRanges)}n&&(s=o.PerformanceTimer.now());const u=this.m_visibleTiles.dataSourceTileList;if(u.forEach((({zoomLevel:e,renderedTiles:t})=>{t.forEach((t=>{this.m_tileObjectRenderer.render(t,e,this.zoomLevel,this.m_camera.position,this.m_sceneRoot),t.frameNumLastVisible=this.m_frameNumber}))})),this.m_mapAnchors.update(this.projection,this.camera.position,this.m_sceneRoot,this.m_overlaySceneRoot),this.m_animatedExtrusionHandler.update(this.zoomLevel),void 0!==t&&(t.addValue("renderCount.numTilesRendered",0),t.addValue("renderCount.numTilesVisible",0),t.addValue("renderCount.numTilesLoading",0),u.forEach((({zoomLevel:e,renderedTiles:i,visibleTiles:n,numTilesLoading:r})=>{t.addValue("renderCount.numTilesRendered",i.size),t.addValue("renderCount.numTilesVisible",n.length),t.addValue("renderCount.numTilesLoading",r)}))),this.m_movementDetector.checkCameraMoved(this,e)){const{latitude:e,longitude:t,altitude:i}=this.geoCenter;this.dispatchEvent({type:U.CameraPositionChanged,latitude:e,longitude:t,altitude:i,yaw:this.m_yaw,pitch:this.m_pitch,roll:this.m_roll,tilt:this.tilt,heading:this.heading,zoom:this.zoomLevel})}const d=void 0!==this.m_pointOfView?this.m_pointOfView:this.m_rteCamera;if(this.renderLabels&&!this.m_pointOfView&&this.m_iconTextRenderer.placeText(u,e),n&&(a=o.PerformanceTimer.now()),this.mapRenderingManager.render(this.m_renderer,this.m_scene,d,!this.isDynamicFrame),n&&(l=o.PerformanceTimer.now()),this.renderLabels&&!this.m_pointOfVie
949w&&this.m_iconTextRenderer.renderText(this.m_viewRanges.maximum),this.m_overlaySceneRoot.children.length>0&&this.m_renderer.render(this.m_overlayScene,d),n&&(c=o.PerformanceTimer.now()),this.m_firstFrameRendered||(this.m_firstFrameRendered=!0,n&&i.appResults.set("firstFrame",e),this.FIRST_FRAME_EVENT.time=e,this.dispatchEvent(this.FIRST_FRAME_EVENT)),this.m_visibleTiles.disposePendingTiles(),this.m_drawing=!1,this.checkCopyrightUpdates(),void 0!==this.m_taskSchedulerTimeout&&clearTimeout(this.m_taskSchedulerTimeout),this.m_taskSchedulerTimeout=setTimeout((()=>{this.m_taskSchedulerTimeout=void 0,this.m_taskScheduler.processPending(e)}),0),void 0!==t){h=o.PerformanceTimer.now();const n=h-e;t.setValue("render.setupTime",r-e),t.setValue("render.cullTime",s-r),t.setValue("render.textPlacementTime",a-s),t.setValue("render.drawTime",l-a),t.setValue("render.textDrawTime",c-l),t.setValue("render.cleanupTime",h-c),t.setValue("render.frameRenderTime",n),t.setValue("render.fullFrameTime",n),t.setValue("render.geometryCreationTime",0),i.addWebGLInfo(this.m_renderer.info),i.addMemoryInfo()}this.DID_RENDER_EVENT.time=e,this.dispatchEvent(this.DID_RENDER_EVENT),this.isDynamicFrame||(!1===this.m_firstFrameComplete&&(this.m_firstFrameComplete=!0,n&&i.appResults.set("firstFrameComplete",e)),this.FRAME_COMPLETE_EVENT.time=e,this.dispatchEvent(this.FRAME_COMPLETE_EVENT))}setupCamera(){(0,o.assert)(void 0!==this.m_visibleTiles),this.m_options.target=r.GeoCoordinates.fromObject((0,o.getOptionValue)(this.m_options.target,H.target)),this.m_options.target.altitude=0,this.m_options.tilt=(0,o.getOptionValue)(this.m_options.tilt,H.tilt),this.m_options.heading=(0,o.getOptionValue)(this.m_options.heading,H.heading),this.m_options.zoomLevel=(0,o.getOptionValue)(this.m_options.zoomLevel,H.zoomLevel),this.lookAtImpl(this.m_options);const{width:e,height:t}=this.getCanvasClientSize();this.resize(e,t)}createVisibleTileSet(){(0,o.assert)(void 0!==this.m_tileGeometryManager),this.m_visibleTiles&&(this.m_visibleTiles.clearTileCache(),this.m_visibleTiles.disposePendingTiles());const e=void 0===this.m_enableMixedLod?this.projection.type===r.ProjectionType.Spherical:this.m_enableMixedLod;return this.m_visibleTiles=new V.VisibleTileSet(new _.FrustumIntersection(this.m_camera,this,this.m_visibleTileSetOptions.extendedFrustumCulling,this.m_tileWrappingEnabled,e,this.m_lodMinTilePixelSize),this.m_tileGeometryManager,this.m_visibleTileSetOptions),this.m_visibleTiles}movementStarted(){this.m_iconTextRenderer.movementStarted(),this.MOVEMENT_STARTED_EVENT.time=Date.now(),this.dispatchEvent(this.MOVEMENT_STARTED_EVENT)}movementFinished(){this.m_iconTextRenderer.movementFinished(),this.MOVEMENT_FINISHED_EVENT.time=Date.now(),this.dispatchEvent(this.MOVEMENT_FINISHED_EVENT),this.animating||(void 0!==this.m_movementFinishedUpdateTimerId&&clearTimeout(this.m_movementFinishedUpdateTimerId),this.m_movementFinishedUpdateTimerId=setTimeout((()=>{this.m_movementFinishedUpdateTimerId=void 0,this.update()}),0))}checkIfTilesChanged(){if(void 0!==this.m_thisFrameTilesChanged)return this.m_thisFrameTilesChanged;const e=this.m_visibleTiles.dataSourceTileList,t=[];t.length=0,e.forEach((({dataSource:e,renderedTiles:i})=>{i.forEach((i=>{t.push(e.name+"-"+i.tileKey.mortonCode())}))})),t.sort();const i=t.join("#");return i!==this.m_lastTileIds?(this.m_lastTileIds=i,this.m_thisFrameTilesChanged=!0):this.m_thisFrameTilesChanged=!1,this.m_thisFrameTilesChanged}checkCopyrightUpdates(){if(!this.checkIfTilesChanged())return;const e=this.getRenderedTilesCopyrightInfo();if(e!==this.m_copyrightInfo){if(e.length===this.m_copyrightInfo.length){let t=!0;for(let i=0;i<e.length;i++){const n=e[i],r=this.m_copyrightInfo[i];if(n.label!==r.label){t=!1;break}}if(t)return}this.m_copyrightInfo=e,this.dispatchEvent(this.COPYRIGHT_CHANGED_EVENT)}}getRenderedTilesCopyrightInfo(){let e=[];for(const t of this.m_visibleTiles.dataSourceTileList)for(const i of t.renderedTiles.values()){const t=i.copyrightInfo;void 0!==t&&0!==t.length&&(e=f.CopyrightInfo.mergeArrays(e,t))}return e}setupStats(e){new O.PerformanceStatistics(e,1e3)}setupRenderer(e){var t;this.m_scene.add(this.m_sceneRoot),this.m_overlayScene.add(this.m_overlaySceneRoot),this.shadowsEnabled=null!==(t=this.m_options.enableShadows)&&void 0!==t&&t,e.setupRenderer()}createTextRenderer(){return new w.IconTextRenderer(new M.MapViewState(this,this.checkIfTilesChanged.bind(this)),this.m_screenProjector,this.m_imageRepo,this.m_textureCache,this.m_renderer,this.m_options)}setFovOnCamera(e,t){const i=n.MathUtils.degToRad(e.fov);if("fixed"===e.type)return void h.CameraUtils.setVerticalFov(this.m_camera,i,t);let r=h.CameraUtils.getFocalLength(this.m_camera);void 0===r&&(h.CameraUtils.setVerticalFov(this.m_camera,i,t),r=h.CameraUtils.getFocalLength(this.m_camera)),h.CameraUtils.setFocalLength(this.m_camera,r,t)}getCanvasClientSize(){let e,t;const{clientWidth:i,clientHeight:n}=this.canvas;if(i>0&&n>0)e=i,t=n;else{const i=this.m_renderer.getPixelRatio();e=Math.round(this.canvas.width/i),t=Math.round(this.canvas.height/i)}return 0!==e&&0!==t||(e=t=1),{width:e,height:t}}}t.MapView=W},4247:(e,t,i)=>{"use strict";
949Object.defineProperty(t,"__esModule",{value:!0}),t.MapViewAtmosphere=t.AtmosphereLightMode=void 0;const n=i(82),r=i(2616),s=i(4250),o=i(4342),a=i(9978);var l,c,h;!function(e){e[e.Ground=1]="Ground",e[e.Sky=2]="Sky",e[e.SkyAndGround=3]="SkyAndGround"}(l||(l={})),function(e){e[e.ScatteringShader=0]="ScatteringShader",e[e.SimpleColor=1]="SimpleColor",e[e.Wireframe=2]="Wireframe"}(c||(c={})),function(e){e[e.LightOverhead=0]="LightOverhead",e[e.LightDynamic=1]="LightDynamic"}(h=t.AtmosphereLightMode||(t.AtmosphereLightMode={}));const u={clipPlanes:{near:0,far:0}};class d{static isPresent(e){for(const t of e.children)if(t.name===d.SkyAtmosphereUserName||t.name===d.GroundAtmosphereUserName)return!0;return!1}constructor(e,t,i,s,o,h=l.SkyAndGround,u=c.ScatteringShader){this.m_mapAnchors=e,this.m_sceneCamera=t,this.m_projection=i,this.m_rendererCapabilities=s,this.m_updateCallback=o,this.m_atmosphereVariant=h,this.m_materialVariant=u,this.m_enabled=!0,this.m_clipPlanesEvaluator=new a.TiltViewClipPlanesEvaluator(.025*r.EarthConstants.EQUATORIAL_RADIUS,0,1,.05,1e7),this.m_lightDirection=new n.Vector3(0,1,0),this.m_atmosphereVariant&l.Sky&&this.createSkyGeometry(),this.m_atmosphereVariant&l.Ground&&this.createGroundGeometry(),this.addToMapAnchors(this.m_mapAnchors)}get skyMesh(){return this.m_skyMesh}get groundMesh(){return this.m_groundMesh}set enabled(e){if(this.disposed)return;if(this.m_enabled===e)return;this.m_enabled=e;const t=d.isPresent(this.m_mapAnchors);e&&!t?this.addToMapAnchors(this.m_mapAnchors):!e&&t&&this.removeFromMapAnchors(this.m_mapAnchors)}get enabled(){return this.m_enabled}set lightMode(e){if(this.m_materialVariant!==c.ScatteringShader)return;const t=e===h.LightDynamic;void 0!==this.m_groundMaterial&&this.m_groundMaterial.setDynamicLighting(t),void 0!==this.m_skyMaterial&&this.m_skyMaterial.setDynamicLighting(t)}dispose(){var e,t,i,n;this.enabled&&(this.enabled=!1),null===(e=this.m_skyMaterial)||void 0===e||e.dispose(),null===(t=this.m_groundMaterial)||void 0===t||t.dispose(),null===(i=this.m_skyGeometry)||void 0===i||i.dispose(),null===(n=this.m_groundGeometry)||void 0===n||n.dispose(),this.m_skyGeometry=void 0,this.m_groundGeometry=void 0,this.m_skyMaterial=void 0,this.m_groundMaterial=void 0,this.m_skyMesh=void 0,this.m_groundMesh=void 0}reset(e){}get disposed(){return void 0===this.m_skyMesh&&void 0===this.m_groundMesh}addToMapAnchors(e){(0,o.assert)(!d.isPresent(e),"Atmosphere already added"),void 0!==this.m_skyMesh&&e.add(m(this.m_skyMesh,Number.MIN_SAFE_INTEGER)),void 0!==this.m_groundMesh&&e.add(m(this.m_groundMesh,Number.MAX_SAFE_INTEGER)),this.m_updateCallback&&this.m_updateCallback()}removeFromMapAnchors(e){if(!d.isPresent(e))return;let t=!1;void 0!==this.m_skyMesh&&(e.remove(this.m_skyMesh),t=!0),void 0!==this.m_groundMesh&&(e.remove(this.m_groundMesh),t=!0),t&&this.m_updateCallback&&this.m_updateCallback()}createSkyGeometry(){this.m_projection.type===r.ProjectionType.Spherical?this.m_skyGeometry=new n.SphereGeometry(1.025*r.EarthConstants.EQUATORIAL_RADIUS,256,256):this.m_skyGeometry=new n.PlaneGeometry(200,200),this.m_skyGeometry.translate(0,0,0),this.m_materialVariant===c.ScatteringShader?this.m_skyMaterial=new s.SkyAtmosphereMaterial({rendererCapabilities:this.m_rendererCapabilities}):this.m_materialVariant===c.SimpleColor?this.m_skyMaterial=new n.MeshBasicMaterial({color:new n.Color(12908781),opacity:.4,transparent:!1,depthTest:!0,depthWrite:!1,side:n.BackSide,blending:n.NormalBlending,fog:!1}):this.m_skyMaterial=new n.MeshStandardMaterial({color:8388607,depthTest:!1,depthWrite:!1,normalScale:new n.Vector2(-1,-1),side:n.BackSide,wireframe:!0}),this.m_skyMesh=new n.Mesh(this.m_skyGeometry,this.m_skyMaterial),this.m_skyMesh.name=d.SkyAtmosphereUserName,this.setupSkyForRendering()}createGroundGeometry(){this.m_projection.type===r.ProjectionType.Spherical?this.m_groundGeometry=new n.SphereGeometry(1.0001*r.EarthConstants.EQUATORIAL_RADIUS,256,256):this.m_groundGeometry=new n.PlaneGeometry(200,200),this.m_groundGeometry.translate(0,0,0),this.m_materialVariant===c.ScatteringShader?this.m_groundMaterial=new s.GroundAtmosphereMaterial({rendererCapabilities:this.m_rendererCapabilities}):this.m_materialVariant===c.SimpleColor?this.m_groundMaterial=new n.MeshBasicMaterial({color:new n.Color(50687),opacity:.4,transparent:!0,depthTest:!1,depthWrite:!1,side:n.FrontSide,blending:n.NormalBlending,fog:!1}):this.m_groundMaterial=new n.MeshStandardMaterial({color:1149338,depthTest:!0,depthWrite:!1,side:n.FrontSide,wireframe:!0}),this.m_groundMesh=new n.Mesh(this.m_groundGeometry,this.m_groundMaterial),this.m_groundMesh.name=d.GroundAtmosphereUserName,this.setupGroundForRendering()}setupSkyForRendering(){if(void 0===this.m_skyMesh)return;let e;e=this.m_materialVariant!==c.ScatteringShader?(e,t)=>{this.overrideClipPlanes(e)}:(e,t)=>{this.overrideClipPlanes(e),(0,o.assert)(t instanceof s.SkyAtmosphereMaterial);const i=this.m_skyMaterial;i.updateUniforms(i,this.m_skyMesh,e,this.m_lightDirection)},(0,o.assert)(void 0!==this.m_skyMaterial),this.m_skyMesh.onBeforeRender=(t,i,n,r,s,o)=>{e(n,s)},this.m_skyMesh.onAfterRender=(e,t,i,n,r,s)=>{this.revertClipPlanes(i)}}setupGroundForRendering(){void 0!==this.m_groundMesh&&this.m_materialVariant===c.ScatteringShader&&((0,o.assert)(void 0!==this.m_groundMaterial),this.m_groundMesh.onBeforeRender=(e,t,i,n,r,a)=>{(0,o.assert)(r instanceof s.GroundAtmosphereMaterial);const l=this.m_groundMaterial;l.updateUniforms(l,this.m_groundMesh,i,this.m_lightDirection)})}overrideClipPlanes(e){const t=this.m_sceneCamera;u.clipPlanes.near=t.near,u.clipPlanes.far=t.far;
949const i=this.m_clipPlanesEvaluator.evaluateClipPlanes(this.m_sceneCamera,this.m_projection);(0,o.assert)(e instanceof n.PerspectiveCamera);const s=e;s.near=i.near,s.far=i.far+.1*r.EarthConstants.EQUATORIAL_RADIUS,s.updateProjectionMatrix()}revertClipPlanes(e){(0,o.assert)(e instanceof n.PerspectiveCamera);const t=e;t.near=u.clipPlanes.near,t.far=u.clipPlanes.far,t.updateProjectionMatrix()}}function m(e,t){const i=e;return i.renderOrder=t,i.pickable=!1,i.anchor=new n.Vector3(0,0,0),i}t.MapViewAtmosphere=d,d.SkyAtmosphereUserName="SkyAtmosphere",d.GroundAtmosphereUserName="GroundAtmosphere"},3011:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MapViewEnvironment=t.DEFAULT_CLEAR_COLOR=void 0;const n=i(2616),r=i(8023),s=i(7610),o=i(4342),a=i(82),l=i(5863),c=i(3977),h=i(3061),u=i(7775),d=i(5640),m=o.LoggerManager.instance.create("MapViewEnvironment");t.DEFAULT_CLEAR_COLOR=16777215;const p={vector3:[new a.Vector3,new a.Vector3,new a.Vector3],frustumPoints:[new a.Vector3,new a.Vector3,new a.Vector3,
949new a.Vector3,new a.Vector3,new a.Vector3,new a.Vector3,new a.Vector3]};t.MapViewEnvironment=class{constructor(e,t){this.m_mapView=e,this.m_lastZoomLevelOnUpdate=NaN,this.onMapViewContextRestored=e=>{void 0!==this.m_mapView.renderer&&this.m_mapView.getTheme().then((e=>{this.updateClearColor(e.clearColor,e.clearAlpha,e.definitions),this.m_mapView.update()}))},this.applyClearColorAndAlpha=()=>{const e=this.evaluateClearColor(),t=r.Expr.isExpr(this.m_clearAlpha)?this.m_clearAlpha.evaluate(this.m_mapView.env,r.ExprScope.Dynamic):this.m_clearAlpha;void 0!==this.m_mapView.renderer&&this.m_mapView.renderer.setClearColor(e,t)},this.m_fog=new h.MapViewFog(this.m_mapView.scene),!1!==t.addBackgroundDatasource&&(this.m_backgroundDataSource=new l.BackgroundDataSource(t.backgroundTilingScheme),this.m_mapView.addDataSource(this.m_backgroundDataSource)),this.m_mapView.addEventListener(c.MapViewEventNames.ContextRestored,this.onMapViewContextRestored),this.updateClearColor()}get lights(){var e;return null!==(e=this.m_createdLights)&&void 0!==e?e:[]}get fog(){return this.m_fog}
949updateBackgroundDataSource(){this.m_backgroundDataSource&&this.m_backgroundDataSource.updateStorageLevelOffset()}update(){this.m_lastZoomLevelOnUpdate!==this.m_mapView.zoomLevel&&(this.m_lastZoomLevelOnUpdate=this.m_mapView.zoomLevel,this.applyClearColorAndAlpha()),this.m_fog.update(this.m_mapView,this.m_mapView.viewRanges.maximum),this.m_skyBackground&&this.m_mapView.projection.type===n.ProjectionType.Planar&&this.m_skyBackground.updateCamera(this.m_mapView.camera),this.updateLights()}updateClearColor(e,i,n){if(void 0===e)this.m_clearColor=t.DEFAULT_CLEAR_COLOR;else{const t=r.Expr.fromJSON(e,n);this.m_clearColor=t.isDynamic()?t:t.evaluate(this.m_mapView.env,r.ExprScope.Value)}if(void 0===i)this.m_clearAlpha=i;else{const e=r.Expr.fromJSON(i,n);this.m_clearAlpha=e.isDynamic()?e:e.evaluate(this.m_mapView.env,r.ExprScope.Value)}this.applyClearColorAndAlpha()}evaluateClearColor(){let e;if(r.Expr.isExpr(this.m_clearColor)){const t=this.m_clearColor.evaluate(this.m_mapView.env,r.ExprScope.Dynamic);e=t instanceof s.RGBA?t.getHex():t}else e=this.m_clearColor;return e}updateSkyBackground(e){e?this.setSkyBackground(e):this.removeSkyBackGround()}updateLighting(e){var t;this.m_createdLights&&this.m_createdLights.forEach((e=>{this.m_mapView.scene.remove(e)})),null===(t=this.m_overlayCreatedLights)||void 0===t||t.forEach((e=>{this.m_mapView.overlayScene.remove(e),e instanceof a.DirectionalLight&&this.m_mapView.overlayScene.remove(e.target)})),void 0!==e&&(this.m_createdLights=[],this.m_overlayCreatedLights=[],e.forEach((e=>{const t=(0,d.createLight)(e);if(!t)return void m.warn(`MapView: failed to create light ${e.name} of type ${e.type}`);if(this.m_mapView.scene.add(t),t.isDirectionalLight){const e=t;this.m_mapView.scene.add(e.target)}this.m_createdLights.push(t);const i=t.clone();this.m_mapView.overlayScene.add(i),i instanceof a.DirectionalLight&&this.m_mapView.overlayScene.add(i.target.clone())})))}updateLights(){if(!this.m_mapView.shadowsEnabled||this.m_mapView.projection.type===n.ProjectionType.Spherical||void 0===this.m_createdLights||0===this.m_createdLights.length)return;const e=[{x:-1,y:-1,z:-1},{x:1,y:-1,z:-1},{x:-1,y:1,z:-1},{x:1,y:1,z:-1},{x:-1,y:-1,z:1},{x:1,y:-1,z:1},{x:-1,y:1,z:1},{x:1,y:1,z:1}].map(((e,t)=>this.m_mapView.ndcToView(e,p.frustumPoints[t])));this.m_createdLights.forEach((t=>{const i=t;if(!0===i.isDirectionalLight){const t=p.vector3[0];t.copy(i.target.position),t.sub(i.position),t.normalize();const r=p.vector3[1];this.m_mapView.projection.type===n.ProjectionType.Planar&&r.set(0,0,-1);const s=this.m_mapView.tilt,o=this.m_mapView.targetDistance*Math.cos(a.MathUtils.degToRad(s))/r.dot(t);i.target.position.copy(this.m_mapView.worldTarget).sub(this.m_mapView.camera.position),i.position.copy(this.m_mapView.worldTarget),i.position.addScaledVector(t,-o),i.position.sub(this.m_mapView.camera.position),i.updateMatrixWorld(),i.shadow.updateMatrices(i);const l=i.shadow.camera,c=e.map((e=>this.viewToLightSpace(e.clone(),l))),h=new a.Box3;c.forEach((e=>{h.expandByPoint(e)})),l.left=h.min.x,l.right=h.max.x,l.top=h.max.y,l.bottom=h.min.y,l.near=.95*-h.max.z,l.far=-h.min.z,l.updateProjectionMatrix()}}))}removeSkyBackGround(){this.m_mapView.scene.background=null,void 0!==this.m_skyBackground&&(this.m_skyBackground.dispose(),this.m_skyBackground=void 0)}setSkyBackground(e){var t;this.m_skyBackground?this.m_skyBackground.updateTexture(e,this.m_mapView.projection.type):this.m_skyBackground=new u.SkyBackground(e,this.m_mapView.projection.type,this.m_mapView.camera),this.m_mapView.scene.background=null===(t=this.m_skyBackground)||void 0===t?void 0:t.texture}viewToLightSpace(e,t){return e.applyMatrix4(t.matrixWorldInverse)}}},3061:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MapViewFog=void 0;const n=i(82),r=i(4250),s=i(4342);t.MapViewFog=class{constructor(e){this.m_scene=e,this.m_enabled=!0,this.m_fog=new n.Fog(0),this.m_fogIsDefined=!1}set enabled(e){this.m_enabled=e,e&&this.m_fogIsDefined&&null===this.m_scene.fog?this.add():e||null===this.m_scene.fog||this.remove()}get enabled(){return this.m_enabled}reset(e){this.m_cachedFog=e,void 0!==e&&void 0!==e.color&&void 0!==e.startRatio?(this.m_fogIsDefined=!0,this.m_fog.color.set(e.color),this.m_enabled&&null===this.m_scene.fog&&this.add()):(this.m_fogIsDefined=!1,null!==this.m_scene.fog&&this.remove())}update(e,t){if(null!==this.m_scene.fog&&void 0!==this.m_cachedFog&&this.m_cachedFog&&void 0!==this.m_cachedFog.startRatio&&(void 0!==e.camera.far||void 0!==t)){const i=void 0!==t?t:e.camera.far,r=1,o=0,a=this.m_cachedFog.startRatio,l=1;(0,s.assert)(a<=l);const c=Math.abs(Math.cos(e.tilt)),h=s.MathUtils.smoothStep(r,o,c);this.m_fog.near=n.MathUtils.lerp(i*a,i,1-h),this.m_fog.far=n.MathUtils.lerp(i*l,i,h),this.m_fog.near=Math.min(this.m_fog.near,e.camera.far),this.m_fog.far=Math.min(this.m_fog.far,e.camera.far)}}add(){this.m_scene.fog=this.m_fog,this.setFogInRawShaderMaterials(!0)}remove(){this.m_scene.fog=null,this.setFogInRawShaderMaterials(!1)}setFogInRawShaderMaterials(e){this.m_scene.traverse((t=>{if(t instanceof n.Mesh){const i=t.material;i instanceof n.Material&&!(i instanceof r.HighPrecisionLineMaterial)&&i.fog!==e&&(i.fog=e,i instanceof r.RawShaderMaterial&&i.invalidateFog())}}))}}},5146:(e,t,i)=>{"use strict";
949Object.defineProperty(t,"__esModule",{value:!0}),t.Squares=t.Circles=t.MapViewPoints=void 0;const n=i(82);class r extends n.Points{constructor(){super(...arguments),this.enableRayTesting=!0}raycast(e,t){if(!this.enableRayTesting)return;const i=this.geometry,r=this.matrixWorld,o=s(e.ray.origin.clone().add(e.ray.direction).project(e.camera),e),a=(i,n)=>{const a=function(e,t,i){const n=e.clone().applyMatrix4(t),r=n.distanceTo(i.ray.origin),o=n.project(i.camera),a=o.x<1&&o.x>-1&&o.y<1&&o.y>-1;return a?{absoluteScreenPosition:s(o,i),pointIsOnScreen:a,distance:r}:{pointIsOnScreen:a}}(i,r,e);a.pointIsOnScreen&&this.testPoint(i,a.absoluteScreenPosition,o,n,a.distance,t)},l=new n.Vector3,c=i.index,h=i.attributes.position.array;if(null!==c){const e=c.array;for(let t=0,i=e.length;t<i;t++)a(l.fromArray(h,3*e[t]),t)}else for(let e=0,t=h.length/3;e<t;e++)a(l.fromArray(h,3*e),e)}}function s(e,t){return new n.Vector2(e.x+1,1-e.y).divideScalar(2).multiply(t.canvasSize).ceil()}t.MapViewPoints=r,t.Circles=class extends r{testPoint(e,t,i,n,r,s){const o=t.x-i.x,a=t.y-i.y;Math.sqrt(o*o+a*a)<=this.material.size/2&&s.push({point:e,distance:r,index:n,object:this})}},t.Squares=class extends r{testPoint(e,t,i,n,r,s){const o=t.x-i.x,a=t.y-i.y,l=this.material.size/2;Math.abs(o)<=l&&Math.abs(a)<=l&&s.push({point:e,distance:r,index:n,object:this})}}},19:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MapViewTaskScheduler=void 0;const n=i(4342),r=i(82),s=i(3977),o=i(8015),a={type:"update"};class l extends r.EventDispatcher{constructor(e=60){super(),this.m_maxFps=e,this.m_throttlingEnabled=!1,this.m_taskQueue=new n.Task
949Queue({groups:[s.TileTaskGroups.FETCH_AND_DECODE,s.TileTaskGroups.CREATE],prioSortFn:(e,t)=>e.getPriority()-t.getPriority()}),this.maxFps=e}set maxFps(e){this.m_maxFps=e<=0?60:e}get maxFps(){return this.m_maxFps}get taskQueue(){return this.m_taskQueue}get throttlingEnabled(){return!0===this.m_throttlingEnabled}set throttlingEnabled(e){this.m_throttlingEnabled=e}requestUpdate(){this.dispatchEvent(a)}processPending(e){const t=o.PerformanceStatistics.instance,i=t.enabled?t.currentFrame:void 0;let r;t.enabled&&(r=n.PerformanceTimer.now()),this.m_taskQueue.update();let a=this.taskQueue.numItemsLeft();if(null==i||i.setValue("TaskScheduler.numPendingTasks",a),this.throttlingEnabled){let l=this.spaceInFrame(e);l=l>2?l-2:l,null==i||i.setValue("TaskScheduler.estimatedAvailableTime",l);let c=0;for(;l>0&&a>0;){function h(e){var t,i;return l-=null!==(i=null===(t=e.estimatedProcessTime)||void 0===t?void 0:t.call(e))&&void 0!==i?i:2,l>0||1===c}c++,[s.TileTaskGroups.CREATE,s.TileTaskGroups.FETCH_AND_DECODE].forEach((e=>{this.m_taskQueue.numItemsLeft(e)&&this.m_taskQueue.processNext(e,h)})),a=this.m_taskQueue.numItemsLeft()}a=this.m_taskQueue.numItemsLeft(),a>0&&(null==i||i.setValue("TaskScheduler.pendingTasksNotYetProcessed",a),this.requestUpdate())}else this.m_taskQueue.processNext(s.TileTaskGroups.CREATE,void 0,this.m_taskQueue.numItemsLeft(s.TileTaskGroups.CREATE)),this.m_taskQueue.processNext(s.TileTaskGroups.FETCH_AND_DECODE,void 0,this.m_taskQueue.numItemsLeft(s.TileTaskGroups.FETCH_AND_DECODE));t.enabled&&(null==i||i.setValue("TaskScheduler.pendingTasksTime",n.PerformanceTimer.now()-r))}clearQueuedTasks(){this.m_taskQueue.clear()}spaceInFrame(e){const t=(performance||Date).now()-e;return Math.max(1e3/this.m_maxFps-t,0)}}t.MapViewTaskScheduler=l},6272:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MapViewThemeManager=void 0;const n=i(6586);function r(e,t){return JSON.stringify(e)===JSON.stringify(t)}t.MapViewThemeManager=class{constructor(e,t,i,n){this.m_mapView=e,this.m_theme=t,this.m_imageRepo=i,this.m_uriResolver=n,this.m_isUpdating=!1,this.m_cachedCompleteTheme={},this.m_abortController=new AbortController,this.m_completeThemePromise=this.setTheme(this.m_theme)}setTheme(e,t){var i;return this.m_abortController.abort("Abort an ongoing setTheme call due to a new setTheme call"),this.m_abortController=new AbortController,this.m_isUpdating=!0,this.m_completeThemePromise=this.loadTheme(e,t,null===(i=this.m_abortController)||void 0===i?void 0:i.signal).then((e=>{var t;return this.updateTheme(e,null===(t=this.m_abortController)||void 0===t?void 0:t.signal)})).finally((()=>{this.m_isUpdating=!1})),this.m_completeThemePromise}getTheme(){return this.m_completeThemePromise}isUpdating(){return this.m_isUpdating}loadTheme(e,t,i){return"string"!=typeof e&&n.isThemeLoaded(e)?Promise.resolve(e):n.load(e,{baseUrl:t,uriResolver:this.m_uriResolver,signal:i})}async updateTheme(e,t){var i,n;const s=this.m_mapView.sceneEnvironment;if(this.m_cachedCompleteTheme.clearAlpha===e.clearAlpha&&this.m_cachedCompleteTheme.clearColor===e.clearColor||(this.m_cachedCompleteTheme.clearColor=e.clearColor,this.m_cachedCompleteTheme.clearAlpha=e.clearAlpha,s.updateClearColor(e.clearColor,e.clearAlpha,e.definitions)),r(this.m_cachedCompleteTheme.sky,e.sky)||(this.m_cachedCompleteTheme.sky=e.sky,s.updateSkyBackground(e.sky)),r(this.m_cachedCompleteTheme.fog,e.fog)||(this.m_cachedCompleteTheme.fog=e.fog,s.fog.reset(e.fog)),r(this.m_cachedCompleteTheme.lights,e.lights)||(this.m_cachedCompleteTheme.lights=e.lights,s.updateLighting(e.lights)),!r(this.m_cachedCompleteTheme.images,e.images)||!r(this.m_cachedCompleteTheme.imageTextures,e.imageTextures))try{await this.updateImages(e.images,e.imageTextures,t),this.m_cachedCompleteTheme.images=e.images,this.m_cachedCompleteTheme.imageTextures=e.imageTextures}catch(e){throw this.m_cachedCompleteTheme.images=void 0,this.m_cachedCompleteTheme.imageTextures=void 0,e}if(!r(this.m_cachedCompleteTheme.textStyles,e.textStyles)||!r(this.m_cachedCompleteTheme.defaultTextStyle,e.defaultTextStyle)||!r(this.m_cachedCompleteTheme.fontCatalogs,e.fontCatalogs))try{await this.m_mapView.iconTextRenderer.setTheme(e,t),this.m_cachedCompleteTheme.textStyles=e.textStyles,this.m_cachedCompleteTheme.defaultTextStyle=e.defaultTextStyle,this.m_cachedCompleteTheme.fontCatalogs=e.fontCatalogs}catch(e){throw this.m_cachedCompleteTheme.textStyles=void 0,this.m_cachedCompleteTheme.defaultTextStyle=void 0,this.m_cachedCompleteTheme.fontCatalogs=void 0,e}Array.isArray(e.priorities)&&(this.m_cachedCompleteTheme.priorities=e.priorities,this.m_mapView.mapAnchors.setPriorities(null!==(i=e.priorities)&&void 0!==i?i:[])),Array.isArray(e.labelPriorities)&&(this.m_cachedCompleteTheme.labelPriorities=e.labelPriorities),this.m_cachedCompleteTheme.styles=null!==(n=e.styles)&&void 0!==n?n:[],this.m_cachedCompleteTheme.definitions=e.definitions,this.m_cachedCompleteTheme.features=e.features;for(const e of this.m_mapView.dataSources)await e.setTheme(this.m_cachedCompleteTheme);return this.m_cachedCompleteTheme}async updateImages(e,t,i){if(this.m_imageRepo.iconTextManager.clear(),this.m_imageRepo.imageCache.clear(this),this.m_mapView.textureCache.evictAll(),e){for(const{url:t,atlas:n,preload:r,scalable:s=!1}of Object.values(e)){const e=this.m_imageRepo.imageCache.registerImageByUrl(this,t,void 0,s);r&&e.loadImage(),"string"==typeof n&&await this.m_imageRepo.iconTextManager.addTextureAtlas(t,n,i)}null==t||t.forEach((t=>{var i,n;const r=null!==(n=null===(i=e[t.image])||void 0===i?void 0:i.url)&&void 0!==n?n:t.image;this.m_imageRepo.iconTextManager.addImageTexture(Object.assign(Object.assign({},t),{image:r}))}))}}}},9701:(e,t,i)=>{"use strict";
949Object.defineProperty(t,"__esModule",{value:!0}),t.PathBlockingElement=void 0;const n=i(82);t.PathBlockingElement=class{constructor(e){this.points=e,this.screenSpaceLines=new Array(e.length>=2?e.length-1:0);for(let e=0;e<this.screenSpaceLines.length;e++)this.screenSpaceLines[e]=new n.Line3(new n.Vector3,new n.Vector3)}}},8881:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PickHandler=t.PickObjectType=void 0;const n=i(82),r=i(8152),s=i(2616),o=i(4572),a=i(5146),l=i(6946),c=i(7979),h=i(541);var u;!function(e){e[e.Unspecified=0]="Unspecified",e[e.Point=1]="Point",e[e.Line=2]="Line",e[e.Area=3]="Area",e[e.Text=4]="Text",e[e.Icon=5]="Icon",e[e.Object3D=6]="Object3D"}(u=t.PickObjectType||(t.PickObjectType={}));const d=new n.Vector3,m=new s.OrientedBox3;function p(e,t,i,n,r){for(const s of e.dependencies){const o=s.mortonCode();if(n.has(o))continue;n.add(o);const a=r.visibleTileSet.getCachedTile(e.dataSource,s,e.offset,r.frameNumber);void 0!==a&&i.intersectObjects(a.objects,!0,t)}}t.PickHandler=class{constructor(e,t,i=!1){this.mapView=e,this.camera=t,this.enablePickTechnique=i,this.m_pickingRaycaster=new l.PickingRaycaster(e.renderer.getSize(new n.Vector2))}intersectMapObjects(e,t,i){const r=this.mapView.getNormalizedScreenCoordinates(e,t),s=this.setupRaycaster(e,t),o=new c.PickListener(i),{clientWidth:a,clientHeight:l}=this.mapView.canvas,h=r.x*a*.5,d=r.y*l*.5,m=new n.Vector2(h,d);this.mapView.iconTextRenderer.pickIconTexts(m,((e,t)=>{const i={type:t?u.Text:u.Icon,point:m,distance:0,renderOrder:e.renderOrder,featureId:e.featureId,userData:e.userData,dataSourceName:e.dataSourceName,dataSourceOrder:e.dataSourceOrder};i.technique=this.enablePickTechnique?e.technique:void 0,o.addResult(i)}));const f=[],g=this.getIntersectedTiles(s),v=new Set;for(const{tile:e,distance:t}of g){if(o.done&&o.furthestResult.distance<t)break;f.length=0,s.intersectObjects(e.objects,!0,f),p(e,f,s,v,this.mapView);for(const e of f)o.addResult(this.createResult(e))}f.length=0;for(const e of this.mapView.mapAnchors.children){s.intersectObject(e,!0,f);for(const e of f)o.addResult(this.createResult(e))}return o.finish(),o.results}raycasterFromScreenPoint(e,t){return this.m_pickingRaycaster.setFromCamera(this.mapView.getNormalizedScreenCoordinates(e,t),this.camera),this.mapView.renderer.getSize(this.m_pickingRaycaster.canvasSize),this.m_pickingRaycaster}createResult(e){var t,i,n;const s=o.MapObjectAdapter.get(e.object),a={type:u.Unspecified,point:e.point,distance:e.distance,dataSourceName:null===(t=null==s?void 0:s.dataSource)||void 0===t?void 0:t.name,dataSourceOrder:null===(i=null==s?void 0:s.dataSource)||void 0===i?void 0:i.dataSourceOrder,intersection:e,tileKey:null==s?void 0:s.tileKey};if(void 0===e.object.userData||void 0===e.object.userData.feature)return a;
949if(this.enablePickTechnique){const t=o.MapObjectAdapter.get(e.object);a.technique=null==t?void 0:t.technique}a.renderOrder=null===(n=e.object)||void 0===n?void 0:n.renderOrder;const l=e.object.userData.feature;if(this.addObjInfo(l,e,a),a.userData){const e=(0,r.getFeatureId)(a.userData);a.featureId=0===e?void 0:e}let c;switch(l.geometryType){case r.GeometryType.Point:case r.GeometryType.Text:c=u.Point;break;case r.GeometryType.Line:case r.GeometryType.ExtrudedLine:case r.GeometryType.SolidLine:case r.GeometryType.TextPath:c=u.Line;break;case r.GeometryType.Polygon:case r.GeometryType.ExtrudedPolygon:c=u.Area;break;case r.GeometryType.Object3D:c=u.Object3D;break;default:c=u.Unspecified}return a.type=c,a}getIntersectedTiles(e){const t=new Array;return this.mapView.visibleTileSet.dataSourceTileList.forEach((i=>{i.dataSource.enablePicking&&i.renderedTiles.forEach((i=>{m.copy(i.boundingBox),m.position.sub(this.mapView.worldCenter);const n=i.computeWorldOffsetX();m.position.x+=n;const r=m.intersectsRay(e.ray);void 0!==r&&t.push({tile:i,distance:r})}))})),t.sort(((e,t)=>e.distance-t.distance)),t}addObjInfo(e,t,i){if(void 0===e.objInfos)return;if(i.intersection.object instanceof a.MapViewPoints)return void(i.userData=e.objInfos[t.index]);if(void 0===e.starts||0===e.starts.length||"number"!=typeof t.faceIndex&&void 0===t.index)return void(1===e.objInfos.length&&(i.userData=e.objInfos[0]));if(1===e.starts.length)return void(i.userData=e.objInfos[0]);const n="number"==typeof t.faceIndex?3*t.faceIndex:t.index;let r=0;for(const t of e.starts){if(t>n)break;r++}i.userData=e.objInfos[r-1]}setupRaycaster(e,t){const i=this.mapView.camera,n=this.raycasterFromScreenPoint(e,t),r=this.mapView.getWorldPositionAt(e,t,!0),s=i.position.distanceTo(r)/this.mapView.camera.getWorldDirection(d).dot(n.ray.direction);return n.params.Line.threshold=h.MapViewUtils.calculateWorldSizeByFocalLength(this.mapView.focalLength,s,1),n}}},7979:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PickListener=void 0;const n=i(4342),r=i(4572);function s(e,t){var i,n;const r=null!==(i=e.dataSourceOrder)&&void 0!==i?i:0,s=null!==(n=t.dataSourceOrder)&&void 0!==n?n:0;if(r!==s)return s-r;const o=e.distance-t.distance,a=void 0!==e.renderOrder&&void 0!==t.renderOrder;return Math.abs(o)>1e-4||!a?o:t.renderOrder-e.renderOrder}t.PickListener=class{constructor(e){this.m_parameters=e,this.m_results=[],this.m_sorted=!0,this.m_finished=!0}addResult(e){var t,i,n,o,a;let l=-1;if(!(null===(t=this.m_parameters)||void 0===t?void 0:t.allowDuplicates))for(l=this.m_results.length;l--;){const t=this.m_results[l];if(t.type===e.type){const s=null===(n=r.MapObjectAdapter.get(null===(i=e.intersection)||void 0===i?void 0:i.object))||void 0===n?void 0:n.dataSource,l=null===(a=r.MapObjectAdapter.get(null===(o=t.intersection)||void 0===o?void 0:o.object))||void 0===a?void 0:a.dataSource;if(s&&l===s){const i=e.featureId;if(t.featureId===i&&(void 0!==i||e.userData&&t.userData===e.userData))break}}}l<0?(this.m_sorted=!1,this.m_finished=!1,this.m_results.push(e)):s(e,this.m_results[l])<0&&(this.m_results[l]=e,this.m_sorted=!1,this.m_finished=!1)}get done(){return!!this.maxResults&&this.m_results.length>=this.maxResults}finish(){this.sortResults(),this.maxResults&&this.m_results.length>this.maxResults&&(this.m_results.length=this.maxResults),this.m_finished=!0}get results(){return(0,n.assert)(this.m_finished,"finish() was not called before getting the results"),this.m_results}get closestResult(){return this.sortResults(),this.m_results.length>0?this.m_results[0]:void 0}get furthestResult(){return this.sortResults(),this.m_results.length>0?this.m_results[this.m_results.length-1]:void 0}get maxResults(){var e,t;const i=null!==(t=null===(e=this.m_parameters)||void 0===e?void 0:e.maxResultCount)&&void 0!==t?t:0;return i>0?i:void 0}sortResults(){if(this.m_sorted)return;const e=[],t=[];this.m_results.sort(s).forEach((i=>(0===i.distance?e:t).push(i))),this.m_results=e.concat(t),this.m_sorted=!0}}},6946:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PickingRaycaster=void 0;const n=i(82),r=i(4572);function s(e,t,i,n){if(e.layers.test(t.layers)&&e.visible){const n=r.MapObjectAdapter.get(e);n&&!n.isPickable()||e.raycast(t,i)}if(!0===n)for(const n of e.children)s(n,t,i,!0)}class o extends n.Raycaster{constructor(e){super(),this.canvasSize=e}intersectObject(e,t,i){const n=null!=i?i:[];return s(e,this,n,t),n}intersectObjects(e,t,i){const n=null!=i?i:[];for(const i of e)s(i,this,n,t);return n}}t.PickingRaycaster=o},6313:(e,t,i)=>{"use strict";
949Object.defineProperty(t,"__esModule",{value:!0}),t.PlaneViewBounds=void 0;const n=i(82),r=i(2616),s=i(4342),o=i(541);t.PlaneViewBounds=class{constructor(e,t,i){this.camera=e,this.projection=t,this.m_options=i,this.m_groundPlaneNormal=new n.Vector3(0,0,1),this.m_groundPlane=new n.Plane(this.m_groundPlaneNormal.clone()),(0,s.assert)(t.type===r.ProjectionType.Planar)}generate(){const e=[];if(this.addCanvasCornerIntersection(e),4===e.length)return this.createPolygon(e);this.addHorizonIntersection(e);const t=(new n.Frustum).setFromProjectionMatrix((new n.Matrix4).multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse)),i=this.getWorldConers(this.projection);if(this.m_options.tileWrappingEnabled||[i.ne,i.nw,i.se,i.sw].forEach((i=>{this.addPointInFrustum(i,t,e)})),this.m_options.tileWrappingEnabled){const r=(new n.Vector3).subVectors(i.sw,i.se).normalize(),s=(new n.Vector3).subVectors(i.se,i.sw).normalize();[new n.Ray(i.se,r),new n.Ray(i.se,s),new n.Ray(i.ne,r),new n.Ray(i.ne,s)].forEach((i=>{this.addFrustumIntersection(i,t,e)}))}else[new n.Line3(i.sw,i.se),new n.Line3(i.ne,i.nw),new n.Line3(i.se,i.ne),new n.Line3(i.nw,i.sw)].forEac
949h((i=>{this.addFrustumIntersection(i,t,e)}));return this.createPolygon(e)}createPolygon(e){if(e.length>2)return new r.GeoPolygon(e,!0)}getWorldConers(e){const t=e.worldExtent(0,0);return{sw:t.min,se:new n.Vector3(t.max.x,t.min.y,0),nw:new n.Vector3(t.min.x,t.max.y,0),ne:t.max}}addNDCRayIntersection(e,t){e.forEach((e=>{const i=o.MapViewUtils.rayCastWorldCoordinates({camera:this.camera,projection:this.projection},e[0],e[1]);i&&this.validateAndAddToGeoPolygon(i,t)}))}addHorizonIntersection(e){const t=this.getVerticalHorizonPositionInNDC();t&&this.addNDCRayIntersection([[-1,t],[1,t]],e)}addCanvasCornerIntersection(e){this.addNDCRayIntersection([[-1,-1],[1,-1],[1,1],[-1,1]],e)}validateAndAddToGeoPolygon(e,t){this.isInVisibleMap(e)&&t.push(this.projection.unprojectPoint(e))}isInVisibleMap(e){return!(e.y<0||e.y>r.EarthConstants.EQUATORIAL_CIRCUMFERENCE||!this.m_options.tileWrappingEnabled&&(e.x<0||e.x>r.EarthConstants.EQUATORIAL_CIRCUMFERENCE))}addPointInFrustum(e,t,i){if(t.containsPoint(e)){const t=this.projection.unprojectPoint(e);t.altitude=0,i.push(t)}}addFrustumIntersection(e,t,i){t.planes.forEach((t=>{let r=null;const s=new n.Vector3;if(e instanceof n.Ray&&e.intersectsPlane(t)?r=e.intersectPlane(t,s):e instanceof n.Line3&&t.intersectsLine(e)&&(r=t.intersectLine(e,s)),r&&o.MapViewUtils.closeToFrustum(r,this.camera)){const e=this.projection.unprojectPoint(r);e.altitude=0,i.push(e)}}))}getVerticalHorizonPositionInNDC(){const e=new n.Vector3(-1,-1,1).unproject(this.camera).add(new n.Vector3(1,-1,1).unproject(this.camera)).multiplyScalar(.5),t=new n.Vector3(-1,1,1).unproject(this.camera).add(new n.Vector3(1,1,1).unproject(this.camera)).multiplyScalar(.5),i=new n.Line3(e,t),r=new n.Vector3;if(this.m_groundPlane.intersectLine(i,r))return r.project(this.camera).y}}},5187:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PolarTileDataSource=void 0;const n=i(82),r=i(7769),s=i(2616),o=i(1984),a=i(4303),l=i(8427),c=i(4572),h=i(6586),u=i(1447);class d extends a.DataSource{constructor({name:e="polar",layerNames:t=["northpole","southpole"],minDataLevel:i,maxDataLevel:r,minDisplayLevel:o,maxDisplayLevel:a,storageLevelOffset:l=-2,geometryLevelOffset:c=1,debugTiles:h=!1}){super({name:e,layerNames:t,minDataLevel:i,maxDataLevel:r,minDisplayLevel:o,maxDisplayLevel:a,storageLevelOffset:l}),this.m_tilingScheme=s.polarTilingScheme,this.m_maxLatitude=n.MathUtils.radToDeg(s.MercatorConstants.MAXIMUM_LATITUDE),this.m_geometryLevelOffset=c,this.m_debugTiles=h,this.cacheable=!1,this.enablePicking=!1}dispose(){this.m_northPoleEntry&&(this.m_northPoleEntry.material.dispose(),delete this.m_northPoleEntry),this.m_southPoleEntry&&(this.m_southPoleEntry.material.dispose(),delete this.m_southPoleEntry),this.m_styleSetEvaluator&&delete this.m_styleSetEvaluator}createTechiqueEntry(e){if(!this.m_styleSetEvaluator)return;const t=new r.MapEnv({$geometryType:"polygon",$layer:"earth",kind:e}),i=this.m_styleSetEvaluator.getMatchingTechniques(t);if(0===i.length)return;const n=i[0],s=(0,l.createMaterial)(n,this.mapView);return s?{material:s.material,technique:n}:void 0}async setTheme(e){e=await h.load(e);const t=(0,o.getStyles)(e.styles).filter((e=>{var t;return!e.layer||(null===(t=this.layerNames)||void 0===t?void 0:t.includes(e.layer))}));t.length>0&&(this.m_styleSetEvaluator=new r.StyleSetEvaluator({styleSet:t,definitions:e.definitions,priorities:e.priorities,labelPriorities:e.labelPriorities})),this.m_northPoleEntry=this.createTechiqueEntry("north_pole"),this.m_southPoleEntry=this.createTechiqueEntry("south_pole"),this.mapView.markTilesDirty(this)}canGetTile(e,t){if(e!==t.level||t.level<1)return!1;const{north:i,south:n}=this.m_tilingScheme.getGeoBox(t);return i>this.m_maxLatitude||n<-this.m_maxLatitude}shouldSubdivide(e,t){if(e<=t.level)return!1;const{north:i,south:n}=this.m_tilingScheme.getGeoBox(t);return i>this.m_maxLatitude||n<-this.m_maxLatitude}getTilingScheme(){return this.m_tilingScheme}getTile(e){const t=new u.Tile(this,e);return this.createTileGeometry(t),t}get geometryLevelOffset(){return this.m_geometryLevelOffset}set geometryLevelOffset(e){this.m_geometryLevelOffset=e}intersectEdge(e,t,i){const n=t.latitude,r=i.latitude;let o=t.longitude,a=i.longitude;90===Math.abs(n)&&(o=a),90===Math.abs(r)&&(a=o);const l=a-o,c=(e-n)/(r-n);return new s.GeoCoordinates(e,o+l*c,0)}createTileGeometry(e){const{north:t,south:i}
949=e.geoBox,r=t>0&&i>=0,o=r?this.m_northPoleEntry:this.m_southPoleEntry;if(void 0===o)return void e.forceHasGeometry(!0);const a=this.m_tilingScheme.projection,l=this.projection,h=this.m_maxLatitude,u=r?h:-h,d=this.m_tilingScheme.boundingBoxGenerator.getWorldBox(e.tileKey),m=a.unprojectPoint(new n.Vector3(d.min.x,d.min.y,0)),p=a.unprojectPoint(new n.Vector3(d.max.x,d.min.y,0)),f=a.unprojectPoint(new n.Vector3(d.max.x,d.max.y,0)),g=a.unprojectPoint(new n.Vector3(d.min.x,d.max.y,0));let v,y=!1;if(1===e.tileKey.level){const e=0===d.min.x,t=e?d.max.x:d.min.x,i=(d.max.y+d.min.y)/2,s=a.unprojectPoint(new n.Vector3(t,i,0)),o=e?m:p;v=r?e?[s,f,o,p]:[s,m,o,g]:e?[s,p,o,f]:[s,g,o,m],y=!0}else{v=r?[m,p,f,g]:[m,g,f,p];const e=v.map((e=>e.latitude)),t=Math.max(...e),i=Math.min(...e);if(r?t<u:i>u)return;if(y=r?i<u:t>u,y){const n=e.indexOf(r?t:i);if(0!==n)for(let e=0;e<n;e++)v.push(v.shift())}}if(y){const t=(d.min.x+d.max.x)/2,i=(d.min.y+d.max.y)/2,r=a.unprojectPoint(new n.Vector3(t,i,0));s.TransverseMercatorUtils.alignLongitude(v,r);const o=v[0],l=v[1],c=v[2],m=v[3],p=Math.abs(l.latitude)>=h,f=Math.abs(m.latitude)>=h,g=p?this.intersectEdge(u,l,c):this.intersectEdge(u,o,l),y=f?this.intersectEdge(u,m,c):this.intersectEdge(u,o,m);v.splice(p?2:1,4,g);const _=e.tileKey.level-this.storageLevelOffset+this.m_geometryLevelOffset,x=360/(1<<Math.max(0,_)),b=Math.floor((g.longitude+180)/x),w=Math.ceil((y.longitude+180)/x);for(let e=b+1;e<w;e++)v.push(new s.GeoCoordinates(u,e*x-180,0));v.push(y),f&&v.push(m)}const _=new n.BufferGeometry,x=v.map((t=>{const i=l.projectPoint(t,new n.Vector3);return i.sub(e.center),i}));_.setFromPoints(x);const b=[];for(let e=1;e<x.length-1;e++)r?b.push(0,e,e+1):b.push(0,e+1,e);_.setIndex(b);const w=new n.Mesh(_,o.material);if(w.userData={dataSource:this.name,tileKey:e.tileKey},this.m_debugTiles){const t=Math.round(16777215*Math.abs(Math.sin(11*e.tileKey.mortonCode())));w.material=new n.MeshBasicMaterial({color:t,transparent:!0,opacity:.5}),e.objects.push(new n.Mesh(_,new n.MeshBasicMaterial({color:t,wireframe:!0})))}c.MapObjectAdapter.create(w,{dataSource:this,technique:o.technique}),e.objects.push(w)}}t.PolarTileDataSource=d},7362:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ScreenCollisionsDebug=t.ScreenCollisions=t.isLineWithBound=t.DetailedCollisionBox=t.CollisionBox=void 0;const n=i(82),r=i(4342),s=i(507),o=i(1102),a=r.LoggerManager.instance.create("ScreenCollissions");class l extends r.Math2D.Box{constructor(e){super(),void 0!==e&&this.copy(e)}copy(e){return e instanceof r.Math2D.Box?this.set(e.x,e.y,e.w,e.h):e instanceof n.Box2?this.set(e.min.x,e.min.y,e.max.x-e.min.x,e.max.y-e.min.y):this.set(e.minX,e.minY,e.maxX-e.minX,e.maxY-e.minY),this}get minX(){return this.x}set minX(e){this.x=e}get maxX(){return this.x+this.w}set maxX(e){this.w=e-this.x}get minY(){return this.y}set minY(e){this.y=e}get maxY(){return this.y+this.h}set maxY(e){this.h=e-this.y}}t.CollisionBox=l;class c extends l{constructor(e,t){super(e),this.detailBoxes=t}}function h(e){return void 0!==e.line}t.DetailedCollisionBox=c,t.isLineWithBound=h;const u=new l;class d{constructor(){this.screenBounds=new r.Math2D.Box,this.rtree=new o}reset(){this.rtree.clear()}update(e,t){this.screenBounds.set(e/-2,t/-2,e,t),this.reset()}allocate(e){const t=e instanceof l?e:new l(e);this.rtree.insert(t)}allocateIBoxes(e){this.rtree.load(e)}search(e){return this.rtree.search(e)}isAllocated(e){const t=e instanceof l?e:u.copy(e),i=this.search(t);return this.intersectsDetails(t,i)}isVisible(e){return this.screenBounds.intersects(e)}isFullyVisible(e){return this.screenBounds.containsBox(e)}intersectsDetails(e,t){for(const i of t)if(i instanceof c){for(const t of i.detailBoxes)if(t.intersects(e))return!0}else{if(!h(i))return!0;{const t=i;if(this.intersectsLine(e,t))return!0}}return!1}intersectsLine(e,t){const i=t.line,n=i.end.x-i.start.x;let r,s,o,a;if(0!==n){const t=i.end.y-i.start.y,l=t,c=-n,h=i.start.y-t/n*i.start.x;r=Math.sign(e.minX*l+(e.minY-h)*c),s=Math.sign(e.maxX*l+(e.minY-h)*c),o=Math.sign(e.minX*l+(e.maxY-h)*c),a=Math.sign(e.maxX*l+(e.maxY-h)*c)}else r=Math.sign(e.minX-i.start.x),s=Math.sign(e.maxX-i.start.x),o=Math.sign(e.minX-i.start.x),a=Math.sign(e.maxX-i.start.x);return r!==s||r!==o||r!==a}}t.ScreenCollisions=d,t.ScreenCollisionsDebug=class extends d{constructor(e){super(),this.m_renderContext=null,this.m_renderingEnabled=!1,this.m_numAllocations=0,this.m_numSuccessfulTests=0,this.m_numFailedTests=0,this.m_numSuccessfulVisibilityTests=0,this.m_numFailedVisibilityTests=0,null!=e&&(this.m_renderContext=e.getContext("2d"))}reset(){super.reset(),this.m_numAllocations=0,this.m_numSuccessfulTests=0,this.m_numFailedTests=0,this.m_numSuccessfulVisibilityTests=0,this.m_numFailedVisibilityTests=0}update(e,t){this.m_renderingEnabled&&a.log(`Allocations: ${this.m_numAllocations} Successful Tests: ${this.m_numSuccessfulTests} Failed Tests: ${this.m_numFailedTests} Successful Visibility Tests: ${this.m_numSuccessfulVisibilityTests} Failed Visibility Tests: ${this.m_numFailedVisibilityTests} `),super.update(e,t),null!==this.m_renderContext&&(this.m_renderContext.canvas.width=e,this.m_renderContext.canvas.height=t),this.m_renderingEnabled=s.debugContext.getValue("DEBUG_SCREEN_COLLISIONS")}allocate(e){super.allocate(e),this.m_numAllocations++,this.m_renderingEnabled&&null!==this.m_renderContext&&(this.m_renderContext.strokeStyle="#6666ff",this.m_renderContext.strokeRect(e.x-this.screenBounds.x,this.screenBounds.y+this.screenBounds.h-e.y,e.w,-e.h))}allocateIBoxes(e){for(const t of e)this.m_numAllocations++,this.m_renderingEnabled&&null!==this.m_renderContext&&(this.m_renderContext.strokeStyle="#aa2222",this.m_renderContext.strokeRect(t.minX-this.screenBounds.x,this.screenBounds.y+this.screenBounds.h-t.minY,t.maxX-t.minX,-(t.maxY-t.minY)));super.allocateIBoxes(e)}intersectsDetails(e,t){const i=super.intersectsDetails(e,t);if(this.m_renderingEnabled&&null!==this.m_renderContext){const t=i?2:1;this.m_renderContext.strokeStyle=i?"#FF0000":"#00ff00",this.m_renderContext.strokeRect(e.x-this.screenBounds.x-t,this.screenBounds.y+this.screenBounds.h-e.y+t,e.w+2*t,-e.h-2*t)}return i?this.m_numFailedTests++:this.m_numSuccessfulTests++,i}isVisible(e){const t=super.isVisible(e);return t?this.m_numSuccessfulVisibilityTests++:this.m_numFailedVisibilityTests++,t}}},8658:(e,t,i)=>{"use strict";
949Object.defineProperty(t,"__esModule",{value:!0}),t.ScreenProjector=void 0;const n=i(82);function r(e){return e.z>-1&&e.z<1}class s{constructor(e){this.m_camera=e,this.m_width=0,this.m_height=0}get width(){return this.m_width}get height(){return this.m_height}project(e,t=new n.Vector2){const i=this.projectVector(e,s.tempV3);return this.ndcToScreen(i,t)}projectToScreen(e,t=new n.Vector2){const i=this.projectVector(e,s.tempV3);if(r(i))return this.ndcToScreen(i,t)}projectAreaToScreen(e,t,i,o=new n.Vector2){t*=2,i*=2;const a=this.projectVector(e,s.tempV3);if(r(a)&&a.x+t>=-1&&a.x-t<=1&&a.y+i>=-1&&a.y-i<=1)return this.ndcToScreen(a,o)}project3(e,t=new n.Vector3){const i=this.projectVector(e,s.tempV3);if(i.z>-1&&i.z<1)return t.set(i.x*this.m_width/2,i.y*this.m_height/2,i.z),t}projectVector(e,t){return t.set(e.x,e.y,e.z).project(this.m_camera),t}onScreen(e){return(t=this.projectVector(e,s.tempV3)).z>-1&&t.z<1&&t.x>=-1&&t.x<=1&&t.y>=-1&&t.y<=1;// removed by dead control flow 950 var t; }update(e,t,i){this.m_camera=e,this.m_width=t,this.m_height=i}ndcToScreen(e,t){return t.set(e.x*this.m_width/2,e.y*this.m_height/2)}}t.ScreenProjector=s,s.tempV2=new n.Vector2,s.tempV3=new n.Vector3},7775:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SkyBackground=void 0;const n=i(3307),r=i(4257);t.SkyBackground=class{constructor(e,t,i){switch(this.m_sky=e,this.m_projectionType=t,this.m_sky.type){case"gradient":this.m_skyTexture=new r.SkyGradientTexture(this.m_sky,this.m_projectionType),this.updateCamera(i);break;case"cubemap":this.m_skyTexture=new n.SkyCubemapTexture(this.m_sky)}}dispose(){this.m_skyTexture.dispose()}get texture(){return this.m_skyTexture.texture}updateCamera(e){"gradient"===this.m_sky.type&&this.m_skyTexture.update(e)}updateTexture(e,t){const i=this.m_sky.type===e.type&&this.m_projectionType===t;switch(e.type){case"gradient":i?this.m_skyTexture.updateTexture(e):this.m_skyTexture=new r.SkyGradientTexture(e,t);break;case"cubemap":i?this.m_skyTexture.updateTexture(e):this.m_skyTexture=new n.SkyCubemapTexture(e)}this.m_projectionType=t,this.m_sky=e}}},3307:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SkyCubemapTexture=t.SkyCubemapFaceId=t.SKY_CUBEMAP_FACE_COUNT=void 0;const n=i(82),r=i(4342).LoggerManager.instance.create("SkyCubemapTexture");var s;t.SKY_CUBEMAP_FACE_COUNT=6,function(e){e[e.positiveX=0]="positiveX",e[e.negativeX=1]="negativeX",e[e.positiveY=2]="positiveY",e[e.negativeY=3]="negativeY",e[e.positiveZ=4]="positiveZ",e[e.negativeZ=5]="negativeZ"}(s=t.SkyCubemapFaceId||(t.SkyCubemapFaceId={})),t.SkyCubemapTexture=class{constructor(e){const t=this.createCubemapFaceArray(e);this.m_skybox=void 0!==t?(new n.CubeTextureLoader).load(t):new n.CubeTexture}dispose(){this.m_skybox.dispose()}get texture(){return this.m_skybox}updateTexture(e){const t=this.createCubemapFaceArray(e);void 0!==t&&(this.m_skybox=(new n.CubeTextureLoader).load(t))}createCubemapFaceArray(e){const i=[void 0,void 0,void 0,void 0,void 0,void 0];for(let n=0;n<t.SKY_CUBEMAP_FACE_COUNT;++n){const t=e[s[n]];if(void 0===t)return void r.error(`Face "${s[n]}" was not defined.`);i[n]=t}return i}}},4257:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SkyGradientTexture=t.DEFAULT_MONOMIAL_POWER=t.DEFAULT_TEXTURE_SIZE=void 0;const n=i(82),r=i(2616),s=i(4342);t.DEFAULT_TEXTURE_SIZE=512,t.DEFAULT_MONOMIAL_POWER=1;const o=[new n.Vector3(1,0,0),new n.Vector3(-1,0,0),new n.Vector3(0,-1,0),new n.Vector3(0,1,0),new n.Vector3(0,0,1),new n.Vector3(0,0,-1)],a=[new n.Vector3(0,0,-1),new n.Vector3(0,0,1),new n.Vector3(1,0,0),new n.Vector3(1,0,0),new n.Vector3(1,0,0),new n.Vector3(-1,0,0)],l=[new n.Vector3(0,1,0),new n.Vector3(0,1,0),new n.Vector3(0,0,1),new n.Vector3(0,0,-1),new n.Vector3(0,1,0),new n.Vector3(0,1,0)];t.SkyGradientTexture=class{constructor(e,i,s=t.DEFAULT_TEXTURE_SIZE){this.m_projectionType=i,this.m_height=s;const o=new n.Color(e.topColor),a=new n.Color(e.bottomColor),l=new n.Color(e.groundColor);this.m_width=this.m_projectionType===r.ProjectionType.Planar?1:this.m_height,this.m_faceCount=this.m_projectionType===r.ProjectionType.Planar?1:6,this.m_faces=[];for(let t=0;t<this.m_faceCount;++t){const i=new Uint8Array(4*this.m_width*this.m_height);this.fillTextureData(i,t,o,a,l,e.monomialPower);const r=new n.DataTexture(i,this.m_width,this.m_height,n.RGBAFormat);r.needsUpdate=!0,r.unpackAlignment=1,this.m_faces.push(r)}this.m_projectionType===r.ProjectionType.Spherical?(this.m_skybox=new n.CubeTexture(this.m_faces),this.m_skybox.needsUpdate=!0):(this.m_farClipPlaneDividedVertically=new n.Line3,this.m_groundPlane=new n.Plane(new n.Vector3(0,0,1)),this.m_bottomMidFarPoint=new n.Vector3,this.m_topMidFarPoint=new n.Vector3,this.m_horizonPosition=new n.Vector3,this.m_farClipPlaneCorners=[new n.Vector3,
950new n.Vector3,new n.Vector3,new n.Vector3])}dispose(){for(let e=0;e<this.m_faceCount;++e)this.m_faces[e].dispose();this.m_projectionType===r.ProjectionType.Spherical&&this.m_skybox.dispose()}get texture(){return this.m_projectionType===r.ProjectionType.Planar?this.m_faces[0]:this.m_skybox}update(e){this.m_projectionType===r.ProjectionType.Planar&&(this.setHorizonPosition(e),this.updateTexturePosition())}updateTexture(e){for(let t=0;t<this.m_faceCount;++t)this.fillTextureData(this.m_faces[t].image.data,t,new n.Color(e.topColor),new n.Color(e.bottomColor),new n.Color(e.groundColor),e.monomialPower),this.m_faces[t].needsUpdate=!0;this.m_projectionType===r.ProjectionType.Spherical&&(this.m_skybox.needsUpdate=!0)}fillTextureData(e,i,c,h,u,d){const m=new n.Color,p=new n.Vector3,f=new n.Vector3,g=new n.Vector3,v=new n.Vector3(0,0,1);for(let n=0;n<this.m_height;++n)for(let y=0;y<this.m_width;++y){if(this.m_projectionType===r.ProjectionType.Spherical){const e=f.copy(a[i]).multiplyScalar((y+.5)/this.m_width*2-1),r=g.copy(l[i]).multiplyScalar((n+.5)/this.m_height*2-1);p.copy(o[i]).add(e).add(r).normalize();const _=Math.max(v.dot(p),0);m.copy(u).lerp(h,Math.min(100*_,1)).lerp(c,_**(0,s.getOptionValue)(d,t.DEFAULT_MONOMIAL_POWER)).multiplyScalar(255)}else{const e=n/this.m_height;0===n?m.copy(u).multiplyScalar(255):m.copy(h).lerp(c,e**(0,s.getOptionValue)(d,t.DEFAULT_MONOMIAL_POWER)).multiplyScalar(255)}const _=4;e.set([m.r,m.g,m.b,255],n*this.m_width*_+y*_)}}setHorizonPosition(e){this.m_farClipPlaneCorners[0].set(-1,-1,1).unproject(e),this.m_farClipPlaneCorners[1].set(1,-1,1).unproject(e),this.m_farClipPlaneCorners[2].set(-1,1,1).unproject(e),this.m_farClipPlaneCorners[3].set(1,1,1).unproject(e),this.m_bottomMidFarPoint.copy(this.m_farClipPlaneCorners[0]).add(this.m_farClipPlaneCorners[1]).multiplyScalar(.5),this.m_topMidFarPoint.copy(this.m_farClipPlaneCorners[2]).add(this.m_farClipPlaneCorners[3]).multiplyScalar(.5),this.m_farClipPlaneDividedVertically.set(this.m_bottomMidFarPoint,this.m_topMidFarPoint),this.m_groundPlane.intersectLine(this.m_farClipPlaneDividedVertically,this.m_horizonPosition)||this.m_horizonPosition.set(0,0,0)}updateTexturePosition(){const e=this.m_bottomMidFarPoint.distanceTo(this.m_horizonPosition)/this.m_farClipPlaneDividedVertically.distance(),t=0===this.m_horizonPosition.length()?1:e-2/this.m_height;this.m_faces[0].offset.set(0,this.m_bottomMidFarPoint.z<=0?-t:e)}}},3228:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SphereHorizon=t.previousCanvasSide=t.nextCanvasSide=t.CanvasSide=void 0;const n=i(82),r=i(2616),s=i(4342),o=i(4442),a=i(541),l=2*Math.PI;var c;function h(e){return(e+1)%4}!function(e){e[e.Bottom=0]="Bottom",e[e.Right=1]="Right",e[e.Top=2]="Top",e[e.Left=3]="Left"}(c=t.CanvasSide||(t.CanvasSide={})),t.nextCanvasSide=h,t.previousCanvasSide=function(e){return(e+3)%4},t.SphereHorizon=class{constructor(e,t){this.m_camera=e,this.m_cornerIntersects=t,this.m_intersections=[],this.m_isFullyVisible=!0;const i=r.EarthConstants.EQUATORIAL_RADIUS*r.EarthConstants.EQUATORIAL_RADIUS,s=(new n.Vector3).setFromMatrixColumn(e.matrixWorld,0).normalize(),o=e.position.clone().normalize(),l=(new n.Vector3).crossVectors(o,s),c=e.position.length();this.m_normalToTangentAngle=Math.asin(r.EarthConstants.EQUATORIAL_RADIUS/c);const h=Math.sqrt(c*c-i);this.m_distanceToHorizonCenter=h*Math.cos(this.m_normalToTangentAngle);const u=c-this.m_distanceToHorizonCenter;this.m_radius=Math.sqrt(i-u*u),this.m_cameraPitch=a.MapViewUtils.extractAttitude({projection:r.sphereProjection},this.m_camera).pitch;const d=(new n.Vector3).copy(o).setLength(u);this.m_matrix=(new n.Matrix4).makeBasis(s,l,o).setPosition(d),this.computeIntersections()}getPoint(e,t=0,i=1,r=new n.Vector3){const s=t*l,o=s+e*((i>=t?i*l:(i+1)*l)-s);return r.set(this.m_radius*Math.cos(o),this.m_radius*Math.sin(o),0),r.applyMatrix4(this.m_matrix),r}getDivisionPoints(e,t=0,i=1,n=10){const r=Math.max(Math.ceil(((i<t?1+i:i)-t)*n),1);for(let n=0;n<r;n++)e(this.getPoint(n/r,t,i))}get isFullyVisible(){return this.m_isFullyVisible}getSideIntersections(e){return this.m_intersections[e]}isTangentVisible(e){switch(e){case c.Top:{const e=this.m_normalToTangentAngle-this.m_cameraPitch;return o.CameraUtils.getTopFov(this.m_camera)>=Math.abs(e)}case c.Bottom:{const e=this.m_normalToTangentAngle+this.m_cameraPitch;return o.CameraUtils.getBottomFov(this.m_camera)>=Math.abs(e)}case c.Left:{const e=this.m_normalToTangentAngle;return o.CameraUtils.getLeftFov(this.m_camera)>=Math.abs(e)&&this.m_cameraPitch<=o.CameraUtils.getBottomFov(this.m_camera)}case c.Right:{const e=this.m_normalToTangentAngle;return o.CameraUtils.getRightFov(this.m_camera)>=Math.abs(e)&&this.m_cameraPitch<=o.CameraUtils.getBottomFov(this.m_camera)}}}getTangentOnSide(e){switch(e){case c.Bottom:return.75;case c.Right:return 0;case c.Top:return.25;case c.Left:return.5}}computeIntersections(){const e=this.m_distanceToHorizonCenter*Math.tan(this.m_cameraPitch-o.CameraUtils.getBottomFov(this.m_camera));let t,i;for(let n=c.Bottom;n<4;n++){if(this.isTangentVisible(n)){this.m_intersections.push([this.getTangentOnSide(n)]);continue}const r=new Array;switch(this.m_isFullyVisible=!1,n){case c.Bottom:r.push(...this.computeTBIntersections(e));break;case c.Right:{const n=o.CameraUtils.getRightFov(this.m_camera),s=this.computeLRIntersections(e,n);s&&([t,i]=s,r.push(void 0!==i?1+i:void 0,t));break}case c.Top:{const e=this.m_distanceToHorizonCenter*Math.tan(this.m_cameraPitch+o.CameraUtils.getTopFov(this.m_camera));r.push(...this.computeTBIntersections(e).reverse());break}case c.Left:{const n=o.CameraUtils.getLeftFov(this.m_camera);if(n===o.CameraUtils.getRightFov(this.m_camera))r.push(void 0!==t?.5-t:void 0,void 0!==i?.5-i:void 0);else{const t=this.computeLRIntersections(e,n);t&&r.push(.5-t[0],void 0!==t[1]?.5-t[1]:void 0)}break}}const s=[this.m_cornerIntersects[n],this.m_cornerIntersects[h(n)]];this.m_intersections.push(r.filter(((e,t)=>void 0!==e&&!s[t])))}}computeTBIntersections(e){const t=this.m_radius*this.m_radius,i=Math.sqrt(t-e*e),n=Math.atan2(e,i)/l;return[.5-n,n>0?n:1+n]}computeLRIntersections(e,t){const i=this.m_distanceToHorizonCenter/Math.cos(this.m_cameraPitch),n=this.m_distanceToHorizonCenter*Math.tan(this.m_cameraPitch),r=i*Math.tan(t),a=o.CameraUtils.getBottomFov(this.m_camera),c=r*(this.m_distanceToHorizonCenter*Math.cos(a)/Math.cos(this.m_cameraPitch-a))/i,h=s.Math2D.intersectLineAndCircle(c,e,r,n,this.m_radius);if(!h)return;const u=h.y1;return[Math.atan2(u,h.x1)/l,-u>=e&&void 0!==h.x2?Math.atan2(h.y2,h.x2)/l:void 0]}}},7284:(e,t,i)=>{"use strict";
950Object.defineProperty(t,"__esModule",{value:!0}),t.SphereViewBounds=t.computeEdgeDivisions=void 0;const n=i(82),r=i(2616),s=i(4342),o=i(3228),a=i(541);function l(e,t){const i=Math.abs(t.latitude-e.latitude),n=e.minLongitudeSpanTo(t);return Math.ceil(Math.max(i/20,n/5))}t.computeEdgeDivisions=l;const c=[{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}];t.SphereViewBounds=class{constructor(e,t){this.camera=e,this.projection=t,(0,s.assert)(t.type===r.ProjectionType.Spherical)}generate(){const e=this.findBoundsIntersections();return this.wrapAroundPoles(e),e.length>2?new r.GeoPolygon(e,!1,!0):void 0}addSideSegmentSubdivisions(e,t,i,r,s){e.push(r);const o=l(r,s);if(o<=1)return;const c=new n.Vector2(i.x-t.x,i.y-t.y).multiplyScalar(1/o),h=new n.Vector2(t.x,t.y);for(let t=0;t<o-1;t++){h.add(c);const t=a.MapViewUtils.rayCastWorldCoordinates({camera:this.camera,projection:this.projection},h.x,h.y);t&&e.push(this.projection.unprojectPoint(t))}}addSideIntersections(e,t,i,n,r){const a=c[t],l=c[(0,o.nextCanvasSide)(t)];if(i&&n)return void this.addSideSegmentSubdivisions(e,a,l,i,n);if(!r)return;const h=r.getSideIntersections(t);if(0!==h.length){if(i){const t=r.getPoint(h[h.length-1]),n=this.projection.unprojectPoint(t);this.addSideSegmentSubdivisions(e,a,t.project(this.camera),i,n)}else{const i=(0,o.previousCanvasSide)(t);let n=r.getSideIntersections(i);0===n.length&&(n=r.getSideIntersections((0,o.previousCanvasSide)(i))),(0,s.assert)(n.length>0),r.getDivisionPoints((t=>{e.push(this.projection.unprojectPoint(t))}),n[n.length-1],h[0])}if(h.length>1){const t=r.getPoint(h[0]),i=r.getPoint(h[1]),n=this.projection.unprojectPoint(t),s=this.projection.unprojectPoint(i);this.addSideSegmentSubdivisions(e,t.project(this.camera),i.project(this.camera),n,s)}if(n){const t=r.getPoint(h[0]),i=this.projection.unprojectPoint(t);this.addSideSegmentSubdivisions(e,t.project(this.camera),l,i,n)}}}findBoundsIntersections(){const e=[],[t,i]=this.addCanvasCornerIntersection(),n=i<4?new o.SphereHorizon(this.camera,t.map((e=>void 0!==e))):void 0;if(0===i&&n.isFullyVisible)return n.getDivisionPoints((t=>{e.push(this.projection.unprojectPoint(t))})),e;for(let i=o.CanvasSide.Bottom;i<4;i++){const r=t[i],s=t[(0,o.nextCanvasSide)(i)];this.addSideIntersections(e,i,r,s,n)}return e}wrapAroundPoles(e){const t=new n.Vector3(0,0,r.EarthConstants.EQUATORIAL_RADIUS),i=new n.Vector3(0,0,-r.EarthConstants.EQUATORIAL_RADIUS),s=a.MapViewUtils.closeToFrustum(t,this.camera),o=a.MapViewUtils.closeToFrustum(i,this.camera);if(!s&&!o)return;const l=this.projection.unprojectPoint(this.camera.position).lng,c=s?90:-90,h=s?l+180:l-180,u=new r.GeoCoordinates(c,h),d=u.normalized(),m=d.lng;let p=e[e.length-1].lng,f=!1;const g=e.findIndex((e=>{const t=(0,r.isAntimeridianCrossing)(p,e.lng);return Math.sign(m-e.lng)===Math.sign(m-p)===t?(f=t,!0):(p=e.lng,!1)}));if(g<0)return;const v=s?90:-90,y=s?1e-5:-1e-5,_=new r.GeoCoordinates(c,l+v).normalized(),x=new r.GeoCoordinates(c,l).normalized(),b=new r.GeoCoordinates(c,l-v).normalized(),w=new r.GeoCoordinates(c,h+y).normalized(),M=e[(g+e.length-1)%e.length],T=e[g];let S=r.GeoCoordinates.lerp(M,T,.01,f);f&&s?S.longitude-=360:S=S.normalized(),e.splice(g,0,h<-180?u:d,_,x,b,w,S)}addCanvasCornerIntersection(){const e=new Array;let t=0;return c.forEach((i=>{const n=a.MapViewUtils.rayCastWorldCoordinates({camera:this.camera,projection:this.projection},i.x,i.y);n?(e.push(this.projection.unprojectPoint(n)),++t):e.push(void 0)})),[e,t]}}},8015:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PerformanceStatistics=t.FrameStatsArray=t.FrameStats=t.Statistics=t.MultiStageTimer=t.computeArrayAverage=t.computeArrayStats=t.SampledTimer=t.SimpleTimer=t.RingBuffer=void 0;const n=i(4342),r=n.LoggerManager.instance.create("Statistics");class s{constructor(e){this.capacity=e,this.buffer=new Array(e),this.capacity=e,this.head=this.tail=this.size=0}clear(){this.head=this.tail=this.size=0}enqOne(e){let t=this.head+1;t>=this.capacity&&(t=0),this.size<this.capacity&&this.size++,this.buffer[this.head]=e,this.head=t,this.size===this.capacity&&(this.tail=this.head)}enq(...e){for(const t of e)this.enqOne(t)}deq(){if(0===this.size)throw new Error("Ringbuffer underrun");const e=this.buffer[this.tail];let t=this.tail+1;return t>=this.capacity&&(t=0),this.size>0&&this.size--,this.tail=t,e}get top(){if(0===this.size)throw new Error("Ringbuffer underrun");return this.buffer[this.tail]}get bottom(){if(0===this.size)throw new Error("Ringbuffer underrun");let e=this.head-1;return e<0&&(e=this.capacity-1),this.buffer[e]}iterator(){return new s.Iterator(this)}asArray(){const e=new Array;for(let t=0;t<this.size;t++)e.push(this.buffer[(this.tail+t)%this.capacity]);return e}}t.RingBuffer=s,function(e){e.Iterator=class{constructor(e,t=0){this.m_buffer=e,this.m_index=t}get value(){return this.m_buffer.buffer[(this.m_buffer.tail+this.m_index)%this.m_buffer.capacity]}next(){return this.m_index++,this.m_index<this.m_buffer.size}}}(s=t.RingBuffer||(t.RingBuffer={}));class o{constructor(e,t){this.statistics=e,this.name=t,this.running=!1}get value(){return this.m_currentValue}setValue(e){this.m_currentValue=e}reset(){this.m_currentValue=void 0}
950start(){if(!this.statistics.enabled)return-1;if(this.running)throw new Error("Timer '"+this.name+"' is already running");return this.running=!0,this.m_currentValue=n.PerformanceTimer.now()}stop(){var e;if(!this.statistics.enabled)return-1;if(this.running){const t=n.PerformanceTimer.now()-(null!==(e=this.m_currentValue)&&void 0!==e?e:0);return this.m_currentValue=t,this.setValue(t),this.running=!1,t}throw new Error("Timer '"+this.name+"' has not been started")}now(){var e;if(!this.statistics.enabled)return-1;if(this.running)return n.PerformanceTimer.now()-(null!==(e=this.m_currentValue)&&void 0!==e?e:0);throw new Error("Timer '"+this.name+"' has not been started")}}t.SimpleTimer=o;class a extends o{constructor(e,t){super(e,t),this.statistics=e,this.name=t,this.numResets=0,this.maxNumSamples=1e3,this.samples=new s(this.maxNumSamples)}reset(){super.reset(),this.getStats(),this.samples.clear(),this.numResets++}setValue(e){super.setValue(e),void 0!==e&&this.samples.enqOne(e)}getStats(){return l(this.samples.asArray())}}function l(e){if(0===e.length)return;e.sort(((e,t)=>e-t));const t=e[0],i=e[e.length-1];let n,r,s,o,a,l,c;if(1===e.length)r=s=o=a=l=c=n=e[0];else if(2===e.length)n=.5*e[0]+.5*e[1],r=s=o=a=l=c=e[1];else{const t=Math.floor(e.length/2);n=e.length%2==0?.5*e[t-1]+.5*e[t]:e[t],r=e[Math.round(.75*e.length)-1],s=e[Math.round(.9*e.length)-1],o=e[Math.round(.95*e.length)-1],a=e[Math.round(.97*e.length)-1],l=e[Math.round(.99*e.length)-1],c=e[Math.round(.999*e.length)-1]}let h=0;for(let t=0,i=e.length;t<i;t++)h+=e[t];return{min:t,max:i,avg:h/e.length,median:n,median75:r,median90:s,median95:o,median97:a,median99:l,median999:c,numSamples:e.length}}t.SampledTimer=a,t.computeArrayStats=l,t.computeArrayAverage=function(e){if(0===e.length)return;let t=0;for(let i=0,n=e.length;i<n;i++)t+=e[i];return t/e.length},t.MultiStageTimer=class{constructor(e,t,i){if(this.statistics=e,this.name=t,this.stages=i,i.length<1)throw new Error("MultiStageTimer needs stages");i.forEach((t=>{if(!e.hasTimer(t))throw new Error("Unknown timer: "+t)}))}get value(){return this.statistics.getTimer(this.stages[this.stages.length-1]).value}
950reset(){this.statistics.enabled&&this.stages.forEach((e=>{this.statistics.getTimer(e).reset()}))}start(){var e;return this.stage=this.stages[0],null!==(e=this.statistics.getTimer(this.stages[0]).value)&&void 0!==e?e:-1}stop(){return this.stage=void 0,void 0!==this.value?this.value:-1}get stage(){return this.currentStage}set stage(e){this.currentStage!==e&&(this.statistics.enabled&&void 0!==this.currentStage&&this.statistics.getTimer(this.currentStage).stop(),this.currentStage=e,this.statistics.enabled&&void 0!==this.currentStage&&this.statistics.getTimer(this.currentStage).start())}},t.Statistics=class{constructor(e,t=!1){this.name=e,this.enabled=t,this.timers=new Map,this.nullTimer=new o(this,"<null>")}createTimer(e,t=!0){const i=t?new a(this,e):new o(this,e);return this.addTimer(i)}addTimer(e){if(void 0!==this.timers.get(e.name))throw new Error("Duplicate timer name: '"+e.name+"'");return this.timers.set(e.name,e),e}getTimer(e){if(!this.enabled)return this.nullTimer;const t=this.timers.get(e);return void 0===t?this.nullTimer:t}hasTimer(e){return void 0!==this.timers.get(e)}reset(){this.timers.forEach((e=>{e.reset()}))}log(e,t){void 0===e&&void 0===this.name||r.log(void 0!==e?e:this.name);let i=0;this.timers.forEach((e=>{i=Math.max(i,e.name.length)}));const n=e=>void 0!==e?e.toFixed(5):"?";this.timers.forEach((e=>{let t=e.name+": "+" ".repeat(i-e.name.length);if(t+=n(e.value),e instanceof a){const i=e.getStats();void 0!==i&&(t+=` [ min=${n(i.min)}, max=${n(i.max)}, avg=${n(i.avg)}, med=${n(i.median)}, med95=${n(i.median95)}, med99=${n(i.median99)}, N=${n(i.numSamples)} ]`)}r.log(t)})),void 0!==t&&r.log(t)}};class c{constructor(){this.entries=new Map,this.messages=void 0}getValue(e){return this.entries.get(e)}setValue(e,t){this.entries.set(e,t)}addValue(e,t){const i=this.entries.get(e);this.entries.set(e,t+(void 0===i?0:i))}addMessage(e){void 0===this.messages&&(this.messages=[]),this.messages.push(e)}reset(){this.entries.forEach(((e,t)=>{this.entries.set(t,0)})),this.messages=void 0}}t.FrameStats=c;class h{constructor(e=0){this.capacity=e,this.frameEntries=new Map,this.messages=new s(e)}get length(){return this.messages.size}reset(){this.frameEntries.forEach(((e,t)=>{e.clear()})),this.messages.clear()}addFrame(e){const t=this.length,i=this.frameEntries;e.entries.forEach(((e,n)=>{let r=i.get(n);if(void 0===r){r=new s(this.capacity);for(let e=0;e<t;e++)r.enqOne(0);this.frameEntries.set(n,r)}r.enqOne(e)})),this.messages.enq(e.messages)}log(){let e=0;this.frameEntries.forEach(((t,i)=>{e=Math.max(e,i.length)}));const t=e=>void 0!==e?e.toFixed(5):"?";this.frameEntries.forEach(((i,n)=>{let s=n+": "+" ".repeat(e-n.length);const o=l(i.asArray());void 0!==o&&(s+=` [ min=${t(o.min)}, max=${t(o.max)}, avg=${t(o.avg)}, med=${t(o.median)}, med95=${t(o.median95)}, med99=${t(o.median99)}, N=${t(o.numSamples)} ]`),r.log(s)}))}}t.FrameStatsArray=h;class u{get isFull(){return this.m_frameEvents.length>=this.maxNumFrames}static get instance(){return void 0===u.m_instance&&(u.m_instance=new u(!1,0)),u.m_instance}get frameEvents(){return this.m_frameEvents}constructor(e=!0,t=1e3){this.enabled=e,this.maxNumFrames=t,this.currentFrame=new c,this.appResults=new Map,this.configs=new Map,u.m_instance=this,this.m_frameEvents=new h(t)}clear(){this.clearFrames(),this.configs.clear(),this.appResults.clear()}clearFrames(){this.m_frameEvents.reset(),this.currentFrame.reset()}addWebGLInfo(e){void 0!==e.render&&(this.currentFrame.setValue("gl.numCalls",null===e.render.calls?0:e.render.calls),this.currentFrame.setValue("gl.numPoints",null===e.render.points?0:e.render.points),this.currentFrame.setValue("gl.numLines",null===e.render.lines?0:e.render.lines),this.currentFrame.setValue("gl.numTriangles",null===e.render.triangles?0:e.render.triangles)),void 0!==e.memory&&(this.currentFrame.setValue("gl.numGeometries",null===e.memory.geometries?0:e.memory.geometries),this.currentFrame.setValue("gl.numTextures",null===e.memory.textures?0:e.memory.textures)),void 0!==e.programs&&this.currentFrame.setValue("gl.numPrograms",null===e.programs?0:e.programs.length)}addMemoryInfo(){if(void 0!==window&&void 0!==window.performance){const e=window.performance.memory;void 0!==e&&(this.currentFrame.setValue("memory.totalJSHeapSize",e.totalJSHeapSize),this.currentFrame.setValue("memory.usedJSHeapSize",e.usedJSHeapSize),this.currentFrame.setValue("memory.jsHeapSizeLimit",e.jsHeapSizeLimit))}}storeAndClearFrameInfo(){return!(this.m_frameEvents.length>=this.maxNumFrames||(this.m_frameEvents.addFrame(this.currentFrame),this.currentFrame.reset(),0))}log(e,t){r.log(void 0!==e?e:"PerformanceStatistics"),this.appResults.forEac
950h(((e,t)=>{r.log(t,e)})),this.configs.forEach(((e,t)=>{r.log(t,e)})),this.m_frameEvents.log(),void 0!==t&&r.log(t)}getAsPlainObject(e=!1){const t={},i={},n={},r={configs:i,appResults:t,frames:n};if(this.appResults.forEach(((e,i)=>{t[i]=e})),this.configs.forEach(((e,t)=>{i[t]=e})),e)for(const[e,t]of this.m_frameEvents.frameEntries)n[e]=t.bottom;else for(const[e,t]of this.m_frameEvents.frameEntries)n[e]=t.asArray();return r.messages=this.m_frameEvents.messages.asArray(),r}getLastFrameStatistics(){return this.getAsPlainObject(!0)}getAsSimpleFrameStatistics(e=!1){const t=new Map,i=new Map,n=new Map,r={configs:t,appResults:i,frames:n,messages:this.m_frameEvents.messages.asArray()};if(this.appResults.forEach(((e,t)=>{i.set(t,e)})),this.configs.forEach(((e,i)=>{t.set(i,e)})),e)for(const[e,t]of this.m_frameEvents.frameEntries)n.set(e,t.bottom);else for(const[e,t]of this.m_frameEvents.frameEntries)n.set(e,t.asArray());return r}}t.PerformanceStatistics=u,u.m_instance=void 0},1797:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TextureLoader=void 0;const n=i(82);t.TextureLoader=class{constructor(){this.m_textureLoader=new n.TextureLoader}async load(e,t,i,r=!0){if(void 0===t)return await this.loadWithThreeLoader(e);const s=await fetch(e,{headers:t,signal:i,mode:r?"cors":"no-cors"}),o=await s.blob(),a=await this.loadWithThreeLoader(URL.createObjectURL(o)),l="image/jpeg/"===o.type||e.search(/\.jpe?g($|\?)/i)>0||0===e.search(/^data\:image\/jpeg/);return a.format=l?n.RGBFormat:n.RGBAFormat,a}loadWithThreeLoader(e){return new Promise(((t,i)=>{this.m_textureLoader.setCrossOrigin(""),this.m_textureLoader.load(e,(e=>t(e)),void 0,(()=>i(new Error("failed to load texture"))))}))}}},5640:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createLight=t.toTextureFilter=t.toWrappingMode=t.toTextureDataType=t.toPixelFormat=void 0;const n=i(82),r=i(2616);t.toPixelFormat=function(e){switch(e){case"Alpha":return n.AlphaFormat;case"RGB":return n.RGBFormat;case"RGBA":return n.RGBAFormat;case"Luminance":return n.LuminanceFormat;case"LuminanceAlpha":return n.LuminanceAlphaFormat;case"Depth":return n.DepthFormat;case"DepthStencil":return n.DepthStencilFormat;case"Red":return n.RedFormat;default:throw new Error(`invalid pixel format: ${e}`)}},t.toTextureDataType=function(e){switch(e){case"UnsignedByte":return n.UnsignedByteType;case"Byte":return n.ByteType;case"Short":return n.ShortType;case"UnsignedShort":return n.UnsignedShortType;case"Int":return n.IntType;case"UnsignedInt":return n.UnsignedIntType;case"Float":return n.FloatType;case"HalfFloat":return n.HalfFloatType;default:throw new Error(`invalid texture data type: ${e}`)}},t.toWrappingMode=function(e){switch(e){case"clamp":return n.ClampToEdgeWrapping;case"repeat":return n.RepeatWrapping;case"mirror":return n.MirroredRepeatWrapping;default:throw new Error(`invalid wrapping mode: ${e}`)}},t.toTextureFilter=function(e){switch(e){case"nearest":return n.NearestFilter;case"nearestMipMapNearest":return n.NearestMipMapNearestFilter;case"nearestMipMapLinear":return n.NearestMipMapLinearFilter;case"linear":return n.LinearFilter;case"linearMipMapNearest":return n.LinearMipMapNearestFilter;case"linearMipMapLinear":return n.LinearMipMapLinearFilter;default:throw new Error(`invalid texture filter: ${e}`)}},t.createLight=function(e){switch(e.type){case"ambient":{const t=new n.AmbientLight(e.color,e.intensity);return t.name=e.name,t}case"directional":{const t=new n.DirectionalLight(e.color,e.intensity);return t.name=e.name,void 0!==e.castShadow&&(t.castShadow=e.castShadow),t.castShadow&&(t.shadow.bias=1e-5,t.shadow.mapSize.width=1024,t.shadow.mapSize.height=1024),function(e,t){if((0,r.isVector3Like)(t.direction)){const{x:i,y:n,z:r}=t.direction;e.position.set(i,n,r)}else{const[i,r]=t.direction.map((e=>n.MathUtils.degToRad(e))),s=Math.cos(r);e.position.set(Math.sin(i)*s,Math.cos(i)*s,Math.sin(r))}e.position.normalize()}(t,e),t}}}},6586:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isThemeLoaded=t.load=t.DEFAULT_MAX_THEME_INHERITANCE_DEPTH=void 0,i(6892);const n=i(2616),r=i(1984),s=i(4342),o=i(3307);async function a(e,i,n){var o,h;if(n=null!=n?n:{},"string"==typeof e){const t=null!==(h=null===(o=n.uriResolver)||void 0===o?void 0:o.resolveUri(e))&&void 0!==h?h:e,i=await fetch(t,{signal:n.signal});if(!i.ok)throw new Error(`ThemeLoader#load: cannot load theme: ${i.statusText}`);(e=await i.json()).url=t,e=l(e,n)}else void 0===e.url&&(e.url=(0,s.getAppBaseUrl)(),e=l(e,n));if(e.styles=(0,r.getStyles)(e.styles),null==e)throw new Error("ThemeLoader#load: loaded resource is not val
950id JSON");return e=await async function(e,i,n){if(n=null!=n?n:{},void 0===i.extends)return i;const o=(0,s.getOptionValue)(n.maxInheritanceDepth,t.DEFAULT_MAX_THEME_INHERITANCE_DEPTH);if(o<=0)throw new Error("maxInheritanceDepth reached when attempting to load base theme");const l=Array.isArray(i.extends)?i.extends:[i.extends];delete i.extends;let c={};for(const t of l){let i,s;(0,r.isConditionalExtendsEntry)(t)?(i=t.value,s=t.when):i=t,c=x(await a(i,e,Object.assign(Object.assign({},n),{resolveLightDefinitions:!1,maxInheritanceDepth:o-1})),c,s)}return x(i,c)}(i,e,n),(0,s.getOptionValue)(n.resolveLightDefinitions,!0)&&void 0!==e.lights&&(i.pushAttr("lights"),e.lights=function(e,t,i){const n=[];for(let r=0;r<e.length;++r){i.pushIndex(r);const s=c(e[r],t,i);void 0!==s?n.push(s):i.warn("invalid light, ignored"),i.pop()}return n}(e.lights,e.definitions,i),i.pop()),e}function l(e,t){if(void 0===e.url)return e;if(e.base){const i=`${e.base.style}/${e.base.scheme}.json`,n=null==t?void 0:t.baseUrl;e.extends=void 0!==n?(0,s.resolveReferenceUri)(n,i):i}const i={resolveUri(i){var n,r;const o=null!==(r=null===(n=null==t?void 0:t.uriResolver)||void 0===n?void 0:n.resolveUri(i))&&void 0!==r?r:i;return o!==i?o:(0,s.resolveReferenceUri)(e.url,i)}};return e.extends&&(e.extends=(Array.isArray(e.extends)?e.extends:[e.extends]).map((n=>{let s;if("string"==typeof n)s=i.resolveUri(n);else if((0,r.isConditionalExtendsEntry)(n)){s=n;let r=n.value;"string"==typeof r?r=i.resolveUri(r):void 0===r.url&&(r.url=e.url,r=l(r,t)),s.value=r}else void 0!==n.url?s=n:(n.url=e.url,s=l(n,t));return s}))),!1!==(null==t?void 0:t.resolveResourceUris)&&function(e,t){if(e.sky&&"cubemap"===e.sky.type)for(let i=0;i<o.SKY_CUBEMAP_FACE_COUNT;++i){const n=e.sky[o.SkyCubemapFaceId[i]];void 0!==n&&(e.sky[o.SkyCubemapFaceId[i]]=t.resolveUri(n))}if(e.images)for(const i of Object.keys(e.images)){const n=e.images[i];n.url=t.resolveUri(n.url),void 0!==n.atlas&&(n.atlas=t.resolveUri(n.atlas))}if(e.fontCatalogs)for(const i of e.fontCatalogs)i.url=t.resolveUri(i.url);if(void 0!==e.styles)for(const i of(0,r.getStyles)(e.styles))i.attr&&["map","normalMap","displacementMap","roughnessMap"].forEach((e=>{const n=i.attr[e];n&&"string"==typeof n&&(i.attr[e]=t.resolveUri(n))}))}(e,i),e}function c(e,t,i){const s=h(e.color,t,i);if(void 0===s)return;e.color=s;const o=h(e.intensity,t,i);if(void 0!==o){if(e.intensity=o,(0,r.isDirectionalLight)(e)&&!(0,n.isVector3Like)(e.direction)){const n=e.direction.map((e=>h(e,t,i)));if(n.some((e=>void 0===e)))return;e.direction=n}return e}}function h(e,t,i){let n=!1;const s=function e(s){if((0,r.isJsonExprReference)(s)){const e=s[1],o=t&&t[e];return void 0===o?(i.warn(`invalid reference '${e}' - not found`),void(n=!0)):(0,r.isJsonExpr)(o)?o:(0,r.getDefinitionValue)(o)}if(Array.isArray(s)){const t=[...s];for(let i=1;i<t.length;++i)t[i]=e(t[i]);return t}return s}(e);if(!n)return s}function u(e,t,i){let n;if(void 0!==i&&void 0!==e){n=Object.assign({},t);for(const t of Object.keys(e)){const s=n[t],o=e[t];let a;(0,r.isJsonExpr)(s)&&"case"===s[0]?(a=s.slice(),a.splice(1,0,i,o)):a=["case",i,o,void 0===s?null:s],n[t]=a}}else n=Object.assign(Object.assign({},t),e);return n}function d(e,t,i){e&&e.forEach((e=>{var n;const r=e.id;if(r){if((null!==(n=i.get(r))&&void 0!==n?n:-1)>=0)return;i.set(r,t.length)}t.push(e)}))}function m(e,t,i){var n;
950if((0,r.isJsonExpr)(e)){if(1===e.length&&"base-attribute-value"===e[0])return null!==(n=null==i?void 0:i[t])&&void 0!==n?n:null;let r=e.length;for(;r--;)e[r]=m(e[r],t,i)}return e}function p(e,t,i){if(e){i=null!=i?i:e;for(const n in e)i[n]=m(e[n],n,t)}}function f(e,t,i,n,r,s,o){var a;const l=e.extends;if(!l)return void p(e.attr,void 0);const c=e.id;c&&s.add(c);const h=null!==(a=n.get(l))&&void 0!==a?a:-1,u=i[h],d=e.technique,m=s.has(l),x=m?`circular dependency detected during the theme loading ${[...s].concat([l]).join(" â ")}`:h<0?`id "${l}" not found.`:d&&d!==u.technique?`extending style rule "${null!=c?c:""}" has a different technique from the base rule "${l}".`:"";if(x){const t=`Invalid style "extends": ${x}`;if(o.warn(t),delete e.extends,m)throw new Error(t);return void p(e.attr,void 0)}f(u,h,i,n,r,s,o);const b=Object.assign(Object.assign({},u),e),w=u.attr,M=e.attr;w&&M&&(b.attr=Object.assign(Object.assign({},w),M)),M&&p(M,w,b.attr),e.id||delete b.id,e.when||delete b.when;const T=function(e,t,i,n){let r,s=e.when;if(s===g)r=n.get(i);else{if(r=y(s,i,n),t){const e=["!",v(t)?[...t]:t];s?v(s)?s.push(e):s=["all",s,e]:s=e}else s=g;e.when=s}return r}(u,e.when,l,r);!function(e,t,i,n){const r=_(e,t);r&&y(r,i,n,!0)}(b,T,c,r),delete b.extends,i.splice(t,1,b)}t.DEFAULT_MAX_THEME_INHERITANCE_DEPTH=4,t.load=async function(e,t){var i;const n=new s.ContextLogger(null!==(i=null==t?void 0:t.logger)&&void 0!==i?i:console,`when processing Theme ${"string"==typeof e?e:e.url}:`),o=await a(e,n,Object.assign(Object.assign({},t),{resolveLightDefinitions:!0}));return function(e,t){const i=new Map,n=new Map;e.forEach(((e,t)=>{const n=e.id;n&&i.set(n,t)}));const r=new Set,s=new Set;e.forEach(((o,a)=>{try{f(o,a,e,i,n,s,t)}catch(e){s.forEach(r.add,r)}finally{s.clear()}}));let o=e.length;for(;o--;){const t=e[o].id;(e[o].when===g||t&&r.has(t))&&e.splice(o,1)}}((0,r.getStyles)(o.styles),n),o},t.isThemeLoaded=function(e){return void 0===e.extends&&!(0,r.isStylesDictionary)(e.styles)};const g=["!",!0];function v(e){return(0,r.isJsonExpr)(e)&&"all"===e[0]}function y(e,t,i,n=!1){let r;return t&&(r=i.get(t),!e||!n&&i.has(t)||(r=[...e],i.set(t,r))),r}function _(e,t){let i=e.when;if(i){if(t){const e=v(t),n=v(i);e&&n?i.splice(1,0,...t.slice(1)):e?i=[...t,i]:n?i.splice(1,0,t):i=["all",t,i]}}else t&&(i=[...t]);return i&&(e.when=i),i}function x(e,t,i){const n=(0,r.getStyles)(t.styles),s=(0,r.getStyles)(e.styles),o=[],a=new Map;return d(n,o,a),d(s,o,a),i&&s.forEach((e=>{_(e,i)})),Object.assign(Object.assign(Object.assign(Object.assign({},t),e),function(e,t){const i=Object.assign(Object.assign({}
950,t.images),e.images);let n=[];return!t.imageTextures&&e.imageTextures?n=e.imageTextures:t.imageTextures&&!e.imageTextures?n=t.imageTextures:t.imageTextures&&e.imageTextures&&(n=e.imageTextures.slice(),t.imageTextures.forEach((e=>{n.find((({name:t})=>t===e.name))||n.push(e)}))),{images:i,imageTextures:n}}(e,t)),{definitions:u(e.definitions,t.definitions,i),styles:o})}},1447:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Tile=t.getFeatureDataSize=void 0;const n=i(82),r=i(2616),s=i(5562),o=i(4342),a=i(6473),l=i(7987),c=i(1335),h=i(7013),u=i(3922),d=i(1406),m=i(3977),p=i(8015),f=o.LoggerManager.instance.create("Tile");t.getFeatureDataSize=function(e){let t=100;return void 0!==e.starts&&(t+=8*e.starts.length),void 0!==e.objInfos&&(t+=16*e.objInfos.length),t},t.Tile=class{constructor(e,t,i=0,s){this.dataSource=e,this.tileKey=t,this.objects=[],this.dependencies=[],this.frameNumLastRequested=-1,this.frameNumVisible=-1,this.frameNumLastVisible=-1,this.numFramesVisible=0,this.visibilityCounter=-1,this.levelOffset=0,this.skipRendering=!1,this.delayRendering=!1,this.m_boundingBox=new r.OrientedBox3,this.m_disposed=!1,this.m_forceHasGeometry=void 0,this.m_iconTextGroups=new h.IconTextGroupPriorityList,this.m_pathBlockingElements=[],this.m_worldCenter=new n.Vector3,this.m_visibleArea=0,this.m_elevationRange={minElevation:0,maxElevation:0},this.geoBox=this.dataSource.getTilingScheme().getGeoBox(this.tileKey),this.updateBoundingBox(),this.m_worldCenter.copy(this.boundingBox.position),this.m_localTangentSpace=null!=s&&s,this.m_textStyleCache=new u.TileTextStyleCache(this),this.m_offset=i,this.m_uniqueKey=r.TileKeyUtils.getKeyForTileKeyAndOffset(this.tileKey,this.offset),e.useGeometryLoader&&(this.m_tileGeometryLoader=new c.TileGeometryLoader(this,this.mapView.taskQueue),this.attachGeometryLoadedCallback())}get isVisible(){try{return this.frameNumLastRequested>=this.dataSource.mapView.frameNumber-1}catch(e){return f.debug(e),!1}}set isVisible(e){this.frameNumLastRequested=e?this.dataSource.mapView.frameNumber:-1,e||!this.m_tileGeometryLoader||this.m_tileGeometryLoader.isSettled||this.m_tileGeometryLoader.cancel()}get projection(){return this.dataSource.projection}get mapView(){return this.dataSource.mapView}get localTangentSpace(){return this.m_localTangentSpace}get memoryUsage(){return void 0===this.m_resourceInfo&&this.computeResourceInfo(),this.m_resourceInfo.heapSize}get center(){return this.m_worldCenter}get uniqueKey(){return this.m_uniqueKey}get offset(){return this.m_offset}set offset(e){this.m_offset!==e&&(this.m_uniqueKey=r.TileKeyUtils.getKeyForTileKeyAndOffset(this.tileKey,e)),this.m_offset=e}getResourceInfo(){return void 0===this.m_resourceInfo&&this.computeResourceInfo(),this.m_resourceInfo}invalidateResourceInfo(){this.m_resourceInfo=void 0}addIconText(e){this.iconTextGroups.add(e),this.iconTextsChanged=!0}addBlockingElement(e){this.m_pathBlockingElements.push(e)}get iconTextGroups(){return this.m_iconTextGroups}get iconTextsChanged(){var e;return null!==(e=this.m_iconTextsChanged)&&void 0!==e&&e}set iconTextsChanged(e){this.m_iconTextsChanged=e}hasIconTexts(){return this.m_iconTextGroups.count()>0}get blockingElements(){return this.m_pathBlockingElements}willRender(e){return!this.skipRendering&&!this.delayRendering}didRender(){}get visibleArea(){return this.m_visibleArea}set visibleArea(e){this.m_visibleArea=e,void 0!==this.tileLoader&&(this.tileLoader.priority=e)}get elevationRange(){return this.m_elevationRange}set elevationRange(e){var t;e.minElevation===this.m_elevationRange.minElevation&&e.maxElevation===this.m_elevationRange.maxElevation&&e.calculationStatus===this.m_elevationRange.calculationStatus||(this.m_elevationRange.minElevation=e.minElevation,this.m_elevationRange.maxElevation=e.maxElevation,this.m_elevationRange.calculationStatus=e.calculationStatus,this.elevateGeoBox(),void 0===this.m_maxGeometryHeight&&void 0===this.m_minGeometryHeight||((0,o.assert)(void 0===(null===(t=this.decodedTile)||void 0===t?void 0:t.boundingBox)),this.updateBoundingBox()))}get decodedTile(){return this.m_decodedTile}set decodedTile(e){var t,i;if(this.m_decodedTile=e,this.invalidateResourceInfo(),void 0===e)return;0===e.geometries.length&&this.forceHasGeometry(!0),this.m_maxGeometryHeight=e.boundingBox?void 0:null!==(t=e.maxGeometryHeight)&&void 0!==t?t:0,this.m_minGeometryHeight=e.boundingBox?void 0:null!==(i=e.minGeometryHeight)&&void 0!==i?i:0,this.elevateGeoBox(),this.updateBoundingBox(e.boundingBox);const n=p.PerformanceStatistics.instance;n.enabled&&void 0!==e.decodeTime&&(n.currentFrame.addValue("decode.decodingTime",e.decodeTime),n.currentFrame.addValue("decode.decodedTiles",1)),void 0!==e.copyrightHolderIds&&(this.copyrightInfo=e.copyrightHolderIds.map((e=>({id:e})))),this.dataSource.requestUpdate()}get disposed(){return this.m_disposed}get allGeometryLoaded(){var e,t;return null!==(t=null===(e=this.m_tileGeometryLoader)||void 0===e?void 0:e.isFinished)&&void 0!==t?t:this.hasGeometry}get hasGeometry(){return void 0===this.m_forceHasGeometry?0!==this.objects.length:this.m_forceHasGeometry}forceHasGeometry(e){this.m_forceHasGeometry=e}resetVisibilityCounter(){this.visibilityCounter=-1}get tileLoader(){return this.m_tileLoader}set tileLoader(e){this.m_tileLoader=e}async load(e){const t=this.tileLoader;if(void 0===t)return await Promise.resolve();if(this.m_tileGeometryLoader){const e=this.m_tileGeometryLoader.isSettled;this.m_tileGeometryLoader.reset(),e&&this.attachGeometryLoadedCallback()}return!0===e&&t.cancel(),await t.loadAndDecode().then((e=>{var i;(0,o.assert)(e===d.TileLoaderState.Ready);const n=t.decodedTile;this.decodedTile=n,null===(i=null==n?void 0:n.dependencies)||void 0===i||i.forEac
950h((e=>{this.dependencies.push(r.TileKey.fromMortonCode(e))}))})).catch((e=>{e===d.TileLoaderState.Failed?this.dispose():e!==d.TileLoaderState.Canceled&&f.error("Unknown error"+e)}))}get textStyleCache(){return this.m_textStyleCache}clear(){const e=e=>{var t;Object.getOwnPropertyNames(e).forEach((t=>{const i=e[t];i instanceof n.Texture&&i.dispose()})),(0,s.needsCanvasSize)(e)&&(null===(t=e.onResizeTarget)||void 0===t||t.removeEventListener(m.MapViewEventNames.Resize,e.onResizeListener),delete e.onResizeListener,delete e.onResizeTarget),e.dispose()},t=t=>{var i,n;null===(i=t.geometry)||void 0===i||i.dispose();for(const e of null!==(n=t.geometries)&&void 0!==n?n:[])e.dispose();t.material instanceof Array?t.material.forEach((t=>{void 0!==t&&e(t)})):t.material&&e(t.material)};this.objects.forEach((e=>{e.traverse((e=>{t(e)})),t(e)})),this.objects.length=0,this.preparedTextPaths&&(this.preparedTextPaths=[]),this.m_textStyleCache.clear(),this.clearIconTexts(),this.invalidateResourceInfo()}clearIconTexts(){this.hasIconTexts()&&(this.iconTextsChanged=!0,this.m_pathBlockingElements.splice(0),this.iconTextGroups.forEachElement((e=>{e.dispose()})),this.iconTextGroups.clear())}addDisposeCallback(e){this.m_disposeCallback=(0,o.chainCallbacks)(this.m_disposeCallback,e)}dispose(){var e;this.m_disposed||(this.m_tileLoader&&(this.m_tileLoader.cancel(),this.m_tileLoader=void 0),this.clear(),this.frameNumLastRequested=0,this.m_disposed=!0,null===(e=this.m_tileGeometryLoader)||void 0===e||e.dispose(),this.m_disposeCallback&&this.m_disposeCallback(this))}computeWorldOffsetX(){return this.projection.worldExtent(0,0).max.x*this.offset}update(e){for(const t of this.objects)t instanceof a.LodMesh&&t.setLevelOfDetail(e-this.tileKey.level)}get boundingBox(){return this.m_boundingBox}updateGeometry(e){if(!this.m_tileGeometryLoader)return!1;if(this.m_tileGeometryLoader.isSettled)return!0;if(this.dataSource.isDetached())return this.m_tileGeometryLoader.cancel(),!0;if(this.tileLoader){if(!this.tileLoader.isFinished)return!0;if(!this.decodedTile)return this.m_tileGeometryLoader.finish(),!0}return void 0!==e&&(this.m_tileGeometryLoader.priority=e),this.m_tileGeometryLoader.update(),!0}loadingFinished(){}attachGeometryLoadedCallback(){(0,o.assert)(void 0!==this.m_tileGeometryLoader),this.m_tileGeometryLoader.waitFinished().then((()=>{this.loadingFinished(),this.removeDecodedTile()})).catch((()=>{this.disposed||this.dataSource.isDetached()||this.mapView.visibleTileSet.disposeTile(this)}))}removeDecodedTile(){this.m_decodedTile=void 0,this.invalidateResourceInfo()}updateBoundingBox(e){e?(this.m_boundingBox.copy(e),this.m_worldCenter.copy(this.boundingBox.position)):this.projection.projectBox(this.geoBox,this.boundingBox)}elevateGeoBox(){var e,t;this.geoBox.southWest.altitude=this.m_elevationRange.minElevation+(null!==(e=this.m_minGeometryHeight)&&void 0!==e?e:0),this.geoBox.northEast.altitude=this.m_elevationRange.maxElevation+(null!==(t=this.m_maxGeometryHeight)&&void 0!==t?t:0)}computeResourceInfo(){let e=0,t=0;const i={heapSize:0,gpuSize:0},n=new Map;for(const e of this.objects)e.visible&&t++,l.Object3DUtils.estimateSize(e,i,n);const r=this.iconTextGroups.count();e+=312*r,void 0!==this.m_decodedTile&&void 0!==this.m_decodedTile.tileInfo&&(i.heapSize+=this.m_decodedTile.tileInfo.numBytes),this.m_resourceInfo={heapSize:i.heapSize+e,gpuSize:i.gpuSize,num3dObjects:t,numIconTexts:r,numUserIconTexts:0}}}},9780:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TileObjectRenderer=void 0;const n=i(8152),r=i(1984),s=i(8023),o=i(5863),a=i(8673),l=i(4572);t.TileObjectRenderer=class{constructor(e,t){this.m_env=e,this.m_renderer=t,this.m_renderOrderStencilValues=new Map,this.m_stencilValue=1}render(e,t,i,n,r){const s=e.computeWorldOffsetX();if(e.willRender(t)){for(const t of e.objects){const o=l.MapObjectAdapter.get(t);this.processTileObject(e,i,t,o)&&(this.updateStencilRef(t),t.position.copy(e.center),void 0!==t.displacement&&t.position.add(t.displacement),t.position.x+=s,t.position.sub(n),e.localTangentSpace&&t.setRotationFromMatrix(e.boundingBox.getRotationMatrix()),t.frustumCulled=!1,r.add(t))}e.didRender()}}prepareRender(){this.m_stencilValue=1,this.m_renderOrderStencilValues.clear()}setupRenderer(){const e=(e,t)=>
950{const i=l.MapObjectAdapter.get(e.object),n=l.MapObjectAdapter.get(t.object);return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:(null==i?void 0:i.tileKey)&&(null==n?void 0:n.tileKey)&&i.tileKey.mortonCode()!==n.tileKey.mortonCode()?i.tileKey.mortonCode()-n.tileKey.mortonCode():e.program!==t.program?e.program.id-t.program.id:e.material.id!==t.material.id?e.material.id-t.material.id:e.z!==t.z?e.z-t.z:e.id-t.id};this.m_renderer.setOpaqueSort(((t,i)=>{var n,s,a,c;const h=l.MapObjectAdapter.get(t.object),u=l.MapObjectAdapter.get(i.object),d=null===(n=null==h?void 0:h.dataSource)||void 0===n?void 0:n.dataSourceOrder,m=null===(s=null==u?void 0:u.dataSource)||void 0===s?void 0:s.dataSourceOrder;if(void 0!==d&&void 0!==m&&d!==m)return d-m;if(t.renderOrder===o.BackgroundDataSource.GROUND_RENDER_ORDER||i.renderOrder===o.BackgroundDataSource.GROUND_RENDER_ORDER)return e(t,i);if(h&&u){const n=null===(a=h.tileKey)||void 0===a?void 0:a.level,s=null===(c=u.tileKey)||void 0===c?void 0:c.level;if(void 0!==n&&void 0!==s){const o=void 0!==h.technique&&(0,r.isExtrudedPolygonTechnique)(h.technique)||void 0!==u.technique&&(0,r.isExtrudedPolygonTechnique)(u.technique);return n===s||o?e(t,i):n-s}}return e(t,i)}))}updateStencilRef(e){if(void 0!==e.renderOrder&&e instanceof a.SolidLineMesh){const t=e.material;Array.isArray(t)?t.forEach((t=>t.stencilRef=this.getStencilValue(e.renderOrder))):t.stencilRef=this.getStencilValue(e.renderOrder)}}allocateStencilValue(e){const t=this.m_stencilValue++;return this.m_renderOrderStencilValues.set(e,t),t}getStencilValue(e){var t;return null!==(t=this.m_renderOrderStencilValues.get(e))&&void 0!==t?t:this.allocateStencilValue(e)}processTileObject(e,t,i,n){return!(!i.visible||!this.processTileObjectFeatures(e,t,i)||n&&(n.update(e.mapView),!n.isVisible()&&n.pickability!==r.Pickability.all))}processTileObjectFeatures(e,t,i){var o,a;const c=i.userData,h=l.MapObjectAdapter.get(i);if(!h)return!1;const u=h.technique,d=(0,n.getPropertyValue)(null==u?void 0:u.minZoomLevel,this.m_env),m=(0,n.getPropertyValue)(null==u?void 0:u.maxZoomLevel,this.m_env);if("number"==typeof d&&t<d)return!1;if("number"==typeof m&&t>=m)return!1;if(void 0===(null==u?void 0:u.enabled))return!0;const p=c.feature;if(!p||!s.Expr.isExpr(u.enabled))return Boolean((0,n.getPropertyValue)(u.enabled,this.m_env));const{starts:f,objInfos:g}=p;if(!Array.isArray(g)||!Array.isArray(f))return!0;const v=i.geometry;if(!v||!v.isBufferGeometry)return!0;const y=null!==(a=null===(o=v.getIndex())||void 0===o?void 0:o.count)&&void 0!==a?a:v.attributes.position.count;let _;return v.clearGroups(),g.forEach(((t,i)=>{var o,a;const l=(0,n.getFeatureId)(t);let c=!0;if(s.Expr.isExpr(u.enabled)){const i=e.dataSource.getFeatureState(l),s=i?new r.MapEnv(i):null,o="object"==typeof t?new r.MapEnv(t,this.m_env):this.m_env,a=new r.MapEnv({$state:s},o);c=Boolean((0,n.getPropertyValue)(u.enabled,a))}if(!c)return;const h=null!==(o=f[i])&&void 0!==o?o:0,d=(null!==(a=f[i+1])&&void 0!==a?a:y)-h;h===_?v.groups[v.groups.length-1].count+=d:v.addGroup(h,d),_=h+d})),v.groups.length>0}}},541:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TileOffsetUtils=t.MapViewUtils=void 0;const n=i(82),r=i(2616),s=i(5610),o=i(4342),a=i(4442),l=i(7987),c=o.LoggerManager.instance.create("MapViewUtils"),h=new n.Vector3(0,0,1),u=new n.Plane(h.clone()),d=new n.Sphere(void 0,s.EarthConstants.EQUATORIAL_RADIUS),m=new n.Raycaster,p={x:new n.Vector3,y:new n.Vector3,z:new n.Vector3},f={x:new n.Vector3,y:new n.Vector3,z:new n.Vector3},g={box3:[new n.Box3],obox3:[new r.OrientedBox3],quaternions:[new n.Quaternion,new n.Quaternion],vector2:[new n.Vector2,new n.Vector2],vector3:[new n.Vector3,new n.Vector3,new n.Vector3,new n.Vector3],matrix4:[new n.Matrix4,new n.Matrix4],transforms:[{xAxis:new n.Vector3,yAxis:new n.Vector3,zAxis:new n.Vector3,position:new n.Vector3}]},v=new n.PerspectiveCamera;var y;!function(e){function t(t,i,s,o,l,h){var u,d,m;const p=a.CameraUtils.getPrincipalPoint(t.camera,g.vector2[0]),f=e.rayCastWorldCoordinates(t,p.x,p.y);if(null===f)return;let v;if("number"==typeof i)v=g.vector2[1].set(i,s);else{const e=i;v=null!==(u=e.center)&&void 0!==u?u:p,o=null!==(d=e.deltaAzimuth)&&void 0!==d?d:0,l=null!==(m=e.deltaTilt)&&void 0!==m?m:0,h=e.maxTiltAngle}const y=v.x===p.x&&v.y===p.y?f:e.rayCastWorldCoordinates(t,v.x,v.y);if(null===y)return;!function(e,t,i){const n=e.camera,r=e.projection.surfaceNormal(t,g.vector3[0]),s=g.quaternions[0].setFromAxisAngle(r,i);n.quaternion.premultiply(s),n.position.sub(t),n.position.applyQuaternion(s),n.position.add(t)}(t,y,-o);const _=new n.Vector3(1,0,0).applyQuaternion(t.camera.quaternion),x=function(e,t,i,s,o,a,l){const c=e.camera,h=e.projection,u=S(h,c,o,l);if(u+i<0)return-u;if(i<=0)return i;if(o.equals(a)||t<0)return r.MathUtils.clamp(i+u,0,s)-u;const d=S(h,c,a,l),m=n.MathUtils.degToRad(89);if(d>m)return 0;let p=0;if(h===r.sphereProjection){const e=h.surfaceNormal(a,g.vector3[0]).projectOnPlane(l).normalize(),t=h.surfaceNormal(o,g.vector3[1]);p=e.angleTo(t)}const f=n.MathUtils.degToRad(90),v=f+p-(2*f-(2*f-(f+p-d+(f+u)))-f-s);return r.MathUtils.clamp(i+d,0,Math.min(v,m))-d}(t,v.y-p.y,l,h,f,y,_);!function(t,i,n,r){const s=t.camera,o=s.position.clone(),a=s.quaternion.clone(),l=g.quaternions[0].setFromAxisAngle(r,n);s.quaternion.premultiply(l),s.position.sub(i),s.position.applyQuaternion(l),s.position.add(i),null===e.rayCastWorldCoordinates(t,0,0)&&(c.warn("Target got invalidated during rotation."),s.position.copy(o),s.quaternion.copy(a))}(t,y,x,_)}function i(e,t,i){const o=g.vector3[0].copy(e.position),a=e.getWorldDirection(g.vector3[1]);m.set(o,a),void 0!==i&&(u.constant-=i,d.radius+=i);const l=new n.Vector3,c=t.type===r.ProjectionType.Planar?m.ray.intersectPlane(u,l):m.ray.intersectSphere(d,l);return void 0!==i&&(u.constant=0,d.radius=s.EarthConstants.EQUATORIAL_RADIUS),c}function h(t,i,s){const o={target:t,distance:i},l=s.worldMaxBounds,c=s.camera,h=s.projection;if(!l)return o;const u=l.getSize(g.vector3[1]),d=s.renderer.getSize(g.vector2[0]),m=a.CameraUtils.convertScreenToWorldSize(s.focalLength,o.distance,d.height),p=m*c.aspect,f=Math.max(p/u.x,m/u.y),v=new n.Vector3(p/2,m/2,0),y={target:o.target.clone(),distance:o.distance};if(h.type===r.ProjectionType.Planar){if(f>1)y.distance/=f,c.getWorldDirection(c.position).multiplyScalar(-y.distance).add(l.getCenter(y.target));else{if(g.box3[0].copy(l).expandByVector(v.multiplyScalar(-1)).clampPoint(o.target,y.target).setZ(o.target.z),y.target.equals(o.target))return o;c.position.x+=y.target.x-o.target.x,c.position.y+=y.target.y-o.target.y}return y}if(f>1)l.getCenter(y.target),y.target.setLength(o.target.length()),y.distance/=f;else{const e=g.obox3[0];e.copy(l),e.position.setLength(o.target.length()),e.extents.sub(v);const t=e.getRotationMatrix(g.matrix4[0]),i=g.vector3[1].copy(y.target).sub(e.position).applyMatrix4(g.matrix4[1].copy(t).transpose()).setZ(0),n=g.vector3[2].copy(i).clamp(g.vector3[3].copy(e.extents).multiplyScalar(-1),e.extents);if(n.equals(i))return o;y.target.copy(n).applyMatrix4(t).add(e.position);const r=e.position.lengthSq(),s=y.target.distanceToSquared(e.position),a=Math.sqrt(r)-Math.sqrt(r-s);y.target.addScaledVector(e.zAxis,-a),y.target.setLength(o.target.length())}return e.panCameraAroundGlobe(s,g.vector3[1].copy(y.target),g.vector3[2].copy(o.target)),c.getWorldDirection(c.position).multiplyScalar(-y.distance).add(y.target),y}function y(e,t,i,o,a,l=new n.Vector3){const c=n.MathUtils.degToRad(o),h=Math.cos(c)*t,u=n.MathUtils.degToRad(i);a.projectPoint(e,l);const d=t*Math.sin(c);if(a.type===r.ProjectionType.Planar)l.x=l.x+Math.sin(u)*d,l.y=l.y-Math.cos(u)*d,l.z=l.z+h;else if(a.type===r.ProjectionType.Spherical){f.z.copy(l).normalize(),f.y.set(0,0,1).projectOnPlane(f.z).normalize(),g.quaternions[0].setFromAxisAngle(f.z,u-Math.PI),f.y.applyQuaternion(g.quaternions[0]),f.y.setLength(d);const e=t*Math.cos(c);l.add(f.y).add(f.z.setLength(e));const i=s.EarthConstants.EQUATORIAL_RADIUS+h,n=Math.sin(c)*t,r=Math.sqrt(i*i+n*n);l.setLength(r)}return l}function _(e,t,i,o){const a=g.vector3[0].set(t,i,0);e.camera.updateMatrixWorld();const l=g.vector3[1].copy(e.camera.position);g.matrix4[0].extractRotation(e.camera.matrixWorld),g.matrix4[1].multiplyMatrices(g.matrix4[0],g.matrix4[1].copy(e.camera.projectionMatrix).invert());const c=a.applyMatrix4(g.matrix4[1]);m.set(l,c.normalize()),void 0!==o&&(u.constant-=o,d.radius+=o);const h=new n.Vector3,p=e.projection.type===r.ProjectionType.Planar?m.ray.intersectPlane(u,h):m.ray.intersectSphere(d,h);return void 0!==o&&(u.constant=0,d.radius=s.EarthConstants.EQUATORIAL_RADIUS),p}function x(e,t,i){e.camera.position.x+=t,e.camera.position.y+=i}function b(e,t,i){g.quaternions[0].setFromUnitVectors(t.normalize(),i.normalize()).invert(),g.matrix4[0].makeRotationFromQuaternion(g.quaternions[0]),e.camera.applyMatrix4(g.matrix4[0]),e.camera.updateMatrixWorld()}function w(e,t,i,r,s=new n.Quaternion){const o=g.transforms[0];return e.localTangentSpace(t,o),g.matrix4[0].makeBasis(o.xAxis,o.yAxis,o.zAxis),s.setFromRotationMatrix(g.matrix4[0]),g.quaternions[0].setFromAxisAngle(g.vector3[1].set(0,0,1),n.MathUtils.degToRad(i)),g.quaternions[1].setFromAxisAngle(g.vector3[1].set(1,0,0),n.MathUtils.degToRad(r)),s.multiply(g.quaternions[0]),s.multiply(g.quaternions[1]),s}function M(t,i){if(i.type===r.ProjectionType.Planar){const e=t.getWorldDirection(g.vector3[0]).normalize(),r=i.surfaceNormal(t.position,g.vector3[1]).negate(),s=e.dot(r);return Math.acos(n.MathUtils.clamp(s,-1,1))}{(0,o.assert)(i.type===r.ProjectionType.Spherical);const n=e.getGeoTargetFromCamera(t,i);return null!==n?e.extractTiltAngleFromLocation(i,t,n):(c.warn("MapView camera is pointing in the void, using maxTilt: ",e.MAX_TILT_RAD),e.MAX_TILT_RAD)}}function T(e,t){g.vector3[1].setFromMatrixPosition(t.matrixWorld),e.projection.localTangentSpace(g.vector3[1],{xAxis:f.x,yAxis:f.y,zAxis:f.z,position:g.vector3[0]}),g.matrix4[1].makeBasis(f.x,f.y,f.z),g.matrix4[0].copy(g.matrix4[1]).invert().multiply(t.matrixWorld),p.x.setFromMatrixColumn(g.matrix4[0],0),p.y.setFromMatrixColumn(g.matrix4[0],1),p.z.setFromMatrixColumn(g.matrix4[0],2);let i=0,n=0,r=0;
950const s=p.z.dot(g.vector3[1].set(0,0,1));return s<1-Number.EPSILON?s>-1+Number.EPSILON?(i=Math.atan2(p.z.x,-p.z.y),n=Math.acos(p.z.z),r=Math.atan2(p.x.z,p.y.z)):(i=-Math.atan2(-p.y.x,p.x.x),n=180,r=0):(i=Math.atan2(-p.y.x,p.x.x),n=0,r=0),{yaw:i,pitch:n,roll:r}}function S(e,t,i,r){e.localTangentSpace(i,{xAxis:f.x,yAxis:f.y,zAxis:f.z,position:g.vector3[0]});const s=g.vector3[2].copy(t.position).sub(g.vector3[0]);r&&(s.projectOnPlane(r),f.z.projectOnPlane(r).normalize());const o=s.length();if(o<1e-5)return c.error("Can not calculate tilt for the zero length vector!"),0;s.divideScalar(o);const a=s.dot(f.z);return a>=1-Number.EPSILON?0:Math.acos(n.MathUtils.clamp(a,-1,1))}function E(e,t){const i=s.EarthConstants.EQUATORIAL_CIRCUMFERENCE/Math.pow(2,t);return e.focalLength*i/256}e.MAX_TILT_DEG=89,e.MAX_TILT_RAD=e.MAX_TILT_DEG*n.MathUtils.DEG2RAD,e.zoomOnTargetPosition=function(i,n,s,o,a=e.MAX_TILT_RAD){const{elevationProvider:l,camera:c,projection:u}=i,d=l?l.getHeight(u.unprojectPoint(c.position),4):void 0,m=_(i,n,s,d),p=e.getTargetAndDistance(u,c,l).target,f=E(i,o);if(i.geoMaxBounds&&h(p,f,i).distance!==f)return o>=i.zoomLevel;if(c.getWorldDirection(c.position).multiplyScalar(-f).add(p),u.type===r.ProjectionType.Spherical){const e=M(c,u)-a;e>0&&t(i,{deltaTilt:e,maxTiltAngle:a})}const g=_(i,n,s,d);return!m||!g||(u.type===r.ProjectionType.Planar?(m.sub(g),x(i,m.x,m.y)):u.type===r.ProjectionType.Spherical&&b(i,m,g),!0)},e.orbitAroundScreenPoint=t,e.getGeoTargetFromCamera=function(e,t,n){const r=i(e,t,n);return null!==r?t.unprojectPoint(r):null},e.getWorldTargetFromCamera=i,e.constrainTargetAndDistanceToViewBounds=h,e.getTargetAndDistance=function(t,n,o){const a=T({projection:t},n).pitch,l=o?o.getHeight(t.unprojectPoint(n.position),4):void 0,c=!o||void 0!==l,h=a<e.MAX_TILT_RAD?i(n,t,l):null;if(null!==h)return{target:h,distance:n.position.distanceTo(h),final:c};{const i=t.groundDistance(n.position),o=Math.max(i-(null!=l?l:0),0),h=t.type===r.ProjectionType.Planar?o/Math.cos(Math.min(a,e.MAX_TILT_RAD)):Math.sqrt(Math.pow(o+s.EarthConstants.EQUATORIAL_RADIUS,2)-Math.pow(s.EarthConstants.EQUATORIAL_RADIUS,2)),u=n.getWorldDirection(g.vector3[0]);u.multiplyScalar(h);const d=g.vector3[1];return d.copy(n.position).add(u),{target:d,distance:h,final:c}}},e.getCameraPositionFromTarget=y,e.wrapGeoPointsToScreen=function(e,t){let i=0;void 0===t&&(t=r.GeoCoordinates.fromObject(e[0]),i=1);let n=t.latitude,s=t.latitude,o=r.MathUtils.normalizeLongitudeDeg(t.longitude),a=0,l=t.longitude,c=t.longitude;const h=[];h.push(new r.GeoCoordinates(n,o));for(let t=i;t<e.length;t++){const i=r.GeoCoordinates.fromObject(e[t]);i.latitude>n?n=i.latitude:i.latitude<s&&(s=i.latitude);let u=r.MathUtils.normalizeLongitudeDeg(i.longitude);const d=r.MathUtils.angleDistanceDeg(o,u);u=o-d,d<0&&-d>a/2?(l=Math.max(l,o-d),a=l-c,o=(l+c)/2):d>0&&d>a/2&&(c=Math.min(c,u),a=l-c,o=(l+c)/2),h.push(new r.GeoCoordinates(i.latitude,u))}return h},e.wrapWorldPointsToView=function(e,t){const i=t.clone().normalize();for(const n of e)if(n.angleTo(t)>Math.PI/2){const e=n.length();n.projectOnPlane(i).setLength(e)}},e.geoBoxToGeoPoints=function(e){const t=e.center;return[new r.GeoCoordinates(e.north,e.west),new r.GeoCoordinates(e.north,e.east),new r.GeoCoordinates(t.latitude,e.west),new r.GeoCoordinates(t.latitude,e.east),new r.GeoCoordinates(e.south,e.west),new r.GeoCoordinates(e.south,e.east),new r.GeoCoordinates(e.north,t.longitude),new r.GeoCoordinates(e.south,t.longitude)]},e.getCameraCoordinatesFromTargetCoordinates=function(e,t,i,n,r){return r.projection.unprojectPoint(y(e,t,i,n,r.projection,g.vector3[1]))},e.rayCastWorldCoordinates=_,e.panCameraAboveFlatMap=x,e.panCameraAroundGlobe=b,e.rotate=function(t,i,o=0,a=Math.PI/4){if(t.camera.rotateOnWorldAxis(t.projection.type===r.ProjectionType.Spherical?g.vector3[0].copy(t.camera.position).normalize():g.vector3[0].set(0,0,1),n.MathUtils.degToRad(-i)),t.camera.updateMatrixWorld(),0===o)return;const l=e.extractAttitude(t,t.camera).pitch;let c=n.MathUtils.clamp(l+n.MathUtils.degToRad(o),0,a);if(t.projection.type===r.ProjectionType.Spherical){const e=Math.asin(s.EarthConstants.EQUATORIAL_RADIUS*Math.sin(Math.PI-a)/t.camera.position.length());c=Math.min(c,e)}t.camera.rotateX(c-l)},e.getCameraRotationAtTarget=w,e.setRotation=function(e,t,i){w(e.projection,e.geoCenter,t,i,e.camera.quaternion)},e.extractCameraTilt=M,e.extractAttitude=T,e.extractSphericalCoordinatesFromLocation=function(e,t,i){e.projection.localTangentSpace(i,{xAxis:f.x,yAxis:f.y,zAxis:f.z,position:g.vector3[0]});let n=0,r=0;return g.vector3[1].copy(t.position).sub(g.vector3[0]).normalize(),g.vector3[1].dot(f.z)>1-Number.EPSILON?(r=Math.PI-T(e,t).yaw,r=Math.atan2(Math.sin(r),Math.cos(r)),n=0,{tilt:n,azimuth:r}):(n=g.vector3[1].angleTo(f.z),g.vector3[1].copy(t.position).sub(g.vector3[0]).projectOnPlane(f.z).normalize(),r=g.vector3[1].angleTo(f.y),g.vector3[1].cross(f.y).dot(f.z)<0&&(r=-r),{tilt:n,azimuth:r})},e.extractTiltAngleFromLocation=S,e.getCameraFrustumPlanes=function(e){const t=e.near,i=e.far;let r=t*Math.tan(n.MathUtils.degToRad(.5*e.fov))/e.zoom,s=2*r,o=e.aspect*s,a=-.5*o;const l=e.view;if(null!==l&&l.enabled){const e=l.fullWidth,t=l.fullHeight;a+=l.offsetX*o/e,r-=l.offsetY*s/t,o*=l.width/e,s*=l.height/t}return a+=0!==e.filmOffset?t*e.filmOffset/e.getFilmWidth():0,{left:a,right:a+o,top:r,bottom:r-s,near:t,far:i}},e.rayCastGeoCoordinates=function(e,t,i){const n=_(e,t,i);return n?e.projection.unprojectPoint(n):null},e.calculateDistanceToGroundFromZoomLevel=function(e,t){const i=T(e,e.camera).pitch,n=s.EarthConstants.EQUATORIAL_CIRCUMFERENCE/Math.pow(2,t);return e.focalLength*n/256*Math.cos(i)},e.calculateDistanceFromZoomLevel=E,e.calculateZoomLevelFromDistance=function(e,t){const i=256*t/e.focalLength;return function(e){const t=Math.ceil(e);return t-e<1e-6?t:e}(n.MathUtils.clamp(Math.log2(s.EarthConstants.EQUATORIAL_CIRCUMFERENCE/i),e.minZoomLevel,e.maxZoomLevel))}
950,e.calculateDepthFromClipDistance=function(e,t){const i=t,n=i.far-i.near,r=e*i.far;return(1-i.near/r)*(i.far/n)},e.cameraToWorldDistance=function(e,t){return e*t.far},e.calculateVerticalFovByHorizontalFov=function(e,t){return 2*Math.atan(Math.tan(e/2)/t)},e.calculateHorizontalFovByVerticalFov=function(e,t){return v.fov=n.MathUtils.radToDeg(e),v.aspect=t,a.CameraUtils.getHorizontalFov(v)},e.calculateFocalLengthByVerticalFov=function(e,t){return a.CameraUtils.setPrincipalPoint(v,new n.Vector2),a.CameraUtils.setVerticalFov(v,e,t),a.CameraUtils.getFocalLength(v)},e.calculateFovByFocalLength=function(e,t){return a.CameraUtils.setPrincipalPoint(v,new n.Vector2),a.CameraUtils.setFocalLength(v,e,t),v.fov},e.calculateScreenSizeByFocalLength=a.CameraUtils.convertWorldToScreenSize,e.calculateWorldSizeByFocalLength=a.CameraUtils.convertScreenToWorldSize,e.estimateObject3dSize=l.Object3DUtils.estimateSize,e.mapViewIsLoading=function(e){let t=0;for(const i of e.visibleTileSet.dataSourceTileList){t+=i.numTilesLoading;for(const e of i.visibleTiles)e.allGeometryLoaded||t++}let i=t>0;return void 0!==e.iconTextRenderer&&(i=i||e.iconTextRenderer.loading),i=i||!e.visibleTileSet.allVisibleTilesLoaded,i},e.closeToFrustum=function(e,t,i=1e-13){const r=(new n.Vector3).copy(e).project(t);return Math.abs(r.x)-i<1&&Math.abs(r.y)-i<1&&Math.abs(r.z)-i<1},e.getBrowserLanguages=o.DOMUtils.getBrowserLanguages}(t.MapViewUtils||(t.MapViewUtils={})),(y=t.TileOffsetUtils||(t.TileOffsetUtils={})).getKeyForTileKeyAndOffset=r.TileKeyUtils.getKeyForTileKeyAndOffset,y.extractOffsetAndMortonKeyFromKey=r.TileKeyUtils.extractOffsetAndMortonKeyFromKey,y.getParentKeyFromKey=r.TileKeyUtils.getParentKeyFromKey},5008:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VisibleTileSet=t.ResourceComputationType=void 0;const n=i(82),r=i(2616),s=i(8263),o=i(4342),a=i(5863),l=i(8502);var c,h;!function(e){e[e.EstimationInMb=0]="EstimationInMb",e[e.NumberOfTiles=1]="NumberOfTiles"}(c=t.ResourceComputationType||(t.ResourceComputationType={})),function(e){e[e.NONE=0]="NONE",e[e.UP=1]="UP",e[e.DOWN=2]="DOWN",e[e.BOTH=3]="BOTH"}(h||(h={}));const u=1/1048576;class d{static getKey(e,t,i){return`${i.name}_${e}_${t}`}static getKeyForTile(e){return d.getKey(e.tileKey.mortonCode(),e.offset,e.dataSource)}constructor(e,t=c.EstimationInMb){this.m_disposedTiles=[],this.m_resourceComputationType=t,this.m_tileCache=new s.LRUCache(e,(e=>this.m_resourceComputationType===c.EstimationInMb?e.memoryUsage*u:1)),this.m_tileCache.evictionCallback=(e,t)=>{void 0!==t.tileLoader&&t.tileLoader.cancel(),this.m_disposedTiles.push(t)},this.m_tileCache.canEvict=(e,t)=>!t.isVisible}get resourceComputationType(){return this.m_resourceComputationType}get capacity(){return this.m_tileCache.capacity}get size(){return this.m_tileCache.size}setCapacity(e,t){this.m_resourceComputationType=t,this.m_tileCache.setCapacityAndMeasure(e,(e=>this.m_resourceComputationType===c.EstimationInMb?e.memoryUsage*u:1))}get(e,t,i){return this.m_tileCache.get(d.getKey(e,t,i))}set(e,t,i,n){this.m_tileCache.set(d.getKey(e,t,i),n)}delete(e){const t=d.getKeyForTile(e);this.deleteByKey(t)}deleteByKey(e){this.m_tileCache.delete(e)}disposeTiles(){this.m_disposedTiles.forEach((e=>{e.dispose()})),this.m_disposedTiles.length=0}shrinkToCapacity(){this.m_tileCache.shrinkToCapacity()}evictAll(){this.m_tileCache.evictAll()}evictSelected(e){this.m_tileCache.evictSelected(e)}forEach(e,t){this.m_tileCache.forEach(((i,n)=>{void 0!==t&&i.dataSource!==t||e(i,n)}))}}const m=(e,t)=>{const i=e.distance-t.distance,n=1e-6*(e.distance+t.distance);return Math.abs(i)<n?e.tileKey.mortonCode()-t.tileKey.mortonCode():i};t.VisibleTileSet=class{constructor(e,t,i){var r;this.m_frustumIntersection=e,this.m_tileGeometryManager=t,this.options=i,this.dataSourceTileList=[],this.allVisibleTilesLoaded=!1,this.m_cameraOverride=new n.PerspectiveCamera,this.m_viewRange={near:.1,far:1/0,minimum:.1,maximum:1/0},this.m_coveringMap=new Map,this.m_resourceComputationType=c.EstimationInMb,this.options=i,this.options.maxTilesPerFrame=Math.floor(null!==(r=this.options.maxTilesPerFrame)&&void 0!==r?r:0),this.m_resourceComputationType=void 0===i.resourceComputationType?c.EstimationInMb:i.resourceComputationType,this.m_dataSourceCache=new d(this.options.tileCacheSize,this.m_resourceComputationType)}getDataSourceCacheSize(){return this.options.tileCacheSize}setDataSourceCacheSize(e,t=c.EstimationInMb){this.options.tileCacheSize=e,this.resourceComputationType=t}getNumberOfVisibleTiles(){return this.options.maxVisibleDataSourceTiles}setNumberOfVisibleTiles(e){this.options.maxVisibleDataSourceTiles=e}
950get maxTilesPerFrame(){return this.options.maxTilesPerFrame}set maxTilesPerFrame(e){if(e<0)throw new Error("Invalid value, this will result in no tiles ever showing");this.options.maxTilesPerFrame=Math.floor(e)}get resourceComputationType(){return this.m_resourceComputationType}set resourceComputationType(e){this.m_resourceComputationType=e,this.m_dataSourceCache.setCapacity(this.options.tileCacheSize,e)}updateClipPlanes(e,t){void 0!==e&&(this.options.clipPlanesEvaluator.maxElevation=e),void 0!==t&&(this.options.clipPlanesEvaluator.minElevation=t);const{camera:i,projection:n,elevationProvider:r}=this.m_frustumIntersection.mapView;return this.m_viewRange=this.options.clipPlanesEvaluator.evaluateClipPlanes(i,n,r),this.m_viewRange}updateRenderList(e,t,i,n,r){let s=!0;const a=this.getVisibleTileKeysForDataSources(t,i,r);this.dataSourceTileList=[],this.m_coveringMap.clear();for(const{dataSource:i,visibleTileKeys:r}of a.tileKeys){r.sort(m);const o=i.getDataZoomLevel(t),a=this.processVisibleTiles(r,i,n,{newTilesPerFrame:0},!0),l=this.processVisibleTiles(a.dependentTiles,i,n,{newTilesPerFrame:0},!1);this.m_tileGeometryManager.updateTiles(a.visibleTiles),this.m_tileGeometryManager.updateTiles(l.visibleTiles),this.dataSourceTileList.push({dataSource:i,storageLevel:e,zoomLevel:o,allVisibleTileLoaded:a.allDataSourceTilesLoaded&&l.allDataSourceTilesLoaded,numTilesLoading:a.numTilesLoading+l.numTilesLoading,visibleTiles:[...a.visibleTiles,...l.visibleTiles],renderedTiles:new Map}),s=s&&a.allDataSourceTilesLoaded}let l,c;this.allVisibleTilesLoaded=s&&a.allBoundingBoxesFinal,this.populateRenderedTiles(),this.forEachCachedTile((e=>{e.isVisible||e.allGeometryLoaded||this.disposeTile(e)})),this.m_dataSourceCache.shrinkToCapacity(),this.dataSourceTileList.forEach((e=>{e.renderedTiles.forEach((t=>{t.update(e.zoomLevel),l=o.MathUtils.min2(l,t.geoBox.minAltitude),c=o.MathUtils.max2(c,t.geoBox.maxAltitude)}))})),void 0===l&&(l=0),void 0===c&&(c=0);let h=!1;const u=this.m_viewRange,d=this.updateClipPlanes(c,l);var p,f;return h=0==(f=u,(p=d).far===f.far&&p.maximum===f.maximum&&p.minimum===f.minimum&&p.near===f.near),{viewRanges:d,viewRangesChanged:h}}getTile(e,t,i,n){return this.getTileImpl(e,t,i,!1,n)}getCachedTile(e,t,i,n){return(0,o.assert)(e.cacheable),this.getTileImpl(e,t,i,!0,n)}getRenderedTile(e,t,i=0){const n=this.dataSourceTileList.find((t=>t.dataSource===e));if(void 0!==n)return n.renderedTiles.get(r.TileKeyUtils.getKeyForTileKeyAndOffset(t,i))}getRenderedTileAtLocation(e,t,i=0){const n=this.dataSourceTileList.find((t=>t.dataSource===e));if(void 0===n)return;const s=e.getTilingScheme(),o=n.zoomLevel,a=s.getTileKey(t,o);if(!a)return;let l=n.renderedTiles.get(r.TileKeyUtils.getKeyForTileKeyAndOffset(a,i));if(void 0!==l)return l;const{searchLevelsUp:c,searchLevelsDown:h}=this.getSearchDirection(e,o);let u=a;for(let e=1;e<=c;++e)if(u=u.parent(),l=n.renderedTiles.get(r.TileKeyUtils.getKeyForTileKeyAndOffset(u,i)),void 0!==l)return l;const d=s.projection.projectPoint(t);for(let e=1;e<=h;++e){const t=o+e,a=r.TileKeyUtils.worldCoordinatesToTileKey(s,d,t);if(a&&(l=n.renderedTiles.get(r.TileKeyUtils.getKeyForTileKeyAndOffset(a,i)),void 0!==l))return l}}removeDataSource(e){this.clearTileCache(e),this.dataSourceTileList=this.dataSourceTileList.filter((t=>t.dataSource!==e))}clearTileCache(e,t){void 0!==e?this.m_dataSourceCache.evictSelected(((i,n)=>i.dataSource===e&&(void 0===t||t(i)))):void 0!==t?this.m_dataSourceCache.evictSelected(t):this.m_dataSourceCache.evictAll()}markTilesDirty(e,t){if(void 0===e)this.dataSourceTileList.forEach((e=>{this.markDataSourceTilesDirty(e,t)}));else{const i=this.dataSourceTileList.find((t=>t.dataSource===e));if(void 0===i)return;this.markDataSourceTilesDirty(i,t)}}disposePendingTiles(){this.m_dataSourceCache.disposeTiles()}forEachVisibleTile(e){for(const t of this.dataSourceTileList)t.renderedTiles.forEach(e)}forEachCachedTile(e,t){this.m_dataSourceCache.forEach(((t,i)=>e(t)),t)}disposeTile(e){this.m_dataSourceCache.delete(e),e.dispose()}processVisibleTiles(e,t,i,n,r){var s;let o=!0,a=0;const c=[],h=[];for(let u=0;u<e.length&&c.length<this.options.maxVisibleDataSourceTiles;u++){const d=e[u],m=this.getTile(t,d.tileKey,d.offset,i);if(void 0!==m&&(c.push(m),o=o&&m.allGeometryLoaded,m.allGeometryLoaded?(this.skipOverlappedTiles(t,m),this.processDelayTileRendering(m,n.newTilesPerFrame,i)&&n.newTilesPerFrame++):a++,m.visibleArea=d.area,m.elevationRange=null!==(s=d.elevationRange)&&void 0!==s?s:{minElevation:0,maxElevation:0},r))for(const t of m.dependencies)void 0===e.find((e=>e.tileKey.mortonCode()===t.mortonCode()))&&void 0===h.find((e=>e.tileKey.mortonCode()===t.mortonCode()))&&h.push(new l.TileKeyEntry(t,0))}return{allDataSourceTilesLoaded:o,numTilesLoading:a,visibleTiles:c,dependentTiles:h}}processDelayTileRendering(e,t,i){let n=!1;return 0!==this.options.maxTilesPerFrame&&t>this.options.maxTilesPerFrame&&e.frameNumLastVisible!==i-1?(e.delayRendering=!0,e.mapView.update()):(e.frameNumVisible<0&&(e.frameNumVisible=i,n=!0),e.numFramesVisible++,e.delayRendering=!1),n}skipOverlappedTiles(e,t){if(this.options.projection.type!==r.ProjectionType.Spherical&&e.isFullyCovering()){const i=t.uniqueKey,n=this.m_coveringMap.get(i);void 0===n?(t.skipRendering=!1,this.m_coveringMap.set(i,t)):n.dataSource instanceof a.Backgroun
950dDataSource?n.skipRendering=!0:e instanceof a.BackgroundDataSource&&(t.skipRendering=!0)}}getSearchDirection(e,t){const i=Math.min(this.options.quadTreeSearchDistanceUp,Math.max(0,t-e.minDataLevel)),n=Math.min(this.options.quadTreeSearchDistanceDown,Math.max(0,e.maxDataLevel-t));return{searchDirection:n>0&&i>0?h.BOTH:n>0?h.DOWN:i>0?h.UP:h.NONE,searchLevelsUp:i,searchLevelsDown:n}}populateRenderedTiles(){this.dataSourceTileList.forEach((e=>{const t=e.renderedTiles,i=[];e.visibleTiles.forEach((e=>{e.levelOffset=0,e.hasGeometry&&!e.delayRendering?t.set(e.uniqueKey,e):i.push(e.uniqueKey)}));const n=e.dataSource;if(0===i.length||!1===n.allowOverlappingTiles)return;const r=e.zoomLevel,{searchDirection:s}=this.getSearchDirection(n,r),o=new Map;for(const e of i)(s!==h.BOTH&&s!==h.UP||!this.findUp(e,r,t,o,n))&&(s!==h.BOTH&&s!==h.DOWN||this.findDown(e,r,t,n))}))}findDown(e,t,i,n){const{offset:s,mortonCode:o}=r.TileKeyUtils.extractOffsetAndMortonKeyFromKey(e),a=r.TileKey.fromMortonCode(o),l=n.getTilingScheme();for(const e of l.getSubTileKeys(a)){const o=r.TileKeyUtils.getKeyForTileKeyAndOffset(e,s),a=this.m_dataSourceCache.get(e.mortonCode(),s,n),l=Math.abs(e.level-t);void 0===a||!a.hasGeometry||a.delayRendering?l<this.options.quadTreeSearchDistanceDown&&this.findDown(o,t,i,n):(i.set(o,a),a.levelOffset=l)}}findUp(e,t,i,n,s){const o=r.TileKeyUtils.getParentKeyFromKey(e);if(void 0!==i.get(o))return!0;const a=n.get(o);if(void 0!==a)return a;const{offset:l,mortonCode:c}=r.TileKeyUtils.extractOffsetAndMortonKeyFromKey(o),h=this.m_dataSourceCache.get(c,l,s),u=h?h.tileKey:r.TileKey.fromMortonCode(c),d=Math.abs(t-u.level);if(void 0!==h&&h.hasGeometry&&!h.delayRendering)return n.set(o,!0),i.set(o,h),h.levelOffset=-d,!0;if(n.set(o,!1),d<this.options.quadTreeSearchDistanceUp&&0!==u.level){const e=this.findUp(o,t,i,n,s);if(n.set(o,e),e)return!0}return!1}getTileImpl(e,t,i,n,r){function s(e){e.frameNumLastRequested=r}if(!e.cacheable&&!n){const i=e.getTile(t,!0);return void 0!==i&&(i.load(),s(i)),i}const o=this.m_dataSourceCache;let a=o.get(t.mortonCode(),i,e);return void 0!==a&&a.offset===i?(s(a),a):n?void 0:(a=e.getTile(t,!0),void 0!==a&&(a.load(),a.offset=i,s(a),o.set(t.mortonCode(),i,e,a)),a)}markDataSourceTilesDirty(e,t){const i=this.m_dataSourceCache,n=new Set,r=e=>{const t=d.getKeyForTile(e);n.has(t)||(n.add(t),e.load(!0))};e.visibleTiles.forEach((e=>{(void 0===t||t(e))&&r(e)})),e.renderedTiles.forEach((e=>{(void 0===t||t(e))&&r(e)})),i.forEach(((e,r)=>{void 0!==t&&!t(e)||n.has(r)||(i.deleteByKey(r),e.dispose())}),e.dataSource)}getVisibleTileKeysForDataSources(e,t,i){const n=Array();let r=!0;if(0===t.length)return{tileKeys:n,allBoundingBoxesFinal:r};const s=new Map;t.forEach((e=>{const t=e.getTilingScheme(),i=s.get(t);void 0===i?s.set(t,[e]):i.push(e)})),void 0!==i?(this.m_cameraOverride.copy(this.m_frustumIntersection.camera),this.m_cameraOverride.near=Math.min(this.m_cameraOverride.near,this.m_viewRange.minimum),this.m_cameraOverride.far=Math.max(this.m_cameraOverride.far,this.m_viewRange.maximum),this.m_cameraOverride.updateProjectionMatrix(),this.m_frustumIntersection.updateFrustum(this.m_cameraOverride.projectionMatrix)):this.m_frustumIntersection.updateFrustum();for(const[t,o]of s){const s=o.map((t=>t.getDataZoomLevel(e))),a=this.m_frustumIntersection.compute(t,i,s,o);r=r&&a.calculationFinal;for(const t of o){const i=[],r=t.getDataZoomLevel(e);for(const e of a.tileKeyEntries.get(r).values())t.canGetTile(r,e.tileKey)&&i.push(e);n.push({dataSource:t,visibleTileKeys:i})}}return{tileKeys:n,allBoundingBoxesFinal:r}}}},9931:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkerBasedDecoder=void 0;const n=i(8152);let r=0;t.WorkerBasedDecoder=class{constructor(e,t){this.workerSet=e,this.decoderServiceType=t,this.m_serviceCreated=!1,this.workerSet.addReference(),this.serviceId=`${this.decoderServiceType}-${r++}`}dispose(){this.m_serviceCreated&&this.workerSet.broadcastRequest(n.WorkerServiceProtocol.WORKER_SERVICE_MANAGER_SERVICE_ID,{type:n.WorkerServiceProtocol.Requests.DestroyService,targetServiceId:this.serviceId}).catch((()=>{})),this.workerSet.removeReference()}async connect(){await this.workerSet.connect(n.WorkerServiceProtocol.WORKER_SERVICE_MANAGER_SERVICE_ID),this.m_serviceCreated||(await this.workerSet.broadcastRequest(n.WorkerServiceProtocol.WORKER_SERVICE_MANAGER_SERVICE_ID,{type:n.WorkerServiceProtocol.Requests.CreateService,targetServiceType:this.decoderServiceType,targetServiceId:this.serviceId}),this.m_serviceCreated=!0)}decodeTile(e,t,i,r){const s=t.mortonCode(),o={type:n.WorkerDecoderProtocol.Requests.DecodeTileRequest,tileKey:s,data:e,projection:(0,n.getProjectionName)(i)},a=e instanceof ArrayBuffer?[e]:void 0;
950return this.workerSet.invokeRequest(this.serviceId,o,a,r)}getTileInfo(e,t,i,r){const s=t.mortonCode(),o={type:n.WorkerDecoderProtocol.Requests.TileInfoRequest,tileKey:s,data:e,projection:(0,n.getProjectionName)(i)},a=e instanceof ArrayBuffer?[e]:void 0;return this.workerSet.invokeRequest(this.serviceId,o,a,r)}configure(e,t){const i=Object.assign(Object.assign({service:this.serviceId,type:n.WorkerDecoderProtocol.DecoderMessageName.Configuration},e),{options:t});this.workerSet.broadcastMessage(i)}get workerCount(){return this.workerSet.workerCount}}},3373:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkerBasedTiler=void 0;const n=i(8152);let r=0;t.WorkerBasedTiler=class{constructor(e,t){this.workerSet=e,this.tilerServiceType=t,this.m_serviceCreated=!1,this.workerSet.addReference(),this.serviceId=`${this.tilerServiceType}-${r++}`}dispose(){this.m_serviceCreated&&this.workerSet.broadcastRequest(n.WorkerServiceProtocol.WORKER_SERVICE_MANAGER_SERVICE_ID,{type:n.WorkerServiceProtocol.Requests.DestroyService,targetServiceId:this.serviceId}).catch((()=>{})),this.workerSet.removeReference()}async connect(){await this.workerSet.connect(n.WorkerServiceProtocol.WORKER_SERVICE_MANAGER_SERVICE_ID),this.m_serviceCreated||(await this.workerSet.broadcastRequest(n.WorkerServiceProtocol.WORKER_SERVICE_MANAGER_SERVICE_ID,{type:n.WorkerServiceProtocol.Requests.CreateService,targetServiceType:this.tilerServiceType,targetServiceId:this.serviceId}),this.m_serviceCreated=!0)}registerIndex(e,t){const i={type:n.WorkerTilerProtocol.Requests.RegisterIndex,id:e,input:t instanceof URL?t.href:t};
950return this.workerSet.invokeRequest(this.serviceId,i)}updateIndex(e,t){const i={type:n.WorkerTilerProtocol.Requests.UpdateIndex,id:e,input:t instanceof URL?t.href:t};return this.workerSet.invokeRequest(this.serviceId,i)}getTile(e,t){const i=t.mortonCode(),r={type:n.WorkerTilerProtocol.Requests.TileRequest,index:e,tileKey:i};return this.workerSet.invokeRequest(this.serviceId,r)}}},2453:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LowResRenderPass=void 0;const n=i(82),r=i(4250),s=i(2331);class o extends s.Pass{constructor(e){super(),this.lowResPixelRatio=e,this.m_renderTarget=null,this.m_localCamera=new n.OrthographicCamera(-1,1,1,-1,0,1),this.m_quadScene=new n.Scene,this.m_quadUniforms=r.CopyShader.uniforms,this.m_quadMaterial=new r.CopyMaterial(this.m_quadUniforms),this.m_quad=new n.Mesh(new n.PlaneBufferGeometry(2,2),this.m_quadMaterial),this.m_savedWidth=0,this.m_savedHeight=0,this.m_quad.frustumCulled=!1,this.m_quadScene.add(this.m_quad),this.m_pixelRatio=e}dispose(){this.m_quadMaterial.dispose(),this.m_quad.geometry.dispose(),null!==this.m_renderTarget&&(this.m_renderTarget.dispose(),this.m_renderTarget=null)}set pixelRatio(e){this.m_pixelRatio=e,this.m_renderTarget&&void 0!==this.pixelRatio&&this.m_renderTarget.setSize(Math.floor(this.m_savedWidth*this.pixelRatio),Math.floor(this.m_savedHeight*this.pixelRatio))}get pixelRatio(){return this.m_pixelRatio}render(e,t,i,r,s){if(!this.enabled||void 0===this.pixelRatio)return;null===this.m_renderTarget&&(this.m_savedWidth=s.width,this.m_savedHeight=s.height,this.m_renderTarget=new n.WebGLRenderTarget(Math.floor(this.m_savedWidth*this.pixelRatio),Math.floor(this.m_savedHeight*this.pixelRatio),{minFilter:n.LinearFilter,magFilter:n.LinearFilter,format:n.RGBAFormat,depthBuffer:!0,stencilBuffer:!0}),this.m_renderTarget.texture.name="LowResRenderPass.sample"),this.m_quadUniforms.tDiffuse.value=this.m_renderTarget.texture,this.m_quadUniforms.opacity.value=1;const o=e.getRenderTarget();e.setRenderTarget(this.m_renderTarget),e.clear(),e.render(t,i),e.setRenderTarget(this.renderToScreen?null:r),e.clear(),e.render(this.m_quadScene,this.m_localCamera),e.setRenderTarget(o)}setSize(e,t){this.m_savedWidth=e,this.m_savedHeight=t,this.m_renderTarget&&void 0!==this.pixelRatio&&this.m_renderTarget.setSize(Math.floor(e*this.pixelRatio),Math.floor(t*this.pixelRatio))}}
950t.LowResRenderPass=o},818:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MSAARenderPass=t.MSAASampling=void 0;const n=i(82),r=i(4250),s=i(2331);var o;!function(e){e[e.Level_0=0]="Level_0",e[e.Level_1=1]="Level_1",e[e.Level_2=2]="Level_2",e[e.Level_3=3]="Level_3",e[e.Level_4=4]="Level_4",e[e.Level_5=5]="Level_5"}(o=t.MSAASampling||(t.MSAASampling={}));class a extends s.Pass{constructor(){super(),this.samplingLevel=o.Level_1,this.m_renderTarget=null,this.m_localCamera=new n.OrthographicCamera(-1,1,1,-1,0,1),this.m_quadScene=new n.Scene,this.m_quadUniforms=r.CopyShader.uniforms,this.m_quadMaterial=new r.MSAAMaterial(this.m_quadUniforms),this.m_quad=new n.Mesh(new n.PlaneBufferGeometry(2,2),this.m_quadMaterial),this.m_tmpColor=new n.Color,this.m_quad.frustumCulled=!1,this.m_quadScene.add(this.m_quad)}dispose(){null!==this.m_renderTarget&&(this.m_renderTarget.dispose(),this.m_renderTarget=null)}render(e,t,i,r,s){if(!this.enabled)return;null===this.m_renderTarget&&(this.m_renderTarget=new n.WebGLRenderTarget(s.width,s.height,{minFilter:n.LinearFilter,magFilter:n.LinearFilter,format:n.RGBAFormat}),this.m_renderTarget.texture.name="MSAARenderPass.sample"),this.m_quadUniforms.tDiffuse.value=this.m_renderTarget.texture;const o=a.OffsetVectors[this.samplingLevel],l=e.getClearColor(this.m_tmpColor),c=void 0!==l?l.getHex():0,h={enabled:null!==i.view&&i.view.enabled,fullWidth:s.width,fullHeight:s.height,x:0,y:0,width:s.width,height:s.height};h.enabled&&null!==i.view&&(h.fullWidth=i.view.fullWidth,h.fullHeight=i.view.fullHeight,h.x=i.view.offsetX,h.y=i.view.offsetY,h.width=i.view.width,h.height=i.view.height);const u=e.getRenderTarget();for(let n=0;n<o.length;n++){const s=o[n];i.setViewOffset(h.fullWidth,h.fullHeight,h.x+s[0]/16,h.y+s[1]/16,h.width,h.height);const a=(n+.5)/o.length-.5,u=1/o.length+a/32;this.m_quadUniforms.opacity.value=u,e.setRenderTarget(this.m_renderTarget),e.clear(),e.render(t,i),e.setRenderTarget(this.renderToScreen?null:r),0===n&&(e.setClearColor(0),e.clear()),e.render(this.m_quadScene,this.m_localCamera),0===n&&void 0!==l&&e.setClearColor(c)}e.setRenderTarget(u),null!==i.view&&(i.view.enabled=h.enabled,i.view.offsetX=h.x,i.view.offsetY=h.y)}setSize(e,t){this.m_renderTarget&&this.m_renderTarget.setSize(e,t)}}t.MSAARenderPass=a,a.OffsetVectors=[[[0,0]],[[4,4],[-4,-4]],[[-2,-6],[6,-2],[-6,2],[2,6]],[[1,-3],[-1,3],[5,1],[-3,-5],[-5,5],[-7,-1],[3,7],[7,-7]],[[1,1],[-1,-3],[-3,2],[4,-1],[-5,-2],[2,5],[5,3],[3,-5],[-2,6],[0,-7],[-4,-6],[-6,4],[-8,0],[7,-4],[6,7],[-7,-8]],[[-4,-7],[-7,-5],[-3,-5],[-5,-4],[-1,-4],[-2,-2],[-6,-1],[-4,0],[-7,1],[-1,2],[-6,3],[-3,3],[-7,6],[-3,6],[-5,7],[-1,7],[5,-7],[1,-6],[6,-5],[4,-4],[2,-3],[7,-2],[1,-1],[4,-1],[2,1],[6,2],[0,4],[4,4],[2,5],[7,5],[5,6],[3,7]]]},9886:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MapRenderingManager=void 0;const n=i(82),r=i(4250),s=i(2453),o=i(818),a=i(8794),l=i(2331),c=i(6721),h=o.MSAASampling.Level_1,u=o.MSAASampling.Level_4;t.MapRenderingManager=class{constructor(e,t,i,a={msaaEnabled:!1}){this.bloom={enabled:!1,strength:1.5,radius:.4,threshold:.85},this.outline={enabled:!1,thickness:.005,color:"#000000",ghostExtrudedPolygons:!1,needsUpdate:!1},this.vignette={enabled:!1,offset:1,darkness:1},this.sepia={enabled:!1,amount:.5},this.m_width=1,this.m_height=1,this.m_renderPass=new l.RenderPass,this.m_target1=new n.WebGLRenderTarget(1,1),this.m_target2=new n.WebGLRenderTarget(1,1),this.m_sepiaPass=new l.ShaderPass(r.SepiaShader),this.m_vignettePass=new l.ShaderPass(r.VignetteShader),this.m_readBuffer=new n.WebGLRenderTarget(e,t),this.m_msaaPass=new o.MSAARenderPass,this.m_msaaPass.enabled=void 0!==a&&!0===a.msaaEnabled,this.m_dynamicMsaaSamplingLevel=void 0===a.dynamicMsaaSamplingLevel?h:a.dynamicMsaaSamplingLevel,this.m_staticMsaaSamplingLevel=void 0===a.staticMsaaSamplingLevel?u:a.staticMsaaSamplingLevel,this.m_lowResPass=new s.LowResRenderPass(i),this.m_lowResPass.enabled=void 0!==i}updateOutline(e){this.outline.color=e.color,this.outline.thickness=e.thickness,this.outline.ghostExtrudedPolygons=e.ghostExtrudedPolygons,this.outline.needsUpdate=!0}render(e,t,i,r){if(!r&&void 0!==this.m_lowResPass.pixelRatio)return this.m_lowResPass.renderToScreen=!0,void this.m_lowResPass.render(e,t,i,null,this.m_readBuffer);const s=this.bloom.enabled||this.outline.enabled||this.vignette.enabled||this.sepia.enabled;let o=null;if((this.bloom.enabled||this.vignette.enabled||this.sepia.enabled)&&(e.setRenderTarget(this.m_target1),e.clearDepth()),this.m_msaaPass.enabled?(this.m_msaaPass.samplingLevel=r?this.m_staticMsaaSamplingLevel:this.m_dynamicMsaaSamplingLevel,this.m_msaaPass.renderToScreen=!s,this.m_msaaPass.render(e,t,i,null,this.m_readBuffer)):this.bloom.enabled||this.vignette.enabled||this.sepia.enabled?(o=this.m_target1,this.m_renderPass.render(e,t,i,this.m_target1,null)):(!this.outline.enabled||this.outline.enabled&&!this.bloom.enabled)&&e.render(t,i),this.outline.enabled){void 0===this.m_outlineEffect&&(this.m_outlineEffect=new a.OutlineEffect(e)),this.outline.needsUpdate&&(this.m_outlineEffect.color=this.outline.color,this.m_outlineEffect.thickness=this.outline.thickness,this.m_outlineEffect.ghostExtrudedPolygons=this.outline.ghostExtrudedPolygons,this.outline.needsUpdate=!1);const n=this.bloom.enabled||this.vignette.enabled||this.sepia.enabled;n&&(o=this.m_target1),e.setRenderTarget(n?o:null),this.m_outlineEffect.render(t,i)}if(this.bloom.enabled){void 0===this.m_bloomPass&&(this.m_bloomPass=new c.BloomPass(new n.Vector2(this.m_width,this.m_height),this.bloom.strength,this.bloom.radiu
950s,this.bloom.threshold));const r=this.vignette.enabled||this.sepia.enabled;this.m_bloomPass.renderToScreen=!r,this.m_bloomPass.radius=this.bloom.radius,this.m_bloomPass.strength=this.bloom.strength,this.m_bloomPass.threshold=this.bloom.threshold,this.m_bloomPass.render(e,t,i,null,o)}else void 0!==this.m_bloomPass&&(this.m_bloomPass.dispose(),this.m_bloomPass=void 0);if(this.vignette.enabled){const n=o,r=this.sepia.enabled;this.m_vignettePass.uniforms.offset.value=this.vignette.offset,this.m_vignettePass.uniforms.darkness.value=this.vignette.darkness,this.m_vignettePass.renderToScreen=!r,r&&(o=o===this.m_target1?this.m_target2:this.m_target1),this.m_vignettePass.render(e,t,i,o,n)}this.sepia.enabled&&(this.m_sepiaPass.renderToScreen=!0,this.m_sepiaPass.uniforms.amount.value=this.sepia.amount,this.m_sepiaPass.render(e,t,i,null,o))}setSize(e,t){this.m_readBuffer.setSize(e,t),this.m_msaaPass.setSize(e,t),void 0!==this.m_bloomPass&&this.m_bloomPass.setSize(e,t),this.m_lowResPass.setSize(e,t),this.m_target1.setSize(e,t),this.m_target2.setSize(e,t),this.m_width=e,this.m_height=t}get lowResPixelRatio(){return this.m_lowResPass.pixelRatio}set lowResPixelRatio(e){this.m_lowResPass.pixelRatio=e,this.m_lowResPass.enabled=void 0!==e}set dynamicMsaaSamplingLevel(e){this.m_dynamicMsaaSamplingLevel=e}get dynamicMsaaSamplingLevel(){return this.m_dynamicMsaaSamplingLevel}set msaaEnabled(e){this.m_msaaPass.enabled=e}get msaaEnabled(){return this.m_msaaPass.enabled}set staticMsaaSamplingLevel(e){this.m_staticMsaaSamplingLevel=e}get staticMsaaSamplingLevel(){return this.m_staticMsaaSamplingLevel}}},8794:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OutlineEffect=void 0;const n=i(82),r=i(4250),s=i(4342);t.OutlineEffect=class{constructor(e){this.m_renderer=e,this.enabled=!0,this.m_defaultThickness=.02,this.m_defaultColor=new n.Color(0,0,0),this.m_defaultAlpha=1,this.m_defaultKeepAlive=!1,this.m_ghostExtrudedPolygons=!1,this.m_cache={},this.m_removeThresholdCount=60,this.m_originalMaterials={},this.m_originalOnBeforeRenders={},this.m_shaderIDs={MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"phong",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical"},this.m_uniformsChunk={outlineThickness:{value:this.m_defaultThickness},outlineColor:{value:this.m_defaultColor},outlineAlpha:{value:this.m_defaultAlpha}},this.autoClear=e.autoClear,this.domElement=e.domElement,this.shadowMap=e.shadowMap}set thickness(e){this.m_defaultThickness=e,this.m_uniformsChunk.outlineThickness.value=e,this.m_cache={}}set color(e){this.m_defaultColor.set(e),this.m_cache={}}set ghostExtrudedPolygons(e){this.m_ghostExtrudedPolygons=e}clear(e,t,i){this.m_renderer.clear(e,t,i)}getPixelRatio(){return this.m_renderer.getPixelRatio()}setPixelRatio(e){this.m_renderer.setPixelRatio(e)}getSize(e){return this.m_renderer.getSize(e)}setSize(e,t,i){this.m_renderer.setSize(e,t,i)}setViewport(e,t,i,n){this.m_renderer.setViewport(e,t,i,n)}setScissor(e,t,i,n){this.m_renderer.setScissor(e,t,i,n)}setScissorTest(e){this.m_renderer.setScissorTest(e)}setRenderTarget(e){this.m_renderer.setRenderTarget(e)}render(e,t){if(this.m_ghostExtrudedPolygons){if(!this.enabled)return void this.m_renderer.render(e,t);const i=this.m_renderer.autoClear;this.m_renderer.autoClear=this.autoClear,this.m_renderer.render(e,t),this.m_renderer.autoClear=i}this.renderOutline(e,t)}renderOutline(e,t){const i=this.m_renderer.autoClear,n=e.autoUpdate,r=e.background,s=this.m_renderer.shadowMap.enabled;e.autoUpdate=!1,e.background=null,this.m_renderer.autoClear=!1,this.m_renderer.shadowMap.enabled=!1,e.traverse(this.setOutlineMaterial.bind(this)),this.m_renderer.render(e,t),e.traverse(this.restoreOriginalMaterial.bind(this)),this.cleanupCache(),e.autoUpdate=n,e.background=r,this.m_renderer.autoClear=i,this.m_renderer.shadowMap.enabled=s}createInvisibleMaterial(){return new n.ShaderMaterial({name:"invisible",visible:!1})}createMaterial(e){if(e instanceof r.EdgeMaterial||!0===e.isDepthPrepassMaterial)return this.createInvisibleMaterial();const t=this.m_shaderIDs[e.type];let i,s=void 0!==e.shaderUniforms?e.shaderUniforms:e.uniforms;if(void 0!==t){const e=n.ShaderLib[t];s=e.uniforms,i=e.vertexShader}else if(!0===e.isRawShaderMaterial){if(i=e.vertexShader,!/attribute\s+vec3\s+position\s*;/.test(i)||!/attribute\s+vec3\s+normal\s*;/.test(i))return this.createInvisibleMaterial()}else{if(!0!==e.isShaderMaterial)return this.createInvisibleMaterial();i=e.vertexShader}const o=void 0!==e.shaderUniforms&&void 0!==e.shaderUniforms.extrusionRatio,a=r.FadingFeature.isDefined(e),l=Object.assign(Object.assign({},s),this.m_uniformsChunk),c=i.replace(/void\s+main\s*\(\s*\)/,"\n#ifdef USE_EXTRUSION\n #ifndef HAS_EXTRUSION_PARS_VERTEX\n #include <extrusion_pars_vertex>\n #endif\n#endif\n\n#ifdef USE_FADING\n #include <fading_pars_vertex>\n#endif\n\nuniform float outlineThickness;\n\nvec4 calculateOutline( vec4 pos, vec3 objectNormal, vec4 skinned ) {\n float thickness = outlineThickness;\n const float ratio = 1.0;\n vec4 pos2 = projectionMatrix * modelViewMatrix * vec4( skinned.xyz + objectNormal, 1.0 );\n vec4 norm = normalize( pos - pos2 );\n return pos + norm * thickness * pos.w * ratio;\n}\nvoid main()").replace(/\}\s*$/,"\n#if ! defined( LAMBERT ) && ! defined( PHONG ) && ! defined( TOON ) && ! defined( STANDARD )\n #ifndef USE_ENVMAP\n vec3 objectNormal = normalize( normal );\n #endif\n#endif\n\n#ifdef FLIP_SIDED\n objectNormal = -objectNormal;\n#endif\n\n#ifdef DECLARE_TRANSFORMED\n vec3 transformed = vec3( position );\n#endif\n\n#ifdef USE_EXTRUSION\n #ifndef HAS_EXTRUSION_VERTEX\n #include <extrusion_vertex>\n #endif\n#endif\n\n#ifdef USE_FADING\n #include <fading_vertex>\n#endif\n\n#ifdef USE_EXTRUSION\n gl_Position = calculateOutline( projectionMatrix * modelViewMatrix * vec4( transformed, 1.0 ),\n objectNormal, vec4( transformed, 1.0 ) );\n#else\n gl_Position = calculateOutline( gl_Position, objectNormal, vec4( transformed, 1.0 ) );\n#endif\n\n#include <fog_vertex>\n}").replace(/#include\s+<[\w_]*light[\w_]*>/g,""),h={};return/vec3\s+transformed\s*=/.test(i)||/#include\s+<begin_vertex>/.test(i)||(h.DECLARE_TRANSFORMED=!0),o&&(l.extrusionRatio={value:r.ExtrusionFeatureDefs.DEFAULT_RATIO_MIN},h.USE_EXTRUSION=1),a&&(l.fadeNear={value:void 0!==s.fadeNear?s.fadeNear.value:r.FadingFeature.DEFAULT_FADE_NEAR},l.fadeFar={value:void 0!==s.fadeFar?s.fadeFar.value:r.FadingFeature.DEFAULT_FADE_FAR},h.USE_FADING=1),new n.ShaderMaterial({defines:h,uniforms:l,vertexShader:c,fragmentShader:"\n#include <common>\n#include <fog_pars_fragment>\n\n#ifdef USE_EXTRUSION\n #include <extrusion_pars_fragment>\n#endif\n\n#ifdef USE_FADING\n #include <fading_pars_fragment>\n#endif\n\nuniform vec3 outlineColor;\nuniform float outlineAlpha;\n\nvoid main() {\n\n gl_FragColor = vec4( outlineColor, outlineAlpha );\n\n #include <fog_fragment>\n\n #ifdef USE_EXTRUSION\n #include <extrusion_fragment>\n #endif\n\n #ifdef USE_FADING\n #include <fading_fragment>\n #endif\n}",side:n.BackSide,fog:!1,blending:n.CustomBlending,blendSrc:n.SrcAlphaFactor,blendDst:n.OneMinusSrcAlphaFactor,blendSrcAlpha:n.OneFactor,blendDstAlpha:n.OneMinusSrcAlphaFactor,transparent:!0,polygonOffset:!0,polygonOffsetFactor:10,polygonOffsetUnits:30})}getOutlineMaterialFromCache(e){let t=this.m_cache[e.uuid];return void 0===t&&(t={material:this.createMaterial(e),used:!0,keepAlive:this.m_defaultKeepAlive,count:0},this.m_cache[e.uuid]=t),t.used=!0,t.material}getOutlineMaterial(e){const t=this.getOutlineMaterialFromCache(e);return this.m_originalMaterials[t.uuid]=e,this.updateOutlineMaterial(t,e),t}setOutlineMaterial(e){if(void 0!==e.material){if(Array.isArray(e.material))for(let t=0,i=e.material.length;t<i;t++)e.material[t]=this.getOutlineMaterial(e.material[t]);else e.material=this.getOutlineMaterial(e.material);this.m_originalOnBeforeRenders[e.uuid]=e.onBeforeRender,e.onBeforeRender=(0,s.chainCallbacks)(e.onBeforeRender,this.onBeforeRender.bind(this))}}restoreOriginalMaterial(e){if(void 0!==e.material){if(Array.isArray(e.material))for(let t=0,i=e.material.length;t<i;t++)e.material[t]=this.m_originalMaterials[e.material[t].uuid];else e.material=this.m_originalMaterials[e.material.uuid];e.onBeforeRender=this.m_originalOnBeforeRenders[e.uuid]}}onBeforeRender(e,t,i,n,r,s){const o=this.m_originalMaterials[r.uuid];void 0!==o&&this.updateUniforms(r,o)}updateUniforms(e,t){var i;const n=t.userData.outlineParameters,s=e.uniforms;s.outlineAlpha.value=t.opacity;const o=void 0!==t.shaderUniforms?t.shaderUniforms:t.uniforms;if(void 0!==n&&(void 0!==n.thickness&&(s.outlineThickness.value=n.thickness),void 0!==n.color&&s.outlineColor.value.fromArray(n.color),void 0!==n.alpha&&(s.outlineAlpha.value=n.alpha)),void 0!==o&&void 0!==o.extrusionRatio){const i=t.shaderUniforms.extrusionRatio.value;e.extrusionRatio=i,e.uniforms.extrusionRatio.value=void 0!==i?i:r.ExtrusionFeatureDefs.DEFAULT_RATIO_MIN}void 0!==(null===(i=e.defines)||void 0===i?void 0:i.USE_FADING)&&void 0!==o.fadeNear&&void 0!==o.fadeFar&&o.fadeFar.value>=0&&(s.fadeNear.value=o.fadeNear.value,s.fadeFar.value=o.fadeFar.value)}updateOutlineMaterial(e,t){if("invisible"===e.name)return;const i=t.userData.outlineParameters;e.skinning=t.skinning,e.morphTargets=t.morphTargets,e.morphNormals=t.morphNormals,e.fog=t.fog,void 0!==i?(e.visible=!1!==t.visible&&(void 0===i.visible||i.visible),void 0!==i.keepAlive&&(this.m_cache[t.uuid].keepAlive=i.keepAlive)):e.visible=t.visible,!0!==t.wireframe&&!1!==t.depthTest||(e.visible=!1)}cleanupCache(){let e;e=Object.keys(this.m_originalMaterials);for(let t=0,i=e.length;t<i;t++)this.m_originalMaterials[e[t]]=void 0;e=Object.keys(this.m_originalOnBeforeRenders);for(let t=0,i=e.length;t<i;t++)this.m_originalOnBeforeRenders[e[t]]=void 0;e=Object.keys(this.m_cache);for(const t of e)!1===this.m_cache[t].used?(this.m_cache[t].count++,!1===this.m_cache[t].keepAlive&&this.m_cache[t].count>this.m_removeThresholdCount&&delete this.m_cache[t]):(this.m_cache[t].used=!1,this.m_cache[t].count=0)}}},2331:(e,t,i)=>{"use strict";
950Object.defineProperty(t,"__esModule",{value:!0}),t.ShaderPass=t.RenderPass=t.Pass=void 0;const n=i(82);class r{constructor(){this.enabled=!1,this.renderToScreen=!1}setSize(e,t){}render(e,t,i,n,r,s){}}t.Pass=r,t.RenderPass=class extends r{constructor(){super()}render(e,t,i,n,r){e.setRenderTarget(this.renderToScreen?null:n),e.render(t,i)}},t.ShaderPass=class extends r{constructor(e,t="tDiffuse"){super(),this.textureID=t,e instanceof n.ShaderMaterial?(this.uniforms=e.uniforms,this.material=e):(this.uniforms=n.UniformsUtils.clone(e.uniforms),this.material=new n.ShaderMaterial({defines:Object.assign({},e.defines),uniforms:this.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader})),this.fsQuad=new s(this.material)}render(e,t,i,n,r,s){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=r.texture),this.fsQuad.material=this.material,e.setRenderTarget(this.renderToScreen?null:n),this.fsQuad.render(e)}};class s{constructor(e){this.m_camera=new n.OrthographicCamera(-1,1,1,-1,0,1);const t=new n.PlaneBufferGeometry(2,2);this.m_mesh=new n.Mesh(t,e)}get material(){return this.m_mesh.material}set material(e){this.m_mesh.material=e}render(e){e.render(this.m_mesh,this.m_camera)}}},6721:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BloomPass=void 0;const n=i(82),r=i(4250),s=i(2331),o=new n.Vector2(1,0),a=new n.Vector2(0,1);class l extends s.Pass{constructor(e,t,i,s){super(),this.resolution=new n.Vector2(256,256),this.m_renderTargetsHorizontal=[],this.m_renderTargetsVertical=[],this.m_nMips=5,this.m_separableBlurMaterials=[],this.m_camera=new n.OrthographicCamera(-1,1,1,-1,0,1),this.m_scene=new n.Scene,this.m_basic=new n.MeshBasicMaterial,this.m_quad=new n.Mesh(new n.PlaneBufferGeometry(2,2)),this.m_bloomTintColors=[new n.Vector3(1,1,1),new n.Vector3(1,1,1),new n.Vector3(1,1,1),new n.Vector3(1,1,1),new n.Vector3(1,1,1)],this.strength=t,this.radius=i,this.threshold=s,this.resolution=e,this.m_quad.frustumCulled=!1,this.m_scene.add(this.m_quad);const o={minFilter:n.LinearFilter,magFilter:n.LinearFilter,format:n.RGBAFormat};let a=Math.round(this.resolution.x/2),l=Math.round(this.resolution.y/2);this.m_renderTargetBright=new n.WebGLRenderTarget(a,l,o),this.m_renderTargetBright.texture.name="UnrealBloomPass.bright",this.m_renderTargetBright.texture.generateMipmaps=!1;for(let e=0;e<this.m_nMips;e++){const t=new n.WebGLRenderTarget(a,l,o);t.texture.name="UnrealBloomPass.h"+e,t.texture.generateMipmaps=!1,this.m_renderTargetsHorizontal.push(t);const i=new n.WebGLRenderTarget(a,l,o);i.texture.name="UnrealBloomPass.v"+e,i.texture.generateMipmaps=!1,this.m_renderTargetsVertical.push(i),a=Math.round(a/2),l=Math.round(l/2)}this.m_highPassUniforms=n.UniformsUtils.clone(r.LuminosityHighPassShader.uniforms),this.m_highPassUniforms.luminosityThreshold.value=s,this.m_highPassUniforms.smoothWidth.value=.01,this.m_materialHighPassFilter=new n.ShaderMaterial({uniforms:this.m_highPassUniforms,vertexShader:r.LuminosityHighPassShader.vertexShader,fragmentShader:r.LuminosityHighPassShader.fragmentShader,defines:{}});const c=[3,5,7,9,11];a=Math.round(this.resolution.x/2),l=Math.round(this.resolution.y/2);for(let e=0;e<this.m_nMips;e++)this.m_separableBlurMaterials.push(this.getSeperableBlurMaterial(c[e])),this.m_separableBlurMaterials[e].uniforms.texSize.value=new n.Vector2(a,l),a=Math.round(a/2),l=Math.round(l/2);this.m_compositeMaterial=this.getCompositeMaterial(this.m_nMips),this.m_compositeMaterial.uniforms.blurTexture1.value=this.m_renderTargetsVertical[0].texture,this.m_compositeMaterial.uniforms.blurTexture2.value=this.m_renderTargetsVertical[1].texture,this.m_compositeMaterial.uniforms.blurTexture3.value=this.m_renderTargetsVertical[2].texture,this.m_compositeMaterial.uniforms.blurTexture4.value=this.m_renderTargetsVertical[3].texture,this.m_compositeMaterial.uniforms.blurTexture5.value=this.m_renderTargetsVertical[4].texture,this.m_compositeMaterial.uniforms.bloomStrength.value=t,this.m_compositeMaterial.uniforms.bloomRadius.value=.1,this.m_compositeMaterial.needsUpdate=!0,this.m_compositeMaterial.uniforms.bloomFactors.value=[1,.8,.6,.4,.2],this.m_compositeMaterial.uniforms.bloomTintColors.value=this.m_bloomTintColors,this.m_copyUniforms=n.UniformsUtils.clone(r.CopyShader.uniforms),this.m_copyUniforms.opacity.value=1,this.m_materialCopy=new n.ShaderMaterial({uniforms:this.m_copyUniforms,vertexShader:r.CopyShader.vertexShader,fragmentShader:r.CopyShader.fragmentShader,blending:n.AdditiveBlending,depthTest:!1,depthWrite:!1,transparent:!0})}dispose(){for(const e of this.m_renderTargetsHorizontal)e.dispose();for(const e of this.m_renderTargetsVertical)e.dispose();this.m_renderTargetBright.dispose()}setSize(e,t){let i=Math.round(e/2),r=Math.round(t/2);this.m_renderTargetBright.setSize(i,r);for(let e=0;e<this.m_nMips;e++)this.m_renderTargetsHorizontal[e].setSize(i,r),this.m_renderTargetsVertical[e].setSize(i,r),this.m_separableBlurMaterials[e].uniforms.texSize.value=new n.Vector2(i,r),i=Math.round(i/2),r=Math.round(r/2)}render(e,t,i,n,r){this.renderToScreen&&(this.m_quad.material=this.m_basic,this.m_basic.map=r.texture,e.setRenderTarget(null),e.clear(),e.render(this.m_scene,this.m_camera)),this.m_highPassUniforms.tDiffuse.value=r.texture,this.m_highPassUniforms.luminosityThreshold.value=this.threshold,this.m_quad.material=this.m_materialHighPassFilter,e.setRenderTarget(this.m_renderTargetBright),e.clear(),e.render(this.m_scene,this.m_camera);let s=this.m_renderTargetBright;for(let t=0;t<this.m_nMips;t++)this.m_quad.material=this.m_separableBlurMaterials[t],this.m_separableBlurMaterials[t].uniforms.colorTexture.value=s.texture,this.m_separableBlurMaterials[t].uniforms.direction.value=o,e.setRenderTarget(this.m_renderTargetsHorizontal[t]),e.clear(),e.render(this.m_scene,this.m_camera),this.m_separableBlurMaterials[t].uniforms.colorTexture.value=this.m_renderTargetsHorizontal[t].texture,this.m_separableBlurMaterials[t].uniforms.direction.value=a,e.setRenderTarget(this.m_renderTargetsVertical[t]),e.clear(),e.render(this.m_scene,this.m_camera),s=this.m_renderTargetsVertical[t];this.m_quad.material=this.m_compositeMaterial,this.m_compositeMaterial.uniforms.bloomStrength.value=this.strength,this.m_compositeMaterial.uniforms.bloomRadius.value=this.radius,this.m_compositeMaterial.uniforms.bloomTintColors.value=this.m_bloomTintColors,e.setRenderTarget(this.m_renderTargetsHorizontal[0]),e.clear(),e.render(this.m_scene,this.m_camera),this.m_quad.material=this.m_materialCopy,this.m_copyUniforms.tDiffuse.value=this.m_renderTargetsHorizontal[0].texture,this.renderToScreen?(e.setRenderTarget(null),e.render(this.m_scene,this.m_camera)):(e.setRenderTarget(r),e.render(this.m_scene,this.m_camera))}getSeperableBlurMaterial(e){return new n.ShaderMaterial({defines:{KERNEL_RADIUS:e,SIGMA:e},uniforms:{colorTexture:{value:null},texSize:{value:new n.Vector2(.5,.5)},direction:{value:new n.Vector2(.5,.5)}},vertexShader:"varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n }",fragmentShader:"#include <common>\n varying vec2 vUv;\n uniform sampler2D colorTexture;\n uniform vec2 texSize;\n uniform vec2 direction;\n\n float gaussianPdf(in float x, in float sigma) {\n return 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;\n }\n void main() {\n vec2 invSize = 1.0 / texSize;\n float fSigma = float(SIGMA);\n float weightSum = gaussianPdf(0.0, fSigma);\n vec3 diffuseSum = texture2D( colorTexture, vUv).rgb * weightSum;\n for( int i = 1; i < KERNEL_RADIUS; i ++ ) {\n float x = float(i);\n float w = gaussianPdf(x, fSigma);\n vec2 uvOffset = direction * invSize * x;\n vec3 sample1 = texture2D( colorTexture, vUv + uvOffset).rgb;\n vec3 sample2 = texture2D( colorTexture, vUv - uvOffset).rgb;\n diffuseSum += (sample1 + sample2) * w;\n weightSum += 2.0 * w;\n }\n gl_FragColor = vec4(diffuseSum/weightSum, 1.0);\n }"})}getCompositeMaterial(e){return new n.ShaderMaterial({defines:{NUM_MIPS:e},uniforms:{blurTexture1:{value:null},blurTexture2:{value:null},blurTexture3:{value:null},blurTexture4:{value:null},blurTexture5:{value:null},dirtTexture:{value:null},bloomStrength:{value:1},bloomFactors:{value:null},bloomTintColors:{value:null},bloomRadius:{value:0}},vertexShader:"varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n }",fragmentShader:"varying vec2 vUv;\n uniform sampler2D blurTexture1;\n uniform sampler2D blurTexture2;\n uniform sampler2D blurTexture3;\n uniform sampler2D blurTexture4;\n uniform sampler2D blurTexture5;\n uniform sampler2D dirtTexture;\n uniform float bloomStrength;\n uniform float bloomRadius;\n uniform float bloomFactors[NUM_MIPS];\n uniform vec3 bloomTintColors[NUM_MIPS];\n\n float lerpBloomFactor(const in float factor) {\n float mirrorFactor = 1.2 - factor;\n return mix(factor, mirrorFactor, bloomRadius);\n }\n\n void main() {\n gl_FragColor = bloomStrength * (\nlerpBloomFactor(bloomFactors[0]) * vec4(bloomTintColors[0], 1.0) * texture2D(blurTexture1, vUv) +\nlerpBloomFactor(bloomFactors[1]) * vec4(bloomTintColors[1], 1.0) * texture2D(blurTexture2, vUv) +\nlerpBloomFactor(bloomFactors[2]) * vec4(bloomTintColors[2], 1.0) * texture2D(blurTexture3, vUv) +\nlerpBloomFactor(bloomFactors[3]) * vec4(bloomTintColors[3], 1.0) * texture2D(blurTexture4, vUv) +\nlerpBloomFactor(bloomFactors[4]) * vec4(bloomTintColors[4], 1.0
950) * texture2D(blurTexture5, vUv) );\n }"})}}t.BloomPass=l},5307:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MSAASampling=t.MSAARenderPass=t.Pass=t.MapRenderingManager=void 0;var n=i(9886);Object.defineProperty(t,"MapRenderingManager",{enumerable:!0,get:function(){return n.MapRenderingManager}});var r=i(2331);Object.defineProperty(t,"Pass",{enumerable:!0,get:function(){return r.Pass}});var s=i(818);Object.defineProperty(t,"MSAARenderPass",{enumerable:!0,get:function(){return s.MSAARenderPass}}),Object.defineProperty(t,"MSAASampling",{enumerable:!0,get:function(){return s.MSAASampling}})},5808:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CopyrightCoverageProvider=void 0;const n=i(4342),r=i(1102);t.CopyrightCoverageProvider=class{constructor(){this.logger=n.LoggerManager.instance.create("CopyrightCoverageProvider")}getTree(){return void 0!==this.m_cachedTreePromise||(this.m_cachedTreePromise=this.getCopyrightCoverageData().then((e=>this.initRBush(e))).catch((e=>(this.logger.error(e),new r)))),this.m_cachedTreePromise}async getCopyrights(e,t){const i=[],r=(await this.getTree()).search({minX:e.west,minY:e.south,maxX:e.east,maxY:e.north});for(const e of r){const r=(0,n.getOptionValue)(e.minLevel,0),s=(0,n.getOptionValue)(e.maxLevel,1/0);t>=r&&t<=s&&void 0===i.find((t=>t.id===e.label))&&i.push({id:e.label})}return i}initRBush(e){const t=new r;if(!e)return this.logger.warn("No copyright coverage data provided"),t;for(const i of e){const{minLevel:e,maxLevel:n,label:r,alt:s}=i;if(i.boxes)for(const o of i.boxes){const[i,a,l,c]=o;t.insert({minX:a,minY:i,maxX:c,maxY:l,minLevel:e,maxLevel:n,label:r,alt:s})}else t.insert({minX:-180,minY:-90,maxX:180,maxY:180,minLevel:e,maxLevel:n,label:r,alt:s})}return t}}},4549:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CopyrightElementHandler=void 0;const n=i(4342),r=i(3977),s=i(8380);class o{static install(e,t){return new o(e,t)}constructor(e,t){if(this.m_defaults=new Map,this.m_mapViews=[],this.update=()=>{var e;const t=this.m_mapViews.map((e=>e.copyrightInfo)).reduce(s.CopyrightInfo.mergeArrays,null!==(e=this.staticInfo)&&void 0!==e?e:[]);if(0===t.length)return void(this.m_element.style.display="none");if(this.m_element.style.display="block",0!==this.m_defaults.size)for(const e of t){const t=this.m_defaults.get(e.id);void 0!==t&&(e.year=(0,n.getOptionValue)(e.year,t.year),e.label=(0,n.getOptionValue)(e.label,t.label),e.link=(0,n.getOptionValue)(e.link,t.link))}const i=s.CopyrightInfo.mergeArrays(t);this.m_element.innerHTML=s.CopyrightInfo.formatAsHtml(i)},"string"==typeof e){const t=document.getElementById(e);if(!t)throw new Error(`CopyrightElementHandler: unable to find DOM element #${e}`);this.m_element=t}else this.m_element=e;void 0!==t&&this.attach(t)}destroy(){for(const e of this.m_mapViews)e.removeEventListener(r.MapViewEventNames.CopyrightChanged,this.update)}attach(e){return this.m_mapViews.push(e),e.addEventListener(r.MapViewEventNames.CopyrightChanged,this.update),this.update(),this}detach(e){return e.removeEventListener(r.MapViewEventNames.CopyrightChanged,this.update),this.m_mapViews=this.m_mapViews.filter((t=>t!==e)),this.update(),this}setDefaults(e){if(this.m_defaults.clear(),void 0!==e)for(const t of e)this.m_defaults.set(t.id,t);return this}setStaticCopyightInfo(e){return this.staticInfo=e,this}}t.CopyrightElementHandler=o},8380:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CopyrightInfo=void 0;const n=i(4342);var r;(r=t.CopyrightInfo||(t.CopyrightInfo={})).mergeArrays=function(e,t){const i=[];for(const r of[e,t])if(void 0!==r)for(const e of r){const t=i.find((t=>t.id===e.id||void 0!==t.label&&t.label===e.label));void 0===t?i.push(Object.assign({},e)):(t.year=n.MathUtils.max2(e.year,t.year),t.label=(0,n.getOptionValue)(e.label,t.label),t.link=(0,n.getOptionValue)(e.link,t.link))}return i},r.formatAsHtml=function(e){if(0===e.length)return"";const t=e.filter((e=>""!==e.label));return 0===t.length?"":"© "+t.map((e=>{var t;const i=null!==(t=e.label)&&void 0!==t?t:e.id,n=void 0!==e.year?`${e.year} ${i}`:i,r=e.link;return r?`<a href="${r}" target="_blank" rel="noreferrer noopener">${n}</a>`:`${n}`})).join(", ")}},9348:(e,t)=>
950{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4757:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UrlCopyrightProvider=void 0;const n=i(3209),r=i(5808);class s extends r.CopyrightCoverageProvider{constructor(e,t,i,r=n.TransferManager.instance()){super(),this.m_fetchURL=e,this.m_baseScheme=t,this.m_requestHeaders=i,this.m_transferManager=r}setRequestHeaders(e){this.m_requestHeaders=e}getCopyrightCoverageData(e){return void 0!==this.m_cachedCopyrightResponse||(this.m_cachedCopyrightResponse=this.m_transferManager.downloadJson(this.m_fetchURL,{headers:this.m_requestHeaders,signal:e}).then((e=>e[this.m_baseScheme])).catch((e=>(this.logger.error(e),[])))),this.m_cachedCopyrightResponse}}t.UrlCopyrightProvider=s},1350:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fitLookAtBounds=t.getFitLookAtBoundsDistance=t.getFitBoundsParams=void 0;const n=i(82),r=i(2616),s=i(4442),o=i(541),a=new n.Vector3,l=new n.PerspectiveCamera;function c(e,t,i,s,a){let l,c;if(e instanceof r.GeoBox)c=null!=a?a:e.center,l=o.MapViewUtils.geoBoxToGeoPoints(e);else if(e instanceof r.GeoPolygon)c=e.getCentroid(),l=e.coordinates;else if((0,r.isGeoBoxExtentLike)(e)){c=null!=a?a:s;const t=r.GeoBox.fromCenterAndExtents(c,e);l=o.MapViewUtils.geoBoxToGeoPoints(t)}else{if(!Array.isArray(e))throw Error("#lookAt: Invalid 'bounds' value");l=e,c=a}e instanceof r.GeoBox||e instanceof r.GeoPolygon||!i||t.type!==r.ProjectionType.Planar||(l=o.MapViewUtils.wrapGeoPointsToScreen(l,c));const h=l.map((e=>t.projectPoint(r.GeoCoordinates.fromObject(e),new n.Vector3))),u=new n.Vector3;return void 0===c?((new n.Box3).setFromPoints(h).getCenter(u),t.scalePointToSurface(u),c=t.unprojectPoint(u)):t.projectPoint(c,u),{target:c,worldTarget:u,worldPoints:h}}function h(e,t){const{projection:i,viewportSize:n,cameraSettings:h,maxZoomLevel:u}=e,{yaw:d,tilt:m,padding:p}=t,{target:f,worldTarget:g,worldPoints:v}=c(t.bounds,i,e.tileWrapping,e.target,t.target);let y,_=t.distance;if(void 0===_){l.copy(e.camera),o.MapViewUtils.getCameraRotationAtTarget(i,f,d,m,l.quaternion),y=l.quaternion;const t=o.MapViewUtils.calculateDistanceFromZoomLevel(h,u);o.MapViewUtils.getCameraPositionFromTarget(f,t,d,m,i,l.position),l.updateMatrixWorld(!0),i.type===r.ProjectionType.Spherical&&o.MapViewUtils.wrapWorldPointsToView(v,l.position),_=function(e,t,i,n,r={top:0,right:0,bottom:0,left:0}){const o={top:2*r.top/n.height,right:2*r.right/n.width,bottom:2*r.bottom/n.height,left:2*r.left/n.width},l=a.copy(t).sub(i.position).length(),c=s.CameraUtils.getPrincipalPoint(i);let h=l;const u=(e,t,i,n)=>{const r=-1===Math.sign(e)?-1:1,s=r>0?n:i;return Math.abs(e)>1?Math.abs((e-t)/(r*(.99-s)-t)):1};for(const t of e){const e=-a.copy(t).applyMatrix4(i.matrixWorldInverse).z,n=a.applyMatrix4(i.projectionMatrix),r=Math.max(u(n.x,c.x,o.left,o.right),u(n.y,c.y,o.bottom,o.top));if(r>1){const t=l-e,i=Math.abs(e)*r+t;h=Math.max(h,i)}}return h}(v,g,l,n,p)}return{target:f,distance:_,quaternion:y}}t.getFitBoundsParams=c,t.getFitLookAtBoundsDistance=h,t.fitLookAtBounds=function(e,t){const{projection:i,camera:n}=e,{yaw:r,tilt:s}=t,{target:a,distance:l,quaternion:c}=h(e,t);c?n.quaternion.copy(c):o.MapViewUtils.getCameraRotationAtTarget(i,a,r,s,n.quaternion),o.MapViewUtils.getCameraPositionFromTarget(a,l,r,s,i,n.position),n.updateMatrixWorld(!0)}},8024:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addGroundPlane=void 0;const n=i(82),r=i(6525),s=i(6189),o=i(2616),a=i(1984),l=i(5863),c=i(8427),h=i(6473),u=i(21),d=i(4772),m=new n.Vector3;function p(e,t,i){const n=e.getAttribute("position"),r=n.array,s=new Float32Array(r.length);for(let e=0;e<n.array.length;e+=1)m.fromBufferAttribute(n,e),i.projection.reprojectPoint(t,m,m).sub(i.center),m.toArray(s,3*e);n.array=s,n.needsUpdate=!0}t.addGroundPlane=function(e,t,i=l.BackgroundDataSource.DEFAULT_COLOR,m=1,f=!1){const g=function(e,t,i,a){const{dataSource:l,projection:d}=e,m=l.getTilingScheme().projection,f=d.type===o.ProjectionType.Spherical,g=!f,v=e.mapView,y=v.shadowsEnabled,_={name:"polygon",color:i,opacity:a},x=(0,c.createMaterial)(_,e.mapView,{fog:null!==v.scene.fog,shadowsEnabled:y}),b=null==x?void 0:x.material;b&&(b.depthWrite=f);const w=function(e,t,i,r){const{dataSource:s,projection:o}=e,a=s.getTilingScheme().projection,l=new n.Vector3,c=new n.BufferGeometry,h=(0,u.projectTilePlaneCorners)(e,a),d=[h.sw,h.se,h.nw,h.ne];if(t)for(const t of d)o.reprojectPoint(a,t,t).sub(e.center);const m=t?new Float32Array(12):new Float64Array(12),p=new n.BufferAttribute(m,3).copyVector3sArray(d);if(c.setAttribute("position",p),r){a.surfaceNormal(h.sw,l).negate();const e=new n.BufferAttribute(new Float32Array(12),3).copyVector3sArray(Array(4).fill(l));c.setAttribute("normal",e)}if(c.setIndex(new n.BufferAttribute(new Uint16Array([0,1,2,2,1,3]),1)),i){const e=new n.BufferAttribute(new Float32Array([0,0,1,0,0,1,1,1]),2);c.setAttribute("uv",e)}return c}(e,g,t,y);if(!f)return new n.Mesh(w,b);const M=[],T=new s.SphericalGeometrySubdivisionModifier(n.MathUtils.degToRad(10),m);if(!(!1!==e.mapView.enableMixedLod))return T.modify(w),p(w,m,e),new n.Mesh(w,b);for(let t=0;t<4;++t){const i=Math.pow(2,t),n=w.clone();i>1&&new r.EdgeLengthGeometrySubdivisionModifier(i,e.geoBox,r.SubdivisionMode.All,m).modify(n),T.modify(n),p(n,m,e),M.push(n)}return new h.LodMesh(M,b)}(e,f,i,m);return g.receiveShadow=e.mapView.shadowsEnabled,g.renderOrder=t,(0,d.registerTileObject)(e,g,{pickability:a.Pickability.transient}),e.objects.push(g),g}},544:(e,t,i)=>{"use strict";
950Object.defineProperty(t,"__esModule",{value:!0}),t.DisplacedBufferAttribute=void 0;const n=i(82),r=i(4342),s=i(8813);class o extends n.BufferAttribute{constructor(e,t,i,r){super(e.array,e.itemSize,e.normalized),this.originalAttribute=e,this.m_normals=t,this.m_uvs=i,this.m_textureWidth=0,this.m_textureHeight=0,this.m_cache=new s.VertexCache(o.MAX_CACHE_SIZE),this.m_lastPos=new n.Vector3,this.m_tmpNormal=new n.Vector3,this.resetTexture(r)}reset(e,t,i,n){this.array=e.array,this.itemSize=e.itemSize,this.count=this.array.length/this.itemSize,this.normalized=e.normalized,this.originalAttribute=e,this.m_normals=t,this.m_uvs=i,this.m_cache.clear(),this.m_lastBufferIndex=void 0,this.resetTexture(n)}getX(e){return this.getDisplacedCoordinate(e).x}getY(e){return this.getDisplacedCoordinate(e).y}getZ(e){return this.getDisplacedCoordinate(e).z}resetTexture(e){this.m_texture=new Float32Array(e.image.data.buffer),this.m_textureWidth=e.image.width,this.m_textureHeight=e.image.height}getDisplacedCoordinate(e){return e===this.m_lastBufferIndex||(this.m_lastBufferIndex=e,this.m_cache.get(e,this.m_lastPos)||(this.displacePosition(e),this.m_cache.set(e,this.m_lastPos))),this.m_lastPos}displacePosition(e){this.m_lastPos.fromBufferAttribute(this.originalAttribute,e);const t=this.m_normals;this.m_tmpNormal.fromBufferAttribute(t,e);const i=this.m_uvs,s=n.MathUtils.clamp(i.getX(e),0,1),o=n.MathUtils.clamp(i.getY(e),0,1),a=(0,r.sampleBilinear)(this.m_texture,this.m_textureWidth,this.m_textureHeight,s,o);this.m_lastPos.add(this.m_tmpNormal.multiplyScalar(a))}}t.DisplacedBufferAttribute=o,o.MAX_CACHE_SIZE=6},8246:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DisplacedBufferGeometry=t.displaceBox=void 0;const n=i(82),r=i(544),s=new n.Vector3,o=new n.Vector3,a=new n.Box3;function l(e,t,i){a.copy(e);const n=s.copy(i),r=o.copy(n);return e.translate(n.multiplyScalar(t.min)).union(a.translate(r.multiplyScalar(t.max))),e}t.displaceBox=l;class c extends n.BufferGeometry{constructor(e,t,i,s){super(),this.originalGeometry=e,this.displacementRange=i,this.m_originalBoundingBox=new n.Box3,this.m_displacedPositions=s||new r.DisplacedBufferAttribute(e.attributes.position,e.attributes.normal,e.attributes.uv,t),this.resetAttributes()}reset(e,t,i){this.originalGeometry=e;const n=e.attributes.position,r=e.attributes.normal,s=e.attributes.uv;this.m_displacedPositions.reset(n,r,s,t);const o=this.displacementRange.min!==i.min||this.displacementRange.max!==i.max;this.displacementRange=i,this.resetAttributes(),this.resetBoundingVolumes(o)}computeBoundingBox(){null===this.originalGeometry.boundingBox&&this.originalGeometry.computeBoundingBox();const e=this.m_originalBoundingBox.copy(this.originalGeometry.boundingBox);null===this.boundingBox?this.boundingBox=e.clone():this.boundingBox.copy(e),l(this.boundingBox,this.displacementRange,s.fromBufferAttribute(this.attributes.normal,0))}computeBoundingSphere(){null===this.boundingBox&&this.computeBoundingBox(),null===this.boundingSphere&&(this.boundingSphere=new n.Sphere),this.boundingBox.getBoundingSphere(this.boundingSphere)}needsBoundingBoxUpdate(e){return e||null!==this.boundingBox&&(!this.originalGeometry.boundingBox||!this.m_originalBoundingBox.equals(this.originalGeometry.boundingBox))}resetBoundingVolumes(e){this.needsBoundingBoxUpdate(e)&&(this.computeBoundingBox(),this.boundingSphere&&this.computeBoundingSphere())}resetAttributes(){this.index=this.originalGeometry.index,this.groups=this.originalGeometry.groups,this.drawRange=this.originalGeometry.drawRange,this.attributes=Object.assign({},this.originalGeometry.attributes),this.attributes.position=this.m_displacedPositions}}t.DisplacedBufferGeometry=c},946:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DisplacedMesh=void 0;const n=i(82),r=i(4250),s=i(4342),o=i(544),a=i(8246);class l extends n.Mesh{static getDisplacedPositionAttribute(e,t){return l.displacedPositions?l.displacedPositions.reset(e.attributes.position,e.attributes.normal,e.attributes.uv,t):l.displacedPositions=new o.DisplacedBufferAttribute(e.attributes.position,e.attributes.normal,e.attributes.uv,t),l.displacedPositions}constructor(e,t,i,n){super(e,t),this.m_getDisplacementRange=i,this.m_raycastStrategy=n}raycast(e,t){const i=this.firstMaterial;if(!function(e){const t=(0,r.hasDisplacementFeature)(e);return(0,s.assert)(t,"Material does not support displacement maps."),t}
950(i)||!function(e){if(!e)return!1;const t=e instanceof n.DataTexture;return(0,s.assert)(t,"Material does not support displacement maps."),t}(i.displacementMap))return void super.raycast(e,t);const o=i.displacementMap,c=Object.assign({},this.m_getDisplacementRange());(0,s.assert)(this.geometry instanceof n.BufferGeometry,"Unsupported geometry type.");const h=this.geometry;this.displacedGeometry?this.displacedGeometry.reset(h,o,c):this.displacedGeometry=new a.DisplacedBufferGeometry(h,o,c,l.getDisplacedPositionAttribute(h,o)),this.geometry=this.displacedGeometry,this.m_raycastStrategy?this.m_raycastStrategy(this,e,t):super.raycast(e,t),super.geometry=this.displacedGeometry.originalGeometry}get firstMaterial(){return Array.isArray(this.material)?this.material[0]:this.material}}t.DisplacedMesh=l},6473:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LodMesh=void 0;const n=i(82);class r extends n.Mesh{constructor(e,t){super(void 0,t),this.geometries=e}set geometries(e){this.m_geometries!==e&&this.disposeGeometries(),this.m_geometries=e,this.geometries&&this.m_geometries.length>0&&(this.geometry=this.m_geometries[0])}get geometries(){return this.m_geometries}setLevelOfDetail(e){this.m_geometries&&0!==this.m_geometries.length&&(e=n.MathUtils.clamp(e,0,this.m_geometries.length-1),this.geometry=this.m_geometries[e])}disposeGeometries(){if(this.m_geometries)for(const e of this.m_geometries)e.dispose();this.geometry.dispose()}}t.LodMesh=r},7987:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Object3DUtils=void 0;const n=i(82),r=i(4250),s=i(4342),o=i(1447),a=s.LoggerManager.instance.create("Object3DUtils");!function(e){function t(e){if(!e.image)return 0;const t=e.image;return 4*t.width*t.height}function i(e,i,n){if(!e)return;if(void 0!==e.uuid&&!0===n.get(e.uuid))return;n.set(e.uuid,!0);const r=t(e);i.heapSize+=r,i.gpuSize+=r}function s(e,t,s){if(void 0===e.uuid||!0!==s.get(e.uuid))if(s.set(e.uuid,!0),e instanceof n.RawShaderMaterial||e instanceof n.ShaderMaterial){const r=e;for(const e in r.uniforms)if(void 0!==r.uniforms[e]){const o=r.uniforms[e];o instanceof n.Texture&&i(o,t,s)}}else if(e instanceof n.MeshBasicMaterial||e instanceof r.MapMeshBasicMaterial){const n=e;i(n.map,t,s),i(n.aoMap,t,s),i(n.specularMap,t,s),i(n.alphaMap,t,s),i(n.envMap,t,s)}else if(e instanceof r.MapMeshStandardMaterial){const n=e;i(n.map,t,s),i(n.lightMap,t,s),i(n.aoMap,t,s),i(n.emissiveMap,t,s),i(n.bumpMap,t,s),i(n.normalMap,t,s),i(n.displacementMap,t,s),i(n.roughnessMap,t,s),i(n.metalnessMap,t,s),i(n.alphaMap,t,s),i(n.envMap,t,s)}else if(e instanceof r.MapMeshPhongMaterial){const n=e;i(n.map,t,s),i(n.lightMap,t,s),i(n.aoMap,t,s),i(n.emissiveMap,t,s),i(n.bumpMap,t,s),i(n.normalMap,t,s),i(n.displacementMap,t,s),i(n.specularMap,t,s),i(n.alphaMap,t,s),i(n.envMap,t,s)}else e instanceof n.LineBasicMaterial||e instanceof n.LineDashedMaterial||e instanceof n.PointsMaterial||a.warn("estimateMeshSize: unidentified material: ",e)}function l(e,t,i,r){if(void 0===e.uuid&&(e.uuid=n.MathUtils.generateUUID()),!0===r.get(e.uuid))return;r.set(e.uuid,!0);let s=0,o=4;void 0!==e.array.BYTES_PER_ELEMENT&&(o=e.array.BYTES_PER_ELEMENT),e instanceof n.InterleavedBufferAttribute||e instanceof n.BufferAttribute?s=o*e.count*e.itemSize:a.warn("estimateMeshSize: unidentified attribute: ",t),i.heapSize+=s+56,i.gpuSize+=s}function c(e,t,i){if(void 0!==e.uuid&&!0===i.get(e.uuid))return;if(i.set(e.uuid,!0),void 0===e)return;const n=e.attributes;if(void 0!==n){for(const e in n)void 0!==n[e]&&l(n[e],e,t,i);null!==e.index&&l(e.index,"index",t,i)}else a.warn("estimateGeometrySize: unidentified geometry: ",e)}e.getTextureSize=t,e.estimateSize=function e(t,i,r){const l=void 0!==i?i:{heapSize:0,gpuSize:0};if(void 0===r&&(r=new Map),function(e,t,i){if(e.isObject3D&&!(e instanceof n.Scene)&&(void 0===e.uuid||!0!==i.get(e.uuid)))if(i.set(e.uuid,!0),e.isMesh||e.isLine||e.isPoints){let n=1e3;const r=0,a=e;if(void 0!==a.material)if(Array.isArray(a.material)){const e=a.material;for(const n of e)s(n,t,i)}else s(a.material,t,i);if(void 0!==a.geometries)for(const e of a.geometries)c(e,t,i);else void 0!==a.geometry&&c(a.geometry,t,i);const l=void 0!==e.userData?e.userData.feature:void 0;void 0!==l&&(n+=(0,o.getFeatureDataSize)(l)),t.heapSize+=n,t.gpuSize+=r}else a.warn("estimateMeshSize: unidentified object",e)}(t,l,r),t.children.length>0)for(const i of t.children)e(i,l,r);return l}}(t.Object3DUtils||(t.Object3DUtils={}))},21:(e,t,i)=>{"use strict";
950Object.defineProperty(t,"__esModule",{value:!0}),t.projectTilePlaneCorners=void 0;const n=i(82),r=i(2616);t.projectTilePlaneCorners=function(e,t){const{east:i,west:s,north:o,south:a}=e.geoBox;return{sw:t.projectPoint(new r.GeoCoordinates(a,s),new n.Vector3),se:t.projectPoint(new r.GeoCoordinates(a,i),new n.Vector3),nw:t.projectPoint(new r.GeoCoordinates(o,s),new n.Vector3),ne:t.projectPoint(new r.GeoCoordinates(o,i),new n.Vector3)}}},4772:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.registerTileObject=void 0;const n=i(4572);t.registerTileObject=function(e,t,i){n.MapObjectAdapter.create(t,Object.assign({dataSource:e.dataSource,tileKey:e.tileKey},i)),e.resetVisibilityCounter()}},8673:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SolidLineMesh=void 0;const n=i(82),r=i(2616),s=i(4250),o=i(4342),a=i(8246),l=new n.Sphere,c=new n.Matrix4,h=new n.Ray,u=new n.Line3,d=new n.Box3,m=new r.OrientedBox3,p=new n.Plane,f=new n.Vector3,g=new n.Vector3,v=new n.Vector3,y=new n.Vector3,_=6,x=2;function b(e,t,i){let r;e instanceof a.DisplacedBufferGeometry&&(r=e.displacementRange,e=e.originalGeometry);const s=e.attributes.position,o=e.index.array,l=new n.Sphere,c=d.makeEmpty(),h=f;for(let e=t;e<i;
950e+=_)c.expandByPoint(h.fromBufferAttribute(s,o[e])),c.expandByPoint(h.fromBufferAttribute(s,o[e+x]));if(r){const t=g;return t.fromBufferAttribute(e.attributes.normal,0),(0,a.displaceBox)(c,r,t).getBoundingSphere(l)}return c.getBoundingSphere(l)}function w(e,t,i,r,s,o,a,l){if(a.equals(e.origin)&&0===e.direction.dot(o.normal)){const s=function(e,t,i,n,r){var s;const o=m;return t.getCenter(o.position),t.delta(o.xAxis).normalize(),o.yAxis.copy(i),o.zAxis.copy(n),o.extents.set(t.distance()/2,r,r),o.contains(e.origin)?0:null!==(s=o.intersectsRay(e))&&void 0!==s?s:1/0}(e,t,i,o.normal,r),a=function(e,t,i){const r=new n.Sphere(t.start,i),s=r.containsPoint(e.origin)?0:e.intersectSphere(r,y)?y.sub(e.origin).length():1/0;r.center.copy(t.end);const o=r.containsPoint(e.origin)?0:e.intersectSphere(r,y)?y.sub(e.origin).length():1/0;return Math.min(s,o)}(e,t,r),c=Math.min(s,a);return c!==1/0&&(e.at(c,l),!0)}return!(a.distanceToSquared(t.closestPointToPoint(a,!0,y))>s||(l.copy(a),0))}function M(e,t,i,n,r,s,o,a,c,h){const d=f,m=p,y=g,b=u,M=e.geometry,T=M.attributes,S=T.position,E=T.biTangent,A=M.index.array;if(l.copy(c),l.applyMatrix4(e.matrixWorld),l.radius+=n,t.ray.intersectsSphere(l))for(let n=o;n<a;n+=_){const o=A[n],a=A[n+x];if(b.start.fromBufferAttribute(S,o),b.end.fromBufferAttribute(S,a),d.set(E.getX(o),E.getY(o),E.getZ(o)).normalize(),m.setFromCoplanarPoints(b.start,v.copy(b.start).add(d),b.end),0===m.normal.manhattanLength())continue;if(!i.intersectPlane(m,y))continue;const l=v;if(!w(i,b,d,r,s,m,y,l))continue;const c=l.applyMatrix4(e.matrixWorld),u=t.ray.origin.distanceTo(c);u<t.near||u>t.far||h.push({distance:u,point:c.clone(),index:n,object:e})}}const T=[0],S=.01;function E(e,t,i,r,a,l,c){var h;const u=e.userData,d=u.feature.boundingVolumes;(0,o.assert)(e.geometry instanceof n.BufferGeometry,"Unsupported geometry type.");const m=e.geometry;(0,o.assert)(function(e){return Array.isArray(e)?e.every((e=>e instanceof s.SolidLineMaterial)):e instanceof s.SolidLineMaterial}(t),"Unsupported material type");const p=t.width/2;(0,o.assert)(Math.abs(1-e.scale.x/e.scale.y)<S),(0,o.assert)(Math.abs(1-e.scale.x/e.scale.z)<S),(0,o.assert)(Math.abs(1-e.scale.y/e.scale.z)<S);const f=p/((e.scale.x+e.scale.y+e.scale.z)/3),g=f*f,v=null!==(h=u.feature.starts)&&void 0!==h?h:T;let y=a,_=v[y];const x=v.length-1;for(;_<l;){const t=y,n=y<x?v[++y]:l;t>=d.length&&d.push(b(m,_,n)),M(e,i,r,p,f,g,_,n,d[t],c),_=n}return y}class A extends n.Mesh{static raycast(e,t,i){var r;(0,o.assert)(e.geometry instanceof n.BufferGeometry,"Unsupported geometry type");const s=e.geometry;(0,o.assert)(null!==s.index,"Geometry does not have indices");const a=e.matrixWorld;c.copy(a).invert();const l=h.copy(t.ray).applyMatrix4(c),u=e.userData,d=null!==(r=u.feature)&&void 0!==r?r:u.feature={};void 0===u.feature&&(u.feature={});const m=s.attributes.position,p=d.attributeInfo;(void 0===p||void 0===d.boundingVolumes||function(e,t){const i=!0===e.isBufferAttribute?e:e.data;return void 0===t||t.data!==i||e.isBufferAttribute&&t.version!==i.version}(m,p))&&(d.boundingVolumes=[],d.attributeInfo=function(e){const t=!0===e.isBufferAttribute?e:e.data;return{data:t,version:t.version}}(m));const f=s.index.array;if(Array.isArray(e.material)){let n=0;for(const r of s.groups)n=E(e,e.material[r.materialIndex],t,l,n,r.start+r.count,i)}else E(e,e.material,t,l,0,f.length,i)}constructor(e,t){super(e,t)}raycast(e,t){A.raycast(this,e,t)}}t.SolidLineMesh=A},5571:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TileDataAccessor=void 0;const n=i(8152),r=i(4342),s=i(4269),o=r.LoggerManager.instance.create("TileDataAccessor");t.TileDataAccessor=class{constructor(e,t,i){this.tile=e,this.visitor=t;const n=!0===i.wantsAll;this.m_wantsPoints=n||!(!1===i.wantsPoints),this.m_wantsLines=n||!(!1===i.wantsLines),this.m_wantsAreas=n||!(!1===i.wantsAreas),this.m_wantsObject3D=n||!(!1===i.wantsObject3D)}visitAll(){const e=this.tile.objects;for(const t of e)this.visitObject(t)}visitObject(e){const t=void 0!==e.userData?e.userData.feature:void 0;if(void 0===t||void 0!==t.objInfos&&1===t.objInfos.length&&!this.visitor.wantsFeature((0,n.getFeatureId)(t.objInfos[0])))return;const i=t.geometryType;if(void 0===i)return void o.warn("#visitObject: visiting object failed, no geometryType",e);switch((0,r.assert)(void 0!==t.objInfos,"featureData.ids missing"),(0,r.assert)(void 0!==t.starts,"featureData.starts missing"),(0,r.assert)(Array.isArray(t.starts),"featureData.starts is not an array"),void 0!==t.objInfos&&void 0!==t.starts&&(0,r.assert)(t.objInfos.length===t.starts.length,"featureData.ids and featureData.starts have unequal length"),i){case n.GeometryType.Point:case n.GeometryType.Text:if(!this.m_wantsPoints)return;break;case n.GeometryType.SolidLine:case n.GeometryType.ExtrudedLine:case n.GeometryType.TextPath:if(!this.m_wantsLines)return;break;case n.GeometryType.Polygon:case n.GeometryType.ExtrudedPolygon:if(!this.m_wantsAreas)return;break;case n.GeometryType.Object3D:if(!this.m_wantsObject3D)return;break;default:o.warn("#visitObject: invalid geometryType")}if("Mesh"!==e.type)return void o.warn("#visitObject: visiting object failed, not of type 'Me
950sh'",e);const s=e;this.visitMesh(s,t)}getBufferGeometry(e){const t=e.geometry;if("BufferGeometry"!==t.type)return void o.warn("#visitObject: object does not have BufferGeometry");const i=t;if(i.getAttribute("position"))return i;o.warn("#visitLines: BufferGeometry has no position attribute")}getGeometryAccessor(e,t,i){switch(e){case n.GeometryType.Point:case n.GeometryType.Text:return;case n.GeometryType.SolidLine:case n.GeometryType.ExtrudedLine:case n.GeometryType.TextPath:return new s.BufferedGeometryLineAccessor(t,e,i);case n.GeometryType.Polygon:case n.GeometryType.ExtrudedPolygon:return;case n.GeometryType.Object3D:return new s.BufferedGeometryObject3dAccessor(t,e,i);default:o.warn("#getGeometryAccessor: invalid geometryType")}}getIndexedGeometryAccessor(e,t,i){switch(e){case n.GeometryType.Point:case n.GeometryType.Text:return;case n.GeometryType.SolidLine:case n.GeometryType.ExtrudedLine:case n.GeometryType.TextPath:return new s.IndexedBufferedGeometryLineAccessor(t,e,i);case n.GeometryType.Polygon:case n.GeometryType.ExtrudedPolygon:case n.GeometryType.Object3D:return;default:o.warn("#getIndexedGeometryAccessor: invalid geometryType")}}visitMesh(e,t){const{objInfos:i,starts:a}=t,l=t.geometryType;if(void 0===i||void 0===a||void 0===l)return;let c;for(let t=0;t<i.length;t++){const h=(0,n.getFeatureId)(i[t]);if(!this.visitor.wantsFeature(h))continue;const u=a[t];let d=-1;if(void 0===c){const t=this.getBufferGeometry(e);if(void 0===t)continue;if(c=null!==t.index?this.getIndexedGeometryAccessor(l,e,t):this.getGeometryAccessor(l,e,t),void 0===c){o.warn("#visitObject: no accessor geometryType",l);continue}}switch(d=t<a.length-1?a[t+1]:c.getCount(),c.setRange(u,d),l){case n.GeometryType.Point:case n.GeometryType.Text:this.visitor.visitPoint(h);break;case n.GeometryType.SolidLine:case n.GeometryType.ExtrudedLine:case n.GeometryType.TextPath:(0,r.assert)((0,s.isLineAccessor)(c)),this.visitor.visitLine(h,c);break;case n.GeometryType.Polygon:case n.GeometryType.ExtrudedPolygon:this.visitor.visitArea(h);break;case n.GeometryType.Object3D:(0,r.assert)((0,s.isObject3dAccessor)(c)),this.visitor.visitObject3D(h,c);break;default:o.warn("#visitObject: invalid geometryType")}}}}},4269:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IndexedBufferedGeometryLineAccessor=t.IndexedBufferedGeometryAccessor=t.BufferedGeometryObject3dAccessor=t.BufferedGeometryLineAccessor=t.BufferedGeometryAccessor=t.BufferedGeometryAccessorBase=t.isObject3dAccessor=t.isLineAccessor=void 0;const n=i(8152),r=i(3211),s=i(4342),o=s.LoggerManager.instance.create("TileGeometry");
950t.isLineAccessor=function(e){return"function"==typeof e.isLineAccessor&&!0===e.isLineAccessor()},t.isObject3dAccessor=function(e){return"function"==typeof e.isObject3dAccessor&&!0===e.isObject3dAccessor()};class a{constructor(e,t,i){this.object=e,this.geometryType=t,this.bufferGeometry=i,this.start=-1,this.end=-1,this.startCapSize=0,this.endCapSize=0,(0,s.assert)(!!e),"BufferGeometry"!==i.type&&o.error("IndexedBufferedGeometryAccessor#constructor: BufferGeometry has wrong type"),(0,s.assert)("BufferGeometry"===i.type,"IndexedBufferedGeometryAccessor#constructor: BufferGeometry has wrong type"),this.position=this.bufferGeometry.getAttribute("position"),this.itemSize=this.position.itemSize,this.position||o.warn("BufferedGeometryAccessor#constructor: BufferGeometry has no position attribute"),this.position.array.constructor!==Float32Array&&o.warn("BufferedGeometryAccessor#constructor: BufferGeometry.position: unsupported ArrayBuffer")}getCount(){return this.position.count}get renderOrder(){return this.object.renderOrder}setRange(e,t,i=0,n=0){(0,s.assert)(e>=0),(0,s.assert)(t>=0),(0,s.assert)(e<=t),this.start=e,this.end=t,this.startCapSize=i,this.endCapSize=n}get color(){const e=e=>{const t=e;if("MeshBasicMaterial"===t.type||"MeshStandardMaterial"===t.type)return t.color;if("RawShaderMaterial"===t.type){const t=e;if("SolidLineMaterial"===t.name)return t.uniforms.diffuseColor.value;o.warn("BufferedGeometryAccessor#color: unknown shader material name",t.name)}else o.warn("BufferedGeometryAccessor#color: unknown material type",t.type)};if(Array.isArray(this.object.material)){const t=new Array,i=this.object.material;for(const n of i)t.push(e(n));return t}return e(this.object.material)}}t.BufferedGeometryAccessorBase=a;class l extends a{constructor(e,t,i,n){super(e,t,i),this.object=e,this.geometryType=t,this.bufferGeometry=i,this.stride=n}clear(){(0,s.assert)(this.checkSetUp(),"BufferedGeometryAccessor not setup");const e=this.position.array,t=this.start*this.itemSize,i=this.end*this.itemSize;for(let n=t;n<i;n++)e[n]=0;this.position.needsUpdate=!0}getVertices(){(0,s.assert)(this.checkSetUp(),"BufferedGeometryAccessor not setup");const e=this.start,t=this.end;return this.position.array.subarray(e*this.itemSize,t*this.itemSize)}checkSetUp(){return void 0!==this.position&&void 0!==this.start&&void 0!==this.end&&this.start>=0&&this.end<=this.position.count&&this.start<=this.end}}t.BufferedGeometryAccessor=l,t.BufferedGeometryLineAccessor=class extends l{constructor(e,t,i){super(e,t,i,3),this.object=e,this.geometryType=t,this.bufferGeometry=i}isLineAccessor(){return!0}get width(){(0,s.assert)(this.checkSetUp(),"RoBufferedGeometryLineAccessor not setup")}},t.BufferedGeometryObject3dAccessor=class extends l{constructor(e,t,i){super(e,t,i,1),this.object=e,this.geometryType=t,this.bufferGeometry=i}isObject3dAccessor(){return!0}getVertices(){return super.getVertices()}};class c extends a{constructor(e,t,i,n,r){super(e,t,i),this.object=e,this.geometryType=t,this.bufferGeometry=i,this.indices=null!==this.bufferGeometry.index?this.bufferGeometry.index.array:void 0,this.indices?this.indices instanceof Uint32Array||(o.warn("IndexedBufferedGeometryAccessor#constructor: BufferGeometry index has wrong type"),(0,s.assert)(this.indices instanceof Uint32Array)):(o.warn("IndexedBufferedGeometryAccessor#constructor: BufferGeometry has no index"),(0,s.assert)(!!this.indices))}getCount(){return this.indices.length}checkSetUp(){return!!this.indices&&void 0!==this.start&&void 0!==this.end&&this.start>=0&&this.end<=this.indices.length&&this.start<=this.end}}t.IndexedBufferedGeometryAccessor=c,t.IndexedBufferedGeometryLineAccessor=class extends c{constructor(e,t,i){super(e,t,i,3),this.object=e,this.geometryType=t,this.bufferGeometry=i}isLineAccessor(){return!0}get width(){if((0,s.assert)(this.checkSetUp(),"RoIndexedBufferedGeometryLineAccessor not setup"),this.geometryType===n.GeometryType.ExtrudedLine){const e=this.start+this.startCapSize,t=this.position.array;return(0,r.reconstructLineWidth)(t,e)}}clear(){(0,s.assert)(this.checkSetUp(),"RoIndexedBufferedGeometryLineAccessor not setup");const e=this.start,t=this.end;for(let i=e;i<t;i++)this.indices[i]=0;null!==this.bufferGeometry.index&&(this.bufferGeometry.index.needsUpdate=!0)}getVertices(){(0,s.assert)(this.checkSetUp(),"RoIndexedBufferedGeometryLineAccessor not setup");const e=this.itemSize,t=this.start,i=this.end,n=new Float32Array((i-t)*e),r=this.position.array;if(2===e)for(let s=t,o=0;s<i;s++,o+=e){const t=this.indices[s];n[o+0]=r[t*e+0],n[o+1]=r[t*e+1]}if(3===e)for(let s=t,o=0;s<i;s++,o+=e){const t=this.indices[s];n[o+0]=r[t*e+0],n[o+1]=r[t*e+1],n[o+2]=r[t*e+2]}else for(let s=t,o=0;s<i;s++,o++){const t=this.indices[s];for(let i=0;i<e;i++)n[o*e+i]=r[t*e+i]}return n}}},5912:(e,t,i)=>{"use strict";
950Object.defineProperty(t,"__esModule",{value:!0}),t.TileGeometryCreator=void 0;const n=i(82),r=i(8152),s=i(2616),o=i(4250),a=i(1984),l=i(8023),c=i(4342),h=i(5863),u=i(8427),d=i(2476),m=i(5316),p=i(176),f=i(9701),g=i(8024),v=i(4772),y=c.LoggerManager.instance.create("TileGeometryCreator"),_=new n.Vector3,x=new n.Vector2;class b{constructor(){this.bufferAttributes=new Map,this.interleavedAttributes=new Map}}class w extends l.CallExpr{constructor(e){super("memo",[e]),this.m_cachedProperties=[],this.m_deps=Array.from(e.dependencies().properties),this.descriptor=this}call(e){let t=!1;return this.m_deps.forEach(((i,n)=>{const r=e.env.lookup(i);t||r===this.m_cachedProperties[n]||(t=!0),t&&(this.m_cachedProperties[n]=r)})),(t||void 0===this.m_cachedValue)&&(this.m_cachedValue=e.evaluate(this.args[0])),this.m_cachedValue}}class M{constructor(e,t,i){this.geometry=e,this.info=t,this.cache=i}getBufferAttribute(e){if(this.cache.bufferAttributes.has(e))return this.cache.bufferAttributes.get(e);const t=(0,u.getBufferAttribute)(e);return this.cache.bufferAttributes.set(e,t),t}getInterleavedBufferAttributes(e){const t=this.cache.interleavedAttributes.get(e);if(t)return t;const i=new((0,r.getArrayConstructor)(e.type))(e.buffer),s=new n.InterleavedBuffer(i,e.stride),o=e.attributes.map((e=>{const t=new n.InterleavedBufferAttribute(s,e.itemSize,e.offset,!1);return{name:e.name,attribute:t}}));return this.cache.interleavedAttributes.set(e,o),o}}function T(e,t){if(Array.isArray(e)){const i=e;t.push(...i)}else t.push(e)}class S{static get instance(){return this.m_instance||(this.m_instance=new S)}constructor(){}initDecodedTile(e){for(const t of e.geometries)for(const e of t.groups)e.createdOffsets=[]}createAllGeometries(e,t){const i=this.createObjects(e,t);if(this.addIconTexts(e,t),this.createIconTexts(e,t,(e=>(0,a.isIconTextTechnique)(e)||(0,a.isLineMarkerTechnique)(e)||(0,a.isTextTechnique)(e))),this.createLabelRejectionElements(e,t),e.dataSource.addGroundPlane&&e.projection.type===s.ProjectionType.Planar){const t=e.mapView.getDataSourceByName(h.Backgroun
950dDataSource.NAME);(0,g.addGroundPlane)(e,-1,null==t?void 0:t.backgroundColor)}return i}createLabelRejectionElements(e,t){if(void 0!==t.pathGeometries)for(const i of t.pathGeometries)e.addBlockingElement(new f.PathBlockingElement(i.path))}processTechniques(e){const t=e.decodedTile;if(void 0===t)return;this.initDecodedTile(t);const i=e.dataSource.exprPool;t.techniques.forEach((e=>{for(const t in e){if(!e.hasOwnProperty(t))continue;const n=e[t];if((0,a.isJsonExpr)(n)&&"kind"!==t)try{let r=l.Expr.fromJSON(n);!0!==r.dependencies().volatile&&(r=new w(r)),e[t]=r.intern(i)}catch(e){y.error("Failed to compile expression:",e)}}}))}prepareTextPaths(e,t,i){const n=new Array,r=e.slice();for(;r.length>0;){const e=r.pop();if(void 0===e)break;const s=t.techniques[e.technique];(0,a.isTextTechnique)(s)&&(void 0===i||i(s))&&n.push(e)}return n}createIconTexts(e,t,i){var r;const s=e.mapView,o=e.computeWorldOffsetX(),l=Math.floor(s.zoomLevel),c=new a.MapEnv({$zoom:l},s.env),h=new m.IconTextBuilder(c,e.textStyleCache,e.dataSource.dataSourceOrder);if(void 0!==t.textPathGeometries){const r=this.prepareTextPaths(t.textPathGeometries,t,i);for(const s of r){const r=t.techniques[s.technique];if(!(0,a.isTextTechnique)(r)||void 0!==i&&!i(r))continue;const l=[];for(let e=0;e<s.path.length;e+=3)l.push(new n.Vector3(s.path[e]+o,s.path[e+1],s.path[e+2]));const c=h.withTechnique(r).build(s.text,l,e.offset,e.dataSource.name,e.dataSource.dataSourceOrder,s.objInfos,s.pathLengthSqr);e.addIconText(c)}}if(void 0!==t.textGeometries)for(const s of t.textGeometries){if(void 0===s.technique||void 0===s.stringCatalog)continue;const l=t.techniques[s.technique];if(!(0,a.isTextTechnique)(l)||void 0!==i&&!i(l))continue;const c=new n.BufferAttribute(new Float64Array(s.positions.buffer),s.positions.itemCount),u=c.count;if(!(u<1)){h.withTechnique(l);for(let t=0;t<u;++t){const i=c.getX(t)+o,a=c.getY(t),l=c.getZ(t),u=s.stringCatalog[s.texts[t]];if(void 0===u)continue;const d=null===(r=s.objInfos)||void 0===r?void 0:r[t],m=new n.Vector3(i,a,l),p=h.build(u,m,e.offset,e.dataSource.name,e.dataSource.dataSourceOrder,d);e.addIconText(p)}}}}createObjects(e,t,i){var h,m,f,g;const v=e.mapView,y=[],b=[],w=v.animatedExtrusionHandler,M=Math.floor(v.zoomLevel),S=new a.MapEnv({$zoom:M},v.env),E=e.objects,A=v.viewRanges,C=void 0!==v.elevationProvider,P=[];for(const M of this.getAttachments(t)){const L=M.geometry,R=M.info.groups,D=R.length;for(let O=0;O<D;){const I=R[O++],F=I.start,V=I.technique,U=t.techniques[V];if(void 0===I.createdOffsets&&(I.createdOffsets=[]),I.createdOffsets.includes(e.offset)||void 0!==i&&!i(U))continue;let B=I.count;for(I.createdOffsets.push(e.offset);O<D&&R[O].technique===V&&F+B===R[O].start;++O)B+=R[O].count,R[O].createdOffsets.push(e.offset);if(!(0,u.usesObject3D)(U))continue;const N=null!==(h=null==w?void 0:w.setAnimationProperties(U,S))&&void 0!==h&&h;let z=y[V];if(void 0===z){const e=(0,u.createMaterial)(U,v,{fog:null!==v.scene.fog,shadowsEnabled:v.shadowsEnabled});if(void 0===e)continue;z=e.material,P.push(e.texturesReady),N&&(0,o.hasExtrusionFeature)(z)&&T(z,b),y[V]=z}(0,a.isTerrainTechnique)(U)&&this.setupTerrainMaterial(U,z,e.mapView.clearColor);const k=new n.BufferGeometry;null===(m=L.vertexAttributes)||void 0===m||m.forEach((e=>{const t=M.getBufferAttribute(e);k.setAttribute(e.name,t)})),null===(f=L.interleavedVertexAttributes)||void 0===f||f.forEach((e=>{M.getInterleavedBufferAttributes(e).forEach((({name:e,attribute:t})=>k.setAttribute(e,t)))}));const G=null!==(g=M.info.index)&&void 0!==g?g:L.index;if(G&&k.setIndex(M.getBufferAttribute(G)),!k.getAttribute("normal")&&(0,a.needsVertexNormals)(U)&&k.computeVertexNormals(),k.addGroup(F,B),(0,a.isSolidLineTechnique)(U)){(0,c.assert)(!(0,o.isHighPrecisionLineMaterial)(z));const t=z;if(1===t.uniforms.wireframe.value){const e=[new n.Vector3(1,0,0),new n.Vector3(0,1,0),new n.Vector3(0,0,1)],t=k.attributes.position,i=new Float32Array(3*t.count);for(let n=0,r=t.count;n<r;n++)e[n%3].toArray(i,3*n);k.setAttribute("barycentric",new n.BufferAttribute(i,3))}!0===U.clipping&&e.projection.type===s.ProjectionType.Planar&&(e.boundingBox.getSize(_),x.set(_.x,_.y),t.clipTileSize=x),k.getAttribute("color")&&(0,o.setShaderMaterialDefine)(t,"USE_COLOR",!0)}const j=l.Expr.isExpr(U.enabled)&&L.featureStarts&&L.featureStarts.length>0,H=(0,u.buildObject)(U,k,j?[z]:z,e,C);if(H.renderOrder=(0,r.getPropertyValue)(U.renderOrder,v.env),void 0!==M.info.uuid&&(H.uuid=M.info.uuid,H.userData.geometryId=M.info.uuid),((0,a.isCirclesTechnique)(U)||(0,a.isSquaresTechnique)(U))&&void 0!==U.enablePicking&&(H.enableRayTesting=U.enablePicking),(0,a.isLineTechnique)(U)||(0,a.isSegmentsTechnique)(U)){const e=this.getFadingParams(S,U);o.FadingFeature.addRenderHelper(H,A,e.fadeNear,e.fadeFar,!1)}if((0,a.isSolidLineTechnique)(U)){const e=this.getFadingParams(S,U);o.FadingFeature.addRenderHelper(H,A,e.fadeNear,e.fadeFar,!1)}if((0,a.isExtrudedLineTechnique)(U)&&void 0!==U.fadeFar){const e=this.getFadingParams(v.env,U);o.FadingFeature.addRenderHelper(H,A,e.fadeNear,e.fadeFar,!0)}if((0,a.isExtrudedPolygonTechnique)(U)?(H.castShadow=v.shadowsEnabled,H.receiveShadow=v.shadowsEnabled):((0,a.isStandardTechnique)(U)||(0,a.isPolygonTechnique)(U))&&(H.receiveShadow=v.shadowsEnabled),((0,a.isExtrudedPolygonTechnique)(U)||(0,a.isStandardTechnique)(U)||(0,a.isPolygonTechnique)(U))&&void 0!==U.fadeFar){const e=this.getFadingParams(S,U);o.FadingFeature.addRenderHelper(H,A,e.fadeNear,e.fadeFar,!0)}if((0,a.isExtrudedPolygonTechnique)(U)&&(0,d.isRenderDepthPrePassEnabled)(U,S)){const t=(0,d.createDepthPrePassMesh)(H);this.addUserData(e,L,t,{technique:U,pickability:a.Pickability.transient}),E.push(t),N&&T(t.material,b),(0,d.setDepthPrePassStencil)(t,H)}const W=(0,a.transientToPickability)((0,r.getPropertyValue)(U.transient,v.env));if(this.addUserData(e,L,H,{technique:U,pickability:W}),E.push(H),(0,a.isExtrudedPolygonTechnique)(U)&&void 0!==M.info.edgeIndex){const t=l.Expr.isExpr(U.enabled)&&L.edgeFeatureStarts&&L.edgeFeatureStarts.length>0,i=U,s=new n.BufferGeometry;s.setAttribute("position",k.getAttribute("position"));const c=k.getAttribute("color");void 0!==c&&s.setAttribute("color",c);const h=k.getAttribute("extrusionAxis");void 0!==h&&s.setAttribute("extrusionAxis",h);const u=k.getAttribute("normal");void 0!==u&&s.setAttribute("normal",u);const d=k.getAttribute("uv");void 0!==d&&s.setAttribute("uv",d),s.setIndex(M.getBufferAttribute(M.info.edgeIndex));const m=U,f=this.getPolygonFadingParams(S,m),g={color:f.color,colorMix:f.colorMix,fadeNear:f.lineFadeNear,fadeFar:f.lineFadeFar,extrusionRatio:N?0:void 0,vertexColors:!!k.getAttribute("color"),rendererCapabilities:v.renderer.capabilities},y=new o.EdgeMaterial(g),_=new n.LineSegments(s,t?[y]:y);_.renderOrder=H.renderOrder+.1,o.FadingFeature.addRenderHelper(_,A,f.lineFadeNear,f.lineFadeFar,!1),N&&T(_.material,b),this.addUserData(e,L,_,{technique:U,pickability:a.Pickability.transient}),p.MapMaterialAdapter.create(y,{color:i.lineColor,objectColor:i.color,opacity:i.opacity,lineWidth:e=>{const t=(0,r.getPropertyValue)(i.lineWidth,e.env);return"number"==typeof t?n.MathUtils.clamp(t,0,1):0}}),E.push(_)}if((0,a.isExtrudedPolygonTechnique)(U)&&N&&(H.customDepthMaterial=new o.MapMeshDepthMaterial({depthPacking:n.RGBADepthPacking}),T(H.customDepthMaterial,b)),(0,a.isPolygonTechnique)(U)&&M.info.edgeIndex){const t=l.Expr.isExpr(U.enabled)&&L.edgeFeatureStarts&&L.edgeFeatureStarts.length>0,i=new n.BufferGeometry;i.setAttribute("position",k.getAttribute("position")),i.setIndex(M.getBufferAttribute(M.info.edgeIndex));const r=U,s=this.getPolygonFadingParams(v.env,r),a={color:s.color,colorMix:s.colorMix,fadeNear:s.lineFadeNear,fadeFar:s.lineFadeFar,vertexColors:!!k.getAttribute("color"),rendererCapabilities:v.renderer.capabilities},c=new o.EdgeMaterial(a),h=new n.LineSegments(i,t?[c]:c);h.renderOrder=H.renderOrder+.1,o.FadingFeature.addRenderHelper(h,A,s.lineFadeNear,s.lineFadeFar,!1),this.addUserData(e,L,h,{technique:U,pickability:W}),p.MapMaterialAdapter.create(c,{color:r.lineColor,objectColor:r.color,opacity:r.opacity}),E.push(h)}}}return b.length>0&&v.animatedExtrusionHandler.add(e,b),Promise.all(P).then()}addIconTexts(e,t){void 0!==t.iconTextGeometries&&e.mapView.imageRepo.iconTextManager.addIconTexts(e,t)}*getAttachments(e){const t=new b;for(const i of e.geometries){const e={index:i.index,edgeIndex:i.edgeIndex,uuid:i.uuid,groups:i.groups};if(yield new M(i,e,t),i.attachments)for(const e of i.attachments)yield new M(i,e,t)}}setupTerrainMaterial(e,t,i){if(!e.map||!e.displacementMap){const e=t;return e.color.set(i),void(0,o.setDisplacementMapToMaterial)(null,e)}t.onBeforeCompile=e=>{e.fragmentShader=e.fragmentShader.replace("#include <map_pars_fragment>","#include <map_pars_fragment>\n uniform sampler2D displacementMap;\n uniform float displacementScale;\n uniform float displacementBias;"),e.fragmentShader=e.fragmentShader.replace("#include <map_fragment>",`#ifdef USE_MAP\n float minElevation = ${s.EarthConstants.MIN_ELEVATION.toFixed(1)};\n float maxElevation = ${s.EarthConstants.MAX_ELEVATION.toFixed(1)};\n float elevationRange = maxElevation - minElevation;\n\n float disp = texture2D( displacementMap, vUv ).x * displacementScale + dis
950placementBias;\n vec4 texelColor = texture2D( map, vec2((disp - minElevation) / elevationRange, 0.0) );\n texelColor = mapTexelToLinear( texelColor );\n diffuseColor *= texelColor;\n#endif`),e.vertexShader=e.vertexShader.replace("#include <displacementmap_vertex>","")},t.displacementMap.needsUpdate=!0}addUserData(e,t,i,r){const s=r.technique;if((0,a.isTerrainTechnique)(s)){(0,c.assert)(0===Object.keys(i.userData).length,"Unexpected user data in terrain object"),(0,c.assert)("object"==typeof t.objInfos[0],"Wrong attribute map type for terrain geometry");const r=t.objInfos[0],s={tileKey:e.tileKey,texture:new n.DataTexture(r.buffer,r.xCountVertices,r.yCountVertices,n.LuminanceFormat,n.FloatType),displacementMap:r,geoBox:e.geoBox};i.userData=s}else{const n="LineSegments"===i.type&&((0,a.isExtrudedPolygonTechnique)(s)||(0,a.isPolygonTechnique)(s)),o={geometryType:t.type,starts:n?t.edgeFeatureStarts:t.featureStarts,objInfos:t.objInfos};void 0===i.userData&&(i.userData={}),i.userData.feature=o,(0,v.registerTileObject)(e,i,Object.assign({tileKey:e.tileKey,dataSource:e.dataSource},r))}}getFadingParams(e,t){return{fadeNear:void 0!==t.fadeNear?(0,r.getPropertyValue)(t.fadeNear,e):o.FadingFeature.DEFAULT_FADE_NEAR,fadeFar:void 0!==t.fadeFar?(0,r.getPropertyValue)(t.fadeFar,e):o.FadingFeature.DEFAULT_FADE_FAR}}getPolygonFadingParams(e,t){let i,n=o.EdgeMaterial.DEFAULT_COLOR_MIX;if(void 0!==t.lineColor&&(i=(0,r.getPropertyValue)(t.lineColor,e),(0,a.isExtrudedPolygonTechnique)(t))){const e=t;n=void 0!==e.lineColorMix?e.lineColorMix:o.EdgeMaterial.DEFAULT_COLOR_MIX}const s=void 0!==t.fadeNear?(0,r.getPropertyValue)(t.fadeNear,e):o.FadingFeature.DEFAULT_FADE_NEAR,l=void 0!==t.fadeFar?(0,r.getPropertyValue)(t.fadeFar,e):o.FadingFeature.DEFAULT_FADE_FAR,c=void 0!==t.lineFadeNear?(0,r.getPropertyValue)(t.lineFadeNear,e):s,h=void 0!==t.lineFadeFar?(0,r.getPropertyValue)(t.lineFadeFar,e):l;return void 0===i&&(i=o.EdgeMaterial.DEFAULT_COLOR),{color:i,colorMix:n,fadeNear:s,fadeFar:l,lineFadeNear:c,lineFadeFar:h}}}t.TileGeometryCreator=S},1335:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TileGeometryLoader=t.TileGeometryLoaderState=void 0;const n=i(4342),r=i(3977),s=i(8015),o=i(5912);function a(e){const t=s.PerformanceStatistics.instance;if(t.enabled){const i=e.dataSource.name,n=e.tileKey.level,r=e.tileKey.column,s=e.tileKey.row,o=e.disposed?"disposed":"invisible";t.currentFrame.addMessage(`Decoded tile: ${i} # lvl=${n} col=${r} row=${s} DISCARDED - ${o}`)}}var l;!function(e){e[e.Initialized=0]="Initialized",e[e.CreationQueued=1]="CreationQueued",e[e.CreatingGeometry=2]="CreatingGeometry",e[e.Finished=3]="Finished",e[e.Canceled=4]="Canceled",e[e.Disposed=5]="Disposed"}(l=t.TileGeometryLoaderState||(t.TileGeometryLoaderState={})),t.TileGeometryLoader=class{constructor(e,t){this.m_tile=e,this.m_taskQueue=t,this.m_priority=0,this.m_state=l.Initialized,this.m_finishedPromise=new Promise(((e,t)=>{this.m_resolveFinishedPromise=e,this.m_rejectFinishedPromise=t}))}set priority(e){this.m_priority=e}getPriority(){return this.m_priority}get tile(){return this.m_tile}get hasDecodedTile(){return void 0!==this.m_decodedTile}get isFinished(){return this.m_state===l.Finished}get isSettled(){return this.isFinished||this.isCanceled||this.isDisposed}waitFinished(){return this.m_finishedPromise}setDecodedTile(e){return this.m_decodedTile=e,this.m_decodedTile}update(){const e=this.tile;this.m_state!==l.Initialized&&this.m_state!==l.Canceled||void 0===e.decodedTile||(this.m_state===l.Initialized&&(o.TileGeometryCreator.instance.processTechniques(e),this.setDecodedTile(e.decodedTile)),this.queueGeometryCreation())}cancel(){var e;a(this.tile),this.m_state=l.Canceled,null===(e=this.m_rejectFinishedPromise)||void 0===e||e.call(this)}dispose(){var e;a(this.tile),this.clear(),this.m_state=l.Disposed,null===(e=this.m_rejectFinishedPromise)||void 0===e||e.call(this)}reset(){this.clear(),this.isSettled&&(this.m_finishedPromise=new Promise(((e,t)=>{this.m_resolveFinishedPromise=e,this.m_rejectFinishedPromise=t}))),this.m_state=l.Initialized}finish(){var e;this.m_decodedTile=void 0,this.m_state=l.Finished,null===(e=this.m_resolveFinishedProm
950ise)||void 0===e||e.call(this)}clear(){this.m_decodedTile=void 0}queueGeometryCreation(){this.m_state!==l.CreationQueued&&(this.m_taskQueue.add({execute:this.createGeometry.bind(this),group:r.TileTaskGroups.CREATE,getPriority:this.getPriority.bind(this),isExpired:()=>this.m_state!==l.CreationQueued,estimatedProcessTime:()=>{var e,t;return(null!==(t=null===(e=this.tile.decodedTile)||void 0===e?void 0:e.decodeTime)&&void 0!==t?t:30)/6}}),this.m_state=l.CreationQueued)}async createGeometry(){if(this.m_state===l.CreatingGeometry)return;this.m_state=l.CreatingGeometry;const e=this.tile,t=this.m_decodedTile;if(void 0===t)return void this.finish();const i=s.PerformanceStatistics.instance;let r=0;i.enabled&&(r=n.PerformanceTimer.now());const a=o.TileGeometryCreator.instance;e.clear(),a.initDecodedTile(t),await a.createAllGeometries(e,t),i.enabled&&this.addStats(i,r),this.finish(),e.dataSource.requestUpdate()}addStats(e,t){const i=this.tile,r=this.m_decodedTile;if(void 0===r)return;const s=n.PerformanceTimer.now()-t,o=e.currentFrame;o.addValue("render.fullFrameTime",s),o.addValue("render.geometryCreationTime",s),o.addValue("geometry.geometryCreationTime",s),o.addValue("geometryCount.numGeometries",r.geometries.length),o.addValue("geometryCount.numTechniques",r.techniques.length),o.addValue("geometryCount.numIconTextGeometries",void 0!==r.iconTextGeometries?r.iconTextGeometries.length:0),o.addValue("geometryCount.numTextGeometries",void 0!==r.textGeometries?r.textGeometries.length:0),o.addValue("geometryCount.numTextPathGeometries",void 0!==r.textPathGeometries?r.textPathGeometries.length:0),o.addValue("geometryCount.numPathGeometries",void 0!==r.pathGeometries?r.pathGeometries.length:0),o.addMessage(`Decoded tile: ${i.dataSource.name} # lvl=${i.tileKey.level} col=${i.tileKey.column} row=${i.tileKey.row}`)}get isCanceled(){return this.m_state===l.Canceled}get isDisposed(){return this.m_state===l.Disposed}}},3801:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TileGeometryManager=void 0,t.TileGeometryManager=class{get visibilityCounter(){return this.m_visibilityCounter}constructor(e){this.mapView=e,this.m_visibilityCounter=1}updateTiles(e){let t=0;for(const i of e){const e=t++;
950i.updateGeometry(e)&&this.m_tileUpdateCallback&&this.m_tileUpdateCallback(i)}}clear(){}setTileUpdateCallback(e){this.m_tileUpdateCallback=e}incrementVisibilityCounter(){return++this.m_visibilityCounter}}},8813:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VertexCache=void 0;const n=i(4342);var r;!function(e){e[e.VertexId=0]="VertexId",e[e.OlderIdx=1]="OlderIdx",e[e.NewerIdx=2]="NewerIdx",e[e.X=3]="X",e[e.Y=4]="Y",e[e.Z=5]="Z",e[e.Count=6]="Count"}(r||(r={}));const s=-1;t.VertexCache=class{constructor(e){this.maxVertexCount=e,this.m_cache=[],this.m_vertexCount=0,this.m_oldestIdx=0,this.m_newestIdx=0,this.m_cache.length=this.maxVertexCount*r.Count,this.clear()}clear(){this.m_cache.fill(s),this.m_vertexCount=0}get(e,t){const i=this.find(e);return void 0!==i&&(this.promoteEntry(i),this.getVertex(i,t),!0)}set(e,t){let i=s;this.m_vertexCount<this.maxVertexCount?(i=this.m_vertexCount*r.Count,this.m_vertexCount++):i=this.m_oldestIdx,1===this.m_vertexCount?this.m_oldestIdx=this.m_newestIdx=i:this.promoteEntry(i),this.setVertex(i,e,t)}find(e){const t=this.m_cache.length;for(let i=0;i<t;i+=r.Count)if(this.m_cache[i]===e)return i}promoteEntry(e){if(e===this.m_newestIdx)return;const t=this.getNewerIdx(e),i=this.getOlderIdx(e);t!==s&&((0,n.assert)(this.getOlderIdx(t)===e),this.setOlderIdx(t,i)),i!==s&&((0,n.assert)(this.getNewerIdx(i)===e),this.setNewerIdx(i,t)),e===this.m_oldestIdx&&
950(this.m_oldestIdx=t),this.setNewerIdx(e,s),this.setOlderIdx(e,this.m_newestIdx),(0,n.assert)(this.m_newestIdx!==s),(0,n.assert)(this.getNewerIdx(this.m_newestIdx)===s),this.setNewerIdx(this.m_newestIdx,e),this.m_newestIdx=e}getOlderIdx(e){return this.m_cache[e+r.OlderIdx]}setOlderIdx(e,t){this.m_cache[e+r.OlderIdx]=t}getNewerIdx(e){return this.m_cache[e+r.NewerIdx]}setNewerIdx(e,t){this.m_cache[e+r.NewerIdx]=t}getVertex(e,t){t.x=this.m_cache[e+r.X],t.y=this.m_cache[e+r.Y],t.z=this.m_cache[e+r.Z]}setVertex(e,t,i){this.m_cache[e]=t,this.m_cache[e+r.X]=i.x,this.m_cache[e+r.Y]=i.y,this.m_cache[e+r.Z]=i.z}}},9587:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.overlayOnElevation=t.overlayIconText=void 0;const n=i(4250),r=i(1984),s=i(4342),o=i(4572);function a(e,t){if(!("material"in e))return;const i=n.setDisplacementMapToMaterial.bind(null,t),r=e.material;Array.isArray(r)?r.forEach(i):r&&i(r)}function l(e,t,i,n){const r=n.unprojectPoint(e);if(i.geoBox.contains(r))r.altitude=t.sampleHeight(r,i);else if(r.altitude=t.getHeight(r,i.tileKey.level),void 0===r.altitude)return!1;return n.projectPoint(r,e),!0}t.overlayIconText=function(e,t,i,n){(0,s.assert)(!e.elevated),i&&(e.elevated=e.path?function(e,t,i,n){for(const r of e)if(!l(r,t,i,n))return!1;return!0}(e.path,t,i,n):l(e.position,t,i,n))},t.overlayOnElevation=function(e){const t=e.mapView.elevationProvider;if(void 0===t||0===e.objects.length)return;const i=e.objects[0],n=o.MapObjectAdapter.get(i);if(!i.userData||!(null==n?void 0:n.technique)||(0,r.isTerrainTechnique)(null==n?void 0:n.technique))return;const s=t.getDisplacementMap(e.tileKey);if(void 0!==s)for(const t of e.objects)a(t,s.texture)}},2967:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IconText=t.IconCompositionType=t.LoadingState=void 0;const n=i(5823),r=i(2002);var s,o;(o=t.LoadingState||(t.LoadingState={}))[o.Requested=0]="Requested",o[o.Loaded=1]="Loaded",o[o.Initialized=2]="Initialized",(s=t.IconCompositionType||(t.IconCompositionType={}))[s.OVERLAID=0]="OVERLAID",s[s.NEXT_TO_EACH_OTHER=1]="NEXT_TO_EACH_OTHER";class a{constructor(e,t,i,r,s=0,o=0,a=0,l=0,c,h,u,d,m,p,f,g){this.text=e,this.points=t,this.renderParams=i,this.layoutParams=r,this.priority=s,this.zOrder=o,this.xOffset=a,this.yOffset=l,this.featureId=c,this.style=h,this.fadeNear=u,this.fadeFar=d,this.tileOffset=m,this.offsetDirection=p,this.dataSourceName=f,this.dataSourceOrder=g,this.visible=!0,this.distanceScale=.5,this.renderOrder=0,this.elevated=!1,i instanceof n.TextRenderStyle&&(this.renderStyle=i),r instanceof n.TextLayoutStyle&&(this.layoutStyle=r),this.setType()}setType(){this.type=void 0===this.path?r.IconTextType.PointIconText:this.m_iconsInfo?r.IconTextType.LineMarker:r.IconTextType.PathLabel}get position(){return this.points instanceof Array?this.points[0]:this.points}get path(){return this.points instanceof Array?this.points:void 0}get textMayOverlap(){return!0===this.mayOverlap}set textMayOverlap(e){this.mayOverlap=e}get textReservesSpace(){return!1!==this.reserveSpace}set textReservesSpace(e){this.reserveSpace=e}get iconInfoList(){return this.m_iconsInfo}set iconInfoList(e){if(void 0!==e&&e.length>0){this.m_iconsInfo=e;const t=void 0!==this.renderOrder?this.renderOrder:0;e.forEach((e=>e.renderOrder=t))}else this.m_iconsInfo=void 0;this.setType()}get renderStyle(){return this.m_renderStyle}set renderStyle(e){this.m_renderStyle=e}get layoutStyle(){return this.m_layoutStyle}set layoutStyle(e){this.m_layoutStyle=e}hasFeatureId(){return!!this.featureId}dispose(){var e,t,i;null===(e=this.iconInfoList)||void 0===e||e.forEach((e=>{var t;return null===(t=e.buffer)||void 0===t?void 0:t.decreaseRefCount()})),null===(i=null===(t=this.textBackgroundInfo)||void 0===t?void 0:t.buffer)||void 0===i||i.decreaseRefCount()}}t.IconText=a,a.HIGHEST_PRIORITY=Number.MAX_SAFE_INTEGER,a.HIGHEST_Z_ORDER=Number.MAX_SAFE_INTEGER},5316:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IconTextBuilder=void 0;const n=i(8152),r=i(5823),s=i(1984),o=i(4342),a=i(2967),l=i(304),c=i(3174),h=o.LoggerManager.instance.create("IconTextBuilder");class u{static composeRenderOrder(e,t){return e*u.RENDER_ORDER_UP_BOUND+t}constructor(e,t,i){if(this.m_env=e,this.m_styleCache=t,this.m_baseRenderOrder=i,this.m_distanceScale=l.DEFAULT_TEXT_DISTANCE_SCALE,this.m_renderOrder=i,Number.isInteger(i))this.renderOrderUpBound=u.RENDER_ORDER_UP_BOUND;else{const e=Math.abs(i);this.renderOrderUpBound=(e-Math.floor(e))*u.RENDER_ORDER_UP_BOUND}this.isValidRenderOrder(i)||h.warn(`Large base render order (${i}) might cause precision issues.`)}withTechnique(e){var t,i,r,a,c;this.m_technique=e,this.m_priority=null!==(t=(0,n.getPropertyValue)(e.priority,this.m_env))&&void 0!==t?t:0,this.m_fadeNear=null!==(i=(0,n.getPropertyValue)(e.fadeNear,this.m_env))&&void 0!==i?i:void 0,this.m_fadeFar=null!==(r=(0,n.getPropertyValue)(e.fadeFar,this.m_env))&&void 0!==r?r:void 0,this.m_distanceScale=null!==(a=e.distanceScale)&&void 0!==a?a:l.DEFAULT_TEXT_DISTANCE_SCALE,this.m_renderStyle=this.m_styleCache.getRenderStyle(e),this.m_layoutStyle=this.m_styleCache.getLayoutStyle(e),this.m_xOffset=(0,n.getPropertyValue)(e.xOffset,this.m_env),this.m_yOffset=(0,n.getPropertyValue)(e.yOffset,this.m_env),this.m_zOrder=(0,n.getPropertyValue)(e.zOrder,this.m_env);const d=null!==(c=(0,n.getPropertyValue)(e.renderOrder,this.m_env))&&void 0!==c?c:0;if(!this.isValidRenderOrder(d)){const e=`Unsupported large render order (${d})`;h.error(e),(0,o.assert)(!1,e)}return this.m_renderOrder=u.composeRenderOrder(this.m_baseRenderOrder,d),(0,s.isTextTechnique)(e)?this.withTextTechnique(e):this.withIconTextTechnique(e),this}withIcon(e,t){return(0,o.assert)(void 0!==this.m_iconInfoBuilder),this.m_iconInfoBuilder.withIcon(e),this.m_shieldGroupIndex=t,this}
950withTextBackgroundImage(e){return this.m_textBackgroundImageTextureName=e,this}build(e,t,i,s,l,c,h,u){var d,m;const p=(0,n.getFeatureId)(c);(0,o.assert)(void 0!==this.m_technique),(0,o.assert)(void 0!==this.m_renderStyle),(0,o.assert)(void 0!==this.m_layoutStyle);const f=this.m_technique,g=this.m_renderStyle,v=this.m_layoutStyle,y=new a.IconText(r.ContextualArabicConverter.instance.convert(e),t,g,v,this.m_priority,this.m_zOrder,this.m_xOffset,this.m_yOffset,p,f.style,this.m_fadeNear,this.m_fadeFar,i,u,s,l);if(y.textMinZoomLevel=this.m_textMinZoomLevel,y.textMaxZoomLevel=this.m_textMaxZoomLevel,y.iconMinZoomLevel=this.m_iconMinZoomLevel,y.iconMaxZoomLevel=this.m_iconMaxZoomLevel,y.textBrightness=this.m_textBrightness,y.distanceScale=this.m_distanceScale,y.mayOverlap=this.m_mayOverlap,y.reserveSpace=this.m_reserveSpace,y.userData=c,y.technique=this.m_technique,y.textFadeTime=void 0!==f.textFadeTime?1e3*f.textFadeTime:void 0,y.pathLengthSqr=h,y.alwaysOnTop=this.m_alwaysOnTop,y.renderOrder=this.m_renderOrder,y.textIsOptional=this.m_textIsOptional,y.iconIsOptional=this.m_iconIsOptional,y.iconCompositionType=this.m_iconCompositionType,y.shieldGroupIndex=this.m_shieldGroupIndex,this.m_textBackgroundImageTextureName){const e=f;y.textBackgroundInfo={technique:e,imageTextureName:this.m_textBackgroundImageTextureName,iconText:y,reserveSpace:e.textReserveSpace,renderOrder:null!==(d=y.renderOrder)&&void 0!==d?d:0}}return y.iconInfoList=null===(m=this.m_iconInfoBuilder)||void 0===m?void 0:m.build(y),y}withTextTechnique(e){var t,i;this.m_mayOverlap=!0===e.mayOverlap,this.m_reserveSpace=!1!==e.reserveSpace,this.m_iconInfoBuilder=void 0,this.m_textBackgroundImageTextureName=void 0,this.m_iconIsOptional=void 0,this.m_iconCompositionType=void 0,this.m_shieldGroupIndex=void 0,this.m_textMinZoomLevel=null!==(t=(0,n.getPropertyValue)(e.minZoomLevel,this.m_env))&&void 0!==t?t:void 0,this.m_textMaxZoomLevel=null!==(i=(0,n.getPropertyValue)(e.maxZoomLevel,this.m_env))&&void 0!==i?i:void 0}withIconTextTechnique(e){var t,i,r,s,l,h,u,d,m;this.m_mayOverlap=!0===e.textMayOverlap,this.m_reserveSpace=!1!==e.textReserveSpace,this.m_alwaysOnTop=!0===e.alwaysOnTop,this.m_textIsOptional=!0===e.textIsOptional,this.m_iconIsOptional=!0===e.iconIsOptional,this.m_iconCompositionType="nextToEachOther"===e["icon-composition-type"]?a.IconCompositionType.NEXT_TO_EACH_OTHER:a.IconCompositionType.OVERLAID,this.m_textMinZoomLevel=null!==(i=(0,n.getPropertyValue)(null!==(t=e.textMinZoomLevel)&&void 0!==t?t:e.minZoomLevel,this.m_env))&&void 0!==i?i:void 0,this.m_textBrightness=null!==(r=o.MathUtils.clamp((0,n.getPropertyValue)(e.textBrightness,this.m_env),0,1))&&void 0!==r?r:1,this.m_textMaxZoomLevel=null!==(l=(0,n.getPropertyValue)(null!==(s=e.textMaxZoomLevel)&&void 0!==s?s:e.maxZoomLevel,this.m_env))&&void 0!==l?l:void 0,this.m_iconMinZoomLevel=null!==(u=(0,n.getPropertyValue)(null!==(h=e.iconMinZoomLevel)&&void 0!==h?h:e.minZoomLevel,this.m_env))&&void 0!==u?u:void 0,this.m_iconMaxZoomLevel=null!==(m=(0,n.getPropertyValue)(null!==(d=e.iconMaxZoomLevel)&&void 0!==d?d:e.maxZoomLevel,this.m_env))&&void 0!==m?m:void 0,this.m_iconInfoBuilder||(this.m_iconInfoBuilder=new c.IconInfoBuilder(this.m_env)),this.m_iconInfoBuilder.withTechnique(e)}isValidRenderOrder(e){return Math.abs(e)<this.renderOrderUpBound}}t.IconTextBuilder=u,u.RENDER_ORDER_UP_BOUND=1e7},9473:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IconTextGroup=void 0;const n=i(4342);class r extends n.PriorityListGroup{static comparePlacementPriority(e,t){return t.priority-e.priority||t.zOrder-e.zOrder}}t.IconTextGroup=r},7013:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IconTextGroupPriorityList=void 0;const n=i(4342);class r extends n.GroupedPriorityList{}t.IconTextGroupPriorityList=r},950:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IconTextGroupState=void 0;const n=i(4342),r=i(3981),s=i(2002);t.IconTextGroupState=class{constructor(e,t,i){this.group=e,this.tileKey=t,this.m_visited=!1,(0,n.assert)(e.elements.length>0);const o=e.elements.length;this.m_iconTextStates=[],this.m_visited=!0;for(let t=0;t<o;++t){const n=e.elements[t];if(n.type===s.IconTextType.LineMarker&&void 0!==n.path){const e=n.path.length;for(let t=0;t<e;t++){const e=new r.IconTextState(n,t),s=i(e);e.update(s),this.m_iconTextStates.push(e)}}else{const e=new r.IconTextState(n),t=i(e);e.update(t),this.m_iconTextStates.push(e)}}}get visited(){return this.m_visited}set visited(e){this.m_visited=e}get priority(){return this.group.priority}get zOrder(){return this.group.zOrder}updateFading(e,t){for(const i of this.m_iconTextStates)void 0!==i&&i.updateFading(e,t)}traverseVisibleIconTexts(e){for(const t of this.m_iconTextStates)void 0!==t&&t.visible&&e(t)}updateIconTexts(e){for(const t of this.m_iconTextStates){const i=e(t);t.update(i)}}get size(){return this.m_iconTextStates.length}get iconTextStates(){return this.m_iconTextStates}}},5738:(e,t,i)=>{"use strict";
950Object.defineProperty(t,"__esModule",{value:!0}),t.IconTextManager=void 0;const n=i(82),r=i(1984),s=i(4342),o=i(5316),a=s.LoggerManager.instance.create("IconTextManager");function l(e,t=0){if(e.imageTextures){const i=e.imageTextures[t];if(i>=0)return e.stringCatalog[i]}}function c(e,t=0){if(e.textBackgroundImageTextures){const i=e.textBackgroundImageTextures[t];if(i>=0)return e.stringCatalog[i]}}function h(e,t=0){return e.objInfos?e.objInfos[t]:void 0}function u(e,t,i=0){const r=(new n.Vector3).fromBufferAttribute(e,i);return r.x+=t,r}function d(e,t=0){var i;(0,s.assert)(e.texts.length>t);const n=e.texts[t];return(0,s.assert)(e.stringCatalog.length>n),null!==(i=e.stringCatalog[n])&&void 0!==i?i:""}t.IconTextManager=class{constructor(){this.m_imageTextures=new Map,this.m_roadShieldGroups=new Map}addIconTexts(e,t){const i=(0,s.assertExists)(t.iconTextGeometries),a=e.computeWorldOffsetX(),l=e.mapView,c=Math.floor(l.zoomLevel),h=new r.MapEnv({$zoom:c},l.env),u=new o.IconTextBuilder(h,e.textStyleCache,e.dataSource.dataSourceOrder);for(const o of i){(0,s.assert)(void 0!==o.technique);const i=(0,s.assertExists)(o.technique),l=t.techniques[i];if(!(0,r.isLineMarkerTechnique)(l)&&!(0,r.isIconTextTechnique)(l))continue;if(!1===l.showOnMap)continue;const c=new n.BufferAttribute(new Float64Array(o.positions.buffer),o.positions.itemCount);u.withTechnique(l),(0,r.isLineMarkerTechnique)(l)&&c.count>0?this.addLineMarker(u,e,o,c,a):(0,r.isIconTextTechnique)(l)&&this.addIconText(u,e,o,c,a)}}async addTextureAtlas(e,t,i){const n=await fetch(t,{signal:i});if(!n.ok)throw new Error(`addTextureAtlas: Cannot load textureAtlas: ${n.statusText}`);const r=await n.json();for(const t of Object.getOwnPropertyNames(r)){const i=r[t],n={name:t,image:e,xOffset:i.x,yOffset:i.y,width:i.width,height:i.height};this.addImageTexture(n)}}addImageTexture(e){void 0!==e.name?(void 0!==this.m_imageTextures.get(e.name)&&a.warn(`addImageTexture: Name already used: ${e.name} (overriding it)`),this.m_imageTextures.set(e.name,e)):a.error("addImageTexture: Name required",e)}getImageTexture(e){return this.m_imageTextures.get(e)}clear(){this.m_imageTextures.clear(),this.m_roadShieldGroups.clear()}addLineMarker(e,t,i,n,r){const s=d(i),o=l(i),a=o+"-"+s;let c=this.m_roadShieldGroups.get(a);void 0===c&&(c=this.m_roadShieldGroups.size,this.m_roadShieldGroups.set(a,c));const m=[];for(let e=0;e<n.count;++e)m.push(u(n,r,e));const p=e.withIcon(o,c).build(s,m,t.offset,t.dataSource.name,t.dataSource.dataSourceOrder,h(i));t.addIconText(p)}addIconText(e,t,i,n,r){var s,o;for(let a=0;a<n.count;++a){const m=null!==(o=null===(s=i.offsetDirections)||void 0===s?void 0:s[a])&&void 0!==o?o:0;e.withIcon(l(i,a)),e.withTextBackgroundImage(c(i,a));const p=e.build(d(i,a),u(n,r,a),t.offset,t.dataSource.name,t.dataSource.dataSourceOrder,h(i,a),void 0,m);t.addIconText(p)}}}},304:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IconTextRenderer=t.DEFAULT_TEXT_DISTANCE_SCALE=t.DEFAULT_FONT_CATALOG_NAME=void 0;const n=i(82),r=i(5823),s=i(4342),o=i(507),a=i(9587),l=i(7362),c=i(2967),h=i(9473),u=i(8950),d=i(791),m=i(2002),p=i(5570),f=i(9913),g=(i(7234),i(4957)),v=i(9463),y=i(3800);var _;i(859),function(e){e[e.PersistentLabels=0]="PersistentLabels",e[e.NewLabels=1]="NewLabels"}(_||(_={})),t.DEFAULT_FONT_CATALOG_NAME="default",t.DEFAULT_TEXT_DISTANCE_SCALE=.5;const x=s.LoggerManager.instance.create("IconTextRenderer",{level:s.LogLevel.Log}),b=new n.Vector3,w=new n.Vector2,M=new n.Vector2,T=[],S={},E={},A={},C=new n.Color,P=new n.Color,L={vector2:[new n.Vector2]};function R(e,t,i,n,r){E.path=n,E.pathOverflow=r,E.layer=e.renderOrder,E.letterCaseArray=e.glyphCaseArray,E.pickingData=e.userData?e:void 0,t.addText(e.glyphs,i,E)}function D(e){return void 0!==e&&(s.PerformanceTimer.now()-e>10&&(x.debug("Placement time limit exceeded."),!0))}t.IconTextRenderer=class{constructor(e,t,i,r,s,o,a,c){this.m_viewState=e,this.m_screenProjector=t,this.m_imageRepo=i,this.m_textureCache=r,this.m_renderer=s,this.m_loadPromisesCount=0,this.m_textCanvases=new Map,this.m_fontCatalogUrls=new Map,this.m_tmpVector=new n.Vector2,this.m_tmpVector3=new n.Vector3,this.m_cameraLookAt=new n.Vector3,this.m_overloaded=!1,this.m_cacheInvalidated=!1,this.m_addNewLabels=!0,this.m_forceNewLabelsPass=!1,this.m_iconTextStateCache=new d.IconTextStateCache,this.m_camera=new n.Orthogra
950phicCamera(-1,1,1,-1),this.m_textStyleCache=new y.TextStyleCache,this.m_screenCollisions=new l.ScreenCollisions,this.m_isUpdatePending=!1,this.m_options=Object.assign({},o),(0,u.initializeDefaultOptions)(this.m_options),this.m_maxFarDistanceRatio=Math.max(this.m_options.maxDistanceRatioForText,this.m_options.maxDistanceRatioForIconText),this.m_textCanvasFactory=null!=a?a:new v.TextCanvasFactory(this.m_renderer),this.m_textCanvasFactory.setGlyphCountLimits(this.m_options.minNumGlyphs,this.m_options.maxNumGlyphs),this.m_imageRenderer=null!=c?c:new p.ImageRenderer(this.m_renderer,this.m_imageRepo,this.m_textureCache),this.initializeCamera(),this.updateFontCatalogs()}set screenCollisions(e){this.m_screenCollisions=e}get screenCollisions(){return this.m_screenCollisions}set disableFading(e){this.m_options.disableFading=e}get disableFading(){return!0===this.m_options.disableFading}get styleCache(){return this.m_textStyleCache}get delayLabelsUntilMovementFinished(){return!0===this.m_options.delayLabelsUntilMovementFinished}set delayLabelsUntilMovementFinished(e){this.m_options.delayLabelsUntilMovementFinished=e}get showReplacementGlyphs(){return!0===this.m_options.showReplacementGlyphs}set showReplacementGlyphs(e){this.m_options.showReplacementGlyphs=e,this.m_textCanvases.forEach((t=>{t.fontCatalog.showReplacementGlyphs=e}))}restoreRenderers(e){this.m_renderer=e,this.m_imageRenderer=new p.ImageRenderer(this.m_renderer,this.m_imageRepo,this.m_textureCache)}async updateFontCatalogs(e,i){e=null!=e?e:[];const n=this.m_options.fontCatalog;if(n&&-1===e.findIndex((e=>e.name===t.DEFAULT_FONT_CATALOG_NAME))&&e.push({name:t.DEFAULT_FONT_CATALOG_NAME,url:n}),e.length>0){for(const[t]of this.m_textCanvases)e.findIndex((e=>e.name===t))<0&&(this.m_fontCatalogUrls.delete(t),this.m_textCanvases.delete(t));await Promise.all(e.map((e=>this.addTextCanvas(e,i))))}else this.m_textCanvases.clear(),this.m_fontCatalogUrls.clear();this.m_textStyleCache.updateTextCanvases(this.m_textCanvases)}async setTheme(e,t){return this.invalidateCache(),this.m_textStyleCache.updateTextStyles(e.textStyles,e.defaultTextStyle),await this.updateFontCatalogs(e.fontCatalogs,t)}renderText(e){let t;this.m_camera.far=e,this.updateGlyphDebugMesh(),this.m_imageRenderer.update(
950);for(const e of this.m_imageRenderer.layers){for(const[,i]of this.m_textCanvases)i.render(this.m_camera,null==t?void 0:t.id,e.id,void 0,!1);this.m_imageRenderer.render(this.m_camera,e),t=e}for(const[,e]of this.m_textCanvases)e.render(this.m_camera,null==t?void 0:t.id,void 0,void 0,!1)}invalidateCache(){this.m_cacheInvalidated=!0}movementStarted(){this.delayLabelsUntilMovementFinished&&(this.m_addNewLabels=!1)}movementFinished(){this.invalidateCache(),this.delayLabelsUntilMovementFinished&&(this.m_addNewLabels=!0)}get overloaded(){return this.m_overloaded}placeText(e,t){const i=function(e){let t=!1;return e.forEach((({renderedTiles:e})=>{e.forEach((e=>{e.iconTextsChanged&&(e.iconTextsChanged=!1,t=!0)}))})),t}(e),n=this.hasOverlayText()||i||function(e){for(let t=0;t<e.length;t++)for(const[i,n]of e[t].renderedTiles)if(n.hasIconTexts())return!0;return!1}(e);if(this.m_isUpdatePending=!1,!n&&!this.m_cacheInvalidated&&!this.m_viewState.renderedTilesChanged)return;const r=this.m_cacheInvalidated||i||this.m_viewState.renderedTilesChanged,s=r&&this.m_addNewLabels;s&&(this.m_iconTextStateCache.clearVisited(),this.updateIconTexts(e));const o=this.m_iconTextStateCache.update(t,this.m_options.disableFading,s,this.m_viewState.zoomLevel);this.reset(),this.m_addNewLabels&&this.prepopulateScreenWithBlockingElements(e);const a=(r||o)&&this.m_addNewLabels;this.placeIconTexts(t,a),this.placeOverlayIconTexts()}addOverlayText(e){0!==e.length&&(this.m_overlayIconTexts=void 0===this.m_overlayIconTexts?e.slice():this.m_overlayIconTexts.concat(e))}clearOverlayText(){this.m_overlayIconTexts=[]}hasOverlayText(){return void 0!==this.m_overlayIconTexts&&this.m_overlayIconTexts.length>0}get overlayText(){return this.m_overlayIconTexts}pickIconTexts(e,t){const i=new Map;for(const[,t]of this.m_textCanvases)t.pickText(e,(e=>{i.set(e,!0)}));this.m_imageRenderer.pickIconTexts(e,(e=>{i.set(e,!1)})),i.forEach(((e,i)=>{t(i,e)}))}get loading(){return this.m_loadPromisesCount>0}get isUpdatePending(){return this.m_isUpdatePending}async waitLoaded(){if(void 0!==this.m_loadPromise)return await this.m_loadPromise}clearRenderStates(){this.m_iconTextStateCache.clear()}getMemoryUsage(){const e={heapSize:0,gpuSize:0};for(const[,t]of this.m_textCanvases)t.getMemoryUsage(e);return this.m_imageRenderer.getMemoryUsage(e),e}reset(){this.m_cameraLookAt.copy(this.m_viewState.lookAtVector),this.m_screenCollisions.reset();for(const[,e]of this.m_textCanvases)e.clear();this.m_imageRenderer.reset()}prepopulateScreenWithBlockingElements(e){const t=[];e.forEach((e=>{const i=new n.Vector3,r=new n.Vector3;for(const n of e.renderedTiles.values())for(const e of n.blockingElements)if(!(e.points.length<2)){this.m_screenProjector.project3(e.points[0],i);for(let n=1;n<e.points.length;n++){this.m_screenProjector.project3(e.points[n],r);const s=e.screenSpaceLines[n-1];s.start.copy(i),s.end.copy(r);const o={minX:Math.min(i.x,r.x),maxX:Math.max(i.x,r.x),minY:Math.min(i.y,r.y),maxY:Math.max(i.y,r.y),line:s};t.push(o),i.copy(r)}}})),this.m_screenCollisions.allocateIBoxes(t)}placeIconTextGroup(e,t,i,n){var o;(0,s.assert)(e.visited);const l=[],c=this.m_viewState.projection,h=this.m_viewState.elevationProvider,u=null==h?void 0:h.getDisplacementMap(e.tileKey);for(const s of e.iconTextStates){if(n===_.PersistentLabels);else if(void 0!==i&&t.numRenderedIconTexts>=i)return x.debug("Placement label limit exceeded."),!1;if(!s.initialized)continue;if(void 0===s.viewDistance||s.viewDistance<0)continue;const e=s.visible;if(n===_.PersistentLabels&&!e||n===_.NewLabels&&e)continue;const d=s.iconText,p=this.m_textStyleCache.getTextStyle(d.style),g=p.textCanvas;if(void 0!==h&&!d.elevated){if(!u){this.m_isUpdatePending=!0,this.m_forceNewLabelsPass=!0;continue}(0,a.overlayIconText)(d,h,u,c)}const v=d.type;if(v===m.IconTextType.PathLabel&&(0,f.isPathLabelTooSmall)(d,this.m_screenProjector,T,this.m_viewState.env)){d.dbgPathTooSmall,s.reset();continue}const y=!0;if(g){if(!this.initializeGlyphs(d,p,y))continue;const e=g.getLayer(null!==(o=d.renderOrder)&&void 0!==o?o:r.DEFAULT_TEXT_CANVAS_LAYER);if(void 0!==e&&e.storage.drawCount+d.glyphs.length>
950e.storage.capacity){x.warn("layer glyph storage capacity exceeded.");continue}g.textRenderStyle=d.renderStyle,g.textLayoutStyle=d.layoutStyle}switch(v){case m.IconTextType.PointIconText:this.addPointIconText(s,g,t);break;case m.IconTextType.LineMarker:this.addLineMarkerLabel(s,l,g,t);break;case m.IconTextType.PathLabel:g&&this.addPathLabel(s,T,g,t)}}return!0}addLoadPromise(e){0===this.m_loadPromisesCount&&(this.m_loadPromise=void 0),++this.m_loadPromisesCount,this.m_loadPromise=this.m_loadPromise?Promise.all([this.m_loadPromise,e]):e}initializeGlyphs(e,t,i){if(e.loadingState===c.LoadingState.Initialized)return void 0!==e.glyphs;(0,s.assert)(void 0!==t.textCanvas);const n=t.textCanvas;if(void 0===e.loadingState)if(e.loadingState=c.LoadingState.Requested,void 0===e.renderStyle&&(e.renderStyle=new r.TextRenderStyle(Object.assign(Object.assign({},t.renderParams),e.renderParams))),void 0===e.layoutStyle&&(e.layoutStyle=new r.TextLayoutStyle(Object.assign(Object.assign({},t.layoutParams),e.layoutParams))),""===e.text)e.loadingState=c.LoadingState.Loaded;else{const t=n.fontCatalog.loadCharset(e.text,e.renderStyle).then((()=>{e.loadingState=c.LoadingState.Loaded,this.m_isUpdatePending=!0,this.m_forceNewLabelsPass=this.m_forceNewLabelsPass||i})).catch((t=>{x.info(`Error loading charset for '${e.text}' with font ${n.fontCatalog.name}`,t)})).finally((()=>{--this.m_loadPromisesCount}));this.addLoadPromise(t)}return e.loadingState===c.LoadingState.Loaded&&(n.textRenderStyle=e.renderStyle,n.textLayoutStyle=e.layoutStyle,e.glyphCaseArray=[],e.textBounds=void 0,e.glyphs=n.fontCatalog.getGlyphs(e.text,n.textRenderStyle,e.glyphCaseArray),e.loadingState=c.LoadingState.Initialized),void 0!==e.glyphs}initializeCamera(){this.m_camera.position.z=1,this.m_camera.near=0}updateCamera(){const{width:e,height:t}=this.m_renderer.getSize(L.vector2[0]);this.m_camera.left=e/-2,this.m_camera.right=e/2,this.m_camera.bottom=t/-2,this.m_camera.top=t/2,this.m_camera.updateProjectionMatrix(),this.m_camera.updateMatrixWorld(!1),this.m_screenCollisions.update(e,t)}async addTextCanvas(e,t){if(this.m_fontCatalogUrls.get(e.name)===e.url)return await Promise.resolve();this.m_fontCatalogUrls.set(e.name,e.url);const i=r.FontCatalog.load(e.url,2048,t).then((t=>{const i=e.name;if(this.m_fontCatalogUrls.get(i)===e.url){t.showReplacementGlyphs=this.showReplacementGlyphs;const e=this.m_textCanvasFactory.createTextCanvas(t,i);this.m_textCanvases.set(i,e)}})).catch((i=>{if(this.m_fontCatalogUrls.delete(e.name),null==t?void 0:t.aborted)throw i;x.info("rendering without font catalog, only icons possible",i)})).finally((()=>{--this.m_loadPromisesCount}));return this.addLoadPromise(i),i}updateGlyphDebugMesh(){const e=o.debugContext.getValue("DEBUG_GLYPHS");void 0!==e&&(e&&void 0===this.m_debugGlyphTextureCacheMesh&&this.initializeGlyphDebugMesh(),(0,s.assert)(void 0!==this.m_debugGlyphTextureCacheMesh),(0,s.assert)(void 0!==this.m_debugGlyphTextureCacheWireMesh),this.m_debugGlyphTextureCacheMesh.visible=e,this.m_debugGlyphTextureCacheWireMesh.visible=e)}initializeGlyphDebugMesh(){if(0===this.m_textCanvases.size)return;const e=this.m_textCanvases.values().next().value,t=e.fontCatalog,i=new n.PlaneGeometry(t.textureSize.width/2.5,t.textureSize.height/2.5,t.textureSize.width/t.maxWidth,t.textureSize.height/t.maxHeight),s=new n.MeshBasicMaterial({transparent:!0,depthWrite:!1,depthTest:!1,map:t.texture});this.m_debugGlyphTextureCacheMesh=new n.Mesh(i,s),this.m_debugGlyphTextureCacheMesh.renderOrder=1e4,this.m_debugGlyphTextureCacheMesh.visible=!1,this.m_debugGlyphTextureCacheMesh.name="glyphDebug";const o=new n.WireframeGeometry(i),a=new n.LineBasicMaterial({transparent:!0,color:10066329,depthWrite:!1,depthTest:!1});this.m_debugGlyphTextureCacheWireMesh=new n.LineSegments(o,a),this.m_debugGlyphTextureCacheWireMesh.renderOrder=9999,this.m_debugGlyphTextureCacheWireMesh.visible=!1,this.m_debugGlyphTextureCacheWireMesh.name="glyphDebug",e.getLayer(r.DEFAULT_TEXT_CANVAS_LAYER).storage.scene.add(this.m_debugGlyphTextureCacheMesh,this.m_debugGlyphTextureCacheWireMesh)}updateIconTexts(e){this.m_iconTextStateCache.clearTextCache(),this.m_cacheInvalidated=!1,this.checkIfOverloaded(e);const t=this.overloaded&&this.m_viewState.isDynamic?s.PerformanceTimer.now():void 0;e.forEach((e=>{this.updateIconTextsFromSource(e.dataSource,e.storageLevel,Array.from(e.renderedTiles.values()),t)}))}updateIconTextsFromSource(e,t,i,n){const r=i;r.sort(((e,t)=>
950e.tileKey.mortonCode()-t.tileKey.mortonCode()));const o=void 0!==n,a=this.gatherGroups(e,t,r,o);let l=0;const c=(0,f.getMaxViewDistance)(this.m_viewState,this.m_maxFarDistanceRatio);let u=a.length>0?a[0].group:void 0;for(const{tile:e,group:t}of a)if(this.prepareIconTextGroup(t,e.tileKey,c),o){if(0!==h.IconTextGroup.comparePlacementPriority(u,t)){if(s.PerformanceTimer.now()-n>5){x.debug("Update time limit exceeded.");break}u=t}if(l+=t.elements.length,l>=100){x.debug("Update label limit exceeded.");break}}}prepareIconTextGroup(e,t,i){if(0===e.elements.length)return;const[,n]=this.m_iconTextStateCache.getOrSet(e,t,(e=>{let{result:t,viewDistance:n}=(0,f.checkReadyForPlacement)(e.iconText,e.iconText.type===m.IconTextType.LineMarker?e.lineMarkerIndex:void 0,this.m_viewState,i);return t!==f.PrePlacementResult.Ok||this.m_iconTextStateCache.deduplicateIconText(this.m_viewState.zoomLevel,e)||(t=f.PrePlacementResult.Duplicate,n=void 0),n}))}gatherGroups(e,t,i,n){const r=[];return i.forEach((i=>{e.shouldRenderText(t,i.tileKey)&&i.iconTextGroups.forEachGroup((e=>{r.push({tile:i,group:e})}))})),n&&r.sort(((e,t)=>h.IconTextGroup.comparePlacementPriority(e.group,t.group))),r}placeIconTexts(e,t){const i={numRenderedIconTexts:0,fadeAnimationRunning:!1,time:e},n=this.overloaded&&this.m_viewState.isDynamic?s.PerformanceTimer.now():void 0;if(0===this.m_iconTextStateCache.size)return void x.debug("IconText cache empty.");const r=this.m_forceNewLabelsPass||t;this.m_forceNewLabelsPass&&(this.m_forceNewLabelsPass=!1);const o=this.m_options.maxNumVisibleLabels,a=this.m_iconTextStateCache.sortedGroupStates;let l=a[0].group,c=0;for(let e=0;e<a.length;++e){const t=a[e],s=t.group;if(r&&0!==h.IconTextGroup.comparePlacementPriority(l,s)){if(this.placeNewIconTexts(c,e,i),D(n))break;l=s,c=e}if(!this.placeIconTextGroup(t,i,o,_.PersistentLabels))break;if(D(n))break}r&&this.placeNewIconTexts(c,a.length,i),i.fadeAnimationRunning&&(this.m_isUpdatePending=!0)}placeNewIconTexts(e,t,i){const n=this.m_iconTextStateCache.sortedGroupStates;for(let r=e;r<t&&this.placeIconTextGroup(n[r],i,this.m_options.maxNumVisibleLabels,_.NewLabels);++r);}placeOverlayIconTexts(){var e;if(void 0===this.m_overlayIconTexts||0===this.m_overlayIconTexts.length)return;const t=this.m_tmpVector.set(this.m_screenProjector.width,this.m_screenProjector.height),i=-t.width/2,s=t.height/2;for(const o of this.m_overlayIconTexts){const a=this.m_textStyleCache.getTextStyle(o.style),l=a.textCanvas;if(void 0===l)continue;const h=!1;if(this.initializeGlyphs(o,a,h),o.loadingState!==c.LoadingState.Initialized)continue;const u=l.getLayer(null!==(e=o.renderOrder)&&void 0!==e?e:r.DEFAULT_TEXT_CANVAS_LAYER);if(void 0!==u&&u.storage.drawCount+o.glyphs.length>u.storage.capacity)continue;let d;if(l.textRenderStyle=o.renderStyle,l.textLayoutStyle=o.layoutStyle,o.type!==m.IconTextType.PathLabel)M.x=i+o.position.x*t.width,M.y=s-o.position.y*t.height,void 0!==o.xOffset&&(M.x+=o.xOffset),void 0!==o.yOffset&&(M.y-=o.yOffset),b.x=M.x,b.y=M.y,b.z=0,R(o,l,b);else{M.x=i,M.y=s,void 0!==o.xOffset&&(M.x+=o.xOffset),void 0!==o.yOffset&&(M.y-=o.yOffset);const e=[];for(const i of o.path){const r=M.x+i.x*t.width,s=M.y-i.y*t.height;e.push(new n.Vector2(r,s))}d=new g.SimplePath;for(let t=0;t<e.length-1;++t)d.add(new n.LineCurve(e[t],e[t+1]));R(o,l,b,d,!0)}}}getDistanceScalingFactor(e,t,i){let n=i/t;return n=1+(n-1)*e.distanceScale,n=Math.max(n,this.m_options.labelDistanceScaleMin),n=Math.min(n,this.m_options.labelDistanceScaleMax),n}getDistanceFadingFactor(e,t,i){let r=1;const s=t.viewDistance;if(void 0!==s&&void 0!==e.fadeFar&&e.fadeFar>0){const t=void 0===e.fadeNear?0:e.fadeNear,o=e.fadeFar;o>t&&(r=1-n.MathUtils.clamp((s/i-t)/(o-t),0,1))}return r}getIconScreenPositions(e,t,i){var r,s,o;const a=[];if(!e.iconInfoList)return a;
950if(e.iconCompositionType===c.IconCompositionType.NEXT_TO_EACH_OTHER){let l=0;for(let t=0;t<e.iconInfoList.length;t++)l+=null!==(r=e.iconInfoList[t].computedWidth)&&void 0!==r?r:0;l*=i;const c=new n.Vector2(t.x-l/2,t.y);for(let t=0;t<e.iconInfoList.length;t++){const n=e.iconInfoList[t-1],r=e.iconInfoList[t];let l=0;n&&(l=(null!==(s=n.computedWidth)&&void 0!==s?s:0)*i/2);const h=(null!==(o=r.computedWidth)&&void 0!==o?o:0)*i/2;c.x+=l+h,a.push(c.clone())}}else for(let i=0;i<e.iconInfoList.length;i++)a.push(t);return a}addIconText(e,t,i,n,r){var o,a;const l=e.iconText,h=e.textRenderState,u=l.type===m.IconTextType.LineMarker,d=!0===l.textIsOptional,p=!0===l.iconIsOptional;b.x=i.x,b.y=i.y,b.z=0;const g=(0,f.pointToPlaneDistance)(t,this.m_viewState.worldCenter,this.m_cameraLookAt);if(void 0!==l.fadeFar&&(l.fadeFar<=0||l.fadeFar*this.m_viewState.maxVisibilityDist<g))return!1;e.setViewDistance(g);const v=this.getDistanceScalingFactor(l,g,this.m_viewState.lookAtDistance),y=this.getDistanceFadingFactor(l,e,this.m_viewState.maxVisibilityDist);let _=void 0!==l.iconInfoList&&s.MathUtils.isWithinBounds(this.m_viewState.zoomLevel,l.iconMinZoomLevel,l.iconMaxZoomLevel)&&l.iconInfoList.every((e=>!1!==e.isValid));_&&(this.m_imageRenderer.prepareIcons(l,this.m_viewState.env)?(null===(o=l.iconInfoList)||void 0===o?void 0:o.some((e=>0===e.computedWidth||0===e.computedHeight)))&&(_=!1):(_=!1,this.m_forceNewLabelsPass=!0,this.m_isUpdatePending=!0));const x=this.getIconScreenPositions(l,i,v);let M;if(_){const e=l.iconInfoList;if(l.iconCompositionType===c.IconCompositionType.NEXT_TO_EACH_OTHER)for(let t=0;t<x.length&&(M=(0,f.placeIcon)(e[t],x[t],v,this.m_viewState.env,this.m_screenCollisions),M!==f.PlacementResult.Rejected);t++);else M=(0,f.placeIcon)(e[0],x[0],v,this.m_viewState.env,this.m_screenCollisions)}const T=!p&&M===f.PlacementResult.Rejected,E=!e.visible,L=0===(null===(a=l.renderParams.fontSize)||void 0===a?void 0:a.size),R=!(!n||!h||L),D=R&&function(e,t,i){const n=e.textRenderState,r=e.iconText;if((0,s.assert)(r.type!==m.IconTextType.PathLabel),void 0===n||""===r.text)return!1;if(!s.MathUtils.isWithinBounds(t.zoomLevel,r.textMinZoomLevel,r.textMaxZoomLevel))return!1;const o=(0,f.getMaxViewDistance)(t,i.maxDistanceRatioForIconText);return!!(!0===r.ignoreDistance||void 0===e.viewDistance||e.viewDistance<o&&e.viewDistance>0)}(e,this.m_viewState,this.m_options)&&!(E&&T);let O;D&&(O=(0,f.placeText)(e,i,v,n,this.m_viewState.env,this.m_screenCollisions,b,!u));let I=!1;if(R&&T||O===f.PlacementResult.Rejected?(h.startFadeOut(r.time),I=h.isVisible()):O===f.PlacementResult.Ok?(I=!0,h.startFadeIn(r.time,this.m_options.disableFading)):h.reset(),I){r.fadeAnimationRunning=r.fadeAnimationRunning||h.isFading(),function(e,t,i,n,r){const s=e.iconText,o=e.textRenderState.opacity*n*s.renderStyle.opacity;if(0===o)return!1;S.letterCaseArray=s.glyphCaseArray,void 0===s.textBufferObject&&(s.textBufferObject=t.createTextBufferObject(s.glyphs,S));const a=s.renderStyle.backgroundOpacity>0&&t.textRenderStyle.fontSize.backgroundSize>0;A.layer=s.renderOrder,A.position=i,A.scale=r,A.opacity=o,void 0!==s.textBrightness?(C.setScalar(s.textBrightness),P.setScalar(s.textBrightness),A.color=C.multiply(s.renderStyle.color),A.backgroundColor=P.multiply(s.renderStyle.backgroundColor)):(A.color=void 0,A.backgroundColor=void 0),A.backgroundOpacity=a?A.opacity*s.renderStyle.backgroundOpacity:0,A.pickingData=s.userData?s:void 0,t.addTextBufferObject(s.textBufferObject,A)}(e,n,b,y,v);const t=l.textBackgroundInfo;t&&this.m_imageRenderer.prepareTextBackground(l)&&l.textBounds&&(w.x=b.x,w.y=b.y,this.m_imageRenderer.addTextBackground(t,w,l.textBounds,e.renderDistance,v))}let F=!1;const V=e.iconRenderState;if(void 0!==V&&(M===f.PlacementResult.Rejected||!d&&O===f.PlacementResult.Rejected?(V.startFadeOut(r.time),F=V.isVisible()):M===f.PlacementResult.Ok?(F=!0,V.startFadeIn(r.time,this.m_options.disableFading)):V.reset(),F&&(r.fadeAnimationRunning=r.fadeAnimationRunning||V.isFading(),l.iconInfoList)))for(let t=0;t<l.iconInfoList.length;t++){const i=l.iconInfoList[t];this.m_imageRenderer.addIcon(i,x[t],this.m_screenCollisions,e.renderDistance,v,!1!==i.reserveSpace&&M===f.PlacementResult.Ok,V.opacity*y,this.m_viewState.env)}return!(!F&&!I||(r.numRenderedIconTexts++,0))}addPointIconText(e,t,i){const n=(0,f.getWorldPosition)(e.iconText,this.m_viewState.projection,this.m_viewState.env,this.m_tmpVector3);return!!this.labelPotentiallyVisible(n,M)&&this.addIconText(e,n,M,t,i)}addLineMarkerLabel(e,t,i,n){var r;const o=e.iconText;if(!(null===(r=this.m_imageRenderer)||void 0===r?void 0:r.prepareIcons(o,this.m_viewState.env)))return;let a;void 0!==o.shieldGroupIndex&&(a=t[o.shieldGroupIndex],void 0===a&&(a=[],t[o.shieldGroupIndex]=a));const l=o.technique,c=void 0!==l.minDistance?l.minDistance*l.minDistance:0;if(c>0&&void 0!==a){let t=0;const r=e.position;if(this.labelPotentiallyVisible(r,M)){let o=!1;for(let e=0;e<a.length&&(o=s.Math2D.distSquared(a[e],a[e+1],M.x,M.y)<c,!o);e+=2);o||this.addIconText(e,r,M,i,n)&&(a.push(M.x,M.y),t++)}0===t&&e.reset()}else{const t=e.position;this.labelPotentiallyVisible(t,M)&&this.addIconText(e,t,M,i,n)}}addPathLabel(e,t,i,r){const s=(0,f.getMaxViewDistance)(this.m_viewState,this.m_options.maxDistanceRatioForText),o=e.iconText;if(!(!0===o.ignoreDistance||void 0===e.viewDistance||e.viewDistance<s))return e.textRenderState.reset(),!1;if(void 0!==o.fadeFar&&(o.fadeFar<=0||o.fadeFar*this.m_viewState.maxVisibilityDist<e.renderDistance))return e.textRenderState.reset(),!1;let a=new n.Path;M.copy(t[0]);for(let e=0;e<t.length-1;++e)a.add(new g.SimpleLineCurve(t[e],t[e+1]));if(a.getPoint(.5).x-a.getPoint(.51).x>0){M.copy(t[t.length-1]),a=new n.Path;for(let e=t.length-1;e>0;--e)a.add(new g.SimpleLineCurve(t[e],t[e-1]))}e.setViewDistance((0,f.computeViewDistance)(o,void 0,this.m_viewState.
950worldCenter,this.m_cameraLookAt));const l=-e.renderDistance,c=this.getDistanceScalingFactor(o,l,this.m_viewState.lookAtDistance),h=i.textRenderStyle.fontSize.size;if(i.textRenderStyle.fontSize.size*=c,(0,f.placePathLabel)(e,a,M,i,this.m_screenCollisions)!==f.PlacementResult.Ok)return i.textRenderStyle.fontSize.size=h,e.textRenderState.reset(),!1;e.textRenderState.startFadeIn(r.time,this.m_options.disableFading);let u=o.renderStyle.opacity;if(e.textRenderState.isFading()&&(u*=e.textRenderState.opacity,r.fadeAnimationRunning=!0),0===e.textRenderState.opacity)return i.textRenderStyle.fontSize.size=h,!1;const d=i.textRenderStyle.opacity,m=i.textRenderStyle.backgroundOpacity,p=this.getDistanceFadingFactor(o,e,this.m_viewState.maxVisibilityDist);return i.textRenderStyle.opacity=u*p,i.textRenderStyle.backgroundOpacity=i.textRenderStyle.opacity*o.renderStyle.backgroundOpacity,b.z=e.renderDistance,R(o,i,b,a),r.numRenderedIconTexts++,i.textRenderStyle.fontSize.size=h,i.textRenderStyle.opacity=d,i.textRenderStyle.backgroundOpacity=m,!0}checkIfOverloaded(e){let t=0;e.forEach((e=>{for(const i of e.renderedTiles.values())t+=i.iconTextGroups.count()}));const i=t>2e4;return i&&!this.m_overloaded&&x.debug("Overloaded Mode enabled."),this.m_overloaded=i,this.m_overloaded}labelPotentiallyVisible(e,t){var i;const r=n.MathUtils.clamp(null!==(i=this.m_options.maxIconTextDistanceToBorder)&&void 0!==i?i:0,0,1);return void 0!==this.m_screenProjector.projectAreaToScreen(e,r,r,t)}}},8950:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.initializeDefaultOptions=void 0,t.initializeDefaultOptions=function(e){void 0===e.minNumGlyphs&&(e.minNumGlyphs=1024),void 0===e.maxNumGlyphs&&(e.maxNumGlyphs=32768),void 0===e.labelDistanceScaleMin&&(e.labelDistanceScaleMin=.7),void 0===e.labelDistanceScaleMax&&(e.labelDistanceScaleMax=1.5),void 0===e.maxDistanceRatioForText&&(e.maxDistanceRatioForText=.99),void 0===e.maxDistanceRatioForIconText&&(e.maxDistanceRatioForIconText=.99),void 0===e.disableFading&&(e.disableFading=!1),void 0===e.delayLabelsUntilMovementFinished&&(e.delayLabelsUntilMovementFinished=!0),void 0===e.showReplacementGlyphs&&(e.showReplacementGlyphs=!1),void 0===e.maxIconTextDistanceToBorder&&(e.maxIconTextDistanceToBorder=.2)}},3981:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isLineMarkerState=t.IconTextState=void 0;const n=i(5823),r=i(4342),s=i(2002),o=i(3569),a=i(6445);t.IconTextState=class{constructor(e,t){this.iconText=e,this.m_lineMarkerIndex=t}get initialized(){return void 0!==this.m_textRenderState||void 0!==this.m_iconRenderState}get visible(){if(void 0!==this.m_textRenderState&&this.m_textRenderState.isVisible())return!0;const e=this.iconRenderState;return!(void 0===e||!e.isVisible())}get textPlacement(){const e=this.iconText.layoutStyle,t=this.m_textLayoutState;return void 0!==t?t.textPlacement:{h:(0,n.hPlacementFromAlignment)(e.horizontalAlignment),v:(0,n.vPlacementFromAlignment)(e.verticalAlignment)}}set textPlacement(e){void 0===this.m_textLayoutState&&!0===this.isBaseTextPlacement(e)||(void 0===this.m_textLayoutState?this.m_textLayoutState=new a.LayoutState(e):this.m_textLayoutState.textPlacement=e)}isBaseTextPlacement(e){const t=this.iconText.layoutStyle;if(void 0!==t)return(0,n.hAlignFromPlacement)(e.h)===t.horizontalAlignment&&(0,n.vAlignFromPlacement)(e.v)===t.verticalAlignment}reset(){void 0!==this.m_textRenderState&&this.m_textRenderState.reset(),void 0!==this.m_textLayoutState&&(void 0!==this.iconText.layoutStyle?this.m_textLayoutState.reset(this.iconText.layoutStyle):this.m_textLayoutState=void 0),this.iconRenderState&&this.m_iconRenderState.reset(),this.m_viewDistance=void 0,this.iconText.textBufferObject=void 0,this.iconText.textBounds=void 0}replace(e){this.m_textRenderState=e.m_textRenderState,this.m_textLayoutState=e.m_textLayoutState,this.m_iconRenderState=e.m_iconRenderState,e.m_textRenderState=void 0,e.m_textLayoutState=void 0,e.m_iconRenderState=void 0,void 0===this.iconText.glyphs&&(this.iconText.glyphs=e.iconText.glyphs,this.iconText.glyphCaseArray=e.iconText.glyphCaseArray),this.iconText.textBounds=void 0,this.iconText.textBufferObject=void 0}get viewDistance(){return this.m_viewDistance}update(e){this.initialized||void 0===e||this.initializeRenderStates(),this.setViewDistance(e)}setViewDistance(e){this.m_viewDistance=e}get renderDistance(){return!0===this.iconText.alwaysOnTop?0:void 0!==this.m_viewDistance?-this.m_viewDistance:0}get textRenderState(){return this.m_textRenderState}get iconRenderState(){return this.m_iconRenderState}get lineMarkerIndex(){return this.m_lineMarkerIndex}get position(){return void 0!==this.iconText.path&&void 0!==this.m_lineMarkerIndex?this.iconText.path[this.m_lineMarkerIndex]:this.iconText.position}updateFading(e,t){void 0!==this.m_textRenderState&&this.m_textRenderState.updateFading(e,t),void 0!==this.iconRenderState&&this.iconRenderState.updateFading(e,t)}initializeRenderStates(){var e;(0,r.assert)(void 0===this.m_textRenderState),(0,r.assert)(void 0===this.m_textLayoutState),(0,r.assert)(void 0===this.m_iconRenderState);const{textFadeTime:t}=this.iconText;if(this.m_textRenderState=new o.RenderState(t),this.iconText.type===s.IconTextType.PointIconText||this.iconText.type===s.IconTextType.LineMarker){const i=null===(e=this.iconText.technique)||void 0===e?void 0:e.iconFadeTime;this.m_iconRenderState=new o.RenderState(void 0!==i?1e3*i:t)}}},t.isLineMarkerState=function(e){return void 0!==e.m_lineMarkerIndex}},791:(e,t,i)=>{"use strict";
950Object.defineProperty(t,"__esModule",{value:!0}),t.IconTextStateCache=void 0;const n=i(4342),r=i(9473),s=i(950),o=i(3981),a=i(2002),l=n.LoggerManager.instance.create("IconTextStateCache",{level:n.LogLevel.Log}),c={entries:[],index:-1};function h(e){return e.hasFeatureId()?e.featureId:e.text}function u(e,t,i,n){return void 0!==e.pathLengthSqr&&void 0!==i.pathLengthSqr&&e.pathLengthSqr>i.pathLengthSqr}function d(e,t,i,n){return t<n}t.IconTextStateCache=class{constructor(){this.m_referenceMap=new Map,this.m_textMap=new Map}getOrSet(e,t,i){let n=this.get(e);return void 0!==n?(n.updateIconTexts(i),[n,!0]):(n=new s.IconTextGroupState(e,t,i),this.set(e,n),[n,!1])}get size(){return this.m_referenceMap.size}get cacheSize(){return this.m_textMap.size}get sortedGroupStates(){return void 0===this.m_sortedGroupStates&&(this.m_sortedGroupStates=Array.from(this.m_referenceMap.values()),this.m_sortedGroupStates.sort(((e,t)=>r.IconTextGroup.comparePlacementPriority(e.group,t.group)))),(0,n.assert)(this.m_referenceMap.size===this.m_sortedGroupStates.length),this.m_sortedGroupStates}update(e,t,i,n){const r=i?this.replaceIconText.bind(this,n):void 0;let s=!1;for(const[n,o]of this.m_referenceMap.entries())o.visited?o.updateFading(e,t):(i&&o.traverseVisibleIconTexts(r),this.m_referenceMap.delete(n),this.m_sortedGroupStates=void 0,s=!0);return s}clearVisited(){for(const e of this.m_referenceMap.values())e.visited=!1}clearTextCache(){this.m_textMap.clear()}clear(){this.m_referenceMap.clear(),this.m_sortedGroupStates=void 0,this.m_textMap.clear()}deduplicateIconText(e,t){const i=this.findDuplicate(t,e);if(void 0===i)return this.m_textMap.set(h(t.iconText),[t]),!0;if(-1===i.index)return i.entries.push(t),!0;const n=i.entries[i.index];return!(n.visible||!t.visible||(i.entries[i.index]=t,n.reset(),0))}replaceIconText(e,t){(0,n.assert)(t.visible);const i=this.findDuplicate(t,e);return void 0!==i&&-1!==i.index&&(i.entries[i.index].replace(t),!0)}get(e){const t=this.m_referenceMap.get(e);return void 0!==t&&(t.visited=!0),t}set(e,t){(0,n.assert)(e.elements.length>0),this.m_referenceMap.set(e,t),this.m_sortedGroupStates=void 0}findDuplicate(e,t){const i=e.iconText,r=this.m_textMap.get(h(i));if(void 0===r)return;c.entries=r;const s=i.hasFeatureId()?function(e,t){const i=e.iconText,r=t.findIndex((e=>e.iconText.tileOffset===i.tileOffset));if(-1===r)return-1;const s=t[r].iconText;if((0,n.assert)(i.featureId===s.featureId),s.text===i.text)return r;l.debug(`Text feature id ${i.featureId} collision between "${i.text} and ${s.text}`)}(e,r):function(e,t,i){const n=e.iconText,r=function(e){return 100<<(Math.min(4,13-Math.min(13,Math.floor(e)))<<2)}(i),s=t.length,l=e.position,c=e.visible,h=(0,o.isLineMarkerState)(e);let m,p=-1,f=1/0;const g=n.type===a.IconTextType.PathLabel?u:d;for(let e=0;e<s;++e){const i=t[e],s=i.iconText,a=n.type!==s.type||h!==(0,o.isLineMarkerState)(i),u=c&&i.visible;if(a||u)continue;const d=l.distanceToSquared(s.position);d>r||(void 0===m||g(s,d,m,f))&&(p=e,m=s,f=d)}return p}(e,r,t);return void 0===s?(i.featureId=void 0,this.findDuplicate(e,t)):(c.index=s,c)}}},2002:(e,t)=>{"use strict";var i;Object.defineProperty(t,"__esModule",{value:!0}),t.IconTextType=void 0,(i=t.IconTextType||(t.IconTextType={}))[i.PointIconText=0]="PointIconText",i[i.PathLabel=1]="PathLabel",i[i.LineMarker=2]="LineMarker"},8488:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MapViewState=void 0;const n=i(82);t.MapViewState=class{constructor(e,t){this.m_mapView=e,this.m_renderedTilesChangeCheck=t,this.m_lookAtVector=new n.Vector3}get worldCenter(){return this.m_mapView.worldCenter}get cameraIsMoving(){return this.m_mapView.cameraIsMoving}get maxVisibilityDist(){return this.m_mapView.viewRanges.maximum}get zoomLevel(){return this.m_mapView.zoomLevel}get env(){return this.m_mapView.env}get frameNumber(){return this.m_mapView.frameNumber}get lookAtVector(){return this.m_mapView.camera.getWorldDirection(this.m_lookAtVector)}get lookAtDistance(){return this.m_mapView.targetDistance}get isDynamic(){return this.m_mapView.isDynamicFrame}get renderedTilesChanged(){return this.m_renderedTilesChangeCheck()}get projection(){return this.m_mapView.projection}get elevationProvider(){return this.m_mapView.elevationProvider}}}
950,9913:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getWorldPosition=t.isPathLabelTooSmall=t.placePathLabel=t.placeText=t.placeIcon=t.PlacementResult=t.checkReadyForPlacement=t.PrePlacementResult=t.getMaxViewDistance=t.pointToPlaneDistance=t.computeViewDistance=void 0;const n=i(82),r=i(8152),s=i(2616),o=i(5823),a=i(1984),l=i(4342),c=i(7362),h=i(2967),u=i(2002),d=i(5154),m=i(5570),p=new n.Vector3(0,0,0),f=new n.Vector3(0,0,0),g=new n.Vector3(0,0,0);function v(e,t,i,n){let r;const s=e.path;if(s&&s.length>1)if(void 0!==t&&s&&s.length>t)r=y(s[t],i,n);else{const e=y(s[0],i,n),t=y(s[s.length-1],i,n);r=Math.min(e,t)}else r=y(e.position,i,n);return r}function y(e,t,i){return g.copy(e).sub(t).dot(i)}var _;t.computeViewDistance=v,t.pointToPlaneDistance=y,t.getMaxViewDistance=function(e,t){return e.maxVisibilityDist*t},function(e){e[e.Ok=0]="Ok",e[e.Invisible=1]="Invisible",e[e.TooFar=2]="TooFar",e[e.Duplicate=3]="Duplicate",e[e.Count=4]="Count"}(_=t.PrePlacementResult||(t.PrePlacementResult={}));const x=new n.Vector3;t.checkReadyForPlacement=function(e,t,i,n){let r;if(!e.visible||i.zoomLevel===e.textMaxZoomLevel)return{result:_.Invisible,viewDistance:r};const o=e.iconInfoList&&l.MathUtils.isWithinBounds(i.zoomLevel,e.iconMinZoomLevel,e.iconMaxZoomLevel);return l.MathUtils.isWithinBounds(i.zoomLevel,e.textMinZoomLevel,e.textMaxZoomLevel)||o?(r=void 0===n?v(e,t,i.worldCenter,i.lookAtVector):function(e,t,i,n,r,o){const a=v(e,t,i,n);return r!==s.ProjectionType.Spherical?a<=o?a:void 0:(p.copy(e.position).normalize(),f.copy(i).normalize(),p.dot(f)>.5877852522924731&&a<=o?a:void 0)}(e,t,i.worldCenter,i.lookAtVector,i.projection.type,n),void 0===r?{result:_.TooFar,viewDistance:r}:{result:_.Ok,viewDistance:r}):{result:_.Invisible,viewDistance:r}};const b=new n.Box2,w=new n.Box2,M=[],T={},S=[],E=new c.CollisionBox,A=new n.Vector2,C=new n.Vector2,P=new l.Math2D.Box,L=new n.Vector2,R=new n.Vector2;var D;function O(e,t,i,s,c,p,f,g,v){const y=e.iconText;(0,l.assert)(void 0!==y.glyphs),(0,l.assert)(void 0!==y.layoutStyle);const _=!y.textBounds||g,x=_?w:y.textBounds;if(_){F(c,i),T.outputCharacterBounds=void 0,T.path=void 0,T.pathOverflow=!1,T.letterCaseArray=y.glyphCaseArray,c.measureText(y.glyphs,x,T);const e=y.technique;if(e&&(0,a.isIconTextTechnique)(e)){const t=(0,r.getPropertyValue)(e["background-padding"],p);t&&(t.x&&(x.min.x-=t.x),t.y&&(x.max.y+=t.y),t.z&&(x.max.x+=t.z),t.w&&(x.min.y-=t.w))}}const M=function(e,t,i,s,a,c=new n.Vector2){switch((0,l.assert)(e.type===u.IconTextType.PointIconText||e.type===u.IconTextType.LineMarker),(0,l.assert)(void 0!==e.layoutStyle),c.x=e.xOffset,c.y=e.yOffset,i.h){case o.HorizontalPlacement.Left:c.x-=t.max.x;break;case o.HorizontalPlacement.Right:c.x-=t.min.x}switch(i.v){case o.VerticalPlacement.Top:c.y-=t.min.y;break;case o.VerticalPlacement.Center:c.y-=.5*(t.max.y+t.min.y);break;case o.VerticalPlacement.Bottom:c.y-=t.max.y}if(e.iconInfoList){let t=0,n=0;if(e.iconCompositionType===h.IconCompositionType.NEXT_TO_EACH_OTHER)for(let i=0;i<e.iconInfoList.length;i++){const r=e.iconInfoList[i];(0,d.imageIsRenderable)(r)&&((0,l.assert)(void 0!==r.computedWidth),(0,l.assert)(void 0!==r.computedHeight),t+=r.computedWidth,n=r.computedHeight)}else{const i=e.iconInfoList[0];(0,d.imageIsRenderable)(i)&&((0,l.assert)(void 0!==i.computedWidth),(0,l.assert)(void 0!==i.computedHeight),t=i.computedWidth,n=i.computedHeight)}c.x+=t*(.5+i.h),c.y+=n*(.5+i.v);const s=(0,o.hPlacementFromAlignment)(e.layoutStyle.horizontalAlignment),u=(0,o.vPlacementFromAlignment)(e.layoutStyle.verticalAlignment);if(s!==i.h||u!==i.v){const t=e.technique;let n=(0,r.getPropertyValue)(t.iconXOffset,a),l=(0,r.getPropertyValue)(t.iconYOffset,a);n="number"==typeof n?n:0,l="number"==typeof l?l:0;const h=s-i.h,d=u-i.v,m=n-e.xOffset,p=l-e.yOffset;s===o.HorizontalPlacement.Center||u===o.VerticalPlacement.Center?(c.x+=2*Math.abs(h)*m,c.y-=2*d*Math.abs(m),c.y+=2*Math.abs(d)*p,c.x-=2*h*Math.abs(p)):(c.x+=2*Math.min(Math.abs(h),.5)*m,c.y-=2*Math.sign(d)*Math.min(Math.abs(d),.5)*Math.abs(m),c.y+=2*Math.min(Math.abs(d),.5)*p,c.x-=2*Math.sign(h)*Math.min(Math.abs(h),.5)*Math.abs(p))}}return c.multiplyScalar(s),c}(y,x,i,s,p,C).add(t);return v.set(M.x,M.y,e.renderDistance),I(y,x,s,M,p,m.Margin.CHECK),f.isVisible(P)?(_&&(b.getSize(R),R.multiplyScalar(s),P.set(L.x-R.x/2,L.y-R.y/2,R.x,R.y)),!y.textMayOverlap&&f.isAllocated(P)?D.Rejected:(y.textReservesSpace&&(I(y,x,s,M,p,m.Margin.ALLOCATE),f.allocate(P)),_?(y.textBufferObject=void 0,y.textBounds=y.textBounds?y.textBounds.copy(x):x.clone()):F(c,i),e.textPlacement=i,D.Ok)):D.Invisible}function I(e,t,i,n,s,o=m.Margin.NONE){var l,c,h;const u=e.technique;let d=0;u&&(0,a.isIconTextTechnique)(u)&&(o===m.Margin.CHECK?d=null!==(c=null!==(l=(0,r.getPropertyValue)(u["check-margin"],s))&&void 0!==l?l:(0,r.getPropertyValue)(u.margin,s))&&void 0!==c?c:0:o===m.Margin.ALLOCATE&&(d=null!==(h=(0,r.getPropertyValue)(u.margin,s))&&void 0!==h?h:0)),b.copy(t).translate(n),b.getCenter(L),b.expandByScalar(d),b.getSize(R),R.multiplyScalar(i),P.set(L.x-R.x/2,L.y-R.y/2,R.x,R.y)}function F(e,t){e.textLayoutStyle.horizontalAlignment=(0,o.hAlignFromPlacement)(t.h),e.textLayoutStyle.verticalAlignment=(0,o.vAlignFromPlacement)(t.v)}!function(e){e[e.Ok=0]="Ok",e[e.Rejected=1]="Rejected",e[e.Invisible=2]="Invisible"}(D=t.PlacementResult||(t.PlacementResult={})),t.placeIcon=function(e,t,i,n,r){return m.ImageRenderer.computeIconScreenBox(e,t,i,n,P,m.Margin.CHECK),r.isVisible(P)?!0!==e.mayOverlap&&r.isAllocated(P)?D.Rejected:D.Ok:D.Invisible},t.placeText=function(e,t,i,n,r,s,o,a=!1){(0,l.assert)(void 0!==e.iconText.layoutStyle);const c=e.iconText.layoutStyle;return(a=a&&void 0!==c.placements&&c.placements.length>1)?function(e,t,i,n,r,s,o){(0,l.assert)(void 0!==e.iconText.layoutStyle);const a=e.iconText,c=e.visible,h=e.textPlacement,u=a.layoutStyle.placements,d=u.length,m=u.findIndex((e=>e.h===h.h&&e.v===h.v));(0,l.assert)(m>=0);let p=!0;for(let a=m;a<d+m;++a){const l=a===m&&c,h=O(e,t,u[a%d],i,n,r,s,!l,x);if(h===D.Ok)return o.copy(x),D.Ok;l&&o.copy(x),p=p&&h===D.Invisible}return p?D.Invisible:D.Rejected}(e,t,i,n,r,s,o):function(e,t,i,n,r,s,o){(0,l.assert)(void 0!==e.iconText.layoutStyle);return O(e,t,e.textPlacement,i,n,r,s,!e.visible,o)}(e,t,i,n,r,s,o)},t.placePathLabel=function(e,t,i,n,r){if(T.path=t,T.outputCharacterBounds=M,T.letterCaseArray=e.iconText.glyphCaseArray,T.horizontalOffset=(0,o.getHorizontalOffset)(e.iconText),!n.measureText(e.iconText.glyphs,b,T))return D.Rejected;if(E.copy(b.translate(i)),!r.isVisible(E))return D.Invisible;let s,a=!1;e.iconText.textMayOverlap||(s=r.search(E),a=s.length>0),S.length=M.length;for(let e=0;e<M.length;++e){const t=M[e].translate(i);let n=S[e];if(void 0===n?(n=new c.CollisionBox(t),S[e]=n):n.copy(t),a&&r.intersectsDetails(n,s))return D.Rejected}if(e.iconText.textReservesSpace){const e=new c.DetailedCollisionBox(E,S.slice());S.length=0,r.allocate(e)}return D.Ok},t.isPathLabelTooSmall=function(e,t,i,n){var r;if((0,l.assert)(e.type===u.IconTextType.PathLabel),0===(null===(r=e.renderParams.fontSize)||void 0===r?void 0:r.size))return!0;
950i.length=0;let s=!1;for(const[r,o]of e.points.entries())U({iconText:e,tmpPosition:p,tmpCameraDir:f,env:n,currentInd:r}),p.copy(o),void 0!==(s?t.project(p.sub(f),A):t.projectToScreen(p.sub(f),A))&&(s=!0,i.push(A.clone()));if(!s)return!0;const o=5*e.text.length;return b.setFromPoints(i),b.max.sub(b.min).lengthSq()<o*o&&(e.dbgPathTooSmall=!0,!0)};const V=new s.OrientedBox3;function U({iconText:e,tmpPosition:t,tmpCameraDir:i,env:n,currentInd:s}){var o;if(!Array.isArray(e.points))return;0===s?(t.copy(e.points[1]),t.sub(e.points[0]).normalize()):(t.copy(e.points[s]),t.sub(e.points[s-1]).normalize());const a=(0,r.getPropertyValue)(null===(o=e.technique)||void 0===o?void 0:o["world-line-offset"],n);i.set(-t.y,t.x,0).multiplyScalar(a)}t.getWorldPosition=function(e,t,i,s){var o;const a=(0,r.getPropertyValue)(null===(o=e.technique)||void 0===o?void 0:o.worldOffset,i);if(null==s||s.copy(e.position),null!=a&&void 0!==e.offsetDirection){t.localTangentSpace(e.position,V);const i=V.yAxis,r=n.MathUtils.degToRad(e.offsetDirection);i.applyAxisAngle(V.zAxis.negate(),r),s.addScaledVector(V.yAxis,a)}return s}},7234:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PlacementStats=void 0,t.PlacementStats=class{constructor(e){this.m_logger=e,this.totalGroups=0,this.resortedGroups=0,this.total=0,this.uninitialized=0,this.tooFar=0,this.numNotVisible=0,this.numPathTooSmall=0,this.numCannotAdd=0,this.numRenderedIcons=0,this.numRenderedTexts=0,this.numTextsInvisible=0,this.numRenderedIconTexts=0}clear(){this.totalGroups=0,this.resortedGroups=0,this.total=0,this.uninitialized=0,this.tooFar=0,this.numNotVisible=0,this.numPathTooSmall=0,this.numCannotAdd=0,this.numRenderedIcons=0,this.numRenderedTexts=0,this.numTextsInvisible=0,this.numRenderedIconTexts=0}log(){const e=this.uninitialized+this.numTextsInvisible+this.tooFar+this.numNotVisible+this.numCannotAdd;this.m_logger.debug("Total groups",this.totalGroups),this.m_logger.debug("Resorted groups",this.resortedGroups),this.m_logger.debug("Total labels",this.total),this.m_logger.debug("Rendered labels",this.numRenderedIconTexts),this.m_logger.debug("Rejected labels",e),this.m_logger.debug("Unitialized labels",this.uninitialized),this.m_logger.debug("Rendered icons",this.numRenderedIcons),this.m_logger.debug("Rendered texts",this.numRenderedTexts),this.m_logger.debug("Texts invisible",this.numTextsInvisible),this.m_logger.debug("Too far",this.tooFar),this.m_logger.debug("Not visible",this.numNotVisible),this.m_logger.debug("Path too small",this.numPathTooSmall),this.m_logger.debug("Rejected, max glyphs reached",this.numCannotAdd)}}},3569:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RenderState=t.DEFAULT_FADE_TIME=t.FadingState=void 0;const n=i(82),r=i(4342);var s;!function(e){e[e.Undefined=0]="Undefined",e[e.FadingIn=1]="FadingIn",e[e.FadedIn=2]="FadedIn",e[e.FadingOut=-1]="FadingOut",e[e.FadedOut=-2]="FadedOut"}(s=t.FadingState||(t.FadingState={})),t.DEFAULT_FADE_TIME=800,t.RenderState=class{constructor(e=t.DEFAULT_FADE_TIME){this.fadeTime=e,this.value=0,this.startTime=0,this.opacity=0,this.m_state=s.Undefined}reset(){this.m_state=s.Undefined,this.value=0,this.startTime=0,this.opacity=0}isUndefined(){return this.m_state===s.Undefined}isFading(){return this.m_state===s.FadingIn||this.m_state===s.FadingOut}isFadingIn(){return this.m_state===s.FadingIn}isFadingOut(){return this.m_state===s.FadingOut}isFadedIn(){return this.m_state===s.FadedIn}isFadedOut(){return this.m_state===s.FadedOut}isVisible(){return this.m_state!==s.FadedOut&&this.m_state!==s.Undefined&&this.opacity>0}startFadeIn(e,t){if(this.m_state!==s.FadingIn&&this.m_state!==s.FadedIn){if(!0===t)return this.value=1,this.opacity=1,this.m_state=s.FadedIn,void(this.startTime=e);this.m_state===s.FadingOut?(this.value=1-this.value,this.startTime=e-this.value*this.fadeTime):(this.startTime=e,this.value=0,this.opacity=0),this.m_state=s.FadingIn}}startFadeOut(e){this.m_state!==s.FadingOut&&this.m_state!==s.FadedOut&&this.m_state!==s.Undefined&&(this.m_state===s.FadingIn?(this.startTime=e-this.value*this.fadeTime,this.value=1-this.value):(this.startTime=e,this.value=0,this.opacity=1),this.m_state=s.FadingOut)}updateFading(e,t){if(this.m_state!==s.FadingIn&&this.m_state!==s.FadingOut)return;0===this.startTime&&(this.startTime=e);const i=e-this.startTime,o=this.m_state===s.FadingIn?0:1,a=this.m_state===s.FadingIn?1:0;t||i>=this.fadeTime?(this.value=1,this.opacity=a,this.m_state=this.m_state===s.FadingIn?s.FadedIn:s.FadedOut):(this.value=i/this.fadeTime,this.opacity=n.MathUtils.clamp(r.MathUtils.smootherStep(o,a,this.value),0,1),(0,r.assert)(this.isFading()))}}},859:(e,t,i)=>{"use strict";
950Object.defineProperty(t,"__esModule",{value:!0}),t.UpdateStats=void 0;const n=i(9913);t.UpdateStats=class{constructor(e){this.m_logger=e,this.tiles=0,this.totalGroups=0,this.newGroups=0,this.totalLabels=0,this.results=new Array(n.PrePlacementResult.Count),this.results.fill(0)}clear(){this.tiles=0,this.totalGroups=0,this.newGroups=0,this.totalLabels=0,this.results.fill(0)}log(){this.m_logger.debug("Tiles",this.tiles),this.m_logger.debug("Total groups",this.totalGroups),this.m_logger.debug("New groups",this.newGroups),this.m_logger.debug("Total labels",this.totalLabels),this.m_logger.debug("Placed labels",this.results[n.PrePlacementResult.Ok]),this.m_logger.debug("Invisible",this.results[n.PrePlacementResult.Invisible]),this.m_logger.debug("Too far",this.results[n.PrePlacementResult.TooFar]),this.m_logger.debug("Duplicate",this.results[n.PrePlacementResult.Duplicate])}}},4298:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BoxBuffer=t.BoxBufferMesh=void 0;const n=i(82),r=i(4342),s=i(161);class o extends n.Mesh{constructor(e,t){super(e,t),this.type="BoxBufferMesh"}get isEmpty(){if(void 0===this.geometry)return!0;{const e=this.geometry;return null===e.index||0===e.index.count}}}t.BoxBufferMesh=o;class a{constructor(e,t=0,i=0,n=32768){this.m_material=e,this.m_renderOrder=t,this.m_maxElementCount=n,this.m_size=0,this.resizeBuffer(i),this.m_pickInfos=new Array}clone(){return new a(this.m_material,this.m_renderOrder)}dispose(){void 0!==this.m_geometry&&(this.m_geometry.dispose(),this.m_geometry=void 0),this.m_mesh=void 0}get size(){return this.m_size}reset(){void 0!==this.m_positionAttribute&&(this.m_positionAttribute.count=0,this.m_colorAttribute.count=0,this.m_uvAttribute.count=0,this.m_indexAttribute.count=0,this.m_pickInfos.length=0)}canAddElements(e=1){const t=this.m_indexAttribute;if(t.count+6*e>=t.array.length){if(t.array.length>=6*this.m_maxElementCount)return!1;const e=Math.min(this.m_maxElementCount,0===this.size?256:2*this.size);this.resize(e)}return!0}saveState(){return{positionAttributeCount:this.m_positionAttribute.count,colorAttributeCount:this.m_colorAttribute.count,uvAttributeCount:this.m_uvAttribute.count,indexAttributeCount:this.m_indexAttribute.count,pickInfoCount:this.m_pickInfos.length}}restoreState(e){this.m_positionAttribute.count=e.positionAttributeCount,this.m_colorAttribute.count=e.colorAttributeCount,this.m_uvAttribute.count=e.uvAttributeCount,this.m_indexAttribute.count=e.indexAttributeCount,this.m_pickInfos.length=e.pickInfoCount}addBox(e,t,i,n,r,s){if(!this.canAddElements())return!1;const{s0:o,t0:a,s1:l,t1:c}=t,{x:h,y:u,w:d,h:m}=e,p=Math.round(i.r*n*255),f=Math.round(i.g*n*255),g=Math.round(i.b*n*255),v=Math.round(255*n),y=this.m_positionAttribute,_=this.m_colorAttribute,x=this.m_uvAttribute,b=this.m_indexAttribute,w=y.count,M=b.count;return y.setXYZ(w,h,u,r),y.setXYZ(w+1,h+d,u,r),y.setXYZ(w+2,h,u+m,r),y.setXYZ(w+3,h+d,u+m,r),_.setXYZW(w,p,f,g,v),_.setXYZW(w+1,p,f,g,v),_.setXYZW(w+2,p,f,g,v),_.setXYZW(w+3,p,f,g,v),x.setXY(w,o,a),x.setXY(w+1,l,a),x.setXY(w+2,o,c),x.setXY(w+3,l,c),b.setX(M,w),b.setX(M+1,w+1),b.setX(M+2,w+2),b.setX(M+3,w+2),b.setX(M+4,w+1),b.setX(M+5,w+3),y.count+=4,_.count+=4,x.count+=4,b.count+=6,this.m_pickInfos.push(s),!0}updateBufferGeometry(){const e=this.m_positionAttribute,t=this.m_colorAttribute,i=this.m_uvAttribute,n=this.m_indexAttribute;e.count>0&&(e.needsUpdate=!0,e.updateRange.offset=0,e.updateRange.count=4*e.count),t.count>0&&(t.needsUpdate=!0,t.updateRange.offset=0,t.updateRange.count=4*t.count),i.count>0&&(i.needsUpdate=!0,i.updateRange.offset=0,i.updateRange.count=4*i.count),n.count>0&&(n.needsUpdate=!0,n.updateRange.offset=0,n.updateRange.count=n.count),void 0!==this.m_geometry&&(this.m_geometry.clearGroups(),this.m_geometry.addGroup(0,this.m_indexAttribute.count))}cleanUp(){0===this.m_indexAttribute.count&&this.size>0&&this.clearAttributes()}get isEmpty(){return this.m_mesh.isEmpty}get mesh(){return void 0===this.m_mesh&&this.resize(),this.m_mesh}pickBoxes(e,t,i){var n;const s=this.m_pickInfos.length,o=this.m_pickInfos,a=this.m_positionAttribute,l=e.x,c=e.y;for(let e=0;e<s;e++){const s=4*e,h=a.getX(s);if(l<h)continue;const u=a.getX(s+1);if(l>u)continue;const d=a.getY(s);if(c<d)continue;const m=a.getY(s+2);if(c>m)continue;const p=new r.Math2D.Box(h,d,u-h,m-d),f=o[e];if(void 0!==i&&void 0!==f&&void 0!==f.uvBoxForPicking&&this.isPixelTrans
950parent(i,l,c,p,f.uvBoxForPicking))continue;const g=null===(n=o[e])||void 0===n?void 0:n.iconText;g&&t(g)}}resize(e,t){return void 0!==this.m_geometry&&this.m_geometry.dispose(),this.m_geometry=new n.BufferGeometry,void 0!==e&&(!0===t||e>this.size)&&this.resizeBuffer(e),this.m_geometry.setAttribute("position",this.m_positionAttribute),this.m_geometry.setAttribute("color",this.m_colorAttribute),this.m_geometry.setAttribute("uv",this.m_uvAttribute),this.m_geometry.setIndex(this.m_indexAttribute),this.m_geometry.addGroup(0,this.m_indexAttribute.count),void 0===this.m_mesh?(this.m_mesh=new o(this.m_geometry,this.m_material),this.m_mesh.renderOrder=this.m_renderOrder):this.m_mesh.geometry=this.m_geometry,this.m_mesh}updateMemoryUsage(e){const t=3*this.m_positionAttribute.count*4+4*this.m_colorAttribute.count+4*this.m_uvAttribute.count*4+4*this.m_indexAttribute.count;e.heapSize+=t,e.gpuSize+=t}isPixelTransparent(e,t,i,n,r){const{u:o,v:a}=(0,s.screenToUvCoordinates)(t,i,n,r),{width:l,height:c}=e instanceof SVGImageElement?e.getBBox():e,h=l*o,u=c*a,d=(0,s.getPixelFromImage)(h,u,e);return void 0!==d&&0===d[3]}clearAttributes(){this.m_positionAttribute=void 0,this.m_colorAttribute=void 0,this.m_uvAttribute=void 0,this.m_indexAttribute=void 0,this.resize(0,!0)}resizeBuffer(e){const t=new Float32Array(4*e*3);if(void 0!==this.m_positionAttribute&&this.m_positionAttribute.array.length>0){const e=this.m_positionAttribute.count;t.set(this.m_positionAttribute.array),this.m_positionAttribute.array=t,this.m_positionAttribute.count=e}else this.m_positionAttribute=new n.BufferAttribute(t,3),this.m_positionAttribute.count=0,this.m_positionAttribute.setUsage(n.DynamicDrawUsage);const i=new Uint8Array(4*e*4);if(void 0!==this.m_colorAttribute){const e=this.m_colorAttribute.count;i.set(this.m_colorAttribute.array),this.m_colorAttribute.array=i,this.m_colorAttribute.count=e}else this.m_colorAttribute=new n.BufferAttribute(i,4,!0),this.m_colorAttribute.count=0,this.m_colorAttribute.setUsage(n.DynamicDrawUsage);const r=new Float32Array(4*e*4);if(void 0!==this.m_uvAttribute){const e=this.m_uvAttribute.count;r.set(this.m_uvAttribute.array),this.m_uvAttribute.array=r,this.m_uvAttribute.count=e}else this.m_uvAttribute=new n.BufferAttribute(r,4),this.m_uvAttribute.count=0,this.m_uvAttribute.setUsage(n.DynamicDrawUsage);const s=6*e*1,o=s>65535?new Uint32Array(s):new Uint16Array(s);if(void 0!==this.m_indexAttribute){const e=this.m_indexAttribute.count;o.set(this.m_indexAttribute.array),this.m_indexAttribute.array=o,this.m_indexAttribute.count=e}else this.m_indexAttribute=new n.BufferAttribute(o,1),this.m_indexAttribute.count=0,this.m_indexAttribute.setUsage(n.DynamicDrawUsage);this.m_size=e}}t.BoxBuffer=a},3174:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IconInfoBuilder=void 0;const n=i(8152),r=i(4342),s=i(207);t.IconInfoBuilder=class{constructor(e){this.m_env=e}withTechnique(e){return this.m_imageTextureName=void 0!==e.imageTexture?(0,n.getPropertyValue)(e.imageTexture,this.m_env):void 0,this.m_technique=e,this}withIcon(e){return void 0!==e&&(this.m_imageTextureName=e),this}build(e){var t,i,o,a;(0,r.assert)(void 0!==this.m_technique);const l=this.m_technique,c=this.m_env,h=null===(t=this.m_imageTextureName)||void 0===t?void 0:t.split(",").filter(((e,t,i)=>e&&i.indexOf(e)===t));if(void 0===h)return;const u=null!==(i=l.iconMayOverlap)&&void 0!==i?i:l.textMayOverlap,d=null!==(o=l.iconReserveSpace)&&void 0!==o?o:l.textReserveSpace,m=(0,n.getPropertyValue)(l.iconColor,c),p=null!==m?s.ColorCache.instance.getColor(m):void 0,f=[];for(let t=0;t<h.length;t++){const i={technique:l,imageTextureName:h[t],iconText:e,mayOverlap:u,reserveSpace:d,iconBrightness:r.MathUtils.clamp(null!==(a=l.iconBrightness)&&void 0!==a?a:1,0,1),iconColor:p};f.push(i)}return f.length>0?f:void 0}}},5154:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.imageIsRenderable=void 0,t.imageIsRenderable=function(e){return void 0!==e.buffer}},5570:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ImageRenderer=t.Margin=t.ImageBatchRegistry=t.ImageBuffer=void 0;const n=i(82),r=i(8152),s=i(4250),o=i(4342),a=i(7063),l=i(6802),c=i(4298),h=o.LoggerManager.instance.create("IconRenderer"),u=new n.Color(1,1,1),d=new n.Color;class m{constructor(e,t,i){this.buffer=e,this.layer=t,this.m_onDispose=i,this.m_refCount=0}increaseRefCount(){return++this.m_refCount,this}decreaseRefCount(){return(0,o.assert)(this.m_refCount>0),0==--this.m_refCount&&this.dispose(),this}dispose(){this.layer.scene.remove(this.buffer.mesh),this.buffer.dispose(),this.m_onDispose()}}t.ImageBuffer=m;class p{constructor(e,t,i,n){this.m_rendererCapabilities=e,this.imageItem=t,this.m_onDispose=i,(0,o.assert)(void 0!==this.imageItem.image);const r=(0,a.loadTexture)(this.imageItem.image,n,{magFilter:"linear",minFilter:p.trilinear?"linearMipMapLinear":"linear"});(0,o.assert)(void 0!==r),p.trilinear&&this.imageItem.mipMaps&&(r.mipmaps=this.imageItem.mipMaps,r.image=r.mipmaps[0]),r.flipY=!1,r.premultiplyAlpha=!0,this.m_material=new s.IconMaterial({rendererCapabilities:this.m_rendererCapabilities,map:r}),this.m_imageBuffers=new Map}getBuffer(e){let t=this.m_imageBuffers.get(e.id);if(t)return t.increaseRefCount();const i=new c.BoxBuffer(this.m_material,e.id),n=i.mesh;return n.frustumCulled=!1,e.scene.add(n),t=new m(i,e,(()=>{this.disposeBuffer(e.id)})),this.m_imageBuffers.set(e.id,t),t.increaseRefCount()}reset(){for(const e of this.m_imageBuffers.values())e.buffer.reset()}update(){for(const e of this.m_imageBuffers.values())e.buffer.updateBufferGeometry()}pickBoxes(e,t,i){for(const n of this.m_imageBuffers.values())n.buffer.pickBoxes(e,t,i)}updateMemoryUsage(e){if(void 0!==this.imageItem.image){const t=this.imageItem.image.width*this.imageItem.image.height*4;e.heapSize+=t,e.gpuSize+=t}for(const t of this.m_imageBuffers.values())t.buffer.updateMemoryUsage(e)}dispose(){this.m_imageBuffers.clear(),this.m_material.map.dispose(),this.m_material.dispose(),this.m_onDispose()}disposeBuffer(e){(0,o.assert)(this.m_imageBuffers.size>0),this.m_imageBuffers.delete(e),0===this.m_imageBuffers.size&&this.dispose()}}p.trilinear=!0;class f{constructor(e,t){this.m_rendererCapabilities=e,this.m_textureCache=t,this.m_batchMap=new Map}registerImage(e,t){var i;const{imageItem:n,imageTexture:r}=e;if(!n)return;(0,o.assert)(void 0!==e.imageTextureName);const s=null!==(i=null==r?void 0:r.image)&&void 0!==i?i:e.imageTextureName;let a=this.m_batchMap.get(s);return void 0===a&&(a=new p(this.m_rendererCapabilities,n,(()=>{this.deleteBatch(s)}),this.m_textureCache),this.m_batchMap.set(s,a)),a.getBuffer(t)}addIcon(e,t,i,n){if(!1===e.isValid||!e.buffer)return void h.warn("IconBatchRegistry: trying to add iconInfo without buffer prepared: ",e.imageTextureName);let r;(0,o.assert)(void 0!==e.uvBox),void 0!==e.iconBrightness?(r=d.setScalar(e.iconBrightness),void 0!==e.iconColor&&(r=d.multiply(e.iconColor))):r=void 0!==e.iconColor?e.
950iconColor:u,e.buffer.buffer.addBox(t,e.uvBox,r,n,i,e)}addTextBackground(e,t,i){if(!1===e.isValid||!e.buffer)return void h.warn("IconBatchRegistry: trying to add background image without buffer prepared: ",e.imageTextureName);(0,o.assert)(void 0!==e.uvBox);const n=u;e.buffer.buffer.addBox(t,e.uvBox,n,1,i,e)}reset(){for(const e of this.m_batchMap.values())e.reset()}update(){for(const e of this.m_batchMap.values())e.update()}pickImageTexts(e,t){for(const i of this.m_batchMap.values())i.pickBoxes(e,t,i.imageItem.image)}updateMemoryUsage(e){for(const t of this.m_batchMap.values())t.updateMemoryUsage(e)}deleteBatch(e){this.m_batchMap.delete(e)}}var g;t.ImageBatchRegistry=f,function(e){e[e.ALLOCATE=0]="ALLOCATE",e[e.CHECK=1]="CHECK",e[e.NONE=2]="NONE"}(g=t.Margin||(t.Margin={}));class v{static computeIconScreenBox(e,t,i,n,s=new o.Math2D.Box,a=g.NONE){var l,c,h;(0,o.assert)(void 0!==e.buffer);const u=e.technique;let d=0;a===g.CHECK?d=null!==(c=null!==(l=(0,r.getPropertyValue)(u["check-margin"],n))&&void 0!==l?l:(0,r.getPropertyValue)(u.margin,n))&&void 0!==c?c:0:a===g.ALLOCATE&&(d=null!==(h=(0,r.getPropertyValue)(u.margin,n))&&void 0!==h?h:0);const m=e.computedWidth*i+2*d,p=e.computedHeight*i+2*d,f=(0,r.getPropertyValue)(u.iconXOffset,n),v=(0,r.getPropertyValue)(u.iconYOffset,n),y=t.x+("number"==typeof f?f:0)*i,_=t.y+("number"==typeof v?v:0)*i;return s.x=y-m/2,s.y=_-p/2,s.w=m,s.h=p,s}constructor(e,t,i){this.m_renderer=e,this.m_imageRepo=t,this.m_textureCache=i,this.m_tempScreenBox=new o.Math2D.Box,this.m_layers=[],this.m_imageBatchRegistry=new f(this.renderer.capabilities,this.m_textureCache)}get renderer(){return this.m_renderer}prepareIcon(e,t){if(void 0!==e.buffer)return!0;const i=e.imageTextureName;if(void 0===i)return e.isValid=!1,!1;const n=this.m_imageRepo.findImage(i);if(n){const{imageItem:i,imageTexture:r}=n;if(i.loaded)return this.setupIconInfo(e,i,t,r),!0}return this.m_imageRepo.loadImage(i).then((t=>{e.isValid=!0})).catch((t=>{e.imageItem=null,e.isValid=!1})),!1}prepareIcons(e,t){let i=!1;const n=e.iconInfoList;return n&&e.visible&&(i=!0,n.forEach((e=>{i=this.prepareIcon(e,t)&&i}))),i}prepareTextBackground(e){var t;const i=e.textBackgroundInfo;if(!1===e.visible)return!1;if(void 0===(null==i?void 0:i.imageTextureName))return!0;if(void 0!==(null===(t=e.textBackgroundInfo)||void 0===t?void 0:t.buffer))return!0;if(e.textBounds){const t=null==i?void 0:i.imageTextureName,r=new n.Vector2;e.textBounds.getSize(r);const s=l.MipMapGenerator.getPaddedSize(r.x,r.y),o=this.m_imageRepo.findImage(t,s);if(o){const{imageItem:e,imageTexture:t}=o;if(e.loaded)return this.setupTextBackgroundInfo(i,e,r,s,t),!0}this.m_imageRepo.loadImage(t,s).then((e=>{i.isValid=!0})).catch((e=>{h.error(e),i.imageItem=null,i.isValid=!1}))}return!1}reset(){this.m_imageBatchRegistry.reset()}addIcon(e,t,i,n,r,s,a,l){(0,o.assert)(void 0!==e.buffer),s&&(v.computeIconScreenBox(e,t,r,l,this.m_tempScreenBox,g.ALLOCATE),i.allocate(this.m_tempScreenBox)),a>0&&(v.computeIconScreenBox(e,t,r,l,this.m_tempScreenBox,g.NONE),this.m_imageBatchRegistry.addIcon(e,this.m_tempScreenBox,n,a))}addTextBackground(e,t,i,n,r){(0,o.assert)(void 0!==e.buffer),(i=i.clone()).min.x*=r,i.min.y*=r,i.max.x*=r,i.max.y*=r,i.translate(t);const s=new o.Math2D.Box(i.min.x,i.min.y,i.max.x-i.min.x,i.max.y-i.min.y);this.m_imageBatchRegistry.addTextBackground(e,s,n)}update(){this.m_imageBatchRegistry.update()}get layers(){return this.m_layers}render(e,t){this.m_renderer.render(t.scene,e)}pickIconTexts(e,t){this.m_imageBatchRegistry.pickImageTexts(e,t)}getMemoryUsage(e){this.m_imageBatchRegistry.updateMemoryUsage(e)}addLayer(e){let t=this.m_layers.find((t=>t.id===e));return void 0===t&&(t={id:e,scene:new n.Scene},this.m_layers.push(t),this.m_layers.sort(((e,t)=>e.id-t.id))),t}setupTextBackgroundInfo(e,t,i,n,r){var s,a;if((0,o.assert)(void 0===e.uvBox),!t.image)return h.error("setupTextBackgroundInfo: No imageItem/imageData found"),void(e.isValid=!1);const l=t.image.width,c=t.image.height,u=p.trilinear&&t.mipMaps,d=l/(u?n.width:l),m=c/(u?n.height:c);e.computedWidth=null!==(s=null==i?void 0:i.x)&&void 0!==s?s:l,e.computedHeight=null!==(a=null==i?void 0:i.y)&&void 0!==a?a:c,e.uvBox={s0:0,t0:m,s1:d,t1:0},e.imageItem=t,e.imageTexture=r,e.buffer=this.m_imageBatchRegistry.registerImage(e,this.addLayer(e.renderOrder)),e.isValid=!0}setupIconInfo(e,t,i,n){if((0,o.assert)(void 0===e.uvBox),!t.image)return h.error("setupImageInfo: No imageItem/imageData found"),void(e.isValid=!1);const s=e.technique,a=t.image.width,c=t.image.height,u=l.MipMapGenerator.getPaddedSize(a,c),d=p.trilinear&&t.mipMaps,m=d?u.width:a,f=d?u.height:c,g=void 0!==(null==n?void 0:n.width)?n.width:a,v=void 0!==(null==n?void 0:n.height)?n.height:c,y=void 0!==(null==n?void 0:n.width)?n.width:a,_=void 0!==(null==n?void 0:n.height)?n.height:c,x=void 0!==(null==n?void 0:n.xOffset)?n.xOffset:0,b=void 0!==(null==n?void 0:n.yOffset)?n.yOffset:0,w=x/m,M=(x+y)/m,T=b/f,S=(b+_)/f;let E=void 0!==s.iconScale?s.iconScale:1,A=void 0!==s.iconScale?s.iconScale:1;const C=(0,r.getPropertyValue)(s.screenWidth,i);null!=C&&(A=E=C/g);const P=(0,r.getPropertyValue)(s.screenHeight,i);null!=P&&(A=P/v,void 0!==C&&(E=A)),e.computedWidth=g*E,e.computedHeight=v*A,e.uvBox={s0:w,t0:S,s1:M,t1:T},e.uvBoxForPicking={s0:x/a,t0:(b+_)/c,s1:(x+y)/a,t1:b/c},e.imageItem=t,e.imageTexture=n,e.buffer=this.m_imageBatchRegistry.registerImage(e,this.addLayer(e.renderOrder)),e.isValid=!0}}t.ImageRenderer=v},161:(e,t,i)=>{"use strict";
950Object.defineProperty(t,"__esModule",{value:!0}),t.screenToUvCoordinates=t.getPixelFromImage=void 0;const n=i(4342);let r,s;t.getPixelFromImage=function(e,t,i){return i instanceof ImageData?function(e,t,i){const{width:r,height:s,data:o}=e,a=o.length/(s*r);if(!n.MathUtils.isWithinBounds(t,0,r)||!n.MathUtils.isWithinBounds(i,0,s))return;const l=(i*r+t)*a;return o.slice(l,l+a)}(i,e,t):function(e,t,i){const{width:o,height:a}=e instanceof SVGImageElement?e.getBBox():e;if(n.MathUtils.isWithinBounds(t,0,o)&&n.MathUtils.isWithinBounds(i,0,a)&&(r||(r=document.createElement("canvas"),s=r.getContext("2d",{willReadFrequently:!0})),s))return r.width=o,r.height=a,s.drawImage(e,0,0),s.getImageData(t,i,1,1).data}(i,e,t)},t.screenToUvCoordinates=function(e,t,i,r){const s=i.x,o=i.x+i.w,a=i.y,l=i.y+i.h;return{u:n.MathUtils.map(e,s,o,r.s0,r.s1),v:n.MathUtils.map(t,a,l,r.t0,r.t1)}}},6445:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LayoutState=void 0;const n=i(5823);t.LayoutState=class{constructor(e){this.m_hAlign=n.DefaultTextStyle.DEFAULT_HORIZONTAL_ALIGNMENT,this.m_vAlign=n.DefaultTextStyle.DEFAULT_VERTICAL_ALIGNMENT,this.textPlacement=e}set textPlacement(e){this.m_hAlign=(0,n.hAlignFromPlacement)(e.h),this.m_vAlign=(0,n.vAlignFromPlacement)(e.v)}get textPlacement(){return{h:(0,n.hPlacementFromAlignment)(this.m_hAlign),v:(0,n.vPlacementFromAlignment)(this.m_vAlign)}}reset(e){this.m_hAlign=e.horizontalAlignment,this.m_vAlign=e.verticalAlignment}get horizontalAlignment(){return this.m_hAlign}get verticalAlignment(){return this.m_vAlign}}},4957:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SimplePath=t.PathParam=t.SimpleLineCurve=void 0;const n=i(82);class r extends n.LineCurve{constructor(e,t){super(e,t)}getLengths(){return void 0===this.m_lengths&&(this.m_lengths=[0,this.v2.distanceTo(this.v1)]),this.m_lengths}}t.SimpleLineCurve=r;class s{constructor(e,t,i){this.path=e,this.index=t,this.t=i}get curve(){return this.path.curves[this.index]}get point(){return void 0===this.m_point&&(this.m_point=this.curve.getPoint(this.t)),this.m_point}}t.PathParam=s;class o extends n.Path{constructor(){super()}getLengths(){if(this.m_cache)return this.m_cache;let e=0;const t=new Array;return t.push(0),this.curves.forEach((i=>{const n=i;e+=n.v1.distanceTo(n.v2),t.push(e)})),this.m_cache=t,t}getParamAt(e){const t=e*this.getLength(),i=this.getCurveLengths();for(let e=0;e<i.length;++e){if(i[e]<t)continue;const n=i[e]-t,r=this.curves[e].getLength();return new s(this,e,0===r?0:1-n/r)}return null}}t.SimplePath=o},9463:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TextCanvasFactory=void 0;const n=i(5823),r=i(4342);t.TextCanvasFactory=class{constructor(e){this.m_renderer=e,this.m_minGlyphCount=0,this.m_maxGlyphCount=0}setGlyphCountLimits(e,t){this.m_minGlyphCount=e,this.m_maxGlyphCount=t}createTextCanvas(e,t){return(0,r.assert)(this.m_maxGlyphCount>0),new n.TextCanvas({renderer:this.m_renderer,fontCatalog:e,minGlyphCount:this.m_minGlyphCount,maxGlyphCount:this.m_maxGlyphCount,name:t})}}},3800:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TextStyleCache=void 0;const n=i(8152),r=i(5823),s=i(1984),o=i(1667),a=i(4342),l=i(207),c=i(8427),h=i(304),u=a.LoggerManager.instance.create("TextStyleCache"),d=new r.TextRenderStyle({fontSize:{unit:r.FontUnit.Pixel,size:32,backgroundSize:8},color:l.ColorCache.instance.getColor("#6d7477"),opacity:1,backgroundColor:l.ColorCache.instance.getColor("#f7fbfd"),backgroundOpacity:.5}),m=new r.TextLayoutStyle({verticalAlignment:r.VerticalAlignment.Center,horizontalAlignment:r.HorizontalAlignment.Center,placements:[]}),p="default";function f(e,t,i){const n=i?function(e){const t=[];return(e?e.toUpperCase().replace(" ","").split(","):[]).forEach((e=>{const i=function(e){if(e.length<1||e.length>2)return;const t={h:r.HorizontalPlacement.Center,v:r.VerticalPlacement.Center};let i=e.charAt(0),n=!0;switch(i){case s.PlacementToken.Top:case s.PlacementToken.North:t.v=r.VerticalPlacement.Top;break;case s.PlacementToken.Bottom:case s.PlacementToken.South:t.v=r.VerticalPlacement.Bottom;break;default:if(n=!1,2===e.length)return}if(n&&1===e.length)return t;switch(i=1===e.length?e.charAt(0):e.charAt(1),i){case s.PlacementToken.Right:case s.PlacementToken.East:t.h=r.HorizontalPlacement.Right;break;case s.PlacementToken.Left:case s.PlacementToken.West:t.h=r.HorizontalPlacement.Left;break;default:return}return t}(e);void 0!==i&&t.push(i)})),t}(i):void 0;return(0,r.resolvePlacementAndAlignment)(function(e){return"Left"===e||"Center"===e||"Right"===e?r.HorizontalAlignment[e]:m.horizontalAlignment}(e),function(e){return"Above"===e||"Center"===e||"Below"===e?r.VerticalAlignment[e]:m.verticalAlignment}(t),n)}t.TextStyleCache=class{constructor(){this.m_textStyles=new Map,this.m_defaultStyle={name:p,fontCatalog:void 0,renderParams:d.params,layoutParams:m.params},this.updateDefaultTextStyle()}updateTextStyles(e,t){this.m_textStyles.clear(),null==e||e.forEach((e=>{this.m_textStyles.set(e.name,this.createTextStyle(e,e.name))})),this.updateDefaultTextStyle(t,e)}
950updateTextCanvases(e){this.initializeTextCanvas(this.m_defaultStyle,e);for(const[,t]of this.m_textStyles)this.initializeTextCanvas(t,e)}getTextStyle(e){let t;return void 0===e?t=this.m_defaultStyle:(t=this.m_textStyles.get(e),void 0===t&&(t=this.m_defaultStyle)),t}createRenderStyle(e,t){const i=e.mapView,h=i.zoomLevel,u=Math.floor(h),d=new s.MapEnv({$zoom:u},i.env),m=this.m_defaultStyle.renderParams,p=(0,a.getOptionValue)(m.opacity,1);let f,g=(0,n.getPropertyValue)((0,a.getOptionValue)(t.opacity,p),d);if(void 0!==t.color){let e=(0,c.evaluateColorProperty)(t.color,d);void 0!==e&&(o.ColorUtils.hasAlphaInHex(e)&&(g*=o.ColorUtils.getAlphaFromHex(e),e=o.ColorUtils.removeAlphaFromHex(e)),f=l.ColorCache.instance.getColor(e))}const v=(0,a.getOptionValue)(m.fontSize.backgroundSize,0),y=(0,n.getPropertyValue)((0,a.getOptionValue)(t.backgroundSize,v),d),_=void 0!==t.backgroundColor&&void 0!==t.backgroundSize&&y>0,x=(0,a.getOptionValue)(m.backgroundOpacity,0);let b,w=(0,n.getPropertyValue)((0,a.getOptionValue)(t.backgroundOpacity,_?1:x),d);if(void 0!==t.backgroundColor){let e=(0,c.evaluateColorProperty)(t.backgroundColor,d);void 0!==e&&(o.ColorUtils.hasAlphaInHex(e)&&(w*=o.ColorUtils.getAlphaFromHex(e),e=o.ColorUtils.removeAlphaFromHex(e)),b=l.ColorCache.instance.getColor(e))}const M={fontName:(0,a.getOptionValue)(t.fontName,m.fontName),fontSize:{unit:r.FontUnit.Pixel,size:(0,n.getPropertyValue)((0,a.getOptionValue)(t.size,m.fontSize.size),d),backgroundSize:y},fontStyle:"Regular"===t.fontStyle||"Bold"===t.fontStyle||"Italic"===t.fontStyle||"BoldItalic"===t.fontStyle?r.FontStyle[t.fontStyle]:m.fontStyle,fontVariant:"Regular"===t.fontVariant||"AllCaps"===t.fontVariant||"SmallCaps"===t.fontVariant?r.FontVariant[t.fontVariant]:m.fontVariant,rotation:(0,a.getOptionValue)(t.rotation,m.rotation),color:(0,a.getOptionValue)(f,(0,a.getOptionValue)(m.color,r.DefaultTextStyle.DEFAULT_COLOR)),backgroundColor:(0,a.getOptionValue)(b,(0,a.getOptionValue)(m.backgroundColor,r.DefaultTextStyle.DEFAULT_BACKGROUND_COLOR)),opacity:g,backgroundOpacity:w},T=this.getTextStyle(t.style).renderParams;return new r.TextRenderStyle(Object.assign(Object.assign({},T),M))}createLayoutStyle(e,t){var i,o,a,l,c,h;const u=e.mapView,d=Math.floor(e.mapView.zoomLevel),m=new s.MapEnv({$zoom:d},u.env),p=this.m_defaultStyle.layoutParams,g=(0,n.getPropertyValue)(t.hAlignment,m),v=(0,n.getPropertyValue)(t.vAlignment,m),y=(0,s.isIconTextTechnique)(t)?(0,n.getPropertyValue)(t["text-placement"],m):null,{horizontalAlignment:_,verticalAlignment:x,placements:b}=f(g,v,y),w=(0,n.getPropertyValue)(t.wrappingMode,m),M="None"===w||"Character"===w||"Word"===w?r.WrappingMode[w]:p.wrappingMode,T={tracking:null!==(i=(0,n.getPropertyValue)(t.tracking,m))&&void 0!==i?i:p.tracking,leading:null!==(o=(0,n.getPropertyValue)(t.leading,m))&&void 0!==o?o:p.leading,maxLines:null!==(a=(0,n.getPropertyValue)(t.maxLines,m))&&void 0!==a?a:p.maxLines,lineWidth:null!==(l=(0,n.getPropertyValue)(t.lineWidth,m))&&void 0!==l?l:p.lineWidth,canvasRotation:null!==(c=(0,n.getPropertyValue)(t.canvasRotation,m))&&void 0!==c?c:p.canvasRotation,lineRotation:null!==(h=(0,n.getPropertyValue)(t.lineRotation,m))&&void 0!==h?h:p.lineRotation,wrappingMode:M,horizontalAlignment:_,verticalAlignment:x,placements:b},S=this.getTextStyle(t.style);return new r.TextLayoutStyle(Object.assign(Object.assign({},S),T))}updateDefaultTextStyle(e,t){var i,n;this.m_defaultStyle.fontCatalog=void 0;const r=null!==(n=null!==(i=null==t?void 0:t.find((e=>e.name===p)))&&void 0!==i?i:e)&&void 0!==n?n:null==t?void 0:t[0];r&&(this.m_defaultStyle=this.createTextStyle(r,p)),this.m_defaultStyle.textCanvas=void 0}initializeTextCanvas(e,t){var i,n,r;e.textCanvas||(e.textCanvas=null!==(i=e.fontCatalog&&t.has(e.fontCatalog)?t.get(e.fontCatalog):t.get(h.DEFAULT_FONT_CATALOG_NAME))&&void 0!==i?i:t.values().next().value,void 0!==e.fontCatalog&&e.fontCatalog!==(null===(n=e.textCanvas)||void 0===n?void 0:n.name)&&u.warn(`Font catalog '${e.fontCatalog}' set in text style '${e.name}' not found.`+(e.textCanvas?` Using default font catalog ${null===(r=e.textCanvas)||void 0===r?void 0:r.name}`:"")))}createTextStyle(e,t){var i;const{horizontalAlignment:n,verticalAlignment:s,placements:o}=f(e.hAlignment,e.vAlignment,e.placements);return{name:t,fontCatalog:(0,a.getOptionValue)(e.fontCatalogName,this.m_defaultStyle.fontCatalog),renderParams:{fontName:e.fontName,fontSize:{unit:r.FontUnit.Pixel,size:32,backgroundSize:null!==(i=e.backgroundSize)&&void 0!==i?i:8},fontStyle:"Regular"===e.fontStyle||"Bold"===e.fontStyle||"Italic"===e.fontStyle||"BoldItalic"===e.fontStyle?r.FontStyle[e.fontStyle]:void 0,fontVariant:"Regular"===e.fontVariant||"AllCaps"===e.fontVariant||"SmallCaps"===e.fontVariant?r.FontVariant[e.fontVariant]:void 0,rotation:e.rotation,color:void 0!==e.color?l.ColorCache.instance.getColor(e.color):void 0,backgroundColor:void 0!==e.backgroundColor?l.ColorCache.instance.getColor(e.backgroundColor):void 0,opacity:e.opacity,backgroundOpacity:e.backgroundOpacity},layoutParams:{tracking:e.tracking,leading:e.leading,maxLines:e.maxLines,lineWidth:e.lineWidth,canvasRotation:e.canvasRotation,lineRotation:e.lineRotation,wrappingMode:"None"===e.wrappingMode||"Character"===e.wrappingMode||"Word"===e.wrappingMode?r.WrappingMode[e.wrappingMode]:r.WrappingMode.Word,verticalAlignment:s,horizontalAlignment:n,placements:o}}}}},3922:(e,t)=>{"use strict";
950Object.defineProperty(t,"__esModule",{value:!0}),t.TileTextStyleCache=void 0,t.TileTextStyleCache=class{constructor(e){this.textRenderStyles=[],this.textLayoutStyles=[],this.tile=e}clear(){this.textRenderStyles.length=0,this.textLayoutStyles.length=0}getRenderStyle(e){let t=this.textRenderStyles[e._index];return void 0===t&&(t=this.textRenderStyles[e._index]=this.tile.mapView.iconTextRenderer.styleCache.createRenderStyle(this.tile,e)),t}getLayoutStyle(e){let t=this.textLayoutStyles[e._index];return void 0===t&&(t=this.textLayoutStyles[e._index]=this.tile.mapView.iconTextRenderer.styleCache.createLayoutStyle(this.tile,e)),t}}},5159:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ImageCache=void 0;const n=i(9237),r=i(9360);class s{constructor(){this.m_images=new Map}static get instance(){return void 0===s.m_instance&&(s.m_instance=new s),s.m_instance}static dispose(){s.m_instance=void 0}registerImage(e,t){let i=this.findImageCacheItem(t.url);return i?(void 0===e||i.owners.includes(e)||i.owners.push(e),i.imageLikeItem):(i={imageLikeItem:t,owners:[e]},this.m_images.set(t.url,i),i.imageLikeItem)}registerImageByUrl(e,t,i,s=!1){const o=s?new r.SVGMarkupItem(t):new n.ImageItem(t,i);return this.registerImage(e,o)}removeImage(e,t){const i=this.m_images.get(t);return void 0!==i&&(this.unlinkCacheItem(i,e),!0)}findImage(e){const t=this.m_images.get(e);if(void 0!==t)return t.imageLikeItem}clear(e){this.m_images.forEach((t=>{this.unlinkCacheItem(t,e)}))}get size(){return this.m_images.size}findImageCacheItem(e){return this.m_images.get(e)}cancelLoading(e){e.loading&&(e.cancelled=!0)}unlinkCacheItem(e,t){const i=e.owners.indexOf(t);i>=0&&e.owners.splice(i,1),0===e.owners.length&&(this.m_images.delete(e.imageLikeItem.url),this.cancelLoading(e.imageLikeItem))}}t.ImageCache=s},9237:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ImageItem=void 0;const n=i(82),r=i(4342),s=i(6802),o=r.LoggerManager.instance.create("loadImage"),a=new s.MipMapGenerator;t.ImageItem=class{constructor(e,t){this.url=e,this.image=t}get loaded(){return void 0!==this.image&&void 0!==this.mipMaps}get loading(){return void 0!==this.loadingPromise}loadImage(){if(this.loaded)return Promise.resolve(this);if(this.loading)return this.loadingPromise;if(this.image){const e=this.image;return e instanceof HTMLImageElement&&!e.complete?(this.loadingPromise=new Promise(((t,i)=>{e.addEventListener("load",this.finalizeImage.bind(this,e,t)),e.addEventListener("error",i)})),this.loadingPromise):(this.finalizeImage(this.image),Promise.resolve(this))}return this.loadingPromise=new Promise(((e,t)=>{o.debug(`Loading image: ${this.url}`),!0===this.cancelled?(o.debug(`Cancelled loading image: ${this.url}`),e(this)):(new n.ImageLoader).load(this.url,(t=>{if(!0===this.cancelled)return o.debug(`Cancelled loading image: ${this.url}`),void e(this);this.finalizeImage(t,e)}),void 0,(e=>{o.error(`... loading image failed: ${this.url} : ${e}`),this.loadingPromise=void 0,t(`... loading image failed: ${this.url} : ${e}`)}))})),this.loadingPromise}finalizeImage(e,t){this.image=e,this.mipMaps=a.generateTextureAtlasMipMap(this),this.loadingPromise=void 0,t&&t(this)}}},9297:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ImageRepo=void 0;const n=i(5738),r=i(5159),s=i(9237),o=i(9360);t.ImageRepo=class{constructor(){this.m_iconTextManager=new n.IconTextManager}get iconTextManager(){return this.m_iconTextManager}get imageCache(){return r.ImageCache.instance}findImage(e,t){const i=this.m_iconTextManager.getImageTexture(e),n=i?i.image:e;let r;return t&&(r=this.imageCache.findImage(o.SVGMarkupItem.getImageItemUrl(n,t))),r||(r=this.imageCache.findImage(n)),r instanceof s.ImageItem?{imageItem:r,imageTexture:i}:void 0}async loadImage(e,t){const i=this.m_iconTextManager.getImageTexture(e),n=i?i.image:e;let r;if(t){const e=o.SVGMarkupItem.getImageItemUrl(n,t),i=this.imageCache.findImage(e);if(i)r=i;else{const i=this.imageCache.findImage(n);if(i instanceof s.ImageItem)r=i;else if(i instanceof o.SVGMarkupItem){await i.loadImage();const n=this.imageCache.findImage(e);n?r=n:(r=i.createImageItem(t),r&&this.imageCache.registerImage(this,r))}}}else{const e=this.imageCache.findImage(n);e instanceof s.ImageItem&&(r=e)}if(r)return await r.loadImage(),{imageItem:r,imageTexture:i};throw new Error(`${e} image not found`)}clear(){this.imageCache.clear(this)}}},7063:(e,t,i)=>{"use strict";
950Object.defineProperty(t,"__esModule",{value:!0}),t.loadTexture=void 0;const n=i(82),r=i(1984),s=i(4342),o=i(5640),a=i(2119),l=s.LoggerManager.instance.create("LoadTexture");function c(e,t,i,r){const s=new a.TextureHandle;return(new n.ImageLoader).load(e,(e=>{s.image=e,t(s)}),void 0,i),r&&s.addEventListener("dispose",(()=>{URL.revokeObjectURL(e)})),s}function h(e){return"nodeName"in e&&"IMG"===e.nodeName}t.loadTexture=function(e,t,i,s,u,d){const m=t.get(e);if(m)return m.addReference(),null==u||u(m),m;const p=function(e,t,i){if("string"==typeof e)return c(e,t,i,!1);if((0,r.isTextureBuffer)(e))return"image/raw"===e.type?function(e,t,i){const r=e.dataTextureProperties;if(r){const i=r.type?(0,o.toTextureDataType)(r.type):void 0,s=function(e,t){if(void 0===t)return new Uint8Array(e);switch(t){case n.UnsignedByteType:return new Uint8Array(e);case n.ByteType:return new Int8Array(e);case n.ShortType:return new Int16Array(e);case n.UnsignedShortType:return new Uint16Array(e);case n.IntType:return new Int32Array(e);case n.UnsignedIntType:return new Uint32Array(e);case n.FloatType:return new Float32Array(e);case n.HalfFloatType:return new Uint16Array(e)}throw new Error("Unsupported texture data type")}(e.buffer,i),l=r.format?(0,o.toPixelFormat)(r.format):void 0,c=a.TextureHandle.fromBufferSource(s,r.width,r.height,l,i);return t(c),c}i("no data texture properties provided.")}(e,t,i):c(URL.createObjectURL(new Blob([e.buffer],{type:e.type})),t,i,!0);if(h(e)||"nodeName"in(s=e)&&"CANVAS"===s.nodeName){const i=a.TextureHandle.fromHtmlImage(e);if(h(e)&&!e.complete){const n=()=>{t(i),e.removeEventListener("load",n)};e.addEventListener("load",n)}else t(i);return i}if(function(e){return"data"in e&&"width"in e&&"height"in e}(e)){const i=new a.TextureHandle(e);return t(i),i}var s;i("Wrong input type")}(e,(e=>{s?(e.onUpdate=()=>{e.onUpdate=null,null==u||u(e)},s.initTexture(e)):null==u||u(e)}),(e=>{l.error("Failed to load texture: ",e),null==d||d(e)}));return p&&(function(e,t){e.needsUpdate=!0,t&&(void 0!==t.wrapS&&(e.wrapS=(0,o.toWrappingMode)(t.wrapS)),void 0!==t.wrapT&&(e.wrapT=(0,o.toWrappingMode)(t.wrapT)),void 0!==t.magFilter&&(e.magFilter=(0,o.toTextureFilter)(t.magFilter)),void 0!==t.minFilter&&(e.minFilter=(0,o.toTextureFilter)(t.minFilter)),void 0!==t.flipY&&(e.flipY=t.flipY),void 0!==t.repeatU&&(e.repeat.x=t.repeatU),void 0!==t.repeatV&&(e.repeat.y=t.repeatV))}(p,i),t.set(e,p)),p}},6802:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MipMapGenerator=void 0;const n=i(82),r="undefined"==typeof window;function s(){const e=document.createElement("canvas"),t=e.getContext("2d",{willReadFrequently:!0});if(!t)throw new Error("Error getting canvas context.");return[e,t]}class o{static getPaddedSize(e,t){return new n.Vector2(n.MathUtils.ceilPowerOfTwo(e),n.MathUtils.ceilPowerOfTwo(t))}constructor(){r||([this.m_paddingCanvas,this.m_paddingContext]=s(),[this.m_resizeCanvas,this.m_resizeContext]=s())}generateTextureAtlasMipMap(e){if(r)throw new Error("MipMapGenerator only works in browser.");if(void 0===e.image)throw new Error("Can not generate mip maps. Image data not loaded!");const t=e.image,i=[];let{width:n,height:s}=o.getPaddedSize(t.width,t.height);for(this.copyImageWithPadding(t,n,s),i.push(this.m_paddingContext.getImageData(0,0,n,s)),n*=.5,s*=.5;n>=1||s>=1;){const e=i[i.length-1];i.push(this.resizeImage(e,Math.max(n,1),Math.max(s,1))),n*=.5,s*=.5}return i}copyImageWithPadding(e,t,i){return this.m_paddingCanvas.width=t,this.m_paddingCanvas.height=i,this.m_paddingContext.clearRect(0,0,t,i),e instanceof ImageData?this.m_paddingContext.putImageData(e,0,0):this.m_paddingContext.drawImage(e,0,0),e.width!==t&&this.m_paddingContext.drawImage(this.m_paddingCanvas,e.width-1,0,1,e.height,e.width,0,t-e.width,e.height),e.height!==i&&this.m_paddingContext.drawImage(this.m_paddingCanvas,0,e.height-1,t,1,0,e.height,t,i-e.height),this.m_paddingCanvas}resizeImage(e,t,i){const n=this.copyImageWithPadding(e,e.width,e.height);return this.m_resizeCanvas.width=t,this.m_resizeCanvas.height=i,this.m_resizeContext.clearRect(0,0,t,i),this.m_resizeContext.drawImage(n,
9500,0,t,i),this.m_resizeContext.getImageData(0,0,t,i)}}t.MipMapGenerator=o},9360:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SVGMarkupItem=void 0;const n=i(9237);class r{constructor(e){this.url=e,this.m_parser=new DOMParser,this.loaded=!1}get loading(){return void 0!==this.loadingPromise&&!1===this.loaded}get svg(){return this.m_svg}loadImage(){return this.loadingPromise||(this.loadingPromise=fetch(this.url).then((e=>e.text())).then((e=>(this.m_svg=e,this.loaded=!0,this)))),this.loadingPromise}createImageItem(e){if(void 0===this.svg)return;const t=this.m_parser.parseFromString(this.svg,"image/svg+xml").children[0];t.setAttribute("width",`${e.width}`),t.setAttribute("height",`${e.height}`),t.setAttribute("preserveAspectRatio","none");const i=(new XMLSerializer).serializeToString(t),s=new Image;return s.src="data:image/svg+xml;base64,"+btoa(i),new n.ImageItem(r.getImageItemUrl(this.url,e),s)}static getImageItemUrl(e,t){return`${e}-${t.width}-${t.height}`}}t.SVGMarkupItem=r},5996:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TextureCache=void 0;const n=i(8263),r=i(7987);class s extends n.LRUCache{constructor(){super(2e6,r.Object3DUtils.getTextureSize),this.canEvict=(e,t)=>t.referenceCount<=1,this.evictionCallback=(e,t)=>{t.removeReference()}}set(e,t){super.set(e,t),t.addReference()}}t.TextureCache=s},2119:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TextureHandle=void 0;const n=i(82);class r extends n.Texture{static fromBufferSource(e,t,i,s,o){const a=new r(null,void 0,void 0,void 0,n.NearestFilter,n.NearestFilter,s,o);return a.isDataTexture=!0,a.image={data:e,width:t,height:i},a.generateMipmaps=!1,a.flipY=!1,a.unpackAlignment=1,a.needsUpdate=!0,a}static fromHtmlImage(e){const t=new r(e);return t.isCanvasTexture=!0,t}constructor(e,t,i,n,r,s,o,a,l,c){super(e,t,i,n,r,s,o,a,l,c),this.m_refCount=1}addReference(){this.m_refCount++}removeReference(){this.m_refCount>0&&(this.m_refCount--,0===this.m_refCount&&super.dispose())}get referenceCount(){return this.m_refCount}dispose(){this.removeReference()}}t.TextureHandle=r},3638:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isWorkerBootstrapResponse=t.isWorkerBootstrapRequest=void 0,t.isWorkerBootstrapRequest=function(e){return e&&"worker-bootstrap-request"===e.type&&Array.isArray(e.dependencies)},t.isWorkerBootstrapResponse=function(e){return e&&"worker-bootstrap-response"===e.type&&Array.isArray(e.resolvedDependencies)}},1973:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkerLoader=void 0;const n=i(4342),r=i(3638),s=n.LoggerManager.instance.create("WorkerLoader");class o{static startWorker(e,t=1e4){return e.startsWith("blob:")?this.startWorkerImmediately(e,t):this.directlyFallbackToBlobBasedLoading?this.startWorkerBlob(e,t):this.startWorkerImmediately(e,t).catch((i=>{if("undefined"!=typeof window){const r=window.location.href,a=new URL(e,r).href;if((0,n.getUrlOrigin)(a)===(0,n.getUrlOrigin)(r))throw i;return s.log("#startWorker: cross-origin worker construction failed, trying load with blob"),this.directlyFallbackToBlobBasedLoading=!0,o.startWorkerBlob(e,t)}throw i}))}static startWorkerImmediately(e,t){try{const i=new Worker(e);return this.waitWorkerInitialized(i,t)}catch(e){return Promise.reject(e)}}static startWorkerBlob(e,t){return this.fetchScriptSourceToBlobUrl(e).then((e=>this.startWorkerImmediately(e,t)))}static fetchScriptSourceToBlobUrl(e){let t=this.sourceLoaderCache.get(e);return void 0!==t||(t=fetch(e).then((e=>e.text())).catch((e=>{throw new Error(`WorkerLoader#fetchScriptSourceToBlob: failed to load worker script: ${e}`)})).then((t=>{this.sourceLoaderCache.delete(e);const i=new Blob([t],{type:"application/javascript"});return URL.createObjectURL(i)})),this.sourceLoaderCache.set(e,t)),t}static waitWorkerInitialized(e,t){return new Promise(((i,n)=>{const s=t=>{const s=t.data;if((0,r.isWorkerBootstrapRequest)(s)){const t=s.dependencies,i=[];for(const e of t){const t=this.dependencyUrlMapping[e];if(!t)return a(),void n(new Error(`#waitWorkerInitialized: Unable to resolve '${e}' as needed by worker script.`));i.push(t)}const r={type:"worker-bootstrap-response",resolvedDependencies:i};e.postMessage(r)}else a(),i(e),setTimeout((()=>{e.dispatchEvent(t)}),0)},o=e=>{a();let t="Error during worker initialization";e.message&&(t+=`: ${e.message}`),"string"==typeof e.filename&&"number"==typeof e.lineno&&(t+=` in ${e.filename}:${e.lineno}`),n(new Error(t))},a=()=>{clearTimeout(l),e.removeEventListener("message",s),e.removeEventListener("error",o)};e.addEventListener("error",o),e.addEventListener("message",s);const l=setTimeout((()=>{a(),n(new Error("Timeout exceeded when waiting for first message from worker."))}),t)}))}}t.WorkerLoader=o,o.directlyFallbackToBlobBasedLoading=!1,o.sourceLoaderCache=new Map,o.dependencyUrlMapping={}},4250:function(e,t,i){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);
950r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=this&&this.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||n(t,e,i)};Object.defineProperty(t,"__esModule",{value:!0}),r(i(8583),t),r(i(8014),t),r(i(8955),t),r(i(8177),t),r(i(8878),t),r(i(5997),t),r(i(674),t),r(i(4744),t),r(i(4258),t),r(i(398),t),r(i(4919),t),r(i(5551),t),r(i(4821),t),r(i(4877),t),r(i(8484),t),r(i(460),t),r(i(4121),t),r(i(1549),t),r(i(2462),t),r(i(182),t),r(i(872),t),r(i(9489),t),r(i(4067),t),r(i(71),t),r(i(3224),t),r(i(2141),t),r(i(3298),t),r(i(9528),t),r(i(8578),t)},460:function(e,t,i){"use strict";var n=this&&this.__rest||function(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(i[n[r]]=e[n[r]])}return i};Object.defineProperty(t,"__esModule",{value:!0}),t.CirclePointsMaterial=void 0;const r=i(82),s=i(2141),o=i(8578);class a extends s.RawShaderMaterial{constructor(e){const t=new r.Color;let i,s,l,c;if(e){const{size:o,color:h,opacity:u}=e,d=n(e,["size","color","opacity"]);i=o,s=h,l=u,d.name="CirclePointsMaterial",d.vertexShader="\nuniform float size;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\n\nattribute vec3 position;\n\nvoid main() {\n vec3 transformed = vec3(position);\n vec4 mvPosition = modelViewMatrix * vec4(transformed, 1.0);\n\n gl_Position = projectionMatrix * mvPosition;\n gl_PointSize = size;\n}\n",d.fragmentShader="\nprecision highp float;\nprecision highp int;\n\nuniform vec3 diffuseColor;\nuniform float opacity;\n\nvoid main() {\n float alpha = opacity;\n\n float radius = 0.5;\n vec2 coords = gl_PointCoord.xy - vec2(0.5);\n float len = length(coords);\n float falloff = fwidth(len);\n float threshold = 1.0 - smoothstep(radius - falloff, radius, len);\n alpha *= threshold;\n\n gl_FragColor = vec4(diffuseColor, alpha);\n}",d.uniforms=r.UniformsUtils.merge([{size:new r.Uniform(a.DEFAULT_CIRCLE_SIZE),diffuseColor:new r.Uniform(t),opacity:new r.Uniform(1)},r.UniformsLib.fog]),d.depthTest=!1,d.extensions=Object.assign(Object.assign({},d.extensions),{derivatives:!0}),c=d}super(c),(0,o.enforceBlending)(this),this.type="CirclePointsMaterial",this.setOpacity(1),void 0!==i&&(this.size=i),void 0!==s&&(this.color=s),void 0!==l&&this.setOpacity(l)}get size(){return this.uniforms.size.value}set size(e){this.uniforms.size.value=e}get color(){return this.uniforms.diffuseColor.value}set color(e){this.uniforms.diffuseColor.value.copy(e)}}t.CirclePointsMaterial=a,a.DEFAULT_CIRCLE_SIZE=1},4121:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CopyMaterial=t.CopyShader=void 0;const n=i(82);t.CopyShader={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:"\n varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n }",fragmentShader:"\n uniform float opacity;\n uniform sampler2D tDiffuse;\n varying vec2 vUv;\n void main() {\n vec4 texel = texture2D( tDiffuse, vUv );\n gl_FragColor = opacity * texel;\n }"};class r extends n.ShaderMaterial{constructor(e){super({name:"CopyMaterial",uniforms:e,vertexShader:t.CopyShader.vertexShader,fragmentShader:t.CopyShader.fragmentShader,premultipliedAlpha:!0,transparent:!1,blending:n.NoBlending,depthTest:!1,depthWrite:!1})}}t.CopyMaterial=r},1549:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EdgeMaterial=void 0;const n=i(82),r=i(8014),s=i(8955),o=i(8177),a=i(2141),l=i(8578);class c extends a.RawShaderMaterial{constructor(e){var t;let i;if(e){const r={},a=void 0!==e.extrusionRatio&&e.extrusionRatio>=s.ExtrusionFeatureDefs.DEFAULT_RATIO_MIN&&e.extrusionRatio<s.ExtrusionFeatureDefs.DEFAULT_RATIO_MAX;e.displacementMap&&(0,l.setShaderDefine)(r,"USE_DISPLACEMENTMAP",!0),a&&(0,l.setShaderDefine)(r,"USE_EXTRUSION",!0),!0===e.vertexColors&&(0,l.setShaderDefine)(r,"USE_COLOR",!0),i={name:"EdgeMaterial",vertexShader:"\n#define EDGE_DEPTH_OFFSET 0.0001\n\n#ifdef USE_COLOR\nattribute vec4 color;\n#else\nuniform vec3 color;\n#endif\n\n// SHADER_NAME may be defined by THREE.JS own shaders in which case these attributes & uniforms are\n// already defined\n#ifndef SHADER_NAME\nattribute vec3 position;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat3 normalMatrix;\n#endif\n\nuniform vec3 edgeColor;\nuniform float edgeColorMix;\n\n#ifdef USE_DISPLACEMENTMAP\nattribute vec3 normal;\nattribute vec2 uv;\nuniform sampler2D displacementMap;\n#endif\n\nvarying vec3 vColor;\n\n#ifdef USE_EXTRUSION\n#include <extrusion_pars_vertex>\n#endif\n\n#ifdef USE_FADING\n#include <fading_pars_vertex>\n#endif\n\nvoid main() {\n\n vColor = mix(edgeColor.rgb, color.rgb, edgeColorMix);\n\n vec3 transformed = vec3( position );\n\n #ifdef USE_EXTRUSION\n #include <extrusion_vertex>\n #endif\n\n #ifdef USE_DISPLACEMENTMAP\n transformed += normalize( normal ) * texture2D( displacementMap, uv ).x;\n #endif\n\n vec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\n\n gl_Position = projectionMatrix * mvPosition;\n // After projection gl_Position contains clip space coordinates of each vertex\n // before perspective division (1 / w), thus only vertexes with -w < z < w should\n // be displayed and offset. We offset only those edges which z coordinate in NDC\n // space is between: -inf < z < 1\n float depthOffset = step(-1.0, -gl_Position.z / gl_Position.w) * EDGE_DEPTH_OFFSET;\n gl_Position.z -= depthOffset;\n\n #ifdef USE_FADING\n #include <fading_vertex>\n #endif\n}",fragmentShader:"\nprecision highp float;\nprecision highp int;\n\nvarying vec3 vColor;\n\n#ifdef USE_EXTRUSION\n#include <extrusion_pars_fragment>\n#endif\n\n#ifdef USE_FADING\n#include <fading_pars_fragment>\n#endif\n\nvoid main() {\n float alphaValue = 1.0;\n gl_FragColor = vec4(vColor, alphaValue);\n\n #ifdef USE_EXTRUSION\n #include <extrusion_fragment>\n #endif\n\n #ifdef USE_FADING\n #include <fading_fragment>\n #endif\n}",uniforms:{color:new n.Uniform(new n.Color(c.DEFAULT_COLOR)),edgeColor:new n.Uniform(new n.Color(c.DEFAULT_COLOR)),edgeColorMix:new n.Uniform(c.DEFAULT_COLOR_MIX),fadeNear:new n.Uniform(o.FadingFeature.DEFAULT_FADE_NEAR),fadeFar:new n.Uniform(o.FadingFeature.DEFAULT_FADE_FAR),extrusionRatio:new n.Uniform(s.ExtrusionFeatureDefs.DEFAULT_RATIO_MAX),displacementMap:new n.Uniform(null!==(t=e.displacementMap)&&void 0!==t?t:new n.Texture)},depthWrite:!1,defines:r,rendererCapabilities:e.rendererCapabilities}}super(i),(0,l.enforceBlending)(this),o.FadingFeature.patchGlobalShaderChunks(),r.ExtrusionFeature.patchGlobalShaderChunks(),void 0!==e&&(void 0!==e.color&&this.color.set(e.color),void 0!==e.colorMix&&(this.colorMix=e.colorMix),void 0!==e.fadeNear&&(this.fadeNear=e.fadeNear),void 0!==e.fadeFar&&(this.fadeFar=e.fadeFar),void 0!==e.displacementMap&&(this.displacementMap=e.displacementMap),void 0!==e.extrusionRatio&&(this.extrusionRatio=e.extrusionRatio))}get objectColor(){return this.uniforms.color.value}set objectColor(e){this.uniforms.color.value.copy(e)}get color(){return this.uniforms.edgeColor.value}set color(e){this.uniforms.edgeColor.value.copy(e)}get lineWidth(){return this.linewidth}set lineWidth(e){this.linewidth=e,this.linewidth<=0?this.visible=!1:this.visible=!0}get colorMix(){return this.uniforms.edgeColorMix.value}set colorMix(e){this.uniforms.edgeColorMix.value!==e&&(this.uniforms.edgeColorMix.value=e)}get fadeNear(){return this.uniforms.fadeNear.value}set fadeNear(e){this.uniforms.fadeNear.value=e}get fadeFar(){return this.uniforms.fadeFar.value}set fadeFar(e){this.uniforms.fadeFar.value!==e&&(this.uniforms.fadeFar.value=e,(0,l.setShaderMaterialDefine)(this,"USE_FADING",e>0))}get extrusionRatio(){return this.uniforms.extrusionRatio.value}set extrusionRatio(e){if(this.uniforms.extrusionRatio.value===e)return;this.uniforms.extrusionRatio.value=e;const t=e>=s.ExtrusionFeatureDefs.DEFAULT_RATIO_MIN;(0,l.setShaderMaterialDefine)(this,"USE_EXTRUSION",t)}get displacementMap(){return this.uniforms.displacementMap.value}set displacementMap(e){if(this.uniforms.displacementMap.value===e)return;this.uniforms.displacementMap.value=e;const t=null!==e;t&&(this.uniforms.displacementMap.value.needsUpdate=!0),(0,l.setShaderMaterialDefine)(this,"USE_DISPLACEMENTMAP",t)}}t.EdgeMaterial=c,c.DEFAULT_COLOR=0,c.DEFAULT_COLOR_MIX=0},2462:(e,t,i)=>{"use strict";
950Object.defineProperty(t,"__esModule",{value:!0}),t.GroundAtmosphereMaterial=t.GroundAtmosphereShader=void 0;const n=i(82),r=i(2141),s=i(1870),o=i(8578);t.GroundAtmosphereShader={uniforms:{u_eyePositionWorld:new n.Uniform(new n.Vector3),u_lightDirectionWorld:new n.Uniform(new n.Vector3(0,1,0)),u_modelViewProjection:new n.Uniform(new n.Matrix4),u_atmosphereEnv:new n.Uniform(new n.Vector3(6384515.136999999,6537590.425,0)),u_hsvCorrection:new n.Uniform(new n.Vector3(0,0,0)),topColor:new n.Uniform(new n.Color(30719)),bottomColor:new n.Uniform(new n.Color(16777215)),offset:new n.Uniform(33),exponent:new n.Uniform(.6),fogColor:new n.Uniform(new n.Color(30719)),fogNear:new n.Uniform(new n.Color(30719)),fogFar:new n.Uniform(new n.Color(16777215))},vertexShader:`\n\n #define IMPROVE_INTERSECT_PRECISION 1\n #define IMPROVE_DOT_PRECISION 1\n\n precision highp float;\n precision highp int;\n\n attribute vec4 position;\n\n // Base mandatory uniforms\n uniform mat4 u_modelViewProjection;\n uniform vec3 u_eyePositionWorld;\n uniform vec3 u_lightDirectionWorld;\n\n uniform vec3 u_atmosphereEnv; // Atmosphere inner and outer radius, camera height\n uniform vec3 u_hsvCorrection;\n\n const float Pi = 3.141592653589793;\n const float Kr = 0.0025;\n const float Km = 0.0015;\n const float Kr4PI = Kr * 4.0 * Pi;\n const float Km4PI = Km * 4.0 * Pi;\n const float ESun = 25.0; // should be 15.0\n const float KmESun = Km * ESun;\n const float KrESun = Kr * ESun;\n const vec3 InvWavelength = vec3(\n 1.0 / pow(0.650, 4.0), // Red\n 1.0 / pow(0.570, 4.0), // Green\n 1.0 / pow(0.475, 4.0)); // Blue\n\n const int nSamples = 2;\n const float fSamples = 2.0;\n\n varying vec3 v_rayleighColor;\n varying vec3 v_mieColor;\n varying vec3 v_vertToCamera;\n varying vec3 v_vertToOrigin;\n\n ${s.default.atmosphere_vertex_utils}\n\n //\n // Computes rayleight and mia atmosphere factors for ground.\n //\n // Code based on GPU Gems article.\n //\n // Author: Sean O'Neil\n //\n // Copyright (c) 2004 Sean O'Neil\n //\n // https://developer.nvidia.com/gpugems/gpugems2/part-ii-shading-lighting-and-shadows/chapter-16-accurate-atmospheric-scattering\n //\n // Further modifications by HERE.\n //\n AtmosphereColor computeGroundAtmosphere(vec3 v3Pos, vec3 vLightDir)\n {\n // Retrieve environment variables\n float fInnerRadius = u_atmosphereEnv.x;\n float fOuterRadius = u_atmosphereEnv.y;\n float fCameraHeight = u_atmosphereEnv.z;\n\n // All that may be moved to const or define(s) at further optimizations:\n float fScale = 1.0 / (fOuterRadius - fInnerRadius);\n float fScaleOverScaleDepth = fScale / RayleighScaleDepth;\n float fCameraHeight2 = fCameraHeight * fCameraHeight;\n float fOuterRadius2 = fOuterRadius * fOuterRadius;\n\n // Get the ray from the camera to the vertex and its length (which is the far point of the ray passing through the atmosphere)\n vec3 v3Ray = v3Pos - u_eyePositionWorld;\n float fFar = length(v3Ray);\n v3Ray /= fFar;\n\n#if !defined(IMPROVE_DOT_PRECISION)\n vec3 v3Dir = normalize(v3Pos);\n#endif\n\n#ifdef CAMERA_IN_SPACE\n\n // Calculate first point of camera ray and sphere intersection.\n float fNear = getNearSphereIntersect(u_eyePositionWorld, v3Ray, fCameraHeight2, fOuterRadius2);\n // Make far relative to first atmosphere intersection, setting it to\n // the length of ray passed through atmosphere\n fFar -= fNear;\n\n // Compute the ray's starting position within the atmosphere, then\n // calculate its scattering offset\n vec3 v3Start = u_eyePositionWorld + v3Ray * fNear;\n float fDepth = exp((fInnerRadius - fOuterRadius) / RayleighScaleDepth);\n\n#else // CAMERA_IN_ATMOSPHERE\n\n // The ray starts already in atmosphere\n vec3 v3Start = u_eyePositionWorld;\n // Virtually fNear is just at eye position, so ray passing through atmosphere does not shorten\n // fFar -= 0.0;\n float fDepth = exp((fInnerRadius - fCameraHeight) / RayleighScaleDepth);\n#endif\n\n#if defined(IMPROVE_DOT_PRECISION)\n float fCameraAngle = dot(-v3Ray, v3Pos) / length(v3Pos);\n#else\n float fCameraAngle = dot(-v3Ray, v3Dir);\n#endif\n float fCameraScale = scale(fCameraAngle);\n\n#ifdef DYNAMIC_LIGHT\n // When we want the atmosphere to be uniform over the globe so it is set to 1.0.\n #if defined(IMPROVE_DOT_PRECISION)\n // The light angle for given light source may be calculated as:\n // angle = dot(vLightDir, v3Dir) / length(v3Dir);\n // where v3Dir holds normalized vertex position, but for precision issues we v3Pos (un-normalized)\n float fLightAngle = dot(vLightDir, v3Pos) / length(v3Pos);\n #else\n float fLightAngle = dot(vLightDir, v3Dir);\n #endif\n#else\n float fLightAngle = 1.0;\n#endif\n float fLightScale = scale(fLightAngle);\n\n float fCameraOffset = fDepth * fCameraScale;\n float fTemp = (fLightScale + fCameraScale);\n\n // Initialize the scattering loop variables\n float fSampleLength = fFar / fSamples;\n float fScaledLength = fSampleLength * fScale;\n vec3 v3SampleRay = v3Ray * fSampleLength;\n vec3 v3SamplePoint = v3Start + v3SampleRay * 0.5;\n\n // Now loop through the sample rays\n vec3 v3BaseColor = vec3(0.0);\n vec3 v3Attenuate = vec3(0.0);\n for(int i = 0; i < nSamples; i++)\n {\n float fHeight = length(v3SamplePoint);\n float fDepth = exp(fScaleOverScaleDepth * (fInnerRadius - fHeight));\n float fScatter = fDepth * fTemp - fCameraOffset;\n // Compute color factors\n v3Attenuate = exp(-fScatter * (InvWavelength * Kr4PI + Km4PI));\n v3BaseColor += v3Attenuate * (fDepth * fScaledLength);\n // Move to the next point\n v3SamplePoint += v3SampleRay;\n }\n\n AtmosphereColor color;\n color.mie = v3BaseColor * (InvWavelength * KrESun + KmESun);\n // Calculate the attenuation factor for the ground\n color.rayleigh = v3Attenuate;\n\n return color;\n }\n\n void main(void)\n {\n #ifdef DYNAMIC_LIGHT\n vec3 vLightDir = u_lightDirectionWorld;\n #else\n vec3 vLightDir = u_eyePositionWorld;\n #endif\n vLightDir = normalize(vLightDir);\n\n AtmosphereColor atmColor = computeGroundAtmosphere(position.xyz, vLightDir);\n v_mieColor = atmColor.mie;\n v_rayleighColor = atmColor.rayleigh;\n v_vertToCamera = u_eyePositionWorld - position.xyz;\n v_vertToOrigin = normalize(position.xyz);\n\n gl_Position = u_modelViewProjection * position;\n }\n `,fragmentShader:`\n\n // Exposure correction gives more subtle gradients on the ground.\n #define CORRECT_EXPOSURE 1\n #define FADE_DEPTH 1\n #define NIGHT_LOCAL 1\n\n precision highp float;\n precision highp int;\n\n #ifdef CORRECT_COLOR\n uniform vec3 u_hsvCorrection; // Hue, saturation, brightness\n #endif\n\n uniform vec3 u_atmosphereEnv; // Atmosphere inner and outer radius, camera height\n uniform vec3 u_eyePositionWorld;\n uniform vec3 u_lightDirectionWorld;\n\n const float g = -0.95;\n const float g2 = g * g;\n\n varying vec3 v_rayleighColor;\n varying vec3 v_mieColor;\n varying vec3 v_vertToCamera;\n varying vec3 v_vertToOrigin;\n\n ${s.default.atmosphere_fragment_utils}\n\n void main(void)\n {\n float fInnerRadius = u_atmosphereEnv.x;\n float fOuterRadius = u_atmosphereEnv.y;\n float fCameraHeight = u_atmosphereEnv.z;\n\n #ifdef DYNAMIC_LIGHT\n vec3 vLightDir = u_lightDirectionWorld;\n #else\n vec3 vLightDir = u_eyePositionWorld;\n #endif\n vLightDir = normalize(vLightDir);\n\n // GPU gems mix of ground solution, with custom alpha settings\n vec3 cRgb = v_mieColor + 0.25 * v_rayleighColor;\n\n // Not needed for HDR frame buffer\n #if !defined(HDR_FRAME_BUFFER) && defined(CORRECT_EXPOSURE)\n // Interesting results with exposure factor: 2.0, 3.5, 4.0\n cRgb = correctExposure(cRgb, 3.0);\n #endif\n\n #ifdef CORRECT_COLOR\n cRgb = correctColor(cRgb, u_hsvCorrection);\n #endif\n\n // Base atmosphere opacity\n float fAtmosphereAlpha = 1.0;\n\n // Factor based on the distance of camera atmosphere and ground, results are:\n // 0.0 = camera on the ground surface,\n // 1.0 = at the outer edge of the atmosphere.\n float fDepthFactor = clamp((fCameraHeight - fInnerRadius) /\n (fOuterRadius - fInnerRadius), 0.0, 1.0);\n #ifdef FADE_DEPTH\n // Fade alpha based on the distance of camera between atmosphere layers\n #ifdef FADE_DEPTH_
950LINEAR\n fAtmosphereAlpha *= fDepthFactor;\n #else\n fAtmosphereAlpha *= pow(fDepthFactor, 1.5);\n #endif\n #endif\n\n#if defined(FADE_NIGHT) || defined(DARKEN_NIGHT)\n #ifdef DYNAMIC_LIGHT\n // Adjust factor based on time of day, results are:\n // 0.0 = night,\n // 1.0 = day.\n #ifdef NIGHT_GLOBAL\n // Global night fade based on camera and light orientation\n float fNightFactor = clamp(dot(normalize(u_eyePositionWorld), vLightDir), 0.0, 1.0);\n fNightFactor = pow(fNightFactor, 0.5);\n #else // NIGHT_LOCAL\n float fNightFactor =\n clamp(dot(v_vertToOrigin, vLightDir) / length(v_vertToOrigin), 0.0, 1.0);\n fNightFactor = pow(fNightFactor, 0.8);\n #endif\n #else\n float fNightFactor = 1.0;\n #endif\n#endif\n\n #ifdef FADE_NIGHT\n // Adjust alpha for night side of the globe\n fAtmosphereAlpha *= fNightFactor;\n #endif\n\n #ifdef DARKEN_NIGHT\n // Change the brightness depending on night / day side.\n // NOTE: Darkening should be rather applied in HSV space, without loss on saturation,\n // but it is much more GPU consuming.\n const float minBrightness = 0.5;\n float fDarkenFactor = clamp(fNightFactor, minBrightness, 1.0);\n cRgb *= fDarkenFactor;\n #endif\n\n #ifdef EXPOSURE_DEPTH\n // Control exposure depending from ground distance\n float exposureBoost = 3.0 - fDepthFactor;\n cRgb = correctExposure(cRgb, exposureBoost);\n #endif\n\n // Experimental fading out of focus point - similar to fresnel effect in top view.\n // This fade is handy to better expose cartographic/map features in screen center.\n float fFocusFactor = 1.0 - clamp(dot(normalize(v_vertToCamera), v_vertToOrigin), 0.0, 1.0) + 0.1;\n fFocusFactor = pow(fFocusFactor, 2.5);\n fAtmosphereAlpha *= fFocusFactor;\n\n // Integrate all features\n gl_FragColor = vec4(cRgb, fAtmosphereAlpha);\n }\n `};
950class a extends r.RawShaderMaterial{constructor(e){let i;e&&(i={name:"GroundAtmosphereMaterial",vertexShader:t.GroundAtmosphereShader.vertexShader,fragmentShader:t.GroundAtmosphereShader.fragmentShader,uniforms:t.GroundAtmosphereShader.uniforms,transparent:!0,depthTest:!1,depthWrite:!1,side:n.FrontSide,blending:n.NormalBlending,fog:!1,rendererCapabilities:e.rendererCapabilities}),super(i)}setDynamicLighting(e){(0,o.setShaderMaterialDefine)(this,"DYNAMIC_LIGHT",e)}set outerRadius(e){this.uniforms.u_atmosphereEnv.value.y=e}get outerRadius(){return this.uniforms.u_atmosphereEnv.value.y}set innerRadius(e){this.uniforms.u_atmosphereEnv.value.x=e}get innerRadius(){return this.uniforms.u_atmosphereEnv.value.x}updateUniforms(e,t,i,n){const r=this.getCameraInfo(t,i);if(void 0===e||!e.isMaterial)throw Error("Wrong object used, only Material objects are supported");if(!(e.uniforms&&e.uniforms.u_atmosphereEnv&&e.uniforms.u_hsvCorrection&&e.uniforms.u_eyePositionWorld&&e.uniforms.u_modelViewProjection&&e.uniforms.u_lightDirectionWorld))throw Error("Atmosphere material has missing uniforms");{const t=r.eyePos,i=r.modelViewProjection,s=r.eyeHeight;e.uniforms.u_eyePositionWorld.value.copy(t),e.uniforms.u_modelViewProjection.value.copy(i),e.uniforms.u_atmosphereEnv.value.z=s,e.uniforms.u_lightDirectionWorld.value=n.clone();const a=s>this.outerRadius,l=(0,o.setShaderDefine)(e.defines,"CAMERA_IN_SPACE",a),c=(0,o.setShaderDefine)(e.defines,"CAMERA_IN_ATMOSPHERE",!a);e.needsUpdate=e.needsUpdate||l||c}}getCameraInfo(e,t,i=!1){if(i){const i=(new n.Matrix4).identity(),r=(new n.Matrix4).copy(e.matrixWorld).invert().transpose(),s=t.projectionMatrix,o=new n.Matrix4;o.multiplyMatrices(r,i),o.multiplyMatrices(s,o);const a=new n.Vector3;e.getWorldPosition(a);const l=new n.Vector3;return t.getWorldPosition(l),{modelViewProjection:o,eyePos:a,eyeHeight:l.distanceTo(a)}}{const i=e.matrixWorld,r=t.matrixWorldInverse,s=t.projectionMatrix,o=new n.Matrix4;o.multiplyMatrices(r,i),o.multiplyMatrices(s,o);const a=new n.Vector3;t.getWorldPosition(a);const l=new n.Vector3;e.getWorldPosition(l);const c=l.distanceTo(a);return a.sub(l),{modelViewProjection:o,eyePos:a,eyeHeight:c}}}}t.GroundAtmosphereMaterial=a},182:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isHighPrecisionLineMaterial=t.HighPrecisionLineMaterial=void 0;const n=i(82),r=i(2141),s=i(7133);
950class o extends r.RawShaderMaterial{constructor(e){Object.assign(n.ShaderChunk,s.default);const t=e?{name:"HighPrecisionLineMaterial",vertexShader:"\n#ifdef USE_COLOR\nattribute vec4 color;\nvarying vec3 vColor;\n#endif\n\n// uniforms to implement double-precision\nuniform mat4 u_mvp; // combined modelView and projection matrix\nuniform vec3 u_eyepos; // eye position major\nuniform vec3 u_eyepos_lowpart; // eye position minor ((double) eyepos - (float) eyepos)\n\n// vertex attributes\nattribute vec3 position; // high part\nattribute vec3 positionLow; // low part\n\n#include <high_precision_vert_func>\n\nvoid main() {\n #ifdef USE_COLOR\n vColor = color.rgb;\n #endif\n\n vec3 pos = subtractDblEyePos(position);\n gl_Position = u_mvp * vec4(pos, 1.0);\n}",fragmentShader:"\nprecision highp float;\nprecision highp int;\n\nuniform vec3 diffuseColor;\nuniform float opacity;\n\n#ifdef USE_COLOR\nvarying vec3 color;\n#endif\n\nvoid main() {\n #ifdef USE_COLOR\n gl_FragColor = vec4( diffuseColor * vColor, opacity );\n #else\n gl_FragColor = vec4( diffuseColor, opacity );\n #endif\n}",uniforms:{diffuseColor:new n.Uniform(new n.Color(o.DEFAULT_COLOR)),opacity:new n.Uniform(o.DEFAULT_OPACITY),u_mvp:new n.Uniform(new n.Matrix4),u_eyepos:new n.Uniform(new n.Vector3),u_eyepos_lowpart:new n.Uniform(new n.Vector3)},rendererCapabilities:e.rendererCapabilities}:void 0;t&&Object.assign(t,e),super(t),this.type="HighPrecisionLineMaterial",this.isHighPrecisionLineMaterial=!0,e&&(void 0!==e.color&&this.color.set(e.color),void 0!==e.opacity&&(this.opacity=e.opacity)),this.updateTransparencyFeature()}get color(){return this.uniforms.diffuseColor.value}set color(e){this.uniforms.diffuseColor.value.copy(e)}updateTransparencyFeature(){this.transparent=this.opacity<1}}t.HighPrecisionLineMaterial=o,o.DEFAULT_COLOR=80,o.DEFAULT_OPACITY=1,t.isHighPrecisionLineMaterial=function(e){return void 0!==e&&!0===e.isHighPrecisionLineMaterial}},872:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isHighPrecisionPointMaterial=t.HighPrecisionPointMaterial=void 0;const n=i(82),r=i(7133);class s extends n.PointsMaterial{constructor(e){Object.assign(n.ShaderChunk,r.default),super(e),this.type="HighPrecisionPointMaterial",this.vertexShader="\n#ifdef USE_COLOR\nvarying vec3 vColor;\n#endif\n\nuniform float size;\n\n// uniforms to implement double-precision\nuniform mat4 u_mvp; // combined modelView and projection matrix\nuniform vec3 u_eyepos; // eye position major\nuniform vec3 u_eyepos_lowpart; // eye position minor ((double) eyepos - (float) eyepos)\n\n// vertex attributes\nattribute vec3 positionLow; // low part\n\n#include <high_precision_vert_func>\n\nvoid main() {\n #ifdef USE_COLOR\n vColor = color.rgb;\n #endif\n\n vec3 pos = subtractDblEyePos(position);\n gl_Position = u_mvp * vec4(pos, 1.0);\n\n // ignore sizeAttenuation for now!\n gl_PointSize = size;\n}",this.fragmentShader=n.ShaderChunk.points_frag,this.fog=!1,this.uniforms={diffuseColor:new n.Uniform(new n.Color(s.DEFAULT_COLOR)),opacity:new n.Uniform(s.DEFAULT_OPACITY),size:new n.Uniform(s.DEFAULT_SIZE),scale:new n.Uniform(s.DEFAULT_SCALE),map:new n.Uniform(new n.Texture),uvTransform:new n.Uniform(new n.Matrix3),u_mvp:new n.Uniform(new n.Matrix4),u_eyepos:new n.Uniform(new n.Vector3),u_eyepos_lowpart:new n.Uniform(new n.Vector3)},this.isHighPrecisionPointMaterial=!0,void 0!==e&&(void 0!==e.color&&this.color.set(e.color),void 0!==e.opacity&&(this.opacity=e.opacity),void 0!==e.size&&(this.size=e.size),void 0!==e.scale&&(this.scale=e.scale),void 0!==e.uvTransform&&(this.uvTransform=e.uvTransform),void 0!==e.map&&(this.map=e.map))}get scale(){return this.uniforms.scale.value}set scale(e){this.uniforms.scale.value=e}get uvTransform(){return this.uniforms.uvTransform.value}set uvTransform(e){this.uniforms.uvTransform.value=e}}t.HighPrecisionPointMaterial=s,s.DEFAULT_COLOR=80,s.DEFAULT_OPACITY=1,s.DEFAULT_SIZE=1,s.DEFAULT_SCALE=1,t.isHighPrecisionPointMaterial=function(e){return void 0!==e&&!0===e.isHighPrecisionPointMaterial}},9489:(e,t,i)=>{"use strict";
950Object.defineProperty(t,"__esModule",{value:!0}),t.IconMaterial=void 0;const n=i(82),r=i(2141);class s extends r.RawShaderMaterial{constructor(e){super(e?{name:"IconMaterial",vertexShader:"\nattribute vec4 position;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\n\nvarying vec4 vColor;\nvarying vec2 vUv;\n\nvoid main() {\n vUv = uv;\n vColor = color;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position.xyz, 1.0);\n}",fragmentShader:"\nprecision highp float;\nprecision highp int;\n\nuniform sampler2D map;\n\nvarying vec4 vColor;\nvarying vec2 vUv;\n\nvoid main() {\n\n vec4 color = texture2D(map, vUv.xy);\n color *= vColor;\n if (color.a < 0.05) {\n discard;\n }\n gl_FragColor = color;\n}",uniforms:{map:new n.Uniform(e.map)},depthTest:!1,depthWrite:!1,transparent:!0,vertexColors:!0,premultipliedAlpha:!0,rendererCapabilities:e.rendererCapabilities}:void 0)}get map(){return this.uniforms.map.value}}t.IconMaterial=s},3224:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MSAAMaterial=void 0;const n=i(82),r=i(4121);class s extends n.ShaderMaterial{constructor(e){super({uniforms:e,vertexShader:r.CopyShader.vertexShader,fragmentShader:r.CopyShader.fragmentShader,premultipliedAlpha:!0,transparent:!0,blending:n.AdditiveBlending,depthTest:!1,depthWrite:!1})}}t.MSAAMaterial=s},4821:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MapMeshBasicMaterial=void 0;const n=i(82),r=i(4342),s=i(4744),o=i(8014),a=i(8955),l=i(8177),c=i(4258),h=i(8878),u=i(5997),d=i(674);class m extends n.MeshBasicMaterial{constructor(e){super(e),l.FadingFeature.patchGlobalShaderChunks(),this.addFadingProperties(),this.applyFadingParameters(e),o.ExtrusionFeature.patchGlobalShaderChunks(),this.addExtrusionProperties(),this.applyExtrusionParameters(Object.assign(Object.assign({},e),{zFightingWorkaround:!0})),this.addDisplacementProperties(),this.applyDisplacementParameters(e),s.ColorCorrectionFeature.patchGlobalShaderChunks(),this.addColorCorrectionProperties(),this.applyColorCorrectionParameters(e)}clone(){return(new m).copy(this)}copy(e){return super.copy(e),this.copyFadingParameters(e),this.copyExtrusionParameters(e),this.copyDisplacementParameters(e),this.copyColorCorrectionParameters(e),this}get fadeNear(){return l.FadingFeature.DEFAULT_FADE_NEAR}set fadeNear(e){}get fadeFar(){return l.FadingFeature.DEFAULT_FADE_FAR}set fadeFar(e){}set brightness(e){}get brightness(){return s.ColorCorrectionFeature.DEFAULT_BRIGHTNESS}set gamma(e){}get gamma(){return s.ColorCorrectionFeature.DEFAULT_GAMMA}get extrusionRatio(){return a.ExtrusionFeatureDefs.DEFAULT_RATIO_MAX}set extrusionRatio(e){}get displacementMap(){return null}set displacementMap(e){}setDisplacementMap(e){}addFadingProperties(){}applyFadingParameters(e){}copyFadingParameters(e){}addExtrusionProperties(){}applyExtrusionParameters(e){}copyExtrusionParameters(e){}addDisplacementProperties(){}copyColorCorrectionParameters(e){}applyDisplacementParameters(e){}copyDisplacementParameters(e){}addColorCorrectionProperties(){}applyColorCorrectionParameters(e){}}t.MapMeshBasicMaterial=m,(0,r.applyMixinsWithoutProperties)(m,[d.FadingFeatureMixin]),(0,r.applyMixinsWithoutProperties)(m,[u.ExtrusionFeatureMixin]),(0,r.applyMixinsWithoutProperties)(m,[h.DisplacementFeatureMixin]),(0,r.applyMixinsWithoutProperties)(m,[c.ColorCorrectionFeatureMixin])},8484:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MapMeshDepthMaterial=void 0;const n=i(82),r=i(4342),s=i(8014),o=i(8955),a=i(5997);class l extends n.MeshDepthMaterial{constructor(e){super(e),s.ExtrusionFeature.patchGlobalShaderChunks(),this.addExtrusionProperties(),this.applyExtrusionParameters(Object.assign(Object.assign({},e),{zFightingWorkaround:!1}))}get extrusionRatio(){return o.ExtrusionFeatureDefs.DEFAULT_RATIO_MAX}set extrusionRatio(e){}addExtrusionProperties(){}applyExtrusionParameters(e){}copyExtrusionParameters(e){}}t.MapMeshDepthMaterial=l,(0,r.applyMixinsWithoutProperties)(l,[a.ExtrusionFeatureMixin])},4877:(e,t,i)=>{"use strict";
950Object.defineProperty(t,"__esModule",{value:!0}),t.MapMeshPhongMaterial=void 0;const n=i(82),r=i(4342),s=i(8014),o=i(8955),a=i(8177),l=i(71),c=i(5997),h=i(674),u=i(5089);class d extends n.MeshPhongMaterial{constructor(e){var t;super(e),a.FadingFeature.patchGlobalShaderChunks(),this.addFadingProperties(),this.applyFadingParameters(e),s.ExtrusionFeature.patchGlobalShaderChunks(),this.addExtrusionProperties(),this.applyExtrusionParameters(Object.assign(Object.assign({},e),{zFightingWorkaround:!0})),this.m_colorIntensity=null!==(t=null==e?void 0:e.colorIntensity)&&void 0!==t?t:1,this.onBeforeCompile=(0,r.chainCallbacks)(this.onBeforeCompile,(e=>{(0,l.linkMixinWithShader)(this,e),e.fragmentShader=e.fragmentShader.replace("#include <lights_phong_pars_fragment>",`#include <lights_phong_pars_fragment>\n ${u.blinnPhongNoSpecular}\n `)})),(0,l.linkMixinWithMaterial)(this,this),(0,r.assert)(void 0!==this.shaderDefines),(0,r.assert)(void 0!==this.shaderUniforms),this.shaderUniforms.colorIntensity=new n.Uniform(this.colorIntensity)}clone(){return(new d).copy(this)}copy(e){return super.copy(e),this.copyFadingParameters(e),this.copyExtrusionParameters(e),this.colorIntensity=e.colorIntensity,this}get colorIntensity(){return this.m_colorIntensity}set colorIntensity(e){this.m_colorIntensity=e,this.shaderUniforms.colorIntensity.value=e}get fadeNear(){return a.FadingFeature.DEFAULT_FADE_NEAR}set fadeNear(e){}get fadeFar(){return a.FadingFeature.DEFAULT_FADE_FAR}set fadeFar(e){}get extrusionRatio(){return o.ExtrusionFeatureDefs.DEFAULT_RATIO_MAX}set extrusionRatio(e){}addFadingProperties(){}applyFadingParameters(e){}copyFadingParameters(e){}addExtrusionProperties(){}applyExtrusionParameters(e){}copyExtrusionParameters(e){}}t.MapMeshPhongMaterial=d,(0,r.applyMixinsWithoutProperties)(d,[h.FadingFeatureMixin]),(0,r.applyMixinsWithoutProperties)(d,[c.ExtrusionFeatureMixin])},4067:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MapMeshStandardMaterial=void 0;const n=i(82),r=i(4342),s=i(8014),o=i(8955),a=i(8177),l=i(5997),c=i(674),h=i(759);class u extends n.MeshStandardMaterial{constructor(e){super(e),a.FadingFeature.patchGlobalShaderChunks(),this.addFadingProperties(),this.applyFadingParameters(e),s.ExtrusionFeature.patchGlobalShaderChunks(),this.addExtrusionProperties(),this.applyExtrusionParameters(Object.assign(Object.assign({},e),{zFightingWorkaround:!0})),!0===(null==e?void 0:e.removeDiffuseLight)&&(this.onBeforeCompile=(0,r.chainCallbacks)(this.onBeforeCompile,(e=>{e.fragmentShader=n.ShaderChunk.meshphysical_frag.replace("#include <lights_physical_pars_fragment>",h.simpleLightingShadowChunk)})))}clone(){return(new u).copy(this)}copy(e){return super.copy(e),this.copyFadingParameters(e),this.copyExtrusionParameters(e),this}get fadeNear(){return a.FadingFeature.DEFAULT_FADE_NEAR}set fadeNear(e){}get fadeFar(){return a.FadingFeature.DEFAULT_FADE_FAR}set fadeFar(e){}get extrusionRatio(){return o.ExtrusionFeatureDefs.DEFAULT_RATIO_MAX}set extrusionRatio(e){}get removeDiffuseLight(){return!1}set removeDiffuseLight(e){}addFadingProperties(){}applyFadingParameters(e){}copyFadingParameters(e){}addExtrusionProperties(){}applyExtrusionParameters(e){}copyExtrusionParameters(e){}}t.MapMeshStandardMaterial=u,(0,r.applyMixinsWithoutProperties)(u,[c.FadingFeatureMixin]),(0,r.applyMixinsWithoutProperties)(u,[l.ExtrusionFeatureMixin])},71:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.linkMixinWithShader=t.linkMixinWithMaterial=t.cameraToWorldDistance=void 0,t.cameraToWorldDistance=function(e,t){return e*t.maximum},t.linkMixinWithMaterial=function(e,t){void 0===t.defines&&(t.defines={}),e.shaderDefines=t.defines,void 0===e.shaderUniforms&&(e.shaderUniforms={})},t.linkMixinWithShader=function(e,t){Object.assign(t.uniforms,e.shaderUniforms),e.shaderUniforms=t.uniforms}},2141:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RawShaderMaterial=void 0;const n=i(82),r=i(4342),s=i(8578);class o extends n.RawShaderMaterial{constructor(e){const t=!0===(null==e?void 0:e.rendererCapabilities.isWebGL2),i=e?Object.assign(Object.assign({},e),{glslVersion:t?n.GLSL3:n.GLSL1,vertexShader:t&&e.vertexShader?(0,r.convertVertexShaderToWebGL2)(e.vertexShader):e.vertexShader,fragmentShader:t&&e.fragmentShader?(0,r.convertFragmentShaderToWebGL2)(e.fragmentShader):e.fragmentShader}):void 0;i&&delete i.rendererCapabilities,super(i),this.invalidateFog(),this.setOpacity(null==i?void 0:i.opacity)}invalidateFog(){void 0!==this.defines&&this.fog!==(0,s.getShaderMaterialDefine)(this,"USE_FOG")&&(0,s.setShaderMaterialDefine)(this,"USE_FOG",this.fog)}setOpacity(e){var t;void 0!==e&&(this.opacity=e,(null===(t=this.uniforms)||void 0===t?void 0:t.opacity)&&(this.uniforms.opacity.value=e))}}t.RawShaderMaterial=o},3298:(e,t,i)=>{"use strict";
950Object.defineProperty(t,"__esModule",{value:!0}),t.SkyAtmosphereMaterial=t.SkyAtmosphereShader=void 0;const n=i(82),r=i(2141),s=i(1870),o=i(8578);t.SkyAtmosphereShader={uniforms:{u_eyePositionWorld:new n.Uniform(new n.Vector3),u_lightDirectionWorld:new n.Uniform(new n.Vector3(0,1,0)),u_modelViewProjection:new n.Uniform(new n.Matrix4),u_atmosphereEnv:new n.Uniform(new n.Vector3(6378137,6537590.425,0)),u_hsvCorrection:new n.Uniform(new n.Vector3(0,0,0)),topColor:new n.Uniform(new n.Color(30719)),bottomColor:new n.Uniform(new n.Color(16777215)),offset:new n.Uniform(33),exponent:new n.Uniform(.6),fogColor:new n.Uniform(new n.Color(30719)),fogNear:new n.Uniform(new n.Color(30719)),fogFar:new n.Uniform(new n.Color(16777215))},vertexShader:`\n precision highp float;\n precision highp int;\n\n attribute vec4 position;\n\n uniform mat4 u_modelViewProjection;\n uniform vec3 u_eyePositionWorld;\n uniform vec3 u_lightDirectionWorld;\n\n uniform vec3 u_atmosphereEnv; // Atmosphere inner and outer radius, camera height\n uniform vec3 u_hsvCorrection;\n\n const float Pi = 3.141592653589793;\n const float Kr = 0.0025;\n const float Kr4PI = Kr * 4.0 * Pi;\n const float Km = 0.0015;\n const float Km4PI = Km * 4.0 * Pi;\n const float ESun = 15.0; // should be 15.0\n const float KmESun = Km * ESun;\n const float KrESun = Kr * ESun;\n const vec3 InvWavelength = vec3(\n 5.60204474633241, // Red = 1.0 / Math.pow(0.650, 4.0)\n 9.473284437923038, // Green = 1.0 / Math.pow(0.570, 4.0)\n 19.643802610477206); // Blue = 1.0 / Math.pow(0.475, 4.0)\n\n const int nSamples = 2;\n const float fSamples = 2.0;\n\n varying vec3 v_rayleighColor;\n varying vec3 v_mieColor;\n varying vec3 v_vertToCamera;\n\n ${s.default.atmosphere_vertex_utils}\n\n //\n // Computes rayleight and mia atmosphere factors for sky.\n //\n // Code based on GPU Gems article.\n //\n // Author: Sean O'Neil\n //\n // Copyright (c) 2004 Sean O'Neil\n //\n // https://developer.nvidia.com/gpugems/gpugems2/part-ii-shading-lighting-and-shadows/chapter-16-accurate-atmospheric-scattering\n //\n // Further modifications by HERE\n //\n AtmosphereColor computeSkyAtmosphere(vec3 v3Pos, vec3 vLightDir)\n {\n // Unpack attributes\n float fInnerRadius = u_atmosphereEnv.x;\n float fOuterRadius = u_atmosphereEnv.y;\n float fCameraHeight = u_atmosphereEnv.z;\n\n // All that may be const or define(s) at further optimization:\n float fScale = 1.0 / (fOuterRadius - fInnerRadius);\n float fScaleOverScaleDepth = (fScale / RayleighScaleDepth);\n float fCameraHeight2 = fCameraHeight * fCameraHeight;\n float fOuterRadius2 = fOuterRadius * fOuterRadius;\n\n // Get the ray from the camera to the vertex and its length (which is the far point of the ray passing through the atmosphere)\n vec3 v3Ray = v3Pos - u_eyePositionWorld;\n float fFar = length(v3Ray);\n v3Ray /= fFar;\n\n #ifdef CAMERA_IN_SPACE\n\n // Calculate the closest intersection of the ray with the outer\n // atmosphere, this is the first point of the ray passing through the atmosphere dome.\n float fNear = getNearSphereIntersect(u_eyePositionWorld, v3Ray, fCameraHeight2, fOuterRadius2);\n // Make far relative to first atmosphere intersection\n fFar -= fNear;\n\n // Compute the ray's starting position within the atmosphere, then\n // calculate its scattering offset\n vec3 v3Start = u_eyePositionWorld + v3Ray * fNear;\n\n float fStartAngle = dot(v3Ray, v3Start) / fOuterRadius;\n float fStartDepth = exp(-1.0 / RayleighScaleDepth );\n float fStartOffset = fStartDepth * scale(fStartAngle);\n\n #else // CAMERA_IN_ATMOSPHERE\n\n // The ray starts already in atmosphere\n vec3 v3Start = u_eyePositionWorld;\n float height = length(v3Start);\n float depth = exp(fScaleOverScaleDepth * (fInnerRadius - fCameraHeight));\n float fStartAngle = dot(v3Ray, v3Start) / height;\n float fStartOffset = depth * scale(fStartAngle);\n\n #endif\n\n // Initialize the scattering loop variables\n float fSampleLength = fFar / fSamples;\n float fScaledLength = fSampleLength * fScale;\n vec3 v3SampleRay = v3Ray * fSampleLength;\n vec3 v3SamplePoint = v3Start + v3SampleRay * 0.5;\n\n // Now loop through the sample rays\n vec3 v3BaseColor = vec3(0.0);\n vec3 v3Attenuate = vec3(0.0);\n for(int i=0; i < nSamples; i++)\n {\n float height = length(v3SamplePoint);\n float depth = exp(fScaleOverScaleDepth * (fInnerRadius - height));\n float fLightAngle = dot(vLightDir, v3SamplePoint) / height;\n float fCameraAngle = dot(v3Ray, v3SamplePoint) / height;\n float fScatter = (fStartOffset + depth * (scale(fLightAngle) - scale(fCameraAngle)));\n v3Attenuate = exp(-fScatter * (InvWavelength * Kr4PI + Km4PI));\n v3BaseColor += v3Attenuate * (depth * fScaledLength);\n v3SamplePoint += v3SampleRay;\n }\n\n // Scale the Mie and Rayleigh colors and set up output of the function\n AtmosphereColor color;\n color.mie = v3BaseColor * KmESun;\n color.rayleigh = v3BaseColor * (InvWavelength * KrESun);\n return color;\n }\n\n void main(void)\n {\n #ifdef DYNAMIC_LIGHT\n vec3 vLightDir = u_lightDirectionWorld;\n #else\n vec3 vLightDir = u_eyePositionWorld;\n #endif\n vLightDir = normalize(vLightDir);\n\n AtmosphereColor atmColor = computeSkyAtmosphere(position.xyz, vLightDir);\n v_mieColor = atmColor.mie;\n v_rayleighColor = atmColor.rayleigh;\n v_vertToCamera = u_eyePositionWorld - position.xyz;\n\n gl_Position = u_modelViewProjection * position;\n }\n `,fragmentShader:`\n // Because of harsh light distribution the exposure correction is always enabled for the sky.\n #define CORRECT_EXPOSURE 1\n\n precision highp float;\n precision highp int;\n\n #ifdef CORRECT_COLOR\n uniform vec3 u_hsvCorrection; // Hue, saturation, brightness\n #endif\n\n uniform vec3 u_atmosphereEnv; // Atmosphere inner and outer radius, camera height\n uniform vec3 u_eyePositionWorld;\n uniform vec3 u_lightDirectionWorld;\n\n const float g = -0.95;\n const float g2 = g * g;\n\n varying vec3 v_rayleighColor;\n varying vec3 v_mieColor;\n varying vec3 v_vertToCamera;\n\n ${s.default.atmosphere_fragment_utils}\n\n void main(void)\n {\n float fInnerRadius = u_atmosphereEnv.x;\n float fOuterRadius = u_atmosphereEnv.y;\n float fCameraHeight = u_atmosphereEnv.z;\n\n #ifdef DYNAMIC_LIGHT\n vec3 vLightDir = u_lightDirectionWorld;\n // Alter alpha based on time of day (0.0 = night , 1.0 = day)\n float fNightAlpha = clamp(dot(normalize(u_eyePositionWorld), vLightDir), 0.0, 1.0);\n #else\n vec3 vLightDir = u_eyePositionWorld;\n float fNightAlpha = 1.0;\n #endif\n vLightDir = normalize(vLightDir);\n\n // NOTE:\n // For better precision normalization may be added on fragment (for mobile devices)\n // while in vertex shader may be left un-normalized\n // dot(vLightDir, normalize(v_vertToCamera)) / length(v_vertToCamera);\n float fCosAngle = dot(vLightDir, v_vertToCamera) / length(v_vertToCamera);\n float fRayleighPhase = 0.75 * (1.0 + fCosAngle * fCosAngle);\n float fMiePhase = 1.5 * ((1.0 - g2) / (2.0 + g2)) * (1.0 + fCosAngle * fCosAngle) / pow(1.0 + g2 - 2.0 * g * fCosAngle, 1.5);\n\n vec3 cRgb = fRayleighPhase * v_rayleighColor + fMiePhase * v_mieColor;\n\n // Sky produces very harsh lighting effect so exposure correction is always enabled.\n #if !defined(HDR_FRAME_BUFFER) && defined(CORRECT_EXPOSURE)\n // Exposure factor may be exposed to uniform variable.\n cRgb = correctExposure(cRgb, 2.0);\n #endif\n\n #ifdef CORRECT_COLOR\n cRgb = correctColor(cRgb, u_hsvCorrection);\n #endif\n\n // Alter alpha based on how close the viewer is to the ground (1.0 = on ground, 0.0 = at edge of atmosphere)\n float fAtmosphereAlpha = clamp((fOuterRadius - fCameraHeight) /\n (fOuterRadius - fInnerRadius), 0.0, 1.0);\n fAtmosphereAlpha *= pow(fNightAlpha, 0.5);\n\n gl_FragColor = vec4(cRgb, mix(cRgb.b, 1.0, fAtmosphereAlpha));\n }\n `};
950class a extends r.RawShaderMaterial{constructor(e){let i;e&&(i={name:"SkyAtmosphereMaterial",vertexShader:t.SkyAtmosphereShader.vertexShader,fragmentShader:t.SkyAtmosphereShader.fragmentShader,uniforms:t.SkyAtmosphereShader.uniforms,transparent:!0,depthTest:!0,depthWrite:!1,side:n.BackSide,blending:n.NormalBlending,fog:!1,rendererCapabilities:e.rendererCapabilities}),super(i)}setDynamicLighting(e){(0,o.setShaderMaterialDefine)(this,"DYNAMIC_LIGHT",e)}set outerRadius(e){this.uniforms.u_atmosphereEnv.value.y=e}get outerRadius(){return this.uniforms.u_atmosphereEnv.value.y}set innerRadius(e){this.uniforms.u_atmosphereEnv.value.x=e}get innerRadius(){return this.uniforms.u_atmosphereEnv.value.x}updateUniforms(e,t,i,n){const r=this.getCameraInfo(t,i);if(void 0===e||!e.isMaterial)throw Error("Wrong object used, only Material objects are supported");if(!(e.uniforms&&e.uniforms.u_atmosphereEnv&&e.uniforms.u_hsvCorrection&&e.uniforms.u_eyePositionWorld&&e.uniforms.u_modelViewProjection&&e.uniforms.u_lightDirectionWorld))throw Error("Atmosphere material has missing uniforms");{const t=r.eyePos,i=r.modelViewProjection,s=r.eyeHeight;e.uniforms.u_eyePositionWorld.value.copy(t),e.uniforms.u_modelViewProjection.value.copy(i),e.uniforms.u_atmosphereEnv.value.z=s,e.uniforms.u_lightDirectionWorld.value=n.clone();const a=s>this.outerRadius,l=(0,o.setShaderDefine)(e.defines,"CAMERA_IN_SPACE",a),c=(0,o.setShaderDefine)(e.defines,"CAMERA_IN_ATMOSPHERE",!a);e.needsUpdate=e.needsUpdate||l||c}}getCameraInfo(e,t,i=!1){if(i){const i=(new n.Matrix4).identity(),r=(new n.Matrix4).copy(e.matrixWorld).invert().transpose(),s=t.projectionMatrix,o=new n.Matrix4;o.multiplyMatrices(r,i),o.multiplyMatrices(s,o);const a=new n.Vector3;e.getWorldPosition(a);const l=new n.Vector3;return t.getWorldPosition(l),{modelViewProjection:o,eyePos:a,eyeHeight:l.distanceTo(a)}}{const i=e.matrixWorld,r=t.matrixWorldInverse,s=t.projectionMatrix,o=new n.Matrix4;o.multiplyMatrices(r,i),o.multiplyMatrices(s,o);const a=new n.Vector3;t.getWorldPosition(a);const l=new n.Vector3;e.getWorldPosition(l);const c=l.distanceTo(a);return a.sub(l),{modelViewProjection:o,eyePos:a,eyeHeight:c}}}}t.SkyAtmosphereMaterial=a},9528:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SolidLineMaterial=t.LineDashesModes=t.LineCapsModes=void 0;const n=i(82),r=i(1667),s=i(7610),o=i(8177),a=i(2141),l=i(8578);var c;!function(e){e[e.CAPS_NONE=0]="CAPS_NONE",e[e.CAPS_SQUARE=1]="CAPS_SQUARE",e[e.CAPS_ROUND=2]="CAPS_ROUND",e[e.CAPS_TRIANGLE_IN=3]="CAPS_TRIANGLE_IN",e[e.CAPS_TRIANGLE_OUT=4]="CAPS_TRIANGLE_OUT"}(c=t.LineCapsModes||(t.LineCapsModes={}));const h={butt:c.CAPS_NONE,square:c.CAPS_SQUARE,round:c.CAPS_ROUND},u=Object.keys(h).reduce(((e,t)=>{const i=t;return e[h[i]]=i,e}),{});var d;!function(e){e[e.DASHES_SQUARE=0]="DASHES_SQUARE",e[e.DASHES_ROUND=1]="DASHES_ROUND",e[e.DASHES_DIAMOND=2]="DASHES_DIAMOND"}(d=t.LineDashesModes||(t.LineDashesModes={}));const m={Square:d.DASHES_SQUARE,Round:d.DASHES_ROUND,Diamond:d.DASHES_DIAMOND},p=Object.keys(m).reduce(((e,t)=>{const i=t;return e[m[i]]=i,e}),{}),f=`\nprecision highp float;\nprecision highp int;\n\nuniform vec4 diffuseColor;\nuniform float opacity;\nuniform float extrusionWidth;\nuniform vec2 tileSize;\nuniform vec2 drawRange;\n\n#ifdef USE_DASH_IMAGE\n uniform sampler2D dashImage;\n#endif\n\n#ifdef USE_DASHED_LINE\n uniform vec4 dashPattern;\n uniform vec4 dashColor;\n\n #define DASHES_SQUARE ${d.DASHES_SQUARE}\n #define DASHES_ROUND ${d.DASHES_ROUND}\n #define DASHES_DIAMOND ${d.DASHES_DIAMOND}\n#endif\n\n#ifdef USE_TILE_CLIP\n varying vec3 vPosition;\n#endif\n\nvarying vec3 vRange;\nvarying vec4 vCoords;\nvarying vec2 vAAGradient;\nvarying vec3 vExtrusionNormal;\n\n\nvarying vec3 vBarycentric;\nvarying float vWireframe;\nfloat edgeFactor() {\n float lineWidth = 1.0;\n vec3 d = fwidth(vBarycentric);\n vec3 f = step(d * lineWidth, vBarycentric);\n return min(min(f.x, f.y), f.z);\n}\n\n#ifdef USE_COLOR\n varying vec3 vColor;\n#endif\n\n#define CAPS_NONE ${c.CAPS_NONE}\n#define CAPS_SQUARE ${c.CAPS_SQUARE}\n#define CAPS_ROUND ${c.CAPS_ROUND}\n#define CAPS_TRIANGLE_IN ${c.CAPS_TRIANGLE_IN}\n#define CAPS_TRIANGLE_OUT ${c.CAPS_TRIANGLE_OUT}
950\n\nfloat roundEdgesAndAddCaps(in vec4 coords, in vec3 range) {\n // Compute the line's width to length ratio.\n float widthRatio = range.y / range.x;\n\n // Compute the inner segment distance (same for all cap mode).\n float dist = abs(coords.y);\n float segmentBeginMask = clamp(ceil(coords.z - coords.x), 0.0, 1.0);\n float segmentEndMask = clamp(ceil(coords.x - coords.w), 0.0, 1.0);\n dist = max(dist, segmentBeginMask * length(vec2((coords.x - coords.z) / widthRatio, coords.y)));\n dist = max(dist, segmentEndMask * length(vec2((coords.x - coords.w) / widthRatio, coords.y)));\n\n #if CAPS_MODE != CAPS_ROUND\n // Compute the caps mask.\n float capRangeMask = clamp(1.0 - ceil(range.z - drawRange.y), 0.0, 1.0);\n float beginCapMask = clamp(ceil(drawRange.x - coords.x), 0.0, 1.0);\n float endCapMask = clamp(ceil(coords.x - drawRange.y), 0.0, 1.0);\n float capMask = capRangeMask * max(beginCapMask, endCapMask);\n\n // Compute the outer segment distance (specific for each cap mode).\n float capDist = max(coords.x - drawRange.y, drawRange.x - coords.x) / widthRatio;\n #if CAPS_MODE == CAPS_NONE\n dist = mix(dist, max(abs(coords.y), (capDist + 0.1) / 0.1), capMask);\n #elif CAPS_MODE == CAPS_SQUARE\n dist = mix(dist, max(abs(coords.y), capDist), capMask);\n #elif CAPS_MODE == CAPS_TRIANGLE_OUT\n dist = mix(dist, abs(coords.y) + capDist, capMask);\n #elif CAPS_MODE == CAPS_TRIANGLE_IN\n dist = mix(dist, max(abs(coords.y), (capDist - abs(coords.y)) + capDist), capMask);\n #endif\n #endif // CAPS_MODE != CAPS_ROUND\n\n return dist;\n}\n\n#ifdef USE_TILE_CLIP\n void tileClip(vec2 tilePos, vec2 tileSize) {\n if (tileSize.x > 0.0 && (tilePos.x < -tileSize.x / 2.0 || tilePos.x > tileSize.x / 2.0))\n discard;\n if (tileSize.y > 0.0 && (tilePos.y < -tileSize.y / 2.0 || tilePos.y > tileSize.y / 2.0))\n discard;\n }\n#endif\n\n#ifdef USE_FADING\n #include <fading_pars_fragment>\n#endif\n\n#include <fog_pars_fragment>\n\n#ifdef USE_DASHED_LINE\nvec4 computeDashedLineColor(float distToCenter) {\n vec4 outputColor;\n\n // Calculate distances for both dash patterns\n float d1 = dashPattern.x / vRange.x;\n float g1 = dashPattern.y / vRange.x;\n #ifdef USE_SECOND_DASH\n float d2 = dashPattern.z / vRange.x;\n float g2 = dashPattern.w / vRange.x;\n\n // Total length of one full pattern (dash1 + gap1 + dash2 + gap2)\n float totalPatternLength = d1 + g1 + d2 + g2;\n #else\n // If only one dash size is used, total length is just dash1 and gap1\n float totalPatternLength = d1 + g1;\n #endif\n\n // Compute the distance to the dash origin\n float dashOrigDist = mod(vCoords.x, totalPatternLength);\n // The resulting function is discontinuous at the start of a dash (dashOrigDist = 0), which causes a spike in the result\n // of fwidth and artifacts in the interpolation. Transform it so that it reaches its maximum at the middle of a gap and\n // goes down to 1.0 at the gap end.\n // Determine the dash state based on the dashOrigDist\n float dashEdgeDist = 0.0;\n float gapCenter;\n if (dashOrigDist <= (d1 + g1)) {\n // In the first dash\n gapCenter = 1.0 + 0.5 * g1 / d1; // Center of the gap\n dashOrigDist = (gapCenter - abs(dashOrigDist - gapCenter)) / d1;\n // Compute distance to dash edge (0.5: dashCenter, 0.0: dashEdge).\n dashEdgeDist = 0.5 - abs(dashOrigDist - 0.5);\n #ifdef USE_SECOND_DASH\n } else if (dashOrigDist <= (totalPatternLength)) {\n // In the second dash\n gapCenter = 1.0 + 0.5 * g2 / d2;\n dashOrigDist = (gapCenter - abs(dashOrigDist - (d1 + g1) - gapCenter)) / d2;\n dashEdgeDist = 0.5 - abs((dashOrigDist ) - 0.5);\n #endif\n }\n\n #if DASHES_MODE == DASHES_ROUND\n dashEdgeDist = 0.5 - distance(vec2(distToCenter * 0.5, dashEdgeDist), vec2(0.0, 0.5));\n #elif DASHES_MODE == DASHES_DIAMOND\n dashEdgeDist -= distToCenter * 0.5;\n #endif\n\n // Blend dash and gap colors using hermitian interpolation (smoothstep) on the interval\n // [-dashWidth, dashWidth], with 'dashWidth' being the sum of the slope of dashEdgeDist on x and y (fwidth).\n // That means 'dashWidth' is the dashEdgeDist function delta across 1 pixel, and hence the interpolation interval\n // is 2 pixels wide and centered on 0 (dash start).\n float dashWidth = fwidth(dashEdgeDist);\n float dashBlendFactor = smoothstep(-dashWidth, dashWidth, dashEdgeDist);\n\n #ifdef USE_DASH_IMAGE\n // Dash texture is mapped to the full dash size. Use dashOrigDist as u coordinate (parallel to line segment).\n // For v coordinate (perpendicular to line), transform vCoords.y (0.0 at line center, +/-1 at edges)\n // to make them 0 at one edge, 1 at the other and 0.5 at the line center:\n vec2 texCoords = vec2(dashOrigDist, 0.5 + vCoords.y / 2.0);\n float textureAlpha = texture2D(dashImage, texCoords).a;\n\n // Pre-calculate the resulting color of the dash:\n if (diffuseColor.a == 1.0) {\n // diffuseColor is fully opaque, use simple mix function with dashColor's alpha as interpolation factor:\n outputColor = mix(diffuseColor, vec4(dashColor.rgb, 1.0), dashColor.a);\n } else {\n // diffuseColor is not fully opaque, perform a custom alpha blending:\n\n // Inverse transparency of dashColor:\n float invDashAlpha = 1.0 - dashColor.a;\n\n // Blend RGB channels based on alpha values:\n outputColor.rgb = diffuseColor.rgb * diffuseColor.a * invDashAlpha + dashColor.rgb * dashColor.a;\n\n // Compute final alpha by blending both alphas:\n outputColor.a = diffuseColor.a * invDashAlpha + dashColor.a;\n\n // If alpha is non-zero, normalize the RGB to account for premultiplied alpha:\n if (outputColor.a != 0.0) {\n outputColor.rgb /= outputColor.a;\n }\n }\n\n // Final mix with textureAlpha and dashBlendFactor as interpolation factor:\n // For a transparent dash color, the dash becomes invisible, and the base (diffuse) color is drawn instead.\n outputColor = mix(diffuseColor, outputColor, textureAlpha * dashBlendFactor);\n #else\n // When a dash texture is not used, dash color's alpha is blended as the other channels with the base color. The base color\n // won't be visible through transparent dashes. Instead, the resulting color depends on the material's blending configuration.\n // (typically, materials drawn underneath will be visible).\n\n // First alpha is interpolated.\n outputColor.a = mix(diffuseColor.a, dashColor.a, dashBlendFactor);\n\n // Then color channels are premultiplied with the alpha channels, interpolated and finally divi
950ded by the interpolated alpha.\n // This keeps colors with low opacity from bleeding into the other color as the opacity increases.\n outputColor.rgb = mix(diffuseColor.rgb * diffuseColor.a, dashColor.rgb * dashColor.a, dashBlendFactor) / outputColor.a;\n #endif\n\n return outputColor;\n}\n#endif\n\nvoid main() {\n float alpha = opacity * diffuseColor.a;\n vec4 outputDiffuse = diffuseColor;\n vec3 baricentricColor = vec3(edgeFactor());\n vec3 color = min(baricentricColor, gl_FragColor.rgb);\n\n #ifdef USE_TILE_CLIP\n tileClip(vPosition.xy, tileSize);\n #endif\n\n // Calculate distance to center (0.0: lineCenter, 1.0: lineEdge).\n float distToCenter = roundEdgesAndAddCaps(vCoords, vRange);\n\n float s = 0.0;\n if (vAAGradient.x < vAAGradient.y) {\n s = smoothstep(vAAGradient.x, vAAGradient.y, distToCenter);\n }\n\n // Drop the fully transparent pixel. It prevents writing to the stencil buffer.\n // Without this discard we will see line cap overlaps on semi-transparent roads.\n if (s == 1.0 && all(equal(color, baricentricColor)) == false) {\n discard;\n }\n\n // Alpha channel in diffuseColor is applied later once it's interpolated
950with dash color's alpha.\n alpha = opacity * (1.0 - s);\n\n #ifdef USE_DASHED_LINE\n outputDiffuse = computeDashedLineColor(distToCenter);\n #endif\n\n #ifdef USE_COLOR\n outputDiffuse.rgb *= vColor;\n #endif\n\n // Removing 'alpha' seems fixing MAPSJS-2929\n gl_FragColor = vec4( outputDiffuse.rgb, outputDiffuse.a * alpha );\n\n #include <fog_fragment>\n\n #ifdef USE_FADING\n #include <fading_fragment>\n #endif\n\n\n\n if (vWireframe == 1.0) {\n // Uncomment to see the wireframe only without fill color\n // gl_FragColor.a = 0.;\n if (all(equal(color, baricentricColor))) {\n gl_FragColor = vec4(1.0, 0., 0., 1.0);\n }\n }\n}`;class g extends a.RawShaderMaterial{constructor(e){var t,i,a,h,u;o.FadingFeature.patchGlobalShaderChunks();const m={CAPS_MODE:c.CAPS_ROUND,DASHES_MODE:d.DASHES_SQUARE};let p,v,y=!0,_=1;e&&(y=!0===e.fog,y&&(0,l.setShaderDefine)(m,"USE_FOG",!0),_=void 0!==e.opacity?e.opacity:_,p=e.displacementMap,void 0!==p&&(0,l.setShaderDefine)(m,"USE_DISPLACEMENTMAP",!0),e["dash-image"]&&(0,l.setShaderDefine)(m,"USE_DASH_IMAGE",!0),v={name:"SolidLineMaterial",vertexShader:'\n#define SEGMENT_OFFSET 0.1\n// The minimum pixel distance prevents huge overscale values. This avoids very blurry lines in\n// extreme perspectives when multiplied with other variables and interpolated across a long line\n// segment that intersects the near plane. Clamping to this minimum distance also allows to always\n// apply the overscale and thus avoid sudden line width "jumps". See HARP-13527 for details.\n#define MIN_DISTANCE 0.1\n\n// over-extrusion width on each side (twice in total).\n#define OVER_EXTRUSION_WIDTH_PIXELS 1.0\n\nconst float PI = 3.14159265358979323846;\nconst float EPSILON = 0.00001;\n\nattribute vec3 extrusionCoord;\nattribute vec3 position;\nattribute vec4 biTangent;\nattribute vec3 tangent;\nattribute vec2 uv;\nattribute vec3 normal;\n\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float extrusionWidth;\nuniform float offset;\nuniform vec2 drawRange;\nuniform vec2 canvasSize;\nuniform float wireframe;\n\n#ifdef USE_DISPLACEMENTMAP\n uniform sampler2D displacementMap;\n#endif\n\n#ifdef USE_TILE_CLIP\n varying vec3 vPosition;\n#endif\n\nvarying vec3 vRange;\nvarying vec4 vCoords;\nvarying vec2 vAAGradient;\n\nattribute vec3 barycentric;\nvarying vec3 vBarycentric;\nvarying float vWireframe;\n\n#ifdef USE_COLOR\n attribute vec3 color;\n varying vec3 vColor;\n#endif\n\n#ifdef USE_FADING\n #include <fading_pars_vertex>\n#endif\n\n#include <fog_pars_vertex>\n\nvec3 computeExtrusionDirWorld(in float extrusionWidth, in vec2 extrusionSign, in vec4 bitangent, in vec3 tangent) {\n // Angle between this segment and the previous one.\n float angle = bitangent.w;\n vec3 bitangentComponent;\n\n /**\n * WEBSDK-226:\n * The following logic is to deal with vertices (line join) connecting\n * 2 legs that are coplanar and opposite in direction.\n * In such cases the resulting biTangent is 0 so the extrusion is 0 on joins,\n * causing the vertices to collpase into one.\n *\n * For start and end vertices => T0=T1 and angle = 0;\n * For vertices on joins =>\n * T0 = leg preceding the vertex\n * T1 = leg following the vertex\n * angle = Ï when T0,T1 are coplanar with opposite direction.\n *\n * Examples:\n *\n * T0 = [0, 1, 0] T0 = [0, -1, 0]\n * T1 = [0, -1, 0] T1 = [0, 1, 0]\n * angle = Ï angle = Ï\n * T0 T1 T0 T1\n * â² | | â²\n * | â¼ â¼ |\n *\n *\n * T0 = [1, 0, 0] T0 = [-1, 0, 0]\n * T1 = [-1, 0, 0] T1 = [1, 0, 0]\n * angle = Ï angle = Ï\n *\n * T0 ----⺠T0 â----\n * T1 â---- T1 ----âº\n *\n */\n if (abs(angle - PI) < EPSILON) {\n // Set the angle to 0 as otherwise the cos(pi/2)=0 for the calculation of\n // the bitangentComponent\n angle = 0.0;\n\n if (tangent.y == 0.) {\n /**\n * T0
950/T1 ----âº\n * T1/T0 â----\n */\n bitangent.y = 1.0;\n } else {\n /**\n * T0/T1 T1/T0 T0/T1 T1/T0\n * â² | or / ⥠⥠/\n * | ⼠⣠/ / â£\n */\n bitangent.x = 1.0;\n }\n }\n\n bitangentComponent = extrusionSign.y * extrusionWidth * bitangent.xyz / cos(angle / 2.0);\n\n // Extrusion component on the tangent direction to cover line caps.\n vec3 tangentComponent = extrusionSign.x * extrusionWidth * tangent;\n\n // Add tangent component only if angle with previous segment is 0, which happens with vertices at line ends (where caps are needed)\n // or in straight segments (where caps won\'t be visible).\n return bitangentComponent + (1.0 - abs(sign(angle))) * tangentComponent;\n}\n\nvec2 computeExtrudedPosLocal(in float linePosition, in float extrusionWidth, in vec2 extrusionSign, in float tanHalfAngle) {\n // For straight segments and line ends (angle and tanHalfAngle are 0), extrude position forwards (extrusionSign.x positive, for\n // end caps) or backwards (extrusionSign.x negative, for start caps) by the extrusion width.\n // For segments at an angle, position must be extruded further by a factor of extrusionSign.y*tanHalfAngle.\n return vec2(linePosition + extrusionSign.x * extrusionWidth * (1.0 + abs(sign(tanHalfAngle)) * (extrusionSign.y * tanHalfAngle - 1.0)),\n extrusionSign.y * extrusionWidth);\n}\n\nvec3 transformToScreen(vec3 worldPosition) {\n vec4 clip = projectionMatrix * modelViewMatrix * vec4(worldPosition,1.0);\n vec3 ndc = clip.xyz / clip.w;\n vec3 screen = ndc * 0.5 + 0.5;\n screen.xy *= canvasSize;\n return screen;\n}\n\nvoid main() {\n // Wireframe\n vBarycentric = barycentric;\n vWireframe = wireframe;\n\n // Calculate the segment.\n vec2 segment = abs(extrusionCoord.xy) - SEGMENT_OFFSET;\n float segmentPos = sign(extrusionCoord.x) / 2.0 + 0.5;\n\n // Calculate the vertex position inside the line (segment).\n float linePos = mix(segment.x, segment.y, segmentPos);\n vec2 extrusionSign = sign(extrusionCoord.xy);\n // Precompute to avoid computing multiple times\n float angle = biTangent.w;\n float tanHalfAngle = tan(angle / 2.0);\n\n // Handle the case where the angle is PI, in such case tan(PI/2) is undefined.\n if (abs(angle - PI) < EPSILON) {\n tanHalfAngle = 1.;\n }\n\n float extrusionFactor = extrusionSign.y * tanHalfAngle;\n\n // Calculate the extrusion to be applied to the vertex position\n vec3 extrusionDirWorld = computeExtrusionDirWorld(extrusionWidth, extrusionSign, biTangent, tangent);\n\n vec3 extrudedPosWorld = position + extrusionDirWorld;\n vec3 centerPosScreen = transformToScreen(position);\n vec3 extrudedPosScreen = transformToScreen(extrudedPosWorld);\n float distanceScreen = max(MIN_DISTANCE, distance(extrudedPosScreen.xy, centerPosScreen.xy));\n\n float overscale = (distanceScreen + OVER_EXTRUSION_WIDTH_PIXELS) / distanceScreen;\n extrusionDirWorld *= overscale;\n extrudedPosWorld = position + extrusionDirWorld;\n\n\n float totalExtrusionWidth = extrusionWidth*overscale;\n float aaGradientHalfWidth = totalExtrusionWidth - extrusionWidth;\n vAAGradient.x = max(0.0, (extrusionWidth - aaGradientHalfWidth)/ totalExtrusionWidth);\n vAAGradient.y = 1.0;\n vec2 extrudedPosLocal = computeExtrudedPosLocal(linePos, totalExtrusionWidth, extrusionSign, tanHalfAngle);\n\n // Store the normalized extrusion coordinates in vCoords (with their ranges in vRange).\n vRange = vec3(extrusionCoord.z, totalExtrusionWidth, extrusionFactor);\n vCoords = vec4(extrudedPosLocal / vRange.xy, segment / vRange.x);\n\n // Adjust the segment to fit the drawRange.\n float capDist = totalExtrusionWidth / extrusionCoord.z;\n if ((vCoords.w + capDist) < drawRange.x || (vCoords.z - capDist) > drawRange.y) {\n vCoords.zw += 1.0;\n }\n if (vCoords.z < drawRange.x) {\n vCoords.zw += vec2(drawRange.x - vCoords.z, 0.0);\n }\n if (vCoords.w >
950 drawRange.y) {\n vCoords.zw -= vec2(0.0, vCoords.w - drawRange.y);\n }\n\n // Transform position.\n #ifdef USE_DISPLACEMENTMAP\n extrudedPosWorld += normalize( normal ) * texture2D( displacementMap, uv ).x;\n #endif\n\n // Shift the line based on the offset, where the bitangent is the cross product of the average\n // of the two direction vectors (the previous and next segment directions) and the normal of\n // the line (facing into the sky). The w component is the angle between the two segments.\n // Note, we need to take the angle into consideration, so we use trigonometry to calculate how\n // much we need to extend the offset. Note, orthough this looks complicated we are doing this\n // in the vertex shader, so it should not cause a performance issue.\n extrudedPosWorld += biTangent.xyz * offset * sqrt(1.0 + pow(abs(tanHalfAngle), 2.0));\n\n vec4 mvPosition = modelViewMatrix * vec4(extrudedPosWorld, 1.0);\n gl_Position = projectionMatrix * mvPosition;\n\n // Pass extruded position to fragment shader.\n #ifdef USE_TILE_CLIP\n vPosition = extrudedPosWorld;\n #endif\n\n #ifdef USE_COLOR\n // Pass vertex color to fragment shader.\n vColor = color;\n #endif\n\n #ifdef USE_FADING\n #include <fading_vertex>\n #endif\n\n #include <fog_vertex>\n}',fragmentShader:f,uniforms:n.UniformsUtils.merge([{diffuseColor:new n.Uniform(g.DEFAULT_COLOR.clone()),dashColor:new n.Uniform(g.DEFAULT_DASH_COLOR.clone()),extrusionWidth:new n.Uniform(g.DEFAULT_WIDTH),offset:new n.Uniform(g.DEFAULT_OFFSET),opacity:new n.Uniform(g.DEFAULT_OPACITY),tileSize:new n.Uniform(new n.Vector2),fadeNear:new n.Uniform(o.FadingFeature.DEFAULT_FADE_NEAR),fadeFar:new n.Uniform(o.FadingFeature.DEFAULT_FADE_FAR),displacementMap:new n.Uniform(void 0!==p?p:new n.Texture),drawRange:new n.Uniform(new n.Vector2(g.DEFAULT_DRAW_RANGE_START,g.DEFAULT_DRAW_RANGE_END)),dashPattern:new n.Uniform(null!==(t=e["dash-pattern"])&&void 0!==t?t:new n.Vector4),dashImage:new n.Uniform(null!==(i=e["dash-image"])&&void 0!==i?i:new n.Texture),canvasSize:new n.Uniform(new n.Vector2),wireframe:new n.Uniform(g.ENABLE_WIREFRAME?1:0)},n.UniformsLib.fog]),defines:m,fog:y,opacity:_,rendererCapabilities:e.rendererCapabilities}),super(v),this.m_color=(new s.RGBA).fromVector(g.DEFAULT_COLOR),this.m_dashColor=(new s.RGBA).fromVector(g.DEFAULT_DASH_COLOR),this.fog=y,this.setOpacity(_),this.stencilFunc=n.NotEqualStencilFunc,this.stencilZPass=n.ReplaceStencilOp,this.stencilRef=1,this.stencilWrite=!1,(0,l.enforceBlending)(this),this.extensions.derivatives=!0,e&&(void 0!==e.color&&(this.color="number"==typeof e.color?r.ColorUtils.getRgbaFromHex(e.color):null!==(a=s.RGBA.parse(e.color))&&void 0!==a?a:this.m_color),void 0!==e.width&&(this.width=e.width),void 0!==e.opacity&&this.setOpacity(e.opacity),void 0!==e.depthTest&&(this.depthTest=e.depthTest),void 0!==e.depthWrite&&(this.depthWrite=e.depthWrite),void 0!==e.fadeNear&&(this.fadeNear=e.fadeNear),void 0!==e.fadeFar&&(this.fadeFar=e.fadeFar),void 0!==e.displacementMap&&(this.displacementMap=e.displacementMap),void 0!==e.cap&&(this.cap=e.cap),void 0!==e.drawRangeStart&&(this.drawRangeStart=e.drawRangeStart),void 0!==e.drawRangeEnd&&(this.drawRangeEnd=e.drawRangeEnd),void 0!==e.dashes&&(this.dashes=e.dashes),void 0!==e.dashColor&&(this.dashColor="number"==typeof e.dashColor?r.ColorUtils.getRgbaFromHex(e.dashColor):null!==(h=s.RGBA.parse(e.dashColor))&&void 0!==h?h:this.m_dashColor),void 0!==e["dash-pattern"]&&(this["dash-pattern"]=e["dash-pattern"]),void 0!==e.fog&&(this.fog=e.fog,this.invalidateFog()),this.offset=null!==(u=e.offset)&&void 0!==u?u:0)}set offset(e){this.uniforms.offset.value=e}get offset(){return this.uniforms.offset.value}setOpacity(e){super.setOpacity(e),void 0!==e&&this.updateStencil()}get color(){return this.m_color}set color(e){this.m_color.copy(e).toVector(this.uniforms.diffuseColor.value),this.updateStencil()}get dashColor(){return this.m_dashColor}set dashColor(e){this.m_dashColor.copy(e).toVector(this.uniforms.dashColor.value)}get width(){return 2*this.uniforms.extrusionWidth.value}set width(e){this.uniforms.extrusionWidth.value=e/2}get"dash-image"(){return this.uniforms.dashImage.value}set"dash-image"(e){this.uniforms.dashImage.value=e,(0,l.setShaderMaterialDefine)(this,"USE_DASH_IMAGE",!0)}get"dash-pattern"(){return this.uniforms.dashPattern.value}set"dash-pattern"(e){this.uniforms.dashPattern.value=e,e&&((0,l.setShaderMaterialDefine)(this,"USE_DASHED_LINE",e.x>0),(0,l.setShaderMaterialDefine)(this,"USE_SECOND_DASH",e.z>0))}get cap(){let e="round";const t=(0,l.getShaderMaterialDefine)(this,"CAPS_MODE");return"number"==typeof t&&u.hasOwnProperty(t)&&(e=u[t]),e}set cap(e){h.hasOwnProperty(e)&&(0,l.setShaderMaterialDefine)(this,"CAPS_MODE",h[e])}get dashes(){let e="Square";const t=(0,l.getShaderMaterialDefine)(this,"DASHES_MODE");return"number"==typeof t&&p.hasOwnProperty(t)&&(e=p[t]),e}set dashes(e){m.hasOwnProperty(e)&&(0,l.setShaderMaterialDefine)(this,"DASHES_MODE",m[e])}get fadeNear(){return this.uniforms.fadeNear.value}set fadeNear(e){this.uniforms.fadeNear.value=e}get fadeFar(){return this.uniforms.fadeFar.value}set fadeFar(e){this.uniforms.fadeFar.value=e,(0,l.setShaderMaterialDefine)(this,"USE_FADING",e>0)}get displacementMap(){return this.uniforms.displacementMap.value}set displacementMap(e){if(this.uniforms.displacementMap.value===e)return;this.uniforms.displacementMap.value=e;const t=null!==e;t&&(this.uniforms.displacementMap.value.needsUpdate=!0),(0,l.setShaderMaterialDefine)(this,"USE_DISPLACEMENTMAP",t)}get drawRangeStart(){return this.uniforms.drawRange.value.x}set drawRangeStart(e){this.uniforms.drawRange.value.x=e}get drawRangeEnd(){return this.uniforms.drawRange.value.y}set drawRangeEnd(e){this.uniforms.drawRange.value.y=e}set clipTileSize(e){this.uniforms.tileSize.value.copy(e);const t=e.x>0&&e.y>0;(0,l.setShaderMaterialDefine)(this,"USE_TILE_CLIP",t)}get clipTileSize(){return this.uniforms.tileSize.value}set canvasSize(e){this.uniforms.canvasSize.value.copy(e)}get canvasSize(){return this.uniforms.canvasSize.value}copy(e){return super.copy(e),this.invalidateFog(),this.setOpacity(e.opacity),this}updateStencil(){var e,t;this.stencilWrite=this.opacity*(null!==(t=null===(e=this.color)||void 0===e?void 0:e.a)&&void 0!==t?t:1)<.98}}t.SolidLineMaterial=g,g.DEFAULT_COLOR=new n.Vector4(1,0,0,1),g.DEFAULT_DASH_COLOR=new n.Vector4(1,0,0,0),g.DEFAULT_WIDTH=1,g.DEFAULT_OPACITY=1,g.DEFAULT_DRAW_RANGE_START=0,g.DEFAULT_DRAW_RANGE_END=1,g.DEFAULT_DASH_SIZE=1,g.DEFAULT_GAP_SIZE=1,g.DEFAULT_OFFSET=0,g.ENABLE_WIREFRAME=!1},8578:(e,t,i)=>{"use strict";
950Object.defineProperty(t,"__esModule",{value:!0}),t.getShaderDefine=t.setShaderDefine=t.getShaderMaterialDefine=t.setShaderMaterialDefine=t.disableBlending=t.enableBlending=t.enforceBlending=t.insertShaderInclude=t.DEFINE_BOOL_FALSE=t.DEFINE_BOOL_TRUE=void 0;const n=i(82),r=i(4342);function s(e){!0!==e.transparent&&!0!==e.forcedBlending&&(e.blending=n.CustomBlending,!0===e.premultipliedAlpha?(e.blendSrc=n.OneFactor,e.blendDst=n.OneMinusSrcAlphaFactor,e.blendSrcAlpha=n.OneFactor,e.blendDstAlpha=n.OneMinusSrcAlphaFactor):(e.blendSrc=n.SrcAlphaFactor,e.blendDst=n.OneMinusSrcAlphaFactor,e.blendSrcAlpha=n.OneFactor,e.blendDstAlpha=n.OneMinusSrcAlphaFactor))}function o(e,t,i=!1){return void 0===e.defines?i:l(e.defines,t)}function a(e,i,n){let r=!1;return"number"==typeof n?(r=e[i]!==n,e[i]=n):!0===n?(r=e[i]!==t.DEFINE_BOOL_TRUE,e[i]=t.DEFINE_BOOL_TRUE):!1===n&&void 0!==e[i]&&(delete e[i],r=!0),r}function l(e,i){const n=e[i];return n!==t.DEFINE_BOOL_FALSE&&(n===t.DEFINE_BOOL_TRUE||n)}t.DEFINE_BOOL_TRUE="",t.DEFINE_BOOL_FALSE=void 0,t.insertShaderInclude=function(e,t,i,n){const r=!0===n?"\t":"";return e.replace(`#include <${t}>`,`#include <${t}>\n${r}#include <${i}>`)},t.enforceBlending=function(e){e.transparent||(s(e),e.forcedBlending=!0)},t.enableBlending=s,t.disableBlending=function(e){!0!==e.transparent&&!0!==e.forcedBlending&&(e.blending=n.NormalBlending)},t.setShaderMaterialDefine=function(e,t,i){(0,r.assert)(void 0!==e.defines,"Do not use this function in ShaderMaterial derived c-tor.");const n=i!==o(e,t);return!!n&&(a(e.defines,t,i),e.needsUpdate=n,!0)},t.getShaderMaterialDefine=o,t.setShaderDefine=a,t.getShaderDefine=l},5562:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.needsCanvasSize=void 0,t.needsCanvasSize=function(e){return"canvasSize"in e}},4744:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasColorCorrectionFeature=t.ColorCorrectionFeature=void 0;const n=i(4342),r=i(71),s=i(4030),o=i(8578),a=i(82);!function(e){function t(e){return void 0!==e.gamma||void 0!==e.brightness}e.DEFAULT_GAMMA=1,e.DEFAULT_BRIGHTNESS=1,e.isEnabled=t,e.patchGlobalShaderChunks=function(){void 0===a.ShaderChunk.color_correction_parts_fragment&&Object.assign(a.ShaderChunk,s.default)},e.updateColorCorrectionFeature=function(i){(0,n.assert)(void 0!==i.shaderDefines),(0,n.assert)(void 0!==i.shaderUniforms);const r=t(i),s=(0,o.setShaderDefine)(i.shaderDefines,"USE_COLOR_CORRECTION",r);i.needsUpdate=s,(0,n.assert)(void 0!==i.shaderUniforms.u_gamma),(0,n.assert)(void 0!==i.shaderUniforms.u_brightness),r?(i.shaderUniforms.u_gamma.value=i.gamma>0?i.gamma:0,i.shaderUniforms.u_brightness.value=a.MathUtils.clamp(i.brightness,0,1)):s&&(i.shaderUniforms.u_gamma.value=e.DEFAULT_GAMMA,i.shaderUniforms.u_brightness.value=e.DEFAULT_BRIGHTNESS)},e.onBeforeCompile=function(e,i){t(e)&&((0,n.assert)(void 0!==e.shaderUniforms),(0,r.linkMixinWithShader)(e,i),i.fragmentShader=(0,o.insertShaderInclude)(i.fragmentShader,"common","color_correction_parts_fragment"),i.fragmentShader=(0,o.insertShaderInclude)(i.fragmentShader,"color_fragment","color_correction_fragment",!0))}}(t.ColorCorrectionFeature||(t.ColorCorrectionFeature={})),t.hasColorCorrectionFeature=function(e){return"brightness"in e&&"gamma"in e}},8583:(e,t)=>{"use strict";function i(e){return"displacementMap"in e}Object.defineProperty(t,"__esModule",{value:!0}),t.setDisplacementMapToMaterial=t.hasDisplacementFeature=void 0,t.hasDisplacementFeature=i,t.setDisplacementMapToMaterial=function(e,t){i(t)&&t.displacementMap!==e&&(t.displacementMap=e,t.needsUpdate=!0,null!==t.displacementMap&&(t.displacementMap.needsUpdate=!0))}},8014:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtrusionFeature=t.hasExtrusionFeature=void 0;const n=i(82),r=i(4342),s=i(71),o=i(4305),a=i(8578),l=i(8955);t.hasExtrusionFeature=function(e){return"extrusionRatio"in e},function(e){function t(e){return void 0!==e.extrusionRatio&&e.extrusionRatio>=l.ExtrusionFeatureDefs.DEFAULT_RATIO_MIN}e.isEnabled=t,e.patchGlobalShaderChunks=function(){void 0===n.ShaderChunk.extrusion_pars_vertex&&Object.assign(n.ShaderChunk,o.default)},e.updateExtrusionFeature=function(e){(0,r.assert)(void 0!==e.shaderDefines),(0,r.assert)(void 0!==e.shaderUniforms);const i=t(e),n=(0,a.setShaderDefine)(e.shaderDefines,"EXTRUSION_MATERIAL",i);e.needsUpdate=n,i?e.shaderUniforms.extrusionRatio.value=e.extrusionRatio:n&&(e.shaderUniforms.extrusionRatio.value=l.ExtrusionFeatureDefs.DEFAULT_RATIO_MAX)},e.onBeforeCompile=function(e,i){t(e)&&((0,r.assert)(void 0!==e.shaderUniforms),(0,s.linkMixinWithShader)(e,i),i.vertexShader=(0,a.insertShaderInclude)(i.vertexShader,"common","extrusion_pars_vertex"),i.vertexShader=(0,a.insertShaderInclude)(i.vertexShader,"begin_vertex","extrusion_vertex",!0),i.fragmentShader=(0,a.insertShaderInclude)(i.fragmentShader,"fog_pars_fragment","extrusion_pars_fragment"),i.fragmentShader=i.fragmentShader.replace("#include <normal_fragment_begin>","#include <extrusion_normal_fragment_begin>"),i.fragmentShader=(0,a.insertShaderInclude)(i.fragmentShader,"fog_fragment","extrusion_fragment",!0))}}(t.ExtrusionFeature||(t.ExtrusionFeature={}))},8955:(e,t)=>{"use strict";var i;
950Object.defineProperty(t,"__esModule",{value:!0}),t.ExtrusionFeatureDefs=void 0,(i=t.ExtrusionFeatureDefs||(t.ExtrusionFeatureDefs={})).DEFAULT_RATIO_MIN=0,i.DEFAULT_RATIO_MAX=1,i.MIN_BUILDING_HEIGHT=.1},8177:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FadingFeature=void 0;const n=i(82),r=i(4342),s=i(71),o=i(3739),a=i(8578);!function(e){function t(e){return void 0!==e.fadeNear&&void 0!==e.fadeFar&&e.fadeFar>0}e.DEFAULT_FADE_NEAR=-1,e.DEFAULT_FADE_FAR=-1,e.isEnabled=t,e.isDefined=function(e){return void 0!==e.fadeNear&&void 0!==e.fadeFar},e.patchGlobalShaderChunks=function(){void 0===n.ShaderChunk.fading_pars_vertex&&Object.assign(n.ShaderChunk,o.default)},e.updateFadingFeature=function(i){(0,r.assert)(void 0!==i.shaderDefines),(0,r.assert)(void 0!==i.shaderUniforms);const n=t(i),s=(0,a.setShaderDefine)(i.shaderDefines,"FADING_MATERIAL",n);i.needsUpdate=s,(0,r.assert)(void 0!==i.shaderUniforms.fadeNear&&void 0!==i.shaderUniforms.fadeFar),n?(i.shaderUniforms.fadeNear.value=i.fadeNear,i.shaderUniforms.fadeFar.value=i.fadeFar,s&&(0,a.enableBlending)(i)):s&&(i.shaderUniforms.fadeNear.value=e.DEFAULT_FADE_NEAR,i.shaderUniforms.fadeFar.value=e.DEFAULT_FADE_FAR,(0,a.disableBlending)(i))},e.onBeforeCompile=function(e,i){t(e)&&((0,r.assert)(void 0!==e.shaderUniforms),(0,s.linkMixinWithShader)(e,i),i.vertexShader=(0,a.insertShaderInclude)(i.vertexShader,"fog_pars_vertex","fading_pars_vertex"),i.vertexShader=(0,a.insertShaderInclude)(i.vertexShader,"fog_vertex","fading_vertex",!0),i.fragmentShader=(0,a.insertShaderInclude)(i.fragmentShader,"fog_pars_fragment","fading_pars_fragment"),i.fragmentShader=(0,a.insertShaderInclude)(i.fragmentShader,"fog_fragment","fading_fragment",!0))},e.addRenderHelper=function(t,i,n,o,a,l){t.onBeforeRender=(0,r.chainCallbacks)(t.onBeforeRender,((t,r,a,c,h,u)=>{const d=h;d.fadeNear=void 0===n||n===e.DEFAULT_FADE_NEAR?e.DEFAULT_FADE_NEAR:(0,s.cameraToWorldDistance)(n,i),d.fadeFar=void 0===o||o===e.DEFAULT_FADE_FAR?e.DEFAULT_FADE_FAR:(0,s.cameraToWorldDistance)(o,i),void 0!==l&&l(t,h)}))}}(t.FadingFeature||(t.FadingFeature={}))},4258:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ColorCorrectionFeatureMixin=void 0;const n=i(4342),r=i(9276),s=i(71),o=i(82),a=i(4744);t.ColorCorrectionFeatureMixin=class{constructor(){this.m_brightness=a.ColorCorrectionFeature.DEFAULT_BRIGHTNESS,this.m_gamma=a.ColorCorrectionFeature.DEFAULT_GAMMA}getBrightness(){return this.m_brightness}setBrightness(e){e!==this.m_brightness&&(this.m_brightness=e,a.ColorCorrectionFeature.updateColorCorrectionFeature(this))}getGamma(){return this.m_gamma}setGamma(e){e!==this.m_gamma&&(this.m_gamma=e,a.ColorCorrectionFeature.updateColorCorrectionFeature(this))}addColorCorrectionProperties(){Object.defineProperty(this,"brightness",{get:()=>this.getBrightness(),set:e=>{this.setBrightness(e)}}),Object.defineProperty(this,"gamma",{get:()=>this.getGamma(),set:e=>{this.setGamma(e)}})}applyColorCorrectionParameters(e){(0,s.linkMixinWithMaterial)(this,this),(0,n.assert)(void 0!==this.shaderDefines),(0,n.assert)(void 0!==this.shaderUniforms),this.shaderUniforms.u_gamma=new o.Uniform(a.ColorCorrectionFeature.DEFAULT_GAMMA),this.shaderUniforms.u_brightness=new o.Uniform(a.ColorCorrectionFeature.DEFAULT_BRIGHTNESS),void 0!==e&&(void 0!==e.brightness&&this.setBrightness(e.brightness),void 0!==e.gamma&&this.setGamma(e.gamma)),this.onBeforeCompile=(0,r.chainCallbacks)(this.onBeforeCompile,(e=>{a.ColorCorrectionFeature.onBeforeCompile(this,e)})),this.needsUpdate=a.ColorCorrectionFeature.isEnabled(this)}copyColorCorrectionParameters(e){return this.setBrightness(void 0===e.brightness?a.ColorCorrectionFeature.DEFAULT_BRIGHTNESS:e.brightness),this.setGamma(void 0===e.gamma?a.ColorCorrectionFeature.DEFAULT_GAMMA:e.gamma),this}}},8878:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DisplacementFeatureMixin=void 0;const n=i(82),r=i(4342),s=i(71),o=i(8578),a=new n.Texture;var l;!function(e){function t(e){return null!==e.displacementMap}e.isEnabled=t,e.updateDisplacementFeature=function(e){(0,r.assert)(void 0!==e.shaderDefines),(0,r.assert)(void 0!==e.shaderUniforms);const i=t(e),n=(0,o.setShaderDefine)(e.shaderDefines,"USE_DISPLACEMENTMAP",i);
950if(e.needsUpdate=n,i){const t=e.displacementMap;t.needsUpdate=!0,e.shaderUniforms.displacementMap.value=t}else n&&(e.shaderUniforms.displacementMap.value=a)},e.onBeforeCompile=function(e,i){t(e)&&((0,r.assert)(void 0!==e.shaderUniforms),(0,s.linkMixinWithShader)(e,i),i.vertexShader=i.vertexShader.replace("#include <skinbase_vertex>","#include <skinbase_vertex>\n#ifndef USE_ENVMAP\n vec3 objectNormal = vec3( normal );\n#endif"),i.vertexShader=(0,o.insertShaderInclude)(i.vertexShader,"uv2_pars_vertex","displacementmap_pars_vertex"),i.vertexShader=(0,o.insertShaderInclude)(i.vertexShader,"skinning_vertex","displacementmap_vertex",!0))}}(l||(l={})),t.DisplacementFeatureMixin=class{constructor(){this.m_displacementMap=null}get displacementMap(){return this.m_displacementMap}set displacementMap(e){this.setDisplacementMap(e)}getDisplacementMap(){return this.m_displacementMap}setDisplacementMap(e){e!==this.m_displacementMap&&(this.m_displacementMap=e,l.updateDisplacementFeature(this))}addDisplacementProperties(){Object.defineProperty(this,"displacementMap",{get:()=>this.getDisplacementMap(),set:e=>{this.setDisplacementMap(e)}})}applyDisplacementParameters(e){(0,s.linkMixinWithMaterial)(this,this),(0,r.assert)(void 0!==this.shaderDefines),(0,r.assert)(void 0!==this.shaderUniforms);const t=this.shaderUniforms;t.displacementMap=new n.Uniform(a),t.displacementScale=new n.Uniform(1),t.displacementBias=new n.Uniform(0),void 0!==e&&void 0!==e.displacementMap&&this.setDisplacementMap(e.displacementMap),this.onBeforeCompile=(0,r.chainCallbacks)(this.onBeforeCompile,(e=>{l.onBeforeCompile(this,e)})),this.needsUpdate=l.isEnabled(this)}copyDisplacementParameters(e){return this.setDisplacementMap(e.displacementMap),this}}},5997:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtrusionFeatureMixin=void 0;const n=i(82),r=i(4342),s=i(8014),o=i(8955),a=i(71);t.ExtrusionFeatureMixin=class{constructor(){this.m_extrusion=o.ExtrusionFeatureDefs.DEFAULT_RATIO_MAX}getExtrusionRatio(){return this.m_extrusion}setExtrusionRatio(e){e!==this.m_extrusion&&(this.m_extrusion=e,s.ExtrusionFeature.updateExtrusionFeature(this))}addExtrusionProperties(){Object.defineProperty(this,"extrusionRatio",{get:()=>this.getExtrusionRatio(),set:e=>{this.setExtrusionRatio(e)}})}applyExtrusionParameters(e){(0,a.linkMixinWithMaterial)(this,this),(0,r.assert)(void 0!==this.shaderDefines),(0,r.assert)(void 0!==this.shaderUniforms),e&&!0===e.zFightingWorkaround&&(this.shaderDefines.ZFIGHTING_WORKAROUND=""),this.shaderUniforms.extrusionRatio=new n.Uniform(o.ExtrusionFeatureDefs.DEFAULT_RATIO_MAX),void 0!==e&&void 0!==e.extrusionRatio&&this.setExtrusionRatio(e.extrusionRatio),this.onBeforeCompile=(0,r.chainCallbacks)(this.onBeforeCompile,(e=>{s.ExtrusionFeature.onBeforeCompile(this,e)})),this.needsUpdate=s.ExtrusionFeature.isEnabled(this)}copyExtrusionParameters(e){return void 0!==e.extrusionRatio&&this.setExtrusionRatio(e.extrusionRatio),this}}},674:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FadingFeatureMixin=void 0;const n=i(82),r=i(4342),s=i(8177),o=i(71);t.FadingFeatureMixin=class{constructor(){this.m_fadeNear=s.FadingFeature.DEFAULT_FADE_NEAR,this.m_fadeFar=s.FadingFeature.DEFAULT_FADE_FAR}getFadeNear(){return this.m_fadeNear}setFadeNear(e){e!==this.m_fadeNear&&(this.m_fadeNear=e,s.FadingFeature.updateFadingFeature(this))}getFadeFar(){return this.m_fadeFar}setFadeFar(e){e!==this.m_fadeFar&&(this.m_fadeFar=e,s.FadingFeature.updateFadingFeature(this))}addFadingProperties(){Object.defineProperty(this,"fadeNear",{get:()=>this.getFadeNear(),set:e=>{this.setFadeNear(e)}}),Object.defineProperty(this,"fadeFar",{get:()=>this.getFadeFar(),set:e=>{this.setFadeFar(e)}})}applyFadingParameters(e){(0,o.linkMixinWithMaterial)(this,this),(0,r.assert)(void 0!==this.shaderDefines),(0,r.assert)(void 0!==this.shaderUniforms),this.shaderUniforms.fadeNear=new n.Uniform(s.FadingFeature.DEFAULT_FADE_NEAR),this.shaderUniforms.fadeFar=new n.Uniform(s.FadingFeature.DEFAULT_FADE_FAR),void 0!==e&&(void 0!==e.fadeNear&&this.setFadeNear(e.fadeNear),void 0!==e.fadeFar&&this.setFadeFar(e.fadeFar)),this.onBeforeCompile=(0,r.chainCallbacks)(this.onBeforeCompile,(e=>{s.FadingFeature.onBeforeCompile(this,e)})),this.needsUpdate=s.FadingFeature.isEnabled(this)}copyFadingParameters(e){return this.setFadeNear(void 0===e.fadeNear?s.FadingFeature.DEFAULT_FADE_NEAR:e.fadeNear),this.setFadeFar(void 0===e.fadeFar?s.FadingFeature.DEFAULT_FADE_FAR:e.fadeFar),this}}},1870:(e,t)=>{"use strict";
950Object.defineProperty(t,"__esModule",{value:!0}),t.default={atmosphere_vertex_utils:"\n\n const float RayleighScaleDepth = 0.25;\n\n struct AtmosphereColor\n {\n vec3 mie;\n vec3 rayleigh;\n };\n\n float scale(float cosAngle)\n {\n float x = 1.0 - cosAngle;\n return RayleighScaleDepth * exp(-0.00287 + x*(0.459 + x*(3.83 + x*(-6.80 + x*5.25))));\n }\n\n float getNearSphereIntersect(vec3 v3Pos, vec3 v3Ray, float fCameraHeight2, float fOuterRadius2) {\n // Solve simple square equation for the x0 (first point of intersection).\n#if defined(IMPROVE_INTERSECT_PRECISION)\n // To improve precision instead of simple projection: b = 2.0 * dot(vPos, v3Ray),\n // we change the equation that gives better results especially around the poles.\n float fB = 2.0 * length(v3Pos) * dot(normalize(v3Pos), v3Ray);\n#else\n float fB = 2.0 * dot(v3Pos, v3Ray);\n#endif\n float fC = fCameraHeight2 - fOuterRadius2;\n // det = b^2 - 4*a*c, where a = 1\n float fDet = max(0.0, fB * fB - 4.0 * fC);\n // Intersection points distances are defined as follows:\n // x0 = (-b - sqrt(det)) / 2*a ^ x1 = (-b + sqrt(det)) / 2*a\n // we search for x0:\n return 0.5 * (-fB - sqrt(fDet));\n }\n\n float getFarSphereIntersect(vec3 v3Pos, vec3 v3Ray, float fCameraHeight2, float fOuterRadius2) {\n // Solve simple square equation for the x1 (second point of intersection).\n#if defined(IMPROVE_INTERSECT_PRECISION)\n float fB = 2.0 * length(v3Pos) * dot(normalize(v3Pos), v3Ray);\n#else\n float fB = 2.0 * dot(v3Pos, v3Ray);\n#endif\n float fC = fCameraHeight2 - fOuterRadius2;\n // det = b^2 - 4*a*c, where a = 1\n float fDet = max(0.0, fB * fB - 4.0 * fC);\n // Compute second intersection distance:\n // x1 = (-b + sqrt(det)) / 2*a\n return 0.5 * (-fB + sqrt(fDet));\n }\n ",atmosphere_fragment_utils:"\n\n // Branch free RGB to HSV conversion.\n // Based on article:\n // http://lolengine.net/blog/2013/01/13/fast-rgb-to-hsv\n // and optimized OpenGL SL algorithm\n // http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl\n vec3 rgb2Hsv(vec3 c)\n {\n const vec4 RGB_HSV_CONV = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);\n // Ternary operator may be used explicitly if compiler can use fast conditional move.\n // vec4 p = c.g < c.b ? vec4(c.bg, RGB_HSV_CONV.wz) : vec4(c.gb, RGB_HSV_CONV.xy);\n vec4 p = mix(vec4(c.bg, RGB_HSV_CONV.wz), vec4(c.gb, RGB_HSV_CONV.xy), step(c.b, c.g));\n // vec4 q = c.r < p.x ? vec4(p.xyw, c.r) : vec4(c.r, p.yzx);\n vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));\n\n float d = q.x - min(q.w, q.y);\n float e = 1.0e-10;\n return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);\n }\n\n // Branch free HSV to RGB conversion\n vec3 hsv2Rgb(vec3 c)\n {\n const vec4 HSV_RGB_CONV = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + HSV_RGB_CONV.xyz) * 6.0 - HSV_RGB_CONV.www);\n return c.z * mix(HSV_RGB_CONV.xxx, clamp(p - HSV_RGB_CONV.xxx, 0.0, 1.0), c.y);\n }\n\n vec3 correctExposure(vec3 rgb, float exposure)\n {\n const vec3 fullColor = vec3(1.0);\n return fullColor - exp(-exposure * rgb);\n }\n\n vec3 correctColor(vec3 rgb, vec3 hsvShift)\n {\n const float e = 0.0000001;\n // Convert rgb color to hsv\n vec3 hsv = rgb2Hsv(rgb);\n // Shift hue value with angle wrapping\n hsv.x = mod(hsv.x + hsvShift.x, 1.0);\n // Shift and clamp saturation\n hsv.y = clamp(hsv.y + hsvShift.y, 0.0, 1.0);\n // Change value if it is significant (greater then epsilon)\n hsv.z = hsv.z > e ? clamp(hsv.z + hsvShift.z, 0.0, 1.0) : 0.0;\n // Convert shifted hsv back to rgb\n return hsv2Rgb(hsv);\n }\n "}},5089:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.blinnPhongNoSpecular=void 0,t.blinnPhongNoSpecular="\nuniform float colorIntensity;\nvoid RE_Direct_BlinnPhong_NoSpecular( const in IncidentLight directLight,\n const in GeometricContext geometry,\n const in BlinnPhongMaterial material,\n inout ReflectedLight reflectedLight ) {\n\n float dotNL = saturate( dot
950( geometry.normal, directLight.direction ) );\n vec3 irradiance = dotNL * directLight.color;\n\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor * colorIntensity);\n}\n#undef RE_Direct\n#define RE_Direct RE_Direct_BlinnPhong_NoSpecular\n"},4030:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={color_correction_parts_fragment:"\n #ifdef USE_COLOR_CORRECTION\n uniform float u_gamma;\n uniform float u_brightness;\n #endif\n ",color_correction_fragment:"\n #ifdef USE_COLOR_CORRECTION\n diffuseColor = vec4( pow( diffuseColor.rgb, vec3( u_gamma ) ) * u_brightness, diffuseColor.a);\n #endif\n "}},4305:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=i(8955),r=n.ExtrusionFeatureDefs.MIN_BUILDING_HEIGHT*n.ExtrusionFeatureDefs.MIN_BUILDING_HEIGHT;t.default={extrusion_pars_vertex:"\n// Add define so we can check for it in the outline effect (see Outline.ts).\n#define HAS_EXTRUSION_PARS_VERTEX\n// Extrusion axis (xyz: vector, w: factor).\nattribute vec4 extrusionAxis;\nuniform float extrusionRatio;\n#ifdef FLAT_SHADED\nvarying vec4 vExtrusionAxis;\n#endif\n#ifdef ZFIGHTING_WORKAROUND\nvarying float vExtrusionRatio;\n#endif\n",extrusion_vertex:`\n#define HAS_EXTRUSION_VERTEX\n#ifdef ZFIGHTING_WORKAROUND\n// Cancel extrusionRatio (meaning, force to 1) if extrusionAxisLen < MIN_BUILDING_HEIGHT.\nconst float MIN_BUILDING_HEIGHT_SQUARED = ${r};\nfloat extrusionAxisLenSquared = dot(extrusionAxis.xyz, extrusionAxis.xyz);\nvExtrusionRatio = (extrusionAxisLenSquared < MIN_BUILDING_HEIGHT_SQUARED) ? 1.0 : extrusionRatio;\n#else\nfloat vExtrusionRatio = extrusionRatio;\n#endif\ntransformed = transformed + extrusionAxis.xyz * (vExtrusionRatio - 1.0);\n#ifdef FLAT_SHADED\nvExtrusionAxis = vec4(normalMatrix * extrusionAxis.xyz, extrusionAxis.w);\n#endif\n`,extrusion_normal_fragment_begin:"\n#ifdef FLAT_SHADED\n // Flattened this divergent path to prevent undefined behaviour in the following derivatives\n // functions. For more info:\n // http://www.aclockworkberry.com/shader-derivative-functions/#Derivatives_and_branches\n\n // Workaround for Adreno/Nexus5 not able able to do dFdx( vViewPosition ) ...\n vec3 fdx = vec3(dFdx(vViewPosition.x), dFdx(vViewPosition.y), dFdx(vViewPosition.z));\n vec3 fdy = vec3(dFdy(vViewPosition.x), dFdy(vViewPosition.y), dFdy(vViewPosition.z));\n vec3 normal = cross( fdx, fdy );\n if (vExtrusionAxis.w > 0.999999) {\n normal = vExtrusionAxis.xyz;\n }\n normal = normalize(normal);\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * (float(gl_FrontFacing) * 2.0 - 1.0);\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * (float(gl_FrontFacing) * 2.0 - 1.0);\n\t\t\tbitangent = bitangent * (float(gl_FrontFacing) * 2.0 - 1.0);\n\t\t#endif\n\t#endif\n#endif\n// non perturbed normal for clearcoat among others\nvec3 geometryNormal = normal;\n",extrusion_pars_fragment:"\n#ifdef ZFIGHTING_WORKAROUND\nvarying float vExtrusionRatio;\n#else\nuniform float extrusionRatio;\n#endif\nvarying vec4 vExtrusionAxis;\n",extrusion_fragment:"\n#ifndef ZFIGHTING_WORKAROUND\nfloat vExtrusionRatio = extrusionRatio;\n#endif\ngl_FragColor.a *= smoothstep( 0.0, 0.25, vExtrusionRatio );\n"}},3739:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={fading_pars_vertex:"\nvarying float fadingDepth;\n",fading_vertex:"\nfadingDepth = -mvPosition.z;\n",fading_pars_fragment:"\nvarying float fadingDepth;\nuniform float fadeNear;\nuniform float fadeFar;\n",fading_fragment:'\n\n// lerp with "hard" edges\n//float fadingFactor = 1.0 - clamp((fadingDepth - fadeNear) / (fadeFar - fadeNear), 0.0, 1.0);\n\n// smooth transitions\nfloat fadingFactor = smoothstep( fadeNear, fadeFar, fadingDepth );\n\ngl_FragColor.a *= 1.0 - fadingFactor;\n\n// debugging color:\n// gl_FragColor = vec4(1., fadingFactor, fadingFactor, 1.0);\n'}},7133:(e,t)=>
950{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={high_precision_vert_func:"\nvec3 subtractDblEyePos( const in vec3 pos ) {\n vec3 t1 = positionLow - u_eyepos_lowpart;\n vec3 e = t1 - positionLow;\n vec3 t2 = ((-u_eyepos_lowpart - e) + (positionLow - (t1 - e))) + pos - u_eyepos;\n vec3 high_delta = t1 + t2;\n vec3 low_delta = t2 - (high_delta - t1);\n return (high_delta + low_delta);\n}\n"}},759:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.simpleLightingShadowChunk=void 0,t.simpleLightingShadowChunk="\n struct PhysicalMaterial {\n vec3\tdiffuseColor;\n float\tspecularRoughness;\n vec3\tspecularColor;\n };\n\n #define DEFAULT_SPECULAR_COEFFICIENT 0.04\n\n void RE_Direct_Physical( const in IncidentLight directLight,\n const in GeometricContext geometry,\n const in PhysicalMaterial material,\n inout ReflectedLight reflectedLight ) {\n // directLight.color is the light color * shadow, internally three.js uses a step function, so\n // this value is either the light color or black. in order to lighten up the shadows, we\n // take add 50% of the color to grey (to give us either pure white or grey) and multiply this to\n // the material's diffuse color.\n #if defined(USE_SHADOWMAP)\n reflectedLight.directDiffuse = (0.5 * directLight.color +\n vec3(0.5,0.5,0.5)) * material.diffuseColor;\n #else\n reflectedLight.directDiffuse = material.diffuseColor;\n #endif\n }\n\n void RE_IndirectDiffuse_Physical( const in vec3 irradiance,\n const in GeometricContext geometry,\n const in PhysicalMaterial material,\n inout ReflectedLight reflectedLight ) {\n // Disable influence of indirect light (it is handled in the RE_Direct_Physical function)\n }\n\n void RE_IndirectSpecular_Physical( const in vec3 radiance,\n const in vec3 irradiance,\n const in vec3 clearcoatRadiance,\n const in GeometricContext geometry,\n const in PhysicalMaterial material,\n inout ReflectedLight reflectedLight) {\n // Disable specular reflection of light.\n }\n\n #define RE_Direct RE_Direct_Physical\n #define RE_IndirectDiffuse RE_IndirectDiffuse_Physical\n #define RE_IndirectSpecular RE_IndirectSpecular_Physical\n"},398:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LuminosityHighPassShader=void 0;const n=i(82);t.LuminosityHighPassShader={uniforms:{tDiffuse:{value:null},luminosityThreshold:{value:1},smoothWidth:{value:1},defaultColor:{value:new n.Color(0)},defaultOpacity:{value:0}},vertexShader:"\n varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n }",fragmentShader:"\n uniform sampler2D tDiffuse;\n uniform vec3 defaultColor;\n uniform float defaultOpacity;\n uniform float luminosityThreshold;\n uniform float smoothWidth;\n varying vec2 vUv;\n void main() {\n vec4 texel = texture2D( tDiffuse, vUv );\n vec3 luma = vec3( 0.299, 0.587, 0.114 );\n float v = dot( texel.xyz, luma );\n vec4 outputColor = vec4( defaultColor.rgb, defaultOpacity );\n float alpha = smoothstep( luminosityThreshold, luminosityThreshold + smoothWidth, v );\n gl_FragColor = mix( outputColor, texel, alpha );\n }"}},4919:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SepiaShader=void 0,t.SepiaShader={uniforms:{tDiffuse:{value:null},amount:{value:1}},vertexShader:"\n varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n }",fragmentShader:"\n uniform float amount;
950\n uniform sampler2D tDiffuse;\n varying vec2 vUv;\n void main() {\n vec4 color = texture2D( tDiffuse, vUv );\n vec3 c = color.rgb;\n color.r = dot( c, vec3( 1.0 - 0.607 * amount, 0.769 * amount, 0.189 * amount ) );\n color.g = dot( c, vec3( 0.349 * amount, 1.0 - 0.314 * amount, 0.168 * amount ) );\n color.b = dot( c, vec3( 0.272 * amount, 0.534 * amount, 1.0 - 0.869 * amount ) );\n gl_FragColor = vec4( min( vec3( 1.0 ), color.rgb ), color.a );\n }"}},5551:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VignetteShader=void 0,t.VignetteShader={uniforms:{tDiffuse:{value:null},offset:{value:1},darkness:{value:1}},vertexShader:"\n varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n }",fragmentShader:"\n uniform float offset;\n uniform float darkness;\n uniform sampler2D tDiffuse;\n varying vec2 vUv;\n void main() {\n vec4 texel = texture2D( tDiffuse, vUv );\n vec2 uv = ( vUv - vec2( 0.5 ) ) * vec2( offset );\n gl_FragColor = vec4( mix( texel.rgb, vec3( 1.0 - darkness ), dot( uv, uv ) ), texel.a );\n }"}},5823:function(e,t,i){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);
950r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=this&&this.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||n(t,e,i)};Object.defineProperty(t,"__esModule",{value:!0}),r(i(6201),t),r(i(9785),t),r(i(1662),t),r(i(9843),t),r(i(3401),t),r(i(889),t),r(i(3461),t),r(i(1741),t),r(i(8533),t)},3401:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getHorizontalOffset=t.TextCanvas=t.DEFAULT_TEXT_CANVAS_LAYER=void 0;const n=i(82),r=i(9843),s=i(16),o=i(1662),a=i(5402),l=i(2516),c=i(3461),h=new n.Vector3,u={array:[new n.Box2],offset:0};let d=new Float32Array;t.DEFAULT_TEXT_CANVAS_LAYER=0;class m{constructor(e){this.m_renderer=e.renderer,this.m_fontCatalog=e.fontCatalog,this.minGlyphCount=e.minGlyphCount,this.maxGlyphCount=e.maxGlyphCount,this.name=e.name,void 0===e.material?(this.m_ownsMaterial=!0,this.m_material=(0,c.createSdfTextMaterial)({fontCatalog:e.fontCatalog,rendererCapabilities:this.m_renderer.capabilities})):(this.m_ownsMaterial=!1,this.m_material=e.material),void 0===e.backgroundMaterial?(this.m_ownsBgMaterial=!0,this.m_bgMaterial=(0,c.createSdfTextMaterial)({fontCatalog:e.fontCatalog,isBackground:!0,rendererCapabilities:this.m_renderer.capabilities})):(this.m_ownsBgMaterial=!1,this.m_bgMaterial=e.backgroundMaterial),this.m_defaultLayer={id:t.DEFAULT_TEXT_CANVAS_LAYER,storage:new s.TextGeometry(new n.Scene,this.m_material,this.m_bgMaterial,this.minGlyphCount,this.maxGlyphCount)},this.m_layers=[this.m_defaultLayer],this.m_currentTextRenderStyle=(new o.TextRenderStyle).copy(m.defaultTextRenderStyle),this.m_currentTextLayoutStyle=(new o.TextLayoutStyle).copy(m.defaultTextLayoutStyle),this.m_lineTypesetter=new a.LineTypesetter,this.m_pathTypesetter=new l.PathTypesetter}get fontCatalog(){return this.m_fontCatalog}set fontCatalog(e){this.m_fontCatalog=e;const t=this.m_material;t.uniforms.sdfTexture.value=this.m_fontCatalog.texture,t.uniforms.sdfParams.value=new n.Vector4(this.m_fontCatalog.textureSize.x,this.m_fontCatalog.textureSize.y,this.m_fontCatalog.size,this.m_fontCatalog.distanceRange),t.defines.MSDF="msdf"===this.m_fontCatalog.type?1:0;const i=this.m_bgMaterial;i.uniforms.sdfTexture.value=this.m_fontCatalog.texture,i.uniforms.sdfParams.value=new n.Vector4(this.m_fontCatalog.textureSize.x,this.m_fontCatalog.textureSize.y,this.m_fontCatalog.size,this.m_fontCatalog.distanceRange),i.defines.MSDF="msdf"===this.m_fontCatalog.type?1:0}get material(){return this.m_material}set material(e){this.m_ownsMaterial&&(this.m_material.dispose(),this.m_ownsMaterial=!1),this.m_material=e;for(const e of this.m_layers)e.storage.mesh.material=this.m_material}get backgroundMaterial(){return this.m_bgMaterial}set backgroundMaterial(e){this.m_ownsBgMaterial&&(this.m_bgMaterial.dispose(),this.m_ownsBgMaterial=!1),this.m_bgMaterial=e;for(const e of this.m_layers)e.storage.backgroundMesh.material=this.m_bgMaterial}get textRenderStyle(){return this.m_currentTextRenderStyle}set textRenderStyle(e){this.m_currentTextRenderStyle.copy(e)}get textLayoutStyle(){return this.m_currentTextLayoutStyle}set textLayoutStyle(e){this.m_currentTextLayoutStyle.copy(e)}clear(){for(const e of this.m_layers)e.storage.clear();this.m_currentTextRenderStyle.copy(m.defaultTextRenderStyle),this.m_currentTextLayoutStyle.copy(m.defaultTextLayoutStyle)}render(e,t,i,n,r){this.m_fontCatalog.update(this.m_renderer);let s=null;void 0!==n&&(s=this.m_renderer.getRenderTarget(),this.m_renderer.setRenderTarget(n)),!0===r&&this.m_renderer.clear(!0);for(let n=0;n<this.m_layers.length;n++){const r=this.m_layers[n];if(r.id>=(null!=t?t:0)){if(!(void 0===i||r.id<i))break;r.storage.update(),this.m_renderer.render(r.storage.scene,e)}}void 0!==n&&this.m_renderer.setRenderTarget(s)}addLayer(e){let t=this.getLayer(e);return void 0===t&&(t={id:e,storage:new s.TextGeometry(new n.Scene,this.m_material,this.m_bgMaterial,this.minGlyphCount,this.maxGlyphCount)},this.m_layers.push(t),this.m_layers.sort(((e,t)=>e.id-t.id))),t}getLayer(e){return this.m_layers.find((t=>t.id===e))}getAllLayers(){return this.m_layers}measureText(e,t,i){var n;let r,s,o,a;if(h.set(0,0,0),void 0!==i){if(r=i.path,s=i.pathOverflow,a=i.outputCharacterBounds,void 0!==i.path){const e=i.path.getPoint(0);if(null===e)return!1;h.set(e.x,e.y,0)}i.letterCaseArray&&(o=i.letterCaseArray)}return this.placeText({horizontalOffset:null!==(n=null==i?void 0:i.horizontalOffset)&&void 0!==n?n:0,input:e,layer:this.m_defaultLayer,textPath:r,textPathOverflow:s,bounds:t,individualBounds:a,letterCaseArray:o})}addText(e,t,i){let n,r,s;h.copy(t);let o=this.m_defaultLayer;if(void 0!==i){if(n=i.path,r=i.pathOverflow,void 0!==i.layer){let e=this.getLayer(i.layer);void 0===e&&(e=this.addLayer(i.layer)),o=e}void 0!==i.path&&h.set(0,0,h.z),i.letterCaseArray&&(s=i.letterCaseArray)}const a=o.storage.drawCount,l=this.placeText({input:e,textPath:n,textPathOverflow:r,layer:o,letterCaseArray:s,horizontalOffset:p(null==i?void 0:i.pickingData)});return l&&void 0!==i?(!0===i.updatePosition&&t.copy(h),void 0!==i.pickingData&&o.storage.addPickingData(a,o.storage.drawCount,i.pickingData)):l||(o.storage.m_drawCount=a),l}createTextBufferObject(e,t){let i,s;h.set(0,0,0);const a=this.m_currentTextRenderStyle.fontVariant===o.FontVariant.SmallCaps;if("string"!=typeof e)i=e,void 0!==t&&t.letterCaseArray&&(s=t.letterCaseArray);else if(s=[],i=this.m_fontCatalog.getGlyphs(e,this.m_currentTextRenderStyle,a?s:void 0),void 0===i)return;let l,c,u,m,p,f;return void 0!==t&&(l=t.path,c=t.pathOverflow,!0===t.outputBounds&&(u=new n.Box2),!0===t.outputCharacterBounds&&(m=[]),!0===t.storeStyles&&(p=this.m_currentTextRenderStyle.clone(),f=this.m_currentTextLayoutStyle.clone())),this.placeText({input:e,layer:this.m_defaultLayer,computeTextBuffer:!0,textPath:l,textPathOverflow:c,bounds:u,individualBounds:m,letterCaseArray:s}),new r.TextBufferObject(i,new Float32Array(d),u,m,p,f)}addTextBufferObject(e,t){var i;let n,r,s,o,a,l,c,h=this.m_defaultLayer;if(void 0!==t){if(void 0!==t.layer){let e=this.getLayer(t.layer);void 0===e&&(e=this.addLayer(t.layer)),h=e}n=null===(i=t.position)||void 0===i?void 0:i.clone(),r=t.scale,s=t.rotation,o=t.color,a=t.opacity,l=t.backgroundColor,c=t.backgroundOpacity}const u=h.storage.drawCount,d=h.storage.addTextBufferObject(e,n,r,s,o,a,l,c);return d&&void 0!==t?void 0!==t.pickingData&&h.storage.addPickingData(u,h.storage.drawCount,t.pickingData):d||(h.storage.m_drawCount=u),d}
950pickText(e,t){for(const i of this.m_layers)i.storage.pick(e,t)}getMemoryUsage(e){this.m_fontCatalog.updateMemoryUsage(e);for(const t of this.m_layers)t.storage.updateMemoryUsage(e)}placeText(e){if(0===e.input.length||0===this.m_currentTextLayoutStyle.maxLines)return void 0!==e.bounds&&(e.bounds.min.set(0,0),e.bounds.max.set(0,0)),void 0!==e.individualBounds&&(e.individualBounds.length=0),!0;let t,i;const n=this.m_currentTextRenderStyle.fontVariant===o.FontVariant.SmallCaps;if("string"!=typeof e.input)t=e.input,e.letterCaseArray&&(i=e.letterCaseArray);else if(i=[],t=this.m_fontCatalog.getGlyphs(e.input,this.m_currentTextRenderStyle,n?i:void 0),void 0===t)return!1;let r;void 0!==e.individualBounds&&(u.array=e.individualBounds,u.offset=0,r=u),void 0!==e.bounds&&(e.bounds.min.set(1/0,1/0),e.bounds.max.set(-1/0,-1/0)),!0===e.computeTextBuffer&&(d=new Float32Array(t.length*s.QUAD_VERTEX_MEMORY_FOOTPRINT));const a=void 0!==e.textPath,l={glyphs:t,fontCatalog:this.m_fontCatalog,textRenderStyle:this.m_currentTextRenderStyle,textLayoutStyle:this.m_currentTextLayoutStyle,position:h,geometry:e.layer.storage,smallCapsArray:n?i:void 0,globalBounds:e.bounds,individualBounds:r,vertexBuffer:!0===e.computeTextBuffer?d:void 0};let c=!0;return a?(Object.assign(l,{path:e.textPath,pathOverflow:!0===e.textPathOverflow,horizontalOffset:e.horizontalOffset}),c=this.m_pathTypesetter.arrangeGlyphs(l)):c=this.m_lineTypesetter.arrangeGlyphs(l),void 0!==r&&(r.array.length=r.offset),c}}function p(e){if(void 0===(null==e?void 0:e.userData))return 0;const{logical_offset:t,num_lines:i}=e.userData;if(void 0===t||void 0===i)return 0;if(1===i)return 0;const n=t/(i-1)*.5;return e.layoutStyle.horizontalAlignment/2+n||0}t.TextCanvas=m,m.defaultTextRenderStyle=new o.TextRenderStyle,m.defaultTextLayoutStyle=new o.TextLayoutStyle,t.getHorizontalOffset=p},6201:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FontCatalog=void 0;const n=i(82),r=i(8533),s=i(9785),o=i(2090),a=i(1662),l="_BoldAssets/",c="_ItalicAssets/";class h{static async load(e,t,i){const r=new URL(e,window.location.href),o=await h.loadJSON(r.href,i),a=new URL(`${o.name}_Assets/Extra/`,r),l=await h.loadJSON(a.href+"Specials.json",i),c=await h.loadTexture(a.href+"Specials.png",i);c.wrapS=n.ClampToEdgeWrapping,c.wrapT=n.ClampToEdgeWrapping,c.minFilter=n.NearestFilter,c.needsUpdate=!0;const u=o.fonts.find((e=>"Extra"===e.name)),d=new s.GlyphData(65533,"Specials",l.chars[0].width,l.chars[0].height,l.chars[0].xadvance,l.chars[0].xoffset,l.chars[0].yoffset,0,0,1,1,c,u,!0);return new h(r.href,o.name,o.type,o.size,o.maxWidth,o.maxHeight,o.distanceRange,o.fonts,o.supportedBlocks,t,d)}static async loadTexture(e,t){let i;return await new Promise(((r,s)=>{i=()=>{s(t.reason)},null==t||t.addEventListener("abort",i),(new n.TextureLoader).load(e,r)})).finally((()=>{null==t||t.removeEventListener("abort",i)}))}static async loadJSON(e,t){const i=await fetch(e,{signal:t});if(!i.ok)throw new Error(`${e} Status Text: ${i.statusText}`);const n=await i.text();return JSON.parse(n)}constructor(e,t,i,n,r,s,a,l,c,h,u){this.url=e,this.name=t,this.type=i,this.size=n,this.maxWidth=r,this.maxHeight=s,this.distanceRange=a,this.fonts=l,this.unicodeBlocks=c,this.maxCodePointCount=h,this.m_replacementGlyph=u,this.showReplacementGlyphs=!1,this.m_baseUrl=e.substring(0,e.lastIndexOf("/")),this.m_glyphTextureCache=new o.GlyphTextureCache(h,this.maxWidth+1,this.maxHeight+1),this.m_loadingJson=new Map,this.m_loadingPages=new Map,this.m_loadingGlyphs=new Map,this.m_loadedJson=new Map,this.m_loadedPages=new Map,this.m_loadedGlyphs=new Map}dispose(){this.fonts.length=0,this.unicodeBlocks.length=0,this.m_glyphTextureCache.dispose(),this.m_loadingJson.clear(),this.m_loadingPages.clear(),this.m_loadingGlyphs.clear(),this.m_loadedJson.clear(),this.m_loadedPages.clear(),this.m_loadedGlyphs.clear()}clear(){this.m_glyphTextureCache.clear(),this.m_loadingJson.clear(),this.m_loadingPages.clear(),this.m_loadingGlyphs.clear(),this.m_loadedJson.clear(),this.m_loadedPages.clear(),this.m_loadedGlyphs.clear()}update(e){this.m_glyphTextureCache.update(e)}get texture(){return this.m_glyphTextureCache.texture}get textureSize(){return this.m_glyphTextureCache.textureSize}get isLoading(){return this.m_loadingJson.size>0||this.m_loadingPages.size>0||this.m_loadingGlyphs.size>0}async loadBlock(e,t,i,n){const r=this.getAssetsPath(i,t),s=`${r}/${e.name.replace(/ /g,"_")}.json`;let o=this.m_loadedJson.get(s);if(void 0===o){let e=this.m_loadingJson.get(s);if(void 0===e)try{e=h.loadJSON(s),this.m_loadingJson.set(s,e),o=await e,this.m_loadingJson.delete(s),this.m_loadedJson.set(s,o)}catch(e){console.error(e),this.m_loadingJson.delete(s)}else o=await e}const a=[];if(!0===n)for(const e of o.pages)a.push(this.loadPage(`${r}/${e}`));return await Promise.all(a),o}removeBlock(e,t,i){const n=this.getAssetsPath(i,t),r=`${n}/${e.name.replace(/ /g,"_")}.json`,s=this.m_loadedJson.get(r);if(void 0!==s){for(const e of s.pages){const t=`${n}/${e}`;this.m_loadingPages.delete(t),this.m_loadedPages.delete(t)}this.m_loadingJson.delete(r),this.m_loadedJson.delete(r)}}async loadCharset(e,t){const i=t.fontName,n=t.fontStyle,r=(t.fontVariant===a.FontVariant.AllCaps||t.fontVariant===a.FontVariant.SmallCaps?e.toUpperCase():e).replace(/[\s\S](?=([\s\S]+))/g,((e,t)=>
950t.indexOf(e)+1?"":e)),s=[];for(const e of r){const t=e.codePointAt(0),r=this.getFont(t,i),o=`${r.name}_${n}`,a=`${o}_${t}`;let l=this.m_loadedGlyphs.get(o);void 0===l&&(l=new Map,this.m_loadedGlyphs.set(o,l));const c=l.get(t);if(void 0===c){let i=this.m_loadingGlyphs.get(a);if(void 0===i){if(!r.charset.includes(String.fromCodePoint(t))){const i=this.createReplacementGlyph(t,e,r);l.set(t,i),this.m_glyphTextureCache.add(a,i);continue}let s;for(const e of this.unicodeBlocks)if(t>=e.min&&t<=e.max){s=e;break}i=this.loadAssets(t,n,s,r),this.m_loadingGlyphs.set(a,i),i.then((e=>{this.m_loadingGlyphs.delete(a),l.set(t,e),this.m_glyphTextureCache.add(a,e)}))}s.push(i)}else this.m_glyphTextureCache.has(a)||(s.push(Promise.resolve(c)),this.m_glyphTextureCache.add(a,c))}return Promise.all(s)}getGlyph(e,t,i){const n=this.m_loadedGlyphs.get(`${t.name}_${i}`);if(void 0!==n)return n.get(e)}getGlyphs(e,t,i){const n=[],r=t.fontName,s=t.fontStyle,o=t.fontVariant,l=o===a.FontVariant.AllCaps||o===a.FontVariant.SmallCaps;for(const t of e){const e=l?t.toUpperCase():t;for(const o of e){const e=o.codePointAt(0),a=this.getFont(e,r),l=this.getGlyph(e,a,s);if(void 0===l||l.isReplacement&&!this.showReplacementGlyphs)return;n.push(l),void 0!==i&&i.push(o!==t)}}return n}getFont(e,t){var i,n;let r=this.fonts[0].name;for(const s of this.unicodeBlocks)if(e>=s.min&&e<=s.max){const e=null!==(i=null==t?void 0:t.split("; "))&&void 0!==i?i:[];r=null!==(n=e.find((e=>{var t;return e&&(null===(t=s.fonts)||void 0===t?void 0:t.includes(e))})))&&void 0!==n?n:s.fonts[0];break}return this.fonts.find((e=>e.name===r))}updateMemoryUsage(e){let t=0;for(const e of this.unicodeBlocks)t+=2*(e.max-e.min);let i=this.m_glyphTextureCache.textureSize.x*this.m_glyphTextureCache.textureSize.y*4;for(const e in this.m_loadedPages.entries)if(void 0!==this.m_loadedPages.get(e)){const t=this.m_loadedPages.get(e);void 0!==t&&(i+=t.image.width*t.image.height*4)}e.heapSize+=t+i,e.gpuSize+=i}createReplacementGlyph(e,t,i){const n=this.m_replacementGlyph.clone();return n.codePoint=e,n.character=t,n.font=i,n.isReplacement=r.UnicodeUtils.isPrintable(e),n}async loadAssets(e,t,i,n){const r=await this.loadBlock(i,n,t);if(void 0===r)return this.m_replacementGlyph;const o=r.chars.find((t=>t.id===e)),a=`${this.getAssetsPath(t,n)}/${r.pages[o.page]}`,l=await this.loadPage(a);return new s.GlyphData(o.id,i.name,o.width,o.height,o.xadvance,o.xoffset,o.yoffset,o.x/l.image.width,1-(o.y+o.height)/l.image.height,(o.x+o.width)/l.image.width,1-o.y/l.image.height,l,n)}async loadPage(e){let t=this.m_loadedPages.get(e);if(void 0===t){let i=this.m_loadingPages.get(e);void 0===i?(i=h.loadTexture(e),this.m_loadingPages.set(e,i),t=await i,t.wrapS=n.ClampToEdgeWrapping,t.wrapT=n.ClampToEdgeWrapping,t.minFilter=n.NearestFilter,t.needsUpdate=!0,this.m_loadingPages.delete(e)&&this.m_loadedPages.set(e,t),this.m_loadingPages.delete(e)):t=await i}return t}getAssetsPath(e,t){let i="_Assets/";switch(e){case a.FontStyle.Bold:void 0!==t.bold&&(i=l);break;case a.FontStyle.Italic:void 0!==t.italic&&(i=c);break;case a.FontStyle.BoldItalic:void 0!==t.boldItalic?i="_BoldItalicAssets/":void 0!==t.italic?i=c:void 0!==t.bold&&(i=l)}return`${this.m_baseUrl}/${this.name}${i}${t.name}`}}t.FontCatalog=h},9785:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GlyphData=void 0;const n=i(82),r=i(8533);class s{constructor(e,t,i,s,o,a,l,c,h,u,d,m,p,f=!1){this.codePoint=e,this.block=t,this.width=i,this.height=s,this.advanceX=o,this.offsetX=a,this.offsetY=l,this.texture=m,this.font=p,this.isReplacement=f,this.positions=[],this.sourceTextureCoordinates=[],this.dynamicTextureCoordinates=[],this.copyIndex=0,this.isInCache=!1,this.character=String.fromCodePoint(e),this.direction=r.UnicodeUtils.getDirection(e,t);const g=this.offsetX,v=g+this.width,y=p.metrics.lineHeight-this.offsetY,_=y-this.height;this.positions.push(new n.Vector3(g,_,1),new n.Vector3(v,_,1),new n.Vector3(g,y,1),new n.Vector3(v,y,1)),this.sourceTextureCoordinates.push(new n.Vector2(c,h),new n.Vector2(u,h),new n.Vector2(c,d),new n.Vector2(u,d)),this.dynamicTextureCoordinates.push(new n.Vector2(0,0),new n.Vector2(1,0),new n.Vector2(0,1),new n.Vector2(1,1))}clone(){return new s(this.codePoint,this.block,this.width,this.height,this.advanceX,this.offsetX,this.offsetY,this.sourceTextureCoordinates[0].x,this.sourceTextureCoordinates[0].y,this.sourceTextureCoordinates[3].x,this.sourceTextureCoordinates[3].y,this.texture,this.font,this.isReplacement)}}t.GlyphData=s},2090:(e,t,i)=>{"use strict";
950Object.defineProperty(t,"__esModule",{value:!0}),t.GlyphTextureCache=void 0;const n=i(82),r=i(8263),s=i(9785),o=i(4420),a=4096;t.GlyphTextureCache=class{constructor(e,t,i){this.capacity=e,this.entryWidth=t,this.entryHeight=i;const s=Math.floor(Math.sqrt(e));this.m_cacheHeight=s*s<e?s+1:s,this.m_cacheWidth=s*this.m_cacheHeight<e?s+1:s,this.m_textureSize=new n.Vector2(this.m_cacheWidth*t,this.m_cacheHeight*i),(this.m_textureSize.y>a||this.m_textureSize.x>a)&&console.warn("GlyphTextureCache texture size ("+this.m_textureSize.x+", "+this.m_textureSize.y+") exceeds WebGL's widely supported MAX_TEXTURE_SIZE ("+a+").\nThis could result in rendering errors on some devices.\nPlease consider reducing its capacity or input assets size."),this.m_entryCache=new r.LRUCache(e),this.initCacheEntries(),this.m_scene=new n.Scene,this.m_camera=new n.OrthographicCamera(0,this.m_textureSize.x,this.m_textureSize.y,0),this.m_camera.position.z=1,this.m_camera.updateMatrixWorld(!1),this.m_rt=new n.WebGLRenderTarget(this.m_textureSize.x,this.m_textureSize.y,{wrapS:n.ClampToEdgeWrapping,wrapT:n.ClampToEdgeWrapping,depthBuffer:!1,stencilBuffer:!1}),this.m_copyTextureSet=new Set,this.m_copyTransform=new n.Matrix3,this.m_copyPositions=[],this.m_copyPositions.push(new n.Vector2,new n.Vector2,new n.Vector2,new n.Vector2),this.m_copyVertexBuffer=new n.InterleavedBuffer(new Float32Array(20*e),5),this.m_copyVertexBuffer.setUsage(n.DynamicDrawUsage),this.m_copyPositionAttribute=new n.InterleavedBufferAttribute(this.m_copyVertexBuffer,3,0),this.m_copyUVAttribute=new n.InterleavedBufferAttribute(this.m_copyVertexBuffer,2,3),this.m_copyGeometry=new n.BufferGeometry,this.m_copyGeometry.setAttribute("position",this.m_copyPositionAttribute),this.m_copyGeometry.setAttribute("uv",this.m_copyUVAttribute);const o=new n.BufferAttribute(new Uint32Array(6*e),1);o.setUsage(n.DynamicDrawUsage),this.m_copyGeometry.setIndex(o),this.m_copyMesh=new n.Mesh(this.m_copyGeometry),this.m_copyMesh.frustumCulled=!1,this.m_copyGeometryDrawCount=0,this.m_clearPositionAttribute=new n.BufferAttribute(new Float32Array(8*e),2),this.m_clearPositionAttribute.setUsage(n.DynamicDrawUsage),this.m_clearGeometry=new n.BufferGeometry,this.m_clearGeometry.setAttribute("position",this.m_clearPositionAttribute);const l=new n.BufferAttribute(new Uint32Array(6*e),1);l.setUsage(n.DynamicDrawUsage),this.m_clearGeometry.setIndex(l),this.m_clearMesh=new n.Mesh(this.m_clearGeometry),this.m_clearMesh.frustumCulled=!1,this.m_clearGeometryDrawCount=0,this.m_scene.add(this.m_clearMesh,this.m_copyMesh)}dispose(){var e,t;this.m_entryCache.clear(),this.m_scene.remove(this.m_clearMesh,this.m_copyMesh),this.m_rt.dispose(),null===(e=this.m_clearMaterial)||void 0===e||e.dispose(),null===(t=this.m_copyMaterial)||void 0===t||t.dispose(),this.m_copyTextureSet.clear(),this.m_clearGeometry.dispose(),this.m_copyGeometry.dispose()}get texture(){return this.m_rt.texture}get textureSize(){return this.m_textureSize}add(e,t){if(void 0!==this.m_entryCache.get(e))return;const i=this.m_entryCache.oldest;if(null===i)throw new Error("GlyphTextureCache is uninitialized!");this.clearCacheEntry(i.value),this.copyGlyphToCache(e,t,i.value.location)}has(e){return this.m_entryCache.has(e)}get(e){return this.m_entryCache.get(e)}clear(){this.m_copyGeometryDrawCount=0,this.m_clearGeometryDrawCount=0,this.m_entryCache.clear(),this.m_copyTextureSet.clear(),this.initCacheEntries()}update(e){let t=null;const i=this.m_clearGeometryDrawCount>0,n=this.m_copyGeometryDrawCount>0;if((i||n)&&(t=e.getRenderTarget(),e.setRenderTarget(this.m_rt)),i){if(this.m_clearMaterial||(this.m_clearMaterial=new o.GlyphClearMaterial({rendererCapabilities:e.capabilities}),this.m_clearMesh.material=this.m_clearMaterial),null===this.m_clearGeometry.index)throw new Error("GlyphTextureCache clear geometry index is uninitialized!");this.m_clearPositionAttribute.needsUpdate=!0,this.m_clearPositionAttribute.updateRange.offset=0,this.m_clearPositionAttribute.updateRange.count=8*this.m_clearGeometryDrawCount,this.m_clearGeometry.index.needsUpdate=!0,this.m_clearGeometry.index.updateRange.offset=0,this.m_clearGeometry.index.updateRange.count=6*this.m_clearGeometryDrawCount,this.m_clearGeometry.setDrawRange(0,6*this.m_clearGeometryDrawCount),this.m_clearMesh.visible=!0,this.m_copyMesh.visible=!1,e.render(this.m_scene,this.m_camera),this.m_clearGeometryDrawCount=0,this.m_clearMesh.visible=!1}if(n){if(this.m_copyMaterial||(this.m_copyMaterial=new o.GlyphCopyMaterial({rendererCapabilities:e.capabilities}),this.m_copyMesh.material=this.m_copyMaterial),null===this.m_copyGeometry.index)throw new Error("GlyphTextureCache copy geometry index is uninitialized!");this.m_copyVertexBuffer.needsUpdate=!0,this.m_copyVertexBuffer.updateRange.offset=0,this.m_copyVertexBuffer.updateRange.count=20*this.m_copyGeometryDrawCount,this.m_copyGeometry.index.needsUpdate=!0,this.m_copyGeometry.index.updateRange.offset=0,this.m_copyGeometry.index.updateRange.count=6*this.m_copyGeometryDrawCount,this.m_copyGeometry.setDrawRange(0,6*this.m_copyGeometryDrawCount),this.m_copyMesh.visible=!0;const t=Array.from(this.m_copyTextureSet),i=Math.ceil(this.m_copyTextureSet.size/8);for(let n=0;n<i;n++){const i=8*n;this.m_copyMaterial.uniforms.pageOffset.value=i;for(let e=0;e<8;e++){const n=i+e;n<this.m_copyTextureSet.size&&(this.m_copyMaterial.uniforms["page"+e].value=t[n])}e.render(this.m_scene,this.m_camera)}this.m_copyTextureSet.clear(),this.m_copyGeometryDrawCount=0}(i||n)&&e.setRenderTarget(t)}initCacheEntries(){const e=new s.GlyphData(0,"",0,0,0,0,0,0,0,0,0,n.Texture.DEFAULT_IMAGE,{name:"",metrics:{size:0,distanceRange:0,base:0,lineHeight:0,lineGap:0,capHeight:0,xHeight:0},charset:""});for(let t=0;t<this.m_cacheHeight;t++)for(let i=0;i<this.m_cacheWidth;i++){const r={glyphData:e,location:new n.Vector2(i,t)};this.m_entryCache.set(`Dummy_${t*this.m_cacheHeight+i}`,r)}}copyGlyphToCache(e,t,i){this.m_copyTextureSet.add(t.texture);let n=0;for(const e of this.m_copyTextureSet.values()){if(e===t.texture)break;n++}t.copyIndex=n,this.m_copyTransform.set(1,0,i.x*this.entryWidth-t.offsetX,0,1,i.y*this.entryHeight-t.positions[0].y,0,0,0);for(let e=0;e<4;++e)this.m_copyPositions[e].set(t.positions[e].x,t.positions[e].y),this.m_copyPositions[e].applyMatrix3(this.m_copyTransform);if(this.m_copyGeometryDrawCount>=this.capacity)return;const r=4*this.m_copyGeometryDrawCount,s=6*this.m_copyGeometryDrawCount;for(let e=0;e<4;++e)this.m_copyPositionAttribute.setXYZ(r+e,this.m_copyPositions[e].x,this.m_copyPositions[e].y,t.copyIndex),this.m_copyUVAttribute.setXY(r+e,t.s
950ourceTextureCoordinates[e].x,t.sourceTextureCoordinates[e].y);if(null===this.m_copyGeometry.index)throw new Error("GlyphTextureCache copy geometry index is uninitialized!");this.m_copyGeometry.index.setX(s,r),this.m_copyGeometry.index.setX(s+1,r+1),this.m_copyGeometry.index.setX(s+2,r+2),this.m_copyGeometry.index.setX(s+3,r+2),this.m_copyGeometry.index.setX(s+4,r+1),this.m_copyGeometry.index.setX(s+5,r+3),++this.m_copyGeometryDrawCount;const o=this.m_copyPositions[0].x/this.m_textureSize.x,a=this.m_copyPositions[0].y/this.m_textureSize.y,l=this.m_copyPositions[3].x/this.m_textureSize.x,c=this.m_copyPositions[3].y/this.m_textureSize.y;t.dynamicTextureCoordinates[0].set(o,a),t.dynamicTextureCoordinates[1].set(l,a),t.dynamicTextureCoordinates[2].set(o,c),t.dynamicTextureCoordinates[3].set(l,c),t.isInCache=!0,this.m_entryCache.set(e,{glyphData:t,location:i})}clearCacheEntry(e){if(e.glyphData.isInCache=!1,this.m_copyPositions[0].set(e.location.x*this.entryWidth,e.location.y*this.entryHeight),this.m_copyPositions[1].set((e.location.x+1)*this.entryWidth,e.location.y*this.entryHeight),this.m_copyPositions[2].set(e.location.x*this.entryWidth,(e.location.y+1)*this.entryHeight),this.m_copyPositions[3].set((e.location.x+1)*this.entryWidth,(e.location.y+1)*this.entryHeight),this.m_clearGeometryDrawCount>=this.capacity)return;const t=4*this.m_clearGeometryDrawCount,i=6*this.m_clearGeometryDrawCount;for(let e=0;e<4;++e)this.m_clearPositionAttribute.setXY(t+e,this.m_copyPositions[e].x,this.m_copyPositions[e].y);if(null===this.m_clearGeometry.index)throw new Error("GlyphTextureCache clear geometry index is uninitialized!");this.m_clearGeometry.index.setX(i,t),this.m_clearGeometry.index.setX(i+1,t+1),this.m_clearGeometry.index.setX(i+2,t+2),this.m_clearGeometry.index.setX(i+3,t+2),this.m_clearGeometry.index.setX(i+4,t+1),this.m_clearGeometry.index.setX(i+5,t+3),++this.m_clearGeometryDrawCount}}},9843:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TextBufferObject=void 0,t.TextBufferObject=class{constructor(e,t,i,n,r,s){this.glyphs=e,this.buffer=t,this.bounds=i,this.characterBounds=n,this.textRenderStyle=r,this.textLayoutStyle=s}}},16:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TextGeometry=t.QUAD_INDEX_MEMORY_FOOTPRINT=t.QUAD_VERTEX_MEMORY_FOOTPRINT=t.INDICES_PER_QUAD=t.VERTICES_PER_QUAD=t.INDEX_BUFFER_STRIDE=t.VERTEX_BUFFER_STRIDE=t.MAX_CAPACITY=void 0;const n=i(82);t.MAX_CAPACITY=65536,t.VERTEX_BUFFER_STRIDE=16,t.INDEX_BUFFER_STRIDE=1,t.VERTICES_PER_QUAD=4,t.INDICES_PER_QUAD=6,t.QUAD_VERTEX_MEMORY_FOOTPRINT=t.VERTICES_PER_QUAD*t.VERTEX_BUFFER_STRIDE,t.QUAD_INDEX_MEMORY_FOOTPRINT=t.INDICES_PER_QUAD*t.INDEX_BUFFER_STRIDE,t.TextGeometry=class{get drawCount(){return this.m_drawCount}get mesh(){return this.m_mesh}get backgroundMesh(){return this.m_bgMesh}constructor(e,i,r,s,o){this.scene=e,this.m_pickingDataArray=[],this.capacity=Math.min(o,t.MAX_CAPACITY),this.m_currentCapacity=Math.min(s,o),this.m_drawCount=0,this.m_updateOffset=0,this.m_vertexBuffer=new n.InterleavedBuffer(new Float32Array(this.m_currentCapacity*t.QUAD_VERTEX_MEMORY_FOOTPRINT),t.VERTEX_BUFFER_STRIDE),this.m_vertexBuffer.setUsage(n.DynamicDrawUsage),this.m_positionAttribute=new n.InterleavedBufferAttribute(this.m_vertexBuffer,4,0),this.m_uvAttribute=new n.InterleavedBufferAttribute(this.m_vertexBuffer,4,4),this.m_colorAttribute=new n.InterleavedBufferAttribute(this.m_vertexBuffer,4,8),this.m_bgColorAttribute=new n.InterleavedBufferAttribute(this.m_vertexBuffer,4,12),this.m_indexBuffer=new n.BufferAttribute(new Uint32Array(this.m_currentCapacity*t.QUAD_INDEX_MEMORY_FOOTPRINT),t.INDEX_BUFFER_STRIDE),this.m_indexBuffer.setUsage(n.DynamicDrawUsage),this.m_geometry=new n.BufferGeometry,this.m_geometry.setAttribute("position",this.m_positionAttribute),this.m_geometry.setAttribute("uv",this.m_uvAttribute),this.m_geometry.setAttribute("color",this.m_colorAttribute),this.m_geometry.setAttribute("bgColor",this.m_bgColorAttribute),this.m_geometry.setIndex(this.m_indexBuffer),this.m_mesh=new n.Mesh(this.m_geometry,i),this.m_bgMesh=new n.Mesh(this.m_geometry,r),this.m_mesh.renderOrder=Number.MAX_SAFE_INTEGER,this.m_bgMesh.renderOrder=Number.MAX_SAFE_INTEGER-1,this.m_mesh.frustumCulled=!1,this.m_bgMesh.frustumCulled=!1,this.scene.add(this.m_bgMesh,this.m_mesh)}dispose(){this.scene.remove(this.m_bgMesh,this.m_mesh),this.m_geometry.dispose()}clear(){this.m_drawCount=0,this.m_updateOffset=0,this.m_pickingDataArray.length=0}update(){this.drawCount>this.m_updateOffset&&(this.m_vertexBuffer.needsUpdate=!0,this.m_vertexBuffer.updateRange.offset=this.m_updateOffset*t.QUAD_VERTEX_MEMORY_FOOTPRINT,this.m_vertexBuffer.updateRange.count=(this.m_drawCount-this.m_updateOffset)*t.QUAD_VERTEX_MEMORY_FOOTPRINT,this.m_indexBuffer.needsUpdate=!0,this.m_indexBuffer.updateRange.offset=this.m_updateOffset*t.QUAD_INDEX_MEMORY_FOOTPRINT,this.m_indexBuffer.updateRange.count=(this.m_drawCount-this.m_updateOffset)*t.QUAD_INDEX_MEMORY_FOOTPRINT),this.m_updateOffset=this.m_drawCount,this.m_geometry.setDrawRange(0,this.m_drawCount*t.INDICES_PER_QUAD)}add(e,i,n,r,s,o){if(this.m_drawCount>=this.capacity)return!1;if(this.m_drawCount>=this.m_currentCapacity){const e=Math.min(2*this.m_currentCapacity,this.capacity);this.resizeBuffers(e)}const a=this.m_drawCount*t.VERTICES_PER_QUAD,l=this.m_drawCount*t.INDICES_PER_QUAD;for(let l=0;l<t.VERTICES_PER_QUAD;++l){this.m_positionAttribute.setXYZW(a+l,i[l].x,i[l].y,i[l].z,(s?-1:1)*o.rotation);const t=s?(l+1)%2+2*Math.floor(l/2):l;this.m_uvAttribute.setXYZW(a+l,e.dynamicTextureCoordinates[t].x,e.dynamicTextureCoordinates[t].y,n,r),this.m_colorAttribute.setXYZW(a+l,o.color.r,o.color.g,o.color.b,o.opacity),this.m_bgColorAttribute.setXYZW(a+l,o.backgroundColor.r,o.backgroundColor.g,o.backgroundColor.b,o.backgroundOpacity)}return this.m_indexBuffer.setX(l,a),this.m_indexBuffer.setX(l+1,a+1),this.m_indexBuffer.setX(l+2,a+2),this.m_indexBuffer.setX(l+3,a+2),this.m_indexBuffer.setX(l+4,a+1),this.m_indexBuffer.setX(l+5,a+3),++this.m_drawCount,!0}addToBuffer(e,i,n,r,s,o,a,l){for(let c=0;c<t.VERTICES_PER_QUAD;++c){const h=i+t.VERTEX_BUFFER_STRIDE*c;e[h]=r[c].x,e[h+1]=r[c].y,e[h+2]=r[c].z,e[h+3]=(a?-1:1)*l.rotation;const u=a?(c+1)%2+2*Math.floor(c/2):c;e[h+4]=n.dynamicTextureCoordinates[u].x,e[h+5]=n.dynamicTextureCoordinates[u].y,e[h+6]=s,e[h+7]=o,e[h+8]=l.color.r,e[h+9]=l.color.g,e[h+10]=l.color.b,e[h+11]=l.opacity,e[h+12]=l.backgroundColor.r,e[h+13]=l.backgroundColor.g,e[h+14]=l.backgroundColor.b,e[h+15]=l.backgroundOpacity}}addTextBufferObject(e,i,n,r,s,o,a,l){if(this.m_drawCount+e.glyphs.length>=this.capacity)return!1;if(this.m_drawCount+e.glyphs.length>=this.m_currentCapacity){const e=Math.min(2*this.m_currentCapacity,this.capacity);this.resizeBuffers(e)}const c=null!=n?n:1,h=null!=r?r:0,u=Math.cos(h),d=Math.sin(h),m=void 0!==i?i.x:0,p=void 0!==i?i.y:0,f=e.buffer,g=f[3]<0?-1:1,v=void 0!==s?s.r:f[8],y=void 0!==s?s.g:f[9],_=void 0!==s?s.b:f[10],x=void 0!==o?o:f[11],b=void 0!==a?a.r:f[12],w=void 0!==a?a.g:f[13],M=void 0!==a?a.b:f[14],T=void 0!==l?l:f[15],S=this.m_drawCount*t.VERTICES_PER_QUAD;for(let i=0;i<e.glyphs.length;++i){const n=i*t.QUAD_VERTEX_MEMORY_FOOTPRINT,r=e.glyphs[i];if(!r.isInCache)return!1;const s=f[n+4]>f[n+t.VERTEX_BUFFER_STRIDE+4],o=f[n+6],a=f[n+7];for(let e=0;e<t.VERTICES_PER_QUAD;++e){const l=f[n+e*t.VERTEX_BUFFER_STRIDE],E=f[n+e*t.VERTEX_BUFFER_STRIDE+1];this.m_positionAttribute.setXYZW(S+i*t.VERTICES_PER_QUAD+e,l*c*u+E*c*-d+m,l*c*d+E*c*u+p,f[n+e*t.VERTEX_BUFFER_STRIDE+2]+0,f[n+e*t.VERTEX_BUFFER_STRIDE+3]+g*h);const A=s?(e+1)%2+2*Math.floor(e/2):e;this.m_uvAttribute.setXYZW(S+i*t.VERTICES_PER_QUAD+e,r.dynamicTextureCoordinates[A].x,r.dynamicTextureCoordinates[A].y,o,(a-o)/c+o),this.m_colorAttribute.setXYZW(S+i*t.VERTICES_PER_QUAD+e,v,y,_,x),this.m_bgColorAttribute.setXYZW(S+i*t.VERTICES_PER_QUAD+e,b,w,M,T)}this.m_indexBuffer.setX((this.m_drawCount+i)*t.INDICES_PER_QUAD,(this.m_drawCount+i)*t.VERTICES_PER_QUAD),this.m_indexBuffer.setX((this.m_drawCount+i)*t.INDICES_PER_QUAD+1,(this.m_drawCount+i)*t.VERTICES_PER_QUAD+1),this.m_indexBuffer.setX((this.m_drawCount+i)*t.INDICES_PER_QUAD+2,(this.m_drawCount+i)*t.VERTICES_PER_QUAD+2),this.m_indexBuffer.setX((this.m_drawCount+i)*t.INDICES_PER_QUAD+3,(this.m_drawCount+i)*t.VERTICES_PER_QUAD+2),this.m_indexBuffer.setX((this.m_drawCount+i)*t.INDICES_PER_QUAD+4,(this.m_drawCount+i)*t.VERTICES_PER_QUAD+1),this.m_indexBuffer.setX((this.m_drawCount+i)*t.INDICES_PER_QUAD+5,(this.m_drawCount+i)*t.VERTICES_PER_QUAD+3)}return this.m_drawCount+=e.glyphs.length,!0}addPickingData(e,t,i){return!(this.m_pickingDataArray.length>=this.m_currentCapacity||(this.m_pickingDataArray.push({start:Math.min(e,this.capacity),end:Math.min(t,this.capacity),data:i}),0))}pick(e,i){for(const n of this.m_pickingDataArray){if(void 0===n)return;for(let r=n.start;r<n.end;++r){const s=r*t.VERTICES_PER_QUAD,o=Math.min(this.m_positionAttribute.getX(s+2),this.m_positionAttribute.getX(s+1));if(e.x<o)continue;const a=Math.max(this.m_positionAttribute.getX(s+2),this.m_positionAttribute.getX(s+1));if(e.x>a)continue;const l=Math.min(this.m_positionAttribute.getY(s+2),this.m_positionAttribute.getY(s+1));if(e.y<l)continue;const c=Math.max(this.m_positionAttribute.getY(s+2),this.m_positionAttribute.getY(s+1));if(!(e.y>c)){i(n.data);break}}}}updateMemoryUsage(e){const t=4*this.m_vertexBuffer.count+4*this.m_indexBuffer.count;e.heapSize+=t,e.gpuSize+=t}resizeBuffers(e){this.m_currentCapacity=e;const i=new Float32Array(e*t.QUAD_VERTEX_MEMORY_FOOTPRINT);i.set(this.m_vertexBuffer.array),this.m_vertexBuffer=new n.InterleavedBuffer(i,t.VERTEX_BUFFER_STRIDE),this.m_vertexBuffer.setUsage(n.DynamicDrawUsage),this.m_positionAttribute=new n.InterleavedBufferAttribute(this.m_vertexBuffer,4,0),this.m_uvAttribute=new n.InterleavedBufferAttribute(this.m_vertexBuffer,4,4),this.m_colorAttribute=new n.InterleavedBufferAttribute(this.m_vertexBuffer,4,8),this.m_bgColorAttribute=new n.InterleavedBufferAttribute(this.m_vertexBuffer,4,12);
950const r=new Uint32Array(e*t.QUAD_INDEX_MEMORY_FOOTPRINT);r.set(this.m_indexBuffer.array),this.m_indexBuffer=new n.BufferAttribute(r,t.INDEX_BUFFER_STRIDE),this.m_indexBuffer.setUsage(n.DynamicDrawUsage),this.m_geometry.dispose(),this.m_geometry=new n.BufferGeometry,this.m_geometry.setAttribute("position",this.m_positionAttribute),this.m_geometry.setAttribute("uv",this.m_uvAttribute),this.m_geometry.setAttribute("color",this.m_colorAttribute),this.m_geometry.setAttribute("bgColor",this.m_bgColorAttribute),this.m_geometry.setIndex(this.m_indexBuffer),this.m_pickingDataArray.length=this.m_currentCapacity,this.scene.remove(this.m_bgMesh,this.m_mesh),this.m_mesh=new n.Mesh(this.m_geometry,this.m_mesh.material),this.m_bgMesh=new n.Mesh(this.m_geometry,this.m_bgMesh.material),this.m_mesh.renderOrder=Number.MAX_SAFE_INTEGER,this.m_bgMesh.renderOrder=Number.MAX_SAFE_INTEGER-1,this.m_mesh.frustumCulled=!1,this.m_bgMesh.frustumCulled=!1,this.scene.add(this.m_bgMesh,this.m_mesh)}}},4420:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SdfTextMaterial=t.GlyphCopyMaterial=t.GlyphClearMaterial=void 0;const n=i(82),r=i(4342);Object.assign(n.ShaderChunk,{sdf_attributes:"\n attribute vec4 position;\n attribute vec4 uv;\n attribute vec4 color;\n attribute vec4 bgColor;\n ",sdf_varying:"\n varying vec4 vColor;\n varying float vWeight;\n varying vec2 vUv;\n varying float vRotation;\n ",sdf_varying_computation:"\n #if BG_TEXT\n vColor = bgColor;\n vWeight = uv.w;\n #else\n vColor = color;\n vWeight = uv.z;\n #endif\n vUv = vec2(uv.xy);\n vRotation = position.w;\n ",sdf_frag_uniforms:"\n uniform sampler2D sdfTexture;\n uniform vec4 sdfParams;\n ",sdf_sampling_functions:"\n float median(float r, float g, float b) {\n return max(min(r, g), min(max(r, g), b));\n }\n\n float getDistance(vec2 uvOffset) {\n vec3 texSample = texture2D(sdfTexture, vUv.xy + uvOffset).rgb;\n #if MSDF\n return median(texSample.r, texSample.g, texSample.b);\n #else\n return texSample.r;\n #endif\n }\n\n float getOpacity(vec2 uvOffset, float weight) {\n vec2 uv = vUv + uvOffset;\n vec2 rotatedUVs = abs(vec2(\n cos(vRotation) * uv.x - sin(vRotation) * uv.y,\n sin(vRotation) * uv.x + cos(vRotation) * uv.y));\n\n float dx = dFdx(rotatedUVs.x) * sdfParams.x;\n float dy = dFdy(rotatedUVs.y) * sdfParams.y;
950\n float toPixels = sdfParams.w * inversesqrt( dx * dx + dy * dy );\n\n float dist = getDistance(uvOffset) + min(weight, 0.5 - 1.0 / sdfParams.w) - 0.5;\n return clamp(dist * toPixels + 0.5, 0.0, 1.0);\n }\n "});class s extends n.RawShaderMaterial{constructor(e){const t=!0===(null==e?void 0:e.rendererCapabilities.isWebGL2),i=e?Object.assign(Object.assign({},e),{glslVersion:t?n.GLSL3:n.GLSL1,vertexShader:t&&e.vertexShader?(0,r.convertVertexShaderToWebGL2)(e.vertexShader):e.vertexShader,fragmentShader:t&&e.fragmentShader?(0,r.convertFragmentShaderToWebGL2)(e.fragmentShader):e.fragmentShader}):void 0;i&&delete i.rendererCapabilities,super(i)}}t.GlyphClearMaterial=class extends s{constructor(e){super(e?{name:"GlyphClearMaterial",vertexShader:"\n attribute vec2 position;\n\n uniform mat4 modelViewMatrix;\n uniform mat4 projectionMatrix;\n\n void main() {\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position.xy, 0.0, 1.0);\n }",fragmentShader:"\n precision highp float;\n precision highp int;\n\n void main() {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);\n }",uniforms:{},depthTest:!1,depthWrite:!1,rendererCapabilities:e.rendererCapabilities}:void 0)}},t.GlyphCopyMaterial=class extends s{constructor(e){super(e?{name:"GlyphCopyMaterial",vertexShader:"\n attribute vec3 position;\n attribute vec2 uv;\n\n uniform mat4 modelViewMatrix;\n uniform mat4 projectionMatrix;\n\n varying vec3 vUv;\n\n void main() {\n vUv = vec3(uv.xy, position.z);\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position.xy, 0.0, 1.0);\n }",fragmentShader:"\n precision highp float;\n precision highp int;\n\n uniform float pageOffset;\n uniform sampler2D page0;\n uniform sampler2D page1;\n uniform sampler2D page2;\n uniform sampler2D page3;\n uniform sampler2D page4;\n uniform sampler2D page5;\n uniform sampler2D page6;\n uniform sampler2D page7;\n\n varying vec3 vUv;\n\n void main() {\n vec4 texSample = vec4(0.0);\n if (vUv.z < pageOffset || vUv.z > (pageOffset + 7.0)) discard;\n else if (vUv.z < pageOffset + 1.0) texSample = texture2D(page0, vUv.xy);\n else if (vUv.z < pageOffset + 2.0) texSample = texture2D(page1, vUv.xy);\n else if (vUv.z < pageOffset + 3.0) texSample = texture2D(page2, vUv.xy);\n else if (vUv.z < pageOffset + 4.0) texSample = texture2D(page3, vUv.xy);\n else if (vUv.z < pageOffset + 5.0) texSample = texture2D(page4, vUv.xy);\n else if (vUv.z < pageOffset + 6.0) texSample = texture2D(page5, vUv.xy);\n else if (vUv.z < pageOffset + 7.0) texSample = texture2D(page6, vUv.xy);\n else texSample = texture2D(page7, vUv.xy);\n\n gl_FragColor = texSample;\n }",uniforms:{pageOffset:new n.Uniform(0),page0:new n.Uniform(n.Texture.DEFAULT_IMAGE),page1:new n.Uniform(n.Texture.DEFAULT_IMAGE),page2:new n.Uniform(n.Texture.DEFAULT_IMAGE),page3:new n.Uniform(n.Texture.DEFAULT_IMAGE),page4:new n.Uniform(n.Texture.DEFAULT_IMAGE),page5:new n.Uniform(n.Texture.DEFAULT_IMAGE),page6:new n.Uniform(n.Texture.DEFAULT_IMAGE),page7:new n.Uniform(n.Texture.DEFAULT_IMAGE)},depthTest:!1,depthWrite:!1,rendererCapabilities:e.rendererCapabilities}:void 0)}},t.SdfTextMaterial=class extends s{constructor(e){super(e?{name:"SdfTextMaterial",vertexShader:void 0!==e.vertexSource?e.vertexSource:"\n #include <sdf_attributes>\n #include <sdf_varying>\n\n uniform mat4 modelViewMatrix;\n uniform mat4 projectionMatrix;\n\n void main() {\n #include <sdf_varying_computation>\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position.xyz, 1.0);\n }",fragmentShader:void 0!==e.fragmentSource?e.fragmentSource:"\n precision highp float;\n precision highp int;\n\n #include <sdf_varying>\n #include <sdf_frag_uniforms>\n #include <sdf_sampling_functions>\n\n void main() {\n vec4 color = vColor;\n color.a *= getOpacity(vec2(0.0), vWeight);\n if (color.a < 0.05) {\n discard;\n }\n gl_FragColor = color;\n }
950",uniforms:{sdfTexture:new n.Uniform(e.texture),sdfParams:new n.Uniform(new n.Vector4(e.textureSize.x,e.textureSize.y,e.size,e.distanceRange))},defines:{MSDF:e.isMsdf?1:0,BG_TEXT:e.isBackground?1:0},depthTest:!0,depthWrite:!1,side:n.FrontSide,transparent:!0,rendererCapabilities:e.rendererCapabilities}:void 0),this.extensions.derivatives=!0}}},1662:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolvePlacementAndAlignment=t.TextLayoutStyle=t.TextRenderStyle=t.DefaultTextStyle=t.vPlacementFromAlignment=t.hPlacementFromAlignment=t.vAlignFromPlacement=t.hAlignFromPlacement=t.WrappingMode=t.HorizontalPlacement=t.VerticalPlacement=t.HorizontalAlignment=t.VerticalAlignment=t.FontVariant=t.FontStyle=t.FontUnit=void 0;const n=i(82);var r,s,o,a,l,c,h,u,d;!function(e){e[e.Em=0]="Em",e[e.Pixel=1]="Pixel",e[e.Point=2]="Point",e[e.Percent=3]="Percent"}(r=t.FontUnit||(t.FontUnit={})),function(e){e[e.Regular=0]="Regular",e[e.Bold=1]="Bold",e[e.Italic=2]="Italic",e[e.BoldItalic=3]="BoldItalic"}(s=t.FontStyle||(t.FontStyle={})),function(e){e[e.Regular=0]="Regular",e[e.AllCaps=1]="AllCaps",e[e.SmallCaps=2]="SmallCaps"}(o=t.FontVariant||(t.FontVariant={})),function(e){e[e.Above=0]="Above",e[e.Center=-.5]="Center",e[e.Below=-1]="Below"}(a=t.VerticalAlignment||(t.VerticalAlignment={})),function(e){e[e.Left=0]="Left",e[e.Center=-.5]="Center",e[e.Right=-1]="Right"}(l=t.HorizontalAlignment||(t.HorizontalAlignment={})),(d=t.VerticalPlacement||(t.VerticalPlacement={}))[d.Top=0]="Top",d[d.Center=-.5]="Center",d[d.Bottom=-1]="Bottom",(u=t.HorizontalPlacement||(t.HorizontalPlacement={}))[u.Left=-1]="Left",u[u.Center=-.5]="Center",u[u.Right=0]="Right",function(e){e[e.None=0]="None",e[e.Character=1]="Character",e[e.Word=2]="Word"}(c=t.WrappingMode||(t.WrappingMode={})),t.hAlignFromPlacement=function(e){return e},t.vAlignFromPlacement=function(e){return e},t.hPlacementFromAlignment=function(e){return e},t.vPlacementFromAlignment=function(e){return e},function(e){e.DEFAULT_FONT_NAME="",e.DEFAULT_FONT_SIZE={unit:Object.freeze(r.Pixel),size:Object.freeze(16),backgroundSize:Object.freeze(0)},e.DEFAULT_FONT_STYLE=s.Regular,e.DEFAULT_FONT_VARIANT=o.Regular,e.DEFAULT_ROTATION=0,e.DEFAULT_COLOR=new n.Color(0),e.DEFAULT_OPACITY=1,e.DEFAULT_BACKGROUND_COLOR=new n.Color(0),e.DEFAULT_BACKGROUND_OPACITY=0,e.DEFAULT_TRACKING=0,e.DEFAULT_LEADING=0,e.DEFAULT_MAX_LINES=1/0,e.DEFAULT_LINE_WIDTH=1/0,e.DEFAULT_CANVAS_ROTATION=0,e.DEFAULT_LINE_ROTATION=0,e.DEFAULT_WRAPPING_MODE=c.Word,e.DEFAULT_VERTICAL_ALIGNMENT=a.Above,e.DEFAULT_HORIZONTAL_ALIGNMENT=l.Left,e.DEFAULT_PLACEMENTS=[]}(h=t.DefaultTextStyle||(t.DefaultTextStyle={}));class m{constructor(e={}){this.m_params={fontName:void 0!==e.fontName?e.fontName:h.DEFAULT_FONT_NAME,fontSize:void 0!==e.fontSize?Object.assign({},e.fontSize):{unit:h.DEFAULT_FONT_SIZE.unit,size:h.DEFAULT_FONT_SIZE.size,backgroundSize:h.DEFAULT_FONT_SIZE.backgroundSize},fontStyle:void 0!==e.fontStyle?e.fontStyle:h.DEFAULT_FONT_STYLE,fontVariant:void 0!==e.fontVariant?e.fontVariant:h.DEFAULT_FONT_VARIANT,rotation:void 0!==e.rotation?e.rotation:h.DEFAULT_ROTATION,color:void 0!==e.color?e.color.clone():h.DEFAULT_COLOR.clone(),opacity:void 0!==e.opacity?e.opacity:h.DEFAULT_OPACITY,backgroundColor:void 0!==e.backgroundColor?e.backgroundColor.clone():h.DEFAULT_BACKGROUND_COLOR.clone(),backgroundOpacity:void 0!==e.backgroundOpacity?e.backgroundOpacity:h.DEFAULT_BACKGROUND_OPACITY,backgroundImage:e.backgroundImage}}get params(){return this.m_params}set params(e){this.m_params=Object.assign(Object.assign({},this.m_params),e)}get fontName(){return this.m_params.fontName}set fontName(e){this.m_params.fontName=e}get fontSize(){return this.m_params.fontSize}set fontSize(e){this.m_params.fontSize=Object.assign({},e)}get fontStyle(){return this.m_params.fontStyle}set fontStyle(e){this.m_params.fontStyle=e}get fontVariant(){return this.m_params.fontVariant}set fontVariant(e){this.m_params.fontVariant=e}get rotation(){return this.m_params.rotation}set rotation(e){this.m_params.rotation=e}get color(){return this.m_params.color}set color(e){this.m_params.color.copy(e)}get backgroundColor(){return this.m_params.backgroundColor}set backgroundColor(e){this.m_params.backgroundColor.copy(e)}get opacity(){return this.m_params.opacity}set opacity(e){this.m_params.opacity=e}get backgroundOpacity(){return this.m_params.backgroundOpacity}set backgroundOpacity(e){this.m_params.backgroundOpacity=e}get backgroundImage(){return this.m_params.backgroundImage}set backgroundImage(e){this.m_params.backgroundImage=e}clone(e={}){return new m(Object.assign(Object.assign({},this.m_params),e))}copy(e){return this.m_params.fontName=e.fontName,this.m_params.fontSize=Object.assign({},e.fontSize),this.m_params.fontStyle=e.fontStyle,this.m_params.fontVariant=e.fontVariant,this.m_params.rotation=e.rotation,this.m_params.color.copy(e.color),this.m_params.backgroundColor.copy(e.backgroundColor),this.m_params.opacity=e.opacity,this.m_params.backgroundOpacity=e.backgroundOpacity,this.m_params.backgroundImage=e.backgroundImage,this}}t.TextRenderStyle=m;class p{constructor(e={}){const{horizontalAlignment:t,verticalAlignment:i,placements:n}=f(e.horizontalAlignment,e.verticalAlignment,e.placements);this.m_params={tracking:void 0!==e.tracking?e.tracking:h.DEFAULT_TRACKING,leading:void 0!==e.leading?e.leading:h.DEFAULT_LEADING,maxLines:void 0!==e.maxLines?e.maxLines:h.DEFAULT_MAX_LINES,lineWidth:void 0!==e.lineWidth?e.lineWidth:h.DEFAULT_LINE_WIDTH,canvasRotation:void 0!==e.canvasRotation?e.canvasRotation:h.DEFAULT_CANVAS_ROTATION,lineRotation:void 0!==e.lineRotation?e.lineRotation:h.DEFAULT_LINE_ROTATION,wrappingMode:void 0!==e.wrappingMode?e.wrappingMode:h.DEFAULT_WRAPPING_MODE,verticalAlignment:i,horizontalAlignment:t,placements:n}}get params(){return this.m_params}set params(e){this.m_params=Object.assign(Object.assign({},this.m_params),e)}get tracking(){return this.m_params.tracking}set tracking(e){this.m_params.tracking=e}get leading(){return this.m_params.leading}set leading(e){this.m_params.leading=e}get maxLines(){return this.m_params.maxLines}set maxLines(e){this.m_params.maxLines=e}get lineWidth(){return this.m_params.lineWidth}set lineWidth(e){this.m_params.lineWidth=e}get canvasRotation(){return this.m_params.canvasRotation}set canvasRotation(e){this.m_params.canvasRotation=e}get lineRotation(){return this.m_params.lineRotation}set lineRotation(e){this.m_params.lineRotation=e}get wrappingMode(){return this.m_params.wrappingMode}set wrappingMode(e){this.m_params.wrappingMode=e}get verticalAlignment(){return this.m_params.verticalAlignment}set verticalAlignment(e){this.m_params.verticalAlignment=e}get horizontalAlignment(){return this.m_params.horizontalAlignment}set horizontalAlignment(e){this.m_params.horizontalAlignment=e}get placements(){return this.m_params.placements}set placements(e){const{horizontalAlignment:t,verticalAlignment:i,placements:n}=f(this.horizontalAlignment,this.verticalAlignment,e);this.m_params.horizontalAlignment=t,this.m_params.verticalAlignment=i,this.m_params.placements=n}clone(e={}){return new p(Object.assign(Object.assign({},this.m_params),e))}copy(e){return this.params=Object.assign({},e.params),this}}function f(e,t,i){var n;const r=null!==(n=null==i?void 0:i.map((e=>Object.assign({},e))))&&void 0!==n?n:h.DEFAULT_PLACEMENTS.map((e=>Object.assign({},e)));return{horizontalAlignment:r.length>0?r[0].h:null!=e?e:h.DEFAULT_HORIZONTAL_ALIGNMENT,verticalAlignment:r.length>0?r[0].v:null!=t?t:h.DEFAULT_VERTICAL_ALIGNMENT,placements:r}}t.TextLayoutStyle=p,t.resolvePlacementAndAlignment=f},5402:(e,t,i)=>{"use strict";
950Object.defineProperty(t,"__esModule",{value:!0}),t.LineTypesetter=void 0;const n=i(82),r=i(16),s=i(1662),o=i(1741),a=i(8533);t.LineTypesetter=class{constructor(){this.m_tempTransform=new n.Matrix3,this.m_tempCorners=[new n.Vector3,new n.Vector3,new n.Vector3,new n.Vector3],this.m_tempLineDirection=a.UnicodeUtils.Direction.LTR,this.m_tempRunDirection=a.UnicodeUtils.Direction.LTR,this.m_tempPixelSize=1,this.m_tempPixelBgSize=1,this.m_tempScale=1,this.m_tempSmallCaps=!1}arrangeGlyphs(e){this.m_currentParams=e,this.m_tempLineDirection=o.TypesettingUtils.getDirection(this.m_currentParams.glyphs,0),this.m_tempRunDirection=this.m_tempLineDirection,this.m_tempPixelSize=o.TypesettingUtils.fontSizeAlignmentFactor*o.TypesettingUtils.getPixelSize(this.m_currentParams.textRenderStyle.fontSize.size,this.m_currentParams.textRenderStyle.fontSize.unit,this.m_currentParams.fontCatalog.size),this.m_tempScale=this.m_tempPixelSize/this.m_currentParams.fontCatalog.size,this.m_tempPixelBgSize=Math.min(o.TypesettingUtils.getPixelSize(this.m_currentParams.textRenderStyle.fontSize.backgroundSize,this.m_currentParams.textRenderStyle.fontSize.unit,this.m_currentParams.fontCatalog.size),this.m_currentParams.fontCatalog.distanceRange*this.m_tempScale),this.m_tempSmallCaps=void 0!==this.m_currentParams.smallCapsArray,this.m_currentParams.position.y+=this.m_currentParams.textLayoutStyle.verticalAlignment*this.m_currentParams.glyphs[0].font.metrics.capHeight*this.m_tempScale;const t=void 0!==this.m_currentParams.globalBounds&&void 0===this.m_currentParams.vertexBuffer,i=this.m_currentParams.position.x,n=this.m_currentParams.glyphs[0].font.metrics.lineHeight+this.m_currentParams.textLayoutStyle.leading;let r=0,l=0,c=0,h=0,u=0,d=0,m=0,p=0,f=!1;for(let e=0;e<this.m_currentParams.glyphs.length&&!(p>this.m_currentParams.textLayoutStyle.maxLines-1);++e){const g=this.m_currentParams.glyphs[e];if(!g.isInCache&&!t)return!1;const v=a.UnicodeUtils.isNewLine(g.codePoint),y=a.UnicodeUtils.isWhiteSpace(g.codePoint);if(f||g.direction!==-this.m_tempLineDirection||(f=!0),a.UnicodeUtils.isPrintable(g.codePoint)&&(u+=(g.advanceX+this.m_currentParams.textLayoutStyle.tracking)*this.m_tempScale*(this.m_tempSmallCaps?o.TypesettingUtils.getSmallCapsScale(this.m_currentParams.glyphs,this.m_currentParams.smallCapsArray,e,this.m_currentParams.textRenderStyle.fontVariant):1)),e===r&&(h=u,d=u,m=u),v||this.m_currentParams.textLayoutStyle.wrappingMode===s.WrappingMode.Character&&u>this.m_currentParams.textLayoutStyle.lineWidth||this.m_currentParams.textLayoutStyle.wrappingMode===s.WrappingMode.Word&&u>this.m_currentParams.textLayoutStyle.lineWidth&&m!==h){if(this.m_currentParams.textLayoutStyle.wrappingMode!==s.WrappingMode.None){let t=l,i=d;this.m_currentParams.textLayoutStyle.wrappingMode===s.WrappingMode.Word&&m!==h&&(t=c,i=m),u=i,e=Math.min(v?r===e?t:e:t,this.m_currentParams.glyphs.length-1)}const t=this.m_tempLineDirection===a.UnicodeUtils.Direction.RTL&&f?1+this.m_currentParams.textLayoutStyle.horizontalAlignment:this.m_currentParams.textLayoutStyle.horizontalAlignment;if(this.m_currentParams.position.x=this.m_currentParams.position.x+u*t,!this.placeLine(r,e,this.m_tempLineDirection,f))return!1;for(this.m_currentParams.position.y-=n*this.m_tempScale,this.m_currentParams.position.x=i;e!==r&&e+1<this.m_currentParams.glyphs.length&&a.UnicodeUtils.isWhiteSpace(this.m_currentParams.glyphs[e+1].codePoint);)++e;if(r=e+1,r===this.m_currentParams.glyphs.length)break;v&&(this.m_tempLineDirection=o.TypesettingUtils.getDirection(this.m_currentParams.glyphs,r),this.m_tempRunDirection=this.m_tempLineDirection),h=0,u=0,l=r,d=0,c=r,m=0,f=!1,p++}else this.m_currentParams.textLayoutStyle.wrappingMode===s.WrappingMode.None||y||(l=e,d=u,this.m_currentParams.textLayoutStyle.wrappingMode===s.WrappingMode.Word&&e+1<this.m_currentParams.glyphs.length&&(a.UnicodeUtils.isWhiteSpace(this.m_currentParams.glyphs[e+1].codePoint)||a.UnicodeUtils.isNewLine(this.m_currentParams.glyphs[e+1].codePoint))&&(c=e,m=u))}if(p<=this.m_currentParams.textLayoutStyle.maxLines-1&&r<=this.m_currentParams.glyphs.length-1){const e=this.m_tempLineDirection===a.UnicodeUtils.Direction.RTL&&f?1+this.m_currentParam
950s.textLayoutStyle.horizontalAlignment:this.m_currentParams.textLayoutStyle.horizontalAlignment;if(this.m_currentParams.position.setX(this.m_currentParams.position.x+u*e),!this.placeLine(r,this.m_currentParams.glyphs.length-1,this.m_tempLineDirection,f))return!1}if(e.globalBounds&&e.globalBounds.max.x-e.globalBounds.min.x>0&&e.globalBounds.max.y-e.globalBounds.min.y>0){const t=e.globalBounds,i=(.5*this.m_currentParams.fontCatalog.distanceRange-this.m_tempPixelBgSize)*this.m_tempScale;t.min.set(t.min.x+i,t.min.y+i),t.max.set(t.max.x-i,t.max.y-i)}return!0}placeLine(e,t,i,n){if(!n)return this.placeRun(e,t,i);const r=this.m_currentParams.glyphs,s=this.m_currentParams.smallCapsArray,l=this.m_currentParams.textRenderStyle,c=this.m_currentParams.textLayoutStyle,h=this.m_currentParams.position,u=i===a.UnicodeUtils.Direction.RTL,d=h.x;let m=0,p=e;for(let n=e;n<=t;++n){const e=r[n];if(e.direction===-this.m_tempRunDirection){if(u&&(h.x=d+m),!this.placeRun(p,n-1,this.m_tempRunDirection))return!1;u||(h.x=d+m),p=n,this.m_tempRunDirection*=-1}else if(e.direction===a.UnicodeUtils.Direction.Neutral&&this.m_tempRunDirection===-i){let e=n;for(;e+1<r.length&&1!==Math.abs(r[e].direction);)++e;if(r[e].direction!==this.m_tempRunDirection){if(u&&(h.x=d+m),!this.placeRun(p,n-1,this.m_tempRunDirection))return!1;u||(h.x=d+m),p=n,this.m_tempRunDirection*=-1}}m+=(e.advanceX+c.tracking)*this.m_tempScale*(this.m_tempSmallCaps?o.TypesettingUtils.getSmallCapsScale(r,s,n,l.fontVariant):1)*i}if(p<=t){if(u&&(h.x=d+m),!this.placeRun(p,t,this.m_tempRunDirection))return!1;u||(h.x=d+m)}return!0}placeRun(e,t,i){const n=this.m_currentParams.glyphs,l=this.m_currentParams.smallCapsArray,c=this.m_currentParams.fontCatalog,h=this.m_currentParams.textRenderStyle,u=this.m_currentParams.textLayoutStyle,d=this.m_currentParams.position,m=this.m_currentParams.geometry,p=this.m_currentParams.globalBounds,f=this.m_currentParams.individualBounds,g=this.m_currentParams.vertexBuffer,v=i===a.UnicodeUtils.Direction.LTR?e:t,y=i===a.UnicodeUtils.Direction.LTR?t:e;for(let _=v;i===a.UnicodeUtils.Direction.RTL?_>=y:_<=y;_+=i){const v=n[_];if(!a.UnicodeUtils.isPrintable(v.codePoint))continue;if(e!==t&&0!==_&&i===a.UnicodeUtils.Direction.RTL&&v.direction===a.UnicodeUtils.Direction.Weak){let t=_,i=n[t-1];for(;t!==e&&(i.direction===a.UnicodeUtils.Direction.Weak||i.direction===a.UnicodeUtils.Direction.Neutral&&!a.UnicodeUtils.isWhiteSpace(i.codePoint));)--t,i=n[t-1];this.placeRun(Math.max(t,e),_,a.UnicodeUtils.Direction.LTR),_=t;continue}const y=v.font,x=y.metrics,b=h.fontStyle,w=b===s.FontStyle.Bold&&void 0===y.bold||b===s.FontStyle.BoldItalic&&void 0===y.bold&&void 0===y.boldItalic,M=b===s.FontStyle.Italic&&void 0===y.italic||b===s.FontStyle.BoldItalic&&void 0===y.italic&&void 0===y.boldItalic,T=!!this.m_tempSmallCaps&&l[_]&&h.fontVariant===s.FontVariant.SmallCaps,S=T?x.xHeight/x.capHeight:1,E=this.m_tempScale*S,A=((w?.02:0)+(T?.01:0))*(c.size/c.distanceRange),C=o.TypesettingUtils.alignBackgroundWidth(this.m_tempPixelSize,.5*this.m_tempPixelBgSize/(c.distanceRange*Math.max(E,1))),P=a.UnicodeUtils.isRtlMirrored(v.codePoint)&&i===a.UnicodeUtils.Direction.RTL,L=x.lineHeight-x.base-.5*x.distanceRange;o.TypesettingUtils.computeGlyphTransform(this.m_tempTransform,d,E,u.canvasRotation,h.rotation);for(let e=0;e<4;++e){const t=v.positions[e],i=M&&e>1?o.TypesettingUtils.OBLIQUE_OFFSET*x.size:0;this.m_tempCorners[e].set(t.x+i,t.y-L,t.z),this.m_tempCorners[e].applyMatrix3(this.m_tempTransform)}if(void 0===p&&void 0===g){if(!m.add(v,this.m_tempCorners,A,A+C,P,h))return!1}else void 0!==p&&o.TypesettingUtils.updateBounds(this.m_tempCorners,p,f),void 0!==g&&m.addToBuffer(g,_*r.QUAD_VERTEX_MEMORY_FOOTPRINT,v,this.m_tempCorners,A,A+C,P,h);d.set(d.x+(v.advanceX+u.tracking)*E*Math.cos(u.lineRotation),d.y+(v.advanceX+u.tracking)*E*Math.sin(u.lineRotation),d.z)}return!0}}},2516:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PathTypesetter=void 0;const n=i(82),r=i(16),s=i(1662),o=i(1741),a=i(8533);t.PathTypesetter=class{constructor(){this.m_tempTransform=new n.Matrix3,this.m_tempCorners=[new n.Vector3,
950new n.Vector3,new n.Vector3,new n.Vector3],this.m_tempLineDirection=a.UnicodeUtils.Direction.LTR,this.m_tempRunDirection=a.UnicodeUtils.Direction.LTR,this.m_tempPixelSize=1,this.m_tempPixelBgSize=1,this.m_tempScale=1,this.m_tempSmallCaps=!1,this.m_tempPathPosition=new n.Vector3,this.m_tempPathLength=0,this.m_tempPathOffset=0}arrangeGlyphs(e){var t;this.m_currentParams=e,this.m_tempLineDirection=o.TypesettingUtils.getDirection(this.m_currentParams.glyphs,0),this.m_tempRunDirection=this.m_tempLineDirection,this.m_tempPixelSize=o.TypesettingUtils.fontSizeAlignmentFactor*o.TypesettingUtils.getPixelSize(this.m_currentParams.textRenderStyle.fontSize.size,this.m_currentParams.textRenderStyle.fontSize.unit,this.m_currentParams.fontCatalog.size),this.m_tempScale=this.m_tempPixelSize/this.m_currentParams.fontCatalog.size,this.m_tempPixelBgSize=Math.min(o.TypesettingUtils.getPixelSize(this.m_currentParams.textRenderStyle.fontSize.backgroundSize,this.m_currentParams.textRenderStyle.fontSize.unit,this.m_currentParams.fontCatalog.size),this.m_currentParams.fontCatalog.distanceRange*this.m_tempScale),this.m_tempSmallCaps=void 0!==this.m_currentParams.smallCapsArray,this.m_tempPathLength=this.m_currentParams.path.getLength(),this.m_tempPathOffset=0;const i=void 0!==this.m_currentParams.globalBounds&&void 0===this.m_currentParams.vertexBuffer;let n=!1,r=0;for(let e=0;e<this.m_currentParams.glyphs.length;++e){const t=this.m_currentParams.glyphs[e];if(!t.isInCache&&!i)return!1;a.UnicodeUtils.isPrintable(t.codePoint)&&(n||t.direction!==-this.m_tempLineDirection||(n=!0),r+=(t.advanceX+this.m_currentParams.textLayoutStyle.tracking)*this.m_tempScale*(this.m_tempSmallCaps?o.TypesettingUtils.getSmallCapsScale(this.m_currentParams.glyphs,this.m_currentParams.smallCapsArray,e,this.m_currentParams.textRenderStyle.fontVariant):1))}return this.m_tempPathOffset=Math.min(Math.max(-this.m_currentParams.textLayoutStyle.horizontalAlignment+this.m_currentParams.textLayoutStyle.horizontalAlignment*r/this.m_tempPathLength+(null!==(t=this.m_currentParams.horizontalOffset)&&void 0!==t?t:0),0),1),this.placeLine(this.m_tempLineDirection,n)}placeLine(e,t){if(!t)return this.placeRun(0,this.m_currentParams.glyphs.length-1,e);const i=this.m_currentParams.glyphs;let n=0;for(let t=n;t<i.length;++t){const r=i[t];if(r.direction===-this.m_tempRunDirection){if(!this.placeRun(n,t-1,this.m_tempRunDirection))return!1;n=t,this.m_tempRunDirection*=-1}else if(r.direction===a.UnicodeUtils.Direction.Neutral&&this.m_tempRunDirection===-e){let e=t;for(;e+1<i.length&&1!==Math.abs(i[e].direction);)++e;if(i[e].direction!==this.m_tempRunDirection){if(!this.placeRun(n,t-1,this.m_tempRunDirection))return!1;n=t,this.m_tempRunDirection*=-1}}}return!(n<i.length&&!this.placeRun(n,i.length-1,this.m_tempRunDirection))}placeRun(e,t,i){const l=this.m_currentParams.glyphs,c=this.m_currentParams.smallCapsArray,h=this.m_currentParams.fontCatalog,u=this.m_currentParams.textRenderStyle,d=this.m_currentParams.textLayoutStyle,m=this.m_currentParams.position,p=this.m_currentParams.geometry,f=this.m_currentParams.globalBounds,g=this.m_currentParams.individualBounds,v=this.m_currentParams.vertexBuffer,y=this.m_currentParams.path,_=u.rotation,x=d.verticalAlignment*l[0].font.metrics.capHeight*this.m_tempScale,b=i===a.UnicodeUtils.Direction.LTR?e:t,w=i===a.UnicodeUtils.Direction.LTR?t:e;for(let M=b;i===a.UnicodeUtils.Direction.RTL?M>=w:M<=w;M+=i){const b=l[M];if(!a.UnicodeUtils.isPrintable(b.codePoint))continue;if(e!==t&&0!==M&&i===a.UnicodeUtils.Direction.RTL&&b.direction===a.UnicodeUtils.Direction.Weak){let t=M,i=l[t-1];for(;t!==e&&(i.direction===a.UnicodeUtils.Direction.Weak||i.direction===a.UnicodeUtils.Direction.Neutral&&!a.UnicodeUtils.isWhiteSpace(i.codePoint));)--t,i=l[t-1];this.placeRun(Math.max(t,e),M,a.UnicodeUtils.Direction.LTR),M=t;continue}const w=b.font,T=w.metrics,S=u.fontStyle,E=S===s.FontStyle.Bold&&void 0===w.bold||S===s.FontStyle.BoldItalic&&void 0===w.bold&&void 0===w.boldItalic,A=S===s.FontStyle.Italic&&void 0===w.italic||S===s.FontStyle.BoldItalic&&void 0===w.italic&&void 0===w.boldItalic,C=!!this.m_tempSmallCaps&&
950c[M]&&u.fontVariant===s.FontVariant.SmallCaps,P=C?T.xHeight/T.capHeight:1,L=this.m_tempScale*P,R=((E?.02:0)+(C?.01:0))*(h.size/h.distanceRange),D=o.TypesettingUtils.alignBackgroundWidth(this.m_tempPixelSize,.5*this.m_tempPixelBgSize/(h.distanceRange*Math.max(L,1))),O=a.UnicodeUtils.isRtlMirrored(b.codePoint)&&i===a.UnicodeUtils.Direction.RTL,I=T.lineHeight-T.base-.5*T.distanceRange,F=y.getPoint(this.m_tempPathOffset);if(null===F)return this.m_currentParams.pathOverflow;const V=y.getTangent(this.m_tempPathOffset),U=new n.Vector2(-V.y,V.x).multiplyScalar(x),B=Math.atan2(V.y,V.x);this.m_tempPathPosition.set(U.x+F.x,U.y+F.y,m.z),u.rotation=_+B,o.TypesettingUtils.computeGlyphTransform(this.m_tempTransform,this.m_tempPathPosition,L,0,u.rotation);for(let e=0;e<4;++e){const t=b.positions[e],i=A&&e>1?o.TypesettingUtils.OBLIQUE_OFFSET*T.size:0;this.m_tempCorners[e].set(t.x+i,t.y-I,t.z),this.m_tempCorners[e].applyMatrix3(this.m_tempTransform),this.m_tempCorners[e].x-=m.x,this.m_tempCorners[e].y-=m.y}if(void 0===f&&void 0===v){if(!p.add(b,this.m_tempCorners,R,R+D,O,u))return!1}else void 0!==f&&o.TypesettingUtils.updateBounds(this.m_tempCorners,f,g),void 0!==v&&p.addToBuffer(v,M*r.QUAD_VERTEX_MEMORY_FOOTPRINT,b,this.m_tempCorners,R,R+D,O,u);u.rotation=_,this.m_tempPathOffset+=(b.advanceX+d.tracking)*L/this.m_tempPathLength}return!0}}},889:(e,t)=>{"use strict";var i,n;Object.defineProperty(t,"__esModule",{value:!0}),t.ContextualArabicConverter=void 0,function(e){e[e.Initial=0]="Initial",e[e.Medial=1]="Medial",e[e.Final=2]="Final"}(i||(i={})),function(e){e[e.Isolated=0]="Isolated",e[e.Connected=1]="Connected"}(n||(n={}));class r{static get instance(){return void 0===this.m_instance&&(this.m_instance=new r),this.m_instance}constructor(){this.m_singleCharactersMap=new Map,this.m_combinedCharactersMap=new Map,this.m_singleCharactersMap.set(1569,[void 0,void 0,void 0]),this.m_singleCharactersMap.set(1570,[void 0,void 0,65154]),this.m_singleCharactersMap.set(1571,[void 0,void 0,65156]),this.m_singleCharactersMap.set(1572,[void 0,void 0,65158]),this.m_singleCharactersMap.set(1573,[void 0,void 0,65160]),this.m_singleCharactersMap.set(1574,[65163,65164,65162]),this.m_singleCharactersMap.set(1575,[void 0,void 0,65166]),this.m_singleCharactersMap.set(1576,[65169,65170,65168]),this.m_singleCharactersMap.set(1577,[void 0,void 0,65172]),this.m_singleCharactersMap.set(1578,[65175,65176,65174]),this.m_singleCharactersMap.set(1579,[65179,65180,65178]),this.m_singleCharactersMap.set(1580,[65183,65184,65182]),this.m_singleCharactersMap.set(1581,[65187,65188,65186]),this.m_singleCharactersMap.set(1582,[65191,65192,65190]),this.m_singleCharactersMap.set(1583,[void 0,void 0,65194]),this.m_singleCharactersMap.set(1584,[void 0,void 0,65196]),this.m_singleCharactersMap.set(1585,[void 0,void 0,65198]),this.m_singleCharactersMap.set(1586,[void 0,void 0,65200]),this.m_singleCharactersMap.set(1587,[65203,65204,65202]),this.m_singleCharactersMap.set(1588,[65207,65208,65206]),this.m_singleCharactersMap.set(1589,[65211,65212,65210]),this.m_singleCharactersMap.set(1590,[65215,65216,65214]),this.m_singleCharactersMap.set(1591,[65219,65220,65218]),this.m_singleCharactersMap.set(1592,[65223,65224,65222]),this.m_singleCharactersMap.set(1593,[65227,65228,65226]),this.m_singleCharactersMap.set(1594,[65231,65232,65230]),this.m_singleCharactersMap.set(1600,[1600,1600,1600]),this.m_singleCharactersMap.set(1601,[65235,65236,65234]),this.m_singleCharactersMap.set(1602,[65239,65240,65238]),this.m_singleCharactersMap.set(1603,[65243,65244,65242]),this.m_singleCharactersMap.set(1604,[65247,65248,65246]),this.m_singleCharactersMap.set(1605,[65251,65252,65250]),this.m_singleCharactersMap.set(1606,[65255,65256,65254]),this.m_singleCharactersMap.set(1607,[65259,65260,65258]),this.m_singleCharactersMap.set(1608,[void 0,void 0,65262]),this.m_singleCharactersMap.set(1609,[void 0,void 0,65264]),this.m_singleCharactersMap.set(1610,[65267,65268,65266]),this.m_singleCharactersMap.set(1662,[64344,64345,64343]),this.m_singleCharactersMap.set(1740,[64510,64511,64509]),this.m_singleCharactersMap.set(1670,[64380,64381,64379]),this.m_singleCharactersMap.set(1705,[64400,64401,64399]),this.m_singleCharactersMap.set(1711,[64404,64405,64403]),this.m_singleCharactersMap.set(1688,[void 0,void 0,64395]),this.m_combinedCharactersMap.set(1604,new Map),this.m_combinedCharactersMap.get(1604).set(1570,[65269,65270]),this.m_combinedCharactersMap.get(1604).set(1571,[65271,65272]),this.m_combinedCharactersMap.get(1604).set(1573,[65273,65274]),this.m_combinedCharactersMap.get(1604).set(1575,[65275,65276]
950),this.m_neutralCharacters=[1552,1554,1555,1556,1557,1611,1612,1613,1614,1615,1616,1617,1618,1619,1620,1621,1622,1623,1624,1648,1750,1751,1752,1753,1754,1755,1756,1759,1760,1761,1762,1763,1764,1767,1768,1770,1771,1772,1773]}convert(e){let t="";for(let r=0;r<e.length;++r){const s=e.charCodeAt(r);if(this.isArabicCharacter(s)){let o=r-1;for(;o>=0&&this.isNeutral(e.charCodeAt(o));--o);let a=o>=0?e.charCodeAt(o):void 0;if(void 0!==a){const e=this.getCharacterMap(a);(void 0===e||void 0===e[i.Initial]&&void 0===e[i.Medial])&&(a=void 0)}let l=r+1;for(;l<e.length&&this.isNeutral(e.charCodeAt(l));++l);let c=l<e.length?e.charCodeAt(l):void 0;if(void 0!==c){const e=this.getCharacterMap(c);(void 0===e||void 0===e[i.Medial]&&void 0===e[i.Final])&&(c=void 0)}if(1604===s&&void 0!==c&&(1570===c||1571===c||1573===c||1575===c)){const e=this.getCombinedCharacterMap(s,c);t+=void 0!==a?String.fromCharCode(e[n.Connected]):String.fromCharCode(e[n.Isolated]),++r;continue}const h=this.getCharacterMap(s);void 0!==a&&void 0!==c&&void 0!==h[i.Medial]?t+=String.fromCharCode(h[i.Medial]):void 0!==a&&void 0!==h[i.Final]?t+=String.fromCharCode(h[i.Final]):void 0!==c&&void 0!==h[i.Initial]?t+=String.fromCharCode(h[i.Initial]):t+=String.fromCharCode(s)}else t+=String.fromCharCode(s)}return t}isArabicCharacter(e){return this.m_singleCharactersMap.has(e)}getCharacterMap(e){return this.m_singleCharactersMap.get(e)}getCombinedCharacterMap(e,t){const i=this.m_combinedCharactersMap.get(e);if(void 0!==i)return i.get(t)}isNeutral(e){for(const t of this.m_neutralCharacters)if(t===e)return!0;return!1}}t.ContextualArabicConverter=r},3461:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSdfTextMaterial=void 0;const n=i(4420);t.createSdfTextMaterial=function(e){return new n.SdfTextMaterial({texture:e.fontCatalog.texture,textureSize:e.fontCatalog.textureSize,size:e.fontCatalog.size,distanceRange:e.fontCatalog.distanceRange,isMsdf:"msdf"===e.fontCatalog.type,isBackground:!0===e.isBackground,vertexSource:e.vertexSource,fragmentSource:e.fragmentSource,rendererCapabilities:e.rendererCapabilities})}},1741:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypesettingUtils=void 0;const n=i(82),r=i(1662),s=i(8533);var o;(o=t.TypesettingUtils||(t.TypesettingUtils={})).EM_TO_PX=16,o.PT_TO_PX=1.25,o.OBLIQUE_ANGLE=.174533,o.OBLIQUE_OFFSET=Math.tan(o.OBLIQUE_ANGLE),o.getPixelSize=function(e,t,i){let n=e;switch(t){case r.FontUnit.Em:n*=o.EM_TO_PX;break;case r.FontUnit.Point:n*=o.PT_TO_PX;break;case r.FontUnit.Percent:n*=.01*i}return n},o.getSmallCapsScale=function(e,t,i,n){return t[i]&&n===r.FontVariant.SmallCaps?e[i].font.metrics.xHeight/e[i].font.metrics.capHeight:1},o.getDirection=function(e,t){let i=s.UnicodeUtils.Direction.LTR,n=t;for(;e[n].direction!==s.UnicodeUtils.Direction.LTR&&e[n].direction!==s.UnicodeUtils.Direction.RTL&&n<e.length-1;)++n;return 1===Math.abs(e[n].direction)&&(i=e[n].direction),i},o.computeGlyphTransform=function(e,t,i,n,r){const s=Math.cos(n),o=Math.sin(n),a=Math.cos(r),l=Math.sin(r);e.set(i*a,i*-l,s*t.x-o*t.y,i*l,i*a,o*t.x+s*t.y,0,0,1)},o.updateBounds=function(e,t,i){const r=Math.min(e[0].x,e[1].x,e[2].x,e[3].x),s=Math.max(e[0].x,e[1].x,e[2].x,e[3].x),o=Math.min(e[0].y,e[1].y,e[2].y,e[3].y),a=Math.max(e[0].y,e[1].y,e[2].y,e[3].y);void 0!==i&&(void 0!==i.array[i.offset]?(i.array[i.offset].min.set(r,o),i.array[i.offset].max.set(s,a)):i.array.push(new n.Box2(new n.Vector2(r,o),new n.Vector2(s,a))),++i.offset),t.min.set(Math.min(t.min.x,r),Math.min(t.min.y,o)),t.max.set(Math.max(t.max.x,s),Math.max(t.max.y,a))},o.fontSizeAlignmentFactor=.964,o.alignBackgroundWidth=function(e,t){return 11.5*t/Math.sqrt(e)}},8533:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeUtils=void 0,function(e){let t;e.whiteSpaceRanges=[[9,9],[32,32],[5760,5760],[8192,8198],[8200,8202],[8287,12288],[6158,6158],[8203,8205]],e.isWhiteSpace=function(t){for(const i of e.whiteSpaceRanges)if(t>=i[0]&&t<=i[1])return!0;return!1},e.newLineRanges=[[10,13],[133,133],[8232,8233]],e.isNewLine=function(t){for(const i of e.newLineRanges)if(t>=i[0]&&t<=i[1])return!0;return!1},e.nonPrintableRanges=[[0,31],[127,159]],e.isPrintable=function(t){for(const i of e.nonPrintableRanges)if(t>=i[0]&&t<=i[1])return!1;return!0},function(e){e[e.Neutral=0]="Neutral",e[e.Weak=.5]="Weak",e[e.LTR=1]="LTR",e[e.RTL=-1]="RTL"}(t=e.Direction||(e.Direction={})),e.rtlBlocks=["Hebrew","Alphabetic Presentation Forms","Arabic","Arabic Supplement","Arabic Extended-A","Arabic Presentation Forms-A","Arabic Presentation Forms-B","Arabic Mathematical Alphabetic Symbols","Indic Siyaq Numbers","Rumi Numeral Symbols","Syriac","Syriac Supplement","Samaritan","Mandaic","Thaana","Mende Kikakui","NKo","Adlam","Hanifi Rohingya"],e.neutralBidirectionalRanges=[[32,47],[58,64],[91,96],[123,126]],e.weakBidirectionalRanges=[[48,57],[1632,1641],[1776,1785]],e.getDirection=function(i,n){for(const n of e.weakBidirectionalRanges)if(i>=n[0]&&i<=n[1])return t.Weak;for(const n of e.neutralBidirectionalRanges)if(i>=n[0]&&i<=n[1])return t.Neutral;return void 0!==e.rtlBlocks.find((e=>e===n))?t.RTL:t.LTR},e.rtlMirroredCodePoints=[40,41,60,62,91,93,123,125],e.isRtlMirrored=function(t){return void 0!==e.rtlMirroredCodePoints.find((e=>e===t))}}(t.UnicodeUtils||(t.UnicodeUtils={}))},1984:function(e,t,i){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);
950r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=this&&this.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||n(t,e,i)};Object.defineProperty(t,"__esModule",{value:!0}),r(i(7259),t),r(i(8284),t),r(i(1017),t),r(i(1370),t),r(i(1216),t),r(i(5771),t),r(i(8131),t),r(i(6304),t),r(i(8023),t)},1667:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ColorUtils=void 0;const n=i(82),r=i(8263),s=i(797),o=i(7610),a=255,l=new n.Color,c={h:0,s:0,l:0};!function(e){function t(e,t){return n.MathUtils.clamp(e+(t<0?e:1-e)*t,0,1)}function i(e,t,i){let n;if(o.RGBA.isRGBA(t))n=e.equals(t)===i;else if("string"==typeof t){const r=h.get(t);if(r)n=e.equals(r)===i;else{const r=o.RGBA.parse(t);void 0!==r&&(h.set(t,r),n=e.equals(r)===i)}}return n}e.getHexFromRgba=function(e,t,i,n){return(0,s.assert)(n>=0&&n<=1),a-Math.floor(n*a)<<24^e*a<<16^t*a<<8^i*a},e.getHexFromRgb=function(e,t,i){return(0,s.assert)(e>=0&&e<=1),(0,s.assert)(t>=0&&t<=1),(0,s.assert)(i>=0&&i<=1),e*a<<16^t*a<<8^i*a},e.getHexFromHsl=function(e,t,i){return(0,s.assert)(e>=0&&e<=1),(0,s.assert)(t>=0&&t<=1),(0,s.assert)(i>=0&&i<=1),l.setHSL(e,t,i).getHex()},e.darken=function(e,t){return l.setRGB(e.r,e.g,e.b),l.getHSL(c),c.l=n.MathUtils.clamp(c.l-t,0,1),l.setHSL(c.h,c.s,c.l),e.r=l.r,e.g=l.g,e.b=l.b,e},e.scaleColor=function(e,i){return l.setRGB(e.r,e.g,e.b),l.getHSL(c),c.s=t(c.s,i.s),c.l=t(c.l,i.l),l.setHSL(c.h,c.s,c.l),e.r=l.r,e.g=l.g,e.b=l.b,e.a=t(e.a,i.a),e},e.getRgbaFromHex=function(e,t=new o.RGBA){return(0,s.assert)(!0,"Wrong hex format"),t.r=(e>>16&a)/a,t.g=(e>>8&a)/a,t.b=(e&a)/a,t.a=(a-(e>>24&a))/a,t},e.hasAlphaInHex=function(e){return(0,s.assert)(!0,"Wrong hex format"),!!(e>>24)},e.getAlphaFromHex=function(e){return(0,s.assert)(!0,"Wrong hex format"),(a-(e>>24)&a)/a},e.removeAlphaFromHex=function(e){return(0,s.assert)(!0,"Wrong hex format"),16777215&e},e.comparePotentiallyRGBA=function(e,t,n){let r;return o.RGBA.isRGBA(e)?r=i(e,t,n):o.RGBA.isRGBA(t)&&(r=i(t,e,n)),r}}(t.ColorUtils||(t.ColorUtils={}));const h=new r.LRUCache(500)},7259:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MapEnv=t.Env=void 0;class i{static isEnv(e){return e instanceof i}lookup(e){}unmap(){return{}}}t.Env=i,t.MapEnv=class extends i{constructor(e,t){super(),this.entries=e,this.parent=t}lookup(e){if(this.entries.hasOwnProperty(e)){const t=this.entries[e];if(void 0!==t)return t}return this.parent?this.parent.lookup(e):void 0}unmap(){const e=this.parent?this.parent.unmap():{};for(const t in this.entries)this.entries.hasOwnProperty(t)&&(e[t]=this.entries[t]);return e}}},8284:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.evaluateJsonExpr=void 0;const n=i(7259),r=i(8023);t.evaluateJsonExpr=function(e,t,i){return r.Expr.fromJSON(e,i).evaluate(new n.MapEnv(t),r.ExprScope.Value)}},8023:function(e,t,i){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);
950r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=this&&this.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||n(t,e,i)};Object.defineProperty(t,"__esModule",{value:!0}),t.InterpolateExpr=t.StepExpr=t.CaseExpr=t.MatchExpr=t.LookupExpr=t.CallExpr=t.HasAttributeExpr=t.ObjectLiteralExpr=t.StringLiteralExpr=t.NumberLiteralExpr=t.BooleanLiteralExpr=t.NullLiteralExpr=t.LiteralExpr=t.VarExpr=t.Expr=t.ExprScope=t.ExprDependencies=void 0;const s=i(82),o=i(2302),a=i(908),l=i(8628),c=i(1017),h=i(1324),u=i(7610),d=i(5771);r(i(7259),t);const m=new o.ExprEvaluator,p=new a.ExprInstantiator;class f{constructor(){this.properties=new Set}}t.ExprDependencies=f;class g{static of(e){const t=new f;return e.accept(this.instance,t),t}visitNullLiteralExpr(e,t){}visitBooleanLiteralExpr(e,t){}visitNumberLiteralExpr(e,t){}visitStringLiteralExpr(e,t){}visitObjectLiteralExpr(e,t){}visitVarExpr(e,t){t.properties.add(e.name)}visitHasAttributeExpr(e,t){t.properties.add(e.name)}visitCallExpr(e,t){switch(e.args.forEach((e=>e.accept(this,t))),e.op){case"dynamic-properties":t.volatile=!0;break;case"feature-state":t.featureState=!0,t.properties.add("$state"),t.properties.add("$id");break;case"id":t.properties.add("$id");break;case"zoom":case"world-ppi-scale":case"world-discrete-ppi-scale":t.properties.add("$zoom");break;case"pixel-world-scale":t.properties.add("$pixelToMeters");break;case"geometry-type":t.properties.add("$geometryType")}}visitLookupExpr(e,t){return this.visitCallExpr(e,t)}visitMatchExpr(e,t){e.value.accept(this,t),e.branches.forEach((([e,i])=>i.accept(this,t))),e.fallback.accept(this,t)}visitCaseExpr(e,t){e.branches.forEach((([e,i])=>{e.accept(this,t),i.accept(this,t)})),e.fallback.accept(this,t)}visitStepExpr(e,t){e.input.accept(this,t),e.defaultValue.accept(this,t),e.stops.forEach((([e,i])=>i.accept(this,t)))}visitInterpolateExpr(e,t){e.input.accept(this,t),e.stops.forEach((([e,i])=>i.accept(this,t)))}}var v;g.instance=new g,function(e){e[e.Value=0]="Value",e[e.Condition=1]="Condition",e[e.Dynamic=2]="Dynamic"}(v=t.ExprScope||(t.ExprScope={}));class y{static isExpr(e){return e instanceof y}static fromJSON(e,t,i,n){return I(e,void 0!==t?{definitions:t,lockedNames:new Set,cache:null!=i?i:new Map,referencedDefinitions:null!=n?n:new Set}:void 0)}evaluate(e,t=v.Value,i){return this.accept(m,new o.ExprEvaluatorContext(m,e,t,i))}instantiate(e){return this.accept(p,e)}dependencies(){return this.m_dependencies||(this.m_dependencies=g.of(this)),this.m_dependencies}intern(e){return e.add(this)}toJSON(){return(new O).serialize(this)}isDynamic(){return void 0===this.m_isDynamic&&(this.m_isDynamic=this.exprIsDynamic()),this.m_isDynamic}}t.Expr=y;class _ extends y{constructor(e){super(),this.name=e}accept(e,t){return e.visitVarExpr(this,t)}exprIsDynamic(){return!1}}t.VarExpr=_;class x extends y{static fromValue(e){switch(typeof e){case"boolean":return new w(e);case"number":return new M(e);case"string":return new T(e);case"object":return null===e?b.instance:new S(e);default:throw new Error(`failed to create a literal from '${e}'`)}}exprIsDynamic(){return!1}}t.LiteralExpr=x;class b extends x{constructor(){super(),this.value=null}accept(e,t){return e.visitNullLiteralExpr(this,t)}exprIsDynamic(){return!1}}t.NullLiteralExpr=b,b.instance=new b;class w extends x{constructor(e){super(),this.value=e}accept(e,t){return e.visitBooleanLiteralExpr(this,t)}}t.BooleanLiteralExpr=w;class M extends x{constructor(e){super(),this.value=e}accept(e,t){return e.visitNumberLiteralExpr(this,t)}}t.NumberLiteralExpr=M;class T extends x{constructor(e){super(),this.value=e}get promotedValue(){var e,t,i;return void 0===this.m_promotedValue&&(this.m_promotedValue=null!==(t=null!==(e=u.RGBA.parse(this.value))&&void 0!==e?e:h.Pixels.parse(this.value))&&void 0!==t?t:null),null!==(i=this.m_promotedValue)&&void 0!==i?i:void 0}accept(e,t){return e.visitStringLiteralExpr(this,t)}}t.StringLiteralExpr=T;class S extends x{constructor(e){super(),this.value=e}get isArrayLiteral(){return Array.isArray(this.value)}accept(e,t){return e.visitObjectLiteralExpr(this,t)}}t.ObjectLiteralExpr=S;class E extends y{constructor(e){super(),this.name=e}accept(e,t){return e.visitHasAttributeExpr(this,t)}exprIsDynamic(){return!1}}t.HasAttributeExpr=E;class A extends y{constructor(e,t){super(),this.op=e,this.args=t}get children(){return this.args}accept(e,t){return e.visitCallExpr(this,t)}exprIsDynamic(){var e;const t=null!==(e=this.descriptor)&&void 0!==e?e:o.ExprEvaluator.getOperator(this.op);return!!(t&&t.isDynamicOperator&&t.isDynamicOperator(this))||this.args.some((e=>e.isDynamic()))}}t.CallExpr=A;class C extends A{static parseArray(e,t){const i=e[1];if(void 0===i)throw new Error("missing lookup table in 'lookup' expression");const n=I(i,t);if(!(Array.isArray(i)&&n instanceof S))throw new Error("Invalid lookup table expression for operator 'lookup'. It must be a literal or a ref to one.");const r=n.value;if(!(Array.isArray(r)||r instanceof Map))throw new Error(`Invalid lookup table type (${typeof r}) for operator 'lookup'`);const s=e.slice(2).map((e=>I(e,t)));return s.unshift(n),new C(s)}constructor(e){super("lookup",e),this.args=e}accept(e,t){return e.visitLookupExpr(this,t)}}t.LookupExpr=C;class P extends y{static isValidMatchLabel(e){switch(typeof e){case"number":case"string":return!0;case"object":if(!Array.isArray(e)||0===e.length)return!1;const t=typeof e[0];return("number"===t||"string"===t)&&e.every((e=>typeof e===t));default:return!1}}constructor(e,t,i){super(),this.value=e,this.branches=t,this.fallback=i}accept(e,t){return e.visitMatchExpr(this,t)}exprIsDynamic(){return this.value.isDynamic()||this.branches.some((([e,t])=>t.isDynamic()))||this.fallback.isDynamic()}}t.MatchExpr=P;class L extends y{constructor(e,t){super(),this.branches=e,this.fallback=t}accept(e,t){return e.visitCaseExpr(this,t)}exprIsDynamic(){return this.branches.some((([e,t])=>e.isDynamic()||t.isDynamic()))||this.fallback.isDynamic()}}t.CaseExpr=L;class R extends y{constructor(e,t,i){super(),this.input=e,this.defaultValue=t,this.stops=i}accept(e,t){return e.visitStepExpr(this,t)}exprIsDynamic(){return this.input.isDynamic()||this.defaultValue.isDynamic()||this.stops.some((([e,t])=>t.isDynamic()))}}t.StepExpr=R;class D extends y{constructor(e,t,i){super(),this.mode=e,this.input=t,this.stops=i}accept(e,t){return e.visitInterpolateExpr(this,t)}exprIsDynamic(){return this.input.isDynamic()||this.stops.some((([e,t])=>t.isDynamic()))}}t.InterpolateExpr=D;class O{serialize(e){return e.accept(this,void 0)}visitNullLiteralExpr(e,t){return null}visitBooleanLiteralExpr(e,t){return e.value}visitNumberLiteralExpr(e,t){return e.value}visitStringLiteralExpr(e,t){return e.value}visitObjectLiteralExpr(e,t){return e.value instanceof s.Vector2?["make-vector",e.value.x,e.value.y]:e.value instanceof s.Vector3?["make-vector",e.value.x,e.value.y,e.value.z]:e.value instanceof s.Vector4?["make-vector",e.value.x,e.value.y,e.value.z,e.value.w]:["literal",e.value]}visitVarExpr(e,t){return["get",e.name]}visitHasAttributeExpr(e,t){return["has",e.name]}visitCallExpr(e,t){return[e.op,...e.args.map((e=>this.serialize(e)))]}visitLookupExpr(e,t){return this.visitCallExpr(e,t)}visitMatchExpr(e,t){const i=[];for(const[t,n]of e.branches)i.push(t,this.serialize(n));return["match",this.serialize(e.value),...i,this.serialize(e.fallback)]}visitCaseExpr(e,t){const i=[];for(const[t,n]of e.branches)i.push(this.serialize(t),this.serialize(n));return["case",...i,this.serialize(e.fallback)]}visitStepExpr(e,t){const i=["step"];return i.push(this.serialize(e.input)),i.push(this.serialize(e.defaultValue)),e.stops.forEach((([e,t])=>{i.push(e),i.push(this.serialize(t))})),i}visitInterpolateExpr(e,t){const i=["interpolate",e.mode];return i.push(this.serialize(e.input)),e.stops.forEach((([e,t])=>{i.push(e),i.push(this.serialize(t))})),i}}function I(e,t){if(Array.isArray(e))return F(e,t);if(null===e)return b.instance;switch(typeof e){case"number":return new M(e);case"string":return new T(e);case"boolean":return new w(e);default:if(u.RGBA.isRGBA(e))return new S(e);throw new Error(`failed to create expression from: ${JSON.stringify(e)}`)}}function F(e,t){const i=e[0];if("string"!=typeof i)throw new Error("expected a builtin function name");switch(i){case"!has":case"!in":return new A("!",[F([i.slice(1),...e.slice(1)])]);case"ref":return function(e,t){if("string"!=typeof e[1])throw new Error("expected the name of an attribute");
950if(void 0===t)throw new Error("ref used with no definitions");const i=e[1];if(t.lockedNames.has(i))throw new Error(`circular referene to '${i}'`);if(!(i in t.definitions))throw new Error(`definition '${i}' not found`);t.referencedDefinitions.add(i);const n=t.cache.get(i);if(void 0!==n)return n;let r,s=t.definitions[i];const o=(0,d.getDefinitionValue)(s);if((0,l.isInterpolatedPropertyDefinition)(o))return y.fromJSON((0,l.interpolatedPropertyDefinitionToJsonExpr)(s));if(!(0,c.isJsonExpr)(o))return y.fromJSON(o);if(s=o,!(0,c.isJsonExpr)(s))throw new Error(`unsupported definition ${i}`);t.lockedNames.add(i);try{r=I(s,t)}finally{t.lockedNames.delete(i)}return t.cache.set(i,r),r}(e,t);case"get":return function(e,t){if(void 0!==e[2])return V("get",e,t);const i=e[1];if("string"!=typeof i)throw new Error("expected the name of an attribute");return new _(i)}(e,t);case"has":return function(e,t){if(void 0!==e[2])return V("has",e,t);const i=e[1];if("string"!=typeof i)throw new Error("expected the name of an attribute");return new E(i)}(e,t);case"literal":return function(e){const t=e[1];if(null===t||"object"!=typeof t)throw new Error("expected an object or array literal");return new S(t)}(e);case"match":return function(e,t){if(e.length<4)throw new Error("not enough arguments");if(!(e.length%2))throw new Error("fallback is missing in 'match' expression");const i=I(e[1],t),n=[];for(let i=2;i<e.length-1;i+=2){const r=e[i];if(!P.isValidMatchLabel(r))throw new Error(`'${JSON.stringify(r)}' is not a valid label for 'match'`);const s=I(e[i+1],t);n.push([r,s])}const r=I(e[e.length-1],t);return new P(i,n,r)}(e,t);case"case":return function(e,t){if(e.length<3)throw new Error("not enough arguments");if(e.length%2)throw new Error("fallback is missing in 'case' expression");const i=[];for(let n=1;n<e.length-1;n+=2){const r=I(e[n],t),s=I(e[n+1],t);i.push([r,s])}const n=I(e[e.length-1],t);return new L(i,n)}(e,t);case"interpolate":return function(e,t){const i=e[1];if(!function(e){if(!Array.isArray(e))return!1;switch(e[0]){case"discrete":case"linear":case"cubic":case"exponential":return!0;default:return!1}}(i))throw new Error("expected an interpolation type");if("exponential"===i[0]&&"number"!=typeof i[1])throw new Error("expected the base of the exponential interpolation");const n=void 0!==e[2]?I(e[2],t):void 0;if(!y.isExpr(n))throw new Error("expected the input of the interpolation");if(3===e.length||!(e.length%2))throw new Error("invalid number of samples");const r=[];for(let i=3;i<e.length-1;i+=2){const n=e[i],s=I(e[i+1],t);r.push([n,s])}return new D(i,n,r)}(e,t);case"step":return function(e,t){if(e.length<2)throw new Error("expected the input of the 'step' operator");if(e.length<3||!(e.length%2))throw new Error("not enough arguments");const i=I(e[1],t),n=I(e[2],t),r=[];for(let i=3;i<e.length;i+=2){const n=e[i],s=I(e[i+1],t);r.push([n,s])}return new R(i,n,r)}(e,t);case"lookup":return C.parseArray(e,t);default:return V(i,e,t)}}function V(e,t,i){return new A(e,t.slice(1).map((e=>I(e,i))))}},2302:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExprEvaluator=t.ExprEvaluatorContext=void 0;const n=i(82),r=i(8023),s=i(6073),o=i(7290),a=i(4672),l=i(8998),c=i(1954),h=i(2181),u=i(202),d=i(4054),m=i(9764),p=i(7029),f=i(3501),g=i(5113),v=i(545),y=i(1324),_=i(7610),x=new Map;function b(e,t){var i,n,s;if(t instanceof r.StringLiteralExpr)return null!==(i=t.promotedValue)&&void 0!==i?i:t.value;const o=e.evaluate(t);return"string"==typeof o&&null!==(s=null!==(n=_.RGBA.parse(o))&&void 0!==n?n:y.Pixels.parse(o))&&void 0!==s?s:o}t.ExprEvaluatorContext=class{constructor(e,t,i,n){this.evaluator=e,this.env=t,this.scope=i,this.cache=n}evaluate(e){var t,i;if(void 0===e)throw new Error("Failed to evaluate expression");const n=null===(t=this.cache)||void 0===t?void 0:t.get(e);if(void 0!==n)return n;const r=e.accept(this.evaluator,this);return null===(i=this.cache)||void 0===i||i.set(e,r),r}wrapValue(e){return r.Expr.isExpr(e)?e:r.LiteralExpr.fromValue(e)}};class w{static defineOperator(e,t){x.set(e,t)}static defineOperators(e){Object.getOwnPropertyNames(e).forEach((t=>{this.defineOperator(t,e[t])}))}static getOperator(e){return x.get(e)}visitVarExpr(e,t){const i=t.env.lookup(e.name);return void 0!==i?i:null}visitNullLiteralExpr(e,t){return null}visitBooleanLiteralExpr(e,t){return e.value}visitNumberLiteralExpr(e,t){return e.value}visitStringLiteralExpr(e,t){return e.value}visitObjectLiteralExpr(e,t){return e.value}visitHasAttributeExpr(e,t){return void 0!==t.env.lookup(e.name)}visitMatchExpr(e,t){const i=t.evaluate(e.value);for(const[n,r]of e.branches){if(Array.isArray(n)&&n.includes(i))return t.evaluate(r);if(n===i)return t.evaluate(r)}return t.evaluate(e.fallback)}visitCaseExpr(e,t){if(t.scope===r.ExprScope.Value){const i=e.branches.findIndex((([e,t])=>e.isDynamic()));if(-1!==i){let n;for(let s=0;s<e.branches.length;++s){const[o,a]=e.branches[s],l=t.evaluate(o),c=t.evaluate(a);if(s<i&&Boolean(l))return c;if((r.Expr.isExpr(l)||Boolean(l))&&(void 0===n&&(n=[]),null==n||n.push([t.wrapValue(l),t.wrapValue(c)]),!r.Expr.isExpr(l)&&Boolean(l)))return new r.CaseExpr(n,r.LiteralExpr.fromValue(null))}const s=t.evaluate(e.fallback);return void 0===n?s:new r.CaseExpr(n,t.wrapValue(s))}}for(const[i,n]of e.branches)if(t.evaluate(i))return t.evaluate(n);return t.evaluate(e.fallback)}visitCallExpr(e,t){var i;const n=null!==(i=e.descriptor)&&void 0!==i?i:x.get(e.op);if(n){let i;if(e.descriptor=n,t.scope===r.ExprScope.Value&&e.isDynamic()){if(e.descriptor.partialEvaluate)return e.descriptor.partialEvaluate(t,e);const n=e.args.map((e=>t.wrapValue(t.evaluate(e))));if(n.every(((t,i)=>
950t===e.args[i])))return e;i=new r.CallExpr(e.op,n)}else i=n.call(t,e);return i}throw new Error(`undefined operator '${e.op}'`)}visitLookupExpr(e,t){return this.visitCallExpr(e,t)}visitStepExpr(e,t){if(t.scope===r.ExprScope.Value){const i=t.evaluate(e.input),n=t.evaluate(e.defaultValue);return new r.StepExpr(t.wrapValue(i),t.wrapValue(n),e.stops.map((([e,i])=>{const n=t.evaluate(i);return[e,t.wrapValue(n)]})))}{const i=t.evaluate(e.input);if("number"!=typeof i)throw new Error(`input '${i}' must be a number`);if(i<e.stops[0][0])return t.evaluate(e.defaultValue);let n=e.stops.findIndex((e=>e[0]>i));return-1===n&&(n=e.stops.length),t.evaluate(e.stops[n-1][1])}}visitInterpolateExpr(e,t){if(t.scope===r.ExprScope.Value){const i=t.evaluate(e.input);return new r.InterpolateExpr(e.mode,t.wrapValue(i),e.stops.map((([e,i])=>{const n=t.evaluate(i);return[e,t.wrapValue(n)]})))}{const i=t.evaluate(e.input);if("number"!=typeof i)throw new Error("input must be a number");if("cubic"===e.mode[0])return function(e,t,i){if(i<t.stops[0][0])return b(e,t.stops[0][1]);if(i>=t.stops[t.stops.length-1][0])return b(e,t.stops[t.stops.length-1][1]);const r=t.stops.findIndex((e=>e[0]>i)),s=Math.max(0,r-1),o=0===s?r:s-1,a=r<t.stops.length-1?r+1:r-1,l=t.stops[o][0],c=t.stops[s][0],h=t.stops[r][0],u=.5*(h-c),d=u/(c-l),m=u/(t.stops[a][0]-h),p=(i-c)/(h-c),f=p*p,g=f*p,v=-d*g+2*d*f-d*p,x=(1+d)*g+(-1.5-2*d)*f+(-.5+d)*p+1,w=(-1-m)*g+(1.5+m)*f+.5*p,M=m*g-m*f,T=b(e,t.stops[o][1]),S=b(e,t.stops[s][1]),E=b(e,t.stops[r][1]),A=b(e,t.stops[a][1]);if("number"==typeof T&&"number"==typeof S&&"number"==typeof E&&"number"==typeof A)return v*T+x*S+w*E+M*A;if(T instanceof _.RGBA&&S instanceof _.RGBA&&E instanceof _.RGBA&&A instanceof _.RGBA)return new _.RGBA(n.MathUtils.clamp(v*T.r+x*S.r+w*E.r+M*A.r,0,1),n.MathUtils.clamp(v*T.g+x*S.g+w*E.g+M*A.g,0,1),n.MathUtils.clamp(v*T.b+x*S.b+w*E.b+M*A.b,0,1),n.MathUtils.clamp(v*T.a+x*S.a+w*E.a+M*A.a,0,1));if(T instanceof y.Pixels&&S instanceof y.Pixels&&E instanceof y.Pixels&&A instanceof y.Pixels)return new y.Pixels(v*T.value+x*S.value+w*E.value+M*A.value);if(T instanceof n.Color&&S instanceof n.Color&&E instanceof n.Color&&A instanceof n.Color)return new n.Color(v*T.r+x*S.r+w*E.r+M*A.r,v*T.g+x*S.g+w*E.g+M*A.g,v*T.b+x*S.b+w*E.b+M*A.b);if(T instanceof n.Vector2&&S instanceof n.Vector2&&E instanceof n.Vector2&&A instanceof n.Vector2)return new n.Vector2(v*T.x+x*S.x+w*E.x+M*A.x,v*T.y+x*S.y+w*E.y+M*A.y);if(T instanceof n.Vector3&&S instanceof n.Vector3&&E instanceof n.Vector3&&A instanceof n.Vector3)return new n.Vector3(v*T.x+x*S.x+w*E.x+M*A.x,v*T.y+x*S.y+w*E.y+M*A.y,v*T.z+x*S.z+w*E.z+M*A.z);if(T instanceof n.Vector4&&S instanceof n.Vector4&&E instanceof n.Vector4&&A instanceof n.Vector4)return new n.Vector4(v*T.x+x*S.x+w*E.x+M*A.x,v*T.y+x*S.y+w*E.y+M*A.y,v*T.z+x*S.z+w*E.z+M*A.z,v*T.w+x*S.w+w*E.w+M*A.w);if(Array.isArray(T)&&Array.isArray(S)&&Array.isArray(E)&&Array.isArray(A)){const e=T.length,t=[];for(let i=0;i<e;++i)t[i]=v*T[i]+x*S[i]+w*E[i]+M*A[i];return t}throw new Error("failed to interpolate values")}(t,e,i);const r=e.stops.findIndex((e=>e[0]>i));if(-1===r)return t.evaluate(e.stops[e.stops.length-1][1]);if(0===r)return t.evaluate(e.stops[0][1]);const[s,o]=e.stops[r],[a,l]=e.stops[r-1],c=b(t,l);let h=0;switch(e.mode[0]){case"discrete":return c;case"linear":h=(i-a)/(s-a);break;case"exponential":{const t=e.mode[1];h=1===t?(i-a)/(s-a):(Math.pow(t,i-a)-1)/(Math.pow(t,s-a)-1);break}default:throw new Error(`interpolation mode ${JSON.stringify(e.mode)} is not supported`)}const u=b(t,o);if("number"==typeof c&&"number"==typeof u)return n.MathUtils.lerp(c,u,h);if(c instanceof _.RGBA&&u instanceof _.RGBA)return c.clone().lerp(u,h);if(c instanceof y.Pixels&&u instanceof y.Pixels)return new y.Pixels(n.MathUtils.lerp(c.value,u.value,h));if(c instanceof n.Color&&u instanceof n.Color)return c.clone().lerp(u,h);if(c instanceof n.Vector2&&u instanceof n.Vector2)return c.clone().lerp(u,h);if(c instanceof n.Vector3&&u instanceof n.Vector3)return c.clone().lerp(u,h);if(c instanceof n.Vector4&&u instanceof n.Vector4)return c.clone().lerp(u,h);if(Array.isArray(c)&&Array.isArray(u)&&c.length===u.length)return c.map(((e,t)=>n.MathUtils.lerp(e,u[t],h)));throw new Error(`todo: mix(${JSON.stringify(c)}, ${JSON.stringify(u)}, ${h})`)}}}t.ExprEvaluator=w,w.defineOperators(o.CastOperators),w.defineOperators(l.ComparisonOperators),w.defineOperators(d.MathOperators),w.defineOperators(f.StringOperators),w.defineOperators(a.ColorOperators),w.defineOperators(g.TypeOperators),w.defineOperators(m.MiscOperators),w.defineOperators(h.FlowOperators),w.defineOperators(s.ArrayOperators),w.defineOperators(p.ObjectOperators),w.defineOperators(c.FeatureOperators),w.defineOperators(u.MapOperators),w.defineOperators(v.VectorOperators)},908:(e,t,i)=>{"use strict";
950Object.defineProperty(t,"__esModule",{value:!0}),t.ExprInstantiator=void 0;const n=i(7259),r=i(8023),s=new n.Env;t.ExprInstantiator=class{visitNullLiteralExpr(e,t){return e}visitBooleanLiteralExpr(e,t){return e}visitNumberLiteralExpr(e,t){return e}visitStringLiteralExpr(e,t){return e}visitObjectLiteralExpr(e,t){return e}visitVarExpr(e,t){if(t.preserve&&t.preserve.has(e.name))return e;const i=t.env.lookup(e.name);return r.LiteralExpr.fromValue(void 0!==i?i:null)}visitHasAttributeExpr(e,t){if(t.preserve&&t.preserve.has(e.name))return e;const i=void 0!==t.env.lookup(e.name);return r.LiteralExpr.fromValue(i)}visitCallExprImpl(e,t,i){const n=e.args.map((e=>e.accept(this,t)));return n.some(((t,i)=>t!==e.args[i]))?i(e.op,n):e}visitCallExpr(e,t){return this.visitCallExprImpl(e,t,((e,t)=>new r.CallExpr(e,t)))}visitLookupExpr(e,t){return this.visitCallExprImpl(e,t,((e,t)=>new r.LookupExpr(t)))}visitMatchExpr(e,t){const i=e.value.accept(this,t);if(i instanceof r.LiteralExpr){const n=i.value;for(const[i,r]of e.branches){if(Array.isArray(i)&&i.includes(n))return r.accept(this,t);if(i===n)return r.accept(this,t)}return e.fallback.accept(this,t)}let n=e.value!==i;const s=e.branches.map((([e,i])=>{const r=i.accept(this,t);return r!==i&&(n=!0),[e,r]})),o=e.fallback.accept(this,t);return o!==e.fallback&&(n=!0),n?new r.MatchExpr(i,s,o):e}visitCaseExpr(e,t){const i=[];let n=!1;
950for(const[o,a]of e.branches){const e=o.accept(this,t),l=e.dependencies();if(o.isDynamic()||0!==l.properties.size)e!==o&&(n=!0),i.push([e,a]);else if(Boolean(e.evaluate(s,r.ExprScope.Condition)))return a.accept(this,t)}if(0===i.length)return e.fallback.accept(this,t);i.length!==e.branches.length&&(n=!0),i.forEach((e=>{const i=e[1].accept(this,t);i!==e[1]&&(n=!0),e[1]=i}));const o=e.fallback.accept(this,t);return o!==e.fallback&&(n=!0),n?new r.CaseExpr(i,o):e}visitStepExpr(e,t){const i=e.input.accept(this,t),n=e.defaultValue.accept(this,t),s=e.stops.map((([e,i])=>[e,i.accept(this,t)]));return new r.StepExpr(i,n,s)}visitInterpolateExpr(e,t){const i=e.input.accept(this,t),n=e.stops.map((([e,i])=>[e,i.accept(this,t)]));return new r.InterpolateExpr(e.mode,i,n)}}},8797:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExprPool=void 0;const n=i(8023);var r;!function(e){e[e.CALL=0]="CALL",e[e.LOOKUP=1]="LOOKUP"}(r||(r={})),t.ExprPool=class{constructor(){this.m_booleanLiterals=new Map,this.m_numberLiterals=new Map,this.m_stringLiterals=new Map,this.m_objectLiterals=new Map,this.m_arrayLiterals=[],this.m_varExprs=new Map,this.m_hasAttributeExprs=new Map,this.m_matchExprs=[],this.m_caseExprs=[],this.m_interpolateExprs=[],this.m_stepExprs=[],this.m_callExprs=new Map}add(e){return e.accept(this,void 0)}clear(){this.m_booleanLiterals.clear(),this.m_numberLiterals.clear(),this.m_stringLiterals.clear(),this.m_objectLiterals.clear(),this.m_arrayLiterals.length=0,this.m_varExprs.clear(),this.m_hasAttributeExprs.clear(),this.m_matchExprs.length=0,this.m_caseExprs.length=0,this.m_interpolateExprs.length=0,this.m_stepExprs.length=0,this.m_callExprs.clear()}visitNullLiteralExpr(e,t){return n.NullLiteralExpr.instance}visitBooleanLiteralExpr(e,t){return this.m_booleanLiterals.get(e.value)||(this.m_booleanLiterals.set(e.value,e),e)}visitNumberLiteralExpr(e,t){return this.m_numberLiterals.get(e.value)||(this.m_numberLiterals.set(e.value,e),e)}visitStringLiteralExpr(e,t){return this.m_stringLiterals.get(e.value)||(this.m_stringLiterals.set(e.value,e),e)}visitObjectLiteralExpr(e,t){const i=this.m_objectLiterals.get(e.value);if(i)return i;if(Array.isArray(e.value)){const t=e.value,i=this.m_arrayLiterals.find((e=>{const i=e.value;return i.length===t.length&&t.every(((e,t)=>e===i[t]))}));if(void 0!==i)return i;this.m_arrayLiterals.push(e)}return this.m_objectLiterals.set(e.value,e),e}visitVarExpr(e,t){return this.m_varExprs.get(e.name)||(this.m_varExprs.set(e.name,e),e)}visitHasAttributeExpr(e,t){return this.m_hasAttributeExprs.get(e.name)||(this.m_hasAttributeExprs.set(e.name,e),e)}visitMatchExpr(e,t){const i=e.value.accept(this,t),r=e.branches.map((([e,i])=>[e,i.accept(this,t)])),s=e.fallback.accept(this,t);for(const e of this.m_matchExprs){if(e.value!==i)continue;if(e.fallback!==s)continue;if(e.branches.length!==r.length)continue;let t=!0;for(let i=0;i<r.length;i++)if(r[i][0]!==e.branches[i][0]||r[i][1]!==e.branches[i][1]){t=!1;break}if(t)return e}const o=new n.MatchExpr(i,r,s);return this.m_matchExprs.push(o),o}visitCaseExpr(e,t){const i=e.branches.map((([e,i])=>[e.accept(this,t),i.accept(this,t)])),r=e.fallback.accept(this,t);for(const e of this.m_caseExprs){if(e.fallback!==r)continue;if(e.branches.length!==i.length)continue;let t=!0;for(let n=0;n<i.length;n++)if(i[n][0]!==e.branches[n][0]||i[n][1]!==e.branches[n][1]){t=!1;break}if(t)return e}const s=new n.CaseExpr(i,r);return this.m_caseExprs.push(s),s}visitCallExprImpl(e,t,i){const s=[];for(let i=0;i<e.args.length;i++)s.push(e.args[i].accept(this,t));this.m_callExprs.has(e.op)||this.m_callExprs.set(e.op,[]);const o=this.m_callExprs.get(e.op);for(const e of o){if(e.args.length!==s.length)continue;let t=0;for(;t<e.args.length&&e.args[t]===s[t];++t);if(t===e.args.length)return e}let a;return a=i===r.CALL?new n.CallExpr(e.op,s):new n.LookupExpr(s),a.descriptor=e.descriptor,o.push(a),a}visitCallExpr(e,t){return this.visitCallExprImpl(e,t,r.CALL)}visitLookupExpr(e,t){return this.visitCallExprImpl(e,t,r.LOOKUP)}visitStepExpr(e,t){if(this.m_stepExprs.includes(e))return e;const i=e.input.accept(this,t),r=e.defaultValue.accept(this,t),s=e.stops.map((e=>{const i=e[0],n=e[1].accept(this,t);return n===e[1]?e:[i,n]}));for(const e of this.m_stepExprs)if(e.input===i&&e.defaultValue===r&&s.length===e.stops.length&&s.every((([t,i],n)=>t===e.stops[n][0]&&i===e.stops[n][1])))return e;const o=new n.StepExpr(i,r,s);return this.m_stepExprs.push(o),o}visitInterpolateExpr(e,t){if(this.m_interpolateExprs.includes(e))return e;const i=e.input.accept(this,t),r=e.stops.map((e=>{const i=e[0],n=e[1].accept(this,t);return n===e[1]?e:[i,n]}));for(const t of this.m_interpolateExprs)if(t.input===i&&t.mode[0]===e.mode[0]&&t.mode[1]===e.mode[1]&&r.length===t.stops.length&&r.every((([e,i],n)=>e===t.stops[n][0]&&i===t.stops[n][1])))return t;const s=new n.InterpolateExpr(e.mode,i,r);return this.m_interpolateExprs.push(s),s}}},8628:(e,t)=>
950{"use strict";var i;Object.defineProperty(t,"__esModule",{value:!0}),t.interpolatedPropertyDefinitionToJsonExpr=t.isInterpolatedPropertyDefinition=t.InterpolationMode=void 0,(i=t.InterpolationMode||(t.InterpolationMode={}))[i.Discrete=0]="Discrete",i[i.Linear=1]="Linear",i[i.Cubic=2]="Cubic",i[i.Exponential=3]="Exponential",t.isInterpolatedPropertyDefinition=function(e){return!!(e&&void 0===e.interpolationMode&&Array.isArray(e.values)&&e.values.length>0&&void 0!==e.values[0]&&Array.isArray(e.zoomLevels)&&e.zoomLevels.length>0&&void 0!==e.zoomLevels[0]&&e.values.length===e.zoomLevels.length)},t.interpolatedPropertyDefinitionToJsonExpr=function(e){if(void 0===e.interpolation||"Discrete"===e.interpolation){const t=["step",["zoom"],e.values[0]];for(let i=1;i<e.zoomLevels.length;++i)t.push(e.zoomLevels[i],e.values[i]);return t}const t=["interpolate"];switch(e.interpolation){case"Linear":t.push(["linear"]);break;case"Cubic":t.push(["cubic"]);break;case"Exponential":t.push(["exponential",void 0!==e.exponent?e.exponent:2]);break;default:throw new Error(`interpolation mode '${e.interpolation}' is not supported`)}t.push(["zoom"]);for(let i=0;i<e.zoomLevels.length;++i)t.push(e.zoomLevels[i],e.values[i]);return t}},1017:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isJsonExpr=void 0,t.isJsonExpr=function(e){return Array.isArray(e)&&e.length>0&&"string"==typeof e[0]}},1324:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Pixels=void 0;const i=/^((?=\.\d|\d)(?:\d+)?(?:\.?\d*))px$/;class n{static parse(e){const t=i.exec(e);if(null!==t)return new n(Number(t[1]))}constructor(e){this.value=e}toJSON(){return`${this.value}px`}}t.Pixels=n},7610:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RGBA=void 0;const n=i(82),r=i(1667),s=i(6331);class o{static parse(e){const t=(0,s.parseStringEncodedColor)(e);if(void 0!==t)return r.ColorUtils.getRgbaFromHex(t)}static isRGBA(e){return e instanceof o}constructor(e=1,t=1,i=1,n=1,r=!0){this.r=e,this.g=t,this.b=i,this.a=n,this.isRGBA=r}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this.a=e.a,this}equals(e){return this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}clone(){return new o(this.r,this.g,this.b,this.a)}fromVector(e){return this.r=e.x,this.g=e.y,this.b=e.z,this.a=e.w,this}toVector(e){return e||(e=new n.Vector4),e.set(this.r,this.g,this.b,this.a),e}fromHex(e){return r.ColorUtils.getRgbaFromHex(e,this),this}getHex(){return r.ColorUtils.getHexFromRgba(this.r,this.g,this.b,this.a)}lerp(e,t){return this.r=n.MathUtils.lerp(this.r,e.r,t),this.g=n.MathUtils.lerp(this.g,e.g,t),this.b=n.MathUtils.lerp(this.b,e.b,t),this.a=n.MathUtils.lerp(this.a,e.a,t),this}toJSON(){return`rgba(${255*this.r|0}, ${255*this.g|0}, ${255*this.b|0}, ${this.a})`}}t.RGBA=o},6331:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseStringEncodedColor=t.parseStringEncodedNumeral=t.StringEncodedNumeralFormatMaxSize=t.StringEncodedNumeralFormats=t.StringEncodedColorFormats=t.StringEncodedMetricFormats=t.StringEncodedNumeralType=void 0;const n=i(6925),r=i(797),s=i(1667);var o;!function(e){e[e.Meters=0]="Meters",e[e.Pixels=1]="Pixels",e[e.Hex=2]="Hex"}(o=t.StringEncodedNumeralType||(t.StringEncodedNumeralType={}));const a={type:o.Meters,size:1,regExp:/^((?=\.\d|\d)(?:\d+)?(?:\.?\d*))m$/,decoder:(e,t)=>{const i=a.regExp.exec(e);return!!i&&void 0!==(t[0]=Number(i[1]))}},l={type:o.Pixels,size:1,mask:1,regExp:/^((?=\.\d|\d)(?:\d+)?(?:\.?\d*))px$/,decoder:(e,t)=>{const i=l.regExp.exec(e);return null!==i&&(t[0]=Number(i[1]),!0)}},c={type:o.Hex,size:4,regExp:/^\#((?:[0-9A-Fa-f][0-9A-Fa-f]){4}|[0-9A-Fa-f]{4})$/,decoder:(e,t)=>{const i=c.regExp.exec(e);if(null===i)return!1;const n=i[1],s=n.length;return(0,r.assert)(4===s||8===s,"Matched incorrect hex color format"),4===s?(t[0]=parseInt(n.charAt(0)+n.charAt(0),16)/255,t[1]=parseInt(n.charAt(1)+n.charAt(1),16)/255,t[2]=parseInt(n.charAt(2)+n.charAt(2),16)/255,t[3]=4===s?parseInt(n.charAt(3)+n.charAt(3),16)/255:1):8===s&&(t[0]=parseInt(n.charAt(0)+n.charAt(1),16)/255,t[1]=parseInt(n.charAt(2)+n.charAt(3),16)/255,t[2]=parseInt(n.charAt(4)+n.charAt(5),16)/255,t[3]=8===s?parseInt(n.charAt(6)+n.charAt(7),16)/255:1),!0}};t.StringEncodedMetricFormats=[a,l];const h=t.StringEncodedMetricFormats.reduce(((e,t)=>Math.max(e,t.size)),0);t.StringEncodedColorFormats=[c];const u=t.StringEncodedColorFormats.reduce(((e,t)=>Math.max(e,t.size)),0);t.StringEncodedNumeralFormats=[...t.StringEncodedMetricFormats,...t.StringEncodedColorFormats],t.StringEncodedNumeralFormatMaxSize=Math.max(u,h);const d=new Array(t.StringEncodedNumeralFormatMaxSize);function m(e,t,i=1){const r=t.find((t=>!!t.decoder(e,d)));if(void 0===r){const t=(0,n.parseCSSColor)(e);return Array.isArray(t)&&!t.some((e=>isNaN(e)))?s.ColorUtils.getHexFromRgba(t[0]/255,t[1]/255,t[2]/255,t[3]):void 0}switch(null==r?void 0:r.type){case o.Pixels:return d[0]*i;case o.Hex:return s.ColorUtils.getHexFromRgba(d[0],d[1],d[2],d[3]);default:return d[0]}}
950t.parseStringEncodedNumeral=function(e,i=1){return m(e,t.StringEncodedNumeralFormats,i)},t.parseStringEncodedColor=function(e){return m(e,t.StringEncodedColorFormats)}},1370:(e,t)=>{"use strict";var i,n,r;Object.defineProperty(t,"__esModule",{value:!0}),t.isTextureBuffer=t.PlacementToken=t.transientToPickability=t.Pickability=t.TextureCoordinateType=void 0,(r=t.TextureCoordinateType||(t.TextureCoordinateType={})).TileSpace="tile-space",r.EquirectangularSpace="equirectangular-space",r.FeatureSpace="feature-space",function(e){e.onlyVisible="only-visible",e.transient="transient",e.all="all"}(i=t.Pickability||(t.Pickability={})),t.transientToPickability=function(e){let t=i.onlyVisible;return null!=e&&(t="string"==typeof e?e:!0===e?i.transient:i.onlyVisible),t},(n=t.PlacementToken||(t.PlacementToken={})).TopLeft="TL",n.Top="T",n.TopRight="TR",n.Right="R",n.BottomRight="BR",n.Bottom="B",n.BottomLeft="BL",n.Left="L",n.Center="C",n.NorthWest="NW",n.North="N",n.NorthEast="NE",n.East="E",n.SouthEast="SE",n.South="S",n.SouthWest="SW",n.West="W",t.isTextureBuffer=function(e){return e&&e.buffer&&"string"==typeof e.type}},1216:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setTechniqueRenderOrderOrPriority=t.addBuffersToTransferList=t.textureCoordinateType=t.supportsTextures=t.needsVertexNormals=t.isLabelRejectionLineTechnique=t.isTextTechnique=t.isTerrainTechnique=t.isStandardTechnique=t.isExtrudedPolygonTechnique=t.isPolygonTechnique=t.isStandardExtrudedLineTechnique=t.isBasicExtrudedLineTechnique=t.isExtrudedLineTechnique=t.isSegmentsTechnique=t.isSpecialDashesLineTechnique=t.isRasterTechnique=t.isSolidLineTechnique=t.isLineTechnique=t.isLineMarkerTechnique=t.isIconTextTechnique=t.isSquaresTechnique=t.isCirclesTechnique=t.TRANSPARENCY_PROPERTY_KEYS=t.TEXTURE_PROPERTY_KEYS=void 0;const n=i(1370);function r(e){return"labeled-icon"===e.name}function s(e){return"line-marker"===e.name}function o(e){return"solid-line"===e.name||"dashed-line"===e.name}function a(e){return"extruded-line"===e.name}function l(e){return a(e)&&"standard"===e.shading}function c(e){return"polygon"===e.name}function h(e){return"extruded-polygon"===e.name}function u(e){return"standard"===e.name}function d(e){return"terrain"===e.name}function m(e){return"text"===e.name}function p(e){return c(e)||u(e)||h(e)||d(e)||o(e)}t.TEXTURE_PROPERTY_KEYS=["map","normalMap","displacementMap","roughnessMap","emissiveMap","alphaMap","metalnessMap","bumpMap","dash-image"],t.TRANSPARENCY_PROPERTY_KEYS=["opacity","transparent"],t.isCirclesTechnique=function(e){return"circles"===e.name},t.isSquaresTechnique=function(e){return"squares"===e.name},t.isIconTextTechnique=r,t.isLineMarkerTechnique=s,t.isLineTechnique=function(e){return"line"===e.name},t.isSolidLineTechnique=o,t.isRasterTechnique=function(e){return"raster"===e.name},t.isSpecialDashesLineTechnique=function(e){return("solid-line"===e.name||"dashed-line"===e.name)&&void 0!==e.dashes&&"Square"!==e.dashes},t.isSegmentsTechnique=function(e){return"segments"===e.name},t.isExtrudedLineTechnique=a,t.isBasicExtrudedLineTechnique=function(e){return a(e)&&"basic"===e.shading},t.isStandardExtrudedLineTechnique=l,t.isPolygonTechnique=c,t.isExtrudedPolygonTechnique=h,t.isStandardTechnique=u,t.isTerrainTechnique=d,t.isTextTechnique=m,t.isLabelRejectionLineTechnique=function(e){return"label-rejection-line"===e.name},t.needsVertexNormals=function(e){return h(e)||c(e)||u(e)||d(e)||l(e)},t.supportsTextures=p,t.textureCoordinateType=function(e){return p(e)?e.textureCoordinateType:void 0},t.addBuffersToTransferList=function(e,i){if(u(e)||h(e)||d(e))for(const r of t.TEXTURE_PROPERTY_KEYS){const t=e[r];(0,n.isTextureBuffer)(t)&&t.buffer instanceof ArrayBuffer&&i.push(t.buffer)}},t.setTechniqueRenderOrderOrPriority=function(e,t,i){if(m(e)||r(e)||s(e)){if(i&&"string"==typeof e._category){const t=i.indexOf(e._category);-1!==t&&(e.priority=i.length-t)}}else if(t&&void 0!==e._layer){const i=i=>{const n=null==t?void 0:t.findIndex((t=>t.layer===e._layer&&t.category===i));return void 0!==n&&-1!==n?10*(n+1):void 0};if("string"==typeof e._category){const t=i(e._category);void 0!==t&&(e.renderOrder=t)}}}},5771:(e,t,i)=>{"use strict";
950Object.defineProperty(t,"__esModule",{value:!0}),t.isConditionalExtendsEntry=t.isDirectionalLight=t.isAmbientLight=t.getStyles=t.isStylesDictionary=t.isJsonExprReference=t.getDefinitionValue=t.isVerboseDefinition=void 0;const n=i(1017);function r(e){return void 0!==(null==e?void 0:e.value)}function s(e){return void 0!==e&&!Array.isArray(e)}t.isVerboseDefinition=r,t.getDefinitionValue=function(e){return r(e)?e.value:e},t.isJsonExprReference=function(e){return Array.isArray(e)&&2===e.length&&"ref"===e[0]&&"string"==typeof e[1]},t.isStylesDictionary=s,t.getStyles=function(e){return void 0===e?[]:s(e)?function(e){const t=[];for(const i in e)e[i].forEach((e=>{void 0===e.layer&&(e.layer=i),t.push(e)}));return t}(e):e},t.isAmbientLight=function(e){return"ambient"===e.type},t.isDirectionalLight=function(e){return"directional"===e.type},t.isConditionalExtendsEntry=function(e){return void 0!==e&&(0,n.isJsonExpr)(e.when)&&/^(object|string)$/.test(typeof e.value)}},8131:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ThemeVisitor=void 0;const n=i(1017),r=i(5771);t.ThemeVisitor=class{constructor(e){this.theme=e}visitStyles(e){const t=t=>!(0,n.isJsonExpr)(t)&&!!e(t);if(void 0!==this.theme.styles)for(const e of(0,r.getStyles)(this.theme.styles))if(t(e))return!0;return!1}}},797:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assert=void 0,t.assert=function(e,t){}},6304:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPropertyValue=void 0;const n=i(8023),r=i(1324),s=i(7610),o=i(6331);t.getPropertyValue=function(e,t,i){var a,l,c;if(n.Expr.isExpr(e)){let o=e.evaluate(t,n.ExprScope.Dynamic,i);return"string"==typeof o&&(o=null!==(l=null!==(a=s.RGBA.parse(o))&&void 0!==a?a:r.Pixels.parse(o))&&void 0!==l?l:o),o instanceof s.RGBA?o.getHex():o instanceof r.Pixels?o.value*(null!==(c=Number(t.lookup("$pixelToMeters")))&&void 0!==c?c:1):o}if(null==e)return null;if("string"!=typeof e)return e;{const i=t.lookup("$pixelToMeters")||1,n=(0,o.parseStringEncodedNumeral)(e,i);return void 0!==n?n:e}}},6073:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArrayOperators=void 0;const n=i(8023),r=["boolean","number","string"];function s(e,t){if(!(e instanceof n.StringLiteralExpr&&r.includes(e.value)))throw new Error(`expected "boolean", "number" or "string" instead of '${JSON.stringify(e)}'`);const i=e.value;t.forEach(((e,t)=>{if(typeof e!==i)throw new Error(`expected array element at index ${t} to have type '${i}'`)}))}function o(e,t){const i=e.evaluate(t);if(!Array.isArray(i))throw new Error(`'${i}' is not an array`);return i}const a={array:{call:(e,t)=>{switch(t.args.length){case 0:throw new Error("not enough arguments");case 1:return o(e,t.args[0]);case 2:{const i=o(e,t.args[1]);return s(t.args[0],i),i}case 3:{const i=o(e,t.args[2]);return function(e,t){if(!(e instanceof n.NumberLiteralExpr))throw new Error("missing expected number of elements");const i=e.value;if(t.length!==i)throw new Error(`the array must have ${i} element(s)`)}(t.args[1],i),s(t.args[0],i),i}default:throw new Error("too many arguments")}}},"make-array":{call:(e,t)=>{if(0===t.args.length)throw new Error("not enough arguments");return[...t.args.map((t=>e.evaluate(t)))]}},at:{call:(e,t)=>{const i=t.args,n=e.evaluate(i[0]);if("number"!=typeof n)throw new Error("expected the index of the element to retrieve");const r=e.evaluate(i[1]);if(!Array.isArray(r))throw new Error("expected an array");return n>=0&&n<r.length?r[n]:null}},slice:{call:(e,t)=>{if(t.args.length<2)throw new Error("not enough arguments");const i=e.evaluate(t.args[0]);if("string"!=typeof i&&!Array.isArray(i))throw new Error("input must be a string or an array");const n=e.evaluate(t.args[1]);if("number"!=typeof n)throw new Error("expected an index");let r;if(t.args.length>2&&(r=e.evaluate(t.args[2]),"number"!=typeof r))throw new Error("expected an index");return i.slice(n,r)}}};t.ArrayOperators=a},7290:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CastOperators=void 0;const i={"to-boolean":{call:(e,t)=>
950Boolean(e.evaluate(t.args[0]))},"to-string":{call:(e,t)=>String(e.evaluate(t.args[0]))},"to-number":{call:(e,t)=>{for(const i of t.args){const t=Number(e.evaluate(i));if(!isNaN(t))return t}throw new Error("cannot convert the value to a number")}}};t.CastOperators=i},4672:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ColorOperators=void 0;const n=i(82),r=i(1667),s=i(7610),o=i(6331),a={alpha:{call:(e,t)=>{let i=e.evaluate(t.args[0]);return"string"==typeof i&&(i=(0,o.parseStringEncodedColor)(i)),"number"==typeof i?r.ColorUtils.getAlphaFromHex(i):1}},rgba:{call:(e,t)=>{const i=e.evaluate(t.args[0]),s=e.evaluate(t.args[1]),o=e.evaluate(t.args[2]),a=e.evaluate(t.args[3]);if("number"==typeof i&&"number"==typeof s&&"number"==typeof o&&"number"==typeof a&&i>=0&&s>=0&&o>=0&&a>=0&&a<=1)return function(e,t,i,s){return r.ColorUtils.getHexFromRgba(n.MathUtils.clamp(e,0,255)/255,n.MathUtils.clamp(t,0,255)/255,n.MathUtils.clamp(i,0,255)/255,n.MathUtils.clamp(s,0,1))}(i,s,o,a);throw new Error(`unknown color 'rgba(${i},${s},${o},${a})'`)}},rgb:{call:(e,t)=>{const i=e.evaluate(t.args[0]),s=e.evaluate(t.args[1]),o=e.evaluate(t.args[2]);if("number"==typeof i&&"number"==typeof s&&"number"==typeof o&&i>=0&&s>=0&&o>=0)return function(e,t,i){return r.ColorUtils.getHexFromRgb(n.MathUtils.clamp(e,0,255)/255,n.MathUtils.clamp(t,0,255)/255,n.MathUtils.clamp(i,0,255)/255)}(i,s,o);throw new Error(`unknown color 'rgb(${i},${s},${o})'`)}},hsl:{call:(e,t)=>{const i=e.evaluate(t.args[0]),s=e.evaluate(t.args[1]),o=e.evaluate(t.args[2]);if("number"==typeof i&&"number"==typeof s&&"number"==typeof o&&i>=0&&s>=0&&o>=0)return function(e,t,i){return r.ColorUtils.getHexFromHsl(n.MathUtils.euclideanModulo(e,360)/360,n.MathUtils.clamp(t,0,100)/100,n.MathUtils.clamp(i,0,100)/100)}(i,s,o);throw new Error(`unknown color 'hsl(${i},${s}%,${o}%)'`)}},"to-color":{call:(e,t)=>h(e.evaluate(t.args[0]))},darken:{call:(e,t)=>{const i=h(e.evaluate(t.args[0])),n=e.evaluate(t.args[1]);if(Number(n)!==n)throw new Error(`invalid darken amount '${n}'`);return r.ColorUtils.darken(i.clone(),n)}},"scale-color":{call:(e,t)=>{const i=t.args,n=i.length,s=h(e.evaluate(i[0]));l.h=l.s=l.l=l.a=0;for(let t=1;t<n;){const n=e.evaluate(i[t++]);if(!c.test(n))throw new Error(`invalid component "${n}"`);const r=e.evaluate(i[t++]);if(r!==Number(r))throw new Error(`invalid factor "${r}"`);l[n]=r}return r.ColorUtils.scaleColor(s.clone(),l)}}},l={h:0,s:0,l:0,a:0},c=/^[sla]$/;function h(e){const t=e;return s.RGBA.isRGBA(e)?e:(null==t?void 0:t.isRGBA)?new s.RGBA(t.r,t.g,t.b,t.a):r.ColorUtils.getRgbaFromHex(function(e){if("string"==typeof e){const t=(0,o.parseStringEncodedColor)(e);if(void 0!==t)return t}throw new Error(`unknown color '${e}'`)}(e))}t.ColorOperators=a},8998:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ComparisonOperators=void 0;const n=i(1667);function r(e,t,i=!1){const n=e.evaluate(t.args[0]),r=e.evaluate(t.args[1]);if(!("number"==typeof n&&"number"==typeof r||"string"==typeof n&&"string"==typeof r)&&i)throw new Error(`invalid operands '${n}' and '${r}' for operator '${t.op}'`);switch(t.op){case"<":return n<r;case">":return n>r;case"<=":return n<=r;case">=":return n>=r;default:throw new Error(`invalid comparison operator '${t.op}'`)}}const s={"!":{call:(e,t)=>!e.evaluate(t.args[0])},"==":{call:(e,t)=>{var i;const r=e.evaluate(t.args[0]),s=e.evaluate(t.args[1]);return null!==(i=n.ColorUtils.comparePotentiallyRGBA(r,s,!0))&&void 0!==i?i:r===s}},"!=":{call:(e,t)=>{var i;const r=e.evaluate(t.args[0]),s=e.evaluate(t.args[1]);return null!==(i=n.ColorUtils.comparePotentiallyRGBA(r,s,!1))&&void 0!==i?i:r!==s}},"<":{call:(e,t)=>r(e,t)},">":{call:(e,t)=>r(e,t)},"<=":{call:(e,t)=>r(e,t)},">=":{call:(e,t)=>r(e,t)}};t.ComparisonOperators=s},1954:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FeatureOperators=void 0;const n=i(7259),r=i(8023),s={"geometry-type":{call:(e,t)=>{switch(e.env.lookup("$geometryType")){case"point":return"Point";case"line":return"LineString";case"polygon":return"Polygon";default:return null}}},"feature-state":{isDynamicOperator:()=>!0,call:(e,t)=>
950{var i,s;if(e.scope!==r.ExprScope.Dynamic)throw new Error("feature-state cannot be used in this context");const o=e.evaluate(t.args[0]);if("string"!=typeof o)throw new Error("expected the name of the property of the feature state");const a=e.env.lookup("$state");return n.Env.isEnv(a)?null!==(i=a.lookup(o))&&void 0!==i?i:null:a instanceof Map&&null!==(s=a.get(o))&&void 0!==s?s:null}},id:{call:(e,t)=>{var i;return null!==(i=e.env.lookup("$id"))&&void 0!==i?i:null}}};t.FeatureOperators=s},2181:(e,t)=>{"use strict";function i(e,t,i){switch(t){case"boolean":case"number":case"string":for(const n of i){const i=e.evaluate(n);if(typeof i===t)return i}throw new Error(`expected a '${t}'`);default:throw new Error(`invalid type '${t}'`)}}Object.defineProperty(t,"__esModule",{value:!0}),t.FlowOperators=void 0;const n={all:{call:(e,t)=>{for(const i of t.args)if(!e.evaluate(i))return!1;return!0}},any:{call:(e,t)=>{for(const i of t.args)if(e.evaluate(i))return!0;return!1}},none:{call:(e,t)=>{for(const i of t.args)if(e.evaluate(i))return!1;return!0}},boolean:{call:(e,t)=>i(e,"boolean",t.args)},number:{call:(e,t)=>i(e,"number",t.args)},string:{call:(e,t)=>i(e,"string",t.args)}};t.FlowOperators=n},202:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MapOperators=void 0;const n=i(8023),r={"ppi-scale":{call:(e,t)=>e.evaluate(t.args[0])*(t.args[1]?e.evaluate(t.args[1]):1)},"world-ppi-scale":{isDynamicOperator:()=>!0,call:(e,t)=>{const i=e.evaluate(t.args[0]),n=t.args[1]?e.evaluate(t.args[1]):1,r=e.env.lookup("$zoom");return i*(Math.pow(2,17)/Math.pow(2,r))*n}},"world-discrete-ppi-scale":{isDynamicOperator:()=>!0,call:(e,t)=>{const i=e.evaluate(t.args[0]),n=e.env.lookup("$zoom");return i*(40075016.68557849/(256*Math.pow(2,Math.floor(n))))}},"pixel-world-scale":{isDynamicOperator:()=>!0,call:(e,t)=>e.evaluate(t.args[0])*(e.env.lookup("$pixelToMeters")||1)},ppi:{call:e=>{const t=e.env.lookup("$ppi");return"number"==typeof t?t:72}},zoom:{isDynamicOperator:()=>!0,call:(e,t)=>{var i;return e.scope===n.ExprScope.Value?t:null!==(i=e.env.lookup("$zoom"))&&void 0!==i?i:null}}};t.MapOperators=r},4054:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MathOperators=void 0;const n=i(82),r={"^":{call:(e,t)=>{const i=e.evaluate(t.args[0]),n=e.evaluate(t.args[1]);if("number"!=typeof i||"number"!=typeof n)throw new Error(`invalid operands '${typeof i}' and '${typeof n}' for operator '^'`);return Math.pow(i,n)}},"-":{call:(e,t)=>{if(1===t.args.length){const i=e.evaluate(t.args[0]);if("number"!=typeof i)throw new Error(`ìnvalid operand '${typeof i} for operator '-'`);return-i}const i=e.evaluate(t.args[0]),n=e.evaluate(t.args[1]);if("number"!=typeof i||"number"!=typeof n)throw new Error(`invalid operands '${typeof i}' and '${typeof n}' for operator '-'`);return i-n}},"/":{call:(e,t)=>{const i=e.evaluate(t.args[0]),n=e.evaluate(t.args[1]);if("number"!=typeof i||"number"!=typeof n)throw new Error(`invalid operands '${typeof i}' and '${typeof n}' for operator '/'`);return i/n}},"%":{call:(e,t)=>{const i=e.evaluate(t.args[0]),n=e.evaluate(t.args[1]);if("number"!=typeof i||"number"!=typeof n)throw new Error(`invalid operands '${typeof i}' and '${typeof n}' for operator '%'`);return i%n}},"+":{call:(e,t)=>t.args.reduce(((t,i)=>Number(t)+Number(e.evaluate(i))),0)},"*":{call:(e,t)=>{const i=e.evaluate(t.args[0]),r=e.evaluate(t.args[1]),s="number"==typeof i,o="number"==typeof r;let a;if(s&&o)a=i*r;else if(o&&(i instanceof n.Vector2||i instanceof n.Vector3||i instanceof n.Vector4))a=i.clone().multiplyScalar(r);else{if(!s||!(r instanceof n.Vector2||r instanceof n.Vector3||r instanceof n.Vector4))throw new Error(`invalid operands '${typeof i}' and '${typeof r}' for operator '*'`);a=r.clone().multiplyScalar(i)}return a}},abs:{call:(e,t)=>{const i=e.evaluate(t.args[0]);if("number"!=typeof i)throw new Error(`invalid operand '${i}' for operator 'abs'`);return Math.abs(i)}},acos:{call:(e,t)=>{const i=e.evaluate(t.args[0]);if("number"!=typeof i)throw new Error(`invalid operand '${i}' for operator 'acos'`);return Math.acos(i)}},asin:{call:(e,t)=>
950{const i=e.evaluate(t.args[0]);if("number"!=typeof i)throw new Error(`invalid operand '${i}' for operator 'asin'`);return Math.asin(i)}},atan:{call:(e,t)=>{const i=e.evaluate(t.args[0]);if("number"!=typeof i)throw new Error(`invalid operand '${i}' for operator 'atan'`);return Math.atan(i)}},ceil:{call:(e,t)=>{const i=e.evaluate(t.args[0]);if("number"!=typeof i)throw new Error(`invalid operand '${i}' for operator 'ceil'`);return Math.ceil(i)}},cos:{call:(e,t)=>{const i=e.evaluate(t.args[0]);if("number"!=typeof i)throw new Error(`invalid operand '${i}' for operator 'cos'`);return Math.cos(i)}},e:{call:()=>Math.E},floor:{call:(e,t)=>{const i=e.evaluate(t.args[0]);if("number"!=typeof i)throw new Error(`invalid operand '${i}' for operator 'floor'`);return Math.floor(i)}},ln:{call:(e,t)=>{const i=e.evaluate(t.args[0]);if("number"!=typeof i)throw new Error(`invalid operand '${i}' for operator 'ln'`);return Math.log(i)}},ln2:{call:(e,t)=>{const i=e.evaluate(t.args[0]);if("number"!=typeof i)throw new Error(`invalid operand '${i}' for operator 'ln2'`);return Math.log2(i)}},log10:{call:(e,t)=>{const i=e.evaluate(t.args[0]);if("number"!=typeof i)throw new Error(`invalid operand '${i}' for operator 'log10'`);return Math.log10(i)}},max:{call:(e,t)=>Math.max(...t.args.map((t=>Number(e.evaluate(t)))))},min:{call:(e,t)=>Math.min(...t.args.map((t=>Number(e.evaluate(t)))))},clamp:{call:(e,t)=>{const i=e.evaluate(t.args[0]),r=e.evaluate(t.args[1]),s=e.evaluate(t.args[2]);if("number"!=typeof i||"number"!=typeof r||"number"!=typeof s)throw new Error(`invalid operands '${i}', ${r}, ${s} for operator 'clamp'`);return n.MathUtils.clamp(i,r,s)}},pi:{call:()=>Math.PI}
950,round:{call:(e,t)=>{const i=e.evaluate(t.args[0]);if("number"!=typeof i)throw new Error(`invalid operand '${i}' for operator 'round'`);return Math.round(i)}},sin:{call:(e,t)=>{const i=e.evaluate(t.args[0]);if("number"!=typeof i)throw new Error(`invalid operand '${i}' for operator 'sin'`);return Math.sin(i)}},sqrt:{call:(e,t)=>{const i=e.evaluate(t.args[0]);if("number"!=typeof i)throw new Error(`invalid operand '${i}' for operator 'sqrt'`);return Math.sqrt(i)}},tan:{call:(e,t)=>{const i=e.evaluate(t.args[0]);if("number"!=typeof i)throw new Error(`invalid operand '${i}' for operator 'tan'`);return Math.tan(i)}}};t.MathOperators=r},9764:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MiscOperators=void 0;const n=i(797),r=i(8023);function s(e){return e.join("&")}function o(e,t){return e+"="+JSON.stringify(t)}function a(e,t=0){if(t>=e.length)return[];const i=a(e,t+1),n=i.length;for(let r=0;r<n;r+=1)i.push([...i[r],e[t]]);return i.push([e[t]]),i}function l(e,t){const i=e.args.slice(1),n=[];for(let e=0;e<i.length;e+=2){const r=t.evaluate(i[e+1]);if(null===r)continue;const s=t.evaluate(i[e]);n.push(o(s,r))}return n.sort().reverse(),function(e){e.sort(((e,t)=>t.length-e.length));const t=e.map((e=>s(e)));return t.push(""),t}(a(n))}const c={length:{call:(e,t)=>{const i=e.evaluate(t.args[0]);if(Array.isArray(i)||"string"==typeof i)return i.length;throw new Error(`invalid operand '${i}' for operator 'length'`)}},coalesce:{call:(e,t)=>{for(const i of t.args){const t=e.evaluate(i);if(null!==t)return t}return null}},lookup:{call:(e,t)=>{(0,n.assert)(t.args.length>0,"missing lookup table");const i=l(t,e);let a=e.evaluate(t.args[0]);if((0,n.assert)(Array.isArray(a)||a instanceof Map,"wrong lookup table type"),Array.isArray(a)){a=function(e){const t=new Map;for(const i of e){if("object"!=typeof i)throw new Error(`Invalid lookup table entry type (${typeof i})`);if(!i.keys)throw new Error("Lookup table entry has no 'keys' property.");if(!i.attributes)throw new Error("Lookup table entry has no 'attributes' property.");const e=s(Object.getOwnPropertyNames(i.keys).sort().map((e=>o(e,i.keys[e]))));t.set(e,i.attributes)}return t}(a);const e=new r.ObjectLiteralExpr(a);t.args[0]=e}return function(e,t){for(const i of e){const e=t.get(i);if(e)return e}return null}(i,a)}},trace:{call:(e,t)=>{const i=[];for(const n of t.args)i.push(e.evaluate(n));return console.error("trace: ",...i),i[0]}}};t.MiscOperators=c},7029:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ObjectOperators=void 0;const n=i(7259),r=i(8023),s=Object.prototype.hasOwnProperty;var o;function a(e,t,i){var r;const a=e.evaluate(t[0]);if("string"!=typeof a)throw new Error("expected the name of an attribute");const l=e.evaluate(t[1]);if(l&&"object"==typeof l){if(n.Env.isEnv(l)){const e=null!==(r=l.lookup(a))&&void 0!==r?r:null;return i===o.get?e:null!==e}if(s.call(l,a))return i!==o.get||l[a]}return i===o.get&&null}!function(e){e[e.get=0]="get",e[e.has=1]="has"}(o||(o={}));const l={in:{call:(e,t)=>{const i=e.evaluate(t.args[0]),n=e.evaluate(t.args[1]);return("string"==typeof i&&"string"==typeof n||!!Array.isArray(n))&&n.includes(i)}},get:{call:(e,t)=>a(e,t.args,o.get)},has:{call:(e,t)=>a(e,t.args,o.has)},"dynamic-properties":{isDynamicOperator:()=>!0,call:(e,t)=>e.scope===r.ExprScope.Dynamic?e.env:t}};t.ObjectOperators=l},3501:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringOperators=void 0;const i={concat:{call:(e,t)=>"".concat(...t.args.map((t=>String(e.evaluate(t)))))},downcase:{call:(e,t)=>String(e.evaluate(t.args[0])).toLocaleLowerCase()},upcase:{call:(e,t)=>String(e.evaluate(t.args[0])).toLocaleUpperCase()},"regex-replace":{call:(e,t)=>{const i=e.evaluate(t.args[0]),n=e.evaluate(t.args[1]),r=e.evaluate(t.args[2]);return"string"==typeof i&&"string"==typeof n&&"string"==typeof r?i.replace(new RegExp(n,"g"),r):i}},"~=":{call:(e,t)=>{const i=e.evaluate(t.args[0]),n=e.evaluate(t.args[1]);return"string"==typeof i&&"string"==typeof n&&i.includes(n)}},"^=":{call:(e,t)=>{const i=e.evaluate(t.args[0]),n=e.evaluate(t.args[1]);return"string"==typeof i&&"string"==typeof n&&i.startsWith(n)}},"$=":{call:(e,t)=>
950{const i=e.evaluate(t.args[0]),n=e.evaluate(t.args[1]);return"string"==typeof i&&"string"==typeof n&&i.endsWith(n)}},split:{call:(e,t)=>{const i=e.evaluate(t.args[0]),n=e.evaluate(t.args[1]);if("string"==typeof i&&"string"==typeof n)return i.split(n);throw new Error(`expected '${i}' and '${n}' to be a string`)}}};t.StringOperators=i},5113:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeOperators=void 0,t.TypeOperators={typeof:{call:(e,t)=>typeof e.evaluate(t.args[0])}}},545:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VectorOperators=void 0;const n=i(82),r=i(8023);function s(e,t,i){let r;switch(i){case"vector2":r=n.Vector2;break;case"vector3":r=n.Vector3;break;case"vector4":r=n.Vector4}for(const i of t.args){const t=e.evaluate(i);if(t instanceof r)return t}throw new Error(`expected a "${i}"`)}function o(e,t,i){let r,s;switch(i){case"vector2":r=n.Vector2,s=2;break;case"vector3":r=n.Vector3,s=3;break;case"vector4":r=n.Vector4,s=4}for(const i of t.args){const t=e.evaluate(i);if(t instanceof r)return t;if(Array.isArray(t)&&t.length===s&&t.every((e=>"number"==typeof e)))return(new r).fromArray(t)}throw new Error(`expected a "${i}"`)}const a={"make-vector":{call:(e,t)=>{if(void 0!==t._value)return t._value;if(t.args.length<2)throw new Error("not enough arguments");if(t.args.length>4)throw new Error("too many arguments");const i=t.args.map((t=>e.evaluate(t)));let s;switch(i.forEach(((e,t)=>{if("number"!=typeof e)throw new Error(`expected vector component at index ${t} to have type "number"`)})),i.length){case 2:s=(new n.Vector2).fromArray(i);break;case 3:s=(new n.Vector3).fromArray(i);break;case 4:s=(new n.Vector4).fromArray(i);break;default:throw new Error("too many arguments")}return t.args.every((e=>e instanceof r.NumberLiteralExpr))&&(t._value=s),s}},vector2:{call:(e,t)=>s(e,t,"vector2")},vector3:{call:(e,t)=>s(e,t,"vector3")},vector4:{call:(e,t)=>s(e,t,"vector4")},"to-vector2":{call:(e,t)=>o(e,t,"vector2")},"to-vector3":{call:(e,t)=>o(e,t,"vector3")},"to-vector4":{call:(e,t)=>o(e,t,"vector4")}};t.VectorOperators=a},3209:function(e,t,i){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);
950r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=this&&this.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||n(t,e,i)};Object.defineProperty(t,"__esModule",{value:!0}),r(i(9047),t)},6766:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DeferredPromise=void 0,t.DeferredPromise=class{constructor(e){this.executor=e,this.promise=new Promise(((e,t)=>{this.resolveFunc=e,this.rejectFunc=t}))}exec(){this.executor().then((e=>this.resolveFunc(e))).catch((e=>this.rejectFunc(e)))}}},9047:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransferManager=void 0;const n=i(6766);class r{static instance(){return r.defaultInstance}static async fetchRepeatedly(e,t,i,n,s){try{if(!(t<i))throw new Error("Max number of retries reached");{const r=await e(n,s);if(200===r.status||204===r.status)return r;if(r.status>=400&&r.status<500){t=i;const e=await r.text();throw new Error(e)}}}catch(e){if(e.hasOwnProperty("isCancelled")||"AbortError"===e.name||t>=i)throw e}return await r.waitFor(r.retryTimeout*t).then((()=>r.fetchRepeatedly(e,t+1,i,n,s)))}static waitFor(e){return new Promise((t=>setTimeout(t,e)))}constructor(e=fetch,t=5){this.fetchFunction=e,this.maxRetries=t,this.activeDownloadCount=0,this.downloadQueue=new Array,this.activeDownloads=new Map}downloadJson(e,t){return this.downloadAs((e=>e.json()),e,t)}downloadArrayBuffer(e,t){return this.download(e,t).then((e=>e.arrayBuffer()))}download(e,t){if(this.activeDownloadCount>=r.maxParallelDownloads){const i=new n.DeferredPromise((()=>this.doDownload(e,t)));return this.downloadQueue.push(i),i.promise}return this.doDownload(e,t)}async doDownload(e,t){try{++this.activeDownloadCount;const i=await r.fetchRepeatedly(this.fetchFunction,0,this.maxRetries,e,t);return this.onDownloadDone(),i}catch(e){throw this.onDownloadDone(),e}}onDownloadDone(){--this.activeDownloadCount,this.execDeferredDownload()}execDeferredDownload(){const e=this.downloadQueue.pop();void 0!==e&&e.exec()}downloadAs(e,t,i){const n=t,r=this.activeDownloads.get(n);if(void 0!==r)return Promise.resolve(r);const s=this.download(t,i).then((t=>{if(this.activeDownloads.delete(n),t.ok)return e(t);throw new Error(JSON.stringify(t))})).catch((e=>{throw this.activeDownloads.delete(n),e}));return this.activeDownloads.set(n,s),s}}t.TransferManager=r,r.retryTimeout=500,r.maxParallelDownloads=16,r.defaultInstance=new r},6463:function(e,t,i){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);
950r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=this&&this.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||n(t,e,i)};Object.defineProperty(t,"__esModule",{value:!0}),r(i(4992),t),r(i(5337),t),r(i(197),t),r(i(9172),t),r(i(5200),t),r(i(8154),t),r(i(9246),t),r(i(5681),t),r(i(7314),t),r(i(4954),t),r(i(173),t),r(i(34),t),r(i(7250),t),r(i(5177),t),r(i(4713),t),r(i(9276),t),r(i(5704),t),r(i(7427),t),r(i(9206),t)},4342:function(e,t,i){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=this&&this.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||n(t,e,i)};Object.defineProperty(t,"__esModule",{value:!0}),r(i(6463),t),r(i(5323),t)},7427:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5681:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},7314:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContextLogger=void 0,t.ContextLogger=class{constructor(e,t){this.m_logger=e,this.headerMessage=t,this.context=[],this.m_headerLogged=!1,this.warn=this.createLogMethod("warn"),this.info=this.createLogMethod("info"),this.error=this.createLogMethod("error")}pushAttr(e){this.context.push(`${this.context.length>0?".":""}${e}`)}pushIndex(e){this.context.push(`[${e}]`)}pop(){this.context.pop()}createLogMethod(e){return(t,...i)=>{this.m_headerLogged||(this.m_logger.info(this.headerMessage),this.m_headerLogged=!0),this.m_logger[e](`${this.context.join("")}: ${t}`,...i)}}}},4992:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DOMUtils=void 0,function(e){function t(e){return e.substring(0,2)}e.getBrowserLanguages=function(){if(void 0!==navigator.languages&&navigator.languages.length>0){const e=[];for(const i of navigator.languages)e.push(t(i));return e}if(void 0!==navigator.language)return[t(navigator.language)]}}(t.DOMUtils||(t.DOMUtils={}))},9276:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.chainCallbacks=void 0,t.chainCallbacks=function(e,t){return function(...i){return e&&e.apply(this,i),t.apply(this,i)}}},9206:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.convertFragmentShaderToWebGL2=t.convertVertexShaderToWebGL2=void 0,t.convertVertexShaderToWebGL2=function(e){return["#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+e},t.convertFragmentShaderToWebGL2=function(e){return["#define varying in","out highp vec4 pc_fragColor;","#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+e}},5337:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GroupedPriorityList=t.PriorityListGroup=void 0;class i{constructor(e,t,i=new Array){this.priority=e,this.zOrder=t,this.elements=i}}t.PriorityListGroup=i,t.GroupedPriorityList=class{constructor(){this.groups=new Map}getGroupKey(e){return`${e.priority}_${e.zOrder}`}add(e){this.getGroup(e).elements.push(e)}clear(){this.groups.clear()}forEachElement(e){this.forEachGroup((t=>{t.elements.forEach(e)}))}forEachGroup(e){for(const[,t]of this.groups)e(t)}count(){let e=0;for(const[,t]of this.groups)e+=t.elements.length;return e}findGroup(e){return this.groups.get(e)}getGroup(e){const t=this.getGroupKey(e);let n=this.findGroup(t);return void 0===n&&(n=new i(e.priority,e.zOrder),this.groups.set(t,n)),n}}},4015:(e,t)=>{"use strict";
950Object.defineProperty(t,"__esModule",{value:!0}),t.ConsoleChannel=void 0,t.ConsoleChannel=class{error(e,...t){console.error(e,...t)}debug(e,...t){console.debug(e,...t)}info(e,...t){console.info(e,...t)}log(e,...t){console.log(e,...t)}trace(e,...t){console.trace(e,...t)}warn(e,...t){console.warn(e,...t)}}},3140:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6781:(e,t)=>{"use strict";var i;Object.defineProperty(t,"__esModule",{value:!0}),t.LoggerOptions=t.LogLevel=void 0,(i=t.LogLevel||(t.LogLevel={}))[i.Trace=0]="Trace",i[i.Debug=1]="Debug",i[i.Log=2]="Log",i[i.Info=3]="Info",i[i.Warn=4]="Warn",i[i.Error=5]="Error",i[i.None=6]="None",t.LoggerOptions=class{}},8648:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Logger=void 0;const n=i(6781);t.Logger=class{constructor(e,t,i){this.name=e,this.m_channel=t,this.enabled=!0,this.level=n.LogLevel.Trace,void 0!==i&&this.update(i)}error(e,...t){this.enabled&&this.level<=n.LogLevel.Error&&this.m_channel.error(this.prefix,e,...t)}debug(e,...t){this.enabled&&this.level<=n.LogLevel.Debug&&this.m_channel.debug(this.prefix,e,...t)}info(e,...t){this.enabled&&this.level<=n.LogLevel.Info&&this.m_channel.info(this.prefix,e,...t)}log(e,...t){this.enabled&&this.level<=n.LogLevel.Log&&this.m_channel.log(this.prefix,e,...t)}trace(e,...t){this.enabled&&this.level<=n.LogLevel.Trace&&this.m_channel.trace(this.prefix,e,...t)}warn(e,...t){this.enabled&&this.level<=n.LogLevel.Warn&&this.m_channel.warn(this.prefix,e,...t)}update(e){this.enabled=void 0===e.enabled?this.enabled:e.enabled,this.level=void 0===e.level?this.level:e.level}get prefix(){return this.name+":"}}},6562:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LoggerManager=void 0;const n=i(2531);t.LoggerManager=class{static get instance(){return this.m_instance||(this.m_instance=new n.LoggerManagerImpl)}}},2531:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LoggerManagerImpl=void 0;const n=i(4015),r=i(8648),s=i(7698);t.LoggerManagerImpl=class{constructor(){this.m_loggers=[],this.channel="undefined"==typeof self||void 0!==self.document?new n.ConsoleChannel:new s.WorkerChannel}getLoggerNames(){return this.m_loggers.map((e=>e.name))}getLogger(e){return this.m_loggers.find((t=>t.name===e))}create(e,t={}){void 0!==this.m_levelSetForAll&&(void 0===t.level||t.level<this.m_levelSetForAll)&&(t.level=this.m_levelSetForAll);const i=new r.Logger(e,this.channel,t);return this.m_loggers.push(i),i}dispose(e){const t=this.m_loggers.indexOf(e);if(t<0)throw new Error(`Cannot unregister "${e}" : no such logger registered.`);this.m_loggers.splice(t,1)}updateAll(e){for(const t of this.m_loggers)t.update(e)}update(e,t){for(const i of this.m_loggers)i.name===e&&i.update(t)}enableAll(e){for(const t of this.m_loggers)t.enabled=e}enable(e,t){this.update(e,{enabled:t})}setLogLevelForAll(e){this.m_levelSetForAll=e;for(const t of this.m_loggers)t.level=e}setLogLevel(e,t){this.update(e,{level:t})}setChannel(e){this.channel=e}}},3069:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MultiChannel=void 0,t.MultiChannel=class{constructor(...e){this.channels=[],this.channels=e}error(e,...t){for(const i of this.channels)i.error(e,...t)}debug(e,...t){for(const i of this.channels)i.debug(e,...t)}info(e,...t){for(const i of this.channels)i.info(e,...t)}log(e,...t){for(const i of this.channels)i.log(e,...t)}trace(e,...t){for(const i of this.channels)i.trace(e,...t)}warn(e,...t){for(const i of this.channels)i.warn(e,...t)}}},7698:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkerChannel=t.WORKERCHANNEL_MSG_TYPE=void 0;const n=i(6781);t.WORKERCHANNEL_MSG_TYPE="worker-channel-message",t.WorkerChannel=class{error(e,...i){const r={message:[e,...i],type:t.WORKERCHANNEL_MSG_TYPE,level:n.LogLevel.Error};self.postMessage(r)}debug(e,...i){const r={message:[e,...i],type:t.WORKERCHANNEL_MSG_TYPE,level:n.LogLevel.Debug};self.postMessage(r)}info(e,...i){const r={message:[e,...i],type:t.WORKERCHANNEL_MSG_TYPE,level:n.LogLevel.Info};self.postMessage(r)}log(e,...i){const r={message:[e,...i],type:t.WORKERCHANNEL_MSG_TYPE,level:n.LogLevel.Log};self.postMessage(r)}trace(e,...i){const r={message:[e,...i],type:t.WORKERCHANNEL_MSG_TYPE,level:n.LogLevel.Trace};self.postMessage(r)}warn(e,...i){const r={message:[e,...i],type:t.WORKERCHANNEL_MSG_TYPE,level:n.LogLevel.Warn};self.postMessage(r)}}},197:function(e,t,i){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);
950r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=this&&this.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||n(t,e,i)};Object.defineProperty(t,"__esModule",{value:!0}),r(i(4015),t),r(i(3140),t),r(i(6781),t),r(i(8648),t),r(i(6562),t),r(i(3069),t),r(i(7698),t)},9172:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Math2D=void 0,function(e){function t(e,t,i,n){return(e-i)*(e-i)+(t-n)*(t-n)}e.Box=class{constructor(e=0,t=0,i=0,n=0){this.x=e,this.y=t,this.w=i,this.h=n}set(e,t,i,n){this.x=e,this.y=t,this.w=i,this.h=n}copy(e){this.x=e.x,this.y=e.y,this.w=e.w,this.h=e.h}contains(e,t){return this.x<=e&&this.x+this.w>=e&&this.y<=t&&this.y+this.h>=t}containsBox(e){const t=e.x+e.w,i=e.y+e.h;return this.contains(e.x,e.y)&&this.contains(t,e.y)&&this.contains(e.x,i)&&this.contains(t,i)}intersects(e){return this.x<=e.x+e.w&&this.x+this.w>=e.x&&this.y<=e.y+e.h&&this.y+this.h>=e.y}},e.distSquared=t,e.computeSquaredLineLength=function(e){let t=0;const i=e.length-4;for(let n=0;n<i;n+=3){const i=e[n+3]-e[n],r=e[n+4]-e[n+1];t+=i*i+r*r}return t},e.distToSegmentSquared=function(e,i,n,r,s,o){const a=t(n,r,s,o);if(0===a)return t(e,i,n,r);let l=((e-n)*(s-n)+(i-r)*(o-r))/a;return l=Math.max(0,Math.min(1,l)),t(e,i,n+l*(s-n),r+l*(o-r))},e.intersectLineAndCircle=function(e,t,i,n,r,s=0,o=0){const a=i-e,l=n-t,c=a*a+l*l,h=e*n-i*t-l*s+a*o,u=r*r*c-h*h;if(u<-1e-10)return;const d=h*l,m=-h*a;if(u<1e-10)return{x1:s+d/c,y1:o+m/c};const p=Math.sqrt(u),f=(l<0?-1:1)*a*p,g=Math.abs(l)*p;return{x1:s+(d+f)/c,y1:o+(m+g)/c,x2:s+(d-f)/c,y2:o+(m-g)/c}},e.intersectLines=function(e,t,i,n,r,s,o,a,l={x:0,y:0}){const c=(e-i)*(s-a)-(t-n)*(r-o);if(0===c)return;const h=((e*n-t*i)*(r-o)-(e-i)*(r*a-s*o))/c,u=((e*n-t*i)*(s-a)-(t-n)*(r*a-s*o))/c;return l.x=h,l.y=u,l}}(t.Math2D||(t.Math2D={}))},5200:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MathUtils=void 0,function(e){function t(e,t,i){return e<t?t:e>i?i:e}e.clamp=t,e.smoothStep=function(e,i,n){return(n=t((n-e)/(i-e),0,1))*n*(3-2*n)},e.smootherStep=function(e,i,n){return(n=t((n-e)/(i-e),0,1))*n*n*(n*(6*n-15)+10)},e.map=function(e,t,i,n,r){return(e-t)*(r-n)/(i-t)+n},e.min2=function(e,t){let i;return void 0!==e&&(i=e),void 0!==t&&(i=void 0===i?t:Math.min(i,t)),i},e.max2=function(e,t){let i;return void 0!==e&&(i=e),void 0!==t&&(i=void 0===i?t:Math.max(i,t)),i},e.isWithinBounds=function(e,t,i){return!(void 0!==t&&e<t||void 0!==i&&e>i)},e.easeInOutCubic=function(e,t,i){return e+(t-e)*(i<.5?4*i*i*i:(i-1)*(2*i-2)*(2*i-2)+1)}}(t.MathUtils||(t.MathUtils={}))},8154:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.applyMixinsWithoutProperties=t.applyMixins=void 0,t.applyMixins=function(e,t){t.forEach((t=>{Object.getOwnPropertyNames(t.prototype).forEach((i=>{e.prototype[i]=t.prototype[i]}))}))},t.applyMixinsWithoutProperties=function(e,t){t.forEach((t=>{Object.getOwnPropertyNames(t.prototype).forEach((i=>{const n=Object.getOwnPropertyDescriptor(t.prototype,i);void 0!==n&&void 0===n.get&&"constructor"!==i&&(e.prototype[i]=t.prototype[i])}))}))}},173:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pick=t.cloneDeep=void 0,t.cloneDeep=function(e){const t=new Map,i=function e(i){if(null===i)return null;if("object"==typeof i){const n=t.get(i);if(void 0!==n)return n;if(Array.isArray(i)){const n=[];t.set(i,n),n.length=i.length;for(let t=0;t<n.length;++t)n[t]=e(i[t]);return n}if(i instanceof Date){const e=new Date(i.getTime());return t.set(i,e),e}if(i instanceof RegExp){const e=new RegExp(i.source,i.flags);return t.set(i,e),e}if(i.constructor!==Object)throw new Error("cloneDeep doesn't support objects with custom prototypes");{const n={};t.set(i,n);for(const t in i)i.hasOwnProperty(t)&&(n[t]=e(i[t]));return n}}return i}(e);return t.clear(),i},t.pick=function(e,t){const i={};for(const n of t)e.hasOwnProperty(n)&&(i[n]=e[n]);return i}},34:(e,t)=>{"use strict";
950Object.defineProperty(t,"__esModule",{value:!0}),t.getOptionValue=void 0,t.getOptionValue=function(...e){for(const t of e)if(null!=t)return t}},4954:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PerformanceTimer=void 0;class i{static now(){return i.nowFunc()}static getNowFunc(){return"undefined"!=typeof performance&&void 0!==performance.now?()=>performance.now():()=>(new Date).getTime()}}t.PerformanceTimer=i,i.instance=new i,i.nowFunc=i.getNowFunc()},5704:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sampleBilinear=void 0,t.sampleBilinear=function(e,t,i,n,r){const s=t-1,o=i-1,a=n*s,l=Math.floor(a),c=r*o,h=Math.floor(c),u=h*t+l,d=l<s?u+1:u,m=h<o?u+t:u,p=l<s?m+1:m,f=e[u],g=e[d],v=e[m],y=e[p],_=Number.isInteger(a)?0:a-l,x=1-_,b=Number.isInteger(c)?0:c-h,w=1-b;return f*x*w+g*_*w+v*x*b+y*_*b}},7250:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TaskQueue=void 0,t.TaskQueue=class{constructor(e){var t;this.m_options=e,this.m_taskLists=new Map,null===(t=this.m_options.groups)||void 0===t||t.forEach((e=>{this.m_taskLists.set(e,[])})),this.m_options.prioSortFn&&(this.sort=this.m_options.prioSortFn)}update(e){if(void 0===e)this.m_taskLists.forEach((e=>{this.updateTaskList(e)}));else{const t=this.getTaskList(e);t&&this.updateTaskList(t)}}add(e){var t;if(this.m_taskLists.has(e.group)){const i=this.m_taskLists.get(e.group);if(!(null==i?void 0:i.includes(e)))return null===(t=this.m_taskLists.get(e.group))||void 0===t||t.push(e),!0}return!1}remove(e){var t,i;if(this.m_taskLists.has(e.group)){const n=null===(t=this.m_taskLists.get(e.group))||void 0===t?void 0:t.indexOf(e);if(-1!==n)return null===(i=this.m_taskLists.get(e.group))||void 0===i||i.splice(n,1),!0}return!1}numItemsLeft(e){var t,i;let n=0;return void 0===e?this.m_taskLists.forEach((e=>{n+=e.length})):n+=null!==(i=null===(t=this.getTaskList(e))||void 0===t?void 0:t.length)&&void 0!==i?i:0,n}processNext(e,t,i=1){if(!this.getTaskList(e)||this.numItemsLeft(e)<=0)return!1;for(let n=0;n<i&&this.numItemsLeft(e)>0;n++){const i=this.pull(e,!0);void 0!==i&&(!t||(null==t?void 0:t(i))?i.execute():this.add(i))}return!0}clear(){this.m_taskLists.clear()}pull(e,t=!1){var i,n;let r;return this.getTaskList(e)&&(r=null===(i=this.getTaskList(e))||void 0===i?void 0:i.pop(),t&&r&&(null===(n=r.isExpired)||void 0===n?void 0:n.call(r)))?this.pull(e,t):r}sort(e,t){return t.getPriority()-e.getPriority()}getTaskList(e){return this.m_taskLists.get(e)}updateTaskList(e){var t;for(let i=0;i<e.length;i++){const n=e[i];(null===(t=null==n?void 0:n.isExpired)||void 0===t?void 0:t.call(n))&&(e.splice(i,1),i--)}e.sort(this.sort)}}},5177:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5323:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getAppBaseUrl=void 0;const n=i(4713);t.getAppBaseUrl=function(){return"undefined"==typeof window?`file://${process.cwd()}/`:(0,n.baseUrl)(window.location.href)}},4713:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getUrlHostAndProtocol=t.getUrlOrigin=t.baseUrl=t.resolveReferenceUri=void 0,t.resolveReferenceUri=function(e,t){return i.test(t)?t:t.startsWith("/")?r(e)+t:(t.startsWith("./")&&(t=t.substr(2)),n(e)+t)};const i=new RegExp("^(((?:[a-z]+:)?//)|(file:/)|(data:))","i");function n(e){if(void 0===e)return"./";let t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),t=e.indexOf("?"),-1!==t&&(e=e.slice(0,t)),t=e.lastIndexOf("/"),-1===t?"./":e.substring(0,t+1)}function r(e){if(void 0===e)return"";const t=s(e);return"file:"===t.protocol?"file://":t.host&&t.protocol?t.protocol+"//"+t.host:t.host?"//"+t.host:t.protocol?t.protocol+"//":""}function s(e){const t=new RegExp(/^(?:([a-z]+:))?\/\/([^\/]*)/,"i"),i=e.match(t);if(!i)throw new Error(`getUrlHostAndProtocol: unable to parse URL '${e}'`);return{protocol:i[1],host:i[2]}}t.baseUrl=n,t.getUrlOrigin=r,t.getUrlHostAndProtocol=s},9246:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assertExists=t.assert=void 0,t.assert=function(e,t){},t.assertExists=function(e,t){return e}},2972:function(e,t,i){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);
950r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=this&&this.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||n(t,e,i)};Object.defineProperty(t,"__esModule",{value:!0}),r(i(7458),t),r(i(3436),t),r(i(9959),t),r(i(6822),t),r(i(3123),t),r(i(5591),t)},9287:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.computeLineAnchorPoints=t.MAX_SEARCH_DEPTH=void 0;const n=i(82),r=new n.Vector3,s=new n.Vector3;t.MAX_SEARCH_DEPTH=3,t.computeLineAnchorPoints=function(e,i){if(e.count<2)return(new Float64Array).buffer;const n=function(e){const t=[];let i=0;for(let n=0;n<e.count-1;++n)i+=r.fromBufferAttribute(e,n).distanceTo(s.fromBufferAttribute(e,n+1)),t.push(i);return t}(e);if(n[n.length-1]<=Number.EPSILON)return(new Float64Array).buffer;const o=function(e,i,n){const o=[],a=e[e.length-1],l=Math.min(t.MAX_SEARCH_DEPTH+1,Math.floor(Math.log2(a/i))),c=l>0?Math.pow(2,l):0,h=c+1,u=a/c;let d=0;for(let t=0;t<h;t++){const i=1===h?a/2:t*u;let l=e.length-1;for(;l!==d;){const t=Math.floor((l+d)/2);i>=e[t]?d=t+1:l=t}const c=e[d],m=1-(c-i)/(c-(0===d?0:e[d-1])),p=r.fromBufferAttribute(n,d).lerp(s.fromBufferAttribute(n,d+1),m);o.push(...p.toArray())}return o}(n,i,e);return new Float64Array(o).buffer}},9252:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DecodeInfo=void 0;const n=i(82),r=i(2616);t.DecodeInfo=class{constructor(e,t,i=0){this.targetProjection=e,this.tileKey=t,this.storageLevelOffset=i,this.projectedBoundingBox=new r.OrientedBox3,this.tileBounds=new n.Box3,this.tileSize=new n.Vector3,this.center=new n.Vector3,this.geoBox=this.tilingScheme.getGeoBox(t),this.targetProjection.projectBox(this.geoBox,this.projectedBoundingBox),this.projectedBoundingBox.getCenter(this.center),this.tilingScheme.getWorldBox(t,this.tileBounds),this.tileBounds.getSize(this.tileSize),this.tileSizeOnScreen=256*Math.pow(2,-this.storageLevelOffset),this.columnCount=r.webMercatorTilingScheme.subdivisionScheme.getLevelDimensionX(this.tileKey.level),this.rowCount=r.webMercatorTilingScheme.subdivisionScheme.getLevelDimensionY(this.tileKey.level)}get tilingScheme(){return r.webMercatorTilingScheme}get sourceProjection(){return this.tilingScheme.projection}}},5591:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GeoJsonDataProvider=void 0;const n=i(8152),r=i(2344),s=i(8449),o=i(4342),a=i(9959),l=o.LoggerManager.instance.create("GeoJsonDataProvider"),c="invalidated";let h=!1;class u extends s.DataProvider{constructor(e,t,i){var n;super(),this.name=e,this.input=t,this.m_registered=!1,this.m_tiler=null!==(n=null==i?void 0:i.tiler)&&void 0!==n?n:r.ConcurrentTilerFacade.getTiler(a.GEOJSON_TILER_SERVICE_TYPE,null==i?void 0:i.workerTilerUrl,null==i?void 0:i.workerConnectionTimeout)}async connect(){try{await this.m_tiler.connect()}catch(e){throw n.WorkerServiceProtocol.isUnknownServiceError(e)&&!h&&(l.info("Unable to start GeoJson tiler service in worker. Use 'OmvTilerService.start();' in decoder script."),h=!0),e}await this.m_tiler.registerIndex(this.name,this.input),this.m_registered=!0}updateInput(e){this.input=e,this.m_tiler.updateIndex(this.name,this.input),this.dispatchEvent({type:c})}ready(){return this.m_registered}async getTile(e){return await this.m_tiler.getTile(this.name,e)}onDidInvalidate(e){return this.addEventListener(c,e),()=>this.removeEventListener(c,e)}dispose(){this.m_tiler.dispose()}}t.GeoJsonDataProvider=u},7458:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ComposedDataFilter=void 0,t.ComposedDataFilter=class{constructor(e){this.filters=e}wantsLayer(e,t){return this.filters.reduce(((i,n)=>i&&n.wantsLayer(e,t)),!0)}wantsPointFeature(e,t,i){return this.filters.reduce(((n,r)=>n&&r.wantsPointFeature(e,t,i)),!0)}wantsLineFeature(e,t,i){return this.filters.reduce(((n,r)=>n&&r.wantsLineFeature(e,t,i)),!0)}wantsPolygonFeature(e,t,i){return this.filters.reduce(((n,r)=>n&&r.wantsPolygonFeature(e,t,i)),!0)}}},6822:(e,t,i)=>{"use strict";
950Object.defineProperty(t,"__esModule",{value:!0}),t.OmvDebugLabelsTile=void 0;const n=i(82),r=i(8152),s=i(2344),o=i(507),a=i(5912),l=i(2002),c=i(5823),h=i(1984),u=new n.LineBasicMaterial({color:0,linewidth:1,depthTest:!1,depthFunc:n.NeverDepth}),d=new n.MeshBasicMaterial({color:16711680,depthTest:!1,depthFunc:n.NeverDepth});new n.MeshBasicMaterial({color:16711680,depthTest:!1,depthFunc:n.NeverDepth}).wireframe=!0,new n.MeshBasicMaterial({color:8421631,depthTest:!1,depthFunc:n.NeverDepth}).wireframe=!0;const m=new n.MeshBasicMaterial({color:0,depthTest:!1,depthFunc:n.NeverDepth}),p=new n.MeshBasicMaterial({color:255,depthTest:!1,depthFunc:n.NeverDepth,opacity:.75,transparent:!0}),f=new n.MeshBasicMaterial({color:10514432,depthTest:!1,depthFunc:n.NeverDepth,opacity:.75,transparent:!0}),g=new c.TextRenderStyle,v=new c.TextLayoutStyle;g.fontSize={unit:c.FontUnit.Point,size:9,backgroundSize:0},g.opacity=.75,g.backgroundOpacity=.75,g.color=new n.Color(.8,.2,.2);const y=Number.MAX_SAFE_INTEGER;class _{constructor(){this.geometry=new n.BufferGeometry,this.indices=new Array,this.positions=new Array}}function x(e,t,i,n,r){r.positions.push(e,t-n,i),r.positions.push(e+n,t,i),r.positions.push(e,t+n,i),r.positions.push(e-n,t,i);const s=r.positions.length/3;r.indices.push(s-4),r.indices.push(s-3),r.indices.push(s-2),r.indices.push(s-4),r.indices.push(s-2),r.indices.push(s-1)}function b(e,t,i=0,r){if(t.indices.length>0){t.geometry.addGroup(0,t.indices.length,0),t.geometry.setAttribute("position",new n.BufferAttribute(new Float32Array(t.positions),3)),t.geometry.setIndex(new n.BufferAttribute(new Uint32Array(t.indices),1));const s=r(t.geometry);s.renderOrder=y-i,e.push(s)}}class w extends s.Tile{constructor(e,t){super(e,t)}loadingFinished(){var e,t,i,y;const w=o.debugContext.getValue("DEBUG_TEXT_PATHS"),M=o.debugContext.getValue("DEBUG_TEXT_PATHS_FULL"),T=o.debugContext.getValue("DEBUG_TEXT_POIS_FULL"),S=o.debugContext.getValue("DEBUG_TEXT_LINE_MARKER");if(!(w||M||S)||void 0===this.decodedTile)return;const E=a.TileGeometryCreator.instance,A=this.decodedTile,C=new Map,P=o.debugContext.getValue("DEBUG_TEXT_PATHS.FILTER.TEXT"),L=o.debugContext.getValue("DEBUG_TEXT_PATHS.FILTER.INDEX"),R=this.mapView.env;void 0!==A.textPathGeometries&&(this.preparedTextPaths=E.prepareTextPaths(A.textPathGeometries,A));const D=this.center.x,O=this.center.y,I=this.center.z,F=this.mapView.pixelToWorld,V=this.computeWorldOffsetX();let U=0;if(this.iconTextGroups.count()>0){const e=new _,t=new _,i=[];this.iconTextGroups.forEachElement((r=>{if(r.type!==l.IconTextType.LineMarker&&r.type!==l.IconTextType.PointIconText)return;const o=r.type===l.IconTextType.LineMarker?t:e,a=5*F,h=(e,t,l)=>{if(x(e,t,l,a,o),T||S){const o=.5*a,h=`${r.text} [${U}]`,u=new s.IconText(c.ContextualArabicConverter.instance.convert(h),new n.Vector3(e+V+D+o,t+O+o,l+I),g,v,s.IconText.HIGHEST_PRIORITY,s.IconText.HIGHEST_Z_ORDER,0,0);u.textMinZoomLevel=0,u.mayOverlap=!0,u.reserveSpace=!1,u.alwaysOnTop=!0,u.ignoreDistance=!0,u.priority=s.IconText.HIGHEST_PRIORITY,u._isDebug=!0,i.push(u)}U++};if(void 0!==r.path&&Array.isArray(r.path))for(let e=0;e<r.path.length;e++){const t=r.path[e];h(t.x-D,t.y-O,10+t.z+5*e-I)}else T&&h(r.position.x-D,r.position.y-O,5-I)}));for(const e of i)this.addIconText(e);b(this.objects,e,0,(e=>new n.Mesh(e,p))),b(this.objects,t,0,(e=>new n.Mesh(e,f)))}if(void 0!==this.preparedTextPaths){const o=new _,a=new _,l=new _;let p=0;for(const u of this.preparedTextPaths){const d=A.techniques[u.technique];if(!(0,h.isTextTechnique)(d)||void 0!==u._isDebug)continue;void 0!==d.color&&C.set(u.technique,new n.Color((0,r.getPropertyValue)(d.color,R))),p=o.positions.length/3;const m=u.text,f=this.preparedTextPaths.indexOf(u);if((!P||m&&m.includes(P))&&(void 0===L||L===f)){for(let h=0;h<u.path.length;h+=3){const p=h/3,f=u.path[h]-D,_=u.path[h+1]-O,b=10+u.path[h+2]+h/3-I;w&&o.positions.push(f,_,b);const T=0===h&&w;if((M||T)&&(x(f,_,b,F*(T?6:4),T?a:l),M)){const o=null!==(e=d.xOffset)&&void 0!==e?e:0,a=null!==(t=d.yOffset)&&void 0!==t?t:0,l=d.minZoomLevel,h=p%5==0?m+":"+p:Number(p).toString(),u=new s.IconText(c.ContextualArabicConverter.instance.convert(h),new n.Vector3(f+V+D,_+O,b+I),g,v,(0,r.getPropertyValue)(null!==(i=d.priority)&&void 0!==i?i:0,R),(0,r.getPropertyValue)(null!==(y=d.zOrder)&&void 0!==y?y:0,R),o,a);u.textMinZoomLevel=(0,r.getPropertyValue)(l,R),u.mayOverlap=!0,u.reserveSpace=!1,u.alwaysOnTop=!0,u.ignoreDistance=!0,u.priority=s.IconText.HIGHEST_PRIORITY,u.zOrder=s.IconText.HIGHEST_Z_ORDER,this.addIconText(u)}}const h=u.path.length/3;for(let e=0;e<h;++e)e>0&&o.indices.push(p+e),e+1<h&&o.indices.push(p+e)}}b(this.objects,o,-2,(e=>new n.LineSegments(e,u))),b(this.objects,a,0,(e=>new n.Mesh(e,d))),b(this.objects,l,-1,(e=>new n.Mesh(e,m)))}}}t.OmvDebugLabelsTile=w},9959:(e,t)=>{"use strict";var i;
950Object.defineProperty(t,"__esModule",{value:!0}),t.GEOJSON_TILER_SERVICE_TYPE=t.VECTOR_TILE_DECODER_SERVICE_TYPE=t.OmvGeometryType=void 0,(i=t.OmvGeometryType||(t.OmvGeometryType={}))[i.UNKNOWN=0]="UNKNOWN",i[i.POINT=1]="POINT",i[i.LINESTRING=2]="LINESTRING",i[i.POLYGON=3]="POLYGON",t.VECTOR_TILE_DECODER_SERVICE_TYPE="vector-tile-decoder",t.GEOJSON_TILER_SERVICE_TYPE="geojson-tiler"},7305:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OmvPoliticalViewFeatureModifier=void 0,t.OmvPoliticalViewFeatureModifier=class{constructor(e){this.m_countryCode=e}doProcessPointFeature(e,t,i){return this.processFeature(e,t)}doProcessLineFeature(e,t,i){return this.processFeature(e,t)}doProcessPolygonFeature(e,t,i){return!0}rewriteEnvironment(e,t){this.isPoliticalViewLayer(e)&&this.updateEnvironment(t,this.m_countryCode,"kind")}updateEnvironment(e,t,i){const n=this.getAlternativePov(e,t,i);void 0!==n&&(e.entries[i]=n)}getAlternativePov(e,t,i){const n=t,r=e.lookup(`${i}:${n}`);return"string"==typeof r&&r.length>0?r:void 0}isPoliticalViewLayer(e){return"boundaries"===e||"places"===e}processFeature(e,t){let i=!1;if(this.isPoliticalViewLayer(e)){const n=Object.keys(t.unmap()).filter((e=>e.includes("kind:"))).length>0,r=!!t.lookup(`kind:${this.m_countryCode}`),s=!!t.lookup("kind"),o=Boolean(this.m_countryCode);i=!o&&!s&&n||o&&(!s&&n&&!r||s&&r),!i&&o&&r&&this.rewriteEnvironment(e,t)}return!i}}},3123:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OmvRestClient=t.AuthenticationTypeAccessToken=t.AuthenticationTypeTomTomV1=t.AuthenticationTypeBearer=t.AuthenticationMethod=t.APIFormat=void 0;const n=i(8449),r=i(3209),s=i(4342).LoggerManager.instance.create("OmvRestClient");var o,a;!function(e){e[e.HereV1=0]="HereV1",e[e.MapboxV4=1]="MapboxV4",e[e.XYZMVT=2]="XYZMVT",e[e.XYZJson=3]="XYZJson",e[e.XYZOMV=4]="XYZOMV",e[e.TomtomV1=5]="TomtomV1",e[e.XYZSpace=6]="XYZSpace"}(o=t.APIFormat||(t.APIFormat={})),function(e){e[e.QueryString=0]="QueryString",e[e.AuthorizationHeader=1]="AuthorizationHeader"}(a=t.AuthenticationMethod||(t.AuthenticationMethod={})),t.AuthenticationTypeBearer={method:a.AuthorizationHeader,name:"Bearer"},t.AuthenticationTypeTomTomV1={method:a.QueryString,name:"key"},t.AuthenticationTypeAccessToken={method:a.QueryString,name:"access_token"};class l extends n.DataProvider{constructor(e){super(),this.params=e,this.downloadManager=void 0===e.downloadManager?r.TransferManager.instance():e.downloadManager,this.urlParams=void 0===e.urlParams?{}:e.urlParams}async connect(){}ready(){return!0}async getTile(e,t){const i={signal:t};let n=this.dataUrl(e);const r=await this.getActualAuthenticationCode();return n=this.applyAuthCode(n,i,r),n=this.addQueryParams(n,this.urlParams),this.params.apiFormat===o.XYZJson?await this.downloadManager.downloadJson(n,i):await this.downloadManager.downloadArrayBuffer(n,i)}dispose(){}async getActualAuthenticationCode(){return"string"==typeof this.params.authenticationCode?this.params.authenticationCode:void 0!==this.params.authenticationCode?await this.params.authenticationCode():void 0!==this.params.getBearerToken?await this.params.getBearerToken():void 0}getDefaultAuthMethod(){if(void 0!==this.params.getBearerToken)return t.AuthenticationTypeBearer;switch(this.params.apiFormat){case o.HereV1:return t.AuthenticationTypeBearer;case o.MapboxV4:case o.XYZOMV:case o.XYZMVT:case o.XYZSpace:case o.XYZJson:return t.AuthenticationTypeAccessToken;case o.TomtomV1:return t.AuthenticationTypeTomTomV1;default:return void s.warn(`#getDefaultAuthMethod: Not supported API format: ${this.params.apiFormat}`)}}applyAuthCode(e,t,i){var n,r,s;if(void 0===i)return e;const o=null!==(n=this.params.authenticationMethod)&&void 0!==n?n:this.getDefaultAuthMethod();if(void 0===o)return e;if(o.method===a.AuthorizationHeader){void 0===t.headers&&(t.headers=new Headers);const e=null!==(r=o.name)&&void 0!==r?r:"Bearer";t.headers.append("Authorization",`${e} ${i}`)}else if(o.method===a.QueryString){const t={};t[null!==(s=o.name)&&void 0!==s?s:"access_token"]=i,e=this.addQueryParams(e,t)}return e}dataUrl(e){if(void 0!==this.params.url)return this.params.url.replace("{x}",String(e.column)).replace("{y}",String(e.row)).replace("{z}",String(e.level));let t=[`/${e.level}`,e.column,e.row].join(this.params.apiFormat===o.XYZSpace||this.params.apiFormat===o.XYZJson?"_":"/");switch(this.params.apiFormat){case o.HereV1:case o.XYZOMV:t+="/omv";break;case o.MapboxV4:case o.XYZMVT:t+=".mvt";break;
950case o.XYZJson:break;case o.XYZSpace:t+=".mvt";break;case o.TomtomV1:t+=".pbf";break;default:s.warn(`Not supported API format: ${this.params.apiFormat}`)}return this.params.baseUrl+t}addQueryParams(e,t){let i="",n=e.includes("?")?"&":"?";for(const e in t)t.hasOwnProperty(e)&&(i+=`${n}${encodeURIComponent(e)}=${encodeURIComponent(t[e])}`,"?"===n&&(n="&"));return e+i}}t.OmvRestClient=l},6441:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.webMercatorTile2TargetTile=t.webMercatorTile2TargetWorld=t.world2tile=t.tile2world=t.createWorldTileTransformationCookie=t.tile2lat=t.lat2tile=t.isArrayBufferLike=void 0;const n=i(82),r=i(2616);function s(e,t){return Math.round((1-Math.log(Math.tan(e*Math.PI/180)+1/Math.cos(e*Math.PI/180))/Math.PI)/2*Math.pow(2,t))}function o(e,t){const{north:i,west:n}=t.geoBox,r=Math.log2(e),o=Math.pow(2,t.tileKey.level+r);return{extents:e,scale:o,top:s(i,t.tileKey.level+r),left:Math.round((n+180)/360*o)}}function a(e,t,i,n=!1,s){void 0!==t.worldTileProjectionCookie&&t.worldTileProjectionCookie.extents===e||(t.worldTileProjectionCookie=o(e,t));const{top:a,left:l,scale:c}=t.worldTileProjectionCookie,h=r.EarthConstants.EQUATORIAL_CIRCUMFERENCE;return s.x=(l+i.x)/c*h,s.y=(a+(n?-i.y:i.y))/c*h,s.z=(0,r.isVector3Like)(i)?i.z:0,s}function l(e,t,i,s,o,l=!1){a(e,t,i,l,s),t.targetProjection.reprojectPoint(r.webMercatorProjection,s,s),i instanceof n.Vector3&&o&&(s.z*=t.targetProjection.getScaleFactor(s))}t.isArrayBufferLike=function(e){return"undefined"!=typeof SharedArrayBuffer?e instanceof ArrayBuffer||e instanceof SharedArrayBuffer:e instanceof ArrayBuffer},t.lat2tile=s,t.tile2lat=function(e,t){const i=Math.PI-2*Math.PI*e/Math.pow(2,t);return 180/Math.PI*Math.atan(.5*(Math.exp(i)-Math.exp(-i)))},t.createWorldTileTransformationCookie=o,t.tile2world=a,t.world2tile=function(e,t,i,n=!1,s){void 0!==t.worldTileProjectionCookie&&t.worldTileProjectionCookie.extents===e||(t.worldTileProjectionCookie=o(e,t));const{top:a,left:l,scale:c}=t.worldTileProjectionCookie,h=r.EarthConstants.EQUATORIAL_CIRCUMFERENCE;return s.x=Math.round(i.x/h*c-l),s.y=Math.round((n?-1:1)*(i.y/h*c-a)),(0,r.isVector3Like)(s)&&(s.z=i.z),s},t.webMercatorTile2TargetWorld=l,t.webMercatorTile2TargetTile=function(e,t,i,n,r,s=!1){l(e,t,i,n,r,s),n.sub(t.center)}},627:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Ring=void 0;const n=i(82);t.Ring=class{constructor(e,t,i=4096,r=!1){if(this.points=e,this.textureCoords=t,this.extents=i,this.hasClipInfo=r,void 0!==t&&t.length!==e.length)throw new Error("the array of texture coordinates must have the same number of elements of the array of points");this.vertexStride=2,void 0!==t&&(this.vertexStride=this.vertexStride+2),this.area=n.ShapeUtils.area(this.points),this.winding=this.area<0}toArray(e=[],t=0){var i;return this.points.forEach(((i,n)=>i.toArray(e,t+this.vertexStride*n))),null===(i=this.textureCoords)||void 0===i||i.forEach(((i,n)=>i.toArray(e,t+this.vertexStride*n+2))),e}isProperEdge(e){const t=this.extents,i=(e+1)%this.points.length,n=this.points[e],r=this.points[i];if(this.hasClipInfo){if(n.x!==r.x&&n.y!==r.y)return!0;if(n.x%this.extents!=0&&n.y%this.extents!=0)return!0;if(r.x%this.extents!=0&&r.y%this.extents!=0)return!0;const e=!0===n.isClipped,t=!0===r.isClipped;return!e&&!t}return!(n.x<=0&&r.x<=0||n.x>=t&&r.x>=t||n.y<=0&&r.y<=0||n.y>=t&&r.y>=t)}}},1140:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VectorTileDataEmitter=void 0;const n=i(1874),r=i(82),s=i(8152),o=i(3561),a=i(2982),l=i(6525),c=i(6189),h=i(2616),u=i(4388),d=i(3711),m=i(4250),p=i(1984),f=i(4342),g=i(9287),v=i(6441),y=i(627),_=f.LoggerManager.instance.create("OmvDecodedTileEmitter"),x=new r.Vector3,b=new r.Vector3,w=new r.Vector3,M=new r.Vector3,T=new r.Vector2,S=new r.Vector2,E=new r.Vector3,A=new r.Vector3,C=new r.Vector3,P=new r.Vector2,L=new r.Vector2,R=new r.Vector2,D=new r.Vector3,O=new r.Vector3,I=new r.Vector3,F=new r.Vector3,V=new r.Vector3,U=new r.Line3,B=Math.PI/8;function N(e,t,i="index"){const n=t>65535?"uint32":"uint16";return{itemCount:1,name:i,buffer:("uint32"===n?new Uint32Array(e):new Uint16Array(e)).buffer,type:n}}class z{constructor(e){this.type=e,this.positions=[],this.normals=[],this.textureCoordinates=[],this.colors=[],this.extrusionAxis=[],this.indices=[],this.edgeIndices=[],this.groups=[],this.texts=[],this.pathLengths=[],this.stringCatalog=[],this.imageTextures=[],this.textBackgroun
950dImageTextures=[],this.featureStarts=[],this.edgeFeatureStarts=[],this.objInfos=[],this.offsetDirections=[]}addText(e){let t=this.stringCatalog.indexOf(e);return t<0&&(t=this.stringCatalog.length,this.stringCatalog.push(e)),t}}var k;!function(e){e[e.Simple=0]="Simple",e[e.Complex=1]="Complex"}(k||(k={}));const G=new r.Color;t.VectorTileDataEmitter=class{constructor(e,t,i={}){var n,r,s;this.m_decodeInfo=e,this.m_styleSetEvaluator=t,this.m_options=i,this.m_meshBuffers=new Map,this.m_geometries=[],this.m_textGeometries=[],this.m_textPathGeometries=[],this.m_pathGeometries=[],this.m_iconTextGeometries=[],this.m_simpleLines=[],this.m_solidLines=[],this.m_sources=[],this.m_maxGeometryHeight=0,this.m_minGeometryHeight=0,this.m_options.gatherFeatureAttributes=null!==(n=i.gatherFeatureAttributes)&&void 0!==n&&n,this.m_options.skipShortLabels=null===(r=i.skipShortLabels)||void 0===r||r,this.m_options.enableElevationOverlay=null!==(s=i.enableElevationOverlay)&&void 0!==s&&s}get projection(){return this.m_decodeInfo.targetProjection}get center(){return this.m_decodeInfo.center}processPointFeature(e,t,i,n,r){var a;const l=n.env;this.processFeatureCommon(l);const{tileKey:c,columnCount:u,rowCount:d}=this.m_decodeInfo,m=c.column+1<u?t-1:t,f=c.row+1<d?t-1:t,g=i.filter((e=>e.x>=0&&e.x<=m&&e.y>=0&&e.y<=f));if(0!==g.length)for(const e of r){if(void 0===e)continue;const i=e._index,r=this.findOrCreateMeshBuffers(i,s.GeometryType.Point);if(void 0===r)continue;const{positions:c,texts:u,imageTextures:d,textBackgroundImageTextures:m,objInfos:f,offsetDirections:y}=r,_=(0,p.isTextTechnique)(e)||(0,p.isIconTextTechnique)(e);let x,b;const w=(0,p.isIconTextTechnique)(e);if(w){const t=e;x=(0,o.evaluateTechniqueAttr)(n,t.imageTexture),void 0!==t["background-image"]&&(b=(0,o.evaluateTechniqueAttr)(n,t["background-image"]))}const M=(0,s.scaleHeight)(n,e,this.m_decodeInfo.tileKey.level),T=(0,s.getFeatureId)(l.entries);for(const i of g){if(_){const t=e,i=(0,s.getFeatureText)(n,t,this.m_options.languages);void 0!==i?u.push(r.addText(i)):u.push(-1)}_?(0,v.webMercatorTile2TargetWorld)(t,this.m_decodeInfo,i,E,M):(0,v.webMercatorTile2TargetTile)(t,this.m_decodeInfo,i,E,M);const o=this.projection.type===h.ProjectionType.Planar?E.z:i.z;o>this.m_maxGeometryHeight?this.m_maxGeometryHeight=o:o<this.m_minGeometryHeight&&(this.m_minGeometryHeight=o),c.push(E.x,E.y,E.z),f.push(this.m_options.gatherFeatureAttributes?l.entries:T),y.push(null!==(a=l.lookup("offset_direction"))&&void 0!==a?a:0),w&&(void 0===x?d.push(-1):d.push(r.addText(x)),void 0===b?m.push(-1):m.push(r.addText(b)))}}}processLineFeature(e,t,i,n,a){var l;const c=n.env;this.processFeatureCommon(c);const h=[],u=[],m=[],y=[],x=this.m_decodeInfo.projectedBoundingBox;let b;const w=2*x.extents.x,M=2*x.extents.y,T=Math.max(w,M);let S,P;const L=void 0!==i[0].untiledPositions,R=!1;let D=!1,O=!1;for(const e of a)if(void 0!==e){if(S){const t=this.getTextureCoordinateType(e);(0,f.assert)(void 0===t||P===t)}else S=this.getComputeTexCoordsFunc(e),P=this.getTextureCoordinateType(e);D=D||(0,p.isSpecialDashesLineTechnique)(e),O=O||!D}for(const e of i){const i=[];let n=0;if(L&&(this.m_decodeInfo.targetProjection.projectPoint(e.untiledPositions[0],A),e.untiledPositions.forEach((e=>{this.m_decodeInfo.targetProjection.projectPoint(e,E),n+=E.distanceTo(A),A.copy(E),this.m_decodeInfo.targetProjection.projectPoint(e.normalized(),E),i.push(E.x,E.y,E.z,n)}))),D){b=[];let r=0;const s=e.positions.length;if(s>1){let o=0;for(let a=0;a<s-1;a++){const s=[],l=[],c=[],h=[],d=e.positions[a],p=e.positions[a+1];if((0,v.webMercatorTile2TargetWorld)(t,this.m_decodeInfo,d,E,R),l.push(E.x,E.y,E.z),(0,v.webMercatorTile2TargetWorld)(t,this.m_decodeInfo,p,C,R),l.push(C.x,C.y,C.z),S&&(S(d,t).toArray(c,c.length),S(p,t).toArray(c,c.length)),L){let e=this.findRelativePositionInLine(E,i)/n;h.push(e),e=this.findRelativePositionInLine(C,i)/n,h.push(e)}else{h.push(o);const e=E.distanceTo(C);r+=e,o+=e,h.push(o)}E.sub(this.m_decodeInfo.center),s.push(E.x,E.y,E.z),C.sub(this.m_decodeInfo.center),s.push(C.x,C.y,C.z),b.push(s),u.push(l),m.push(c),y.push(h)}}if(!L&&r>0)for(const e of y)e.forEach(((t,i)=>{e[i]=t/r}))}if(O){const r=[],s=[],o=[],a=[];e.positions.forEach((e=>{if((0,v.webMercatorTile2TargetWorld)(t,this.m_decodeInfo,e,E,R),s.push(E.x,E.y,E.z),S&&S(e,t).toArray(o,o.length),L){const e=this.findRelativePositionInLine(E,i)/n;a.push(e)}E.sub(this.m_decodeInfo.center),r.push(E.x,E.y,E.z)})),h.push(r),u.push(s),m.push(o),y.push(a)}}const I=this.m_decodeInfo.tileKey.level>=11;for(const e of a){if(void 0===e)continue;const t=e._index,i=e.name;if((0,p.isLineTechnique)(e)||(0,p.isSolidLineTechnique)(e)){const i=(0,p.isLineTechnique)(e)?this.m_simpleLines:this.m_solidLines,r=(0,p.isLineTechnique)(e)?k.Simple:k.Complex;D&&((0,f.assert)(void 0!==b,"OmvDecodedTileEmitter#processLineFeature: Internal error - No localLineSegments"),this.applyLineTechnique(i,e,t,r,c.entries,b,n,this.getTextureCoordinateType(e)?m:void 0,y)),h.length>0&&this.applyLineTechnique(i,e,t,r,c.entries,h,n,this.getTextureCoordinateType(e)?m:void 0,L?y:void 0)}else if((0,p.isTextTechnique)(e)||(0,p.isIconTextTechnique)(e)||(0,p.isLineMarkerTechnique)(e)){const i=e,a=(0,s.getFeatureText)(n,i,this.m_options.languages);if(void 0===a&&!(0,p.isIconTextTechnique)(e)&&!(0,p.isLineMarkerTechnique)(e))continue;if((0,p.isTextTechnique)(e)){let e=[];
950if(this.m_options.skipShortLabels){const t=T/this.m_decodeInfo.tileSizeOnScreen,i=5*String(a).length*t*.5,n=i*i;e=this.splitJaggyLines(u,n,B)}else e=u;if(0===e.length)continue;for(const i of e){const e=f.Math2D.computeSquaredLineLength(i);this.m_textPathGeometries.push({technique:t,path:i,pathLengthSqr:e,text:String(a),objInfos:this.m_options.gatherFeatureAttributes?c.entries:(0,s.getFeatureId)(c.entries)})}}else{const i=e,h=(0,o.evaluateTechniqueAttr)(n,i.imageTexture),d=Math.max(Number.EPSILON,null!==(l=(0,o.evaluateTechniqueAttr)(n,i["anchor-point-density"]))&&void 0!==l?l:20),m=this.m_decodeInfo.projectedBoundingBox.extents,p=2*Math.min(m.x,m.y)/d,f=new r.BufferAttribute(new Float64Array,3);for(const e of u)f.array=e,f.count=e.length/f.itemSize,this.m_iconTextGeometries.push({technique:t,positions:{name:"position",type:"float",buffer:(0,g.computeLineAnchorPoints)(f,p),itemCount:f.itemSize},texts:[0],stringCatalog:[a,h],imageTextures:[1],objInfos:this.m_options.gatherFeatureAttributes?[c.entries]:[(0,s.getFeatureId)(c.entries)]})}}else if((0,p.isLabelRejectionLineTechnique)(e))for(const e of u){const t=[];for(let i=0;i<e.length;i+=3)t.push((new r.Vector3).fromArray(e,i));this.m_pathGeometries.push({path:t})}else if((0,p.isExtrudedLineTechnique)(e)){const i=this.findOrCreateMeshBuffers(t,s.GeometryType.ExtrudedLine);if(void 0===i)continue;const{positions:r,indices:a,groups:l,featureStarts:u,objInfos:m}=i,p=a.length,f=(0,o.evaluateTechniqueAttr)(n,e.width);if(void 0===f)continue;const g=(0,o.evaluateTechniqueAttr)(n,e.cap,"Circle"),v=I&&"Circle"===g;h.forEach((e=>{(0,d.triangulateLine)(e,f,r,a,v),u.push(p),m.push(this.m_options.gatherFeatureAttributes?c.entries:(0,s.getFeatureId)(c.entries))}));const y=a.length-p;l.push({start:p,count:y,technique:t})}else _.warn(`OmvDecodedTileEmitter#processLineFeature: Invalid line technique\n ${i} for layer: ${c.entries.$layer} `)}}processPolygonFeature(e,t,i,n,s){const o=n.env;this.processFeatureCommon(o);const l=!1;s.forEach((e=>{if(void 0===e)return;const s=e._index;if(void 0===s)throw new Error("OmvDecodedTileEmitter#processPolygonFeature: Internal error - No technique index");let c;const u=o.lookup("bbox");if(Array.isArray(u)){const[e,t,i,n]=u,s=new h.GeoBox(new h.GeoCoordinates(t,e),new h.GeoCoordinates(n,i));c=new r.Box3,h.webMercatorProjection.projectBox(s,c)}const d=[],m=(0,p.isExtrudedPolygonTechnique)(e),f=(0,p.isPolygonTechnique)(e),g=(0,p.isStandardTechnique)(e),_=m||f||g,x=this.getComputeTexCoordsFunc(e,c),b=_&&!m;for(const e of i){const i=[];for(let n=0;n<e.rings.length;n++){const s=0===n;let o=e.rings[n];b&&o.some((e=>e.x<0||e.x>t||e.y<0||e.y>t))&&(o=(0,a.clipPolygon)(o,t));const l=r.ShapeUtils.area(o);if(s&&0===l)break;if(0!==l){let e;void 0!==x&&(e=o.map((e=>x(e,t)))),i.push(new y.Ring(o,e,t,b))}}i.length>0&&d.push(i)}const w=(0,p.isSolidLineTechnique)(e)||(0,p.isLineTechnique)(e);if(_)this.applyPolygonTechnique(d,e,s,n,t);else if(w){const i="line"===e.name?this.m_simpleLines:this.m_solidLines,r="line"===e.name?k.Simple:k.Complex,a=(0,p.isSpecialDashesLineTechnique)(e);d.forEach((c=>{const h=[],u=a?[]:void 0;c.forEach((e=>{const i=e.points.length;let n=[],r=0,s=0,o=a?[]:void 0;for(let c=0;c<i;++c){a&&n.length>0&&(n=[],o=[]);const d=(c+1)%i,m=e.points[c],p=e.points[d],f=e.isProperEdge(c);if(f||0===n.length){if(f&&0===n.length&&((0,v.webMercatorTile2TargetTile)(t,this.m_decodeInfo,T.copy(m),E,l),n.push(E.x,E.y,E.z),a)){(0,v.webMercatorTile2TargetTile)(t,this.m_decodeInfo,T.copy(p),C,l),n.push(C.x,C.y,C.z),o.push(s);const e=E.distanceTo(C);r+=e,s+=e,o.push(s)}}else h.push(n),n=[];f&&!a&&((0,v.webMercatorTile2TargetTile)(t,this.m_decodeInfo,T.copy(p),E,l),n.push(E.x,E.y,E.z)),a&&n.length>0&&r>0&&(o.forEach(((e,t)=>{o[t]=e/r})),h.push(n),u.push(o))}!a&&n.length>0&&h.push(n)})),0!==h.length&&this.applyLineTechnique(i,e,s,r,o.entries,h,n,void 0,u)}))}}))}getDecodedTile(){this.createGeometries(),this.processSimpleLines(this.m_simpleLines),this.processLines(this.m_solidLines);const e={techniques:this.m_styleSetEvaluator.decodedTechniques,geometries:this.m_geometries,decodeTime:void 0};return this.m_textGeometries.length>0&&(e.textGeometries=this.m_textGeometries),this.m_iconTextGeometries.length>0&&(e.iconTextGeometries=this.m_iconTextGeometries),this.m_textPathGeometries.length>0&&(e.textPathGeometries=this.m_textPathGeometries),this.m_pathGeometries.length>0&&(e.pathGeometries=this.m_pathGeometries),0!==this.m_sources.length&&(e.copyrightHolderIds=this.m_sources),e.maxGeometryHeight=this.m_maxGeometryHeight,e.minGeometryHeight=this.m_minGeometryHeight,e}splitJaggyLines(e,t,i){const n=[],r=(e,t,i)=>{let n=Number.MAX_SAFE_INTEGER,r=Number.MIN_SAFE_INTEGER,s=Number.MAX_SAFE_INTEGER,o=Number.MIN_SAFE_INTEGER;for(let a=t;a<i;a+=3){const t=e[a],i=e[a+1];t<n&&(n=t),t>r&&(r=t),i<s&&(s=i),i>o&&(o=i)}return(r-n)*(r-n)+(o-s)*(o-s)},s=e.slice();for(;s.length>0;){const e=s.pop();if(void 0===e||e.length<6)continue;let o=-1;for(let t=0;t<e.length-3;t+=3){P.set(e[t],e[t+1]),L.set(e[t+3],e[t+4]);const n=L.sub(P).normalize();if(t>0){const e=Math.atan2(R.x*n.y-n.x*R.y,n.dot(R));if(Math.abs(e)>i){o=t;break}}R.set(n.x,n.y)}if(o>0){const i=r(e,0,o+3),a=r(e,o,e.length);i>t&&n.push(e.slice(0,o+3)),a>t&&s.push(e.slice(o))}else r(e,0,e.length)>t&&n.push(e)}return n}getTextureCoordinateType(e){return((0,p.isPolygonTechnique)(e)||(0,p.isSolidLineTechnique)(e)||(0,p.isExtrudedPolygonTechnique)(e))&&this.m_options.enableElevationOverlay?p.TextureCoordinateType.TileSpace:(0,p.textureCoordinateType)(e)}getComputeTexCoordsFunc(e,t){switch(this.getTextureCoordinateType(e)){case p.TextureCoordinateType.TileSpace:return(e,t)=>{const i=e.clone().divideScalar(t);return i.y=1-i.y,i};case p.TextureCoordinateType.EquirectangularSpace:return(e,t)=>{const i=(0,v.tile2world)(t,this.m_decodeInfo,e,!1,A),n=h.normalizedEquirectangularProjection.reprojectPoint(h.webMercatorProjection,i);return new r.Vector2(n.x,n.y)};case p.TextureCoordinateType.FeatureSpace:if(!t)return;return(e,i)=>{const n=(0,v.tile2world)(i,this.m_decodeInfo,e,!1,A),s=new r.Vector2(n.x,n.y);return t&&(s.x-=t.min.x,s.y-=t.min.y,s.x/=t.max.x-t.min.x,s.y/=t.max.y-t.min.y),s.y=1-s.y,s};default:return}}applyLineTechnique(e,t,i,n=k.Complex,r,o,a,l,c){let h;const d=e.find((e=>e.technique===i)),m=void 0!==l;if(void 0===d){h=new u.LineGroup(m,void 0,n===k.Simple);const t={type:n===k.Complex?s.GeometryType.SolidLine:s.GeometryType.Line,technique:i,lines:h};this.m_options.gatherFeatureAttributes&&(t.objInfos=[r],t.featureStarts=[0]),e.push(t)}else h=d.lines,this.m_options.gatherFeatureAttributes&&d.objInfos&&d.featureStarts&&(d.objInfos.push(r),d.featureStarts.push(h.indices.length));let p=0;o.forEach((e=>{h.add(this.m_decodeInfo.center,e,this.projection,c?c[p]:void 0,l?l[p]:void 0),p++}))}applyPolygonTechnique(e,t,i,a,u){var d,g;if(0===e.length)return;const y=(0,p.isExtrudedPolygonTechnique)(t),C=y?s.GeometryType.ExtrudedPolygon:s.GeometryType.Polygon,P=this.findOrCreateMeshBuffers(i,C);if(void 0===P)return;const L=t,R=t,D=!0===L.boundaryWalls,O=(0,p.isPolygonTechnique)(t),I=this.getTextureCoordinateType(t);let F=(0,o.evaluateTechniqueAttr)(a,L.height),V=(0,o.evaluateTechniqueAttr)(a,L.floorHeight);if(void 0===F){const e=a.env.lookup("height"),t=(0,o.evaluateTechniqueAttr)(a,L.defaultHeight);F=void 0!==e?e:void 0!==t?t:0}if(void 0===V){const e=a.env.lookup("min_height");V=void 0===e||O?0:e}F=Math.max(V+m.ExtrusionFeatureDefs.MIN_BUILDING_HEIGHT,F);const U=this.m_decodeInfo.tileKey.level,B=y&&(0,s.scaleHeight)(a,L,U);this.m_decodeInfo.tileBounds.getCenter(x);const{positions:z,normals:k,textureCoordinates:j,colors:H,extrusionAxis:W,indices:q,edgeIndices:X,groups:Z}=P,Y=this.m_decodeInfo.targetProjection.type===h.ProjectionType.Spherical,K=y?
950null!==(d=L.lineWidth)&&void 0!==d?d:0:O&&null!==(g=R.lineWidth)&&void 0!==g?g:0,$="number"!=typeof K||K>0;let J;if((0,p.isExtrudedPolygonTechnique)(t)&&(0,f.getOptionValue)(t.vertexColors,!1)){let e=(0,o.evaluateTechniqueAttr)(a,t.color);if(void 0===e){const t=a.env.lookup("color");this.isColorStringValid(t)&&(e=String(t))}void 0===e&&(e=(0,o.evaluateTechniqueAttr)(a,t.defaultColor,0)),void 0===e&&(e=0),G.set(e),J=G}for(const t of e){const e=q.length,s=X.length,o=[],d=z.length/3,m=t[0],p=m.vertexStride,f=p+2;for(let e=0;e<m.points.length;++e){const t=m.points[e];o.push(t.x,-t.y),void 0!==m.textureCoords&&o.push(m.textureCoords[e].x,m.textureCoords[e].y);const i=(e+1)%m.points.length,n=m.isProperEdge(e);o.push(n?i:-1,D||n?i:-1)}const g=[];let x=1;for(;x<t.length;){const e=o.length/f;g.push(e);const i=t[x++];for(let t=0;t<i.points.length;++t){const n=(t+1)%i.points.length,r=i.points[t];o.push(r.x,-r.y),void 0!==i.textureCoords&&o.push(i.textureCoords[t].x,i.textureCoords[t].y);const s=i.isProperEdge(t);o.push(s?e+n:-1,D||s?e+n:-1)}}try{const e=(0,n.default)(o,g,f),t=o.length/f;if(Y){const t=new r.BufferGeometry,i=[],n=[],s=[],a=[];for(let e=0;e<o.length;e+=f){const t=(0,v.tile2world)(u,this.m_decodeInfo,T.set(o[e],o[e+1]),!0,A);i.push(t.x,t.y,0),void 0!==I&&n.push(o[e+2],o[e+3]),s.push(o[e+p]),a.push(o[e+p+1])}const d=new r.BufferAttribute(new Float32Array(i),3);let m;t.setAttribute("position",d),void 0!==I&&(m=new r.BufferAttribute(new Float32Array(n),2),t.setAttribute("uv",m));const g=new r.BufferAttribute(new Float32Array(s),1);t.setAttribute("edge",g);const y=new r.BufferAttribute(new Float32Array(a),1);t.setAttribute("wall",g);const _=N(e,d.count-1),x="uint32"===_.type?new r.Uint32BufferAttribute(_.buffer,1):new r.Uint16BufferAttribute(_.buffer,1);t.setIndex(x);const b=this.m_decodeInfo.tileKey.level;if(b>=3&&b<9){const e=Math.pow(2,9-b),{geoBox:i}=this.m_decodeInfo;new l.EdgeLengthGeometrySubdivisionModifier(e,i,l.SubdivisionMode.NoDiagonals,h.webMercatorProjection).modify(t)}new c.SphericalGeometrySubdivisionModifier(r.MathUtils.degToRad(10),h.webMercatorProjection).modify(t),o.length=0,e.length=0;for(let e=0;e<d.array.length;e+=3){const t=(0,v.world2tile)(u,this.m_decodeInfo,E.set(d.array[e],d.array[e+1],0),!0,S);o.push(t.x,t.y),void 0!==I&&(o.push(m.array[e/3*2]),o.push(m.array[e/3*2+1])),o.push(g.array[e/3]),o.push(y.array[e/3])}const w=t.getIndex();null!==w&&e.push(...w.array)}b.set(0,0,1);for(let e=0;e<o.length;e+=f){(0,v.webMercatorTile2TargetWorld)(u,this.m_decodeInfo,T.set(o[e],o[e+1]),E,!1,!0);const t=B?this.m_decodeInfo.targetProjection.getScaleFactor(E):1;this.m_maxGeometryHeight=Math.max(this.m_maxGeometryHeight,t*F),this.m_minGeometryHeight=Math.min(this.m_minGeometryHeight,t*F),Y&&b.set(E.x,E.y,E.z).normalize(),E.sub(this.center),w.copy(b).multiplyScalar(V*t),z.push(E.x+w.x,E.y+w.y,E.z+w.z),void 0!==I&&j.push(o[e+2],o[e+3]),this.m_options.enableElevationOverlay&&k.push(...b.toArray()),y&&(M.copy(b).multiplyScalar(F*t),z.push(E.x+M.x,E.y+M.y,E.z+M.z),W.push(0,0,0,0,M.x-w.x,M.y-w.y,M.z-w.z,1),void 0!==I&&j.push(o[e+2],o[e+3]),this.m_options.enableElevationOverlay&&k.push(...b.toArray()),void 0!==J&&H.push(J.r,J.g,J.b,J.r,J.g,J.b))}for(let t=0;t<e.length;t+=3)if(y){const i=d+2*e[t+0]+1,n=d+2*e[t+1]+1,r=d+2*e[t+2]+1;q.push(i,n,r)}else{const i=d+e[t+0],n=d+e[t+1],r=d+e[t+2];q.push(i,n,r)}$&&this.addEdges(d,t,f,p,z,o,X,y,L.footprint,L.maxSlope),y&&this.addWalls(d,t,f,p,o,q)}catch(e){_.error("cannot triangulate geometry",e)}this.m_options.gatherFeatureAttributes&&(P.objInfos.push(a.env.entries),P.featureStarts.push(e),P.edgeFeatureStarts.push(s));const C=q.length-e;C>0&&Z.push({start:e,count:C,technique:i})}}createGeometries(){this.m_meshBuffers.forEach(((e,t)=>{if(0===e.positions.length)return;if(!this.m_styleSetEvaluator.techniques||this.m_styleSetEvaluator.techniques.length<=t)throw new Error("Invalid technique index");const i=this.m_styleSetEvaluator.techniques[t];if(void 0===i)return;if(e.texts.length>0){const n={positions:{name:"position",type:"float",buffer:new Float64Array(e.positions).buffer,itemCount:3},texts:e.texts,technique:t,stringCatalog:e.stringCatalog,objInfos:e.objInfos};if((0,p.isTextTechnique)(i))this.m_textGeometries.push(n);else{(0,f.assert)((0,p.isIconTextTechnique)(i));const t=n;
950t.imageTextures=e.imageTextures,t.textBackgroundImageTextures=e.textBackgroundImageTextures,t.offsetDirections=e.offsetDirections,this.m_iconTextGeometries.push(t)}return}const n=new Float32Array(e.positions);0===e.groups.length&&e.groups.push({start:0,count:n.length/3,technique:t});const r=[{name:"position",buffer:n.buffer,itemCount:3,type:"float"}],s={type:e.type,vertexAttributes:r,groups:e.groups};if(e.normals.length>0){const t=new Float32Array(e.normals);(0,f.assert)(t.length===n.length,"length of normals buffer is different than the length of the position buffer"),r.push({name:"normal",buffer:t.buffer,itemCount:3,type:"float"})}if(e.colors.length>0){const t=new Float32Array(e.colors);(0,f.assert)(t.length===n.length,"length of colors buffer is different than the length of the position buffer"),r.push({name:"color",buffer:t.buffer,itemCount:3,type:"float"})}const o=e.positions.length/3;if(e.textureCoordinates.length>0){const t=e.textureCoordinates.length/2;(0,f.assert)(t===o,"length of textureCoordinates buffer is different than the length of theposition buffer");const i=new Float32Array(e.textureCoordinates);r.push({name:"uv",buffer:i.buffer,itemCount:2,type:"float"})}if(e.extrusionAxis.length>0){const t=new Float32Array(e.extrusionAxis);(0,f.assert)(t.length/4==n.length/3,"length of extrusionAxis buffer is different than the length of the position buffer"),r.push({name:"extrusionAxis",buffer:t.buffer,itemCount:4,type:"float"})}e.indices.length>0&&(s.index=N(e.indices,o-1)),e.edgeIndices.length>0&&(s.edgeIndex=N(e.edgeIndices,o-1,"edgeIndex")),s.featureStarts=e.featureStarts,s.edgeFeatureStarts=e.edgeFeatureStarts,s.objInfos=e.objInfos,this.m_geometries.push(s)}))}processLines(e){e.forEach((e=>{const{vertices:t,indices:i}=e.lines,n=e.technique,r=new Float32Array(t).buffer,o=N(i,t.length/e.lines.stride-1),a={type:"float",stride:e.lines.stride,buffer:r,attributes:e.lines.vertexAttributes},l={type:s.GeometryType.SolidLine,index:o,interleavedVertexAttributes:[a],groups:[{start:0,count:i.length,technique:n}],vertexAttributes:[],featureStarts:e.featureStarts,objInfos:e.objInfos};this.m_geometries.push(l)}))}processSimpleLines(e){e.forEach((e=>{const{vertices:t,indices:i}=e.lines,n=e.technique,r={buffer:new Float32Array(t).buffer,itemCount:3,type:"float",name:"position"},o={type:s.GeometryType.Line,index:N(i,t.length/r.itemCount-1),vertexAttributes:[r],groups:[{start:0,count:i.length,technique:n}],featureStarts:e.featureStarts,objInfos:e.objInfos};this.m_geometries.push(o)}))}findOrCreateMeshBuffers(e,t){let i=this.m_meshBuffers.get(e);return void 0!==i?i.type!==t?void _.error(`MeshBuffer has been created with wrong type "${s.GeometryType[t]}"\n instead of "${s.GeometryType[i.type]}"`):i:(i=new z(t),this.m_meshBuffers.set(e,i),i)}processFeatureCommon(e){const t=e.lookup("source");"string"==typeof t&&""!==t&&(this.m_sources.includes(t)||this.m_sources.push(t))}isColorStringValid(e){return"string"==typeof e&&e.length>0}addEdges(e,t,i,n,s,o,a,l,c,h){const u=new r.Vector3,d=new r.Vector3;let m,p,f=0,g=0;for(;f<t;){for(;f!==m;){void 0===m&&(m=f),f<t&&(g=Math.max(g,f));const r=o[f*i+n];if(r<0)break;if(l)if(!0===c&&a.push(e+2*f,e+2*r),a.push(e+2*f+1,e+2*r+1),void 0!==h){if(void 0!==p){const t=3*(e+2*p),i=3*(e+2*f),n=3*(e+2*r);u.set(s[i]-s[t],s[i+1]-s[t+1],s[i+2]-s[t+2]).normalize(),d.set(s[n]-s[i],s[n+1]-s[i+1],s[n+2]-s[i+2]).normalize(),u.dot(d)<=h&&a.push(e+2*f,e+2*f+1)}}else a.push(e+2*f,e+2*f+1);else a.push(e+f,e+r);p=f,f=r}f=g+1,m=void 0,p=void 0}}addWalls(e,t,i,n,r,s){let o,a=0,l=0;for(;a<t;){for(;a!==o;){void 0===o&&(o=a),a<t&&(l=Math.max(l,a));const c=r[a*i+n+1];if(c<0)break;s.push(e+2*a,e+2*a+1,e+2*c+1,e+2*c+1,e+2*c,e+2*a),a=c}a=l+1,o=void 0}}findRelativePositionInLine(e,t){let i=1/0,n=0;for(let r=0;r<t.length;
950r+=4){U.set(D.set(t[r],t[r+1],t[r+2]),O.set(t[r+4],t[r+5],t[r+6])),U.closestPointToPoint(e,!0,I);const s=I.distanceTo(e);s<i&&(F.copy(I),V.copy(D),i=s,n=t[r+3])}return n+F.distanceTo(V)}}},3436:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VectorTileDataSource=void 0;const n=i(8152),r=i(2616),s=i(2344),o=i(8449),a=i(4342),l=i(9959),c=i(3123),h=a.LoggerManager.instance.create("VectorTileDataSource");function u(e){var t;if(e.dataProvider)return e.dataProvider;if(null!==(t=e.baseUrl)&&void 0!==t?t:e.url)return new c.OmvRestClient(e);throw new Error("OmvDataSource: missing url, baseUrl or dataProvider params")}let d=!1;const m="https://vector.hereapi.com/v2/vectortiles/base/mc",p={baseUrl:m,apiFormat:c.APIFormat.XYZOMV,layerNames:["tilezen"],authenticationMethod:{method:c.AuthenticationMethod.QueryString,name:"apikey"},copyrightInfo:[{id:"here.com",year:(new Date).getFullYear(),label:"HERE",link:"https://legal.here.com/terms"}]},f=new Map([[m,p]]);class g extends o.TileDataSource{constructor(e){var t,i,n,h,d,p,g;super(null!==(t=e.tileFactory)&&void 0!==t?t:new o.TileFactory(s.Tile),Object.assign({layerNames:null!==(i=e.layerNames)&&void 0!==i?i:["omv"],concurrentDecoderServiceName:null!==(n=e.concurrentDecoderServiceName)&&void 0!==n?n:l.VECTOR_TILE_DECODER_SERVICE_TYPE,minDataLevel:null!==(h=e.minDataLevel)&&void 0!==h?h:1,maxDataLevel:null!==(d=e.maxDataLevel)&&void 0!==d?d:17,storageLevelOffset:null!==(p=e.storageLevelOffset)&&void 0!==p?p:-1},function(e){var t;if(void 0===e.dataProvider&&void 0===e.url){const i=null!==(t=e.baseUrl)&&void 0!==t?t:m,n=Object.assign(Object.assign({},f.get(i)),e);return Object.assign(Object.assign({},n),{tilingScheme:r.webMercatorTilingScheme,dataProvider:new c.OmvRestClient(n)})}return Object.assign(Object.assign({},e),{tilingScheme:r.webMercatorTilingScheme,dataProvider:u(e)})}(e))),this.m_params=e,this.cacheable=!0,this.addGroundPlane=void 0===e.addGroundPlane||!0===e.addGroundPlane;let v=e.roundUpCoordinatesIfNeeded;void 0===v&&(null==e?void 0:e.baseUrl)===m&&(v=!0),this.m_decoderOptions={showMissingTechniques:!0===this.m_params.showMissingTechniques,gatherFeatureAttributes:!0===this.m_params.gatherFeatureAttributes,politicalView:this.m_params.politicalView,skipShortLabels:this.m_params.skipShortLabels,storageLevelOffset:null!==(g=e.storageLevelOffset)&&void 0!==g?g:-1,enableElevationOverlay:!0===this.m_params.enableElevationOverlay,roundUpCoordinatesIfNeeded:v},this.maxGeometryHeight=(0,a.getOptionValue)(e.maxGeometryHeight,r.EarthConstants.MAX_BUILDING_HEIGHT),this.minGeometryHeight=(0,a.getOptionValue)(e.minGeometryHeight,0)}async connect(){try{await super.connect()}catch(e){throw e.message&&n.WorkerServiceProtocol.isUnknownServiceError(e)&&!d&&(h.info("Unable to create decoder service in worker. Use 'OmvTileDecoderService.start();' in decoder script."),d=!0),"string"==typeof e?new Error(e):e}this.configureDecoder(void 0,this.m_decoderOptions)}shouldPreloadTiles(){return!0}setPoliticalView(e){e=null==e?void 0:e.toLowerCase(),this.m_decoderOptions.politicalView!==e&&(this.m_decoderOptions.politicalView=e,this.configureDecoder(void 0,{politicalView:void 0!==e?e:""}))}get storageLevelOffset(){return super.storageLevelOffset}set storageLevelOffset(e){super.storageLevelOffset=e,this.m_decoderOptions.storageLevelOffset=this.storageLevelOffset,this.configureDecoder(void 0,{storageLevelOffset:this.storageLevelOffset})}setEnableElevationOverlay(e){this.m_decoderOptions.enableElevationOverlay!==e&&(this.m_decoderOptions.enableElevationOverlay=e,this.configureDecoder(void 0,{enableElevationOverlay:e}))}configureDecoder(e,t){this.clearCache(),this.decoder.configure(e,t),this.isDetached()||this.mapView.markTilesDirty(this)}}t.VectorTileDataSource=g},1503:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VectorTileDecoderService=t.VectorTileDecoder=t.VectorTileDataProcessor=void 0;const n=i(7769),r=i(2626),s=i(4342),o=i(5156),a=i(2926),l=i(4585),c=i(9252),h=i(9959),u=i(1140),d=s.LoggerManager.instance.create("VectorTileDecoder",{enabled:!1});class m{constructor(e,t,i,n,r={}){var s,o;this.m_tileKey=e,this.m_projection=t,this.m_styleSetEvaluator=i,this.m_dataAdapter=n,this.m_options=r,r.storageLevelOffset=null!==(s=r.storageLevelOffset)&&void 0!==s?s:0,r.showMissingTechniques=null!==(o=r.showMissingTechniques)&&void 0!==o&&o}getDecodedTile(e){this.m_styleSetEvaluator.resetTechniques();const t=new c.DecodeInfo(this.m_projection,this.m_tileKey,this.m_options.storageLevelOffset);return this.m_decodedTileEmitter=new u.VectorTileDataEmitter(t,this.m_styleSetEvaluator,this.m_options),this.m_dataAdapter.process(e,t,this),this.m_decodedTileEmitter.getDecodedTile()}
950processPointFeature(e,t,i,n,r){(0,s.assert)(void 0!==this.m_decodedTileEmitter),this.processFeature(e,t,i,"point",n,r,this.m_decodedTileEmitter.processPointFeature)}processLineFeature(e,t,i,n,r){(0,s.assert)(void 0!==this.m_decodedTileEmitter),this.processFeature(e,t,i,"line",n,r,this.m_decodedTileEmitter.processLineFeature)}processPolygonFeature(e,t,i,n,r){(0,s.assert)(void 0!==this.m_decodedTileEmitter),this.processFeature(e,t,i,"polygon",n,r,this.m_decodedTileEmitter.processPolygonFeature)}processFeature(e,t,i,n,r,s,o){const a=this.createMapEnv(r,s,e,n),l=this.m_styleSetEvaluator.getMatchingTechniques(a,e,n);if(0===l.length)return void(this.m_options.showMissingTechniques&&d.log("VectorTileDataProcessor#processFeature: no techniques for object:",JSON.stringify(a.unmap())));const c={env:a,cachedExprResults:new Map};this.m_decodedTileEmitter&&o.apply(this.m_decodedTileEmitter,[e,t,i,c,l])}createMapEnv(e,t,i,r){const s=this.m_tileKey.level;return new n.MapEnv(Object.assign(Object.assign({$layer:i,$id:null!=t?t:null,$level:s,$zoom:Math.max(0,s-this.m_options.storageLevelOffset),$geometryType:r},this.getLocalizedNames(e)),e))}getLocalizedNames(e){var t,i;const[n,r]=null!==(i=null===(t=this.m_options.languages)||void 0===t?void 0:t.map((t=>e[`name:${t}`])))&&void 0!==i?i:[];return{"$localized-name":null!=n?n:e.name,"$secondary-localized-name":r}}}t.VectorTileDataProcessor=m;class p extends r.ThemedTileDecoder{constructor(e){super(),this.m_dataAdapter=e,this.m_options={map:{},changed:!1},this.m_defaultDataAdapters=[],this.m_defaultDataAdapters.push(new l.OmvDataAdapter,new a.GeoJsonVtDataAdapter,new o.GeoJsonDataAdapter)}connect(){return Promise.resolve()}decodeThemedTile(e,t,i,n){const r=s.PerformanceTimer.now();if(!this.m_dataAdapter&&(this.m_dataAdapter=this.findDefaultDataAdapter(e),!this.m_dataAdapter))return Promise.reject(new Error("Unsupported data format."));const o=this.m_dataAdapter;if((0,s.assert)(o.canProcess(e)),this.m_options.changed){if(o instanceof l.OmvDataAdapter){const e=this.m_options.map;o.configure(e)}this.m_options.changed=!1}const a=new m(t,n,i,o,this.m_options.map).getDecodedTile(e);return a.decodeTime=s.PerformanceTimer.now()-r,Promise.resolve(a)}configure(e,t){super.configure(e,t),this.m_options.map=Object.assign(Object.assign(Object.assign({},this.m_options.map),e),t),this.m_options.changed=!0}findDefaultDataAdapter(e){for(const t of this.m_defaultDataAdapters)if(t.canProcess(e))return t}}t.VectorTileDecoder=p,t.VectorTileDecoderService=class{static start(){r.WorkerServiceManager.getInstance().register({serviceType:h.VECTOR_TILE_DECODER_SERVICE_TYPE,factory:e=>r.TileDecoderService.start(e,new p)})}}},2926:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GeoJsonVtDataAdapter=void 0;const n=i(82),r=i(2616),s=i(6441),o=4096;var a;!function(e){e[e.Unknown=0]="Unknown",e[e.Point=1]="Point",e[e.LineString=2]="LineString",e[e.Polygon=3]="Polygon"}(a||(a={}));const l=new n.Vector3;t.GeoJsonVtDataAdapter=class{canProcess(e){if((0,s.isArrayBufferLike)(e))return!1;const t=e;return void 0!==t.features&&void 0!==t.source&&void 0!==t.x&&void 0!==t.y&&void 0!==t.z}process(e,t,i){for(const c of e.features)switch(c.type){case a.Point:for(const t of c.geometry){const r=t[0],s=t[1],a=new n.Vector3(r,s,0);i.processPointFeature(e.layer,o,[a],c.tags,c.id)}break;case a.LineString:{const a=c.geometry;let h;const u=[];a.forEach((e=>{const t=null==h?void 0:h.positions[h.positions.length-1],[i,r]=e[0];if((null==t?void 0:t.x)===i&&(null==t?void 0:t.y)===r)for(let t=1;t<e.length;++t){const[i,r]=e[t];null==h||h.positions.push(new n.Vector2(i,r))}else{const t=e.map((([e,t])=>new n.Vector2(e,t)));u.push({positions:t}),h=u[u.length-1]}})),u.forEach((e=>{e.untiledPositions=e.positions.map((e=>((0,s.tile2world)(o,t,e,!1,l),r.webMercatorProjection.unprojectPoint(l))))})),i.processLineFeature(e.layer,o,u,c.tags,c.id);break}case a.Polygon:{const t=[];let r;for(const e of c.geometry){const i=[];for(const[t,r]of e){const e=new n.Vector2(t,r);i.push(e)}n.ShapeUtils.area(i)>0&&(r={rings:[]},t.push(r)),null==r||r.rings.push(i)}i.processPolygonFeature(e.layer,o,t,c.tags,c.id);break}case a.Unknown:}}}}
950,5156:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GeoJsonDataAdapter=void 0;const n=i(82),r=i(6112),s=i(2616),o=i(6441),a=4096,l=new n.Vector3;function c(e,t,i){return s.webMercatorProjection.projectPoint(s.GeoCoordinates.fromGeoPoint(e),l),(0,o.world2tile)(a,t,l,!1,i)}function h(e,t){return{untiledPositions:e.map((e=>s.GeoCoordinates.fromGeoPoint(e))),positions:e.map((e=>c(e,t,new n.Vector2)))}}function u(e,t){return"LineString"===e.type?[h(e.coordinates,t)]:e.coordinates.map((e=>h(e,t)))}function d(e,t){return{rings:e.map(((e,i)=>{const r=0===i,{positions:s}=h(e,t),o=n.ShapeUtils.area(s)>0;return(r&&!o||!r&&o)&&s.reverse(),s}))}}function m(e,t){return"Polygon"===e.type?[d(e.coordinates,t)]:e.coordinates.map((e=>d(e,t)))}function p(e,t){return"Point"===e.type?[c(e.coordinates,t,new n.Vector3)]:e.coordinates.map((e=>c(e,t,new n.Vector3)))}t.GeoJsonDataAdapter=class{canProcess(e){return e&&"FeatureCollection"===e.type&&Array.isArray(e.features)}process(e,t,i,n="geojson"){if(Array.isArray(e.features)&&0!==e.features.length)for(const s of e.features)switch(s.geometry.type){case"LineString":case"MultiLineString":{let e=u(s.geometry,t);const o=[],l=100;e.forEach((e=>{(0,r.clipLineString)(e.positions,-l,-l,a+l,a+l).forEach((e=>{o.push({positions:e})}))})),e=o,e.length>0&&i.processLineFeature(n,a,o,s.properties,s.id);break}case"Polygon":case"MultiPolygon":{const e=m(s.geometry,t);i.processPolygonFeature(n,a,e,s.properties,s.id);break}case"Point":case"MultiPoint":{const e=p(s.geometry,t);i.processPointFeature(n,a,e,s.properties,s.id);break}}}}},9607:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GeometryCommands=t.FeatureAttributes=t.visitOmvLayer=t.visitOmv=t.isClosePathCommand=t.isLineToCommand=t.isMoveToCommand=t.CommandKind=void 0;const n=i(82),r=i(3577);var s;function o(e,t){if((!t.visitLayer||t.visitLayer(e))&&e.features)for(const i of e.features)switch(i.type){case r.com.mapbox.pb.Tile.GeomType.UNKNOWN:break;case r.com.mapbox.pb.Tile.GeomType.POINT:t.visitPointFeature&&t.visitPointFeature(i);break;case r.com.mapbox.pb.Tile.GeomType.LINESTRING:t.visitLineFeature&&t.visitLineFeature(i);break;case r.com.mapbox.pb.Tile.GeomType.POLYGON:t.visitPolygonFeature&&t.visitPolygonFeature(i)}t.endVisitLayer&&t.endVisitLayer(e)}!function(e){e[e.MoveTo=1]="MoveTo",e[e.LineTo=2]="LineTo",e[e.ClosePath=7]="ClosePath"}(s=t.CommandKind||(t.CommandKind={})),t.isMoveToCommand=function(e){return e.kind===s.MoveTo},t.isLineToCommand=function(e){return e.kind===s.LineTo},t.isClosePathCommand=function(e){return e.kind===s.ClosePath},t.visitOmv=function(e,t){if(e.layers)for(const i of e.layers)t.visitLayer&&!t.visitLayer(i)||o(i,t),t.endVisitLayer&&t.endVisitLayer(i)},t.visitOmvLayer=o,t.FeatureAttributes=class{accept(e,t,i){const{keys:n,values:r}=e,s=t.tags;if(s&&n&&r)for(let e=0;e<s.length;e+=2){const t=n[s[e]],o=r[s[e+1]];if(!i.visitAttribute(t,o))break}}},t.GeometryCommands=class{accept(e,t){if(!e)return;const i=e.length;let r=0,o=0;const a=[],l=[],c=[];for(let h=0;h<i;){const i=7&e[h],u=e[h]>>3;if(++h,i===s.MoveTo||i===s.LineTo)for(let s=0;s<u;++s){const s=e[h++],u=e[h++];r+=s>>1^-(1&s),o+=u>>1^-(1&u),"Polygon"===t.type&&(a.push(r),l.push(o));const d=new n.Vector2(r,o);c.push({kind:i,position:d})}else{for(const e of c)t.visitCommand(e);t.visitCommand({kind:i}),a.length=0,l.length=0,c.length=0}}if(c.length>0)for(const e of c)t.visitCommand(e)}}},4585:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OmvDataAdapter=t.asGeometryType=void 0;const n=i(5133),r=i(82),s=i(7769),o=i(4342),a=i(9959),l=i(7305),c=i(6441),h=i(9607),u=i(3577),d=["stringValue","floatValue","doubleValue","intValue","uintValue","sintValue","boolValue"],m=o.LoggerManager.instance.create("OmvDataAdapter",{enabled:!1}),p=n.fromNumber(Number.MAX_SAFE_INTEGER,!0),f=n.fromNumber(Number.MIN_SAFE_INTEGER,!1);function g(e,t,i){if(void 0!==t.id&&null!==t.id)return t.id;if(e.hasOwnProperty("id")){const t=e.id;if("number"==typeof t)return t;if(t)return void 0!==i&&t.greaterThan(Number.MAX_SAFE_INTEGER)&&i.error("Invalid ID: Larger than largest available Number in feature: ",e),t.toNumber()}}function v(e){if(void 0===e)return a.OmvGeometryType.UNKNOWN;switch(e.type){case u.com.mapbox.pb.Tile.GeomType.UNKNOWN:return a.OmvGeometryType.UNKNOWN;case u.com.mapbox.pb.Tile.GeomType.POINT:return a.OmvGeometryType.POINT;case u.com.mapbox.pb.Tile.GeomType.LINESTRING:return a.OmvGeometryType.LINESTRING;
950case u.com.mapbox.pb.Tile.GeomType.POLYGON:return a.OmvGeometryType.POLYGON;default:return a.OmvGeometryType.UNKNOWN}}function y(e,t){e.forEach((e=>{e.x===t-1&&(e.x=t)}))}t.asGeometryType=v,t.OmvDataAdapter=class{constructor(){this.m_geometryCommands=new h.GeometryCommands,this.m_roundUpCoordinatesIfNeeded=!1}configure(e){var t;const i=e.politicalView;this.m_dataFilter=void 0,this.m_featureModifiers=[new l.OmvPoliticalViewFeatureModifier(null!=i?i:"")],this.m_roundUpCoordinatesIfNeeded=null!==(t=e.roundUpCoordinatesIfNeeded)&&void 0!==t&&t}canProcess(e){return(0,c.isArrayBufferLike)(e)}process(e,t,i){const{tileKey:n}=t,r=new Uint8Array(e),s=u.com.mapbox.pb.Tile.decode(r);this.m_tileKey=n,this.m_processor=i,(0,h.visitOmv)(s,this)}visitLayer(e){this.m_layer=e;const t=this.m_tileKey.level,i=e.name;return!(void 0!==this.m_dataFilter&&!this.m_dataFilter.wantsLayer(i,t))}visitPointFeature(e){var t;if(void 0===e.geometry)return;const i=this.filterAndModifyFeature(e,"doProcessPointFeature","wantsPointFeature");if(!i)return;const n=this.m_layer.name,s=null!==(t=this.m_layer.extent)&&void 0!==t?t:4096,o=[];this.m_geometryCommands.accept(e.geometry,{type:"Point",visitCommand:e=>{(0,h.isMoveToCommand)(e)&&o.push(new r.Vector3(e.position.x,e.position.y,0))}}),0!==o.length&&this.m_processor.processPointFeature(n,s,o,i,g(e,i,m))}visitLineFeature(e){var t;if(void 0===e.geometry)return;const i=this.filterAndModifyFeature(e,"doProcessLineFeature","wantsLineFeature");if(!i)return;const n=this.m_layer.name,r=null!==(t=this.m_layer.extent)&&void 0!==t?t:4096,s=[];let o;this.m_geometryCommands.accept(e.geometry,{type:"Line",visitCommand:e=>{(0,h.isMoveToCommand)(e)?(o=[e.position],s.push({positions:o})):(0,h.isLineToCommand)(e)&&o.push(e.position)}}),0!==s.length&&(this.mustRoundUpCoordinates&&function(e,t){e.forEach((e=>y(e.positions,t)))}(s,r),this.m_processor.processLineFeature(n,r,s,i,g(e,i,m)))}visitPolygonFeature(e){var t;if(void 0===e.geometry)return;const i=this.filterAndModifyFeature(e,"doProcessPolygonFeature","wantsPolygonFeature");if(!i)return;const n=this.m_layer.name,s=null!==(t=this.m_layer.extent)&&void 0!==t?t:4096,o=[];let a,l,c;this.m_geometryCommands.accept(e.geometry,{type:"Polygon",visitCommand:e=>{if((0,h.isMoveToCommand)(e))l=[e.position];else if((0,h.isLineToCommand)(e))l.push(e.position);else if((0,h.isClosePathCommand)(e)&&void 0!==l&&l.length>0){const e=Math.sign(r.ShapeUtils.area(l));void 0===c&&(c=e),e===c&&(a={rings:[]},o.push(a)),l.push(l[0].clone()),null==a||a.rings.push(l)}}}),0!==o.length&&(this.mustRoundUpCoordinates&&function(e,t){e.forEach((e=>e.rings.forEach((e=>y(e,t)))))}(o,s),function(e){const t=e[0];if(void 0!==t&&0!==t.rings.length&&!(r.ShapeUtils.area(t.rings[0])>0))for(const t of e)for(const e of t.rings)e.reverse()}(o),this.m_processor.processPolygonFeature(n,s,o,i,g(e,i,m)))}filterAndModifyFeature(e,t,i){const r=this.m_tileKey.level,o=this.m_layer.name,a=v(e);if(this.m_dataFilter&&!1===this.m_dataFilter[i](o,a,r))return;const l=function(e,t){const i=new h.FeatureAttributes,r={};return i.accept(e,t,{visitAttribute:(e,t)=>(r[e]=function(e){const t=Object.prototype.hasOwnProperty;for(const i of d)if(t.call(e,i)){const t=e[i];if(void 0===t)throw new Error("unpexted undefined value");return n.isLong(t)?t.comp(p)>0||t.comp(f)<0?t.toString():t.toNumber():t}throw new Error("not happening")}(t),!0)}),r}(this.m_layer,e),c=new s.MapEnv(l);return this.m_featureModifiers&&this.m_featureModifiers.find((e=>!e[t](o,c,this.m_tileKey.level)))?void 0:l}get mustRoundUpCoordinates(){return this.m_roundUpCoordinatesIfNeeded&&this.m_tileKey.level<5&&this.m_tileKey.column===this.m_tileKey.columnCount()-1}}},9330:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WebTileDataSource=void 0;const n=i(5185),r=i(2616),s=i(2344),o=i(1984),a=i(4342),l=i(1527);class c extends s.DataSource{constructor(e){var t,i,n,r,s,o;super(e),this.m_options=e,this.m_opacity=1,this.m_renderOrder=0,this.m_transparent=!1,this.dataProvider=this.m_options.dataProvider,this.cacheable=!0,this.m_opacity=null!==(i=null===(t=this.m_options.renderingOptions)||void 0===t?void 0:t.opacity)&&void 0!==i?i:1,this.m_transparent=!0===(null===(n=this.m_options.renderingOptions)||void 0===n?void 0:n.transparent)||this.m_opacity<1,this.m_renderOrder=null!==(s=null===(r=this.m_options.renderingOptions)||void 0===r?void 0:r.renderOrder)&&void 0!==s?s:0,this.m_resolution=(0,a.getOptionValue)(e.resolution,c.resolutionValue.resolution512),this.layerNames=null!==(o=e.layerNames)&&void 0!==o?o:["raster"]}set opacity(e){var t;this.m_opacity=e,this.m_opacity<1?this.m_transparent=!0:!0!==(null===(t=this.m_options.renderingOptions)||void 0===t?void 0:t.transparent)&&(this.m_transparent=!1)}get opacity(){return this.m_opacity}get resolution(){return this.m_resolution}get renderOrder(){return this.m_renderOrder}
950get transparent(){return this.m_transparent}get technique(){return this.m_technique}shouldPreloadTiles(){return!0}getTilingScheme(){return r.webMercatorTilingScheme}getTile(e){const t=new s.Tile(this,e);return t.tileLoader=new l.WebTileLoader(this,t,this.dataProvider),t}isFullyCovering(){return!this.m_transparent}async setTheme(e,t){e=await s.ThemeLoader.load(e,{baseUrl:t});const i=(0,o.getStyles)(e.styles).filter((e=>{var t;return!e.layer||(null===(t=this.layerNames)||void 0===t?void 0:t.includes(e.layer))}));if(i.length>0){this.m_styleSetEvaluator=new n.StyleSetEvaluator({styleSet:i,definitions:e.definitions,priorities:e.priorities,labelPriorities:e.labelPriorities});const t=this.m_styleSetEvaluator.getMatchingTechniques(this.mapView.env);if(0===t.length)return;const r=t[t.length-1];(0,o.isRasterTechnique)(r)&&(this.m_technique=r)}}}t.WebTileDataSource=c,function(e){let t,i;!function(e){e[e.ppi72=72]="ppi72",e[e.ppi250=250]="ppi250",e[e.ppi320=320]="ppi320",e[e.ppi500=500]="ppi500"}(t=e.ppiValue||(e.ppiValue={})),function(e){e[e.resolution256=256]="resolution256",e[e.resolution512=512]="resolution512"}(i=e.resolutionValue||(e.resolutionValue={}))}(c=t.WebTileDataSource||(t.WebTileDataSource={}))},1527:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WebTileLoader=void 0;const n=i(82),r=i(8152),s=i(2344),o=i(8024),a=i(176),l=i(4250);class c extends s.BaseTileLoader{constructor(e,t,i){super(e,t.tileKey),this.dataSource=e,this.tile=t,this.dataProvider=i}loadImpl(e,t,i){this.dataProvider.getTexture(this.tile,e).then((e=>{if(void 0===e||void 0===e[0])return this.tile.forceHasGeometry(!0),void t(s.TileLoaderState.Ready);const[i,c]=e;void 0!==c&&(this.tile.copyrightInfo=c),i.minFilter=n.LinearFilter,i.magFilter=n.LinearFilter,i.generateMipmaps=!1,this.tile.clear();const h=(0,o.addGroundPlane)(this.tile,this.dataSource.renderOrder,16777215,this.dataSource.opacity,!0).material;(0,l.hasColorCorrectionFeature)(h)&&a.MapMaterialAdapter.create(h,{brightness:()=>{var e,t;const i=null!==(t=(0,r.getPropertyValue)(null===(e=this.dataSource.technique)||void 0===e?void 0:e.brightness,this.dataSource.mapView.env))&&void 0!==t?t:l.ColorCorrectionFeature.DEFAULT_BRIGHTNESS;return parseFloat(i).toFixed(3)},gamma:()=>{var e,t;const i=null!==(t=(0,r.getPropertyValue)(null===(e=this.dataSource.technique)||void 0===e?void 0:e.gamma,this.dataSource.mapView.env))&&void 0!==t?t:l.ColorCorrectionFeature.DEFAULT_GAMMA;return parseFloat(i).toFixed(3)}}),i.encoding=n.LinearEncoding,h.map=i,this.dataSource.transparent&&(0,l.enableBlending)(h),h.depthTest=!1,this.tile.invalidateResourceInfo(),this.dataSource.requestUpdate(),t(s.TileLoaderState.Ready)}),i).catch(i)}}t.WebTileLoader=c},9636:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Style=void 0;const n=i(6586);class r extends H.map.render.Style{constructor(e){super(e),this.m_abortController=new AbortController,"string"!=typeof e?this.setConfig(Object.assign({},e)):this.m_url=new URL(e,location.href).href,this.m_baseUrl="string"==typeof this.m_url?this.m_url:location.href,this.setState(H.map.render.Style.State.INIT)}getUrl(){return this.m_url}getBaseUrl(){return this.m_baseUrl}load(){this.loadAsync(!1,!1)}cancelLoad(){this.getState()===H.map.render.Style.State.LOADING&&(this.m_abortController.abort("Style load cancelled"),this.setState(H.map.render.Style.State.INIT))}setFeaturesEnabledByDefault(){const e=this.getConfig();if(void 0!==(null==e?void 0:e.features)){const t=[];for(const i in e.features)e.features[i].enabledByDefault&&t.push({feature:i,mode:e.features[i].modes[0].name});this.m_enabledFeatures=t}else this.m_enabledFeatures=void 0}async loadAsync(e,t){if(!t||this.getState()!==H.map.render.Style.State.READY){if(this.getState()===H.map.render.Style.State.LOADING)return await this.m_loadPromise.then((()=>{})).catch((()=>{}));if(void 0!==this.m_url){const t=H.getStylePath()+"/harp/";this.setState(H.map.render.Style.State.LOADING),this.m_abortController=new AbortController;const i=this.m_abortController.signal;try{this.m_loadPromise=n.load(this.m_url,{baseUrl:t,signal:i});const r=await this.m_loadPromise;this.setConfig(r),this.setState(H.map.render.Style.State.READY),this.setFeaturesEnabledByDefault(),e||this.dispatchChangeEvent()}catch(e){(null==i?void 0:i.aborted)||(this.setState(H.map.render.Style.State.ERROR),this.dispatchError(e))}}else this.setState(H.map.render.Style.State.READY),this.setFeaturesEnabledByDefault(),e||this.dispatchChangeEvent()}}setEnabledFeatures(e){const t=Object.assign({},this.m_enabledFeatures);if(void 0!==e){if(new Set(e.map((e=>e.feature))).size!==e.length)throw new H.lang.InvalidArgumentError(this.setEnabledFeatures,0,"The list of features to enable should not contain duplicates.");this.m_enabledFeatures=e}
950else this.getState()===H.map.render.Style.State.READY&&this.setFeaturesEnabledByDefault();this.dispatchChangeEvent({enabledFeatures:this.m_enabledFeatures},{enabledFeatures:t})}getEnabledFeatures(){return this.m_enabledFeatures}disposeInternal(){super.disposeInternal(),this.cancelLoad()}dispatchChangeEvent(e,t){this.dispatchEvent(new H.util.ChangeEvent("change",e,t))}}t.Style=r},159:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ImageLoader=void 0,t.ImageLoader=class{constructor(e){this.mapView=e,this.m_textureReferenceCounts=new Map,this.m_tilesWithRefs=new Set}setImageReferences(e,t=[]){this.m_textureReferenceCounts.forEach(((i,n)=>{t.includes(n)||i.delete(e)&&0===i.size&&(this.mapView.imageRepo.imageCache.removeImage(this,n),this.m_textureReferenceCounts.delete(n))})),t.forEach((t=>{const i=this.m_textureReferenceCounts.get(t);void 0!==i?i.add(e):this.m_textureReferenceCounts.set(t,new Set([e]))})),t.length?this.m_tilesWithRefs.add(e):this.m_tilesWithRefs.delete(e)}releaseImageReferences(e){this.m_tilesWithRefs.has(e)&&this.setImageReferences(e)}dispose(){this.m_textureReferenceCounts.forEach(((e,t)=>{this.mapView.imageRepo.imageCache.removeImage(this,t)})),this.m_textureReferenceCounts.clear()}load(e,t){void 0===this.mapView.imageRepo.imageCache.findImage(e)&&this.mapView.imageRepo.imageCache.registerImageByUrl(this,e,t)}}},7564:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LayeredGeoJsonDataAdapter=void 0;const n=i(5156);t.LayeredGeoJsonDataAdapter=class{constructor(){this.m_geoJsonDataAdapter=new n.GeoJsonDataAdapter}canProcess(e){return!0}process(e,t,i){"FeatureCollection"===e.data.type&&(e.data={geojson:e.data});const n=e.data;for(const e in n){const r=n[e];this.m_geoJsonDataAdapter.canProcess(r)&&this.m_geoJsonDataAdapter.process(r,t,i,e)}}}},1881:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LocalObjectDataAdapter=t.DEFAULT_BORDER=t.DEFAULT_EXTENTS=t.MAX_LINE_WIDTH=void 0;const n=i(2616),r=i(4342),s=i(7316),o=i(82),a=i(6441),l=i(5432),c=i(6112),h=r.LoggerManager.instance.create("harp::LocalObjectDataAdapter");t.MAX_LINE_WIDTH=100,t.DEFAULT_EXTENTS=4096,t.DEFAULT_BORDER=t.DEFAULT_EXTENTS*t.MAX_LINE_WIDTH/512;t.LocalObjectDataAdapter=class{canProcess(e){return"object"==typeof e&&"markers"in e&&"spatials"in e&&"overlays"in e}process(e,t,i){this.processMarkers(e.markers,t,i),this.processSpatials(e.spatials,t,i),this.processOverlays(e.overlays,t,i)}processMarkers(e,i,n){e.forEach(((e,r)=>{var o;const a=(0,s.getMarkerProperties)(e);if(null!==a){a.zOrder=null!==(o=e.getZIndex())&&void 0!==o?o:r;const s=e.getGeometry();let l,c=a.id;s instanceof H.geo.Point?l=[p(s,i)]:(c=void 0,l=s.getGeometries().map((e=>p(e,i)))),n.processPointFeature("markers",t.DEFAULT_EXTENTS,l,a,c)}}))}processSpatials(e,i,o){const a="spatials";e.forEach(((e,l)=>{var c;const h={id:e.getId(),minZoom:e.getMin(!0),maxZoom:e.getMax(!0)+1,zOrder:l,volatile:e.getVolatility()},u=null!==(c=e.getStyle().lineWidth)&&void 0!==c?c:0;Object.assign(h,(0,s.getSpatialProperties)(e));const d=e.getId();if(e instanceof H.map.Polygon){const s=e.getElevation(),l=e.getExtrusion();if(h.min_height=s,h.height=s+l,h.height>0){h.lineWidth=r.MathUtils.clamp(u,0,1);const t=i.targetProjection;if(t.type===n.ProjectionType.Planar&&(h.constantHeight=h.height>2e3,!0===h.constantHeight)){const{lat:i,lng:n}=e.getBoundingBox().getCenter(),r=t.projectPoint({latitude:i,longitude:n}),s=t.getScaleFactor(r);h.min_height*=s,h.height*=s}}const c=function(e,t){if(e instanceof H.geo.MultiPolygon){const i=[],n=e.getGeometries();for(const e of n){const n=y(e,t);i.push(...n)}return i}return y(e,t)}(e.getGeometry(),i);o.processPolygonFeature(a,t.DEFAULT_EXTENTS,c,h,d)}else{const n=function(e,t){if(e instanceof H.geo.MultiLineString){const i=[];for(const n of e.getGeometries())i.push(...v(n,t));return i}return v(e,t)}(e.getGeometry(),i);n.length>0&&o.processLineFeature(a,t.DEFAULT_EXTENTS,n,h,d)}}))}processOverlays(e,i,n){e.forEach(((e,r)=>{const s=e.getGeometry().getBoundingBox(),o={id:e.getId(),minZoom:e.getMin(!0),maxZoom:e.getMax(!0)+1,zOrder:r,opacity:e.getOpacity(),min_height:0,height:0,volatile:e.getVolatility(),bbox:[s.getLeft(),s.getBottom(),s.getRight(),s.getTop()]},a=e.getBitmap();if(null===a)return;if(a instanceof HTMLImageElement)o.map=a.src;else{const e=a.getContext("2d");if(null===e)return void h.error("Cannot get context from canvas");o.map={buffer:e.getImageData(0,0,a.width,a.height).data.buffer,type:"image/raw",dataTextureProperties:{width:a.width,height:a.height}}}const l=y(H.geo.Polygon.fromRect(e.getGeometry()),i);n.processPolygonFeature("overlays",t.DEFAULT_EXTENTS,l,o,e.getId())}))}};const u=new o.Vector3,d=new n.GeoCoordinates(0,0);function m(e,i,r=new o.Vector3){return(0,a.world2tile)(t.DEFAULT_EXTENTS,i,n.webMercatorProjection.projectPoint(e,u),!1,r)}function p(e,t,i=new o.Vector3){return d.latitude=e.lat,d.longitude=e.lng,d.altitude=e.alt,m(d,t,i)}function f(e,t){const i=e.getLatLngAltArray(),n=[];for(let e=0;e<i.length;e+=3)d.latitude=i[e],d.longitude=i[e+1],d.altitude=i[e+2],n.push(m(d,t,new o.Vector2));return n}function g(e,t,i=!1){return e.map((e=>(d.longitude=e[0],d.latitude=e[1],d.altitude=e[2],m(d,t,new o.Vector2))))}function v(e,i){let n;if((0,l.isCrossingAntimeridian)(e)){const t=[];(0,l.wrapGeoLineString)(e,t),n=t.map((e=>g(e,i)))}else n=[f(e,i)];const r=[];for(const e of n){const i=(0,c.clipLineString)(e,-t.DEFAULT_BORDER,-t.DEFAULT_BORDER,t.DEFAULT_EXTENTS+t.DEFAULT_BORDER,t.DEFAULT_EXTENTS+t.DEFAULT_BORDER);for(const e of i)r.push({positions:H.math.simplifyDP(e,5)})}return r}function y(e,t){if((0,l.isCrossingAntimeridian)(e)){const i=[];return(0,l.wrapGeoPolygon)(e,i),i.map((e=>({rings:e.map((e=>g(e,t)))})))}{const i=e.getExterior(),n=e.getInteriors(),r=[],s=f(i,t);let a=o.ShapeUtils.area(s)>0;a||s.reverse(),r.push(s);for(const e of n){const i=f(e,t);a=o.ShapeUtils.area(i)>0,a&&i.reverse(),r.push(i)}return[{rings:r}]}}},9049:(e,t,i)=>{"use strict";
950Object.defineProperty(t,"__esModule",{value:!0}),t.LocalObjectDataProvider=void 0;const n=i(82),r=i(2730),s=i(1881),o=i(3261),a=new n.Box3,l=1/s.DEFAULT_EXTENTS;function c(e,t){return H.map.Object.compareZInfo(e.getZInfo(),t.getZInfo(),!1)}class h extends o.ObjectDataProvider{constructor(e){super(e),this.provider=e}async getTile(e,t){const i=this.m_tilingScheme.getGeoBox(e),n=(0,r.getClampedGeoRect)(i,e),s=(0,r.getClampedGeoRect)(u(this.m_tilingScheme,this.m_tilingScheme.getWorldBox(e,a),.1),e),o=(0,r.getClampedGeoRect)(u(this.m_tilingScheme,this.m_tilingScheme.getWorldBox(e,a),l),e);return{markers:this.provider.providesMarkers()?this.fetchMarkers(e,o):[],spatials:this.provider.providesSpatials()?this.fetchSpatials(e,s):[],overlays:this.provider.providesOverlays()?this.fetchOverlays(n):[]}}fetchMarkers(e,t){const i=[],n=[],r=this.getMarkerImageLoader(),s=this.provider.requestMarkers(t,void 0,!0,!1);for(const e of s){const t=e.getIcon();if(t.getState()===H.map.Icon.State.READY){const s=`H-icon-${t.uid}`;n.push(s),r.load(s,t.getBitmap()),i.push(e)}}return r.setImageReferences(e,n),i.sort(c),i}fetchSpatials(e,t){const i=this.provider.requestSpatials(t,void 0,!0,!1),n=[],r=this.getSpatialImageLoader();for(const e of i){const t=e.getStyle().lineDashImage;if(void 0!==t){const i=`H-lineDashImage-${e.getId()}`;n.push(i),r.load(i,t)}}return r.setImageReferences(e,n),i.sort(c)}fetchOverlays(e){return this.provider.requestOverlays(e,void 0,!0,!1).sort(c)}}function u(e,t,i){const r=new n.Vector3,s=t.getSize(r).multiplyScalar(i);return s.z=0,t.expandByVector(s),e.projection.unprojectBox(t)}t.LocalObjectDataProvider=h},2497:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LocalObjectDataSource=void 0;const n=i(82),r=i(9049),s=i(1930),o=i(9310),a=i(1881),l=i(1503),c=i(2730),h=i(8124),u=i(4262),d=new n.Box3;class m extends o.ObjectDataSource{constructor(e,t){super(Object.assign(Object.assign({},e),{dataProvider:new r.LocalObjectDataProvider(t),tileFactory:new s.TileFactory(o.ObjectTile),addGroundPlane:!1,gatherFeatureAttributes:!0,decoder:new l.VectorTileDecoder(new a.LocalObjectDataAdapter)}),t),this.provider=t,this.m_invalidateAllTiles=!1,this.m_synced_at=H.map.provider.Invalidations.MARK_INITIAL,this.m_affectedBoundingBox=new n.Box3,this.m_affectedBoundingBoxNextWorld=new n.Box3,this.m_objects=new Map}getMapObjectById(e){return this.m_objects.get(e)}attach(e){super.attach(e),this.provider instanceof H.map.provider.LocalObjectProvider&&this.provider.getRootGroup().getObjects(!0).forEach((e=>{this.m_objects.set(e.getId(),e)}))}detach(e){this.m_objects.forEach(((e,t)=>{e.getVolatility()&&(e instanceof H.map.Overlay?this.mapView.removeDynamicProperty(p(e)):e instanceof H.map.GeoShape&&this.removeStyleDynamicProps(e.getId()))})),super.detach(e)}setStyleDynamicProps(e,t){f.forEach((i=>this.mapView.setDynamicProperty(g(i,t),e[i])))}removeStyleDynamicProps(e){f.forEach((t=>this.mapView.removeDynamicProperty(g(t,e))))}dispose(){this.m_objects.clear(),super.dispose()}invalidateTiles(){const e=this.m_affectedBoundingBox.isEmpty();this.m_invalidateAllTiles||e?this.mapView.markTilesDirty(this):e||this.mapView.markTilesDirty(this,(e=>this.isTileAffected(e))),this.m_affectedBoundingBox.makeEmpty(),this.m_affectedBoundingBoxNextWorld.makeEmpty(),this.m_invalidateAllTiles=!1}isTileAffected(e){return this.getTilingScheme().getWorldBox(e.tileKey,d),d.expandByScalar(this.mapView.pixelToWorld*a.MAX_LINE_WIDTH),d.intersectsBox(this.m_affectedBoundingBox)||!this.m_affectedBoundingBoxNextWorld.isEmpty()&&d.intersectsBox(this.m_affectedBoundingBoxNextWorld)}onProviderUpdate(e){if(this.isDetached())return;if(e.target===this.provider)return this.m_invalidateAllTiles=!0,void this.invalidateTiles();const t=e.target,i=this.m_synced_at,r=e.currentTarget.getInvalidations(t.type);if(this.m_synced_at=r.getMark(),t instanceof H.map.Marker&&t.getIcon().getState()===H.map.Icon.State.READY||t instanceof H.map.GeoShape||t instanceof H.map.Overlay){if(r.isRemove(i)?(this.m_objects.delete(t.getId()),t.getVolatility()&&(t instanceof H.map.Overlay?this.mapView.removeDynamicProperty(p(t)):t instanceof H.map.GeoShape&&this.removeStyleDynamicProps(t.getId()))):this.m_objects.set(t.getId(),t),r.isSpatial(i))return this.m_invalidateAllTiles=!0,void this.invalidateTiles();if(t instanceof H.map.GeoShape&&!t.getVolatility()&&r.isVolatility(i)&&(0,u.default)((()=>this.removeStyleDynamicProps(t.getId())),this.invalidationDebounceTime,this.invalidationMaxTime),t.getVolatility()&&(r.isAdd(i)||r.isVisual(i)||r.isVolatility(i)))if(t instanceof H.map.Overlay){const e=p(t),i=t.getBitmap(),n=this.mapView.env.lookup(e);if(null!==i&&n!==i&&(this.mapView.setDynamicProperty(e,i),void 0!==n))return}else if(t instanceof H.map.GeoShape){const e=t.getStyle(),n=t.getId();if(this.setStyleDynamicProps(e,n),r.isVisual(i))return}if(!this.m_invalidateAllTiles){const e=t instanceof H.map.Marker||t instanceof H.map.Overlay?t.getGeometry().getBoundingBox():t.getBoundingBox(),i=(0,c.hGeoRectToHarpGeoBox)(e);this.getTilingScheme().projection.projectBox(i,d),this.m_affectedBoundingBox=this.m_affectedBoundingBox.union(d);const r=this.projection.unitScale;(this.m_affectedBoundingBox.max.x>r||this.m_affectedBoundingBox.min.x<0)&&(this.m_affectedBoundingBoxNextWorld=new n.Box3(this.m_affectedBoundingBox.min.clone().add(new n.Vector3(-r,0,0)),this.m_affectedBoundingBox.max.clone().add(new n.Vector3(-r,0,0))))}this.invalidateTilesWithDelay()}}}function p(e){return`${h.ObjectStyleBuilder.DYNAMIC_OVERLAY_PROP_PREFIX}${e.getId()}`}t.LocalObjectDataSource=m;const f=["fillColor","strokeColor","lineWidth"];function g(e,t){return`${e}:${t}`}},3261:(e,t,i)=>{"use strict";
950Object.defineProperty(t,"__esModule",{value:!0}),t.ObjectDataProvider=void 0;const n=i(8635);class r extends n.DataProvider{constructor(e){super(),this.provider=e}setTilingScheme(e){this.m_tilingScheme=e}setProjectionSource(e){this.m_projectionSource=e}getProjectionSource(){return this.m_projectionSource}setMarkerImageLoader(e){this.m_markerImageLoader=e}getMarkerImageLoader(){return this.m_markerImageLoader}setSpatialImageLoader(e){this.m_spatiaImageLoader=e}getSpatialImageLoader(){return this.m_spatiaImageLoader}async connect(){}dispose(){var e,t;null===(e=this.m_markerImageLoader)||void 0===e||e.dispose(),null===(t=this.m_spatiaImageLoader)||void 0===t||t.dispose()}ready(){return void 0!==this.m_markerImageLoader&&void 0!==this.m_spatiaImageLoader}}t.ObjectDataProvider=r},9310:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ObjectTile=t.ObjectDataSource=void 0;const n=i(159),r=i(1447),s=i(1930),o=i(3436),a=i(4262);class l extends o.VectorTileDataSource{constructor(e,t){super(Object.assign(Object.assign({},e),{tileFactory:new s.TileFactory(c),addGroundPlane:!1,layerNames:[`H-${t.uid}`],gatherFeatureAttributes:!0})),this.provider=t,this.m_tileInvalidationPending=!1,this.invalidationDebounceTime=100,this.invalidationMaxTime=200,this.isDisposed=!1,t.addEventListener("update",this.onProviderUpdate,!1,this),this.debounceTileInvalidation=(0,a.default)((()=>{this.m_tileInvalidationPending=!1,this.isDisposed||this.invalidateTiles()}),this.invalidationDebounceTime,this.invalidationMaxTime)}attach(e){super.attach(e);const t=this.dataProvider();t.setMarkerImageLoader(new n.ImageLoader(e)),t.setSpatialImageLoader(new n.ImageLoader(e)),t.setTilingScheme(this.getTilingScheme()),t.setProjectionSource(this)}dispose(){this.provider.removeEventListener("update",this.onProviderUpdate,!1,this),super.dispose(),this.isDisposed=!0}get tileInvalidationPending(){return this.m_tileInvalidationPending}invalidateTilesWithDelay(){this.m_tileInvalidationPending=!0,this.debounceTileInvalidation()}}t.ObjectDataSource=l;class c extends r.Tile{dispose(){super.dispose(),this.dataSource.dataProvider().getMarkerImageLoader().releaseImageReferences(this.tileKey)}get allGeometryLoaded(){return super.allGeometryLoaded&&!this.dataSource.tileInvalidationPending}}t.ObjectTile=c},8124:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ObjectStyleBuilder=void 0;const n=i(1984);class r{constructor(e){this.layerName=e,this.m_withVolatile=!1,this.m_withMarker=!1,this.m_withLine=!1,this.m_shouldClipLines=!1,this.m_withOverlay=!1,this.m_withPolygon=!1,this.m_withPolygonOutline=!0,this.m_withExtrudedPolygon=!1,this.m_withPolygonAlwaysPickable=!1}withVolatile(){return this.m_withVolatile=!0,this}withMarker(){return this.m_withMarker=!0,this}withLine(e=!1){return this.m_withLine=!0,this.m_shouldClipLines=e,this}withOverlay(){return this.m_withOverlay=!0,this}withPolygon(e=!1,t=!1,i=!1){return this.m_withPolygon=!0,this.m_withPolygonOutline=e,this.m_withExtrudedPolygon=t,this.m_withPolygonAlwaysPickable=i,this}build(){const e=[],t={layer:this.layerName,attr:{minZoomLevel:["case",!0,["get","minZoom"],["zoom"]],maxZoomLevel:["get","maxZoom"]}};if(this.m_withMarker){const i=s(t,{when:["==",["geometry-type"],"Point"],technique:"labeled-icon",attr:{priority:1e3,imageTexture:["get","imageTexture"],iconFadeTime:0,iconReserveSpace:!1,iconMayOverlap:!0,textIsOptional:!0,textReserveSpace:!1,screenWidth:["get","screenWidth"],screenHeight:["get","screenHeight"],iconXOffset:["get","iconXOffset"],iconYOffset:["get","iconYOffset"],renderOrder:["get","zOrder"]}});e.push(i)}if(this.m_withLine){const i=s(t,{when:["all",["==",["geometry-type"],"LineString"],["!has","dashPattern"],["!",["get","volatile"]]],technique:"solid-line",attr:{renderOrder:["get","zOrder"],cap:["get","lineCap"],color:["get","strokeColor"],width:["get","lineWidth"],clipping:this.m_shouldClipLines}}),n=s(i,{when:["all",["==",["geometry-type"],"LineString"],["has","dashes"]],technique:"solid-line",attr:{color:"#0000",dashColor:["get","strokeColor"],clipping:this.m_shouldClipLines,dashes:["get","dashes"],"dash-pattern":["get","dashPattern"],"dash-image":["get","dashImage"]}});if(e.push(i,n),this.m_withVolatile){const t=s(i,{when:["all",["==",["geometry-type"],"LineString"],["!has","dashPattern"],["get","volatile"]],attr:{color:["get",["concat","strokeColor:",["get","id"]],["dynamic-properties"]
950],width:["concat",["get",["concat","lineWidth:",["get","id"]],["dynamic-properties"]],"px"]}});e.push(t)}}const i=["==",["get","height"],0];if(this.m_withOverlay){const o=s(t,{when:["all",["==",["geometry-type"],"Polygon"],i,["has","map"],["!",["get","volatile"]]],technique:"polygon",attr:{renderOrder:["+",["get","zOrder"]],map:["get","map"],mapProperties:{flipY:!0,minFilter:"linear"},textureCoordinateType:n.TextureCoordinateType.FeatureSpace,color:16777215,opacity:["get","opacity"],transparent:!0}});if(e.push(o),this.m_withVolatile){const t=s(o,{when:["all",["==",["geometry-type"],"Polygon"],i,["has","map"],["get","volatile"]],attr:{map:["get",["concat",r.DYNAMIC_OVERLAY_PROP_PREFIX,["get","id"]],["dynamic-properties"]]}});e.push(t)}}if(this.m_withPolygon){const r=s(t,{when:["all",["==",["geometry-type"],"Polygon"],i,["!has","map"],["!",["get","volatile"]]],technique:"polygon",attr:{renderOrder:["+",["get","zOrder"]],color:["get","fillColor"],lineWidth:0}});if(this.m_withPolygonAlwaysPickable&&(r.transient=n.Pickability.all),e.push(r),this.m_withPolygonOutline){const r=s(t,{when:["all",["==",["geometry-type"],"Polygon"],i,["!has","map"],["!has","dashes"],["!",["get","volatile"]]],technique:"solid-line",attr:{renderOrder:["+",["get","zOrder"],.5],color:["get","strokeColor"],width:["get","lineWidth"]}}),o=s(r,{when:["all",["==",["geometry-type"],"Polygon"],i,["!has","map"],["has","dashes"]],technique:"solid-line",attr:{clipping:!0,color:"#0000",dashColor:["get","strokeColor"],dashes:["get","dashes"],"dash-pattern":["get","dashPattern"]}});if(this.m_withPolygonAlwaysPickable&&(r.transient=n.Pickability.all,o.transient=n.Pickability.all),e.push(r,o),this.m_withVolatile){const t=s(r,{when:["all",["==",["geometry-type"],"Polygon"],i,["!has","map"],["!has","dashes"],["get","volatile"]],attr:{color:["get",["concat","strokeColor:",["get","id"]],["dynamic-properties"]],width:["concat",["get",["concat","lineWidth:",["get","id"]],["dynamic-properties"]],"px"]}});e.push(t)}}if(this.m_withExtrudedPolygon){const i=s(t,{when:["all",["==",["geometry-type"],"Polygon"],[">",["get","height"],0]],technique:"extruded-polygon",attr:{renderOrder:["get","zOrder"],color:["get","fillColor"],lineColor:["get","strokeColor"],lineWidth:["get","lineWidth"],constantHeight:["get","constantHeight"]}});this.m_withPolygonAlwaysPickable&&(i.transient=n.Pickability.all),e.push(i)}if(this.m_withVolatile){const t=s(r,{when:["all",["==",["geometry-type"],"Polygon"],i,["!has","map"],["get","volatile"]],attr:{color:["get",["concat","fillColor:",["get","id"]],["dynamic-properties"]]}});e.push(t)}}return{styles:e}}}function s(e,t){const i=Object.assign(Object.assign({},e),t);return i.attr=Object.assign(Object.assign({},e.attr),t.attr),i}t.ObjectStyleBuilder=r,r.DYNAMIC_OVERLAY_PROP_PREFIX="overlay-image"},6724:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ObjectTileDataProvider=void 0;const n=i(3261),r=i(7316);class s extends n.ObjectDataProvider{constructor(e){super(e),this.provider=e,void 0!==H.service&&e instanceof H.service.extension.TileProvider&&e.setTileCanvasRendering(!1)}async getTile(e,t){if(void 0!==t&&t.addEventListener("abort",(()=>{this.provider.cancelTile(e.column,e.row,e.level)})),this.provider.providesMarkers()){const t=this.getMarkerImageLoader();return await new Promise(((i,n)=>{this.provider.requestTileAsPromise(e.column,e.row,e.level).then((n=>{const s=[],o=n.data,a=[];o.forEach((i=>{const n=(0,r.getMarkerProperties)(i);if(null!==n){const r=i.getIcon();if(r.getState()===H.map.Icon.State.READY){const e=n.imageTexture;s.push(e),t.load(e,r.getBitmap())}n.tileKey=e,a.push({type:"Feature",properties:n,geometry:i.getGeometry().toGeoJSON()})}})),t.setImageReferences(e,s),i({type:"FeatureCollection",features:a})}),n)}))}return this.provider.requestTileAsPromise(e.column,e.row,e.level)}}t.ObjectTileDataProvider=s},2464:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ObjectTileDataSource=void 0;const n=i(9310),r=i(6724),s=i(1930),o=i(1447),a=i(1503),l=i(7564),c=i(7665);class h extends n.ObjectDataSource{constructor(e,t){super(u(Object.assign(Object.assign({},e),{addGroundPlane:!1,gatherFeatureAttributes:!0,dataProvider:new r.ObjectTileDataProvider(t)}),t),t),this.provider=t}ready(){return super.ready()&&this.provider.getStyleInternal().getState()===H.map.render.Style.State.READY}invalidateTiles(){this.mapView.markTilesDirty(this,(({tileKey:e})=>{const t=this.provider.requestTile(e.column,e.row,e.level,!0);return void 0!==t&&!t.valid}))}
950onProviderUpdate(e){var t;if(this.isDetached())return;if(e.target===this.provider)return void this.mapView.markTilesDirty(this);const i=e.target;(i instanceof H.map.Marker&&(null===(t=i.getIcon())||void 0===t?void 0:t.getState())===H.map.Icon.State.READY||i instanceof H.map.Spatial)&&this.invalidateTilesWithDelay()}}t.ObjectTileDataSource=h;const u=(e,t)=>{if(t.providesMarkers())e.tileFactory=new s.TileFactory(n.ObjectTile),e.decoder=new a.VectorTileDecoder;else if(t.providesSpatials())e.tileFactory=new s.TileFactory(o.Tile),e.decoder=new a.VectorTileDecoder(new c.SpatialObjectDataAdapter);else{if(!t.providesGeoJSON())throw Error('At least one of these provider\'s methods should return "true":\n providesMarkers(), providesSpatials(), providesGeoJSON()');e.tileFactory=new s.TileFactory(n.ObjectTile),e.decoder=new a.VectorTileDecoder(new l.LayeredGeoJsonDataAdapter)}return e}},2420:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isProviderAdapter=void 0,t.isProviderAdapter=function(e){return null!=e&&e.provider instanceof H.map.provider.Provider}},7665:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SpatialObjectDataAdapter=void 0;const n=i(82),r=i(7316);t.SpatialObjectDataAdapter=class{canProcess(e){return!0}process(e,t,i){var n;const l="extensionSpatial",c=e.getObjects(),h=null!==(n=e.getTileSize())&&void 0!==n?n:s;c.forEach((t=>{const n=t.getGeometriesForTile(e);if(void 0!==n&&n.length>0){const e=t.getId();let s;const c=(0,r.getSpatialProperties)(t),u=t.isClosed();if(u?(s=function(e){const t=[];for(let i=0;i<e.length;i++){const n=e[i],r=n.paths,s=r.length,o=n.interiorsIndex,l=n.outlinesIndex;let c,h=Math.min(o,l,s);const u=[];for(let e=0;e<h;e++)c=[r[e].map(a)],u.push({rings:c});if(1===h){h=Math.min(l,s);for(let e=o;e<h;e++)c.push(r[e].map(a))}t.push(u)}return t}(n),c.height=0):s=o(n,!1),s.length>0)if(u){const t=Object.assign(Object.assign({},c),{lineWidth:0});s.forEach((n=>{i.processPolygonFeature(l,h,n,t,e)}))}else i.processLineFeature(l,h,s,c,e);s=o(n,!0),s.length>0&&i.processLineFeature(l,h,s,c,e)}}))}};const s=256;function o(e,t){const i=[];for(let n=0;n<e.length;n++){const r=e[n],s=t?r.outlinesIndex:0,o=t?r.paths.length:Math.min(r.interiorsIndex,r.outlinesIndex,r.paths.length);for(let e=s;e<o;e++)i.push({positions:r.paths[e].map(a)})}return i}function a(e){return new n.Vector2(e.x,e.y)}},3709:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VectorTileDataProvider=void 0;const n=i(8635);class r extends n.DataProvider{constructor(e){super(),this.provider=e}async getTile(e,t){return void 0!==t&&t.addEventListener("abort",(()=>{this.provider.cancelTile(e.column,e.row,e.level)})),await new Promise(((t,i)=>{this.provider.requestTileAsPromise(e.column,e.row,e.level).then((({data:e})=>{e instanceof ArrayBuffer&&t(e.slice(0,e.byteLength))}),i)}))}ready(){return!0}async connect(){return await Promise.resolve()}dispose(){}}t.VectorTileDataProvider=r},9470:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WebTileDataProvider=void 0;const n=i(82),r=[];t.WebTileDataProvider=class{constructor(e){this.provider=e}async getTexture(e,t){return void 0!==t&&t.addEventListener("abort",(()=>{this.provider.cancelTile(e.tileKey.column,e.tileKey.row,e.tileKey.level)})),await new Promise(((t,i)=>{this.provider.requestTileAsPromise(e.tileKey.column,e.tileKey.row,e.tileKey.level).then((({data:e})=>{null===e&&t(void 0);const i=new n.Texture(e);i.needsUpdate=!0,t([i,r])}),i)}))}}},5432:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isCrossingAntimeridian=t.wrapGeoLineString=t.wrapGeoPolygon=void 0;const n=i(8965),r=i(3997),s=i(4860);function o(e){const t=[],i=e.getLatLngAltArray();let n=0,r=0;for(let e=0,o=i.length;e<o;e+=3){const o=i[e];let a=i[e+1];const l=i[e+2];if(e>=3){a+=n;const e=Math.abs(a-r)>180?a>r?-360:360:0;r=a+=e,n+=e}else r=a;t.push(new s.GeoCoordinates(o,a,l))}return t}function a(e){const{left:t,middle:i,right:n}=e;return{left:null==t?void 0:t.map(l),middle:null==i?void 0:i.map(l),right:null==n?void 0:n.map(l)}}function l(e){return e.toGeoPoint()}t.wrapGeoPolygon=function(e,t){const i=o(e.getExterior()),r=a((0,n.wrapPolygon)(i)),s=e.getInteriors().map((e=>a((0,n.wrapPolygon)(o(e)))));for(const e in r){if(void 0===r[e])continue;const i=[];
950s.forEach((t=>{void 0!==t[e]&&i.push(t[e])})),t.push([r[e],...i])}},t.wrapGeoLineString=function(e,t){const{left:i,middle:n,right:s}=(0,r.wrapLineString)(o(e));for(const e of[i,n,s])void 0!==e&&e.forEach((e=>{t.push(e.map((e=>e.toGeoPoint())))}))},t.isCrossingAntimeridian=function(e){return e instanceof H.geo.LineString?e.getDBCs()>0:e.getExterior().getDBCs()>0}},7316:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getMarkerProperties=t.getSpatialProperties=void 0,t.getSpatialProperties=e=>{var t,r,s,o;const a=e.getStyle(),l=a.lineWidth,c={lineWidth:`${a.lineWidth}px`,lineJoin:"Round",strokeColor:n(a.strokeColor)};return e.isClosed()?c.fillColor=n(a.fillColor):c.lineCap=i[a.lineCap],a.lineDash.length>1&&(c.dashPattern=["make-vector",["pixel-world-scale",(null!==(t=a.lineDash[0])&&void 0!==t?t:0)*l],["pixel-world-scale",(null!==(r=a.lineDash[1])&&void 0!==r?r:0)*l],["pixel-world-scale",(null!==(s=a.lineDash[2])&&void 0!==s?s:0)*l],["pixel-world-scale",(null!==(o=a.lineDash[3])&&void 0!==o?o:0)*l]],c.dashes="Square",void 0!==a.lineDashImage&&(c.dashImage=`H-lineDashImage-${e.getId()}`)),c},t.getMarkerProperties=e=>{const t=e.getIcon();let i=null;if(t.getState()===H.map.Icon.State.READY){const{w:n,h:r}=t.getSize(),s=`H-icon-${t.uid}`,o=t.getAnchor();let a=0,l=0;void 0!==o&&(a=o.x,l=o.y),i={id:e.getId(),imageTexture:s,minZoom:e.getMin(!0),maxZoom:e.getMax(!0)+1,screenWidth:n,screenHeight:r,iconXOffset:n/2-a,iconYOffset:-(r/2-l)}}return i};const i={butt:"butt",square:"square",round:"round"},n=e=>{const t="none"===e;return t&&console.warn('Unsupported color value "none" converted to "rgba(0,0,0,0)"'),t?"rgba(0,0,0,0)":e}},8218:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lights=void 0,t.lights=[{name:"ambientLight",color:"#ffffff",intensity:.8,type:"ambient"},{direction:{x:-.3535533524,y:.3535534098,z:.8660254115},name:"light1",color:"#ffffff",intensity:.4,type:"directional"},{direction:{x:-.2548870499,y:-.9512512293,z:.1736481802},name:"light2",color:"#ffffff",intensity:.3,type:"directional"},{direction:{x:.6830126975,y:.1830126865,z:.7071067893},name:"light3",color:"#ffffff",intensity:.25,type:"directional"}]},6667:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDefaultTheme=t.DARK_THEME=t.DEFAULT_THEME=void 0;const n=i(8218),r=i(173),s={color:"#FFFFFF",startRatio:.7};t.DEFAULT_THEME={clearColor:"#FFFFFF",fog:s,sky:{type:"gradient",topColor:"#347BC0",bottomColor:"#EDF2F9",groundColor:"#FFFFFF"},lights:n.lights},t.DARK_THEME={clearColor:"#010608",fog:s,sky:{type:"gradient",topColor:"#010608",bottomColor:"#EDF2F9",groundColor:"#010608"},lights:n.lights},t.getDefaultTheme=(e=!1)=>(0,r.cloneDeep)(e?t.DARK_THEME:t.DEFAULT_THEME)},483:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Layers=void 0;const n=i(2972),r=i(9330),s=i(2497),o=i(9310),a=i(8124),l=i(2464),c=i(3709),h=i(9470),u=i(9636),d=i(5694),m=i(6667),p=i(8449),f=H.getStylePath()+"/harp/";function g(e){let t;return void 0!==H.service&&(e instanceof H.service.trafficVectorTile.Provider?t=["traffic_flow","incident_icons","traffic_incidents"]:e instanceof H.service.omv.Provider&&(t=["tilezen_points","tilezen_lines","tilezen_polygons","tilezen_polygons_outlines","tilezen_volumes","tilezen_building_footprints","tilezen_building_footprints_outlines","tilezen_building_addresses","tilezen_road_shield_labels","tilezen_hillshade","tilezen_contour"])),t}function v(e){return`H-${e.uid}`}t.Layers=class{constructor(e,t,i,n){this.mapView=e,this.dataModel=t,this.lookAtManipulator=i,this.surfaceFactory=n,this.m_dataSources=new Map,this.m_renderers=[],this.m_isSetLayerOngoing=!1,this.m_disposed=!1,this.m_abortController=new AbortController,this.m_themeManager=new y(t,this.m_dataSources),t.addEventListener("add",this.onAdd,!1,this),t.addEventListener("remove",this.onRemove,!1,this),t.addEventListener("set",this.onSet,!1,this),t.addEventListener("configchange",this.onConfigChange,!1,this),t.addEventListener("update",this.onUpdate,!1,this),this.resetDataSourceOrder=this.resetDataSourceOrder.bind(this);const r=[];
950t.asArray().forEach(((e,t)=>{r.push(this.add(e,t))})),Promise.all(r).then(this.resetDataSourceOrder)}forEachRenderer(e){this.m_renderers.forEach(((t,i)=>e(t,i)))}dispose(){this.m_disposed=!0,this.dataModel.getLength()>0&&this.updateMinMaxListeners(this.dataModel.get(0),!1),this.dataModel.asArray().forEach(((e,t)=>{this.remove(e,t)})),this.m_renderers.forEach((e=>e.dispose())),this.m_dataSources.clear(),this.dataModel.removeEventListener("add",this.onAdd,!1,this),this.dataModel.removeEventListener("remove",this.onRemove,!1,this),this.dataModel.removeEventListener("set",this.onSet,!1,this),this.dataModel.removeEventListener("configchange",this.setTheme,!1,this),this.dataModel.removeEventListener("update",this.onUpdate,!1,this)}resetDataSourceOrder(){this.dataModel.asArray().forEach(((e,t)=>{const i=e.getProvider(),n=this.m_dataSources.get(i);void 0!==n&&(n.dataSourceOrder=t,i.providesOMV()&&(n.addGroundPlane=0===t))})),this.mapView.update()}sortSurfaces(){this.m_renderers.forEach((e=>{const t=e.getLayer();e.getSurface().setZIndex(this.dataModel.indexOf(t))}))}createDataSource(e,t){var i;const o=e.getProvider(),d={name:t,minDisplayLevel:e.min,maxDisplayLevel:e.max,minDataLevel:o.min,maxDataLevel:o.max};let m;if(o instanceof H.map.provider.RemoteTileProvider){const e=o.getStyleInternal();if(!(e instanceof u.Style))throw new H.lang.IllegalOperationError(this.add,`Wrong style format for layer ${t}.`);if(this.m_disposed&&console.warn(new H.lang.IllegalOperationError(this.add,`Cannot add layer ${t}. The rendering engine has been disposed.`)),o.providesOMV()){let e;void 0!==H.service&&o instanceof H.service.omv.Provider&&(e=o.getPoliticalView(),o.addEventListener("politicalviewchange",this.onPoliticalViewChange,void 0,this)),m=new n.VectorTileDataSource(Object.assign(Object.assign({},d),{layerNames:null!==(i=g(o))&&void 0!==i?i:[v(o)],dataProvider:new c.VectorTileDataProvider(o),storageLevelOffset:-1,gatherFeatureAttributes:!0,politicalView:void 0!==e?e.toLowerCase():void 0,languages:void 0!==H.service&&o instanceof H.service.omv.Provider?o.getLanguages():void 0}))}else if(o.providesRasters())m=new r.WebTileDataSource(Object.assign(Object.assign({},d),{layerNames:[v(o)],dataProvider:new h.WebTileDataProvider(o),resolution:r.WebTileDataSource.resolutionValue[r.WebTileDataSource.resolutionValue[o.tileSize]],storageLevelOffset:this.mapView.pixelRatio<2&&o.tileSize>256?-1:0,renderingOptions:{opacity:o.getOpacityInternal(),transparent:!0}}));else if(o.providesSpatials()||o.providesMarkers()||o.providesGeoJSON()){m=new l.ObjectTileDataSource(d,o);let t=e.getConfig();if(void 0===t.styles){const e=new a.ObjectStyleBuilder(m.layerNames[0]);o.providesMarkers()?e.withMarker():o.providesSpatials()&&(e.withLine(!0),e.withPolygon()),t=e.build();const i=new u.Style(t);i.setState(H.map.render.Style.State.READY),o.setStyleInternal(i,!0)}}}else if(o instanceof H.map.provider.ObjectProvider){o.setEngineType(H.Map.EngineType.HARP),m=new s.LocalObjectDataSource(d,o);const e=new a.ObjectStyleBuilder(m.layerNames[0]).withMarker().withLine(!1).withPolygon(!0,!0).withOverlay().withVolatile().build(),t=new u.Style(e);t.setState(H.map.render.Style.State.READY),o.setStyleInternal(t,!0)}return m}async add(e,t){const i=e.getProvider();0===t&&(this.updateMinMaxListeners(e,!0),this.adjustZoomConstraints());const n=`H-${null==i?void 0:i.uid}`;let r=!1;if(function(e){return void 0!==e.requestDomMarkers}(e)){const t=new H.map.render.dom.MarkerRenderer(e);t.setSurface(this.surfaceFactory.createDOMSurface()),this.m_renderers.push(t);const i=this.dataModel.asArray();this.m_renderers.sort(((e,t)=>i.indexOf(e.getLayer())-i.indexOf(t.getLayer()))),r=!0,this.sortSurfaces()}const s=this.createDataSource(e,n);void 0!==s?(this.m_dataSources.set(i,s),this.mapView.addDataSource(s),await this.setTheme()):r||console.warn(new H.lang.IllegalOperationError(this.add,`Layer ${n} is not supported.`))}remove(e,t){for(let t=0;t<this.m_renderers.length;t++)if(this.m_renderers[t].getLayer()===e){this.m_renderers[t].dispose(),this.m_renderers.splice(t,1);break}const i=e.getProvider(),n=this.m_dataSources.get(i);if(void 0!==n){this.mapView.removeDataSource(n),n.dispose(),this.m_dataSources.delete(i);const e=i.getStyleInternal();e instanceof u.Style&&e.cancelLoad(),this.setTheme()}0===t&&this.updateMinMaxListeners(e,!1),0===this.dataModel.getLength()&&this.adjustZoomConstraints(),void 0!==H.service&&i instanceof H.service.omv.Provider&&i.removeEventListener("politicalviewchange",this.onPoliticalViewChange,void 0,this)}get isSetLayerOngoing(){return this.m_isSetLayerOngoing}async onSet(e){if(e.removed instanceof H.map.layer.Layer){this.m_isSetLayerOngoing=!0;try{this.remove(e.removed,e.idx)}catch(e){throw this.m_isSetLayerOngoing=!1,e}}e.added instanceof H.map.layer.Layer&&await this.add(e.added,e.idx),this.m_isSetLayerOngoing=!1,this.resetDataSourceOrder()}onUpdate(e){const t=e.target.getProvider();if(this.m_dataSources.has(t)){const e=this.m_dataSources.get(t);e instanceof o.ObjectDataSource||(this.mapView.markTilesDirty(e),e instanceof r.WebTileDataSource&&t.providesRasters()&&(e.opacity=t.getOpacityInternal())),this.mapView.update()}}onAdd(e){this.add(e.added,e.idx).then(this.resetDataSourceOrder)}onRemove(e){this.remove(e.removed,e.idx),this.resetDataSourceOrder()}onPoliticalViewChange(e){void 0!==H.service&&e.target instanceof H.service.omv.Provider&&this.m_dataSources.get(e.target).setPoliticalView(e.newValue.toLowerCase())}adjustZoomConstraints(){const e=this.dataModel.asArray(),{min:t,max:i}=d.default.lookAt.zoom;e.length>0?this.lookAtManipulator.setZoomConstraints(Math.max(t,e[0].min),Math.min(i,e[0].max)):this.lookAtManipulator.setZoomConstraints(t,i);const n=this.mapView.zoomLevel,r=this.lookAtManipulator.clampZoom(n);r!==n&&(this.mapView.zoomLevel=r)}updateMinMaxListeners(e,t){t?(e.addEventListener("minchange",this.adjustZoomConstraints,!1,this),e.addEventListener("maxchange",this.adjustZoomConstraints,!1,this)):(e.removeEventListener("minchange",this.adjustZoomConstraints,!1,this),e.removeEventListener("maxchange",this.adjustZoomConstraints,!1,this))}onConfigChange(e){var t;if(e.target instanceof H.map.layer.Layer){const i=this.m_dataSources.get(e.target.getProvider());(null===(t=e.newValue)||void 0===t?void 0:t.hasOwnProperty("enabledFeatures"))?i instanceof p.TileDataSource&&(i.enabledFeatures=e.newValue.enabledFeatures):(null==i||i.exprPool.clear(),this.setTheme())}}async setTheme(){this.m_abortController.abort("Abort theme loading due to a data model change."),this.m_abortController=new AbortController;const e=this.m_abortController.signal;try{const t=await this.m_themeManager.merge();e.throwIfAborted(),await this.mapView.setTheme(t,f)}catch(e){}}};class y{constructor(e,t){this.dataModel=e,this.dataSources=t,this.dark=void 0,this.m_uniqueStyles=new Map}async loadLayerTheme(e){var t;const i=e.getProvider(),n=null==i?void 0:i.getStyleInternal(),r=n.getState();if(!(n instanceof u.Style)||r===H.map.render.Style.State.ERROR)return;const s=this.dataSources.get(i);s instanceof p.TileDataSource&&(s.enabledFeatures=n.getEnabledFeatures());const o=null!==(t=n.getUrl())&&void 0!==t?t:JSON.stringify(n.getConfig()),a=this.m_uniqueStyles.get(o);if(void 0===a){this.m_uniqueStyles.set(o,n);const e=void 0===g(i);return await n.loadAsync(!1,!0).then((()=>
950{if(n.getState()!==H.map.render.Style.State.ERROR)return e?function(e,t){var i;const n=null!==(i=e.getConfig())&&void 0!==i?i:void 0;return void 0!==n&&e.getState()===H.map.render.Style.State.READY&&(Array.isArray(n.styles)&&n.styles.forEach((e=>{e.layer=t})),e.setConfig(n)),n}(n,v(i)):n.getConfig()}))}r===H.map.render.Style.State.INIT&&a.loadAsync(!0,!0).then((()=>{n.setConfig(a.getConfig()),n.setState(a.getState())}))}async merge(){this.m_uniqueStyles.clear();const e=this.dataModel.asArray();if(0===e.length)return this.dark=void 0,{};this.dark=e[0].dark;const t=e.map((async e=>await this.loadLayerTheme(e))),i=(await Promise.all(t)).filter((e=>void 0!==e));return{extends:[(0,m.getDefaultTheme)(this.dark),...i]}}}},9561:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LookAtManipulator=t.adjustHeading=void 0;const n=i(7220),r=i(2616),s=i(2344),o=i(5694),a=i(82),l=i(2730),c=i(4609);function h(e){return(180+e)%360}t.adjustHeading=h;class u{constructor(e,t){this.m_mapView=e,this.m_viewPort=t,this.camera=this.m_mapView.camera.clone()}update(){const{width:e,height:t,padding:i}=this.m_viewPort,n=this.m_mapView.camera,r=Math.max(1,e-i.left-i.right),o=Math.max(1,t-i.top-i.bottom);this.camera.copy(n),this.camera.aspect=r/o,s.CameraUtils.setPrincipalPoint(this.camera,{x:0,y:0});const l=(0,c.calculateNormalizedDeviceCoordinates)(i.left,i.top,e,t),h=new a.Vector3(l.x,l.y,-1).applyMatrix4(n.projectionMatrixInverse),u=2*Math.atan2(h.y,n.near);s.CameraUtils.setVerticalFov(this.camera,u,o),this.camera.updateProjectionMatrix()}get projection(){return this.m_mapView.projection}get tileWrappingEnabled(){return this.m_mapView.tileWrappingEnabled}}t.LookAtManipulator=class{constructor(e,t){this.mapView=e,this.m_viewPort=t,this.m_localTangentSpace={position:new a.Vector3,xAxis:new a.Vector3,yAxis:new a.Vector3,zAxis:new a.Vector3},this.m_boundsGenerator=new n.BoundsGenerator(this.mapView),this.m_paddedBoundsGenerator=this.m_boundsGenerator,this.setZoomConstraints(o.default.lookAt.zoom.min,o.default.lookAt.zoom.max),t.addEventListener("update",this.onViewPortUpdate,void 0,this),this.onViewPortUpdate()}
950getLookAtData(e=!1,t=!1){return(e||void 0===this.m_viewBounds)&&this.updateViewBounds(),{position:this.mapView.target.toLatLng(),zoom:this.mapView.zoomLevel,heading:h(this.mapView.heading),tilt:this.mapView.tilt,bounds:t?this.m_paddedViewBounds:this.m_viewBounds,incline:0}}setZoomConstraints(e,t){this.m_layerMinZoom=e,this.m_layerMaxZoom=t,this.mapView.minZoomLevel=e,this.mapView.maxZoomLevel=t,this.invalidateViewBounds()}clampValues(e){const{heading:t,tilt:i}=o.default.lookAt;if(void 0!==e.zoom&&(e.zoom=this.clampZoom(e.zoom)),void 0!==e.tilt&&(e.tilt=a.MathUtils.clamp(e.tilt,i.min,i.max)),void 0!==e.heading){const i=(e.heading%360+360)%360;e.heading=a.MathUtils.clamp(i,t.min,t.max)}}clampZoom(e){const{zoom:t}=o.default.lookAt;return a.MathUtils.clamp(e,Math.max(t.min,this.m_layerMinZoom),Math.min(t.max,this.m_layerMaxZoom))}lookAt(e){this.mapView.lookAt(Object.assign(Object.assign({},e),{padding:this.m_viewPort.padding})),this.invalidateViewBounds()}applyLookAtDelta(e,t,i,n,r){const l=this.mapView;if(n||r){const e=a.MathUtils.degToRad(o.default.lookAt.tilt.max);s.MapViewUtils.orbitAroundScreenPoint(this.mapView,{deltaTilt:a.MathUtils.degToRad(n),maxTiltAngle:e}),s.MapViewUtils.orbitAroundScreenPoint(this.mapView,{deltaAzimuth:a.MathUtils.degToRad(r),maxTiltAngle:e,center:t})}0!==i&&this.zoomAt(l.zoomLevel+i,t),this.moveLookAtByOffset(e.x,e.y),this.invalidateViewBounds()}moveLookAtByOffset(e,t){if(0===e&&0===t)return;const i=this.mapView.camera,n=this.mapView.projection,o=a.MathUtils.degToRad(this.mapView.heading),l=this.mapView.pixelToWorld,c=Math.cos(-o),h=Math.sin(-o),u=(e*c+t*h)*l,d=(t*c-e*h)*l;if(n.type===r.ProjectionType.Planar)i.position.x+=u,i.position.y-=d,this.clampCameraPosition();else{const e=s.MapViewUtils.getWorldTargetFromCamera(i,n);if(null===e)return;n.localTangentSpace(e,this.m_localTangentSpace);const t=this.m_localTangentSpace.xAxis,r=this.m_localTangentSpace.yAxis,o=e.clone();t.multiplyScalar(u),o.sub(t),r.multiplyScalar(d),o.add(r),s.MapViewUtils.panCameraAroundGlobe(this.mapView,e,o)}this.invalidateViewBounds()}setAngles(e,t){const i=o.default.lookAt.tilt;e=a.MathUtils.clamp(e,i.min,i.max);const{target:n,distance:r}=s.MapViewUtils.getTargetAndDistance(this.mapView.projection,this.mapView.camera,this.mapView.elevationProvider),l=this.mapView.projection.unprojectPoint(n);s.MapViewUtils.getCameraRotationAtTarget(this.mapView.projection,l,-t,e,this.mapView.camera.quaternion),s.MapViewUtils.getCameraPositionFromTarget(this.mapView.target,r,-t,e,this.mapView.projection,this.mapView.camera.position),this.invalidateViewBounds()}zoomAt(e,t){const i=this.clampZoom(e);this.mapView.zoomLevel!==i&&(s.MapViewUtils.zoomOnTargetPosition(this.mapView,t.x,t.y,i),this.invalidateViewBounds())}clampCameraPosition(){if(this.mapView.projection.type===r.ProjectionType.Spherical)return;const{target:e}=s.MapViewUtils.getTargetAndDistance(this.mapView.projection,this.mapView.camera,this.mapView.elevationProvider),t=this.mapView.projection.unprojectPoint(e),i=this.mapView.projection.projectPoint(t),n=i.x-e.x,o=i.y-e.y;this.mapView.camera.position.x+=n,this.mapView.camera.position.y+=o,this.invalidateViewBounds()}invalidateViewBounds(){this.m_viewBounds=void 0,this.m_paddedViewBounds=void 0}updateViewBounds(){var e;null===(e=this.m_paddedView)||void 0===e||e.update(),this.m_viewBounds=(0,l.harpToHGeoPolygon)(this.m_boundsGenerator.generate()),this.m_paddedViewBounds=this.m_paddedBoundsGenerator===this.m_boundsGenerator?this.m_viewBounds:(0,l.harpToHGeoPolygon)(this.m_paddedBoundsGenerator.generate())}onViewPortUpdate(){const e=this.m_viewPort.padding;if(e.top||e.left||e.bottom||e.right){const e=this.m_viewPort.center,t=this.mapView.getNormalizedScreenCoordinates(e.x,e.y);s.CameraUtils.setPrincipalPoint(this.mapView.camera,t),this.m_paddedBoundsGenerator===this.m_boundsGenerator&&(this.m_paddedView=new u(this.mapView,this.m_viewPort),this.m_paddedBoundsGenerator=new n.BoundsGenerator(this.m_paddedView))}else this.m_paddedBoundsGenerator!==this.m_boundsGenerator&&(s.CameraUtils.setPrincipalPoint(this.mapView.camera,{x:0,y:0}),this.m_paddedBoundsGenerator=this.m_boundsGenerator,this.m_paddedView=void 0);this.invalidateViewBounds()}}},8935:(e,t,i)=>{"use strict";
950Object.defineProperty(t,"__esModule",{value:!0}),t.RenderEngine=t.RenderEngineState=void 0;const n=i(82),r=i(8806),s=i(9026),o=i(2616),a=i(3977),l=i(2730),c=i(9070),h=i(2505),u=i(483),d=i(6562),m=i(9561),p=i(541),f=i(4954),g=i(248),v=i(1135),y=i(5694),_=i(6667),x=i(5925),b=i(2344),w=i(507),M=i(7362),T=d.LoggerManager.instance.create("harp::RenderEngine");var S;!function(e){e[e.Suspended=0]="Suspended",e[e.Busy=1]="Busy",e[e.Shutdown=2]="Shutdown"}(S=t.RenderEngineState||(t.RenderEngineState={}));class E extends H.util.EventTarget{constructor(e,t,i,n){super(),this.m_syncedSize=null,this.m_lookAtAnimation=void 0,this.m_animation=void 0,this.m_animationDuration=.3,this.m_lastCallTime=0,this.m_state=S.Suspended,this.m_rendered=!1,this.m_suspendTimeout=5e3,this.m_renderCallbacks=void 0,this.m_kinetics=void 0,this.m_control=new r.ControlUtils,this.type=H.Map.EngineType.HARP,this.m_viewModel=t,this.m_viewPort=e,this.m_dataModel=i,t.startControl=this.startControl.bind(this),t.control=this.control.bind(this),t.endControl=this.endControl.bind(this),e.startInteraction=this.startInteraction.bind(this),e.interaction=this.interaction.bind(this),e.endInteraction=this.endInteraction.bind(this),this.m_surface=new v.default(e.element,e.width,e.height,n.pixelRatio),this.m_collisionsDebugSurface=new v.default(e.element,e.width,e.height,n.pixelRatio),this.m_screenCollisionsDebug=new M.ScreenCollisionsDebug(this.m_collisionsDebugSurface.getElement()),this.m_screenCollisions=new M.ScreenCollisions,this.m_layersContainer=e.element.ownerDocument.createElement("div"),this.m_layersContainer.style.position="absolute",this.m_layersContainer.style.width=this.m_layersContainer.style.height="100%",this.m_layersContainer.style.zIndex="1",e.element.appendChild(this.m_layersContainer);const s=new Blob([H.__harp_worker_decoders__],{type:"application/javascript"}),l=URL.createObjectURL(s);this.mapView=new a.MapView({decoderUrl:l,synchronousRendering:!0,canvas:this.m_surface.getElement(),pixelRatio:n.pixelRatio,enableMixedLod:!0,lodMinTilePixelSize:512,enableNativeWebglAntialias:!0,projection:n.projectionType===o.ProjectionType.Spherical?o.sphereProjection:o.mercatorProjection,theme:(0,_.getDefaultTheme)(!1),enablePickTechnique:!0,maxVisibleDataSourceTiles:200}),this.setCollisionsDebugger(!1),this.m_handleRequestAnimationFrame=this.renderLoop.bind(this),t.addEventListener("update",this.onViewUpdate,void 0,this),e.addEventListener("update",this.onResize,void 0,this),this.m_lookAtManipulator=new m.LookAtManipulator(this.mapView,this.m_viewPort),this.mapView.addEventListener(a.MapViewEventNames.FrameComplete,(()=>{this.m_layers.isSetLayerOngoing||(this.m_rendered=!0)})),this.mapView.addEventListener(a.MapViewEventNames.Update,(()=>{this.m_rendered=!1,this.relaunch()})),this.mapView.addEventListener(a.MapViewEventNames.ContextLost,(()=>{this.m_state=S.Suspended,cancelAnimationFrame(this.m_animationFrameHandle)})),this.m_layers=new u.Layers(this.mapView,i,this.m_lookAtManipulator,{createDOMSurface:()=>new H.map.render.dom.Surface(this.m_layersContainer,e.width,e.height,n.pixelRatio)}),this.m_control.addEventListener(r.AnimationUpdateEvent,(e=>{var t;null===(t=this.m_animation)||void 0===t||t.stop(!0),e.changeRate.hasValue()&&(this.m_animation=new c.Animation(this.mapView,1/0,this.applyControl.bind(this)),this.m_animation.start())})),this.m_interaction=new H.map.render.InteractionUtils,this.setSize(!1),this.relaunch();const h=new x.MapViewPickHandlerAdapter(this.mapView.pickHandler,this.geoToScreen.bind(this));this.m_pickingHandler=new g.PickingHandlerComposite((()=>{const e=[];return this.m_layers.forEachRenderer((t=>{t instanceof H.map.render.dom.MarkerRenderer&&e.push({getObjectsAt:(e,i,r)=>t.getObjectsAt(e*n.pixelRatio,i*n.pixelRatio,r)})})),e.push(h),e})),T.log("Ready")}setOnRenderCallbacks(e,t){this.m_renderCallbacks={start:e,end:t}}setCollisionsDebugger(e){e?(this.m_collisionsDebugSurface.getElement().style.display="block",this.mapView.iconTextRenderer.screenCollisions=this.m_screenCollisionsDebug,w.debugContext.setValue("DEBUG_SCREEN_COLLISIONS",!0)):(this.m_collisionsDebugSurface.getElement().style.display="none",this.mapView.iconTextRenderer.screenCollisions=this.m_screenCollisions,w.debugContext.setValue("DEBUG_SCREEN_COLLISIONS",!1)),this.mapView.update()}adjustZoomConstraints(){this.m_layers.adjustZoomConstraints()}onViewUpdate(e){const t=this.lookAtParamsFromLookAtData(e.newValue,e.modifiers);this.stopAnimations();const i=function(e){if(e&&this.m_lookAtManipulator.getLookAtData().zoom%1){const e=0|this.m_lookAtManipulator.getLookAtData().zoom;this.m_lookAtManipulator.lookAt({distance:p.MapViewUtils.calculateDistanceFromZoomLevel(this.mapView,e)})}}.bind(this,e.integerZoom);if(e.animate){let n=1;"number"==typeof e.animate&&(n=1/e.animate),this.setLookAtWithAnimation(t,n,e.integerZoom,i),this.relaunch()}else this.m_lookAtManipulator.lookAt(t),i()}setLookAtWithAnimation(e,t,i,r){const o=h.CameraAnimationBuilder.createFlyToOptions(this.mapView,Object.assign(Object.assign({},e),{padding:this.m_viewPort.padding}),((e,i)=>{const n={heading:e.heading,tilt:e.tilt,zoom:p.MapViewUtils.calculateZoomLevelFromDistance(this.mapView,e.distance)},r={heading:i.heading,tilt:i.tilt,zoom:p.MapViewUtils.calculateZoomLevelFromDistance(this.mapView,i.distance)};return this.getFlyToDuration(n,r)*t}),i).controlPoints;this.m_lookAtAnimation=new s.CameraKeyTrackAnimation(this.mapView,{controlPoints:o,interpolation:n.InterpolateLinear}),this.m_lookAtAnimation.start(0,r)}onResize(){this.setSize(!0),this.relaunch()}setSize(e){let{width:t,height:i}=this.m_viewPort;if(t>0&&i>0){e&&(this.m_syncedSize={w:t,h:i}),this.mapView.pixelRatio<2&&(t+=t%2,i+=i%2),this.m_surface.setSize(t,i),this.m_collisionsDebugSurface.setSize(t,i),this.mapView.resize(t,i);const n=this.lookAtParamsFromLookAtData(this.m_viewModel.getLookAtData());
950this.m_lookAtManipulator.lookAt(n),this.m_layers.forEachRenderer((e=>{e.getSurface().setSize(t,i)}))}}lookAtParamsFromLookAtData(e,t=-1>>>0){const i={};return this.m_lookAtManipulator.clampValues(e),t&H.map.ChangeEvent.Type.POSITION&&(i.target=e.position),t&H.map.ChangeEvent.Type.ZOOM&&(i.zoomLevel=e.zoom),t&H.map.ChangeEvent.Type.HEADING&&(i.heading=(0,m.adjustHeading)(e.heading)),t&H.map.ChangeEvent.Type.TILT&&(i.tilt=e.tilt),t&H.map.ChangeEvent.Type.BOUNDS&&(t&H.map.ChangeEvent.Type.ZOOM&&t&H.map.ChangeEvent.Type.POSITION||(i.bounds=e.bounds instanceof H.geo.Polygon?(0,l.hToHarpGeoPolygon)(e.bounds):(0,l.getHarpBoundingBox)(e.bounds))),i}synchronizeViewPort(){null!==this.m_syncedSize&&(this.m_viewPort.synchronize(this.m_syncedSize),this.m_syncedSize=null)}synchronizeLookAt(){var e;this.m_viewModel.synchronize(this.m_lookAtManipulator.getLookAtData(null===(e=this.m_lookAtAnimation)||void 0===e?void 0:e.isRunning(),!0))}adjustLongitudeToVisibleWorld(e){const t=this.mapView.target.longitude;if(Math.abs(t-e)<o.MAX_LONGITUDE)return e;const i=Math.sign(t),n=Math.trunc(t/(2*o.MAX_LONGITUDE)+i/2);return e+2*o.MAX_LONGITUDE*n}inViewport(e){return e.x>=0&&e.y>=0&&e.x<=this.m_viewPort.width&&e.y<=this.m_viewPort.height}setProjection(e){this.mapView.projection.type!==e&&(this.mapView.projection=e===o.ProjectionType.Spherical?o.sphereProjection:o.mercatorProjection)}getProjection(){return this.mapView.projection.type}get animationDuration(){return this.m_animationDuration}set animationDuration(e){e===+e&&e>0&&(this.m_animationDuration=e)}resetAnimationDefaults(){this.m_animationDuration=.3}dispose(){this.m_state=S.Shutdown,cancelAnimationFrame(this.m_animationFrameHandle),this.mapView.dispose(),this.stopAnimations(),this.m_viewModel.removeEventListener("update",this.onViewUpdate,void 0,this),this.m_viewPort.removeEventListener("update",this.onResize,void 0,this),this.m_viewModel.startControl=H.map.ViewModel.prototype.startControl,this.m_viewModel.control=H.map.ViewModel.prototype.control,this.m_viewModel.endControl=H.map.ViewModel.prototype.endControl,this.m_viewPort.startInteraction=H.map.ViewPort.prototype.startInteraction,this.m_viewPort.interaction=H.map.ViewPort.prototype.interaction,this.m_viewPort.endInteraction=H.map.ViewPort.prototype.endInteraction,this.m_layers.dispose(),this.m_viewPort.element.removeChild(this.m_layersContainer)}updateTimeStamp(){this.m_lastCallTime=f.PerformanceTimer.now()}relaunch(){const{width:e,height:t}=this.m_viewPort;e>0&&t>0&&(this.updateTimeStamp(),this.m_state===S.Suspended&&this.startRenderLoop())}get continueRenderLoop(){return this.mapView.isDynamicFrame||f.PerformanceTimer.now()-this.m_lastCallTime<this.m_suspendTimeout&&!this.m_rendered}startRenderLoop(){this.continueRenderLoop?(this.m_state=S.Busy,this.m_animationFrameHandle=requestAnimationFrame(this.m_handleRequestAnimationFrame)):(this.m_state=S.Suspended,this.m_animationFrameHandle=void 0,this.m_rendered&&(this.m_rendered=!1,setTimeout((()=>{this.mapView.isDynamicFrame?this.relaunch():this.dispatchRenderEvent()}))))}renderLoop(e){void 0!==this.m_renderCallbacks&&this.m_renderCallbacks.start(),this.mapView.renderSync(e),this.m_suspendTimeout=5e3,this.renderLayers()||(this.m_rendered=!1),this.synchronizeLookAt(),this.synchronizeViewPort(),void 0!==this.m_renderCallbacks&&this.m_renderCallbacks.end(),this.startRenderLoop()}renderLayers(){var e;let t=this.m_lookAtManipulator.getLookAtData(null===(e=this.m_lookAtAnimation)||void 0===e?void 0:e.isRunning()).bounds.getBoundingBox();this.mapView.projection.type===o.ProjectionType.Planar&&t.getHeight()>=2*o.MercatorConstants.MAXIMUM_LATITUDE&&(t=new H.geo.Rect(90,t.getLeft(),-90,t.getRight()));const i=this.mapView.zoomLevel;this.m_dataModel.asArray().forEach((e=>{var n;null===(n=e.getProvider())||void 0===n||n.preprocessData(t,i)}));const n=this.m_viewPort.center,r=new H.math.Point(0,0);let s=!0;return this.m_layers.forEachRenderer((e=>{const o=e.render(t,n,void 0,i,!1,r,(e=>this.geoToScreen(e)));o===H.map.render.RenderState.ACTIVE&&(this.m_suspendTimeout=1/0),o===H.map.render.RenderState.PENDING&&(s=!1)})),s}getState(){return this.m_state}stopAnimations(){var e,t;null===(e=this.m_lookAtAnimation)||void 0===e||e.stop(),this.m_control.isRunning()&&this.endControl(!0),this.m_interaction.isRunning()&&this.endInteraction(!0),null===(t=this.m_animation)||void 0===t||t.stop(!0)}applyControl(e,t,i,n){const r=this.m_control.getChangeRate(),s=r.moveZ*i,o=r.rotateX*i,a=r.rotateY*i,l={x:r.moveX*i,y:r.moveY*i};this.m_lookAtManipulator.applyLookAtDelta(l,this.getControlTargetNDC(),s,o,a)}dispatchRenderEvent(e){this.dispatchEvent(new H.util.Event("render",null!=e?e:this))}getFlyToDuration(e,t){const i=Math.max(8*this.getCapabilityRatio(e,t,"zoom"),this.getCapabilityRatio(e,t,"heading"),this.getCapabilityRatio(e,t,"tilt")/2);return n.MathUtils.clamp(3e3*i,300,4e3)/1e3}getCapabilityRatio(e,t,i){const n=this.getCapabilities().lookAt[i],r=n.max-n.min,s="zoom"===i?t[i]-e[i]:((e,t)=>{const i=t-e;return i>-180&&i<=180?i:i>180?i-360:i+360}
950)(e[i],t[i]);return Math.abs(s)/r||0}screenToGeo(e,t){const{latitude:i,longitude:n,altitude:r}=this.mapView.getGeoCoordinatesAt(e,t,!0);return new H.geo.Point(i,n,r)}geoToScreen(e){let t;if(this.getProjection()===o.ProjectionType.Planar){const{lat:i,lng:n,alt:r}=e,s=this.adjustLongitudeToVisibleWorld(n),o=this.mapView.getScreenPosition([s,i,r]);t=o,this.inViewport(o)||(t=this.mapView.getScreenPosition([s+360,i,r]),this.inViewport(t)||(t=this.mapView.getScreenPosition([s-360,i,r])),this.inViewport(t)||(t=o))}else t=this.mapView.getScreenPosition(e);return void 0!==t?{x:Math.round(t.x),y:Math.round(t.y)}:null}screenToLookAtData(e,t){const i=this.m_viewModel.getLookAtData();return i.position=this.screenToGeo(e,t),i}getObjectsAt(e,t,i,n,r=!1){this.m_pickingHandler.getObjectsAt(e,t,i,r).then(n)}async capture(e,t,i,n){return await new Promise(((r,s)=>{const o=()=>{this.mapView.removeEventListener(a.MapViewEventNames.FrameComplete,o);const s=this.m_viewPort.element.ownerDocument.createElement("img");s.onload=()=>{const o=this.m_viewPort.element.ownerDocument.createElement("canvas"),a=this.mapView.pixelRatio,l=o.width=(i-e)*a,c=o.height=(n-t)*a;o.getContext("2d").drawImage(s,e,t,l,c,0,0,l,c),r(o)},s.src=this.mapView.canvas.toDataURL()};this.mapView.addEventListener(a.MapViewEventNames.FrameComplete,o),this.mapView.update()}))}setPointer(e,t){}zoomAt(e,t,i){const n=this.mapView.getNormalizedScreenCoordinates(t,i);this.m_lookAtManipulator.zoomAt(e,n),this.relaunch()}startControl(e,t,i){this.stopAnimations(),this.m_kinetics=e,this.m_control.start(t,i)}control(e,t,i,n,r,s){for(let e,t=0;t<arguments.length;t++)if(e=arguments[t],Number.isNaN(e))throw new Error(`Invalid argument ${e}`);this.m_control.isRunning()&&this.m_control.set(e,t,i,n,r,s)}endControl(e,t){var i,n;if(!this.m_control.isRunning())return;const r=t instanceof Function,s=this.getControlTargetNDC();if(null===(i=this.m_animation)||void 0===i||i.stop(),void 0===this.m_kinetics||e||r){if(r){const e=this.m_lookAtManipulator.getLookAtData();t(e);const i=this.mapView.zoomLevel,n=this.m_lookAtManipulator.clampZoom(e.zoom)-i;n&&(this.m_animation=new c.Animation(this.mapView,Math.abs(n/this.m_control.getChangeRate().moveZ)*Math.PI,(e=>{const t=(r=e,--r*r*r+1);var r;this.m_lookAtManipulator.zoomAt(i+n*t,s)})).start())}}else{const e=null!==(n=this.m_kinetics.power)&&void 0!==n?n:1,t=this.m_control.getChangeRate(),i=this.m_kinetics.duration>0?this.m_kinetics.duration:1,{zoom:r,tilt:o,heading:a}=this.m_lookAtManipulator.getLookAtData();let l=0,h=0;this.m_animation=new c.Animation(this.mapView,i,(n=>{const c=this.m_kinetics.ease(n)*i*e,u=t.moveX*c,d=t.moveY*c,p=t.moveZ*c,f=t.rotateX*c,g=t.rotateY*c;this.m_lookAtManipulator.setAngles(o+f,(0,m.adjustHeading)(a+g)),this.m_lookAtManipulator.zoomAt(r+p,s),this.m_lookAtManipulator.moveLookAtByOffset(u-l,d-h),l=u,h=d})).start()}this.m_control.reset()}startInteraction(e,t){const i=!!(void 0!==t||e&(H.map.render.RenderEngine.InteractionModifiers.HEADING|H.map.render.RenderEngine.InteractionModifiers.TILT));this.stopAnimations(),this.m_kinetics=t,this.m_interaction.start(e,i)}interaction(e,t,i,n,r){if(!this.m_interaction.isRunning())return;const s=this.m_interaction,o=s.store(e,t,i,n,r);if(!this.m_interaction.isGestureDetected())return;let a=!1;const l=this.m_interaction.getMoveVector(),c=o&&s.getBifocalCenter(),h=H.map.render.RenderEngine.InteractionModifiers;let u={x:0,y:0},d=b.CameraUtils.getPrincipalPoint(this.mapView.camera),m=0,p=0,f=0;s.isModifierEnabled(h.TILT)&&(p=l.y/this.m_viewPort.height*2*-180,a=!0),s.isModifierEnabled(h.HEADING)&&(o?(f=this.m_interaction.getBifocalRotation(),d=this.mapView.getNormalizedScreenCoordinates(c.x,c.y),a=!0):l.x&&(f=l.x/this.m_viewPort.width*360,a=!0));const g=this.m_interaction.getBifocalScaling();o&&1!==g&&s.isModifierEnabled(h.ZOOM)&&(m=Math.log(Math.pow(2,this.mapView.zoomLevel)*g)/Math.LN2-this.mapView.zoomLevel,d=this.mapView.getNormalizedScreenCoordinates(c.x,c.y),a=!0),s.isModifierEnabled(h.COORD)&&l.x*l.x+l.y*l.y>0&&(u={x:-l.x,y:-l.y},a=!0),a&&(this.m_lookAtManipulator.applyLookAtDelta(u,d,m,p,f),this.relaunch())}endInteraction(e){var t;if(this.m_interaction.isRunning()&&!e&&void 0!==this.m_kinetics){const e=(null!==(t=this.m_kinetics.power)&&void 0!==t?t:1)*this.m_interaction.getSpeed();if(e>0){const t=this.m_kinetics.duration>0?this.m_kinetics.duration:1,i=this.m_interaction.getDirection(),n=this.m_kinetics.ease;this.m_animation=new c.Animation(this.mapView,t,(t=>{const r=e-e*n(t);this.m_lookAtManipulator.moveLookAtByOffset(-i.x*r,-i.y*r)})).start()}}this.m_kinetics=void 0,this.m_interaction.clear()}getCapabilities(){return y.default}getControlTargetNDC(){var e,t;return void 0!==(null===(e=this.m_control)||void 0===e?void 0:e.atX)&&void 0!==(null===(t=this.m_control)||void 0===t?void 0:t.atY)?this.mapView.getNormalizedScreenCoordinates(this.m_control.atX,this.m_control.atY):b.CameraUtils.getPrincipalPoint(this.mapView.c
950amera)}}t.RenderEngine=E},1135:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=class{constructor(e,t,i,n){this.m_canvas=this.createElement(e.ownerDocument),e.appendChild(this.m_canvas),this.m_pixelRatio=n,this.setSize(t,i)}createElement(e){const t=e.createElement("canvas");return t.style.position="absolute",t.style.top=t.style.left="0",t}setSize(e,t){const i=this.m_pixelRatio;this.m_canvas.width=Math.max(e*i,1),this.m_canvas.height=Math.max(t*i,1),this.m_canvas.style.width=`${e}px`,this.m_canvas.style.height=`${t}px`}getElement(){return this.m_canvas}}},5694:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i={lookAt:{zoom:{min:-8,max:24},tilt:{min:0,max:70},incline:{min:0,max:0},heading:{min:0,max:360}},interaction:{ZOOM:H.map.render.RenderEngine.InteractionModifiers.ZOOM,COORD:H.map.render.RenderEngine.InteractionModifiers.COORD},capture:!0};t.default=i},6597:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,i,n){const r=i.getIcon(),s=r.getHitArea();if(null===s)return!0;const o=r.getAnchor();e+=o.x,t+=o.y;const a=i.getGeometry();let l=!1;if(a instanceof H.geo.MultiPoint){const i=a.getGeometries();let r=i.length;for(;r--&&!l;){const o=n(i[r]);l=s.hitTest(e-o.x,t-o.y,0)!==H.math.CoverType.NONE}}else{const i=n(a);l=s.hitTest(e-i.x,t-i.y,0)!==H.math.CoverType.NONE}return l}},5925:function(e,t,i){"use strict";var n=this&&this.__rest||function(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(i[n[r]]=e[n[r]])}return i};Object.defineProperty(t,"__esModule",{value:!0}),t.MapViewPickHandlerAdapter=t.getPickData=void 0;const r=i(2497),s=i(6597),o=i(2420),a=i(4342),l=i(8263),c=i(8449);var h=H.map.provider.PickingMode;function u(e,t){var i;const r=e.userData,{$id:s,$layer:o,$zoom:a,$level:l,$geometryType:c,"$localized-name":h,"$secondary-localized-name":u}=r,d=n(r,["$id","$layer","$zoom","$level","$geometryType","$localized-name","$secondary-localized-name"]),m={};m.properties=d;const p=d.kind;m.id=e.featureId>0?e.featureId:d.id,m.layers=[`${t}_${o}:${p}`],m.source_layer=o,m.source_name=t,m.geometry_type=c,m.technique=e.technique;const f=null!==(i=e.tileKey)&&void 0!==i?i:e.userData.tileKey;if(null!=f){const{row:e,column:t,level:i}=f;m.tile={coords:{x:t,y:e,z:i,key:`${t}/${e}/${i}`}}}return m}function d(e,t,i){const n=new H.map.Feature(u(e,t));return n.setParentEventTarget(i),n}t.getPickData=u,t.MapViewPickHandlerAdapter=class{constructor(e,t){this.pickHandler=e,this.geoToScreen=t,this.m_featureCache=new l.LRUCache(100)}async getObjectsAt(e,t,i,n){const l={maxResultCount:i?1:void 0,allowDuplicates:n},m=this.pickHandler.intersectMapObjects(e,t,l),p=[];for(const l of m){if(void 0===l.userData)continue;const m=this.pickHandler.mapView.getDataSourceByName(l.dataSourceName);if(!(m instanceof c.TileDataSource)){(0,a.assert)(!1,"Pick supported only for TileDataSource instances");continue}const f=m.dataProvider();if(!(0,o.isProviderAdapter)(f))continue;const g=f.provider;switch(g.getPickingMode()){case h.SOURCE:{if(!(m instanceof r.LocalObjectDataSource)){(0,a.assert)(!1,"Cannot use 'SOURCE' pick mode for source without 'getMapObjectById'");continue}const i=m.getMapObjectById(l.userData.id);!p.includes(i)&&(i instanceof H.map.GeoShape||i instanceof H.map.Overlay||i instanceof H.map.Marker&&(0,s.default)(e,t,i,this.geoToScreen))&&p.push(i);break}case h.FEATURE:{let e;if(void 0!==l.tileKey){const{column:t,row:i,level:n}=l.tileKey;e={x:t,y:i,z:n}}g.getFeatureProxy(l.userData,e,(function(e){void 0!==e&&(e.setRootParentEventTarget(g),p.push(e))}))||p.push(n?d(l,m.name,g):this.getFeature(l,m.name,g));break}case h.PROVIDER:if(!(g instanceof H.map.provider.RemoteTileProvider)){(0,a.assert)(!1,"'PROVIDER' picking mode support only for RemoteTileProvider");continue}await g.requestObjectAsPromise(u(l,m.name),!1).then((i=>{i instanceof H.map.Marker&&!(0,s.default)(e,t,i,this.geoToScreen)||p.push(i)}))}if(i&&p.length>0)break}return p}getFeature(e,t,i){let n=this.m_featureCache.get(e.userData),r=null==n?void 0:n.find((t=>t.getData().technique===e.technique));return void 0===r&&(r=d(e,t,i),void 0===n&&(n=[]),n.push(r),this.m_featureCache.set(e.userData,n)),r}}},248:(e,t)=>
950{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PickingHandlerComposite=void 0,t.PickingHandlerComposite=class{constructor(e){this.getPickingHandlers=e}async getObjectsAt(e,t,i,n){let r=[];const s=this.getPickingHandlers();for(const o of s){const s=await o.getObjectsAt(e,t,i,n);if(i&&s.length>0)return[s[0]];r=r.concat(s)}return r}}},2730:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getClampedGeoRect=t.harpToHGeoPolygon=t.harpGeoBoxToHGeoRect=t.hGeoRectToHarpGeoBox=t.getHarpBoundingBox=t.hToHarpGeoPolygon=void 0;const n=i(6482),r=i(4860),s=i(3068),o=i(82);function a(e){return new s.GeoBox(new r.GeoCoordinates(e.getBottom(),e.getLeft()),new r.GeoCoordinates(e.getTop(),e.getRight()))}function l(e){const t=[];e.push(e[0]);const i=e.length;for(let n=0;n<i-1;n++){const i=e[n],s=e[n+1];if(t.push(i),Math.abs(s.longitude-i.longitude)>=180){const e=(i.latitude+s.latitude)/2,n=(i.longitude+s.longitude)/2,o=(i.altitude+s.altitude)/2;t.push(new r.GeoCoordinates(e,n,o||void 0))}}return t.length!==e.length-1?l(t):t}t.hToHarpGeoPolygon=function(e){const t=[];if(e.getExterior().eachLatLngAlt(((e,i,n)=>{t.push(new r.GeoCoordinates(e,i,n))})),t.length>2)return new n.GeoPolygon(t,!0)},t.getHarpBoundingBox=function(e){return a(e.getBoundingBox())},t.hGeoRectToHarpGeoBox=a,t.harpGeoBoxToHGeoRect=function(e){return H.geo.Rect.fromPoints({lat:e.north,lng:e.west},{lat:e.south,lng:e.east})},t.harpToHGeoPolygon=function(e){if(void 0===e)return;const t=[];return l(e.coordinates).map((e=>{t.push(e.latitude,e.longitude,e.altitude)})),new H.geo.Polygon(new H.geo.LineString(t))},t.getClampedGeoRect=function(e,t){const i=function(e){const t=Math.pow(2,e.level)-1;return{row:e.row===t,column:e.column===t}}(t);return new H.geo.Rect(0===t.row?90:o.MathUtils.clamp(e.north,-90,90),o.MathUtils.clamp(e.west,-180,180),i.row?-90:o.MathUtils.clamp(e.south,-90,90),i.column?180:o.MathUtils.clamp(e.east,-180,180))}},9070:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Animation=void 0;const n=i(3977),r=i(4954);t.Animation=class{constructor(e,t,i){this.mapView=e,this.duration=t,this.updateCallback=i,this.running=!1,this.m_lastFrameTime=0,this.m_startTime=0,this.m_animateCb=e=>{this.animate(e.time<this.m_startTime?r.PerformanceTimer.now():e.time)}}start(e,t){if(!this.running)return this.running=!0,this.onFinished=t,this.mapView.addEventListener(n.MapViewEventNames.Render,this.m_animateCb),this.mapView.beginAnimation(),this.m_startTime=null!=e?e:r.PerformanceTimer.now(),this.m_lastFrameTime=this.m_startTime,this}stop(e=!1){this.running&&(this.running=!1,this.mapView.endAnimation(),this.mapView.removeEventListener(n.MapViewEventNames.Render,this.m_animateCb),void 0===this.onFinished||e||this.onFinished())}animate(e){const t=e-this.m_startTime,i=e-this.m_lastFrameTime;let n=t/this.duration;(0===this.duration||n>1)&&(n=1),this.m_lastFrameTime=e,this.update(n,t,i,e),n>=1&&this.stop()}update(e,t,i,n){void 0!==this.updateCallback&&this.updateCallback(e,t,i,n)}}},8806:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChangeRate=t.ControlUtils=t.AnimationUpdateEvent=void 0,t.AnimationUpdateEvent="animation-update";class i extends H.util.EventTarget{constructor(){super(),this.atX=void 0,this.atY=void 0,this.m_isRunning=!1,this.reset()}start(e,t){this.m_isRunning&&this.reset(),e===+e&&t===+t&&(this.atX=e,this.atY=t),this.m_isRunning=!0}reset(){this.m_isRunning=!1,this.atX=this.atY=void 0,this.m_changeRate=new r(0,0,0,0,0,0)}set(e,t,i,s,o,a){if(e/=1e3,t/=1e3,i/=1e3,s/=1e3,o/=1e3,a/=1e3,this.isRunning()){const l=new r(e,t,i,s,o,a);this.m_changeRate.equals(l)||(this.m_changeRate=l,this.dispatchEvent(new n(this.getChangeRate())))}}isRunning(){return this.m_isRunning}getChangeRate(){return this.m_changeRate}}t.ControlUtils=i;class n extends H.util.Event{constructor(e){super(t.AnimationUpdateEvent),this.changeRate=e,this.changeRate=e}}class r{constructor(e,t,i,n,r,s){this.moveX=e,this.moveY=t,this.moveZ=i,this.rotateX=n,this.rotateY=r,this.rotateZ=s,this.moveX=e,this.moveY=t,this.moveZ=i,this.rotateX=n,this.rotateY=r,this.rotateZ=s}equals(e){return this.moveX===e.moveX&&this.moveY===e.moveY&&this.moveZ===e.moveZ&&this.rotateX===e.rotateX&&this.rotateY===e.rotateY&&this.rotateZ===e.rotateZ}hasValue(){return 0!==this.moveX||0!==this.moveY||0!==this.moveZ||0!==this.rotateX||0!==this.rotateY||0!==this.rotateZ}}t.ChangeRate=r},4262:(e,t)=>
950{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,i=0){let n,r;return function(){const s=this,o=arguments;function a(){r=0,e.apply(s,o)}clearTimeout(n),r>0&&i&&Date.now()-r>=i?a():(void 0===r&&(r=Date.now()),n=setTimeout((()=>a()),t))}}}},__webpack_module_cache__={};function __nested_webpack_require_3351421__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var i=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e].call(i.exports,i,i.exports,__nested_webpack_require_3351421__),i.exports}__nested_webpack_require_3351421__.d=(e,t)=>{for(var i in t)__nested_webpack_require_3351421__.o(t,i)&&!__nested_webpack_require_3351421__.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},__nested_webpack_require_3351421__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__nested_webpack_require_3351421__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__nested_webpack_require_3351421__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __nested_webpack_exports__={};(()=>{"use strict";const e=__nested_webpack_require_3351421__(8935),t=__nested_webpack_require_3351421__(9636),i=__nested_webpack_require_3351421__(5234);self.H.map.render.harp={RenderEngine:e.RenderEngine,ProjectionType:i.ProjectionType,Style:t.Style}})()})();}).call(self); 951/* unused harmony default export */ var __WEBPACK_DEFAULT_EXPORT__ = (H); 952 953/***/ } 954 955/******/ }); 956/************************************************************************/ 957/******/ // The module cache 958/******/ var __webpack_module_cache__ = {}; 959/******/ 960/******/ // The require function 961/******/ function __webpack_require__(moduleId) { 962/******/ // Check if module is in cache 963/******/ var cachedModule = __webpack_module_cache__[moduleId]; 964/******/ if (cachedModule !== undefined) { 965/******/ return cachedModule.exports; 966/******/ } 967/******/ // Create a new module (and put it into the cache) 968/******/ var module = __webpack_module_cache__[moduleId] = { 969/******/ // no module.id needed 970/******/ // no module.loaded needed 971/******/ exports: {} 972/******/ }; 973/******/ 974/******/ // Execute the module function 975/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); 976/******/ 977/******/ // Return the exports of the module 978/******/ return module.exports; 979/******/ } 980/******/ 981/************************************************************************/ 982/* harmony import */ var _here_maps_api_for_javascript_bin_mapsjs_bundle_harp_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(315); 983 984 985/******/ })() 986;
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.